diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 854db6b123..a777fdbba1 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -8439,7 +8439,20 @@ (all-off 0) (course-spots 1) (task-spots 2) - (all-on 3)) + (all-on 3) + (bmc04 4) + (bmc05 5) + (bmc06 6) + (bmc07 7) + (bmc08 8) + (bmc09 9) + (bmc10 10) + (bmc11 11) + (bmc12 12) + (bmc13 13) + (bmc14 14) + (bmc15 15) + (bmc16 16)) ;; ---main-h:bot-marks-controls (define-extern *display-bot-marks* bot-marks-controls) @@ -32606,7 +32619,7 @@ (jump-dest vector :inline :offset 368) (focus enemy-focus :inline :offset-assert 384) (incoming enemy-attack-info :inline :offset-assert 416) - (actor-group (pointer actor-group) :offset-assert 480) + (actor-group (pointer actor-group) :offset-assert 480) (actor-group-count int32 :offset-assert 484) (neck joint-mod :offset-assert 488) (on-notice symbol :offset-assert 492) @@ -38526,28 +38539,29 @@ ;; ai-task-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(declare-type ai-task-pool basic) +(declare-type bot nav-enemy) + (deftype ai-task (basic) - ((next basic :offset-assert 4) - (prev basic :offset-assert 8) - (pool basic :offset-assert 12) - (unique-id uint32 :offset-assert 16) - (pad-ik1n231 uint32 3 :offset-assert 20) - (bytes int8 16 :offset-assert 32) + ((next ai-task :offset-assert 4) + (prev ai-task :offset-assert 8) + (pool ai-task-pool :offset-assert 12) + (unique-id uint32 :offset-assert 16) + (bytes uint8 16 :offset 32) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (ai-task-method-9 () none 9) - (ai-task-method-10 () none 10) - (ai-task-method-11 () none 11) + (reset-task! "Virtual" (_type_) none 9) + (ai-task-method-10 "Virtual" (_type_ bot) none 10) + (ai-task-method-11 "Virtual" (_type_ bot) none 11) ) ) -#| (deftype ai-task-pool (basic) - ((anchor basic :offset-assert 4) - (tasks uint32 :offset-assert 8) + ((anchor ai-task :offset-assert 4) + (tasks (pointer uint32) :offset-assert 8) ;; this is VERY likely an (inline-array ai-task), but the static data for *bot-task-pool* has no type pointers (tasks-length uint32 :offset-assert 12) (unique-id uint32 :offset-assert 16) ) @@ -38555,34 +38569,33 @@ :size-assert #x14 :flag-assert #xc00000014 (:methods - (ai-task-pool-method-9 () none 9) - (ai-task-pool-method-10 () none 10) - (ai-task-pool-method-11 () none 11) + (assign-ids! "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" (_type_ type) ai-task 9) + (set-next-task! "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." (_type_ ai-task) none 10) + (ai-task-pool-method-11 (_type_) ai-task 11) ) ) -|# -#| + (deftype ai-task-control (basic) - ((anchor basic :offset-assert 4) - (pool basic :offset-assert 8) + ((anchor ai-task :offset-assert 4) + (pool ai-task-pool :offset-assert 8) ) :method-count-assert 18 :size-assert #xc :flag-assert #x120000000c (:methods - (ai-task-control-method-9 () none 9) - (ai-task-control-method-10 () none 10) - (ai-task-control-method-11 () none 11) - (ai-task-control-method-12 () none 12) - (ai-task-control-method-13 () none 13) - (ai-task-control-method-14 () none 14) - (ai-task-control-method-15 () none 15) - (ai-task-control-method-16 () none 16) - (ai-task-control-method-17 () none 17) + (new (symbol type ai-task-pool) _type_ 0) + (ai-task-control-method-9 (_type_) none 9) + (ai-task-control-method-10 (_type_ bot) none 10) + (get-task-by-type (_type_ type bot) ai-task 11) + (ai-task-control-method-12 (_type_ bot) symbol 12) + (ai-task-control-method-13 (_type_ ai-task bot) ai-task 13) + (ai-task-control-method-14 (_type_ ai-task bot) none 14) + (init-task! "Initialize a task of the given type in the [[ai-task-control]]'s pool." (_type_ type bot) ai-task 15) + (set-next-task-for-pool! (_type_ ai-task) none 16) + (set-next-task! "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." (_type_ ai-task) none 17) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -38591,13 +38604,13 @@ (deftype bot-focus-info (structure) ((max-los-dist float :offset-assert 0) - (fproc basic :offset-assert 4) + (fproc process-focusable :offset-assert 4) (bullseye-xz-dist float :offset-assert 8) (ry-diff float :offset-assert 12) (my-facing-ry float :offset-assert 16) (bullseye-ry float :offset-assert 20) (los int8 :offset-assert 24) - (update-time time-frame :offset-assert 32) + (update-time time-frame :offset-assert 32) (bullseye vector :inline :offset-assert 48) (pos vector :inline :offset-assert 64) (my-facing-xz-dir vector :inline :offset-assert 80) @@ -38608,7 +38621,6 @@ :flag-assert #x900000070 ) -#| (deftype bot-turn-info (structure) ((facing-ry float :offset-assert 0) (targ-ry float :offset-assert 4) @@ -38624,34 +38636,51 @@ :size-assert #x60 :flag-assert #x900000060 ) -|# -#| (deftype bot-speech-tuning (structure) ((fo-min int32 :offset-assert 0) (fo-max int32 :offset-assert 4) (fo-curve int8 :offset-assert 8) - (trans? basic :offset-assert 12) + (trans? symbol :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| +;; +++bot-h:speech-flags +(defenum speech-flags + :type uint16 + :bitfield #t + (playing) + (sf01) + (sf02) + (sf03) + (sf04) + (sf05) + (sf06) + (sf08) + (sf09) + (sf10) + (sf11) + (sf12) + (sf13) + (sf14) + (sf15) + ) +;; ---bot-h:speech-flags + (deftype bot-speech-info (structure) - ((flags uint16 :offset-assert 0) + ((flags speech-flags :offset-assert 0) (hold-time uint16 :offset-assert 2) (slave-id int8 :offset-assert 4) (tuning-id int8 :offset-assert 5) - (name basic :offset-assert 8) + (name string :offset-assert 8) ) :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# (deftype bot-spot (structure) ((center vector :inline :offset-assert 0) @@ -38666,15 +38695,14 @@ :flag-assert #x900000014 ) -#| (deftype bot-waypoint (basic) ((waypoint-id int16 :offset-assert 4) (nav-mesh-index int8 :offset-assert 6) (skip-to int8 :offset-assert 7) - (on-set basic :offset-assert 8) - (on-update basic :offset-assert 12) - (on-skipping-here basic :offset-assert 16) - (check-too-far basic :offset-assert 20) + (on-set (function bot none) :offset-assert 8) + (on-update (function bot none) :offset-assert 12) + (on-skipping-here (function bot none) :offset-assert 16) + (check-too-far symbol :offset-assert 20) (warn-dist float :offset-assert 24) (fail-dist-delta float :offset-assert 28) ) @@ -38683,22 +38711,23 @@ :flag-assert #x900000020 ;; field check-too-far uses ~A with a signed load ) -|# +(declare-type bot-speech-list basic) +(declare-type bot-speech-list-shuffle bot-speech-list) (deftype bot-course (basic) - ((course-id uint8 :offset-assert 4) - (speech-count uint16 :offset-assert 6) - (spot-count uint16 :offset-assert 8) - (retry-cookie uint8 :offset-assert 10) - (too-far-warn-speeches basic :offset-assert 12) - (too-far-fail-speeches basic :offset-assert 16) - (attack-player-speeches basic :offset-assert 20) - (default-check-too-far basic :offset-assert 24) - (waypoints basic :offset-assert 28) - (speeches uint32 :offset-assert 32) - (speech-tunings uint32 :offset-assert 36) - (dirs uint32 :offset-assert 40) - (spots uint32 :offset-assert 44) + ((course-id uint8 :offset-assert 4) + (speech-count uint16 :offset-assert 6) + (spot-count uint16 :offset-assert 8) + (retry-cookie uint8 :offset-assert 10) + (too-far-warn-speeches bot-speech-list-shuffle :offset-assert 12) + (too-far-fail-speeches bot-speech-list-shuffle :offset-assert 16) + (attack-player-speeches bot-speech-list :offset-assert 20) + (default-check-too-far symbol :offset-assert 24) + (waypoints (array bot-waypoint) :offset-assert 28) + (speeches (inline-array bot-speech-info) :offset-assert 32) + (speech-tunings (inline-array bot-speech-tuning) :offset-assert 36) + (dirs (inline-array vector) :offset-assert 40) + (spots (inline-array bot-spot) :offset-assert 44) ) :method-count-assert 9 :size-assert #x30 @@ -38706,8 +38735,47 @@ ;; field default-check-too-far uses ~A with a signed load ) +;; +++bot-h:bot-flags +(defenum bot-flags + :type uint32 + :bitfield #t + (bf00 0) + (failed 1) + (bf02 2) + (bf03 3) + (bf04 4) + (bf05 5) + (bf06 6) + (attacked 7) + (too-far-fail 8) ;; not sure + (bf09 9) + (bf10 10) + (bf11 11) + (bf12 12) + (bf13 13) + (bf14 14) + (bf15 15) + (bf16 16) + (bf17 17) + (bf18 18) + (bf19 19) + (bf20 20) + (bf21 21) + (bf22 22) + (bf23 23) + (bf24 24) + (bf25 25) + (bf26 26) + (bf27 27) + (bf28 28) + (bf29 29) + (bf30 30) + (bf31 31) + ) +;; ---bot-h:bot-flags + (deftype bot (nav-enemy) - ((bot-flags uint32 :offset-assert 604) + ((bot-flags bot-flags :offset-assert 604) (min-speed float :offset-assert 608) (max-speed float :offset-assert 612) (follow-offset float :offset-assert 616) @@ -38718,9 +38786,9 @@ (travel-prev-ry float :offset-assert 636) (travel-prev-ry1 float :offset-assert 640) (player-blocking float :offset-assert 644) - (ai-ctrl basic :offset-assert 648) - (course basic :offset-assert 652) - (waypoint basic :offset-assert 656) + (ai-ctrl ai-task-control :offset-assert 648) + (course bot-course :offset-assert 652) + (waypoint bot-waypoint :offset-assert 656) (waypoint-bits uint32 :offset-assert 660) (waypoint-int32a int32 :offset-assert 664) (bot-task-bits uint32 :offset-assert 668) @@ -38741,21 +38809,21 @@ (slave-id int8 :offset-assert 712) (vehicle-seat-index int8 :offset-assert 713) (bot-health-index int8 :offset-assert 714) - (task basic :offset-assert 716) - (swivel-joint-mod basic :offset-assert 720) - (health-handle uint64 :offset-assert 728) - (poi-handle uint64 :offset-assert 736) - (my-simple-focus uint32 :offset-assert 744) - (attacker-handle uint64 :offset-assert 752) - (scene-player-handle uint64 :offset-assert 760) - (master-handle uint64 :offset-assert 768) - (vehicle-handle uint64 :offset-assert 776) - (hit-invuln-starting-time time-frame :offset-assert 784) - (danger-time time-frame :offset-assert 792) - (attacker-time time-frame :offset-assert 800) - (started-warning-time time-frame :offset-assert 808) - (waypoint-time0 uint64 :offset-assert 816) - (next-too-far-warn-time time-frame :offset-assert 824) + (task game-task-control :offset-assert 716) + (swivel-joint-mod joint-mod :offset-assert 720) + (health-handle handle :offset-assert 728) + (poi-handle handle :offset-assert 736) + (my-simple-focus (pointer simple-focus) :offset-assert 744) + (attacker-handle handle :offset-assert 752) + (scene-player-handle handle :offset-assert 760) + (master-handle handle :offset-assert 768) + (vehicle-handle handle :offset-assert 776) + (hit-invuln-starting-time time-frame :offset-assert 784) + (danger-time time-frame :offset-assert 792) + (attacker-time time-frame :offset-assert 800) + (started-warning-time time-frame :offset-assert 808) + (waypoint-time0 time-frame :offset-assert 816) + (next-too-far-warn-time time-frame :offset-assert 824) (spot bot-spot :inline :offset-assert 832) (follow-dir vector :inline :offset-assert 864) (focus-info bot-focus-info :inline :offset-assert 880) @@ -38764,74 +38832,74 @@ :size-assert #x3e0 :flag-assert #xe1036003e0 (:methods - (bot-method-178 () none 178) - (bot-method-179 () none 179) - (bot-method-180 () none 180) - (bot-method-181 () none 181) - (bot-method-182 () none 182) - (bot-method-183 () none 183) - (bot-method-184 () none 184) - (bot-method-185 () none 185) - (bot-method-186 () none 186) - (bot-method-187 () none 187) - (bot-method-188 () none 188) - (bot-method-189 () none 189) - (bot-method-190 () none 190) - (bot-method-191 () none 191) - (bot-method-192 () none 192) - (bot-method-193 () none 193) - (bot-method-194 () none 194) - (bot-method-195 () none 195) - (bot-method-196 () none 196) - (bot-method-197 () none 197) - (bot-method-198 () none 198) - (bot-method-199 () none 199) - (bot-method-200 () none 200) - (bot-method-201 () none 201) - (bot-method-202 () none 202) - (bot-method-203 () none 203) - (bot-method-204 () none 204) - (bot-method-205 () none 205) - (bot-method-206 () none 206) - (bot-method-207 () none 207) - (bot-method-208 () none 208) - (bot-method-209 () none 209) - (bot-method-210 () none 210) - (bot-method-211 () none 211) - (bot-method-212 () none 212) - (bot-method-213 () none 213) - (bot-method-214 () none 214) - (bot-method-215 () none 215) - (bot-method-216 () none 216) - (bot-method-217 () none 217) - (bot-method-218 () none 218) - (bot-method-219 () none 219) - (bot-method-220 () none 220) - (bot-method-221 () none 221) - (bot-method-222 () none 222) - (bot-method-223 () none 223) - (bot-method-224 () none 224) + (failed () _type_ :state 178) + (hidden () _type_ :state 179) + (clear-poi-and-focus! "Clear our point of interest and focus handles." (_type_) none 180) + (bot-method-181 (_type_ vector vector vector vector vector float) none 181) + (turn-to-target (_type_ bot-turn-info process-focusable float) none 182) + (alive? (_type_) symbol 183) + (bot-debug-draw-spot-id (_type_) none 184) + (bot-debug-draw-sphere (_type_ vector rgba) none 185) + (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none 186) + (reset-attacker! (_type_) none 187) + (scene-release? (_type_) symbol 188) + (select-focus! "Find enemies around our `notice-enemy-dist` and choose a target." (_type_) process 189) + (bot-method-190 (_type_) symbol 190) + (bot-method-191 (_type_) none 191) + (bot-method-192 (_type_) none 192) + (bot-method-193 (_type_) symbol 193) + (outside-spot-radius? "Are we outside of the given [[bot-spot]] radius?" (_type_ bot-spot vector symbol) symbol 194) + (attacked-by-player? "Were we attacked by the player?" (_type_ process-focusable) symbol 195) + (bot-method-196 (_type_) none 196) + (fail-mission! (_type_) none 197) + (set-cam-height! (_type_ vector) meters 198) + (cam-move-to-bot (_type_) none 199) + (fail-falling (_type_) none 200) + (set-next-focus! (_type_ enemy enemy-best-focus) none 201) + (choose-spot "Choose the closest [[bot-spot]] that is not blocked by the player." (_type_ int (pointer uint)) int 202) + (play-attacked-speech (_type_) none 203) + (play-too-far-warn-speech (_type_) symbol 204) + (scene-play "Spawn a [[scene-player]] process for the given scene." (_type_ string symbol) symbol 205) + (play-speech (_type_ int) none 206) + (play-death-sound "Play one of our death sounds." (_type_ string) none 207) + (bot-method-208 (_type_) symbol 208) + (channel-active? "Is the given [[gui-channel]] active?" (_type_ uint) symbol 209) + (init! "Set defaults for various fields." (_type_) none 210) + (clear-speech-flags! "Clear the `playing` flag for all of our speeches." (_type_) none 211) + (reset-warn-time! (_type_) none 212) + (go-to-waypoint! "Start moving to the given [[bot-waypoint]]." (_type_ int symbol) object 213) + (bot-method-214 (_type_) symbol 214) + (skip-waypoint (_type_) none 215) + (bot-method-216 (_type_) none 216) + (speech-ended? "Is the given speech active?" (_type_ int) symbol 217) + (speech-playing? "Is the given speech playing?" (_type_ int) symbol 218) + (player-blocking-spot? (_type_ bot-spot) symbol 219) + (stop-speech (_type_ uint symbol) none 220) + (bot-method-221 (_type_) quaternion 221) + (bot-method-222 (_type_ vector) none 222) + (bot-method-223 (_type_ symbol) none 223) + (bot-check-too-far + "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. + If the player is too far, play a warning speech." + (_type_) symbol 224) ) ) -#| (deftype bot-speech-list (basic) - ((flags uint8 :offset-assert 4) - (retry-cookie uint8 :offset-assert 5) - (last-local-index int16 :offset-assert 6) - (speech-indexes basic :offset-assert 8) + ((flags uint8 :offset-assert 4) + (retry-cookie uint8 :offset-assert 5) + (last-local-index int16 :offset-assert 6) + (speech-indexes (array int16) :offset-assert 8) ) :method-count-assert 11 :size-assert #xc :flag-assert #xb0000000c (:methods - (bot-speech-list-method-9 () none 9) - (bot-speech-list-method-10 () none 10) + (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int 9) + (reset-index (_type_ symbol) none 10) ) ) -|# -#| (deftype bot-speech-list-shuffle (bot-speech-list) ((history-mask uint64 :offset-assert 16) (history-mask-full uint64 :offset-assert 24) @@ -38842,27 +38910,24 @@ (:methods ) ) -|# -#| (deftype bot-course-table (basic) - ((course UNKNOWN 18 :offset-assert 4) + ((course bot-course 18 :offset-assert 4) ) :method-count-assert 9 :size-assert #x4c :flag-assert #x90000004c ) -|# -;; (define-extern *bot-task-pool* ai-task-pool) -;; (define-extern *bot-course-table* bot-course-table) +(define-extern *bot-task-pool* ai-task-pool) +(define-extern *bot-course-table* bot-course-table) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern bot-simple-check-too-far function) -;; (define-extern bot-check-too-far-always-okay function) +(define-extern bot-simple-check-too-far (function bot int)) +(define-extern bot-check-too-far-always-okay (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bot-states ;; @@ -38878,19 +38943,20 @@ (level float :offset-assert 4) (min-level float :offset-assert 8) (charge-speed float :offset-assert 12) - (powerup-sound-id uint32 :offset-assert 16) - (plasma-sound-id uint32 :offset-assert 20) + (powerup-sound-id sound-id :offset-assert 16) + (plasma-sound-id sound-id :offset-assert 20) ) :method-count-assert 15 + :pack-me :size-assert #x18 :flag-assert #xf00000018 (:methods - (sig-plasma-method-9 () none 9) - (sig-plasma-method-10 () none 10) - (sig-plasma-method-11 () none 11) - (sig-plasma-method-12 () none 12) - (sig-plasma-method-13 () none 13) - (sig-plasma-method-14 () none 14) + (sig-plasma-method-9 (_type_) none 9) + (sig-plasma-method-10 (_type_) symbol 10) + (sig-plasma-method-11 (_type_ symbol) none 11) + (sig-plasma-method-12 (_type_) none 12) + (sig-plasma-method-13 (_type_) symbol 13) + (sig-plasma-method-14 (_type_ process-focusable) none 14) ) ) @@ -38921,68 +38987,65 @@ :flag-assert #x90000000c ) -#| (deftype sig (bot) - ((fired-gun-count uint32 :offset-assert 988) - (sig-path basic :offset-assert 992) - (sig-path-clock basic :offset-assert 996) - (travel-anim-interp float :offset-assert 1000) - (platform-index uint8 :offset-assert 1004) - (played-unjam-time time-frame :offset-assert 1012) - (sig-path-start-time time-frame :offset-assert 1020) - (sig-path-cur-time time-frame :offset-assert 1028) - (sig-path-prev-time time-frame :offset-assert 1036) - (plasma sig-plasma :inline :offset-assert 1044) - (sig-path-prev-pos vector :inline :offset-assert 364) + ((fired-gun-count uint32 :offset-assert 992) + (sig-path sig-path :offset-assert 996) + (sig-path-clock clock :offset-assert 1000) + (travel-anim-interp float :offset-assert 1004) + (platform-index uint8 :offset-assert 1008) + (played-unjam-time time-frame :offset-assert 1016) + (sig-path-start-time time-frame :offset-assert 1024) + (sig-path-cur-time time-frame :offset-assert 1032) + (sig-path-prev-time time-frame :offset-assert 1040) + (plasma sig-plasma :inline :offset 1048) + (sig-path-prev-pos vector :inline :offset 368) ) :method-count-assert 259 :size-assert #x430 :flag-assert #x10303b00430 (:methods - (sig-method-225 () none 225) - (sig-method-226 () none 226) - (sig-method-227 () none 227) - (sig-method-228 () none 228) - (sig-method-229 () none 229) - (sig-method-230 () none 230) - (sig-method-231 () none 231) - (sig-method-232 () none 232) - (sig-method-233 () none 233) - (sig-method-234 () none 234) - (sig-method-235 () none 235) - (sig-method-236 () none 236) - (sig-method-237 () none 237) - (sig-method-238 () none 238) - (sig-method-239 () none 239) - (sig-method-240 () none 240) - (sig-method-241 () none 241) - (sig-method-242 () none 242) - (sig-method-243 () none 243) - (sig-method-244 () none 244) - (sig-method-245 () none 245) - (sig-method-246 () none 246) - (sig-method-247 () none 247) - (sig-method-248 () none 248) - (sig-method-249 () none 249) - (sig-method-250 () none 250) - (sig-method-251 () none 251) - (sig-method-252 () none 252) - (sig-method-253 () none 253) - (sig-method-254 () none 254) - (sig-method-255 () none 255) - (sig-method-256 () none 256) - (sig-method-257 () none 257) - (sig-method-258 () none 258) + (whip () _type_ :state 225) + (blast () _type_ :state 226) + (chase () _type_ :state 227) + (chase-attack () _type_ :state 228) + (traveling () _type_ :state 229) + (traveling-blocked () _type_ :state 230) + (waiting-far () _type_ :state 231) + (waiting-close () _type_ :state 232) + (waiting-turn () _type_ :state 233) + (waiting-crouched () _type_ :state 234) + (charge-plasma () _type_ :state 235) + (gun-jam () _type_ :state 236) + (repair-gun () _type_ :state 237) + (clean-gun () _type_ :state 238) + (sig-path-run () _type_ :state 239) + (sig-path-jump () _type_ :state 240) + (sig-path-jump-land () _type_ :state 241) + (sig-path-shoot-jump () _type_ :state 242) + (sig-path-shoot-jump-land () _type_ :state 243) + (sig-path-idle () _type_ :state 244) + (sig-method-245 (_type_) symbol 245) + (sig-method-246 (_type_) symbol 246) + (fire-gun "Increase gun fired counter and spawn projectile." (_type_ vector) (pointer process) 247) + (sig-method-248 (_type_ sig-path-sample) none 248) + (sig-method-249 (_type_ sig-path) none 249) + (sig-method-250 (_type_) symbol 250) + (sig-method-251 (_type_) symbol 251) + (sig-method-252 (_type_) symbol 252) + (sig-method-253 (_type_) none 253) + (sig-method-254 (_type_) symbol 254) + (sig-method-255 (_type_) symbol 255) + (sig-method-256 (_type_) none 256) + (sig-method-257 (_type_) symbol 257) + (sig-method-258 (_type_) none 258) ) ) -|# -#| (deftype sigt-wait-spot (ai-task) - ((check-done basic :offset-assert 32) - (which-spot int8 :offset-assert 36) - (num-spots uint8 :offset-assert 37) - (spot-indexes UNKNOWN 6 :offset-assert 38) + ((check-done (function sigt-wait-spot sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 6 :offset 38) ) :method-count-assert 12 :size-assert #x30 @@ -38990,50 +39053,44 @@ (:methods ) ) -|# -#| (deftype sigt-choose-piston (ai-task) - ((check-done basic :offset-assert 32) - (which-spot int8 :offset-assert 36) - (num-spots uint8 :offset-assert 37) - (spot-indexes UNKNOWN 4 :offset-assert 38) - (actor-indexes UNKNOWN 4 :offset-assert 42) + ((check-done (function sigt-choose-piston sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + (actor-indexes uint8 4 :offset 42) ) :method-count-assert 15 :size-assert #x30 :flag-assert #xf00000030 (:methods - (sigt-choose-piston-method-12 () none 12) - (sigt-choose-piston-method-13 () none 13) - (sigt-choose-piston-method-14 () none 14) + (sigt-choose-piston-method-12 (_type_ sig) symbol 12) + (sigt-choose-piston-method-13 (_type_ sig) none 13) + (sigt-choose-piston-method-14 (_type_ sig int) symbol 14) ) ) -|# -#| (deftype sigt-riding-piston (ai-task) - ((check-done basic :offset-assert 32) - (which-spot int8 :offset-assert 36) - (num-spots uint8 :offset-assert 37) - (spot-indexes UNKNOWN 4 :offset-assert 38) + ((check-done (function sigt-riding-piston sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) ) :method-count-assert 13 :size-assert #x30 :flag-assert #xd00000030 (:methods - (sigt-riding-piston-method-12 () none 12) + (sigt-riding-piston-method-12 (_type_ sig) symbol 12) ) ) -|# -#| (deftype sigt-charge-plasma (ai-task) - ((check-done basic :offset-assert 32) - (which-spot int8 :offset-assert 36) - (num-spots uint8 :offset-assert 37) - (spot-indexes UNKNOWN 4 :offset-assert 38) - (actor-index uint8 :offset-assert 42) + ((check-done (function sigt-charge-plasma sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + (actor-index uint8 :offset 42) ) :method-count-assert 12 :size-assert #x30 @@ -39041,9 +39098,7 @@ (:methods ) ) -|# -#| (deftype sigt-fight-focus (ai-task) () :method-count-assert 12 @@ -39052,9 +39107,7 @@ (:methods ) ) -|# -#| (deftype sigt-repair-gun (ai-task) () :method-count-assert 12 @@ -39063,7 +39116,6 @@ (:methods ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -39075,10 +39127,9 @@ ;; sig-shot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sig-shot (projectile) - ((tail-pos vector :inline :offset-assert 476) - (hit-pos vector :inline :offset-assert 492) + ((tail-pos vector :inline :offset-assert 480) + (hit-pos vector :inline :offset-assert 496) ) :method-count-assert 40 :size-assert #x200 @@ -39086,43 +39137,39 @@ (:methods ) ) -|# -;; (define-extern sig-shot-move function) +(define-extern sig-shot-move (function sig-shot none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sig-plasma ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern sparticle-sig-plasma-lightning function) +(define-extern sparticle-sig-plasma-lightning (function sparticle-system sparticle-cpuinfo vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sig ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sig-anim-info (structure) ((anim-index int32 :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype sig-global-info (basic) ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim UNKNOWN 3 :offset-assert 8) + (blue-hit-anim sig-anim-info 3 :inline :offset-assert 8) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -;; (define-extern *sig-global-info* sig-global-info) -;; (define-extern *sig-nav-enemy-info* nav-enemy-info) +(define-extern *sig-global-info* sig-global-info) +(define-extern *sig-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sig-states ;; @@ -39133,67 +39180,63 @@ ;; ash-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ashelin-course (bot-course) - ((ouch-speeches basic :offset-assert 48) - (victory-speeches basic :offset-assert 52) + ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) + (victory-speeches bot-speech-list-shuffle :offset-assert 52) ) :method-count-assert 9 :size-assert #x38 :flag-assert #x900000038 ;; field default-check-too-far uses ~A with a signed load ) -|# -#| (deftype ashelin (bot) - ((knocked-anim basic :offset-assert 988) - (travel-anim-interp float :offset-assert 992) - (fired-gun-count uint32 :offset-assert 996) - (last-fire-time time-frame :offset-assert 1004) - (victory-speech-time time-frame :offset-assert 1012) - (frontline plane :inline :offset-assert 1020) + ((ash-course ashelin-course :offset 652 :score 1) ;; added, overrides course field + (knocked-anim art-joint-anim :offset-assert 992) + (travel-anim-interp float :offset-assert 996) + (fired-gun-count uint32 :offset-assert 1000) + (last-fire-time time-frame :offset-assert 1008) + (victory-speech-time time-frame :offset-assert 1016) + (frontline plane :inline :offset-assert 1024) ) :method-count-assert 251 :size-assert #x410 :flag-assert #xfb03900410 (:methods - (ashelin-method-225 () none 225) - (ashelin-method-226 () none 226) - (ashelin-method-227 () none 227) - (ashelin-method-228 () none 228) - (ashelin-method-229 () none 229) - (ashelin-method-230 () none 230) - (ashelin-method-231 () none 231) - (ashelin-method-232 () none 232) - (ashelin-method-233 () none 233) - (ashelin-method-234 () none 234) - (ashelin-method-235 () none 235) - (ashelin-method-236 () none 236) - (ashelin-method-237 () none 237) - (ashelin-method-238 () none 238) - (ashelin-method-239 () none 239) - (ashelin-method-240 () none 240) - (ashelin-method-241 () none 241) - (ashelin-method-242 () none 242) - (ashelin-method-243 () none 243) - (ashelin-method-244 () none 244) - (ashelin-method-245 () none 245) - (ashelin-method-246 () none 246) - (ashelin-method-247 () none 247) - (ashelin-method-248 () none 248) - (ashelin-method-249 () none 249) - (ashelin-method-250 () none 250) + (back-spring () _type_ :state 225) + (cartwheel-left () _type_ :state 226) + (tumble-right () _type_ :state 227) + (chase () _type_ :state 228) + (traveling () _type_ :state 229) + (traveling-blocked () _type_ :state 230) + (waiting-idle () _type_ :state 231) + (standing-idle () _type_ :state 232) + (standing-turn () _type_ :state 233) + (standing-blast () _type_ :state 234) + (ashelin-method-235 (_type_ symbol) symbol 235) + (ashelin-method-236 (_type_ vector float float float float) symbol 236) + (fire-projectile (_type_ vector) none 237) + (ashelin-method-238 (_type_ symbol symbol) symbol 238) + (ashelin-method-239 (_type_) none 239) + (ashelin-method-240 (_type_ int) none 240) + (ashelin-method-241 (_type_) int 241) + (ashelin-method-242 (_type_) int 242) + (ashelin-method-243 (_type_ float) int 243) + (ashelin-method-244 (_type_) none 244) + (ashelin-method-245 (_type_) none 245) + (ashelin-method-246 (_type_) int 246) + (ashelin-method-247 (_type_) symbol 247) + (ashelin-method-248 (_type_) symbol 248) + (ashelin-method-249 (_type_) none 249) + (ashelin-method-250 (_type_ symbol) none 250) ) ) -|# -#| (deftype asht-wait-spot (ai-task) - ((check-done basic :offset-assert 32) - (which-spot int8 :offset-assert 36) - (num-spots uint8 :offset-assert 37) - (spot-indexes UNKNOWN 6 :offset-assert 38) + ((check-done (function asht-wait-spot ashelin symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 6 :offset 38) ) :method-count-assert 12 :size-assert #x30 @@ -39201,9 +39244,7 @@ (:methods ) ) -|# -#| (deftype asht-fight-focus (ai-task) () :method-count-assert 12 @@ -39212,8 +39253,6 @@ (:methods ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash-task ;; @@ -39224,10 +39263,9 @@ ;; ash-shot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ashelin-shot (projectile) - ((tail-pos vector :inline :offset-assert 476) - (hit-pos vector :inline :offset-assert 492) + ((tail-pos vector :inline :offset-assert 480) + (hit-pos vector :inline :offset-assert 496) ) :method-count-assert 40 :size-assert #x200 @@ -39235,38 +39273,34 @@ (:methods ) ) -|# -;; (define-extern ashelin-shot-move function) +(define-extern ashelin-shot-move (function ashelin-shot none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ashelin-anim-info (structure) ((anim-index int32 :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype ashelin-global-info (basic) ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim UNKNOWN 6 :offset-assert 8) - (blue-hit-land-anim UNKNOWN 6 :offset-assert 32) + (blue-hit-anim int32 6 :offset-assert 8) + (blue-hit-land-anim int32 6 :offset-assert 32) ) :method-count-assert 9 :size-assert #x38 :flag-assert #x900000038 ) -|# -;; (define-extern *ashelin-global-info* ashelin-global-info) -;; (define-extern *ashelin-nav-enemy-info* nav-enemy-info) +(define-extern *ashelin-global-info* ashelin-global-info) +(define-extern *ashelin-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash-states ;; @@ -39277,65 +39311,54 @@ ;; sig0-course ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype sig-atoll (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. - ) -|# +(declare-type sig0-course bot-course) -#| -(deftype sig0-course (UNKNOWN) - ((course-id uint8 :offset-assert 4) - (speech-count uint16 :offset-assert 6) - (spot-count uint16 :offset-assert 8) - (retry-cookie uint8 :offset-assert 10) - (too-far-warn-speeches basic :offset-assert 12) - (too-far-fail-speeches basic :offset-assert 16) - (attack-player-speeches basic :offset-assert 20) - (default-check-too-far basic :offset-assert 24) - (waypoints basic :offset-assert 28) - (speeches uint32 :offset-assert 32) - (speech-tunings uint32 :offset-assert 36) - (dirs uint32 :offset-assert 40) - (spots uint32 :offset-assert 44) - (liftcat-speech-index int8 :offset-assert 48) - (first-liftcat-speeches basic :offset-assert 52) - (second-liftcat-speeches basic :offset-assert 56) +(deftype sig-atoll (sig) + ((sig-course sig0-course :offset 652 :score 1) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 260 + :size-assert #x430 + :flag-assert #x10403b00430 + (:methods + (sig-atoll-method-259 (_type_) symbol 259) + ) + ) + +(deftype sig0-course (bot-course) + ((liftcat-speech-index int8 :offset-assert 48) + (first-liftcat-speeches (array int16) :offset-assert 52) + (second-liftcat-speeches (array int16) :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c ;; field default-check-too-far uses ~A with a signed load ) -|# -;; (define-extern sig0-first-battle-too-far function) -;; (define-extern sig0-tank-check-too-far function) -;; (define-extern sig0-gangway-check-too-far function) -;; (define-extern sig0-final-snipers-check-too-far function) -;; (define-extern sig0-say-look-out-if-should function) -;; (define-extern sig-say-waste-the-suckers-if-should function) -;; (define-extern *sig0-course* sig0-course) +(define-extern sig0-first-battle-too-far (function sig-atoll int)) +(define-extern sig0-tank-check-too-far (function sig-atoll int)) +(define-extern sig0-gangway-check-too-far (function sig-atoll int)) +(define-extern sig0-final-snipers-check-too-far (function sig-atoll int)) +(define-extern sig0-say-look-out-if-should (function sig-atoll none)) +(define-extern sig-say-waste-the-suckers-if-should (function sig-atoll none)) +(define-extern *sig0-course* sig0-course) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash1-course ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype ashelin-battle (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype ashelin-battle (ashelin) + ((player-in-bounds-time time-frame :offset-assert 1040) + ) + :method-count-assert 252 + :size-assert #x418 + :flag-assert #xfc03a00418 + (:methods + (set-frontline-dist! (_type_) none 251) + ) ) -|# -;; (define-extern *ash1-course* ashelin-course) +(define-extern *ash1-course* ashelin-course) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; atoll-tank ;; @@ -43263,70 +43286,72 @@ ;; whack ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype hip-mole-event (UNKNOWN) - ((min-time uint16 :offset-assert 0) - (max-time uint16 :offset-assert 2) - (mode uint8 :offset-assert 4) +(deftype hip-mole-event (structure) + ((min-time uint16 :offset 0) + (max-time uint16 :offset 2) + (mode uint8 :offset 4) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :size-assert #x5 + :flag-assert #x900000005 ) -|# -#| -(deftype hip-mole (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. +(deftype hip-mole (process-drawable) + ((cabinet handle :offset-assert 200) + (index int32 :offset-assert 208) + (mode uint8 :offset-assert 212) + (sound-id uint32 :offset-assert 216) + (abort? symbol :offset-assert 220) + ) + :method-count-assert 22 + :size-assert #xe0 + :flag-assert #x16006000e0 + (:methods + (idle () _type_ :state 20) + (active (time-frame uint) _type_ :state 21) + ) ) -|# (deftype whack-a-metal (process-drawable) - ( - (cabinet handle :offset-assert 200) - (bopper uint32 :offset-assert 208) - (mole object 8 :offset-assert 212) - (score-part basic 2 :offset-assert 244) - (wave int32 :offset-assert 252) - (event int32 :offset-assert 256) - (event-time time-frame :offset-assert 264) - (event-length time-frame :offset-assert 272) - (hud-score int64 :offset-assert 280) - (hud-goal int64 :offset-assert 288) - (score float :offset-assert 296) - (score-time time-frame :offset-assert 304) - (dizzy? symbol :offset-assert 312) - (miss-count int32 :offset-assert 316) - (air-attack-count int32 :offset-assert 320) - (slot-buffer int32 4 :offset-assert 324) - (speech-time time-frame :offset-assert 344) - (speech-count int32 :offset-assert 352) - (speech-last basic 4 :offset-assert 356) - ) + ((cabinet handle :offset-assert 200) + (bopper (pointer process) :offset-assert 208) + (mole (pointer hip-mole) 8 :offset-assert 212) + (score-part sparticle-launch-control 2 :offset-assert 244) + (wave int32 :offset-assert 252) + (event int32 :offset-assert 256) + (event-time time-frame :offset-assert 264) + (event-length time-frame :offset-assert 272) + (hud-score handle :offset-assert 280) + (hud-goal handle :offset-assert 288) + (score float :offset-assert 296) + (score-time time-frame :offset-assert 304) + (dizzy? symbol :offset-assert 312) + (miss-count int32 :offset-assert 316) + (air-attack-count int32 :offset-assert 320) + (slot-buffer int32 4 :offset-assert 324) + (speech-time time-frame :offset-assert 344) + (speech-count int32 :offset-assert 352) + (speech-last int32 4 :offset-assert 356) + ) :method-count-assert 30 :size-assert #x174 :flag-assert #x1e01000174 (:methods - (whack-a-metal-method-21 () none 20) - (whack-a-metal-method-22 () none 21) - (whack-a-metal-method-23 () none 22) - (whack-a-metal-method-24 () none 23) - (whack-a-metal-method-25 () none 24) - (whack-a-metal-method-26 () none 25) - (whack-a-metal-method-27 () none 26) - (whack-a-metal-method-28 () none 27) - (whack-a-metal-method-29 () none 28) - (whack-a-metal-method-30 () none 29) + (hide () _type_ :state 20) + (wait-for-start () _type_ :state 21) + (active (symbol int) _type_ :state 22) + (attack (int) _type_ :state 23) + (lose () _type_ :state 24) + (win () _type_ :state 25) + (whack-a-metal-method-26 (_type_) integer 26) + (whack-a-metal-method-27 (_type_) none 27) + (whack-a-metal-method-28 (_type_) none 28) + (whack-a-metal-method-29 (_type_ int int) int 29) ) ) -;; (define-extern birth-func-whack-score (function int sparticle-cpuinfo sparticle-launchinfo none)) -;; (define-extern *mole-data* array) -;; (define-extern hip-mole-init function) +(define-extern birth-func-whack-score (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern *mole-data* (array (array hip-mole-event))) +(define-extern hip-mole-init (function handle int none :behavior hip-mole)) (define-extern whack-a-metal-init (function entity-actor none :behavior whack-a-metal)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -51492,11 +51517,10 @@ ;; kid-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype kid (bot) - ((travel-anim-interp float :offset-assert 988) - (arrest-attempt-time time-frame :offset-assert 996) - (arrestor-handle uint64 :offset-assert 1004) + ((travel-anim-interp float :offset-assert 992) + (arrest-attempt-time time-frame :offset-assert 1000) + (arrestor-handle uint64 :offset-assert 1008) ) :method-count-assert 235 :size-assert #x3f8 @@ -51514,7 +51538,6 @@ (kid-method-234 () none 234) ) ) -|# #| (deftype kidt-wait-spot (ai-task) diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index fd9b2ad4f8..44a8080eec 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -731,5 +731,126 @@ "tomb-boulder": [ [0, "(function process vector cspace object object (pointer process))"], [4, "(function process-drawable vector)"] + ], + "bot": [[25, "(function gui-connection symbol :behavior bot)"]], + "sig0-course": [ + [0, "(function sig-atoll none)"], + [1, "(function symbol)"], + [2, "(function sig-atoll none)"], + [3, "(function object sig-atoll symbol)"], + [4, "(function sig-atoll none)"], + [5, "(function object sig-atoll symbol)"], + [6, "(function sig-atoll none)"], + [7, "(function sig-atoll none)"], + [8, "(function object sig-atoll symbol)"], + [9, "(function sig-atoll none)"], + [10, "(function object sig-atoll symbol)"], + [11, "(function sig-atoll none)"], + [12, "(function object sig-atoll symbol)"], + [13, "(function sig-atoll none)"], + [14, "(function sig-atoll none)"], + [15, "(function object sig-atoll symbol)"], + [16, "(function sig-atoll none)"], + [17, "(function object sig-atoll symbol)"], + [18, "(function sig-atoll none)"], + [19, "(function sig-atoll none)"], + [20, "(function object sig-atoll symbol)"], + [21, "(function sig-atoll none)"], + [22, "(function sig-atoll none)"], + [23, "(function sig-atoll none)"], + [24, "(function object sig-atoll symbol)"], + [25, "(function sig-atoll none)"], + [26, "(function object sig-atoll symbol)"], + [27, "(function sig-atoll none)"], + [28, "(function object sig-atoll symbol)"], + [29, "(function sig-atoll none)"], + [30, "(function object sig-atoll symbol)"], + [31, "(function sig-atoll none)"], + [32, "(function sig-atoll none)"], + [33, "(function object sig-atoll symbol)"], + [34, "(function sig-atoll none)"], + [35, "(function sig-atoll none)"], + [36, "(function object sig-atoll symbol)"], + [37, "(function sig-atoll none)"], + [38, "(function sig-atoll none)"], + [39, "(function object sig-atoll symbol)"], + [40, "(function sig-atoll none)"], + [41, "(function object sig-atoll symbol)"], + [42, "(function sig-atoll none)"], + [43, "(function sig-atoll none)"], + [44, "(function object sig-atoll symbol)"], + [45, "(function sig-atoll none)"], + [46, "(function object sig-atoll symbol)"], + [47, "(function sig-atoll none)"], + [48, "(function object sig-atoll symbol)"], + [49, "(function sig-atoll none)"], + [50, "(function sig-atoll none)"], + [51, "(function object sig-atoll symbol)"], + [52, "(function sig-atoll none)"], + [53, "(function object sig-atoll symbol)"], + [54, "(function sig-atoll none)"], + [55, "(function object sig-atoll symbol)"], + [56, "(function sig-atoll none)"], + [57, "(function object sig-atoll symbol)"], + [58, "(function sig-atoll none)"], + [59, "(function sig-atoll none)"], + [60, "(function object sig-atoll symbol)"], + [61, "(function sig-atoll none)"], + [62, "(function sig-atoll none)"], + [63, "(function sig-atoll none)"], + [64, "(function object sig-atoll symbol)"], + [65, "(function sig-atoll none)"], + [66, "(function object sig-atoll symbol)"], + [67, "(function sig-atoll none)"], + [68, "(function object sig-atoll symbol)"], + [69, "(function sig-atoll none)"], + [70, "(function object sig-atoll symbol)"], + [71, "(function sig-atoll none)"], + [72, "(function sig-atoll none)"], + [73, "(function object sig-atoll symbol)"], + [74, "(function sig-atoll none)"], + [75, "(function sig-atoll none)"], + [76, "(function object sig-atoll symbol)"], + [77, "(function sig-atoll none)"], + [78, "(function object sig-atoll symbol)"], + [79, "(function sig-atoll none)"], + [80, "(function object sig-atoll symbol)"], + [81, "(function sig-atoll none)"], + [82, "(function object sig-atoll symbol)"], + [83, "(function sig-atoll none)"], + [84, "(function sig-atoll none)"], + [85, "(function ai-task-control sig-atoll symbol)"], + [86, "(function sig-atoll none)"], + [87, "(function sig-atoll none)"], + [88, "(function sigt-choose-piston sig-atoll symbol)"], + [89, "(function sig-atoll none)"], + [90, "(function sig-atoll none)"], + [91, "(function object sig-atoll symbol)"], + [92, "(function sig-atoll none)"], + [93, "(function sig-atoll none)"], + [94, "(function object sig-atoll symbol)"], + [95, "(function sig-atoll none)"], + [96, "(function object sig-atoll symbol)"], + [97, "(function sig-atoll bot-speech-list-shuffle none)"], + [98, "(function object sig-atoll symbol)"] + ], + "ash1-course": [ + [0, "(function ashelin-battle none)"], + [1, "(function asht-wait-spot ashelin-battle symbol)"], + [2, "(function ashelin-battle none)"], + [3, "(function asht-wait-spot ashelin-battle symbol)"], + [4, "(function ashelin-battle symbol)"], + [5, "(function asht-wait-spot ashelin-battle symbol)"], + [6, "(function ashelin-battle none)"], + [7, "(function ashelin-battle none)"], + [8, "(function asht-wait-spot ashelin-battle symbol)"], + [9, "(function ashelin-battle none)"], + [10, "(function asht-wait-spot ashelin-battle symbol)"], + [11, "(function ashelin-battle none)"], + [12, "(function asht-wait-spot ashelin-battle symbol)"] + ], + "whack": [ + [0, "(function (pointer process) :behavior whack-a-metal)"], + [6, "(function int none :behavior whack-a-metal)"] ] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 3fb4e64cce..81900f7b0f 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -39,7 +39,6 @@ "(method 77 spyder)", "(method 77 flamer)", "(method 77 grenadier)", - "(method 224 bot)", // until loop without nop: "target-history-print", "display-list-control", @@ -51,8 +50,6 @@ "(anon-function 10 pilot-recorder)", "(method 0 hover-nav-control)", "(method 24 nav-network)", - "(method 9 bot-speech-list)", - "(method 9 bot-speech-list-shuffle)", "(anon-function 10 sig-recorder)", // actual asm "quad-copy!", @@ -108,7 +105,6 @@ "(method 9 editable-region)", // condition branch assert hit "(anon-function 10 meet-brutter)", "(method 154 vehicle-racer)", - "(anon-function 13 sig0-course)", "(method 228 hal-sewer)", "(method 154 vehicle-city-racer)", "(method 53 squid)", @@ -519,7 +515,8 @@ "(anon-function 1 ruins-obs)": [ 1, 2, 4, 6, 7, 14, 17, 19, 22, 24, 26, 27, 29, 31, 33, 35 ], - "(anon-function 2 ruins-obs)": [7, 28, 37, 50, 51, 61, 62, 71] + "(anon-function 2 ruins-obs)": [7, 28, 37, 50, 51, 61, 62, 71], + "(anon-function 62 sig0-course)": [0, 1, 5, 6] }, // Sometimes the game might use format strings that are fetched dynamically, diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index a9a2e19879..7b0d9b5d90 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -215,14 +215,13 @@ "LWIDEA.DGO", "LWIDEB.DGO", "LWIDEC.DGO", - "FEA.DGO", - "FEB.DGO", + // "ATE.DGO", + // "ATO.DGO", "DRI.DGO", "TOC.DGO", "FOB.DGO", "SAG.DGO", "MTX.DGO", - "MCN.DGO", "MTN.DGO", "TOB.DGO", "TOA.DGO", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 879af47797..0847172dd2 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -1048,5 +1048,33 @@ "tomb-beetle": [ ["L118", "attack-info"], ["L126", "(pointer int64)", 2] + ], + "bot": [ + ["L382", "attack-info"], + ["L383", "attack-info"] + ], + "sig0-course": [ + ["L536", "vector"], + ["L549", "vector"], + ["L619", "uint64", true], + ["L620", "uint64", true] + ], + "sig": [["L190", "sphere"]], + "ash1-course": [["L126", "uint64", true]], + "whack": [ + ["L1103", "uint64", true], + ["L1104", "uint64", true], + ["L1105", "uint64", true], + ["L1106", "uint64", true], + ["L1107", "uint64", true], + ["L1108", "uint64", true], + ["L1109", "uint64", true], + ["L1110", "uint64", true], + ["L1111", "uint64", true], + ["L1112", "uint64", true], + ["L1113", "uint64", true], + ["L1152", "uint64", true], + ["L1153", "uint64", true], + ["L1154", "uint64", true] ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index a207a50b4b..062875d44f 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1435,11 +1435,40 @@ "(method 24 minimap)": [[16, "minimap-draw-work"]], "(method 15 minimap)": [[16, "minimap-draw-work"]], "(method 11 minimap)": [[16, ["inline-array", "vector", 4]]], - "(method 26 minimap)": [[32, "vector"], [64, "matrix"], [48, "vector"]], - "(method 23 minimap)": [[32, "vector"], [48, "vector"], [64, "matrix"], [80, "matrix"], [144, "matrix"]], - "(method 17 minimap)": [[32, "vector"], [48, "vector"], [64, "matrix"], [80, "matrix"], [144, "matrix"], [240, "vector"], [256, "vector"]], - "(method 18 minimap)": [[32, "vector"], [48, "vector"], [64, "matrix"], [80, "matrix"], [144, "matrix"], [240, "vector"], [256, "vector"]], - "(method 19 minimap)": [[16, "vector"], [32, "matrix"]], + "(method 26 minimap)": [ + [32, "vector"], + [64, "matrix"], + [48, "vector"] + ], + "(method 23 minimap)": [ + [32, "vector"], + [48, "vector"], + [64, "matrix"], + [80, "matrix"], + [144, "matrix"] + ], + "(method 17 minimap)": [ + [32, "vector"], + [48, "vector"], + [64, "matrix"], + [80, "matrix"], + [144, "matrix"], + [240, "vector"], + [256, "vector"] + ], + "(method 18 minimap)": [ + [32, "vector"], + [48, "vector"], + [64, "matrix"], + [80, "matrix"], + [144, "matrix"], + [240, "vector"], + [256, "vector"] + ], + "(method 19 minimap)": [ + [16, "vector"], + [32, "matrix"] + ], "(method 12 trail-graph)": [[16, ["inline-array", "vector", 2]]], "(method 14 trail-graph)": [[16, ["inline-array", "vector", 2]]], "(method 13 trail-graph)": [[16, ["inline-array", "vector", 2]]], @@ -1477,7 +1506,7 @@ [48, "vector"], [64, "vector"] ], - "(method 13 grid-info)": [[16, "bounding-box"]], + "(method 13 grid-info)": [[16, "bounding-box"]], "(method 20 vehicle-controller)": [[16, "vehicle-control-point"]], "(method 16 vehicle-controller)": [[16, "vehicle-control-point"]], "(method 104 vehicle)": [[16, "vehicle-control-point"]], @@ -1603,5 +1632,25 @@ ], "(trans show-sequence tomb-plat-simon)": [[16, "event-message-block"]], "(event dangerous tomb-simon-block)": [[16, "vector"]], - "(method 185 tomb-beetle)": [[16, "vector"]] + "(method 185 tomb-beetle)": [[16, "vector"]], + "(method 189 bot)": [ + [16, "enemy-best-focus"], + [32, "sphere"] + ], + "(method 190 bot)": [[16, "connection-pers"]], + "(method 247 sig)": [[16, "projectile-init-by-other-params"]], + "(method 250 sig)": [[16, "sphere"]], + "(method 25 sig-shot)": [[32, "vector"]], + "(method 12 sigt-choose-piston)": [[16, "event-message-block"]], + "(method 11 sigt-riding-piston)": [[16, "event-message-block"]], + "(anon-function 48 sig0-course)": [[16, "event-message-block"]], + "ashelin-shot-move": [[16, "vector"]], + "(method 25 ashelin-shot)": [[32, "vector"]], + "(anon-function 97 sig0-course)": [[16, "vector"]], + "(anon-function 12 ash1-course)": [[16, "event-message-block"]], + "(anon-function 93 sig0-course)": [[16, ["array", "symbol", 3]]], + "(code active whack-a-metal)": [ + [16, "vector"], + [32, "vector"] + ] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 521241080f..e8f6b49827 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -6545,7 +6545,7 @@ "(method 3 engine-minimap)": [ [7, "t9", "(function engine-minimap engine-minimap)"] ], - "(method 24 minimap)":[ + "(method 24 minimap)": [ [189, "s2", "connection-minimap"], [194, "s2", "connection-minimap"], [18, "v1", "(pointer uint128)"], @@ -6560,9 +6560,7 @@ [141, "v1", "(inline-array vector4w)"], [161, "s2", "(pointer uint128)"] ], - "(method 15 minimap)": [ - [48, "s2", "(pointer uint128)"] - ], + "(method 15 minimap)": [[48, "s2", "(pointer uint128)"]], "(method 16 minimap)": [ [[30, 35], "v1", "process-drawable"], [56, "v1", "entity-actor"], @@ -6582,9 +6580,7 @@ [[3, 180], "s3", "connection-minimap"], [143, "v1", "basic"] ], - "(method 10 engine-minimap)": [ - [6, "s5", "connection-minimap"] - ], + "(method 10 engine-minimap)": [[6, "s5", "connection-minimap"]], "(method 26 minimap)": [ [34, "a0", "process-drawable"], [49, "v1", "process-drawable"], @@ -6766,9 +6762,7 @@ ], "(trans attack-forward gator)": [[[19, 23], "gp", "process-focusable"]], "(code attack-forward gator)": [[14, "v1", "art-joint-anim"]], - "(method 11 sew-light-switch)": [ - ["_stack_", 16, "res-tag"] - ], + "(method 11 sew-light-switch)": [["_stack_", 16, "res-tag"]], "(method 33 mtn-dice-button)": [[35, "v1", "art-joint-anim"]], "(trans restart mtn-dice)": [ [128, "v1", "collide-shape-prim-group"], @@ -6835,7 +6829,10 @@ [103, "a0", "(pointer entity-actor)"], [287, "v1", "int"] ], - "(method 11 strip-hazard)": [[34, "v0", "(pointer float)"], ["_stack_", 64, "res-tag"]], + "(method 11 strip-hazard)": [ + [34, "v0", "(pointer float)"], + ["_stack_", 64, "res-tag"] + ], "(method 11 strip-chain-crate)": [[38, "v0", "(pointer float)"]], "(method 33 vehicle-rider)": [[10, "s4", "vehicle"]], "(method 35 vehicle-rider)": [[[10, 15], "a0", "vehicle"]], @@ -7126,5 +7123,299 @@ "(enter fly-away tomb-beetle)": [ [6, "a0", "vector"], [[1, 53], "gp", "(inline-array tomb-beetle-fly-info)"] - ] + ], + "(method 76 bot)": [[45, "v1", "process-focusable"]], + "(code failed bot)": [[23, "gp", "art-joint-anim"]], + "(code die-falling bot)": [[32, "gp", "art-joint-anim"]], + "(code hit bot)": [[30, "v1", "art-joint-anim"]], + "(method 74 bot)": [ + [115, "v1", "process"], + [230, "a0", "vector"] + ], + "(method 97 bot)": [ + [130, "s5", "process-focusable"], + [138, "s5", "process-focusable"] + ], + "(method 129 bot)": [ + [70, "s5", "process-focusable"], + [73, "s5", "process-focusable"] + ], + "(method 189 bot)": [ + [41, "a0", "connection"], + [42, "a0", "collide-shape"], + [90, "a0", "connection"], + [91, "a0", "collide-shape"], + [153, "a1", "process-focusable"] + ], + "(method 190 bot)": [ + [10, "v1", "sphere"], + [40, "a0", "connection"], + [41, "a0", "collide-shape"], + [49, "a3", "sphere"], + [58, "f2", "float"], + [89, "a0", "connection"], + [90, "a0", "collide-shape"], + [98, "a3", "sphere"], + [107, "f2", "float"] + ], + "(method 223 bot)": [ + [29, "s3", "process-focusable"], + [38, "s3", "process-focusable"] + ], + "(method 10 sig)": [ + [[3, 20], "v0", "sound-rpc-set-param"], + [19, "v0", "sound-rpc-set-param"] + ], + "(method 78 sig)": [ + [23, "v1", "art-joint-anim"], + [59, "v1", "art-joint-anim"] + ], + "(method 88 sig)": [[32, "a1", "art-joint-anim"]], + "(method 89 sig)": [[32, "a1", "art-joint-anim"]], + "(method 97 sig)": [ + [67, "a0", "process-focusable"], + [131, "a0", "process-focusable"], + [192, "s5", "process-focusable"], + [134, "a0", "process-focusable"], + [70, "a0", "process-focusable"], + [130, "s4", "process-focusable"], + [66, "s4", "process-focusable"] + ], + "(code waiting-crouched sig)": [[14, "v1", "art-joint-anim"]], + "(code waiting-far sig)": [ + [158, "v1", "art-joint-anim"], + [101, "v1", "art-joint-anim"] + ], + "(code waiting-close sig)": [ + [27, "v1", "art-joint-anim"], + [180, "gp", "art-joint-anim"] + ], + "(code waiting-turn sig)": [ + [50, "v1", "art-joint-anim"], + [194, "a1", "art-joint-anim"], + [327, "s4", "art-joint-anim"] + ], + "(code charge-plasma sig)": [ + [14, "v1", "art-joint-anim"], + [73, "v1", "art-joint-anim"], + [142, "v1", "art-joint-anim"], + [198, "v1", "art-joint-anim"] + ], + "(code repair-gun sig)": [ + [14, "v1", "art-joint-anim"], + [159, "v1", "art-joint-anim"], + [236, "v1", "art-joint-anim"], + [313, "v1", "art-joint-anim"], + [390, "v1", "art-joint-anim"], + [467, "v1", "art-joint-anim"], + [633, "v1", "art-joint-anim"], + [553, "v1", "art-joint-anim"], + [79, "v1", "art-joint-anim"] + ], + "(code clean-gun sig)": [ + [14, "v1", "art-joint-anim"], + [214, "v1", "art-joint-anim"], + [85, "v1", "art-joint-anim"], + [154, "v1", "art-joint-anim"] + ], + "(code traveling-blocked sig)": [[14, "v1", "art-joint-anim"]], + "(code stare sig)": [ + [27, "v1", "art-joint-anim"], + [180, "gp", "art-joint-anim"] + ], + "(code whip sig)": [[44, "a1", "art-joint-anim"]], + "(post chase sig)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(post chase-attack sig)": [ + [15, "a0", "process-focusable"], + [18, "a0", "process-focusable"] + ], + "(code hit sig)": [[14, "v1", "art-joint-anim"]], + "(code failed sig)": [ + [14, "v1", "art-joint-anim"], + [70, "v1", "art-joint-anim"], + [129, "v1", "art-joint-anim"] + ], + "(code sig-path-jump sig)": [[31, "v1", "art-joint-anim"]], + "(code sig-path-jump-land sig)": [[24, "v1", "art-joint-anim"]], + "(code sig-path-shoot-jump sig)": [[31, "v1", "art-joint-anim"]], + "(code sig-path-shoot-jump-land sig)": [[24, "v1", "art-joint-anim"]], + "(code sig-path-idle sig)": [ + [14, "v1", "art-joint-anim"], + [66, "v1", "art-joint-anim"] + ], + "(method 30 sig-shot)": [[116, "a0", "sig"]], + "(method 14 sig-plasma)": [ + [40, "v0", "sound-rpc-set-param"], + [56, "v0", "sound-rpc-set-param"] + ], + "sparticle-sig-plasma-lightning": [[15, "a0", "sig-atoll"]], + "sig0-say-look-out-if-should": [[29, "v1", "process-focusable"]], + "(method 77 sig)": [ + [57, "s5", "art-joint-anim"], + [91, "v1", "art-joint-anim"], + [176, "s4", "art-joint-anim"] + ], + "(method 86 sig)": [[28, "a0", "process-focusable"]], + "(method 250 sig)": [ + [63, "a0", "connection"], + [64, "a0", "collide-shape"], + [112, "a0", "connection"], + [113, "a0", "collide-shape"], + [204, "s4", "process-focusable"], + [176, "a0", "process-focusable"], + [175, "s2", "process-focusable"], + [207, "s4", "process-focusable"] + ], + "(method 11 sigt-charge-plasma)": [ + [110, "s3", "process-focusable"], + [113, "s3", "process-focusable"] + ], + "(method 12 sigt-choose-piston)": [ + [61, "s5", "process-focusable"], + [102, "s5", "process-focusable"], + [111, "s5", "process-focusable"] + ], + "(method 14 sigt-choose-piston)": [[34, "gp", "process-focusable"]], + "(method 186 bot)": [ + [19, "a0", "uint"], + [19, "v1", "uint"] + ], + "(method 46 sig)": [ + [6, "v1", "collide-shape-prim-group"], + [24, "v1", "collide-shape-prim-group"], + [44, "v1", "collide-shape-prim-group"], + [63, "v1", "collide-shape-prim-group"], + [82, "v1", "collide-shape-prim-group"] + ], + "(method 79 ashelin)": [[67, "v1", "art-joint-anim"]], + "(method 78 ashelin)": [ + [22, "s5", "art-joint-anim"], + [74, "v1", "art-joint-anim"], + [108, "v1", "art-joint-anim"], + [159, "v1", "art-joint-anim"], + [193, "v1", "art-joint-anim"] + ], + "(method 77 ashelin)": [[129, "s5", "art-joint-anim"]], + "(method 51 ashelin)": [ + [22, "a0", "process-focusable"], + [25, "a0", "process-focusable"] + ], + "(code waiting-idle ashelin)": [ + [204, "v1", "art-joint-anim"], + [95, "v1", "art-joint-anim"] + ], + "(code standing-idle ashelin)": [ + [189, "v1", "art-joint-anim"], + [126, "v1", "art-joint-anim"] + ], + "(code standing-turn ashelin)": [[47, "s4", "art-joint-anim"]], + "(code standing-blast ashelin)": [[68, "v1", "art-joint-anim"]], + "(post chase ashelin)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(code back-spring ashelin)": [ + [30, "v1", "art-joint-anim"], + [309, "v1", "art-joint-anim"], + [171, "v1", "art-joint-anim"] + ], + "(code tumble-right ashelin)": [ + [35, "v1", "art-joint-anim"], + [168, "v1", "art-joint-anim"], + [280, "v1", "art-joint-anim"] + ], + "(code cartwheel-left ashelin)": [ + [35, "v1", "art-joint-anim"], + [168, "v1", "art-joint-anim"], + [280, "v1", "art-joint-anim"] + ], + "(code die-falling ashelin)": [[108, "gp", "art-joint-anim"]], + "(anon-function 0 ash1-course)": [[31, "v1", "asht-wait-spot"]], + "ashelin-shot-move": [[49, "v1", "(state ashelin)"]], + "(method 28 ashelin-shot)": [ + [47, "t9", "(function projectile projectile-options none)"] + ], + "(method 30 ashelin-shot)": [[119, "a0", "ashelin"]], + "(anon-function 2 ash1-course)": [[50, "v1", "asht-wait-spot"]], + "(anon-function 7 ash1-course)": [[90, "v1", "asht-wait-spot"]], + "(anon-function 9 ash1-course)": [[12, "v1", "asht-wait-spot"]], + "(anon-function 0 sig0-course)": [[64, "v1", "sigt-wait-spot"]], + "(anon-function 2 sig0-course)": [[15, "v1", "sigt-wait-spot"]], + "(anon-function 4 sig0-course)": [[43, "v1", "sigt-charge-plasma"]], + "(anon-function 7 sig0-course)": [[44, "v1", "sigt-wait-spot"]], + "(anon-function 9 sig0-course)": [[21, "v1", "sigt-wait-spot"]], + "(anon-function 11 sig0-course)": [[44, "v1", "sigt-wait-spot"]], + "(anon-function 14 sig0-course)": [[42, "v1", "sigt-wait-spot"]], + "(anon-function 16 sig0-course)": [[21, "v1", "sigt-wait-spot"]], + "(anon-function 19 sig0-course)": [[51, "v1", "sigt-wait-spot"]], + "(anon-function 23 sig0-course)": [[27, "v1", "sigt-wait-spot"]], + "(anon-function 25 sig0-course)": [[15, "v1", "sigt-wait-spot"]], + "(anon-function 27 sig0-course)": [[43, "v1", "sigt-charge-plasma"]], + "(anon-function 29 sig0-course)": [[33, "v1", "sigt-wait-spot"]], + "(anon-function 32 sig0-course)": [[22, "v1", "sigt-wait-spot"]], + "(anon-function 35 sig0-course)": [[15, "v1", "sigt-wait-spot"]], + "(anon-function 47 sig0-course)": [[17, "v1", "sigt-wait-spot"]], + "(anon-function 45 sig0-course)": [[46, "v1", "sigt-wait-spot"]], + "(anon-function 43 sig0-course)": [[43, "v1", "sigt-charge-plasma"]], + "(anon-function 38 sig0-course)": [[21, "v1", "sigt-wait-spot"]], + "(anon-function 40 sig0-course)": [[15, "v1", "sigt-wait-spot"]], + "(anon-function 50 sig0-course)": [[15, "v1", "sigt-wait-spot"]], + "(anon-function 52 sig0-course)": [[17, "v1", "sigt-wait-spot"]], + "(anon-function 54 sig0-course)": [[51, "v1", "sigt-charge-plasma"]], + "(anon-function 56 sig0-course)": [[41, "v1", "sigt-wait-spot"]], + "(anon-function 59 sig0-course)": [[15, "v1", "sigt-wait-spot"]], + "(anon-function 63 sig0-course)": [[21, "v1", "sigt-wait-spot"]], + "(anon-function 65 sig0-course)": [[17, "v1", "sigt-wait-spot"]], + "(anon-function 67 sig0-course)": [[45, "v1", "sigt-charge-plasma"]], + "(anon-function 69 sig0-course)": [[51, "v1", "sigt-wait-spot"]], + "(anon-function 72 sig0-course)": [[42, "v1", "sigt-wait-spot"]], + "(anon-function 75 sig0-course)": [[29, "v1", "sigt-wait-spot"]], + "(anon-function 77 sig0-course)": [[15, "v1", "sigt-wait-spot"]], + "(anon-function 79 sig0-course)": [[55, "v1", "sigt-charge-plasma"]], + "(anon-function 81 sig0-course)": [[20, "v1", "sigt-wait-spot"]], + "(anon-function 84 sig0-course)": [[26, "v1", "sigt-riding-piston"]], + "(anon-function 87 sig0-course)": [[29, "v1", "sigt-choose-piston"]], + "(anon-function 90 sig0-course)": [[18, "v1", "sigt-wait-spot"]], + "(anon-function 93 sig0-course)": [[92, "v1", "sigt-wait-spot"]], + "(anon-function 95 sig0-course)": [[21, "v1", "sigt-wait-spot"]], + "(anon-function 13 sig0-course)": [[67, "v1", "int"]], + "(code active hip-mole)": [ + [11, "v1", "art-joint-anim"], + [119, "v1", "art-joint-anim"] + ], + "(post idle hip-mole)": [ + [52, "gp", "process-drawable"], + [58, "gp", "process-drawable"] + ], + "(method 28 whack-a-metal)": [ + [68, "s5", "process-drawable"], + [76, "s5", "process-drawable"], + [125, "s5", "process-drawable"] + ], + "(code active whack-a-metal)": [ + [47, "v1", "art-joint-anim"], + [219, "v1", "art-joint-anim"], + [288, "v1", "art-joint-anim"], + [143, "v1", "lightning-tracker"] + ], + "(method 10 whack-a-metal)": [[24, "t9", "(function process none)"]], + "(method 7 whack-a-metal)": [ + [26, "t9", "(function process-drawable int process-drawable)"] + ], + "(method 27 whack-a-metal)": [ + [69, "a1", "hip-mole"], + [78, "a1", "hip-mole"], + [156, "a1", "hip-mole"], + [165, "a1", "hip-mole"] + ], + "(method 224 bot)": [ + [28, "t9", "(function bot int)"], + [46, "t9", "(function bot int)"] + ], + "(anon-function 97 sig0-course)": [[62, "v1", "sigt-wait-spot"]], + "(anon-function 11 ash1-course)": [[51, "v1", "asht-wait-spot"]], + "(anon-function 4 ash1-course)": [[99, "v1", "asht-wait-spot"]] } diff --git a/decompiler/config/jak2/var_names.jsonc b/decompiler/config/jak2/var_names.jsonc index fd515cf1e7..c2f319bf76 100644 --- a/decompiler/config/jak2/var_names.jsonc +++ b/decompiler/config/jak2/var_names.jsonc @@ -2162,7 +2162,9 @@ } }, "(method 54 collide-shape)": { - "vars": { "v1-3": "proc" } + "vars": { + "v1-3": "proc" + } }, "(method 42 collide-shape)": { "args": ["obj", "other", "cquery"] @@ -2233,7 +2235,6 @@ "f0-11": "dist-until-gone" } }, - "dma-add-process-drawable": { "args": ["pd", "dc", "flag", "dma-buf"], "vars": { @@ -2281,6 +2282,179 @@ "vars": { "s4-0": ["s4-0", "art-joint-anim"] } }, "(code target-running-attack)": { - "vars": {"t1-6": ["t1-6", "sound-name"]} + "vars": { "t1-6": ["t1-6", "sound-name"] } + }, + "(method 9 bot-speech-list)": { + "vars": { + "s2-0": "sp-indexes", + "s1-0": "last-idx", + "s0-0": "idx", + "v1-37": "flags" + }, + "args": ["sp-list", "bot", "sp-info", "arg3"] + }, + "(method 182 bot)": { + "vars": { + "s5-0": "bot-root", + "a0-7": "proc-vel", + "v1-4": "targ-pos" + }, + "args": ["obj", "turn-info", "proc", "arg3"] + }, + "(method 223 bot)": { + "vars": { + "gp-0": "focus", + "s3-0": "focus-proc", + "v1-1": "timer", + "s4-1": "cquery" + } + }, + "(method 213 bot)": { + "vars": { + "v1-0": "course", + "a0-2": "waypoint-count", + "a2-1": "i", + "s4-0": "waypoint", + "s5-1": "on-skip", + "t9-4": "on-set", + "s3-0": "mesh-idx" + }, + "args": ["obj", "id", "skipped?"] + }, + "(method 215 bot)": { + "vars": { + "s5-0": "skip-id" + } + }, + "(method 205 bot)": { + "args": ["obj", "scene", "grab?"] + }, + "(method 207 bot)": { + "args": ["obj", "sound"] + }, + "(method 206 bot)": { + "args": ["obj", "idx"], + "vars": { + "s5-0": "speech", + "gp-0": "course", + "a1-4": "proc", + "t2-0": "hold-time", + "v1-5": "tuning" + } + }, + "(method 211 bot)": { + "vars": { + "v1-1": "speeches", + "a0-2": "i", + "a1-1": "speech" + } + }, + "(method 217 bot)": { + "args": ["obj", "idx"], + "vars": { + "v1-2": "speech" + } + }, + "(method 189 bot)": { + "vars": { + "s3-0": "sphere", + "gp-0": "focus", + "f0-0": "enemy-dist", + "s4-0": ["coll-spec", "collide-spec"], + "a0-5": "next-actor", + "a1-1": "cshape", + "a1-2": "ccore", + "a1-26": "enemy", + "s2-0": "proc", + "s3-1": "i", + "v1-27": "actor" + } + }, + "(method 184 bot)": { + "vars": { + "s5-0": "course", + "s4-0": "i", + "s3-0": "spot", + "a2-2": "spot-id" + } + }, + "(method 197 bot)": { + "vars": { + "s5-0": "mission-failed?", + "a0-7": "master-handle", + "a1-2": "fail-params" + } + }, + "(method 201 bot)": { + "vars": { + "f0-0": "rating", + "v1-0": "enemy-dist" + }, + "args": ["obj", "enemy", "arg2"] + }, + "(method 220 bot)": { + "args": ["obj", "channel"] + }, + "(method 214 bot)": { + "vars": { + "a1-0": "fproc" + } + }, + "(method 208 bot)": { + "vars": { + "a1-0": "target-trans", + "v1-4": "bot-root" + } + }, + "(method 194 bot)": { + "args": ["obj", "spot", "bot-trans", "arg3"] + }, + "(method 209 bot)": { + "args": ["obj", "channel"] + }, + "(method 218 bot)": { + "args": ["obj", "idx"] + }, + "(method 219 bot)": { + "args": ["obj", "spot"] + }, + "(method 202 bot)": { + "vars": { + "s2-0": "i", + "s3-0": "bot-trans", + "f0-0": "spot-dist", + "s1-0": "spot", + "gp-0": "spot-idx" + }, + "args": ["obj", "num-spots", "spot-indices"] + }, + "(method 203 bot)": { + "vars": { + "a1-2": "idx" + } + }, + "(method 9 bot-speech-list-shuffle)": { + "args": ["obj", "bot", "sp-info", "sp-flags"], + "vars": { + "v1-1": "course-cookie", + "s2-0": "history-mask", + "s0-0": "speech-idx", + "s1-0": "last-idx" + } + }, + "(method 204 bot)": { + "vars": { + "a1-2": "idx" + } + }, + "(method 224 bot)": { + "vars": { + "t9-0": "check-too-far-func", + "gp-0": "result", + "v1-0": "too-far-check" + } + }, + "(method 195 bot)": { + "args": ["obj", "fproc"] } -} +} \ No newline at end of file diff --git a/decompiler/level_extractor/extract_tie.cpp b/decompiler/level_extractor/extract_tie.cpp index 4b51a36cb6..8e8996d962 100644 --- a/decompiler/level_extractor/extract_tie.cpp +++ b/decompiler/level_extractor/extract_tie.cpp @@ -559,7 +559,7 @@ void update_proto_info(std::vector* out, u32 tex_combo = (((u32)tpage) << 16) | tidx; // look up the texture to make sure it's valid auto tex = tdb.textures.find(tex_combo); - ASSERT(tex != tdb.textures.end()); + // ASSERT(tex != tdb.textures.end()); // remember the texture id adgif.combo_tex = tex_combo; // and the hidden value in the unused a+d diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index ce4cb24c95..2ee33934fa 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -848,7 +848,21 @@ const std::unordered_map< ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}}, {"predator-graph", {{"node", ArrayFieldDecompMeta(TypeSpec("predator-node"), 48)}, - {"edge", ArrayFieldDecompMeta(TypeSpec("predator-edge"), 4)}}}}}}; + {"edge", ArrayFieldDecompMeta(TypeSpec("predator-edge"), 4)}}}, + {"sig0-course", + {{"spots", ArrayFieldDecompMeta(TypeSpec("bot-spot"), 32)}, + {"speeches", ArrayFieldDecompMeta(TypeSpec("bot-speech-info"), 16)}, + {"dirs", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}, + {"speech-tunings", ArrayFieldDecompMeta(TypeSpec("bot-speech-tuning"), 16)}}}, + {"ashelin-course", + {{"spots", ArrayFieldDecompMeta(TypeSpec("bot-spot"), 32)}, + {"speeches", ArrayFieldDecompMeta(TypeSpec("bot-speech-info"), 16)}, + {"dirs", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}, + {"speech-tunings", ArrayFieldDecompMeta(TypeSpec("bot-speech-tuning"), 16)}}}, + {"ai-task-pool", + {{"tasks", ArrayFieldDecompMeta(TypeSpec("uint32"), + 4, + ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}}}}}; goos::Object decompile_structure(const TypeSpec& type, const DecompilerLabel& label, diff --git a/goal_src/jak2/characters/ashelin/ash-h.gc b/goal_src/jak2/characters/ashelin/ash-h.gc index 6912e94a85..5e03a01aed 100644 --- a/goal_src/jak2/characters/ashelin/ash-h.gc +++ b/goal_src/jak2/characters/ashelin/ash-h.gc @@ -7,3 +7,82 @@ ;; DECOMP BEGINS +(deftype ashelin-course (bot-course) + ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) + (victory-speeches bot-speech-list-shuffle :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + + +(deftype ashelin (bot) + ((ash-course ashelin-course :offset 652) + (knocked-anim art-joint-anim :offset-assert 992) + (travel-anim-interp float :offset-assert 996) + (fired-gun-count uint32 :offset-assert 1000) + (last-fire-time time-frame :offset-assert 1008) + (victory-speech-time time-frame :offset-assert 1016) + (frontline plane :inline :offset-assert 1024) + ) + :heap-base #x390 + :method-count-assert 251 + :size-assert #x410 + :flag-assert #xfb03900410 + (:methods + (back-spring () _type_ :state 225) + (cartwheel-left () _type_ :state 226) + (tumble-right () _type_ :state 227) + (chase () _type_ :state 228) + (traveling () _type_ :state 229) + (traveling-blocked () _type_ :state 230) + (waiting-idle () _type_ :state 231) + (standing-idle () _type_ :state 232) + (standing-turn () _type_ :state 233) + (standing-blast () _type_ :state 234) + (ashelin-method-235 (_type_ symbol) symbol 235) + (ashelin-method-236 (_type_ vector float float float float) symbol 236) + (fire-projectile (_type_ vector) none 237) + (ashelin-method-238 (_type_ symbol symbol) symbol 238) + (ashelin-method-239 (_type_) none 239) + (ashelin-method-240 (_type_ int) none 240) + (ashelin-method-241 (_type_) int 241) + (ashelin-method-242 (_type_) int 242) + (ashelin-method-243 (_type_ float) int 243) + (ashelin-method-244 (_type_) none 244) + (ashelin-method-245 (_type_) none 245) + (ashelin-method-246 (_type_) int 246) + (ashelin-method-247 (_type_) symbol 247) + (ashelin-method-248 (_type_) symbol 248) + (ashelin-method-249 (_type_) none 249) + (ashelin-method-250 (_type_ symbol) none 250) + ) + ) + + +(defskelgroup skel-ashelin ashelin 0 3 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 2.7) + :shadow 2 + :origin-joint-index 13 + ) + +(deftype asht-wait-spot (ai-task) + ((check-done (function asht-wait-spot ashelin symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 6 :offset 38) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + + +(deftype asht-fight-focus (ai-task) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) diff --git a/goal_src/jak2/characters/ashelin/ash-shot.gc b/goal_src/jak2/characters/ashelin/ash-shot.gc index 950e7336f3..ddb4f5d853 100644 --- a/goal_src/jak2/characters/ashelin/ash-shot.gc +++ b/goal_src/jak2/characters/ashelin/ash-shot.gc @@ -7,3 +7,517 @@ ;; DECOMP BEGINS +(defpart 672 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x45 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.75)) + (sp-flt spt-scale-y (meters 10)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpart 673 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 674 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-flt spt-num 1.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -1.28) + (sp-flt spt-fade-a -0.48) + (sp-int spt-timer 100) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 675 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x46 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-scale-y (meters 4.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -3.6571429) + (sp-int spt-timer 35) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpartgroup group-ashelin-shot-hit + :id 149 + :duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 676 :period 600 :length 5) + (sp-item 677 :fade-after (meters 100) :period 600 :length 5) + (sp-item 678 :period 600 :length 5) + (sp-item 679 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 200) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 200) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 150) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 125) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 100) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 75) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 65) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 50) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 40) + (sp-item 680 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 25) + ) + ) + +(defpart 679 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.0 0.2 1.0) + (sp-flt spt-y (meters 0.25)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.001) (meters -0.00033333333) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -2.4) 1 873.81335) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.10666667) + (sp-flt spt-fade-b -0.10666667) + (sp-rnd-flt spt-accel-y -1.3653333 -5.4613333 1.0) + (sp-flt spt-friction 0.9) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 200) + (sp-launcher-by-id spt-next-launcher 681) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 680 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 96.0) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.0005) (meters -0.0005) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.10666667) + (sp-flt spt-fade-b -0.10666667) + (sp-rnd-flt spt-accel-y -1.3653333 -5.4613333 1.0) + (sp-flt spt-friction 0.8) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 200) + (sp-launcher-by-id spt-next-launcher 681) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 681 + :init-specs ((sp-flt spt-fade-a -0.96)) + ) + +(defpart 677 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees -0.1)) + (sp-flt spt-fade-a -0.32) + (sp-int spt-timer 400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 682) + ) + ) + +(defpart 682 + :init-specs ((sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 682) + ) + ) + +(defpart 678 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 2.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 48.0) + (sp-flt spt-scalevel-x (meters 0.12857144)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.9142857) + (sp-flt spt-fade-b -0.9142857) + (sp-int spt-timer 400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2) + (sp-int spt-next-time 35) + (sp-launcher-by-id spt-next-launcher 683) + ) + ) + +(defpart 683 + :init-specs ((sp-flt spt-scale-x (meters 4.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.010958904)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.38356164) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a -0.13150685) + ) + ) + +(defpart 676 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.16666667)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 55) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 684) + ) + ) + +(defpart 684 + :init-specs ((sp-flt spt-scale-x (meters 3.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.0875)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-b -6.4) + ) + ) + +(deftype ashelin-shot (projectile) + ((tail-pos vector :inline :offset-assert 480) + (hit-pos vector :inline :offset-assert 496) + ) + :heap-base #x180 + :method-count-assert 40 + :size-assert #x200 + :flag-assert #x2801800200 + ) + + +(defmethod draw-laser-sight ashelin-shot ((obj ashelin-shot)) + "TODO - confirm If applicable, draw the laser sight particles + :virtual" + (draw-beam (-> *part-id-table* 675) (-> obj tail-pos) (-> obj starting-dir) #f #t) + 0 + (none) + ) + +(defmethod spawn-impact-particles ashelin-shot ((obj ashelin-shot)) + "Spawns associated particles with the projectile if applicable" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((v1-1 (-> obj root-override trans)) + (a1-0 (-> obj tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-2 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> gp-0 quad) vf6) + (let ((f30-0 (-> *part-id-table* 672 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 672 init-specs 4 initial-valuef) (fmin f30-0 (vector-length s5-1))) + (draw-beam (-> *part-id-table* 672) a1-0 s5-1 #f #t) + (set! (-> *part-id-table* 672 init-specs 4 initial-valuef) f30-0) + ) + (vector-normalize! s5-1 1.0) + (let ((t9-2 sp-launch-particles-var) + (a0-5 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 673)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> gp-0 quad)) + (t9-2 a0-5 a1-2 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((f0-4 (vector-dot s5-1 (-> (camera-matrix) vector 2)))) + (when (< 0.0 f0-4) + (let ((f0-5 (* f0-4 f0-4)) + (f30-1 (-> *part-id-table* 674 init-specs 8 initial-valuef)) + (f28-0 (-> *part-id-table* 674 init-specs 8 random-rangef)) + ) + (set! (-> *part-id-table* 674 init-specs 8 initial-valuef) (* f30-1 f0-5)) + (set! (-> *part-id-table* 674 init-specs 8 random-rangef) (* f28-0 f0-5)) + (let ((t9-4 sp-launch-particles-var) + (a0-6 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 674)) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> gp-0 quad)) + (t9-4 a0-6 a1-3 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (set! (-> *part-id-table* 674 init-specs 8 initial-valuef) f30-1) + (set! (-> *part-id-table* 674 init-specs 8 random-rangef) f28-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod spawn-shell-particles ashelin-shot ((obj ashelin-shot)) + "TODO - confirm" + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-1 (method-of-type part-tracker activate))) + (t9-1 + (the-as part-tracker gp-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-2 run-function-in-process) + (a0-3 gp-0) + (a1-2 part-tracker-init) + (a2-4 (-> *part-group-id-table* 149)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> obj root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-2) + a0-3 + a1-2 + a2-4 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-0 ppointer) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch none vs sound-id. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 18] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 36] +(defmethod play-impact-sound ashelin-shot ((obj ashelin-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (the-as + sound-id + (cond + ((zero? v1-0) + (sound-play "ashelin-fire") + ) + ((= v1-0 (projectile-options lose-altitude)) + (sound-play "ashelin-shot-hi") + ) + ((= v1-0 (projectile-options lose-altitude proj-options-2)) + ((the-as (function projectile projectile-options none) (find-parent-method ashelin-shot 28)) obj arg0) + ) + ) + ) + ) + ) + +(defmethod made-impact? ashelin-shot ((obj ashelin-shot)) + "TODO - queries the collision cache, return true/false" + (let ((v1-0 (-> obj root-override)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a1-0 t1-0)) + (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a1-0 ignore-process0) obj) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) + ) + ) + +(defun ashelin-shot-move ((arg0 ashelin-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root-override))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 40960.0 f0-0) + (vector-normalize! s4-0 40960.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (let ((v1-9 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-5 (-> arg0 hit-pos)) + ) + (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector+! a1-5 a1-5 v1-9) + (move-to-point! (-> arg0 root-override) a1-5) + ) + (go (the-as (state ashelin) (method-of-object arg0 impact))) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init-collision! ashelin-shot ((obj ashelin-shot)) + "Init the [[projectile]]'s [[collide-shape]]" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> obj root-override) s5-0) + ) + (set! (-> obj root-override pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) + ) + (let ((v1-23 (-> obj parent))) + (when (not (logtest? (-> (the-as ashelin (if v1-23 + (the-as ashelin (-> v1-23 0 self)) + ) + ) + bot-flags + ) + (bot-flags attacked) + ) + ) + (let* ((a0-17 (-> obj root-override)) + (v1-27 (-> a0-17 root-prim)) + ) + (countdown (a0-18 (-> a0-17 total-prims)) + (logclear! (-> v1-27 prim-core collide-with) (collide-spec jak)) + (&+! v1-27 80) + ) + ) + ) + ) + (none) + ) + +(defmethod init-proj-settings! ashelin-shot ((obj ashelin-shot)) + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc + :virtual" + (set! (-> obj tail-pos quad) (-> obj root-override trans quad)) + (set! (-> obj attack-mode) 'eco-yellow) + (set! (-> obj max-speed) 307200.0) + (set! (-> obj move) ashelin-shot-move) + (set! (-> obj timeout) (seconds 1.335)) + (none) + ) diff --git a/goal_src/jak2/characters/ashelin/ash-states.gc b/goal_src/jak2/characters/ashelin/ash-states.gc index 3568ba7a6a..48fac93b95 100644 --- a/goal_src/jak2/characters/ashelin/ash-states.gc +++ b/goal_src/jak2/characters/ashelin/ash-states.gc @@ -7,3 +7,1161 @@ ;; DECOMP BEGINS +(defstate waiting-idle (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + 0 + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 3))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 (-> self draw art-group data 29))) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + (ja-no-eval :group! (-> self draw art-group data 30) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (let ((v1-55 (ja-group))) + (cond + ((and v1-55 (= v1-55 (-> self draw art-group data 30))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +(defstate standing-idle (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (none) + ) + :trans (behavior () + (bot-method-223 self #t) + (cond + ((bot-method-214 self) + (cond + ((ashelin-method-238 self #t #t) + (when (and (ashelin-method-235 self #t) (let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 (-> self draw art-group data 29))) + ) + ) + (cond + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ((ashelin-method-235 self #f) + (go-virtual standing-blast) + ) + (else + (let ((a1-4 (ashelin-method-242 self))) + (if (nonzero? a1-4) + (ashelin-method-240 self (the-as int a1-4)) + ) + ) + ) + ) + ) + (let ((a1-5 (ashelin-method-246 self))) + (cond + ((nonzero? a1-5) + (ashelin-method-240 self a1-5) + ) + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ) + ) + ) + (else + (let ((a1-6 (ashelin-method-246 self))) + (cond + ((nonzero? a1-6) + (ashelin-method-240 self a1-6) + ) + (else + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (ashelin-method-247 self) + ) + (go-virtual chase) + ) + ) + ) + ) + ) + ) + (when (logtest? (bot-flags bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (let ((a1-7 (ashelin-method-241 self))) + (if (nonzero? a1-7) + (ashelin-method-240 self (the-as int a1-7)) + ) + ) + ) + ) + (else + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (ashelin-method-239 self) + ) + ) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 29))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (or (= v1-16 (-> self draw art-group data 27)) + (= v1-16 (-> self draw art-group data 31)) + (= v1-16 (-> self draw art-group data 32)) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + ((let ((v1-31 (ja-group))) + (and v1-31 (= v1-31 (-> self draw art-group data 3))) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 27) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 29) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +(defstate standing-turn (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (bot-method-214 self) + (let ((a1-1 (ashelin-method-246 self))) + (if (nonzero? a1-1) + (ashelin-method-240 self a1-1) + ) + ) + (when (logtest? (bot-flags bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (let ((a1-2 (ashelin-method-241 self))) + (if (nonzero? a1-2) + (ashelin-method-240 self (the-as int a1-2)) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) + (let ((s5-0 (-> self focus-info fproc))) + (if (not s5-0) + (ashelin-method-239 self) + ) + (turn-to-target self gp-0 s5-0 0.335) + ) + (let ((s4-0 (-> self draw art-group data (if (>= (-> gp-0 predicted-ry-diff) 0.0) + 31 + 32 + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-1 (new 'stack-no-clear 'quaternion)) + (f0-1 (-> gp-0 predicted-ry-diff)) + (f30-0 0.0) + (f28-0 10.0) + ) + (quaternion-rotate-y! s5-1 (-> gp-0 src-quat) f0-1) + (ja-no-eval :group! s4-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)) 2.0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((f0-6 (ja-aframe-num 0))) + (cond + ((< f0-6 f28-0) + (if (>= f0-6 f30-0) + (quaternion-slerp! (-> self root-override2 quat) (-> gp-0 src-quat) s5-1 (/ (- f0-6 f30-0) (- f28-0 f30-0))) + ) + ) + (else + (quaternion-copy! (-> self root-override2 quat) s5-1) + ) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + ) + ) + (go-virtual standing-idle) + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +(defstate traveling (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info-override callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-5 enemy-flags)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-165 self) + (set! (-> self player-blocking) 0.0) + (none) + ) + :trans (behavior () + (if (logtest? (-> self focus-status) (focus-status grabbed)) + (go-virtual waiting-idle) + ) + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) + (ashelin-method-239 self) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + (go-virtual traveling-blocked) + ) + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ) + 0 + (none) + ) + :code (behavior () + (until #f + (ashelin-method-249 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self spot)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 center quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate traveling-blocked (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + (go-virtual traveling) + ) + ) + (none) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +(defstate stare (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (when (bot-method-214 self) + (if (ashelin-method-238 self #t #f) + (go-virtual standing-idle) + ) + ) + (if (not (nav-enemy-method-163 self)) + (go-virtual traveling) + ) + ) + (none) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + ) + +(defstate standing-blast (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (if (not (handle->process (-> self focus handle))) + (enemy-method-72 self) + ) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (none) + ) + :code (behavior () + (bot-method-223 self #t) + (if (or (not (bot-method-214 self)) (not (ashelin-method-235 self #f))) + (enemy-method-72 self) + ) + (let ((v1-12 (ja-group))) + (if (and v1-12 (or (= v1-12 (-> self draw art-group data 29)) (= v1-12 (-> self draw art-group data 28)))) + (ja-channel-push! 1 (seconds 0.03)) + (ja-channel-push! 1 (seconds 0.08)) + ) + ) + (let ((gp-0 #f)) + (ja-no-eval :group! (-> self draw art-group data 28) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (and (not gp-0) (>= (ja-aframe-num 0) 7.0)) + (set! gp-0 #t) + (fire-projectile self (-> self focus-info bullseye)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (cond + ((logtest? (-> self bot-flags) (bot-flags attacked)) + (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) + (reset-attacker! self) + ) + ((logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) + (ashelin-method-245 self) + ) + ) + (enemy-method-72 self) + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +(defstate chase (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (nav-enemy-method-166 self) + (none) + ) + :trans (behavior () + (bot-method-223 self #t) + (cond + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ((not (bot-method-214 self)) + (go-virtual traveling) + ) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (if (or (ashelin-method-238 self #t #f) (ashelin-method-248 self)) + (go-virtual standing-idle) + ) + ) + (let ((gp-0 (-> self nav))) + (set! (-> gp-0 target-speed) (lerp-scale + (-> self enemy-info-override walk-travel-speed) + (-> self enemy-info-override run-travel-speed) + (-> self focus-info bullseye-xz-dist) + 81920.0 + 92160.0 + ) + ) + ) + 0 + (none) + ) + :code (behavior () + (until #f + (ashelin-method-249 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-6 (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate back-spring (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-167 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override2 trans) (-> self move-dest)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root-override2 quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (ja-no-eval :group! (-> self draw art-group data 33) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (quaternion-slerp! (-> self root-override2 quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-30 *game-info*) + (a0-11 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-11) + (set! (-> self attack-id) a0-11) + ) + (countdown (s5-1 2) + (vector-! gp-1 (-> self move-dest) (-> self root-override2 trans)) + (let ((a0-14 (-> self nav state)) + (v1-33 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-33 quad)) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 acceleration) 1638400.0) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-40 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-40 enemy-flags))) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-40 enemy-flags)))) + ) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-40 enemy-flags)))) + (set! (-> v1-40 nav callback-info) (-> v1-40 enemy-info-override callback-info)) + ) + 0 + (let ((f0-13 (* 1.6153771 (vector-length gp-1)))) + (let ((v1-46 (-> self nav))) + (set! (-> v1-46 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 34) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) frames num-frames) -1)) 1.4) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-12 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-12 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-negate! gp-1 gp-1) + (quaternion-set! (-> self root-override2 quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root-override2 quat)) + (suspend) + (ja :num! (seek! max 1.4)) + ) + (bot-method-223 self #f) + (if (or (not (bot-method-214 self)) (!= (ashelin-method-246 self) 1)) + (goto cfg-15) + ) + ) + ) + (label cfg-15) + (let ((v1-92 self)) + (set! (-> v1-92 enemy-flags) (the-as enemy-flag (logclear (-> v1-92 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-92 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! (-> self draw art-group data 35) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate cartwheel-left (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-167 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root-override2 trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root-override2 quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 -16384.0) + (ja-no-eval :group! (-> self draw art-group data 36) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 36)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (quaternion-slerp! (-> self root-override2 quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info-override callback-info)) + ) + 0 + (let ((f0-13 (* 1.0714335 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 37) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 37)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 -16384.0) + (quaternion-set! (-> self root-override2 quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root-override2 quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-78 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! (-> self draw art-group data 38) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 38)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate tumble-right (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-167 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root-override2 trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root-override2 quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 16384.0) + (ja-no-eval :group! (-> self draw art-group data 39) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (quaternion-slerp! (-> self root-override2 quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info-override callback-info)) + ) + 0 + (let ((f0-13 (* 1.8749386 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 40) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 40)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 16384.0) + (quaternion-set! (-> self root-override2 quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root-override2 quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-78 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! (-> self draw art-group data 41) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate hit (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + 0 + (none) + ) + :code (behavior () + (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? v1-6 (enemy-flag checking-water)) + (set! v1-7 (logior v1-6 (enemy-flag enable-on-active))) + (set! v1-7 (logclear v1-6 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-7) + (if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> self mask) (logior (process-mask collectable) (-> self mask))) + (logclear! (-> self mask) (process-mask collectable)) + ) + (let ((v1-14 (-> self enemy-flags))) + (if (logtest? (enemy-flag no-initial-move-to-ground) v1-14) + (set! v1-15 (logior (enemy-flag check-water-backup) v1-14)) + (set! v1-15 (logclear v1-14 (enemy-flag check-water-backup))) + ) + ) + (set! (-> self enemy-flags) v1-15) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> self focus-status) (focus-status hit)) + (enemy-method-72 self) + (none) + ) + ) + +(defstate knocked (ashelin) + :virtual #t + :enter (behavior () + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + (let ((t9-0 (-> (method-of-type bot knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self bot-flags) (bot-flags bf23)) + (when (and (nonzero? (-> self hit-points)) (zero? (-> self fated-time))) + (if (logtest? (-> self bot-flags) (bot-flags bf04)) + (logior! (-> self bot-flags) (bot-flags bf12)) + (set! (-> self bot-flags) (logior (bot-flags bf23) (-> self bot-flags))) + ) + ) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type bot knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (bot-flags bf23) (-> self bot-flags)) (!= (-> self state-time) (-> self clock frame-counter))) + (logclear! (-> self bot-flags) (bot-flags bf23)) + (ashelin-method-244 self) + ) + (none) + ) + ) + +(defstate die-falling (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :code (behavior () + (let ((v1-1 (get-rand-int self 3))) + (cond + ((zero? v1-1) + (play-death-sound self "asha057") + ) + ((= v1-1 1) + (play-death-sound self "asha055") + ) + (else + (play-death-sound self "asha056") + ) + ) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (or (= v1-10 (-> self draw art-group data 9)) (= v1-10 (-> self draw art-group data 12)))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (enemy-method-133 self) + (-> self enemy-info-override die-falling-anim) + (-> self enemy-info-override die-anim) + ) + ) + ) + (f30-0 (get-rand-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + (until #f + (if (and (logtest? (-> self bot-flags) (bot-flags failed)) (reset? *fail-mission-control*)) + (reset! *fail-mission-control*) + ) + (suspend) + ) + #f + (none) + ) + ) + +(defstate failed (ashelin) + :virtual #t + :enter (behavior () + (go-virtual die-falling) + (none) + ) + ) diff --git a/goal_src/jak2/characters/ashelin/ash-task.gc b/goal_src/jak2/characters/ashelin/ash-task.gc index fa8690cdbe..8693101074 100644 --- a/goal_src/jak2/characters/ashelin/ash-task.gc +++ b/goal_src/jak2/characters/ashelin/ash-task.gc @@ -7,3 +7,74 @@ ;; DECOMP BEGINS +(defmethod reset-task! asht-wait-spot ((obj asht-wait-spot)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +(defmethod ai-task-method-11 asht-wait-spot ((obj asht-wait-spot) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (when (>= s4-0 0) + (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) + (set! s4-0 -1) + ) + ) + ) + (when (< s4-0 0) + (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) + (set! (-> obj which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + 20 + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + ) + (when (not ((-> obj check-done) obj (the-as ashelin arg0))) + (let ((a1-10 (handle->process (-> arg0 focus handle)))) + (when (and a1-10 + (attacked-by-player? arg0 (the-as process-focusable a1-10)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) asht-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + (none) + ) + +(defmethod ai-task-method-11 asht-fight-focus ((obj asht-fight-focus) (arg0 bot)) + "Virtual" + (let ((a1-1 (handle->process (-> arg0 focus handle)))) + (if (and a1-1 + (attacked-by-player? arg0 (the-as process-focusable a1-1)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (logior! (-> arg0 bot-flags) (bot-flags bf00)) + (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch bot-flags vs none. +(defmethod ai-task-method-10 asht-fight-focus ((obj asht-fight-focus) (arg0 bot)) + "Virtual" + (logclear! (-> arg0 bot-flags) (bot-flags bf00)) + (none) + ) diff --git a/goal_src/jak2/characters/ashelin/ash.gc b/goal_src/jak2/characters/ashelin/ash.gc index 1a48beb64c..011a23407f 100644 --- a/goal_src/jak2/characters/ashelin/ash.gc +++ b/goal_src/jak2/characters/ashelin/ash.gc @@ -7,3 +7,1359 @@ ;; DECOMP BEGINS +(deftype ashelin-anim-info (structure) + ((anim-index int32 :offset-assert 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + + +(deftype ashelin-global-info (basic) + ((prev-blue-hit int8 :offset-assert 4) + (blue-hit-anim int32 6 :offset-assert 8) + (blue-hit-land-anim int32 6 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + + +(define *ashelin-global-info* (new 'static 'ashelin-global-info + :blue-hit-anim (new 'static 'array int32 6 13 14 15 19 20 21) + :blue-hit-land-anim (new 'static 'array int32 6 16 17 18 22 23 24) + ) + ) + +(define *ashelin-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim -1 + :hit-anim 3 + :knocked-anim 10 + :knocked-land-anim 11 + :die-anim 26 + :die-falling-anim 26 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 10 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.7 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 57344.0 + :knocked-soft-vxz-hi 57344.0 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 81920.0 + :knocked-medium-vxz-lo 57344.0 + :knocked-medium-vxz-hi 57344.0 + :knocked-medium-vy-lo 81920.0 + :knocked-medium-vy-hi 81920.0 + :knocked-hard-vxz-lo 57344.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 81920.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 57344.0 + :knocked-yellow-vxz-hi 57344.0 + :knocked-yellow-vy-lo 81920.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 57344.0 + :knocked-red-vxz-hi 57344.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 6 + :taunt-anim -1 + :run-travel-speed (meters 10) + :run-acceleration (meters 25) + :run-turning-acceleration (meters 12) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 5) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 360.0) + :notice-nav-radius (meters 20) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod enemy-method-59 ashelin ((obj ashelin)) + (let* ((t9-0 (method-of-type bot enemy-method-59)) + (v0-0 (t9-0 obj)) + ) + (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (set! v0-0 (logior (penetrate jak-yellow-shot) v0-0)) + ) + v0-0 + ) + ) + +;; WARN: Return type mismatch penetrate vs none. +(defmethod ashelin-method-250 ashelin ((obj ashelin) (arg0 symbol)) + (if arg0 + (set! (-> obj bot-flags) (logior (bot-flags bf22) (-> obj bot-flags))) + (logclear! (-> obj bot-flags) (bot-flags bf22)) + ) + (set! (-> obj root-override2 penetrated-by) (enemy-method-59 obj)) + (none) + ) + +(defmethod bot-method-193 ashelin ((obj ashelin)) + (let* ((t9-0 (method-of-type bot bot-method-193)) + (v0-0 (t9-0 obj)) + ) + (when (and (not v0-0) (logtest? #x400000 (-> obj incoming penetrate-using))) + (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (set! v0-0 #t) + ) + (set! (-> obj bot-flags) (logior (bot-flags bf21) (-> obj bot-flags))) + ) + v0-0 + ) + ) + +(defmethod enemy-method-106 ashelin ((obj ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) + (let ((t9-0 (method-of-type bot enemy-method-106))) + (t9-0 obj arg0 arg1 arg2 arg3) + ) + (if (!= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) + (set! (-> obj incoming knocked-type) (knocked-type knocked-type-1)) + ) + (none) + ) + +(defmethod enemy-method-104 ashelin ((obj ashelin) (arg0 process) (arg1 uint) (arg2 uint)) + (if (and (= (-> arg0 type) target) + (-> obj next-state) + (let ((v1-4 (-> obj next-state name))) + (or (= v1-4 'back-spring) (= v1-4 'cartwheel-left) (= v1-4 'tumble-right)) + ) + ) + #f + ((method-of-type bot enemy-method-104) obj arg0 arg1 arg2) + ) + ) + +(defmethod enemy-method-97 ashelin ((obj ashelin)) + (with-pp + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 5)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 2.5)) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> obj focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) + (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + (else + (clear-focused (-> obj focus)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + s5-1 + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod alive? ashelin ((obj ashelin)) + (let ((t9-0 (method-of-type bot alive?))) + (the-as + symbol + (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) + ) + ) + ) + ) + ) + +(defmethod enemy-method-114 ashelin ((obj ashelin)) + "@abstract" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-12 prim-core action) (collide-action solid can-ride deadly)) + (set-vector! (-> v1-12 local-sphere) 0.0 3276.8 0.0 3276.8) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-14 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-14 local-sphere) 0.0 5324.8 0.0 3276.8) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-16 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-16 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-16 local-sphere) 0.0 7372.8 0.0 3276.8) + ) + (set! (-> s5-0 nav-radius) 5120.0) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 7)) + (set! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +(defmethod enemy-method-115 ashelin ((obj ashelin)) + "@abstract" + (init! obj) + (set! (-> obj channel) (the-as uint 22)) + (set! (-> obj travel-anim-interp) 0.0) + (set! (-> obj focus-info max-los-dist) 204800.0) + (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 0)) + (set! (-> obj hit-invuln-focus-disable-delay) (the-as uint 750)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (enemy-method-113 obj *ashelin-nav-enemy-info*) + (let ((v1-10 (-> obj neck))) + (set! (-> v1-10 up) (the-as uint 1)) + (set! (-> v1-10 nose) (the-as uint 2)) + (set! (-> v1-10 ear) (the-as uint 0)) + (set-vector! (-> v1-10 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-10 ignore-angle) 30947.555) + ) + (let ((t9-4 (method-of-type bot enemy-method-115))) + (t9-4 obj) + ) + (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + 0 + (none) + ) + +;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod ashelin-method-238 ashelin ((obj ashelin) (arg0 symbol) (arg1 symbol)) + (cond + ((and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) + #t + ) + (else + (let ((f0-0 81920.0)) + (if arg1 + (set! f0-0 (+ 6144.0 f0-0)) + ) + (when (>= f0-0 (-> obj focus-info bullseye-xz-dist)) + (let ((v1-9 (-> obj focus-info los))) + (if arg0 + (or (= v1-9 1) (= v1-9 4)) + (= v1-9 1) + ) + ) + ) + ) + ) + ) + ) + +(defmethod ashelin-method-235 ashelin ((obj ashelin) (arg0 symbol)) + (with-pp + (and (>= (- (-> pp clock frame-counter) (-> obj last-fire-time)) (seconds 1)) + (and (>= 8556.089 (fabs (-> obj focus-info ry-diff))) (ashelin-method-238 obj arg0 #t)) + ) + ) + ) + +(defmethod ashelin-method-243 ashelin ((obj ashelin) (arg0 float)) + (let ((f30-0 (deg- arg0 (-> obj focus-info my-facing-ry)))) + (when (>= 16384.0 (fabs f30-0)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s5-0 (-> obj root-override2 trans)) + (return 1) + ) + (cond + ((< 0.0 f30-0) + (when (ashelin-method-236 obj s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s5-0 (-> obj root-override2 trans)) + (return 2) + ) + ) + (else + (when (ashelin-method-236 obj s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s5-0 (-> obj root-override2 trans)) + (return 3) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod ashelin-method-246 ashelin ((obj ashelin)) + (when (>= 32768.0 (-> obj focus-info bullseye-xz-dist)) + (let ((f0-1 (-> obj focus-info bullseye-ry))) + (return (ashelin-method-243 obj f0-1)) + ) + ) + (when (logtest? (bot-flags bf20) (-> obj bot-flags)) + (set! (-> obj root-override2 trans w) 1.0) + (when (>= (vector4-dot (the-as vector (-> obj frontline)) (-> obj root-override2 trans)) 12288.0) + (let ((f0-7 (atan (-> obj frontline x) (-> obj frontline z)))) + (return (ashelin-method-243 obj f0-7)) + ) + ) + ) + 0 + ) + +(defmethod ashelin-method-241 ashelin ((obj ashelin)) + (let* ((v1-0 (target-pos 0)) + (a1-0 (-> obj root-override2 trans)) + (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) + (f0-5 (deg- f30-0 (-> obj focus-info my-facing-ry))) + (s5-0 0) + ) + (cond + ((or (>= 8192.0 (fabs f0-5)) (>= (fabs f0-5) 24576.0)) + (let ((s3-1 (zero? (get-rand-int obj 2))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s2-0 2) + (cond + (s3-1 + (when (ashelin-method-236 obj s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-0 (-> obj root-override2 trans)) + (set! s5-0 3) + (goto cfg-20) + ) + ) + (else + (when (ashelin-method-236 obj s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-0 (-> obj root-override2 trans)) + (set! s5-0 2) + (goto cfg-20) + ) + ) + ) + (set! s3-1 (not s3-1)) + ) + ) + (label cfg-20) + ) + (else + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-1 (-> obj root-override2 trans)) + (set! s5-0 1) + ) + ) + ) + ) + s5-0 + ) + ) + +(defmethod ashelin-method-242 ashelin ((obj ashelin)) + (let ((s5-0 0)) + (cond + ((zero? (get-rand-int obj 2)) + (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s4-0 (+ 16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-0 (-> obj root-override2 trans)) + (set! s5-0 3) + ) + ) + ) + ) + (else + (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s4-1 (+ -16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-1 (-> obj root-override2 trans)) + (set! s5-0 2) + ) + ) + ) + ) + ) + s5-0 + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod ashelin-method-240 ashelin ((obj ashelin) (arg0 int)) + (case arg0 + ((3) + (go (method-of-object obj cartwheel-left)) + ) + ((2) + (go (method-of-object obj tumble-right)) + ) + (else + (go (method-of-object obj back-spring)) + ) + ) + (none) + ) + +(defmethod ashelin-method-247 ashelin ((obj ashelin)) + (cond + ((logtest? (bot-flags bf20) (-> obj bot-flags)) + (set! (-> obj root-override2 trans w) 1.0) + (set! (-> obj focus-info bullseye w) 1.0) + (let ((f30-0 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root-override2 trans)))) + (let ((f0-4 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye)))) + (if (or (>= 0.0 f0-4) (>= -8192.0 f30-0)) + (return #t) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root-override2 trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> obj frontline)))) + (return #t) + ) + (if (>= f30-0 0.0) + (return #f) + ) + (let ((a2-0 (new 'stack-no-clear 'vector)) + (a0-8 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a2-0 (the-as vector (-> obj frontline)) (- (-> obj frontline w))) + (set! (-> a0-8 quad) (-> obj root-override2 trans quad)) + (set! (-> a0-8 y) 0.0) + (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> obj frontline)) 8192.0) + ) + ) + ) + ) + (else + #t + ) + ) + ) + +(defmethod ashelin-method-248 ashelin ((obj ashelin)) + (when (logtest? (bot-flags bf20) (-> obj bot-flags)) + (set! (-> obj root-override2 trans w) 1.0) + (set! (-> obj focus-info bullseye w) 1.0) + (let ((f0-3 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root-override2 trans))) + (f1-1 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye))) + ) + (when (and (< 0.0 f1-1) (< 0.0 f0-3)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root-override2 trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s5-0 (the-as vector (-> obj frontline))) 0.0) + ) + ) + ) + ) + ) + +(defmethod go-hostile ashelin ((obj ashelin)) + (bot-method-223 obj #t) + (cond + ((not (bot-method-214 obj)) + (enemy-method-72 obj) + ) + ((ashelin-method-238 obj #t #f) + (go (method-of-object obj standing-idle)) + ) + ((ashelin-method-247 obj) + (go (method-of-object obj chase)) + ) + (else + (go (method-of-object obj standing-idle)) + ) + ) + (none) + ) + +(defmethod enemy-method-72 ashelin ((obj ashelin)) + (if (bot-method-214 obj) + (go-hostile obj) + (ashelin-method-239 obj) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod ashelin-method-239 ashelin ((obj ashelin)) + (if (bot-method-214 obj) + (go (method-of-object obj standing-idle)) + (go (method-of-object obj waiting-idle)) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-idle ashelin ((obj ashelin)) + (go (method-of-object obj hidden)) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod fire-projectile ashelin ((obj ashelin) (arg0 vector)) + (with-pp + (set! (-> obj last-fire-time) (-> pp clock frame-counter)) + (+! (-> obj fired-gun-count) 1) + (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options account-for-target-velocity proj-options-8000)) + (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 ignore-handle) (process->handle obj)) + (let* ((v1-13 *game-info*) + (a0-10 (+ (-> v1-13 attack-id) 1)) + ) + (set! (-> v1-13 attack-id) a0-10) + (set! (-> s4-0 attack-id) a0-10) + ) + (set! (-> s4-0 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector<-cspace! (-> s4-0 pos) (-> obj node-list data 22)) + (set! (-> s4-0 vel quad) (-> arg0 quad)) + (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) + (vector-normalize! (-> s4-0 vel) 307200.0) + (spawn-projectile ashelin-shot s4-0 obj *default-dead-pool*) + ) + (none) + ) + ) + +(defmethod ashelin-method-249 ashelin ((obj ashelin)) + (with-pp + (let* ((f30-0 (-> obj nav state speed)) + (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) + (f1-0 (-> obj travel-anim-interp)) + (v1-5 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-5 (= v1-5 (-> obj draw art-group data 5))) + (let ((f28-0 f1-0) + (f0-4 (seek f1-0 f0-1 (* 4.0 (-> pp clock seconds-per-frame)))) + ) + (cond + ((logtest? (bot-flags bf19) (-> obj bot-flags)) + (if (< f0-4 1.0) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-17 (-> obj skel root-channel 1))) + (set! (-> v1-17 dist) 13107.2) + (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + ) + (logclear! (-> obj bot-flags) (bot-flags bf19)) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + (else + (if (< 1.0 f0-4) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-27 (-> obj skel root-channel 1))) + (set! (-> v1-27 dist) 43690.68) + (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + ) + (set! (-> obj bot-flags) (logior (bot-flags bf19) (-> obj bot-flags))) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + ) + (set! (-> obj travel-anim-interp) f0-4) + (let ((f0-7 (if (logtest? (bot-flags bf19) (-> obj bot-flags)) + (+ -1.0 f0-4) + (- 1.0 f0-4) + ) + ) + (v1-39 (-> obj skel root-channel 1)) + ) + (set! (-> v1-39 frame-interp 1) f0-7) + (set! (-> v1-39 frame-interp 0) f0-7) + ) + ) + (let* ((f28-1 (current-cycle-distance (-> obj skel))) + (f0-8 (quaternion-y-angle (-> obj root-override2 quat))) + (f1-10 (deg- f0-8 (-> obj travel-prev-ry))) + (f0-11 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-10)))) + (f0-14 (/ (* 16.0 (fmax f30-0 f0-11)) (* 15.0 f28-1))) + (a0-22 (-> obj skel root-channel 0)) + ) + (set! (-> a0-22 param 0) f0-14) + (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-23 (-> obj skel root-channel 1))) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (let ((f30-1 (seek f1-0 f0-1 (* 4.0 (-> pp clock seconds-per-frame))))) + (set! (-> obj travel-anim-interp) f30-1) + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-26 (-> obj skel root-channel 0))) + (set! (-> a0-26 dist) 26214.4) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-26 param 0) 1.0) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + ) + (cond + ((< f30-1 1.0) + (let ((f0-22 (- 1.0 f30-1)) + (a0-27 (-> obj skel root-channel 1)) + ) + (set! (-> a0-27 frame-interp 1) f0-22) + (set! (-> a0-27 frame-interp 0) f0-22) + (set! (-> a0-27 dist) 13107.2) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> a0-27 param 0) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-chan) + ) + (logclear! (-> obj bot-flags) (bot-flags bf19)) + ) + (else + (let ((f0-26 (+ -1.0 f30-1)) + (a0-29 (-> obj skel root-channel 1)) + ) + (set! (-> a0-29 frame-interp 1) f0-26) + (set! (-> a0-29 frame-interp 0) f0-26) + (set! (-> a0-29 dist) 43690.68) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-29 param 0) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + ) + (set! (-> obj bot-flags) (logior (bot-flags bf19) (-> obj bot-flags))) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod enemy-method-51 ashelin ((obj ashelin)) + (local-vars (v1-36 art-element)) + (let ((f28-0 (quaternion-y-angle (-> obj root-override2 quat)))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let ((a0-4 (handle->process (-> obj focus handle)))) + (when a0-4 + (get-trans (the-as process-focusable a0-4) 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> obj root-override2 transv quad)) + (if (< (vector-dot + (-> obj root-override2 transv) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override2 quat)) + ) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f28-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (vector-z-quaternion! s5-1 (-> obj root-override2 quat)) + (let ((f28-1 (atan (-> s5-1 x) (-> s5-1 z)))) + (enemy-method-50 obj s5-1) + (let* ((f30-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f0-10 (deg- f30-0 f28-1)) + ) + (set! f28-0 (if (>= 16384.0 (fabs f0-10)) + f30-0 + (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48)) + ) + ) + (cond + ((and (>= 8192.0 f0-10) (>= f0-10 -16384.0)) + (set! v1-36 (-> obj draw art-group data 10)) + ) + ((>= f0-10 8192.0) + (set! v1-36 (-> obj draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ((zero? (get-rand-int obj 3)) + (set! v1-36 (-> obj draw art-group data 10)) + ) + (else + (set! v1-36 (-> obj draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ) + ) + ) + ) + (set! (-> obj knocked-anim) (the-as art-joint-anim v1-36)) + ) + ) + f28-0 + ) + ) + +(defmethod enemy-method-77 ashelin ((obj ashelin) (arg0 (pointer float))) + (local-vars (a2-0 int)) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let ((s5-1 (ash 1 (-> *ashelin-global-info* prev-blue-hit))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + (vector-z-quaternion! s4-0 (-> obj root-override2 quat)) + (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (enemy-method-50 obj s4-0) + (let* ((f0-6 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-8 (fabs (deg- f0-6 f30-0))) + ) + (if (>= 16384.0 f0-8) + (set! a2-0 (logior s5-1 7)) + (set! a2-0 (logior s5-1 56)) + ) + ) + ) + ) + (let* ((v1-9 (enemy-method-120 obj 6 a2-0)) + (s5-2 (-> obj draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9))) + ) + (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) + (let ((v1-12 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-12 (or (= v1-12 (-> obj draw art-group data 16)) + (= v1-12 (-> obj draw art-group data 17)) + (= v1-12 (-> obj draw art-group data 18)) + (= v1-12 (-> obj draw art-group data 22)) + (= v1-12 (-> obj draw art-group data 23)) + (= v1-12 (-> obj draw art-group data 24)) + ) + ) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-38 (-> obj skel root-channel 0))) + (set! (-> a0-38 frame-group) (the-as art-joint-anim s5-2)) + (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) + (set! (-> a0-38 param 1) 1.0) + (set! (-> a0-38 frame-num) 0.0) + (joint-control-channel-group! a0-38 (the-as art-joint-anim s5-2) num-func-seek!) + ) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-40 (-> obj skel root-channel 0))) + (set! (-> a0-40 frame-group) (-> obj knocked-anim)) + (set! (-> a0-40 param 0) (the float (+ (-> obj knocked-anim frames num-frames) -1))) + (set! (-> a0-40 param 1) (-> arg0 0)) + (set! (-> a0-40 frame-num) 0.0) + (joint-control-channel-group! a0-40 (-> obj knocked-anim) num-func-seek!) + ) + #t + ) + ) + ) + +(defmethod enemy-method-78 ashelin ((obj ashelin) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let* ((v1-1 *ashelin-global-info*) + (s5-0 (-> obj draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit)))) + ) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-7 (-> obj skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim s5-0)) + (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) + (set! (-> a0-7 param 1) 1.0) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim s5-0) num-func-seek!) + ) + ) + #t + ) + (else + (let ((v1-15 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-15 (= v1-15 (-> obj draw art-group data 7))) + (cond + ((or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-14 (-> obj skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 9))) + (set! (-> a0-14 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 9)) frames num-frames) -1)) + ) + (set! (-> a0-14 param 1) 1.0) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 9)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-16 (-> obj skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-16 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 8)) frames num-frames) -1)) + ) + (set! (-> a0-16 param 1) 1.0) + (set! (-> a0-16 frame-num) 0.0) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-seek!) + ) + #t + ) + ) + ) + ((and (or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) (nonzero? (get-rand-int obj 3))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-20 (-> obj skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (set! (-> a0-20 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-20 param 1) 1.0) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-22 (-> obj skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + ) + #t + ) + ) + ) + ) + ) + ) + +(defmethod enemy-method-79 ashelin ((obj ashelin) (arg0 int) (arg1 enemy-knocked-info)) + (cond + ((= arg0 3) + (let ((s5-0 (ja-done? 0))) + (cond + ((and s5-0 (let ((v1-4 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (and v1-4 (or (= v1-4 (-> obj draw art-group data 16)) + (= v1-4 (-> obj draw art-group data 17)) + (= v1-4 (-> obj draw art-group data 18)) + (= v1-4 (-> obj draw art-group data 22)) + (= v1-4 (-> obj draw art-group data 23)) + (= v1-4 (-> obj draw art-group data 24)) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-21 (-> obj skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 25))) + (set! (-> a0-21 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 25)) frames num-frames) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 25)) num-func-seek!) + ) + (set! s5-0 #f) + ) + (else + (let ((v1-25 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-25 (= v1-25 (-> obj draw art-group data 8))) + (let ((f0-4 (ja-aframe-num 0))) + (cond + ((>= f0-4 22.0) + (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) + (logior! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-4 16.0) + (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (logior! (-> obj focus-status) (focus-status dangerous)) + (let* ((v1-42 *game-info*) + (a0-34 (+ (-> v1-42 attack-id) 1)) + ) + (set! (-> v1-42 attack-id) a0-34) + (set! (-> obj attack-id) a0-34) + ) + ) + ) + ) + ) + ) + ((let ((v1-45 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (and v1-45 (= v1-45 (-> obj draw art-group data 11))) + ) + (let ((f0-5 (ja-aframe-num 0))) + (cond + ((>= f0-5 32.0) + (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) + (logior! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-5 25.0) + (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (logior! (-> obj focus-status) (focus-status dangerous)) + (let* ((v1-62 *game-info*) + (a0-47 (+ (-> v1-62 attack-id) 1)) + ) + (set! (-> v1-62 attack-id) a0-47) + (set! (-> obj attack-id) a0-47) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((a0-48 (-> obj skel root-channel 0))) + (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group frames num-frames) -1))) + (set! (-> a0-48 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type bot enemy-method-79) obj arg0 arg1) + ) + ) + ) + +(defmethod ashelin-method-236 ashelin ((obj ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (local-vars (v1-23 float) (sv-272 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let* ((v1-0 (-> obj nav)) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a1-1 (-> v1-0 sphere-id-array)) + (a2-2 (-> v1-0 state mesh bounds)) + (a3-1 (-> v1-0 root-nav-sphere)) + (t0-1 (-> v1-0 sphere-count)) + ) + (dotimes (t1-1 t0-1) + (let ((t3-0 (-> a0-3 (-> a1-1 t1-1))) + (t2-4 (-> v1-0 sphere-array t1-1)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-2) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-1 w))) + ) + ) + ) + 0 + (let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (vector-! (-> s0-0 current-pos) (-> obj root-override2 trans) (-> obj nav state mesh bounds)) + (set! sv-272 (-> s0-0 travel)) + (set! (-> sv-272 x) (sin arg1)) + (set! (-> sv-272 y) 0.0) + (set! (-> sv-272 z) (cos arg1)) + (set! (-> sv-272 w) 1.0) + (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) + (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) + (avoid-spheres-1! (-> obj nav) s0-0) + (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) + ) + 0 + (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) + (let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-no-gaps + (-> obj nav) + (-> obj root-override2 trans) + (-> obj nav state current-poly) + arg0 + t0-2 + ) + ) + (.lvf vf1 (&-> arg0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-23 vf1) + (let ((f0-11 v1-23) + (f1-1 arg4) + ) + (>= f0-11 (* f1-1 f1-1)) + ) + ) + ) + ) + +(defmethod nav-enemy-method-142 ashelin ((obj ashelin) (arg0 nav-control)) + (if (not (and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) + ) + ) + ) + ((method-of-type bot nav-enemy-method-142) obj arg0) + ) + (none) + ) + +(defmethod bot-method-216 ashelin ((obj ashelin)) + (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to obj))) + 0 + (none) + ) + +(defmethod play-attacked-speech ashelin ((obj ashelin)) + (local-vars (v1-3 int) (a3-0 int)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((v1-2 0)) + (if (logtest? #x3c00000 (-> obj incoming penetrate-using)) + (set! v1-3 (logior v1-2 128)) + (set! v1-3 (logior v1-2 64)) + ) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (set! a3-0 (logior v1-3 256)) + (set! a3-0 (logior v1-3 512)) + ) + (let ((a1-3 (bot-speech-list-method-9 + (-> obj ash-course attack-player-speeches) + obj + (-> obj ash-course speeches) + (the-as speech-flags a3-0) + ) + ) + ) + (if (>= a1-3 0) + (play-speech obj a1-3) + ) + ) + ) + (none) + ) + +(defmethod ashelin-method-244 ashelin ((obj ashelin)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((a1-2 + (bot-speech-list-method-9 (-> obj ash-course ouch-speeches) obj (-> obj ash-course speeches) (speech-flags)) + ) + ) + (if (>= a1-2 0) + (play-speech obj a1-2) + ) + ) + ) + (none) + ) + +(defmethod ashelin-method-245 ashelin ((obj ashelin)) + (with-pp + (when (and (not (channel-active? obj (the-as uint 0))) + (>= (-> pp clock frame-counter) (-> obj victory-speech-time)) + ) + (let ((s5-0 (bot-speech-list-method-9 + (-> obj ash-course victory-speeches) + obj + (-> obj ash-course speeches) + (speech-flags) + ) + ) + ) + (when (>= s5-0 0) + (set! (-> obj victory-speech-time) + (the-as time-frame (+ (get-rand-int-range obj 1200 2100) (-> pp clock frame-counter))) + ) + (play-speech obj s5-0) + ) + ) + ) + (none) + ) + ) + +(defmethod enemy-method-136 ashelin ((obj ashelin)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (the-as int (-> obj hit-focus-time))) (seconds 2)) + (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> obj enemy-flags) v0-0) + v0-0 + ) + ) + ) + ) + +;; WARN: Return type mismatch enemy-flag vs none. +(defmethod play-speech ashelin ((obj ashelin) (arg0 int)) + (let ((t9-0 (method-of-type bot play-speech))) + (t9-0 obj arg0) + ) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (none) + ) + +(defmethod draw hud-ashelin ((obj hud-ashelin)) + (set-hud-piece-position! + (-> obj sprites 2) + (the int (+ 30.0 (* -130.0 (-> obj offset)))) + (the int (+ 30.0 (* -100.0 (-> obj offset)))) + ) + (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 8 2) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-ashelin ((obj hud-ashelin)) + (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-ashelin ((obj hud-ashelin)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 0 scale-x) 12.0) + (set! (-> obj sprites 0 scale-y) 11.2) + (set! (-> obj sprites 0 pos z) #xfffff2) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> obj sprites 1 pos z) #xfffff0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 3 tex) + (lookup-texture-by-name "hud-ashlyn-head" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.4) + (set! (-> obj sprites 3 pos z) #xffffff) + 0 + (none) + ) diff --git a/goal_src/jak2/characters/sig/sig-h.gc b/goal_src/jak2/characters/sig/sig-h.gc index e9d2e062c1..5a0d991408 100644 --- a/goal_src/jak2/characters/sig/sig-h.gc +++ b/goal_src/jak2/characters/sig/sig-h.gc @@ -7,29 +7,192 @@ ;; DECOMP BEGINS +(deftype sig-plasma (structure) + ((flags uint8 :offset-assert 0) + (level float :offset-assert 4) + (min-level float :offset-assert 8) + (charge-speed float :offset-assert 12) + (powerup-sound-id sound-id :offset-assert 16) + (plasma-sound-id sound-id :offset-assert 20) + ) + :pack-me + :method-count-assert 15 + :size-assert #x18 + :flag-assert #xf00000018 + (:methods + (sig-plasma-method-9 (_type_) none 9) + (sig-plasma-method-10 (_type_) symbol 10) + (sig-plasma-method-11 (_type_ symbol) none 11) + (sig-plasma-method-12 (_type_) none 12) + (sig-plasma-method-13 (_type_) symbol 13) + (sig-plasma-method-14 (_type_ process-focusable) none 14) + ) + ) + + (deftype sig-path-sample (structure) - ((bytes uint8 32 :offset-assert 0) - (pos vector :inline :offset-assert 32) - (quat quaternion :inline :offset-assert 48) - (flags uint8 :offset 12) - (pos-x float :offset 32) - (pos-y float :offset 36) - (pos-z float :offset 40) - (quat-x float :offset 48) - (quat-y float :offset 52) - (quat-z float :offset 56) - (quat-w float :offset 60) + ((bytes uint8 32 :offset-assert 0) + (pos vector :inline :offset-assert 32) + (quat quaternion :inline :offset-assert 48) + (flags uint8 :offset 12) + (pos-x float :offset 32) + (pos-y float :offset 36) + (pos-z float :offset 40) + (quat-x float :offset 48) + (quat-y float :offset 52) + (quat-z float :offset 56) + (quat-w float :offset 60) ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) +;; ERROR: failed type prop at 14: add failed: sig-path-sample + + (deftype sig-path (basic) - ((sample-count int32 :offset-assert 4) - (samples (inline-array sig-path-sample) :offset-assert 8) + ((sample-count int32 :offset-assert 4) + (samples (inline-array sig-path-sample) :offset-assert 8) ) :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) + + +(deftype sig (bot) + ((fired-gun-count uint32 :offset-assert 992) + (sig-path sig-path :offset-assert 996) + (sig-path-clock clock :offset-assert 1000) + (travel-anim-interp float :offset-assert 1004) + (platform-index uint8 :offset-assert 1008) + (played-unjam-time time-frame :offset-assert 1016) + (sig-path-start-time time-frame :offset-assert 1024) + (sig-path-cur-time time-frame :offset-assert 1032) + (sig-path-prev-time time-frame :offset-assert 1040) + (plasma sig-plasma :inline :offset 1048) + (sig-path-prev-pos vector :inline :offset 368) + ) + :heap-base #x3b0 + :method-count-assert 259 + :size-assert #x430 + :flag-assert #x10303b00430 + (:methods + (whip () _type_ :state 225) + (blast () _type_ :state 226) + (chase () _type_ :state 227) + (chase-attack () _type_ :state 228) + (traveling () _type_ :state 229) + (traveling-blocked () _type_ :state 230) + (waiting-far () _type_ :state 231) + (waiting-close () _type_ :state 232) + (waiting-turn () _type_ :state 233) + (waiting-crouched () _type_ :state 234) + (charge-plasma () _type_ :state 235) + (gun-jam () _type_ :state 236) + (repair-gun () _type_ :state 237) + (clean-gun () _type_ :state 238) + (sig-path-run () _type_ :state 239) + (sig-path-jump () _type_ :state 240) + (sig-path-jump-land () _type_ :state 241) + (sig-path-shoot-jump () _type_ :state 242) + (sig-path-shoot-jump-land () _type_ :state 243) + (sig-path-idle () _type_ :state 244) + (sig-method-245 (_type_) symbol 245) + (sig-method-246 (_type_) symbol 246) + (fire-gun (_type_ vector) (pointer process) 247) + (sig-method-248 (_type_ sig-path-sample) none 248) + (sig-method-249 (_type_ sig-path) none 249) + (sig-method-250 (_type_) symbol 250) + (sig-method-251 (_type_) symbol 251) + (sig-method-252 (_type_) symbol 252) + (sig-method-253 (_type_) none 253) + (sig-method-254 (_type_) symbol 254) + (sig-method-255 (_type_) symbol 255) + (sig-method-256 (_type_) none 256) + (sig-method-257 (_type_) symbol 257) + (sig-method-258 (_type_) none 258) + ) + ) + + +(defskelgroup skel-sig sig 0 7 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow 2 + :origin-joint-index 25 + ) + +(deftype sigt-wait-spot (ai-task) + ((check-done (function sigt-wait-spot sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 6 :offset 38) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + + +(deftype sigt-choose-piston (ai-task) + ((check-done (function sigt-choose-piston sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + (actor-indexes uint8 4 :offset 42) + ) + :method-count-assert 15 + :size-assert #x30 + :flag-assert #xf00000030 + (:methods + (sigt-choose-piston-method-12 (_type_ sig) symbol 12) + (sigt-choose-piston-method-13 (_type_ sig) none 13) + (sigt-choose-piston-method-14 (_type_ sig int) symbol 14) + ) + ) + + +(deftype sigt-riding-piston (ai-task) + ((check-done (function sigt-riding-piston sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + ) + :method-count-assert 13 + :size-assert #x30 + :flag-assert #xd00000030 + (:methods + (sigt-riding-piston-method-12 (_type_ sig) symbol 12) + ) + ) + + +(deftype sigt-charge-plasma (ai-task) + ((check-done (function sigt-charge-plasma sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + (actor-index uint8 :offset 42) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + + +(deftype sigt-fight-focus (ai-task) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + + +(deftype sigt-repair-gun (ai-task) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) diff --git a/goal_src/jak2/characters/sig/sig-plasma.gc b/goal_src/jak2/characters/sig/sig-plasma.gc index 3dbb2bcbce..6150e05262 100644 --- a/goal_src/jak2/characters/sig/sig-plasma.gc +++ b/goal_src/jak2/characters/sig/sig-plasma.gc @@ -5,5 +5,271 @@ ;; name in dgo: sig-plasma ;; dgos: ATE, UNB +(declare-type sig-atoll sig) + ;; DECOMP BEGINS +(defun sparticle-sig-plasma-lightning ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-1 (-> arg1 key proc)) + (a1-2 (cond + ((= (-> v1-1 type) sig-atoll) + (-> v1-1 node-list data 24) + ) + (else + (let ((v1-3 (-> v1-1 parent))) + (-> (the-as sig-atoll (if v1-3 + (the-as sig-atoll (-> v1-3 0 self)) + ) + ) + node-list + data + 52 + ) + ) + ) + ) + ) + (v1-6 (vector<-cspace! (new 'stack-no-clear 'vector) a1-2)) + ) + (set! (-> arg2 x) (-> v1-6 x)) + (set! (-> arg2 y) (-> v1-6 y)) + (set! (-> arg2 z) (-> v1-6 z)) + ) + (sparticle-texture-animate arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-sig-plasma + :id 147 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 665) (sp-item 666 :flags (bit6)) (sp-item 667 :flags (bit6)) (sp-item 668 :flags (bit6))) + ) + +(defpart 667 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2.25) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 32.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 668 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 16.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +(defpart 666 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x43b)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 665 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xcc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.9)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0)) + (sp-flt spt-r 0.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-y (meters 0.0125)) + (sp-flt spt-fade-r 6.4) + (sp-flt spt-fade-g 6.4) + (sp-flt spt-fade-a 6.4) + (sp-int spt-timer 200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 15 1 0 #xc0cc00 #xc0cd00 #xc0ce00 #xc0cf00 #xc0d000 #xc0d100 #xc0d200) + ) + (sp-func spt-func 'sparticle-sig-plasma-lightning) + (sp-int-plain-rnd spt-next-time 15 4 1) + (sp-launcher-by-id spt-next-launcher 669) + ) + ) + +(defpart 669 + :init-specs ((sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-flt spt-scalevel-y (meters 0)) + (sp-flt spt-fade-r -8.533334) + (sp-flt spt-fade-g -8.533334) + (sp-flt spt-fade-a -8.533334) + (sp-int-plain-rnd spt-next-time 15 4 1) + (sp-launcher-by-id spt-next-launcher 670) + ) + ) + +(defpart 670 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters -0.00093750004) (meters -0.00093750004) 1.0) + (sp-rnd-flt spt-scalevel-y (meters -0.00078125) (meters -0.00078125) 1.0) + (sp-flt spt-fade-r -0.8) + (sp-flt spt-fade-g -0.8) + (sp-flt spt-fade-a -0.8) + ) + ) + +(defmethod sig-plasma-method-14 sig-plasma ((obj sig-plasma) (arg0 process-focusable)) + (with-pp + (let* ((f0-0 (-> obj level)) + (f30-0 (cond + ((logtest? (-> obj flags) 2) + (seek f0-0 1.0 (* (-> obj charge-speed) (-> pp clock seconds-per-frame))) + ) + (else + (let ((f1-1 (-> obj min-level))) + (when (< f0-0 f1-1) + (set! f1-1 f0-0) + (set! (-> obj min-level) f1-1) + ) + (seek f0-0 f1-1 (* 0.25 (-> pp clock seconds-per-frame))) + ) + ) + ) + ) + ) + (set! (-> obj level) f30-0) + (cond + ((= f30-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) (-> obj powerup-sound-id)) + (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) + ) + (let ((v1-11 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-11 command) (sound-command set-param)) + (set! (-> v1-11 id) (-> obj plasma-sound-id)) + (set! (-> v1-11 params volume) -4) + (set! (-> v1-11 auto-time) 24) + (set! (-> v1-11 auto-from) 2) + (set! (-> v1-11 params mask) (the-as uint 17)) + (-> v1-11 id) + ) + ) + (else + (let ((s4-0 (-> arg0 root-override trans))) + (if (movie?) + (set! s4-0 (camera-pos)) + ) + (let ((f28-0 (+ 0.25 (* 0.75 f30-0)))) + (sound-play-by-name + (static-sound-name "sig-gun-powerup") + (-> obj powerup-sound-id) + (the int (* 1024.0 f28-0)) + (the int (* 1524.0 (+ 0.5 (* 0.5 f30-0)))) + 0 + (sound-group sfx) + s4-0 + ) + (sound-play-by-name + (static-sound-name "sig-gun-plasma") + (-> obj plasma-sound-id) + (the int (* 1024.0 f28-0)) + (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) + 0 + (sound-group sfx) + s4-0 + ) + ) + ) + (when (not (logtest? (-> arg0 draw status) (draw-control-status no-draw))) + (let ((s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data 24)))) + (set! (-> *part-id-table* 667 init-specs 2 initial-valuef) (lerp 409.6 9216.0 f30-0)) + (set! (-> *part-id-table* 667 init-specs 8 initial-valuef) (lerp 0.0 32.0 f30-0)) + (set! (-> *part-id-table* 668 init-specs 2 initial-valuef) (lerp 409.6 32768.0 f30-0)) + (set! (-> *part-id-table* 668 init-specs 8 initial-valuef) (lerp 0.0 16.0 f30-0)) + (set! (-> *part-id-table* 666 init-specs 2 initial-valuef) (lerp 409.6 8192.0 f30-0)) + (set! (-> *part-id-table* 665 init-specs 1 initial-valuef) (lerp 0.1 1.0 f30-0)) + (set! (-> *part-id-table* 665 init-specs 2 initial-valuef) (lerp 409.6 3686.4 f30-0)) + (spawn (-> arg0 part) s5-2) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch uint vs none. +(defmethod sig-plasma-method-12 sig-plasma ((obj sig-plasma)) + (let ((f0-0 (-> obj level))) + (-> obj min-level) + (when (>= f0-0 1.0) + (set! f0-0 0.99) + (set! (-> obj level) f0-0) + ) + (set! (-> obj min-level) (fmax 0.0 (+ -0.5 f0-0))) + ) + (set! (-> obj flags) (logand -23 (-> obj flags))) + (none) + ) + +;; WARN: Return type mismatch uint vs none. +(defmethod sig-plasma-method-11 sig-plasma ((obj sig-plasma) (arg0 symbol)) + (set! (-> obj min-level) 0.0) + (cond + (arg0 + (set! (-> obj level) 0.0) + ) + (else + (if (>= (-> obj level) 1.0) + (set! (-> obj level) 0.99) + ) + ) + ) + (set! (-> obj flags) (logand -24 (-> obj flags))) + (none) + ) + +;; WARN: Return type mismatch uint vs none. +(defmethod sig-plasma-method-9 sig-plasma ((obj sig-plasma)) + (logior! (-> obj flags) 8) + (none) + ) + +(defmethod sig-plasma-method-10 sig-plasma ((obj sig-plasma)) + (logtest? (-> obj flags) 4) + ) + +(defmethod sig-plasma-method-13 sig-plasma ((obj sig-plasma)) + (and (logtest? (-> obj flags) 8) (logtest? (-> obj flags) 16)) + ) diff --git a/goal_src/jak2/characters/sig/sig-shot.gc b/goal_src/jak2/characters/sig/sig-shot.gc index 1d3f0cc456..0e7d8cd82c 100644 --- a/goal_src/jak2/characters/sig/sig-shot.gc +++ b/goal_src/jak2/characters/sig/sig-shot.gc @@ -7,3 +7,509 @@ ;; DECOMP BEGINS +(defpart 652 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x45 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.75)) + (sp-flt spt-scale-y (meters 10)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpart 653 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 654 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-flt spt-num 1.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -1.28) + (sp-flt spt-fade-a -0.48) + (sp-int spt-timer 100) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 655 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x46 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-scale-y (meters 4.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -3.6571429) + (sp-int spt-timer 35) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +(defpartgroup group-sig-shot-hit + :id 146 + :duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 656 :period 600 :length 5) + (sp-item 657 :fade-after (meters 100) :period 600 :length 5) + (sp-item 658 :period 600 :length 5) + (sp-item 659 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 200) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 200) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 150) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 125) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 100) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 75) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 65) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 50) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 40) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 25) + ) + ) + +(defpart 659 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.0 0.2 1.0) + (sp-flt spt-y (meters 0.25)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.001) (meters -0.00033333333) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -2.4) 1 873.81335) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.10666667) + (sp-flt spt-fade-b -0.10666667) + (sp-rnd-flt spt-accel-y -1.3653333 -5.4613333 1.0) + (sp-flt spt-friction 0.9) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 200) + (sp-launcher-by-id spt-next-launcher 661) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 660 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 96.0) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.0005) (meters -0.0005) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.10666667) + (sp-flt spt-fade-b -0.10666667) + (sp-rnd-flt spt-accel-y -1.3653333 -5.4613333 1.0) + (sp-flt spt-friction 0.8) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 200) + (sp-launcher-by-id spt-next-launcher 661) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 661 + :init-specs ((sp-flt spt-fade-a -0.96)) + ) + +(defpart 657 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees -0.1)) + (sp-flt spt-fade-a -0.32) + (sp-int spt-timer 400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 662) + ) + ) + +(defpart 662 + :init-specs ((sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 662) + ) + ) + +(defpart 658 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 2.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 48.0) + (sp-flt spt-scalevel-x (meters 0.12857144)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.9142857) + (sp-flt spt-fade-b -0.9142857) + (sp-int spt-timer 400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2) + (sp-int spt-next-time 35) + (sp-launcher-by-id spt-next-launcher 663) + ) + ) + +(defpart 663 + :init-specs ((sp-flt spt-scale-x (meters 4.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.010958904)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.38356164) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a -0.13150685) + ) + ) + +(defpart 656 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.16666667)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 55) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 664) + ) + ) + +(defpart 664 + :init-specs ((sp-flt spt-scale-x (meters 3.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.0875)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-b -6.4) + ) + ) + +(deftype sig-shot (projectile) + ((tail-pos vector :inline :offset-assert 480) + (hit-pos vector :inline :offset-assert 496) + ) + :heap-base #x180 + :method-count-assert 40 + :size-assert #x200 + :flag-assert #x2801800200 + ) + + +(defmethod draw-laser-sight sig-shot ((obj sig-shot)) + "TODO - confirm If applicable, draw the laser sight particles + :virtual" + (draw-beam (-> *part-id-table* 655) (-> obj tail-pos) (-> obj starting-dir) #f #t) + 0 + (none) + ) + +(defmethod spawn-impact-particles sig-shot ((obj sig-shot)) + "Spawns associated particles with the projectile if applicable" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((v1-1 (-> obj root-override trans)) + (a1-0 (-> obj tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-2 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> gp-0 quad) vf6) + (let ((f30-0 (-> *part-id-table* 652 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 652 init-specs 4 initial-valuef) (fmin f30-0 (vector-length s5-1))) + (draw-beam (-> *part-id-table* 652) a1-0 s5-1 #f #t) + (set! (-> *part-id-table* 652 init-specs 4 initial-valuef) f30-0) + ) + (vector-normalize! s5-1 1.0) + (let ((t9-2 sp-launch-particles-var) + (a0-5 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 653)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> gp-0 quad)) + (t9-2 a0-5 a1-2 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((f0-4 (vector-dot s5-1 (-> (camera-matrix) vector 2)))) + (when (< 0.0 f0-4) + (let ((f0-5 (* f0-4 f0-4)) + (f30-1 (-> *part-id-table* 654 init-specs 8 initial-valuef)) + (f28-0 (-> *part-id-table* 654 init-specs 8 random-rangef)) + ) + (set! (-> *part-id-table* 654 init-specs 8 initial-valuef) (* f30-1 f0-5)) + (set! (-> *part-id-table* 654 init-specs 8 random-rangef) (* f28-0 f0-5)) + (let ((t9-4 sp-launch-particles-var) + (a0-6 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 654)) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> gp-0 quad)) + (t9-4 a0-6 a1-3 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (set! (-> *part-id-table* 654 init-specs 8 initial-valuef) f30-1) + (set! (-> *part-id-table* 654 init-specs 8 random-rangef) f28-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod spawn-shell-particles sig-shot ((obj sig-shot)) + "TODO - confirm" + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-1 (method-of-type part-tracker activate))) + (t9-1 + (the-as part-tracker gp-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-2 run-function-in-process) + (a0-3 gp-0) + (a1-2 part-tracker-init) + (a2-4 (-> *part-group-id-table* 146)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> obj root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-2) + a0-3 + a1-2 + a2-4 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-0 ppointer) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs sound-id. +(defmethod play-impact-sound sig-shot ((obj sig-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "sig-shot-fire") + ) + ((= v1-0 (projectile-options lose-altitude)) + (sound-play "sig-shot-hit") + ) + ) + ) + (the-as sound-id 0) + ) + +(defmethod made-impact? sig-shot ((obj sig-shot)) + "TODO - queries the collision cache, return true/false" + (let ((v1-0 (-> obj root-override)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a1-0 t1-0)) + (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a1-0 ignore-process0) obj) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) + ) + ) + +(defun sig-shot-move ((arg0 sig-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root-override))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 40960.0 f0-0) + (vector-normalize! s4-0 40960.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (let ((v1-9 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-5 (-> arg0 hit-pos)) + ) + (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector+! a1-5 a1-5 v1-9) + (move-to-point! (-> arg0 root-override) a1-5) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod init-collision! sig-shot ((obj sig-shot)) + "Init the [[projectile]]'s [[collide-shape]]" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> obj root-override) s5-0) + ) + (let ((v1-22 (-> obj parent))) + (when (not (logtest? (-> (the-as sig (if v1-22 + (the-as sig (-> v1-22 0 self)) + ) + ) + bot-flags + ) + (bot-flags attacked) + ) + ) + (let* ((a0-16 (-> obj root-override)) + (v1-27 (-> a0-16 root-prim)) + ) + (countdown (a0-17 (-> a0-16 total-prims)) + (logclear! (-> v1-27 prim-core collide-with) (collide-spec jak)) + (&+! v1-27 80) + ) + ) + ) + ) + (set! (-> obj root-override pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) + ) + (none) + ) + +(defmethod init-proj-settings! sig-shot ((obj sig-shot)) + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc + :virtual" + (set! (-> obj tail-pos quad) (-> obj root-override trans quad)) + (set! (-> obj attack-mode) 'eco-yellow) + (set! (-> obj max-speed) 307200.0) + (set! (-> obj move) sig-shot-move) + (set! (-> obj timeout) (seconds 1.335)) + (none) + ) diff --git a/goal_src/jak2/characters/sig/sig-states.gc b/goal_src/jak2/characters/sig/sig-states.gc index 54b7f75918..f1421df4ca 100644 --- a/goal_src/jak2/characters/sig/sig-states.gc +++ b/goal_src/jak2/characters/sig/sig-states.gc @@ -7,3 +7,2028 @@ ;; DECOMP BEGINS +(defstate waiting-crouched (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) + (logior! (-> self focus-status) (focus-status disable)) + (none) + ) + :exit (behavior () + (local-vars (v1-1 enemy-flag)) + (let ((v1-0 (-> self enemy-flags))) + (if (logtest? v1-0 (enemy-flag checking-water)) + (set! v1-1 (logior v1-0 (enemy-flag enable-on-active))) + (set! v1-1 (logclear v1-0 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-1) + (logclear! (-> self focus-status) (focus-status disable)) + (none) + ) + :trans (behavior () + (if (and (not (logtest? (-> self focus-status) (focus-status grabbed))) + (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + ) + (go-virtual traveling) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 47) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 47)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate waiting-far (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ((sig-method-251 self) + (go-virtual charge-plasma) + ) + ((sig-method-254 self) + (go-virtual clean-gun) + ) + ) + ) + (if (and (-> self focus-info fproc) + (or (< (-> self focus-info bullseye-xz-dist) 90112.0) + (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) + ) + ) + (go-virtual waiting-close) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 6))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.2)) + ) + ((let ((v1-17 (ja-group))) + (and v1-17 (= v1-17 (-> self draw art-group data 4))) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate waiting-close (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ((and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) + (go-virtual waiting-turn) + ) + ((sig-method-251 self) + (go-virtual charge-plasma) + ) + ((sig-method-254 self) + (go-virtual clean-gun) + ) + ) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (or (not (-> self focus-info fproc)) (>= (-> self focus-info bullseye-xz-dist) 102400.0)) + ) + (go-virtual waiting-far) + ) + (none) + ) + :code (behavior () + (let* ((v1-2 (ja-group)) + (gp-0 + (-> self + draw + art-group + data + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 4))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + 7 + ) + (else + (let ((v1-32 (ja-group))) + (cond + ((and v1-32 (= v1-32 (-> self draw art-group data 5))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + (let ((v1-46 (ja-group))) + (cond + ((and v1-46 (= v1-46 (-> self draw art-group data 7))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + 7 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-62 (ja-group))) + (if (not (and v1-62 (= v1-62 gp-0))) + (ja-channel-push! 1 (seconds 0.3)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate waiting-turn (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + (none) + ) + :code (behavior () + (local-vars (s4-1 art-element) (f0-19 float)) + (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) + (let ((s5-0 (-> self focus-info fproc))) + (if (not s5-0) + (go-virtual waiting-close) + ) + (turn-to-target self gp-0 s5-0 1.4361539) + ) + (let ((v1-8 (ja-group))) + (cond + ((and v1-8 (or (= v1-8 (-> self draw art-group data 4)) (= v1-8 (-> self draw art-group data 6)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.04)) + ) + (else + (let ((v1-38 (ja-group))) + (cond + ((and v1-38 (= v1-38 (-> self draw art-group data 5))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.04)) + ) + (else + (let ((v1-53 (ja-group))) + (if (and v1-53 (= v1-53 (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-channel-push! 1 (seconds 0.3)) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((a2-4 (-> self focus-info fproc))) + (if a2-4 + (turn-to-target self gp-0 a2-4 1.4361539) + ) + ) + (let ((s4-0 (>= (-> gp-0 predicted-ry-diff) 0.0))) + (let ((a1-11 (-> self draw art-group data (if s4-0 + 48 + 52 + ) + ) + ) + ) + (ja-no-eval :group! a1-11 + :num! (seek! (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1)) 1.3) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.3)) + ) + (let ((a2-7 (-> self focus-info fproc))) + (if a2-7 + (turn-to-target self gp-0 a2-7 1.2307693) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'quaternion)) + (f0-18 (-> gp-0 predicted-ry-diff)) + (f30-0 4.0) + (f28-0 28.0) + ) + (cond + (s4-0 + (if (< f0-18 0.0) + (set! f0-18 (+ 65536.0 f0-18)) + ) + (cond + ((< f0-18 18204.445) + (set! f0-19 9102.223) + (set! s4-1 (-> self draw art-group data 49)) + (set! f28-0 18.0) + ) + ((< f0-18 27306.666) + (set! f0-19 18204.445) + (set! s4-1 (-> self draw art-group data 50)) + ) + (else + (set! f0-19 27306.666) + (set! s4-1 (-> self draw art-group data 51)) + ) + ) + ) + (else + (if (>= f0-18 0.0) + (set! f0-18 (+ -65536.0 f0-18)) + ) + (cond + ((< -18204.445 f0-18) + (set! f0-19 -9102.223) + (set! s4-1 (-> self draw art-group data 53)) + (set! f28-0 18.0) + ) + ((< -27306.666 f0-18) + (set! f0-19 -18204.445) + (set! s4-1 (-> self draw art-group data 54)) + ) + (else + (set! f0-19 -27306.666) + (set! s4-1 (-> self draw art-group data 55)) + ) + ) + ) + ) + (quaternion-rotate-y! s5-1 (-> gp-0 src-quat) f0-19) + (ja-no-eval :group! s4-1 + :num! (seek! (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)) 1.3) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((f0-24 (ja-aframe-num 0))) + (cond + ((< f0-24 f28-0) + (if (>= f0-24 f30-0) + (quaternion-slerp! (-> self root-override2 quat) (-> gp-0 src-quat) s5-1 (/ (- f0-24 f30-0) (- f28-0 f30-0))) + ) + ) + (else + (quaternion-copy! (-> self root-override2 quat) s5-1) + ) + ) + ) + (suspend) + (ja :num! (seek! max 1.3)) + ) + ) + ) + ) + (go-virtual waiting-close) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate charge-plasma (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self plasma flags) (logand -29 (-> self plasma flags))) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (set! (-> self plasma flags) (logand -15 (-> self plasma flags))) + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ((not (sig-method-251 self)) + (go-virtual waiting-close) + ) + ) + ) + (if (>= (-> self plasma level) 1.0) + (logior! (-> self plasma flags) 4) + (set! (-> self plasma flags) (logand -5 (-> self plasma flags))) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! (-> self draw art-group data 35) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (logior! (-> self plasma flags) 2) + (ja-channel-push! 1 (seconds 0.07)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 36) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 36)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (and (logtest? (-> self plasma flags) 4) (logtest? (-> self plasma flags) 8)) + (goto cfg-12) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (label cfg-12) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 37) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 37)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.07)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 38) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 38)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (logtest? (-> self plasma flags) 8) + (logior! (-> self plasma flags) 16) + (set! (-> self plasma flags) (logand -17 (-> self plasma flags))) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self plasma flags) (logand -9 (-> self plasma flags))) + (nav-enemy-simple-post) + (none) + ) + ) + +(defstate gun-jam (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek! (ja-aframe 8.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0))) + ) + (sound-play "sig-gun-jam") + (logclear! (-> self bot-flags) (bot-flags bf20)) + (set! (-> self bot-flags) (logior (bot-flags bf19) (-> self bot-flags))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go-virtual repair-gun) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate repair-gun (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (if (bot-method-214 self) + (go-hostile self) + ) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) (zero? (-> self played-unjam-time))) + (set! (-> self played-unjam-time) (-> self clock frame-counter)) + (sound-play "sig-gun-unjam") + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 26) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 26)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-channel-push! 1 (seconds 0.07)) + (countdown (gp-0 (get-rand-int-range self 2 4)) + (ja-no-eval :group! (-> self draw art-group data 27) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 28) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.13)) + (ja-no-eval :group! (-> self draw art-group data 29) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 31) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.13)) + (ja-no-eval :group! (-> self draw art-group data 30) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 32) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 32)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (countdown (gp-1 (get-rand-int-range self 2 3)) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 33) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 34) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate clean-gun (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (countdown (gp-0 2) + 0 + (cond + ((= gp-0 1) + (let ((s5-0 (get-rand-int-range self 1 2))) + (ja-channel-push! 1 (seconds 0.13)) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! (-> self draw art-group data 29) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (else + (let ((s5-1 (get-rand-int-range self 1 4))) + (ja-channel-push! 1 (seconds 0.13)) + (while (nonzero? s5-1) + (+! s5-1 -1) + (ja-no-eval :group! (-> self draw art-group data 30) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + (when (nonzero? gp-0) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 31) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate traveling (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info-override callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-5 enemy-flags)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-166 self) + (set! (-> self skel top-anim interp) 1.0) + (set! (-> self player-blocking) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) + (go-virtual waiting-close) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + (go-virtual traveling-blocked) + ) + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ) + 0 + (none) + ) + :code (behavior () + (until #f + (sig-method-258 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self spot)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 center quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate traveling-blocked (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + (go-virtual traveling) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.3)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate stare (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (when (bot-method-214 self) + (cond + ((sig-method-246 self) + (go-virtual whip) + ) + ((sig-method-245 self) + (go-virtual blast) + ) + ) + ) + (cond + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (nav-enemy-method-163 self)) + (go-virtual traveling) + ) + ) + ) + (none) + ) + :code (behavior () + (let* ((v1-2 (ja-group)) + (gp-0 + (-> self + draw + art-group + data + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 4))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + 7 + ) + (else + (let ((v1-32 (ja-group))) + (cond + ((and v1-32 (= v1-32 (-> self draw art-group data 5))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + (let ((v1-46 (ja-group))) + (cond + ((and v1-46 (= v1-46 (-> self draw art-group data 7))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + 7 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-62 (ja-group))) + (if (not (and v1-62 (= v1-62 gp-0))) + (ja-channel-push! 1 (seconds 0.3)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + #f + (none) + ) + ) + +(defstate whip (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-11 *game-info*) + (a0-6 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-6) + (set! (-> self attack-id) a0-6) + ) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (enemy-method-46 self 0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (none) + ) + :code (behavior () + (local-vars (a1-2 art-element)) + (enemy-method-46 self 3) + (ja-channel-push! 1 (seconds 0.1)) + 0.0 + (let ((f30-0 (cond + ((< (fabs (-> self focus-info ry-diff)) 8192.0) + (set! a1-2 (-> self draw art-group data 9)) + 18.0 + ) + ((< (-> self focus-info ry-diff) 0.0) + (set! a1-2 (-> self draw art-group data 11)) + 16.0 + ) + (else + (set! a1-2 (-> self draw art-group data 10)) + 18.0 + ) + ) + ) + ) + (ja-no-eval :group! a1-2 + :num! (seek! (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (and (logtest? (-> self focus-status) (focus-status dangerous)) (< f30-0 (ja-aframe-num 0))) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (seek-toward-heading-vec! + (-> self root-override2) + (-> self focus-info bullseye-xz-dir) + 131072.0 + (seconds 0.05) + ) + (nav-enemy-simple-post) + (none) + ) + ) + +(defstate blast (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (if (not (handle->process (-> self focus handle))) + (enemy-method-72 self) + ) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (none) + ) + :code (behavior () + (local-vars (gp-0 art-element)) + (let ((f30-0 8.0)) + (cond + ((< (fabs (-> self focus-info ry-diff)) 8192.0) + (ja-channel-push! 1 (seconds 0.1)) + (set! gp-0 (-> self draw art-group data 12)) + ) + ((< (-> self focus-info ry-diff) 0.0) + (ja-channel-push! 1 (seconds 0.1)) + (set! gp-0 (-> self draw art-group data 14)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (set! gp-0 (-> self draw art-group data 13)) + ) + ) + (let ((f30-1 (ja-aframe f30-0 0))) + (ja-no-eval :group! gp-0 :num! (seek! f30-1) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! + (-> self root-override2) + (-> self focus-info bullseye-xz-dir) + 131072.0 + (seconds 0.05) + ) + (bot-method-223 self #t) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (or (not (bot-method-214 self)) (not (sig-method-245 self))) + ) + (enemy-method-72 self) + ) + (suspend) + (ja :num! (seek! f30-1)) + ) + ) + ) + (bot-method-223 self #t) + (if (and (bot-method-214 self) (sig-method-245 self)) + (fire-gun self (-> self focus-info bullseye)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (bot-method-223 self #f) + (if (and (bot-method-214 self) (sig-method-246 self)) + (go-virtual whip) + ) + (suspend) + (ja-eval) + ) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (enemy-method-72 self) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate chase (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (set! (-> self skel top-anim interp) 1.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #t) + (cond + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ((not (bot-method-214 self)) + (go-virtual traveling) + ) + ((sig-method-246 self) + (go-virtual whip) + ) + ((sig-method-245 self) + (go-virtual blast) + ) + ((and (not (logtest? (bot-flags bf19) (-> self bot-flags))) + (= (-> self focus-info los) 1) + (-> self focus-info fproc) + (>= 3640.889 (fabs (-> self focus-info ry-diff))) + (>= 81920.0 (-> self focus-info bullseye-xz-dist)) + ) + (go-virtual chase-attack) + ) + ) + (none) + ) + :code (behavior () + (until #f + (sig-method-258 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-6 (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate chase-attack (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type sig chase) enter)) + (set! (-> self skel top-anim interp) 1.0) + (if (not (handle->process (-> self focus handle))) + (go-virtual traveling) + ) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (none) + ) + :code (behavior () + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim (-> self draw art-group data 45)) + 0.0 + 9 + 9 + 1.0 + 0.0 + #f + ) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.167)) + (sig-method-258 self) + (suspend) + ) + (bot-method-223 self #t) + (let ((a1-2 (-> self focus-info fproc))) + (cond + ((and a1-2 + (logtest? (-> self bot-flags) (bot-flags bf00)) + (not (logtest? (bot-flags bf19) (-> self bot-flags))) + (attacked-by-player? self a1-2) + (= (-> self focus-info los) 1) + ) + (fire-gun self (-> self focus-info bullseye)) + 0 + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim (-> self draw art-group data 44)) + 0.0 + 30 + 0 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.8)) + (sig-method-258 self) + (suspend) + ) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (go-virtual chase) + (none) + ) + :post (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (-> self nav state)) + (v1-7 (get-trans (the-as process-focusable a0-1) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-7 quad)) + ) + 0 + ) + ) + (nav-enemy-travel-post) + (none) + ) + ) + +(defstate hit (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :code (behavior () + (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-30 (-> self enemy-flags))) + (if (logtest? v1-30 (enemy-flag checking-water)) + (set! v1-31 (logior v1-30 (enemy-flag enable-on-active))) + (set! v1-31 (logclear v1-30 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-31) + (if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> self mask) (logior (process-mask collectable) (-> self mask))) + (logclear! (-> self mask) (process-mask collectable)) + ) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? (enemy-flag no-initial-move-to-ground) v1-38) + (set! v1-39 (logior (enemy-flag check-water-backup) v1-38)) + (set! v1-39 (logclear v1-38 (enemy-flag check-water-backup))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> self focus-status) (focus-status hit)) + (enemy-method-72 self) + (none) + ) + ) + +(defstate knocked (sig) + :virtual #t + :enter (behavior () + (sig-plasma-method-12 (-> self plasma)) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (let ((t9-1 (-> (method-of-type bot knocked) enter))) + (if t9-1 + (t9-1) + ) + ) + (if (logtest? (bot-flags bf19 bf20) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flags bf12)) + ) + (none) + ) + ) + +(defstate die-falling (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (sig-plasma-method-11 (-> self plasma) #f) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self skel top-anim interp) 0.0) + (play-death-sound self "sigt093") + (none) + ) + ) + +(defstate failed (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot failed) enter))) + (if t9-0 + (t9-0) + ) + ) + (sig-plasma-method-11 (-> self plasma) #f) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self skel top-anim interp) 0.0) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (and (logtest? (-> self bot-flags) (bot-flags failed)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) + (reset? *fail-mission-control*) + ) + (reset! *fail-mission-control*) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + ) + +(defstate sig-path-run (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (if (logtest? (-> gp-0 flags) 1) + (go-virtual sig-path-jump) + ) + (if (logtest? (-> gp-0 flags) 2) + (go-virtual sig-path-shoot-jump) + ) + (let ((v1-14 (-> self root-override2))) + (set! (-> v1-14 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-14 trans w) 1.0) + (quaternion-copy! (-> v1-14 quat) (-> gp-0 quat)) + ) + ) + (if (sig-method-257 self) + (go-virtual sig-path-idle) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (and v1-2 (or (= v1-2 (-> self draw art-group data 58)) (= v1-2 (-> self draw art-group data 60)))) + (ja-channel-push! 1 (seconds 0.07)) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 56) :num! (loop!)) + (until #f + (suspend) + (let* ((f0-1 (vector-length (-> self root-override2 transv))) + (f0-3 (fmax 0.1 (* 0.000020345053 f0-1))) + ) + (ja :num! (loop! f0-3)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate sig-path-jump (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self bot-flags) (logior (bot-flags bf24) (-> self bot-flags))) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 1)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-jump) + ) + (if (logtest? s5-0 2) + (go-virtual sig-path-shoot-jump) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (go-virtual sig-path-jump-land) + ) + ) + (let ((v1-27 (-> self root-override2))) + (set! (-> v1-27 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-27 trans w) 1.0) + (quaternion-copy! (-> v1-27 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (let ((f30-0 0.0)) + (let ((v1-2 (ja-group))) + (if (and v1-2 (= v1-2 (-> self draw art-group data 57))) + (set! f30-0 1.0) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 57) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 57)) frames num-frames) -1))) + :frame-num f30-0 + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate sig-path-jump-land (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 1)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-jump) + ) + (if (logtest? s5-0 2) + (go-virtual sig-path-shoot-jump) + ) + ) + (let ((v1-18 (-> self root-override2))) + (set! (-> v1-18 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-18 trans w) 1.0) + (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (let* ((f0-0 (vector-length (-> self root-override2 transv))) + (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + ) + (ja-no-eval :group! (-> self draw art-group data 58) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 58)) frames num-frames) -1)) + f0-2 + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (suspend) + (let* ((f0-4 (vector-length (-> self root-override2 transv))) + (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + ) + (ja :num! (seek! max f0-6)) + ) + ) + (go-virtual sig-path-run) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate sig-path-shoot-jump (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self bot-flags) (logior (bot-flags bf24) (-> self bot-flags))) + (logclear! (-> self bot-flags) (bot-flags bf25)) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 2)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-shoot-jump) + ) + (if (and (logtest? s5-0 1) (logtest? (bot-flags bf25) (-> self bot-flags))) + (go-virtual sig-path-jump) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (go-virtual sig-path-shoot-jump-land) + ) + ) + (let ((v1-29 (-> self root-override2))) + (set! (-> v1-29 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-29 trans w) 1.0) + (quaternion-copy! (-> v1-29 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (let ((f30-0 0.0)) + (let ((v1-2 (ja-group))) + (if (and v1-2 (= v1-2 (-> self draw art-group data 59))) + (set! f30-0 1.0) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 59) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 59)) frames num-frames) -1))) + :frame-num f30-0 + ) + ) + (until (ja-done? 0) + (if (and (not (logtest? (bot-flags bf25) (-> self bot-flags))) + (and (< 5.0 (ja-aframe-num 0)) (sig-method-250 self)) + ) + (set! (-> self bot-flags) (logior (bot-flags bf25) (-> self bot-flags))) + ) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate sig-path-shoot-jump-land (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 2)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-shoot-jump) + ) + (if (logtest? s5-0 1) + (go-virtual sig-path-jump) + ) + ) + (let ((v1-18 (-> self root-override2))) + (set! (-> v1-18 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-18 trans w) 1.0) + (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (let* ((f0-0 (vector-length (-> self root-override2 transv))) + (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + ) + (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)) + f0-2 + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (suspend) + (let* ((f0-4 (vector-length (-> self root-override2 transv))) + (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + ) + (ja :num! (seek! max f0-6)) + ) + ) + (go-virtual sig-path-run) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +(defstate sig-path-idle (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (vector-reset! (-> self root-override2 transv)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! (-> self draw art-group data 61) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 61)) 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 62) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 62)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) diff --git a/goal_src/jak2/characters/sig/sig-task.gc b/goal_src/jak2/characters/sig/sig-task.gc index 1e327df72b..0090795ceb 100644 --- a/goal_src/jak2/characters/sig/sig-task.gc +++ b/goal_src/jak2/characters/sig/sig-task.gc @@ -7,3 +7,430 @@ ;; DECOMP BEGINS +(defmethod reset-task! sigt-wait-spot ((obj sigt-wait-spot)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +(defmethod ai-task-method-11 sigt-wait-spot ((obj sigt-wait-spot) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (when (>= s4-0 0) + (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) + (set! s4-0 -1) + ) + ) + ) + (when (< s4-0 0) + (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) + (set! (-> obj which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + 20 + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + ) + (when (not ((-> obj check-done) obj (the-as sig arg0))) + (let ((a1-10 (handle->process (-> arg0 focus handle)))) + (cond + ((and a1-10 + (attacked-by-player? arg0 (the-as process-focusable a1-10)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ((logtest? (bot-flags bf19) (-> arg0 bot-flags)) + (get-task-by-type (-> arg0 ai-ctrl) sigt-repair-gun arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + ) + (none) + ) + +(defmethod ai-task-method-11 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) + "Virtual" + (let ((a1-1 (handle->process (-> arg0 focus handle)))) + (if (and a1-1 + (attacked-by-player? arg0 (the-as process-focusable a1-1)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (logior! (-> arg0 bot-flags) (bot-flags bf00)) + (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch bot-flags vs none. +(defmethod ai-task-method-10 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) + "Virtual" + (logclear! (-> arg0 bot-flags) (bot-flags bf00)) + (none) + ) + +(defmethod ai-task-method-11 sigt-repair-gun ((obj sigt-repair-gun) (arg0 bot)) + "Virtual" + (cond + ((not (logtest? (bot-flags bf19) (-> arg0 bot-flags))) + (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + ) + (else + (let ((a1-4 (handle->process (-> arg0 focus handle)))) + (when (and a1-4 + (attacked-by-player? arg0 (the-as process-focusable a1-4)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + ) + (none) + ) + +(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig) (arg1 int)) + (let* ((v1-2 (-> arg0 course spots (-> obj spot-indexes arg1))) + (a0-6 (-> arg0 actor-group 0 data (-> obj actor-indexes arg1) actor)) + (gp-0 (if a0-6 + (-> a0-6 extra process) + ) + ) + ) + (or (player-blocking-spot? arg0 v1-2) + (or (not gp-0) + (>= 14336.0 + (vector-vector-xz-distance (target-pos 0) (-> (the-as process-focusable gp-0) root-override trans)) + ) + ) + ) + ) + ) + +(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) + (let ((s4-0 0)) + (let ((f30-0 -1.0) + (s3-0 (-> arg0 root-override2 trans)) + ) + (countdown (s2-0 (-> obj num-spots)) + (let* ((v1-3 (-> obj spot-indexes s2-0)) + (f28-0 (vector-vector-xz-distance s3-0 (the-as vector (-> arg0 course spots v1-3)))) + ) + (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (not (sigt-choose-piston-method-14 obj arg0 (the-as int s2-0)))) + (set! f30-0 f28-0) + (set! s4-0 (the-as int s2-0)) + ) + ) + ) + ) + (set! (-> obj which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + 20 + ) + (let* ((v1-22 (-> arg0 actor-group 0 data (-> obj actor-indexes s4-0) actor)) + (a0-6 (if v1-22 + (-> v1-22 extra process) + ) + ) + ) + (if a0-6 + (set! (-> arg0 poi-handle) (process->handle a0-6)) + ) + ) + ) + (none) + ) + +(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) + (with-pp + (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + (not (sigt-choose-piston-method-14 obj arg0 (-> obj which-spot))) + ) + (let* ((v1-12 (-> arg0 actor-group 0 data (-> obj actor-indexes (-> obj which-spot)) actor)) + (s5-1 (if v1-12 + (-> v1-12 extra process) + ) + ) + ) + (when s5-1 + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'sync) + (let ((v1-19 + (- ((method-of-type sync-info get-timeframe-offset!) (the-as sync-info (send-event-function s5-1 a1-3)) 0) + (-> pp clock frame-counter) + ) + ) + ) + (when (and (< v1-19 (seconds 0.5)) (< (seconds 0.2) v1-19)) + (let ((v1-22 (-> (the-as process-focusable s5-1) root-override)) + (s4-0 (-> arg0 root-override2)) + ) + (when (>= 10012.445 + (fabs (deg- + (atan (- (-> v1-22 trans x) (-> s4-0 trans x)) (- (-> v1-22 trans z) (-> s4-0 trans z))) + (quaternion-y-angle (-> s4-0 quat)) + ) + ) + ) + (set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable)))) + (when (send-event arg0 'jump 4 (-> (the-as process-focusable s5-1) root-override trans)) + (set! (-> arg0 spot center quad) (-> (the-as process-focusable s5-1) root-override trans quad)) + (set! (-> arg0 spot center w) 10240.0) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +(defmethod reset-task! sigt-choose-piston ((obj sigt-choose-piston)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +(defmethod ai-task-method-11 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (cond + ((< s4-0 0) + (sigt-choose-piston-method-13 obj (the-as sig arg0)) + ) + ((sigt-choose-piston-method-14 obj (the-as sig arg0) s4-0) + (sigt-choose-piston-method-13 obj (the-as sig arg0)) + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + ) + (when (not ((-> obj check-done) obj (the-as sig arg0))) + (let ((a1-6 (handle->process (-> arg0 focus handle)))) + (when (and a1-6 + (attacked-by-player? arg0 (the-as process-focusable a1-6)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + (none) + ) + +(defmethod ai-task-method-10 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) + "Virtual" + (clear-poi-and-focus! arg0) + (none) + ) + +(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((obj sigt-riding-piston) (arg0 sig)) + (with-pp + (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (let* ((v1-9 (-> arg0 actor-group 0 data (-> arg0 platform-index) actor)) + (a0-4 (if v1-9 + (-> v1-9 extra process) + ) + ) + ) + (when a0-4 + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer pp)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'sync) + (let ((v1-16 + (- ((method-of-type sync-info get-timeframe-offset!) (the-as sync-info (send-event-function a0-4 a1-6)) 0) + (-> pp clock frame-counter) + ) + ) + ) + (when (and (< v1-16 (seconds 2.8)) (< (seconds 1.8) v1-16)) + (let ((v1-19 (-> arg0 nav))) + (set! (-> v1-19 target-speed) 0.0) + ) + 0 + (let ((s5-1 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable)))) + (when (send-event arg0 'jump 0 (-> s5-1 center)) + (mem-copy! (the-as pointer (-> arg0 spot)) (the-as pointer s5-1) 20) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +(defmethod reset-task! sigt-riding-piston ((obj sigt-riding-piston)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod ai-task-method-11 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) + (set! (-> obj which-spot) s4-0) + (send-event + (ppointer->process (-> arg0 my-simple-focus)) + 'move-trans + (-> arg0 course spots (-> obj spot-indexes s4-0)) + ) + (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + ) + ((-> obj check-done) obj (the-as sig arg0)) + (none) + ) + +(defmethod ai-task-method-10 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) + "Virtual" + (clear-poi-and-focus! arg0) + (none) + ) + +(defmethod reset-task! sigt-charge-plasma ((obj sigt-charge-plasma)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +(defmethod ai-task-method-11 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (when (>= s4-0 0) + (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) + (set! s4-0 -1) + ) + ) + ) + (when (< s4-0 0) + (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) + (set! (-> obj which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + 20 + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + (let* ((v1-24 (-> arg0 actor-group 0 data (-> obj actor-index) actor)) + (s3-1 (when v1-24 + (let ((s2-0 (-> v1-24 extra process))) + (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + ) + ) + (cond + (s3-1 + (set! (-> arg0 poi-handle) (process->handle s3-1)) + (set! (-> arg0 focus-mode) 1) + (let ((a1-10 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (if (and (outside-spot-radius? arg0 a1-10 (the-as vector #f) #f) + (enemy-method-95 arg0 (get-trans (the-as process-focusable s3-1) 3) 10012.445) + ) + (logior! (-> arg0 stack 920) 1) + (set! (-> arg0 stack 920) (logand -2 (-> arg0 stack 920))) + ) + ) + ) + (else + (clear-poi-and-focus! arg0) + (set! (-> arg0 stack 920) (logand -2 (-> arg0 stack 920))) + (set! (-> arg0 focus-mode) 0) + 0 + ) + ) + ) + ) + (when (not ((-> obj check-done) obj (the-as sig arg0))) + (let ((a1-14 (handle->process (-> arg0 focus handle)))) + (when (and a1-14 + (attacked-by-player? arg0 (the-as process-focusable a1-14)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + (none) + ) + +(defmethod ai-task-method-10 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) + "Virtual" + (clear-poi-and-focus! arg0) + (set! (-> arg0 stack 920) (logand -2 (-> arg0 stack 920))) + (set! (-> arg0 focus-mode) 0) + 0 + (none) + ) diff --git a/goal_src/jak2/characters/sig/sig.gc b/goal_src/jak2/characters/sig/sig.gc index 6f7ceb7c5f..88748b104d 100644 --- a/goal_src/jak2/characters/sig/sig.gc +++ b/goal_src/jak2/characters/sig/sig.gc @@ -7,3 +7,1388 @@ ;; DECOMP BEGINS +(deftype sig-anim-info (structure) + ((anim-index int32 :offset-assert 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + + +(deftype sig-global-info (basic) + ((prev-blue-hit int8 :offset-assert 4) + (blue-hit-anim sig-anim-info 3 :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + + +(define *sig-global-info* + (new 'static 'sig-global-info :blue-hit-anim (new 'static 'inline-array sig-anim-info 3 + (new 'static 'sig-anim-info :anim-index 19) + (new 'static 'sig-anim-info :anim-index 20) + (new 'static 'sig-anim-info :anim-index 21) + ) + ) + ) + +(define *sig-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 15 + :knocked-land-anim 15 + :die-anim 25 + :die-falling-anim 25 + :victory-anim -1 + :jump-wind-up-anim 39 + :jump-in-air-anim 40 + :jump-land-anim 41 + :neck-joint 6 + :look-at-joint 7 + :bullseye-joint 5 + :sound-hit (static-sound-name "sig-hit") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 20 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.7 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 45056.0 + :knocked-soft-vxz-hi 54067.2 + :knocked-soft-vy-lo 38092.8 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 65536.0 + :knocked-medium-vxz-hi 74547.2 + :knocked-medium-vy-lo 65536.0 + :knocked-medium-vy-hi 73728.0 + :knocked-hard-vxz-lo 66355.2 + :knocked-hard-vxz-hi 85196.8 + :knocked-hard-vy-lo 60620.8 + :knocked-hard-vy-hi 101580.8 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 73728.0 + :knocked-red-vy-lo 65536.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 8 + :taunt-anim -1 + :run-travel-speed (meters 7) + :run-acceleration (meters 14) + :run-turning-acceleration (meters 6) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 8) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 360.0) + :notice-nav-radius (meters 20) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *sig-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defpartgroup group-sig-gun-glow + :id 148 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 671 :flags (bit6))) + ) + +(defpart 671 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 192.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 16.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 819.2) + ) + ) + +(defmethod enemy-method-97 sig ((obj sig)) + (with-pp + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (cond + ((= (-> s4-0 type) target) + (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 1.5)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! s4-0 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 6)) + (set! s4-0 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((v1-23 (-> obj focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? v1-23) + (cond + (s4-0 + (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (>= 16384.0 + (vector-vector-xz-distance (-> obj root-override2 trans) (get-trans (the-as process-focusable s4-0) 3)) + ) + ) + (set! s5-1 s4-0) + ) + ) + (else + (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (set! s5-1 (select-focus! obj)) + (cond + (s5-1 + (empty) + ) + (else + (let ((s4-1 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + ) + ((= v1-23 1) + (cond + (s4-0 + (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (>= 16384.0 + (vector-vector-xz-distance (-> obj root-override2 trans) (get-trans (the-as process-focusable s4-0) 3)) + ) + ) + (set! s5-1 s4-0) + ) + ) + (else + (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (let ((s4-2 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-2 process-focusable) + s4-2 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) + (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + (else + (clear-focused (-> obj focus)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + s5-1 + ) + ) + ) + ) + +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 33] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 38] +(defmethod enemy-method-74 sig ((obj sig) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block)) + (let ((v1-0 arg2)) + (the-as object (cond + ((= v1-0 'untrigger) + (sig-plasma-method-11 (-> obj plasma) #t) + ) + ((= v1-0 'sig-path) + (when (and (not (logtest? (-> obj focus-status) (focus-status dead))) + (nonzero? (-> obj hit-points)) + (zero? (-> obj fated-time)) + ) + (let ((a1-2 (-> arg3 param 0))) + (sig-method-249 obj (the-as sig-path a1-2)) + ) + (go (method-of-object obj sig-path-run)) + ) + ) + (else + ((method-of-type bot enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(defmethod enemy-method-55 sig ((obj sig)) + (with-pp + (let ((v1-2 (-> obj skel top-anim frame-group))) + (cond + ((>= (- (-> pp clock frame-counter) (-> obj danger-time)) (seconds 2)) + (cond + ((not v1-2) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + ) + ((= v1-2 (-> obj draw art-group data 44)) + (push-anim-to-targ + (-> obj skel top-anim) + (the-as art-joint-anim (-> obj draw art-group data 46)) + 0.0 + 0 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + ) + ) + ) + (else + (cond + ((not v1-2) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + ) + ((= v1-2 (-> obj draw art-group data 42)) + (push-anim-to-targ + (-> obj skel top-anim) + (the-as art-joint-anim (-> obj draw art-group data 43)) + 0.0 + 0 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + ) + ) + ) + ) + ) + (let ((t9-2 (method-of-type bot enemy-method-55))) + (t9-2 obj) + ) + (when (logtest? (-> obj bot-flags) (bot-flags too-far-fail)) + (let ((f0-0 (vector-vector-distance (-> obj root-override2 trans) (target-pos 0)))) + (when (or (>= f0-0 491520.0) + (and (>= f0-0 102400.0) + (>= (- (-> pp clock frame-counter) (the-as int (-> obj last-draw-time))) (seconds 10)) + ) + ) + (process-entity-status! obj (entity-perm-status no-kill) #f) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + ) + ) + (sig-plasma-method-14 (-> obj plasma) obj) + (none) + ) + ) + +(defmethod go-to-waypoint! sig ((obj sig) (arg0 int) (arg1 symbol)) + "Start moving to the given [[bot-waypoint]]." + (set! (-> obj plasma charge-speed) 0.125) + ((method-of-type bot go-to-waypoint!) obj arg0 arg1) + ) + +(defmethod deactivate sig ((obj sig)) + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> obj plasma powerup-sound-id)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 24) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + (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) (-> obj plasma plasma-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) + ) + ((method-of-type bot deactivate) obj) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod enemy-method-46 sig ((obj sig) (arg0 int)) + "@abstract" + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (let ((v1-2 (-> obj root-override2 root-prim))) + (dotimes (a0-1 4) + (let ((a1-3 (-> (the-as collide-shape-prim-group v1-2) child (+ a0-1 3)))) + (set! (-> a1-3 prim-core collide-with) (collide-spec)) + (set! (-> a1-3 prim-core collide-as) (collide-spec)) + (set! (-> a1-3 transform-index) -2) + ) + ) + ) + ) + ((= v1-0 3) + (let ((v1-5 (the-as collide-shape-prim-group (-> obj root-override2 root-prim)))) + (let ((a0-3 (-> v1-5 child 3))) + (set! (-> a0-3 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> a0-3 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a0-3 transform-index) 23) + (set-vector! (-> a0-3 local-sphere) 0.0 -819.2 -4915.2 1638.4) + ) + (let ((a0-6 (-> v1-5 child 4))) + (set! (-> a0-6 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> a0-6 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a0-6 transform-index) 23) + (set-vector! (-> a0-6 local-sphere) 0.0 0.0 -1638.4 2048.0) + ) + (let ((a0-9 (-> v1-5 child 5))) + (set! (-> a0-9 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> a0-9 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a0-9 transform-index) 23) + (set-vector! (-> a0-9 local-sphere) 0.0 0.0 2048.0 1638.4) + ) + (let ((v1-7 (-> v1-5 child 6))) + (set! (-> v1-7 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-7 transform-index) 23) + (set-vector! (-> v1-7 local-sphere) 0.0 1024.0 6144.0 2457.6) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod enemy-method-114 sig ((obj sig)) + "@abstract" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 10240.0 0.0 13721.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 0.0 4096.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 7168.0 0.0 4096.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-17 local-sphere) 0.0 10240.0 0.0 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) 7372.8) + (let ((v1-27 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-27 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> obj root-override2) s5-0) + ) + (enemy-method-46 obj 0) + 0 + (none) + ) + +(defmethod enemy-method-115 sig ((obj sig)) + "@abstract" + (init! obj) + (set! (-> obj channel) (the-as uint 21)) + (set! (-> obj notice-enemy-dist) 122880.0) + (set! (-> obj travel-anim-interp) 0.0) + (set! (-> obj plasma charge-speed) 0.125) + (set! (-> obj plasma powerup-sound-id) (new-sound-id)) + (set! (-> obj plasma plasma-sound-id) (new-sound-id)) + (set! (-> obj focus-info max-los-dist) 102400.0) + (set! (-> obj sig-path) #f) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-sig" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (enemy-method-113 obj *sig-nav-enemy-info*) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 147) obj)) + (add-connection *part-engine* obj 23 obj 671 (new 'static 'sphere :y 327.68 :z 7536.64 :r 163840.0)) + (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1ffc007ffff0))) + (set! (-> obj skel interp-select 1) 0) + (set! (-> obj skel top-anim) (new 'process 'top-anim-joint-control obj)) + (set! (-> obj skel interp-select 0) 0) + (set! (-> obj skel interp-select 1) 0) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + (set! (-> obj swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) + (let ((v1-26 (-> obj neck))) + (set! (-> v1-26 up) (the-as uint 1)) + (set! (-> v1-26 nose) (the-as uint 2)) + (set! (-> v1-26 ear) (the-as uint 0)) + (set-vector! (-> v1-26 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-26 ignore-angle) 30947.555) + ) + (let ((t9-10 (method-of-type bot enemy-method-115))) + (t9-10 obj) + ) + (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs enemy-flag. +(defmethod enemy-method-105 sig ((obj sig) (arg0 process)) + (let ((t9-0 (method-of-type bot enemy-method-105))) + (t9-0 obj arg0) + ) + (the-as enemy-flag (if (and (-> obj next-state) (= (-> obj next-state name) 'whip)) + (sound-play "sig-gun-strike") + ) + ) + ) + +(defmethod sig-method-251 sig ((obj sig)) + (logtest? (-> obj plasma flags) 1) + ) + +(defmethod sig-method-254 sig ((obj sig)) + (logtest? (bot-flags bf22) (-> obj bot-flags)) + ) + +(defmethod sig-method-252 sig ((obj sig)) + (logtest? (bot-flags bf20) (-> obj bot-flags)) + ) + +(defmethod sig-method-255 sig ((obj sig)) + (logtest? (bot-flags bf19) (-> obj bot-flags)) + ) + +(defmethod sig-method-246 sig ((obj sig)) + (>= 16384.0 (-> obj focus-info bullseye-xz-dist)) + ) + +(defmethod sig-method-245 sig ((obj sig)) + (and (or (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) + (and (>= 40960.0 (-> obj focus-info bullseye-xz-dist)) (= (-> obj focus-info los) 1)) + ) + (zero? (logand (bot-flags bf19) (-> obj bot-flags))) + ) + ) + +(defmethod go-hostile sig ((obj sig)) + (bot-method-223 obj #t) + (cond + ((not (bot-method-214 obj)) + (enemy-method-72 obj) + ) + ((sig-method-246 obj) + (go (method-of-object obj whip)) + ) + ((sig-method-245 obj) + (go (method-of-object obj blast)) + ) + (else + (go (method-of-object obj chase)) + ) + ) + (none) + ) + +(defmethod enemy-method-72 sig ((obj sig)) + (cond + ((bot-method-214 obj) + (go-hostile obj) + ) + ((sig-method-252 obj) + (go (method-of-object obj gun-jam)) + ) + ((sig-method-255 obj) + (go (method-of-object obj repair-gun)) + ) + ((not (outside-spot-radius? obj (the-as bot-spot #f) (the-as vector #f) #f)) + (go (method-of-object obj traveling)) + ) + ((and (-> obj focus-info fproc) (>= (fabs (-> obj focus-info ry-diff)) 9102.223)) + (go (method-of-object obj waiting-turn)) + ) + ((sig-method-251 obj) + (go (method-of-object obj charge-plasma)) + ) + ((sig-method-254 obj) + (go (method-of-object obj clean-gun)) + ) + (else + (go (method-of-object obj waiting-close)) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-idle sig ((obj sig)) + (go (method-of-object obj waiting-far)) + (none) + ) + +(defmethod fire-gun sig ((obj sig) (arg0 vector)) + "Increase gun fired counter and spawn projectile." + (+! (-> obj fired-gun-count) 1) + (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options account-for-target-velocity proj-options-8000)) + (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 ignore-handle) (process->handle obj)) + (let* ((v1-11 *game-info*) + (a0-10 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-10) + (set! (-> s5-0 attack-id) a0-10) + ) + (set! (-> s5-0 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector<-cspace! (-> s5-0 pos) (-> obj node-list data 24)) + (set! (-> s5-0 vel quad) (-> arg0 quad)) + (vector-! (-> s5-0 vel) (-> s5-0 vel) (-> s5-0 pos)) + (vector-normalize! (-> s5-0 vel) 307200.0) + (spawn-projectile sig-shot s5-0 obj *default-dead-pool*) + ) + ) + +(defmethod sig-method-258 sig ((obj sig)) + (with-pp + (let ((f30-0 (-> obj nav state speed))) + (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 16384.0 28672.0))) + (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (-> pp clock seconds-per-frame))) + ) + (let ((f28-0 (-> obj travel-anim-interp)) + (v1-7 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-7 (= v1-7 (-> obj draw art-group data 3))) + (let ((v1-12 (-> obj skel root-channel 1))) + (set! (-> v1-12 frame-interp 1) f28-0) + (set! (-> v1-12 frame-interp 0) f28-0) + ) + (let* ((f28-1 (current-cycle-distance (-> obj skel))) + (f0-5 (quaternion-y-angle (-> obj root-override2 quat))) + (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (f0-8 (fmin 28672.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) + (f0-11 (/ (* 24.0 (fmax f30-0 f0-8)) (* 30.0 f28-1))) + (a0-10 (-> obj skel root-channel 0)) + ) + (set! (-> a0-10 param 0) f0-11) + (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-11 (-> obj skel root-channel 1))) + (set! (-> a0-11 param 0) 0.0) + (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-13 (-> obj skel root-channel 0))) + (set! (-> a0-13 dist) 13107.2) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-13 param 0) 1.0) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + ) + (let ((a0-14 (-> obj skel root-channel 1))) + (set! (-> a0-14 frame-interp 1) f28-0) + (set! (-> a0-14 frame-interp 0) f28-0) + (set! (-> a0-14 dist) 22937.6) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-14 param 0) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-chan) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod enemy-method-77 sig ((obj sig) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let* ((v1-3 (enemy-method-120 obj 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) + (s5-1 (-> obj draw art-group data (-> *sig-global-info* blue-hit-anim v1-3 anim-index))) + ) + (set! (-> *sig-global-info* prev-blue-hit) v1-3) + (let ((v1-6 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-6 (= v1-6 (-> obj draw art-group data 22))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-15 (-> obj skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim s5-1)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) + (set! (-> a0-15 param 1) 1.0) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim s5-1) num-func-seek!) + ) + ) + #t + ) + (((knocked-type knocked-type-2)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-18 (-> obj skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (set! (-> a0-18 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-18 param 1) 1.0) + (set! (-> a0-18 frame-num) 0.0) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + ) + #t + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (vector-z-quaternion! s4-0 (-> obj root-override2 quat)) + (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (enemy-method-50 obj s4-0) + (let* ((f0-14 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-15 (deg- f0-14 f30-0)) + (f1-0 (fabs f0-15)) + (s4-1 (cond + ((>= 8192.0 f1-0) + (-> obj draw art-group data 16) + ) + ((>= f1-0 24576.0) + (-> obj draw art-group data 15) + ) + ((< f0-15 0.0) + (-> obj draw art-group data 17) + ) + (else + (-> obj draw art-group data 18) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-25 (-> obj skel root-channel 0))) + (set! (-> a0-25 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-25 param 1) (-> arg0 0)) + (set! (-> a0-25 frame-num) 0.0) + (joint-control-channel-group! a0-25 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + ) + ) + #t + ) + ) + ) + +(defmethod enemy-method-78 sig ((obj sig) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) + (-> obj draw art-group data 22) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-3 (-> obj skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) 1.0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + ) + #t + ) + ) + (((knocked-type knocked-type-2)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-6 (-> obj skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + ) + (set! (-> a0-6 param 1) 1.0) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + ) + #t + ) + (else + (not (ja-done? 0)) + ) + ) + ) + +(defmethod enemy-method-84 sig ((obj sig) (arg0 enemy-jump-info)) + (logclear! (-> obj bot-flags) (bot-flags bf23)) + (let ((f1-0 (vector-vector-xz-distance (-> arg0 dest-pos) (-> arg0 start-pos))) + (f2-1 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) + ) + 2048.0 + (let* ((f0-2 -245760.0) + (v1-6 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + (f1-4 + (cond + ((or (not (and v1-6 (= v1-6 (-> obj draw art-group data 3)))) (or (= (-> obj jump-why) 4) (>= f2-1 8192.0))) + (set! (-> obj bot-flags) (logior (bot-flags bf23) (-> obj bot-flags))) + (let ((f2-3 (fmax 12288.0 (* 0.5 f1-0))) + (f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) + ) + (- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f2-3) (+ 10240.0 f1-3)) f1-3) + ) + ) + (else + (fmax 2048.0 (* 0.2 f1-0)) + ) + ) + ) + ) + (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (* 0.000011111111 f0-2)) + ) + ) + (none) + ) + +(defmethod enemy-method-86 sig ((obj sig)) + (let* ((t9-0 (method-of-type bot enemy-method-86)) + (v0-0 (t9-0 obj)) + ) + (when (and (= (-> obj jump-why) 4) (not v0-0)) + (when (< (-> obj root-override2 transv y) 0.0) + (let* ((v1-11 (-> obj actor-group 0 data (-> obj platform-index) actor)) + (a0-5 (if v1-11 + (-> v1-11 extra process) + ) + ) + ) + (when a0-5 + (let ((s4-0 (-> (the-as process-focusable a0-5) root-override trans)) + (s5-0 (-> obj root-override2 trans)) + ) + (when (< 2048.0 (- (-> s4-0 y) (-> s5-0 y))) + (vector-reset! (-> obj root-override2 transv)) + (let ((f30-0 9420.8)) + (when (< f30-0 (vector-vector-xz-distance s4-0 s5-0)) + (vector-! s5-0 s5-0 s4-0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 f30-0) + (vector+! s5-0 s5-0 s4-0) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'collide-query))) + (find-ground (-> obj root-override2) a1-4 (the-as collide-spec (-> obj gnd-collide)) 8192.0 81920.0 1024.0) + ) + (set! (-> s5-0 y) (-> obj root-override2 gspot-pos y)) + (set! v0-0 #t) + ) + ) + ) + ) + ) + ) + v0-0 + ) + ) + +;; WARN: Return type mismatch object vs float. +(defmethod enemy-method-85 sig ((obj sig)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((t9-0 (method-of-type bot enemy-method-85))) + (t9-0 obj) + ) + (let ((s5-0 (static-sound-spec "sig-jland" :mask (reg0)))) + (set! (-> s5-0 reg 0) (the-as uint (-> obj root-override2 ground-pat material))) + (sound-play-by-spec s5-0 (new-sound-id) (the-as vector #t)) + ) + (the-as + float + (cond + ((logtest? (bot-flags bf23) (-> obj bot-flags)) + (let ((v0-3 (the-as object (-> obj root-override2 transv)))) + (.svf (&-> (the-as vector v0-3) quad) vf0) + v0-3 + ) + ) + (else + (let ((v1-9 obj)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) + ) + 0 + (let ((v1-11 obj)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-11 enemy-flags))) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-11 enemy-flags)))) + ) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-11 enemy-flags)))) + (set! (-> v1-11 nav callback-info) (-> v1-11 enemy-info-override callback-info)) + ) + 0 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> obj root-override2 transv quad)) + (set! (-> s5-1 y) 0.0) + (let ((v1-18 (-> obj nav state))) + (set! (-> v1-18 speed) (fmin (vector-length s5-1) (-> obj nav target-speed))) + ) + 0 + (vector-xz-normalize! s5-1 16384.0) + (let ((v1-21 (-> obj nav state))) + (logior! (-> v1-21 flags) (nav-state-flag directional-mode)) + (set! (-> v1-21 travel quad) (-> s5-1 quad)) + ) + ) + 0.0 + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs symbol. +(defmethod enemy-method-89 sig ((obj sig) (arg0 enemy-jump-info)) + (the-as + symbol + (when (logtest? (bot-flags bf23) (-> obj bot-flags)) + (let ((a0-2 (-> obj skel root-channel 0))) + (set! (-> a0-2 param 0) 1.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info-override jump-wind-up-anim))) + (a0-6 (-> obj skel root-channel 0)) + ) + (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) + (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) + (set! (-> a0-6 param 1) (-> arg0 anim-speed)) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim a1-3) num-func-seek!) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs symbol. +(defmethod enemy-method-88 sig ((obj sig) (arg0 enemy-jump-info)) + (the-as + symbol + (when (logtest? (bot-flags bf23) (-> obj bot-flags)) + (let ((a0-2 (-> obj skel root-channel 0))) + (set! (-> a0-2 param 0) 1.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info-override jump-land-anim))) + (a0-6 (-> obj skel root-channel 0)) + ) + (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) + (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) + (set! (-> a0-6 param 1) (-> arg0 anim-speed)) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim a1-3) num-func-seek!) + ) + ) + ) + ) + +;; WARN: Return type mismatch float vs meters. +(defmethod set-cam-height! sig ((obj sig) (arg0 vector)) + (cond + ((and (-> obj next-state) (= (-> obj next-state name) 'failed)) + (set-vector! arg0 0.0 4096.0 28672.0 1.0) + ) + ((logtest? (-> obj focus-status) (focus-status under-water)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + ) + (else + (set-vector! arg0 0.0 20480.0 45056.0 1.0) + ) + ) + (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (the-as + meters + (if (logtest? (-> obj focus-status) (focus-status under-water)) + (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + ) + ) + ) + +(defmethod bot-method-216 sig ((obj sig)) + (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to obj))) + 0 + (none) + ) + +;; WARN: Return type mismatch enemy-flag vs none. +(defmethod sig-method-249 sig ((obj sig) (arg0 sig-path)) + (set! (-> obj sig-path) arg0) + (set! (-> obj sig-path-clock) (-> *display* user0-clock)) + (set! (-> obj sig-path-start-time) (-> obj sig-path-clock frame-counter)) + (set! (-> obj sig-path-cur-time) (-> obj sig-path-start-time)) + (set! (-> obj sig-path-prev-time) (-> obj sig-path-start-time)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod sig-method-248 sig ((obj sig) (arg0 sig-path-sample)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 (-> obj sig-path-clock frame-counter))) + (when (!= (-> obj sig-path-cur-time) a0-1) + (set! (-> obj sig-path-prev-time) (-> obj sig-path-cur-time)) + (set! (-> obj sig-path-cur-time) a0-1) + (set! (-> obj event-param-point quad) (-> obj root-override2 trans quad)) + ) + ) + (let ((s3-0 (+ (-> obj sig-path sample-count) -1)) + (s2-0 (the int (* 0.05 (the float (- (-> obj sig-path-prev-time) (-> obj sig-path-start-time)))))) + (s4-0 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) + ) + (if (< s3-0 s2-0) + (set! s2-0 s3-0) + ) + (if (< s3-0 s4-0) + (set! s4-0 s3-0) + ) + (cond + ((= s2-0 s4-0) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s2-0)) 64) + ) + (else + (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s4-0)) 64) + (let ((v1-22 0)) + (countdown (a0-9 (- s4-0 s2-0)) + (set! v1-22 (logior v1-22 (logand (-> obj sig-path samples (+ a0-9 s2-0) flags) 3))) + ) + (logior! (-> arg0 flags) v1-22) + ) + ) + ) + (when (< s4-0 s3-0) + (let* ((f0-6 0.05) + (f1-5 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))) + (f30-0 (* f0-6 (- f1-5 (* (the float (the int (/ f1-5 20.0))) 20.0)))) + (v1-30 (-> obj sig-path samples)) + (s3-1 (-> v1-30 s4-0)) + (s4-1 (-> v1-30 (+ s4-0 1))) + (s2-1 (-> arg0 flags)) + ) + (vector-lerp! (-> arg0 pos) (-> s3-1 pos) (-> s4-1 pos) f30-0) + (quaternion-slerp! (-> arg0 quat) (-> s3-1 quat) (-> s4-1 quat) f30-0) + (set! (-> arg0 flags) s2-1) + ) + (vector-! (-> obj root-override2 transv) (-> arg0 pos) (-> obj event-param-point)) + (let ((v0-5 (-> obj root-override2 transv))) + (.lvf vf1 (&-> (-> obj root-override2 transv) quad)) + (let ((f0-7 (-> pp clock frames-per-second))) + (.mov at-0 f0-7) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v0-5 quad) vf1) + ) + ) + ) + (none) + ) + ) + ) + +(defmethod sig-method-256 sig ((obj sig)) + (let* ((v1-3 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) + (v1-4 (- (+ (-> obj sig-path sample-count) -1) v1-3)) + ) + (if (<= v1-4 0) + 0 + (* 20 v1-4) + ) + ) + (none) + ) + +(defmethod sig-method-257 sig ((obj sig)) + (>= (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) + (+ (-> obj sig-path sample-count) -1) + ) + ) + +(defmethod sig-method-250 sig ((obj sig)) + (local-vars (a2-7 float) (a2-14 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((s5-0 (new 'stack-no-clear 'sphere))) + (let ((v1-4 (+ (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) 2)) + (a0-3 (-> obj sig-path sample-count)) + (a1-1 (-> obj sig-path samples)) + ) + (while (< v1-4 a0-3) + (let ((a2-1 (-> a1-1 v1-4))) + (when (not (logtest? (-> a2-1 flags) 4)) + (set! (-> s5-0 quad) (-> a2-1 pos quad)) + (set! (-> s5-0 r) 32768.0) + (goto cfg-8) + ) + ) + (+! v1-4 1) + ) + ) + (return #f) + (label cfg-8) + (let ((s4-0 (the-as process-drawable #f))) + (let ((f30-0 -1.0)) + (set! *actor-list-length* 0) + (if #t + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* s5-0 *actor-list* 256)) + ) + (when #f + (let ((a0-7 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-21 (-> a0-7 next0))) + (while (!= a0-7 (-> *collide-player-list* alive-list-end)) + (let* ((a0-8 (-> (the-as connection a0-7) param1)) + (a1-3 (-> (the-as collide-shape a0-8) root-prim)) + ) + (when (logtest? (collide-spec hit-by-others-list pusher) (-> a1-3 prim-core collide-as)) + (let ((a1-4 (-> a1-3 prim-core))) + (let ((a2-6 a1-4) + (a3-5 s5-0) + ) + (.lvf vf2 (&-> a2-6 world-sphere quad)) + (.lvf vf3 (&-> a3-5 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-7 vf1) + (let ((f0-4 a2-7) + (f1-3 (+ (-> a1-4 world-sphere w) (-> s5-0 r))) + ) + (when (< f0-4 (* f1-3 f1-3)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-8)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-7 v1-21) + *collide-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (when #f + (let ((a0-10 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-28 (-> a0-10 next0))) + (while (!= a0-10 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-11 (-> (the-as connection a0-10) param1)) + (a1-15 (-> (the-as collide-shape a0-11) root-prim)) + ) + (when (logtest? (collide-spec hit-by-others-list pusher) (-> a1-15 prim-core collide-as)) + (let ((a1-16 (-> a1-15 prim-core))) + (let ((a2-13 a1-16) + (a3-7 s5-0) + ) + (.lvf vf2 (&-> a2-13 world-sphere quad)) + (.lvf vf3 (&-> a3-7 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-14 vf1) + (let ((f0-5 a2-14) + (f1-7 (+ (-> a1-16 world-sphere w) (-> s5-0 r))) + ) + (when (< f0-5 (* f1-7 f1-7)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-11)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-10 v1-28) + *collide-hit-by-player-list* + (set! v1-28 (-> v1-28 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let* ((v1-33 (-> *actor-list* s3-0)) + (a0-14 (-> v1-33 root-prim)) + ) + (when (logtest? (collide-spec hit-by-others-list pusher) (-> a0-14 prim-core collide-as)) + (let* ((s1-0 (-> v1-33 process)) + (s2-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-0 + (let ((f0-6 (vector-vector-distance-squared s5-0 (get-trans (the-as process-focusable s2-0) 0)))) + (when (or (< f30-0 0.0) (< f0-6 f30-0)) + (set! f30-0 f0-6) + (set! s4-0 s2-0) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + (s4-0 + (fire-gun obj (get-trans (the-as process-focusable s4-0) 3)) + #t + ) + (else + #f + ) + ) + ) + ) + ) + ) + +(defmethod draw hud-sig ((obj hud-sig)) + (set-hud-piece-position! + (-> obj sprites 2) + (the int (+ 30.0 (* -130.0 (-> obj offset)))) + (the int (+ 30.0 (* -100.0 (-> obj offset)))) + ) + (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 15 2) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-sig ((obj hud-sig)) + (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-sig ((obj hud-sig)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 0 scale-x) 12.0) + (set! (-> obj sprites 0 scale-y) 11.2) + (set! (-> obj sprites 0 pos z) #xfffff2) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> obj sprites 1 pos z) #xfffff0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 3 tex) + (lookup-texture-by-name "hud-sig-head" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.4) + (set! (-> obj sprites 3 pos z) #xffffff) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/game/main-h.gc b/goal_src/jak2/engine/game/main-h.gc index da3a26e949..12ce8ee2ed 100644 --- a/goal_src/jak2/engine/game/main-h.gc +++ b/goal_src/jak2/engine/game/main-h.gc @@ -47,7 +47,20 @@ (all-off 0) (course-spots 1) (task-spots 2) - (all-on 3)) + (all-on 3) + (bmc04 4) + (bmc05 5) + (bmc06 6) + (bmc07 7) + (bmc08 8) + (bmc09 9) + (bmc10 10) + (bmc11 11) + (bmc12 12) + (bmc13 13) + (bmc14 14) + (bmc15 15) + (bmc16 16)) ;; ---bot-marks-controls ;; +++race-marks-controls diff --git a/goal_src/jak2/levels/atoll/ash1-course.gc b/goal_src/jak2/levels/atoll/ash1-course.gc index 0cdb54ae2e..d4f8e94237 100644 --- a/goal_src/jak2/levels/atoll/ash1-course.gc +++ b/goal_src/jak2/levels/atoll/ash1-course.gc @@ -7,3 +7,461 @@ ;; DECOMP BEGINS +(deftype ashelin-battle (ashelin) + ((player-in-bounds-time time-frame :offset-assert 1040) + ) + :heap-base #x3a0 + :method-count-assert 252 + :size-assert #x418 + :flag-assert #xfc03a00418 + (:methods + (set-frontline-dist! (_type_) none 251) + ) + ) + + +(defmethod set-frontline-dist! ashelin-battle ((obj ashelin-battle)) + (let ((a0-1 *target*)) + (when a0-1 + (set! (-> obj frontline w) (- (+ 40960.0 (vector-dot (the-as vector (-> obj frontline)) (get-trans a0-1 0))))) + 0 + ) + ) + (none) + ) + +(define *ash1-course* + (new 'static 'ashelin-course + :course-id #x1 + :speech-count #x30 + :spot-count #x8 + :attack-player-speeches (new 'static 'bot-speech-list-shuffle + :flags #xe + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 11 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26) + ) + :default-check-too-far #f + :waypoints (new 'static 'boxed-array :type bot-waypoint + (new 'static 'bot-waypoint + :waypoint-id 1 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (clear-speech-flags! arg0) + (move-to-point! (-> arg0 root-override2) (the-as vector (-> arg0 ash-course spots 0))) + (let ((v1-7 (game-task-control-method-9 (-> arg0 task)))) + (if (= (-> v1-7 action) (game-task-action say)) + (add-process + *gui-control* + arg0 + (gui-channel art-load) + (gui-action queue) + (the-as string (-> v1-7 scene)) + -99.0 + 0 + ) + ) + ) + (let ((a0-8 15)) + (set! (-> arg0 hit-points) a0-8) + (set! (-> arg0 enemy-info-override default-hit-points) a0-8) + ) + (set! (-> arg0 waypoint-time0) 0) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 0)) + (set! (-> v1-10 bytes 4) (the-as uint -1)) + (set! (-> (the-as asht-wait-spot v1-10) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (with-pp + (if (and (zero? (-> arg1 waypoint-time0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 0 actor)) + ) + (t9-0 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + ) + (let ((s5-0 (game-task-control-method-9 (-> arg1 task)))) + (cond + ((and (nonzero? (-> arg1 waypoint-time0)) + (and (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 1)) + (let ((f0-0 143360.0)) + (and (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root-override2 trans))) + (= (-> s5-0 action) (game-task-action say)) + ) + ) + ) + ) + (process-entity-status! arg1 (entity-perm-status no-kill) #t) + (when (scene-play arg1 (the-as string (-> s5-0 scene)) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 2 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (process-entity-status! arg1 (entity-perm-status no-kill) #f) + ) + ) + ) + #f + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 2 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 0)) + (set! (-> (the-as asht-wait-spot v1-1) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (when (scene-release? arg1) + (set! (-> arg1 bot-flags) (logior (bot-flags bf20) (-> arg1 bot-flags))) + (let ((s5-0 (-> arg1 ash-course spots))) + (vector-! (the-as vector (-> arg1 frontline)) (the-as vector (-> s5-0 2)) (the-as vector (-> s5-0 1))) + (vector-normalize! (-> arg1 frontline) 1.0) + (set! (-> arg1 frontline w) (- (vector-dot (the-as vector (-> arg1 frontline)) (the-as vector (-> s5-0 1))))) + ) + (set-frontline-dist! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 3 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 3 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (with-pp + (send-event arg0 'hide #f) + (ashelin-method-250 arg0 #t) + (set! (-> arg0 notice-enemy-dist) 245760.0) + (set-setting! 'sound-mode #f 0 1) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set-setting! 'airlock #f 0 0) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer pp)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'trigger) + (let ((t9-4 send-event-function) + (v1-18 (-> arg0 actor-group 0 data 1 actor)) + ) + (t9-4 + (if v1-18 + (-> v1-18 extra process) + ) + a1-4 + ) + ) + ) + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-save-ashelin-res-b" -99.0 0) + (let ((v1-24 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-24 bytes 5) (the-as uint 2)) + (set! (-> v1-24 bytes 6) (the-as uint 3)) + (set! (-> v1-24 bytes 7) (the-as uint 4)) + (set! (-> (the-as asht-wait-spot v1-24) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (with-pp + (when (not (channel-active? arg1 (the-as uint 0))) + (cond + ((and (not (speech-playing? arg1 45)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 2.5)) + ) + (play-speech arg1 45) + ) + ((and (not (speech-playing? arg1 46)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 7)) + ) + (play-speech arg1 46) + ) + ((and (not (speech-playing? arg1 47)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 14)) + ) + (play-speech arg1 47) + ) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer pp)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'query) + (set! (-> a1-8 param 0) (the-as uint 'beaten)) + (let ((t9-7 send-event-function) + (v1-37 (-> arg1 actor-group 0 data 1 actor)) + ) + (when (t9-7 + (if v1-37 + (-> v1-37 extra process) + ) + a1-8 + ) + (logclear! (-> arg1 bot-flags) (bot-flags bf20)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 4 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 ashelin-battle)) + (with-pp + (set-frontline-dist! arg0) + (let ((s5-0 (target-pos 0))) + (if (>= (-> s5-0 y) 176128.0) + (set! (-> arg0 player-in-bounds-time) (-> pp clock frame-counter)) + ) + (if (>= (- (-> pp clock frame-counter) (-> arg0 player-in-bounds-time)) (seconds 4)) + (send-event arg0 'instant-death) + ) + (if (< (-> s5-0 y) 192512.0) + (logior! (-> arg0 bot-flags) (bot-flags bf10)) + (logclear! (-> arg0 bot-flags) (bot-flags bf10)) + ) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 4 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (task-node-close! (game-task-node atoll-battle-battle)) + (remove-setting! 'sound-mode) + (ashelin-method-250 arg0 #f) + (remove-setting! 'airlock) + (logclear! (-> arg0 bot-flags) (bot-flags bf10)) + (when (not (channel-active? arg0 (the-as uint 0))) + (let ((v1-12 (get-rand-int arg0 3))) + (cond + ((zero? v1-12) + (play-speech arg0 42) + ) + ((= v1-12 1) + (play-speech arg0 43) + ) + (else + (play-speech arg0 44) + ) + ) + ) + ) + (let ((v1-20 (game-task-control-method-9 (-> arg0 task)))) + (if (= (-> v1-20 action) (game-task-action say)) + (add-process + *gui-control* + arg0 + (gui-channel art-load) + (gui-action queue) + (the-as string (-> v1-20 scene)) + -99.0 + 0 + ) + ) + ) + (let ((v1-22 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-22 bytes 5) (the-as uint 3)) + (set! (-> v1-22 bytes 6) (the-as uint 5)) + (set! (-> v1-22 bytes 7) (the-as uint 6)) + (set! (-> v1-22 bytes 8) (the-as uint 7)) + (let ((v0-12 + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 1.5)) + (let ((s5-0 (game-task-control-method-9 (-> arg1 task)))) + (when (and (= (-> s5-0 action) (game-task-action say)) + (not (channel-active? arg1 (the-as uint 0))) + (scene-play arg1 (the-as string (-> s5-0 scene)) #f) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 5 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + (set! (-> (the-as asht-wait-spot v1-22) check-done) v0-12) + (the-as symbol v0-12) + ) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 5 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (logclear! (-> arg0 bot-flags) (bot-flags bf06)) + (bot-method-196 arg0) + (let ((v1-5 (-> arg0 root-override2 root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + (set! (-> arg0 root-override2 backup-collide-as) (collide-spec)) + (set! (-> arg0 root-override2 backup-collide-with) (collide-spec)) + 0 + (send-event arg0 'hide #t) + (let ((v1-15 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-15 bytes 5) (the-as uint 3)) + (set! (-> v1-15 bytes 6) (the-as uint 5)) + (set! (-> v1-15 bytes 7) (the-as uint 6)) + (set! (-> v1-15 bytes 8) (the-as uint 7)) + (set! (-> (the-as asht-wait-spot v1-15) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) (when (scene-release? arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 6 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 6 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (process-entity-status! arg0 (entity-perm-status bit-4) #f) + (process-entity-status! arg0 (entity-perm-status no-kill) #f) + (logclear! (-> arg0 enemy-flags) (enemy-flag use-notice-distance)) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 3)) + (set! (-> v1-3 bytes 6) (the-as uint 5)) + (set! (-> v1-3 bytes 7) (the-as uint 6)) + (set! (-> v1-3 bytes 8) (the-as uint 7)) + (set! (-> (the-as asht-wait-spot v1-3) check-done) (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) #f)) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + ) + :speeches (new 'static 'inline-array bot-speech-info 48 + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha001") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha008") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha009") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha010") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha011") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha012") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha013") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha002") + (new 'static 'bot-speech-info :flags (speech-flags sf10) :hold-time #x5a :slave-id -1 :name "asha003") + (new 'static 'bot-speech-info :flags (speech-flags sf06) :hold-time #x5a :slave-id -1 :name "asha004") + (new 'static 'bot-speech-info :flags (speech-flags sf06) :hold-time #x5a :slave-id -1 :name "asha005") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha006") + (new 'static 'bot-speech-info :flags (speech-flags sf08) :hold-time #x5a :slave-id -1 :name "asha007") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha018") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha019") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha020") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha021") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha022") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha023") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha024") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha025") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha026") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha027") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha028") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha029") + (new 'static 'bot-speech-info :flags (speech-flags sf10) :hold-time #x5a :slave-id -1 :name "asha030") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha031") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha035") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha036") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha039") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha041") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha050") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha051") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha052") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha054") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha014") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha015") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha016") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha017") + (new 'static 'bot-speech-info :flags (speech-flags sf11) :hold-time #x5a :slave-id -1 :name "asha038") + (new 'static 'bot-speech-info :flags (speech-flags sf11) :hold-time #x5a :slave-id -1 :name "asha044") + (new 'static 'bot-speech-info :flags (speech-flags sf11) :hold-time #x5a :slave-id -1 :name "asha049") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha032") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha033") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha034") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha037") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha047") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha042") + ) + :speech-tunings (new 'static 'inline-array bot-speech-tuning 1 + (new 'static 'bot-speech-tuning :fo-min 30 :fo-max 100 :fo-curve #xb :trans? #t) + ) + :spots (new 'static 'inline-array bot-spot 8 + (new 'static 'bot-spot :center (new 'static 'vector :x 2263285.8 :y 213319.69 :z -4552335.5 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2293555.2 :z -4570276.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2235105.2 :z -4669890.5 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2224291.8 :y 222167.05 :z -4707533.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2164695.0 :y 221593.6 :z -4725145.5 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2305392.8 :y 214671.36 :z -4561797.0 :w 8192.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2245959.8 :y 214425.6 :z -4561961.0 :w 8192.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2269757.5 :y 216965.12 :z -4560404.5 :w 8192.0)) + ) + :ouch-speeches (new 'static 'bot-speech-list-shuffle + :flags #x6 + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 35 36 37 38 39 40 41) + ) + :victory-speeches (new 'static 'bot-speech-list-shuffle + :flags #xe + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 0 1 2 3 4 5 6 27 28 29 30 31 32 33 34) + ) + ) + ) + +(set! (-> *bot-course-table* course 1) *ash1-course*) diff --git a/goal_src/jak2/levels/atoll/sig0-course.gc b/goal_src/jak2/levels/atoll/sig0-course.gc index b7b829a95c..2cce49b625 100644 --- a/goal_src/jak2/levels/atoll/sig0-course.gc +++ b/goal_src/jak2/levels/atoll/sig0-course.gc @@ -5,5 +5,3182 @@ ;; name in dgo: sig0-course ;; dgos: ATE +(declare-type sig0-course bot-course) + ;; DECOMP BEGINS +(deftype sig-atoll (sig) + ((sig-course sig0-course :offset 652) + ) + :heap-base #x3b0 + :method-count-assert 260 + :size-assert #x430 + :flag-assert #x10403b00430 + (:methods + (sig-atoll-method-259 (_type_) symbol 259) + ) + ) + + +(deftype sig0-course (bot-course) + ((liftcat-speech-index int8 :offset-assert 48) + (first-liftcat-speeches (array int16) :offset-assert 52) + (second-liftcat-speeches (array int16) :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + + +;; WARN: Return type mismatch object vs symbol. +(defmethod alive? sig-atoll ((obj sig-atoll)) + (let ((t9-0 (method-of-type bot alive?))) + (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'waiting-far) + (= v1-3 'waiting-close) + (= v1-3 'waiting-turn) + (= v1-3 'waiting-crouched) + (= v1-3 'charge-plasma) + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-idle sig-atoll ((obj sig-atoll)) + (cond + ((task-node-closed? (game-task-node atoll-sig-resolution)) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + (else + (go (method-of-object obj waiting-crouched)) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod sig-atoll-method-259 sig-atoll ((obj sig-atoll)) + (let ((v1-0 *target*)) + (the-as symbol (and v1-0 + (not (logtest? (-> v1-0 focus-status) (focus-status edge-grab))) + (>= (- (-> v1-0 control trans y) (-> obj sig-course spots 11 center y)) -819.2) + ) + ) + ) + ) + +(defun sig0-first-battle-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (cond + ((and (zero? gp-0) (< 24576.0 (- (-> (get-trans *target* 1) y) (-> arg0 sig-course spots 2 center y)))) + (set! gp-0 1) + ) + ((>= (-> (target-pos 0) z) -3399680.0) + (set! gp-0 2) + ) + ) + gp-0 + ) + ) + +(defun sig0-tank-check-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (if (and (zero? gp-0) (not (sig-atoll-method-259 arg0))) + (set! gp-0 1) + ) + gp-0 + ) + ) + +(defun sig0-gangway-check-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (when (nonzero? gp-0) + (let* ((s5-1 (-> arg0 sig-course spots)) + (f0-0 (vector-segment-distance-point! + (target-pos 0) + (the-as vector (-> s5-1 18)) + (the-as vector (-> s5-1 19)) + (the-as vector #f) + ) + ) + ) + (cond + ((< f0-0 45056.0) + (set! gp-0 0) + ) + ((< f0-0 110592.0) + (set! gp-0 1) + ) + ) + ) + ) + gp-0 + ) + ) + +(defun sig0-final-snipers-check-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (when (or (zero? gp-0) (= gp-0 1)) + (let ((f0-1 (- (-> (get-trans *target* 1) y) (-> arg0 sig-course spots 38 center y)))) + (cond + ((>= f0-1 53248.0) + (set! gp-0 2) + ) + ((>= f0-1 34816.0) + (set! gp-0 1) + ) + ) + ) + ) + gp-0 + ) + ) + +(defun sig0-say-look-out-if-should ((arg0 sig-atoll)) + (when (logtest? (-> arg0 bot-task-bits) 4) + (when (not (logtest? (-> arg0 bot-task-bits) 16)) + (let ((s5-0 (handle->process (-> arg0 focus handle)))) + (when s5-0 + (let ((v1-9 (if (type? s5-0 nav-enemy) + s5-0 + ) + ) + ) + (when v1-9 + (if (>= 20480.0 (- (-> (the-as process-focusable v1-9) root-override trans y) (-> arg0 root-override2 trans y))) + (logior! (-> arg0 bot-task-bits) 16) + ) + ) + ) + ) + ) + ) + (if (and (logtest? (-> arg0 bot-task-bits) 16) + (not (speech-playing? arg0 26)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 26) + ) + ) + (none) + ) + +(defun sig-say-waste-the-suckers-if-should ((arg0 sig-atoll)) + (if (and (logtest? (-> arg0 bot-task-bits) 8) + (not (speech-playing? arg0 25)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 25) + ) + (none) + ) + +(define *sig0-course* + (new 'static 'sig0-course + :speech-count #x34 + :spot-count #x2a + :too-far-warn-speeches (new 'static 'bot-speech-list-shuffle + :flags #xa + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 35 36 37) + ) + :too-far-fail-speeches (new 'static 'bot-speech-list-shuffle + :flags #xa + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 38 43 44 45 48 49 50 51) + ) + :attack-player-speeches (new 'static 'bot-speech-list + :flags #x2 + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 42 41 39 40 46 47) + ) + :default-check-too-far 'bot-simple-check-too-far + :waypoints (new 'static 'boxed-array :type bot-waypoint + (new 'static 'bot-waypoint + :waypoint-id 1 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll) (arg1 bot-speech-list-shuffle)) + (let ((a0-1 20)) + (set! (-> arg0 hit-points) a0-1) + (set! (-> arg0 enemy-info-override default-hit-points) a0-1) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set-vector! a1-1 0.0 32768.0 0.0 1.0) + (quaternion-zxy! (-> arg0 root-override2 quat) a1-1) + ) + (clear-speech-flags! arg0) + (logior! (-> arg0 focus-status) (focus-status disable)) + (let ((v1-9 (game-task-control-method-9 (-> arg0 task)))) + (if (= (-> v1-9 action) (game-task-action say)) + (add-process + *gui-control* + arg0 + (gui-channel art-load) + (gui-action queue) + (the-as string (-> v1-9 scene)) + -99.0 + 0 + ) + ) + ) + (let ((v1-11 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-11 bytes 5) (the-as uint 1)) + (set! (-> v1-11 bytes 6) (the-as uint 0)) + (set! (-> v1-11 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-11) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when *target* + (let* ((s5-0 (target-pos 0)) + (f1-0 (vector-vector-xz-distance (-> arg1 root-override2 trans) s5-0)) + (f0-1 (- (-> s5-0 x) (-> arg1 root-override2 trans x))) + (f2-2 (- (-> s5-0 z) (-> arg1 root-override2 trans z))) + ) + (when (and (>= f2-2 -40960.0) + (or (>= 40960.0 f1-0) (< f2-2 24576.0) (and (< f2-2 192512.0) (or (< f0-1 -81920.0) (< 53248.0 f0-1)))) + ) + (let ((v1-19 (game-task-control-method-9 (-> arg1 task)))) + (cond + ((= (-> v1-19 action) (game-task-action say)) + (when (scene-play arg1 (the-as string (-> v1-19 scene)) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 2 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 3 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 2 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (stop-speech arg0 (the-as uint 0) #f) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 0)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (scene-release? arg1) + (reset-warn-time! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 3 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 3 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (if (demo?) + (talker-spawn-func (-> *talker-speech* 77) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (process-entity-status! arg0 (entity-perm-status no-kill) #t) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set! (-> arg0 too-far-warn-dist) 286720.0) + (set-setting! 'airlock #f 0 0) + (let ((a1-3 (new 'stack-no-clear 'array 'symbol 3))) + (set! (-> a1-3 2) 'atoll3) + (set! (-> a1-3 1) 'atoll2) + (set! (-> a1-3 0) 'atoll1) + (want-sound-banks *load-state* a1-3) + ) + (play-speech arg0 0) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'trigger) + (let ((t9-7 send-event-function) + (v1-21 (-> arg0 actor-group 0 data 0 actor)) + ) + (t9-7 + (if v1-21 + (-> v1-21 extra process) + ) + a1-5 + ) + ) + ) + (let ((v1-25 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-25 bytes 5) (the-as uint 1)) + (set! (-> v1-25 bytes 6) (the-as uint 1)) + (set! (-> v1-25 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-25) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 4 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 sig-atoll)) + (if (and (logtest? (-> arg0 bot-task-bits) 2) + (not (speech-playing? arg0 33)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 33) + ) + (none) + ) + :on-skipping-here #f + :check-too-far 'sig0-first-battle-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 4 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 286720.0) + (let ((v1-2 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-2 bytes 5) (the-as uint 1)) + (set! (-> v1-2 bytes 6) (the-as uint 2)) + (set! (-> v1-2 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-2) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 0 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 5 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (if (and (logtest? (-> arg0 bot-task-bits) 2) + (not (speech-playing? arg0 33)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 33) + ) + (none) + ) + :on-skipping-here #f + :check-too-far 'sig0-first-battle-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 5 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-choose-piston arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 4)) + (set! (-> v1-1 bytes 6) (the-as uint 3)) + (set! (-> v1-1 bytes 7) (the-as uint 4)) + (set! (-> v1-1 bytes 8) (the-as uint 5)) + (set! (-> v1-1 bytes 9) (the-as uint 6)) + (set! (-> v1-1 bytes 10) (the-as uint 1)) + (set! (-> v1-1 bytes 11) (the-as uint 1)) + (set! (-> v1-1 bytes 12) (the-as uint 2)) + (set! (-> v1-1 bytes 13) (the-as uint 2)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-choose-piston v1-1) check-done) + (lambda ((arg0 sigt-choose-piston) (arg1 sig-atoll)) + (when (sigt-choose-piston-method-12 arg0 arg1) + (reset-warn-time! arg1) + (set! (-> arg1 platform-index) (-> arg0 actor-indexes (-> arg0 which-spot))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 6 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (if (and (not (speech-playing? arg0 1)) + (not (channel-active? arg0 (the-as uint 0))) + (< (-> arg0 root-override2 trans z) (-> (target-pos 0) z)) + ) + (play-speech arg0 1) + ) + (none) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 6 + :nav-mesh-index 1 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (logior! (-> arg0 focus-status) (focus-status ignore)) + (let ((gp-0 7) + (s5-0 8) + ) + (when (= (-> arg0 platform-index) 2) + (set! gp-0 9) + (set! s5-0 10) + ) + (let ((v1-6 (get-task-by-type (-> arg0 ai-ctrl) sigt-riding-piston arg0))) + (set! (-> v1-6 bytes 5) (the-as uint 2)) + (set! (-> v1-6 bytes 6) (the-as uint gp-0)) + (set! (-> v1-6 bytes 7) (the-as uint s5-0)) + (set! (-> v1-6 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-riding-piston v1-6) check-done) + (the-as + (function sigt-riding-piston sig symbol) + (lambda ((arg0 ai-task-control) (arg1 sig-atoll)) (when (ai-task-control-method-12 arg0 arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 7 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (when (not (channel-active? arg0 (the-as uint 0))) + (if (and (not (speech-playing? arg0 1)) (< (-> arg0 root-override2 trans z) (-> (target-pos 0) z))) + (play-speech arg0 1) + ) + ) + (none) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 7 + :nav-mesh-index 1 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (reset-warn-time! arg0) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 11)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 3 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (cond + ((sig-atoll-method-259 arg1) + (let ((a0-4 (-> arg1 actor-group 0 data 4 actor))) + (set! (-> arg1 poi-handle) (ppointer->handle (if a0-4 + (process->ppointer (-> a0-4 extra process)) + ) + ) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 8 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ((not (speech-playing? arg1 3)) + (play-speech arg1 3) + (reset-warn-time! arg1) + #f + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-tank-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 8 + :nav-mesh-index 1 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (logclear! (-> arg0 focus-status) (focus-status ignore)) + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sig-tank" -99.0 0) + (let ((v1-6 (-> arg0 entity extra perm))) + (logior! (-> v1-6 status) (entity-perm-status bit-5)) + (set! (-> arg0 plasma charge-speed) (if (logtest? (-> v1-6 user-uint8 0) 1) + 0.5 + 0.25 + ) + ) + ) + (play-speech arg0 2) + (let ((v1-14 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-14 bytes 5) (the-as uint 3)) + (set! (-> v1-14 bytes 6) (the-as uint 12)) + (set! (-> v1-14 bytes 7) (the-as uint 13)) + (set! (-> v1-14 bytes 8) (the-as uint 14)) + (set! (-> v1-14 bytes 10) (the-as uint 4)) + (set! (-> (the-as sigt-charge-plasma v1-14) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (if (and (not (channel-active? arg1 (the-as uint 0))) (sig-atoll-method-259 arg1)) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sig-tank" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 9 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-tank-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 9 + :nav-mesh-index 1 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 15)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (scene-release? arg1) + (clear-poi-and-focus! arg1) + (reset-warn-time! arg1) + (let ((v1-8 (-> arg1 entity extra perm))) + (logior! (-> v1-8 status) (entity-perm-status bit-5)) + (set! (-> v1-8 user-int8 0) (the-as int (logior (-> v1-8 user-uint8 0) 1))) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 10 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 10 + :nav-mesh-index 2 + :skip-to #xf + :on-set (lambda ((arg0 sig-atoll)) + (play-speech arg0 4) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 36864.0) + (let ((v1-6 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-6 bytes 5) (the-as uint 2)) + (set! (-> v1-6 bytes 6) (the-as uint 16)) + (set! (-> v1-6 bytes 7) (the-as uint 17)) + (set! (-> v1-6 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-6) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (cond + ((and (logtest? (-> arg1 actor-group 0 data 5 actor extra perm status) (entity-perm-status dead)) + (logtest? (-> arg1 actor-group 0 data 6 actor extra perm status) (entity-perm-status dead)) + ) + (logclear! (-> arg1 focus-status) (focus-status disable)) + (set! (-> arg1 notice-enemy-dist) 122880.0) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 11 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + (else + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (if (and (not (speech-playing? arg1 5)) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-1 73728.0)) + (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root-override2 trans))) + ) + ) + (play-speech arg1 5) + ) + ) + #f + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here (lambda ((arg0 sig-atoll)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel art-load) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (process-entity-status! arg0 (entity-perm-status no-kill) #t) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (clear-poi-and-focus! arg0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 16)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-hiding-behind-blocks")) + (none) + ) + :check-too-far 'sig0-gangway-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 11 + :nav-mesh-index 2 + :skip-to #xf + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 sig-course liftcat-speech-index) 0) + (let ((f0-0 (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + (f1-0 98304.0) + ) + (if (>= f0-0 (* f1-0 f1-0)) + (logior! (-> arg0 waypoint-bits) 2) + ) + ) + (play-speech arg0 6) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 20)) + (set! (-> v1-10 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-10) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (when (and (not (logtest? (-> arg1 waypoint-bits) 4)) + (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + ) + (set! (-> arg1 waypoint-bits) (logand -5 (-> arg1 waypoint-bits))) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-14 (-> arg1 actor-group 0 data 7 actor)) + ) + (t9-1 + (if v1-14 + (-> v1-14 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'query) + (let ((t9-2 send-event-function) + (v1-21 (-> arg1 actor-group 0 data 8 actor)) + ) + (case (t9-2 + (if v1-21 + (-> v1-21 extra process) + ) + a1-3 + ) + ((2) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (logior! (-> arg1 waypoint-bits) 1) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer pp)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'beaten) + (let ((t9-3 send-event-function) + (v1-34 (-> arg1 actor-group 0 data 7 actor)) + ) + (t9-3 + (if v1-34 + (-> v1-34 extra process) + ) + a1-4 + ) + ) + ) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'query) + (set! (-> a1-5 param 0) (the-as uint 'beaten)) + (let ((t9-4 send-event-function) + (v1-43 (-> arg1 actor-group 0 data 7 actor)) + ) + (when (and (t9-4 + (if v1-43 + (-> v1-43 extra process) + ) + a1-5 + ) + (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 12 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (cond + ((and (logtest? (-> arg0 waypoint-bits) 2) + (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + ) + (set! (-> arg0 waypoint-bits) (logand -3 (-> arg0 waypoint-bits))) + (let ((f0-0 98304.0)) + (if (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + (play-speech arg0 34) + ) + ) + ) + ((and (logtest? (-> arg0 waypoint-bits) 2) + (let ((f0-3 49152.0)) + (>= (* f0-3 f0-3) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + ) + ) + (set! (-> arg0 waypoint-bits) (logand -3 (-> arg0 waypoint-bits))) + (play-speech arg0 34) + ) + (else + (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + (not (channel-active? arg0 (the-as uint 0))) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer pp)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'query) + (let ((t9-9 send-event-function) + (v1-28 (-> arg0 actor-group 0 data 8 actor)) + ) + (when (and (zero? (t9-9 + (if v1-28 + (-> v1-28 extra process) + ) + a1-7 + ) + ) + (let ((f0-6 98304.0)) + (>= (* f0-6 f0-6) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + ) + ) + (when (and (demo?) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 1)) + (logtest? (-> arg0 waypoint-bits) 16) + ) + (set! (-> arg0 waypoint-bits) (logand -17 (-> arg0 waypoint-bits))) + (talker-spawn-func (-> *talker-speech* 80) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (or (not (logtest? (-> arg0 waypoint-bits) 8)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (if (and (demo?) (zero? (logand (-> arg0 waypoint-bits) 8))) + (logior! (-> arg0 waypoint-bits) 16) + ) + (logior! (-> arg0 waypoint-bits) 8) + (let* ((s5-4 (-> arg0 sig-course)) + (s4-1 (-> s5-4 liftcat-speech-index)) + ) + (play-speech arg0 (-> s5-4 first-liftcat-speeches s4-1)) + (let ((v1-62 (+ s4-1 1))) + (if (>= v1-62 (-> s5-4 first-liftcat-speeches length)) + (set! v1-62 0) + ) + (set! (-> s5-4 liftcat-speech-index) v1-62) + ) + ) + (set! (-> arg0 waypoint-time0) (-> pp clock frame-counter)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far 'sig0-gangway-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 12 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (if (< -86016.0 (- (-> (target-pos 0) z) (-> arg0 sig-course spots 20 center z))) + (play-speech arg0 9) + ) + (let ((a0-3 (-> arg0 actor-group 0 data 10 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-3 + (process->ppointer (-> a0-3 extra process)) + ) + ) + ) + ) + (let ((v1-13 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-13 bytes 5) (the-as uint 2)) + (set! (-> v1-13 bytes 6) (the-as uint 21)) + (set! (-> v1-13 bytes 7) (the-as uint 22)) + (set! (-> v1-13 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-13) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((not (logtest? (-> arg1 waypoint-bits) 1)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 81920.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (logior! (-> arg1 waypoint-bits) 1) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 10) + (set-setting! 'entity-name "camera-68" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 81920.0) + (set! (-> arg1 too-far-fail-dist-delta) 225280.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 2)) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 13 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 2) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 13 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-a" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 9 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 2)) + (set! (-> v1-10 bytes 6) (the-as uint 21)) + (set! (-> v1-10 bytes 7) (the-as uint 22)) + (set! (-> v1-10 bytes 10) (the-as uint 10)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 9 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (let ((s5-0 *target*)) + (if (and s5-0 (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-21 (-> arg1 actor-group 0 data 9 actor)) + ) + (and (t9-2 + (if v1-21 + (-> v1-21 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) + (>= (- (-> s5-0 control trans y) (-> arg1 root-override2 trans y)) -4096.0) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sniper-a" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 14 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer pp)) + (set! (-> a1-8 num-params) 0) + (set! (-> a1-8 message) 'resume) + (let ((t9-10 send-event-function) + (v1-54 (-> arg1 actor-group 0 data 9 actor)) + ) + (t9-10 + (if v1-54 + (-> v1-54 extra process) + ) + a1-8 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 14 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 2)) + (set! (-> v1-1 bytes 6) (the-as uint 21)) + (set! (-> v1-1 bytes 7) (the-as uint 22)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (scene-release? arg1) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set-vector! a1-1 0.0 -16384.0 0.0 1.0) + (quaternion-zxy! (-> arg1 root-override2 quat) a1-1) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-6 (-> arg1 sig-course spots))) + (vector-lerp! s5-0 (the-as vector (-> v1-6 21)) (the-as vector (-> v1-6 22)) 0.5) + ) + (move-to-point! (-> arg1 root-override2) s5-0) + ) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 15 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 15 + :nav-mesh-index 3 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (play-speech arg0 11) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 23)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (when (or (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 11 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-2 + ) + ) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 16 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (b! (not (channel-active? arg0 (the-as uint 0))) cfg-2 :delay (empty-form)) + (set! (-> arg0 waypoint-time0) (-> pp clock frame-counter)) + (b! #t cfg-21 :delay (nop!)) + (label cfg-2) + (b! + (not (and (not (speech-playing? arg0 12)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.75)) + ) + ) + cfg-7 + :delay (empty-form) + ) + (play-speech arg0 12) + (b! #t cfg-21 :delay (nop!)) + (label cfg-7) + (if (and (not (speech-playing? arg0 13)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.5)) + (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'query) + (set! (-> a1-5 param 0) (the-as uint 'beaten)) + (let ((t9-5 send-event-function) + (v1-26 (-> arg0 actor-group 0 data 11 actor)) + ) + (not (t9-5 + (if v1-26 + (-> v1-26 extra process) + ) + a1-5 + ) + ) + ) + ) + ) + (play-speech arg0 13) + ) + (label cfg-21) + (none) + ) + ) + :on-skipping-here (lambda ((arg0 sig-atoll)) + (with-pp + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (clear-poi-and-focus! arg0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-2 send-event-function) + (v1-8 (-> arg0 actor-group 0 data 7 actor)) + ) + (t9-2 + (if v1-8 + (-> v1-8 extra process) + ) + a1-1 + ) + ) + ) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 21)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-down-ramp")) + (none) + ) + ) + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 16 + :nav-mesh-index 3 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 24)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 11 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 17 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (if (and (not (speech-playing? arg0 13)) + (not (channel-active? arg0 (the-as uint 0))) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-11 (-> arg0 actor-group 0 data 11 actor)) + ) + (not (t9-2 + (if v1-11 + (-> v1-11 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + (play-speech arg0 13) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 17 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 waypoint-time0) 0) + (let ((a0-1 (-> arg0 actor-group 0 data 13 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-1 + (process->ppointer (-> a0-1 extra process)) + ) + ) + ) + ) + (play-speech arg0 14) + (let ((v1-9 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-9 bytes 5) (the-as uint 2)) + (set! (-> v1-9 bytes 6) (the-as uint 25)) + (set! (-> v1-9 bytes 7) (the-as uint 26)) + (set! (-> v1-9 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-9) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 73728.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (play-speech arg1 15) + (reset-warn-time! arg1) + (set-setting! 'entity-name "camera-69" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 73728.0) + (set! (-> arg1 too-far-fail-dist-delta) 233472.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 18 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 18 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-b" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 12 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (play-speech arg0 16) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 2)) + (set! (-> v1-12 bytes 6) (the-as uint 25)) + (set! (-> v1-12 bytes 7) (the-as uint 26)) + (set! (-> v1-12 bytes 10) (the-as uint 13)) + (set! (-> (the-as sigt-charge-plasma v1-12) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 12 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (if (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 12 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sniper-b" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 19 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'resume) + (let ((t9-12 send-event-function) + (v1-53 (-> arg1 actor-group 0 data 12 actor)) + ) + (t9-12 + (if v1-53 + (-> v1-53 extra process) + ) + a1-9 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 19 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 2)) + (set! (-> v1-1 bytes 6) (the-as uint 25)) + (set! (-> v1-1 bytes 7) (the-as uint 26)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (remove-setting! 'sound-mode) + (clear-poi-and-focus! arg1) + (reset-warn-time! arg1) + (play-speech arg1 17) + (logior! (-> arg1 waypoint-bits) 1) + ) + (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 20 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 20 + :nav-mesh-index 4 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 27)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 21 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (if (and (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 1.5)) + (not (speech-playing? arg0 18)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 18) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 21 + :nav-mesh-index 5 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 sig-course liftcat-speech-index) 0) + (let ((v1-2 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-2 bytes 5) (the-as uint 1)) + (set! (-> v1-2 bytes 6) (the-as uint 29)) + (set! (-> v1-2 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-2) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'query) + (let* ((t9-0 send-event-function) + (v1-4 (-> arg1 actor-group 0 data 15 actor)) + (v1-6 (t9-0 + (if v1-4 + (-> v1-4 extra process) + ) + a1-1 + ) + ) + ) + (cond + ((zero? v1-6) + (when (not (channel-active? arg1 (the-as uint 0))) + (let ((s5-0 (-> arg1 root-override2 trans)) + (s4-0 (-> arg1 sig-course spots)) + (f0-0 163840.0) + ) + (when (and (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (target-pos 0))) + (let ((f0-3 86016.0)) + (or (>= (* f0-3 f0-3) (vector-vector-xz-distance-squared s5-0 (the-as vector (-> s4-0 28)))) + (let ((f0-6 102400.0)) + (>= (* f0-6 f0-6) (vector-vector-xz-distance-squared s5-0 (the-as vector (-> s4-0 29)))) + ) + ) + ) + ) + (when (or (not (logtest? (-> arg1 waypoint-bits) 2)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg1 waypoint-bits) 2) + (let* ((s5-1 (-> arg1 sig-course)) + (s4-1 (-> s5-1 liftcat-speech-index)) + ) + (play-speech arg1 (-> s5-1 second-liftcat-speeches s4-1)) + (let ((v1-35 (+ s4-1 1))) + (if (>= v1-35 (-> s5-1 second-liftcat-speeches length)) + (set! v1-35 0) + ) + (set! (-> s5-1 liftcat-speech-index) v1-35) + ) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + ) + ) + ) + ) + ) + ((= v1-6 2) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (logior! (-> arg1 waypoint-bits) 1) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer pp)) + (set! (-> a1-8 num-params) 0) + (set! (-> a1-8 message) 'beaten) + (let ((t9-7 send-event-function) + (v1-48 (-> arg1 actor-group 0 data 14 actor)) + ) + (t9-7 + (if v1-48 + (-> v1-48 extra process) + ) + a1-8 + ) + ) + ) + ) + (if (and (not (speech-playing? arg1 20)) (not (channel-active? arg1 (the-as uint 0)))) + (play-speech arg1 20) + ) + (when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer pp)) + (set! (-> a1-13 num-params) 1) + (set! (-> a1-13 message) 'query) + (set! (-> a1-13 param 0) (the-as uint 'beaten)) + (let ((t9-12 send-event-function) + (v1-68 (-> arg1 actor-group 0 data 14 actor)) + ) + (t9-12 + (if v1-68 + (-> v1-68 extra process) + ) + a1-13 + ) + ) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 22 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 22 + :nav-mesh-index #x6 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 waypoint-time0) 0) + (let ((a0-1 (-> arg0 actor-group 0 data 16 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-1 + (process->ppointer (-> a0-1 extra process)) + ) + ) + ) + ) + (if (not (speech-playing? arg0 20)) + (play-speech arg0 20) + ) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 1)) + (set! (-> v1-12 bytes 6) (the-as uint 30)) + (set! (-> v1-12 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-12) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 61440.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 21) + (set-setting! 'entity-name "camera-70" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 61440.0) + (set! (-> arg1 too-far-fail-dist-delta) 245760.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 23 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 23 + :nav-mesh-index #x6 + :skip-to #x1f + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-c" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 17 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 30)) + (set! (-> v1-10 bytes 10) (the-as uint 16)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 17 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (if (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 17 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) + (and (>= (- (-> (target-pos 0) y) (-> arg1 sig-course spots 30 center y)) -8192.0) + (scene-play arg1 "atoll-sniper-c" #f) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 24 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'resume) + (let ((t9-13 send-event-function) + (v1-57 (-> arg1 actor-group 0 data 17 actor)) + ) + (t9-13 + (if v1-57 + (-> v1-57 extra process) + ) + a1-9 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here (lambda ((arg0 sig-atoll)) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (clear-poi-and-focus! arg0) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 30)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-charge-gun-for-sniper-c")) + (none) + ) + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 24 + :nav-mesh-index #x6 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 30)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (scene-release? arg1) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (play-speech arg1 22) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 25 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 25 + :nav-mesh-index #x6 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 36864.0) + (let ((v1-4 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-4 bytes 5) (the-as uint 1)) + (set! (-> v1-4 bytes 6) (the-as uint 31)) + (set! (-> v1-4 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-4) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 26 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) (sig-say-waste-the-suckers-if-should arg0) (none)) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 26 + :nav-mesh-index #x7 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 32)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 27 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) (sig-say-waste-the-suckers-if-should arg0) (none)) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 27 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (let ((v1-4 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-4 bytes 5) (the-as uint 1)) + (set! (-> v1-4 bytes 6) (the-as uint 33)) + (set! (-> v1-4 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-4) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 18 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 28 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) (sig-say-waste-the-suckers-if-should arg0) (none)) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 28 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 waypoint-time0) 0) + (let ((a1-0 (-> arg0 actor-group 0 data 19 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a1-0 + (process->ppointer (-> a1-0 extra process)) + ) + ) + ) + ) + (let ((v1-7 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-7 bytes 5) (the-as uint 1)) + (set! (-> v1-7 bytes 6) (the-as uint 34)) + (set! (-> v1-7 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-7) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 73728.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 23) + (set-setting! 'entity-name "camera-71" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 73728.0) + (set! (-> arg1 too-far-fail-dist-delta) 233472.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.1)) + ) + (remove-setting! 'string-startup-vector) + (logior! (-> arg1 waypoint-bits) 2) + ) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 29 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 2)) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 29 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-d" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 20 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 34)) + (set! (-> v1-10 bytes 10) (the-as uint 19)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 20 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (if (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 20 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sniper-d" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 30 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'resume) + (let ((t9-12 send-event-function) + (v1-53 (-> arg1 actor-group 0 data 20 actor)) + ) + (t9-12 + (if v1-53 + (-> v1-53 extra process) + ) + a1-9 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 30 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 34)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (play-speech arg1 24) + (logior! (-> arg1 waypoint-bits) 1) + ) + (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 31 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 31 + :nav-mesh-index #x9 + :skip-to #x25 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 36864.0) + (let ((v1-6 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-6 bytes 5) (the-as uint 1)) + (set! (-> v1-6 bytes 6) (the-as uint 35)) + (set! (-> v1-6 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-6) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (not (channel-active? arg1 (the-as uint 0))) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 32 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (cond + ((not (logtest? (-> arg0 bot-task-bits) 4)) + (when (and (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.25)) + (< (-> arg0 sig-course spots 36 center x) (-> (target-pos 0) x)) + ) + (logior! (-> arg0 bot-task-bits) 4) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-14 (-> arg0 actor-group 0 data 21 actor)) + ) + (t9-1 + (if v1-14 + (-> v1-14 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (else + (sig0-say-look-out-if-should arg0) + ) + ) + (none) + ) + ) + :on-skipping-here (lambda ((arg0 sig-atoll)) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (clear-poi-and-focus! arg0) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 34)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-cross-water")) + (none) + ) + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 32 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (when (not (logtest? (-> arg0 bot-task-bits) 4)) + (logior! (-> arg0 bot-task-bits) 4) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-14 (-> arg0 actor-group 0 data 21 actor)) + ) + (t9-0 + (if v1-14 + (-> v1-14 extra process) + ) + a1-0 + ) + ) + ) + ) + (let ((v1-18 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-18 bytes 5) (the-as uint 1)) + (set! (-> v1-18 bytes 6) (the-as uint 37)) + (set! (-> v1-18 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-18) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (logtest? (-> arg1 waypoint-bits) 1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 33 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (sig0-say-look-out-if-should arg0) + (when (and (not (logtest? (-> arg0 waypoint-bits) 1)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 16384.0) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 33 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 38)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (cond + ((logtest? (bot-flags bf19) (-> arg1 bot-flags)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 34 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + (else + (if (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (set! (-> arg1 bot-flags) (logior (bot-flags bf20) (-> arg1 bot-flags))) + (logclear! (-> arg1 bot-flags) (bot-flags bf20)) + ) + #f + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 34 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'die-count)) + (let ((t9-0 send-event-function) + (v1-8 (-> arg0 actor-group 0 data 21 actor)) + ) + (set! (-> arg0 waypoint-int32a) (the-as int (t9-0 + (if v1-8 + (-> v1-8 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 1)) + (set! (-> v1-12 bytes 6) (the-as uint 38)) + (set! (-> v1-12 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-12) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (not (logtest? (bot-flags bf19) (-> arg1 bot-flags))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 35 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (cond + ((not (speech-playing? arg0 27)) + (if (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.5)) + (play-speech arg0 27) + ) + ) + ((not (logtest? (-> arg0 waypoint-bits) 1)) + (when (speech-ended? arg0 27) + (logior! (-> arg0 waypoint-bits) 1) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (set! (-> arg0 waypoint-time0) (-> pp clock frame-counter)) + ) + ) + ((not (logtest? (-> arg0 waypoint-bits) 2)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'die-count)) + (let ((t9-3 send-event-function) + (v1-26 (-> arg0 actor-group 0 data 21 actor)) + ) + (cond + ((or (>= (- (the-as int (t9-3 + (if v1-26 + (-> v1-26 extra process) + ) + a1-3 + ) + ) + (the-as uint (-> arg0 waypoint-int32a)) + ) + 5 + ) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 10)) + ) + (set! (-> arg0 bot-flags) (logior (bot-flags bf21) (-> arg0 bot-flags))) + (logior! (-> arg0 waypoint-bits) 2) + ) + (else + (if (and (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 4)) + (not (speech-playing? arg0 28)) + ) + (play-speech arg0 28) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 35 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (play-speech arg0 29) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-8 (-> arg0 actor-group 0 data 21 actor)) + ) + (t9-1 + (if v1-8 + (-> v1-8 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 1)) + (set! (-> v1-12 bytes 6) (the-as uint 37)) + (set! (-> v1-12 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-12) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 21 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (clear-poi-and-focus! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 36 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 36 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 39)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (not (channel-active? arg1 (the-as uint 0))) + ) + (let ((f0-0 122880.0)) + (if (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (play-speech arg1 30) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 37 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 37 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (set! (-> arg0 waypoint-time0) 0) + (let ((a0-1 (-> arg0 actor-group 0 data 22 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-1 + (process->ppointer (-> a0-1 extra process)) + ) + ) + ) + ) + (reset-warn-time! arg0) + (let ((v1-11 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-11 bytes 5) (the-as uint 1)) + (set! (-> v1-11 bytes 6) (the-as uint 40)) + (set! (-> v1-11 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-11) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-0 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 61440.0) + ) + (cond + ((and (< f0-0 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 31) + (set-setting! 'entity-name "camera-72" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 61440.0) + (set! (-> arg1 too-far-fail-dist-delta) 430080.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.1)) + ) + (remove-setting! 'string-startup-vector) + (logior! (-> arg1 waypoint-bits) 2) + ) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 38 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here (lambda ((arg0 sig-atoll)) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (clear-poi-and-focus! arg0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 38)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-show-sniper-e")) + (none) + ) + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 38 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-e" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 23 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 40)) + (set! (-> v1-10 bytes 10) (the-as uint 22)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 23 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (when (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 23 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + (if (and (not (speech-playing? arg1 32)) + (and (>= (-> arg1 plasma level) 1.0) (-> arg1 next-state) (= (-> arg1 next-state name) 'charge-plasma)) + ) + (play-speech arg1 32) + ) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) + (not (channel-active? arg1 (the-as uint 0))) + (scene-play arg1 "atoll-sniper-e" #f) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 39 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer pp)) + (set! (-> a1-12 num-params) 0) + (set! (-> a1-12 message) 'resume) + (let ((t9-15 send-event-function) + (v1-66 (-> arg1 actor-group 0 data 23 actor)) + ) + (t9-15 + (if v1-66 + (-> v1-66 extra process) + ) + a1-12 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 39 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 40)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (scene-release? arg1) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 40 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 40 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (task-node-close! (game-task-node atoll-sig-resolution)) + (process-entity-status! arg0 (entity-perm-status bit-4) #f) + (logclear! (-> arg0 enemy-flags) (enemy-flag use-notice-distance)) + (logclear! (-> arg0 bot-flags) (bot-flags bf06)) + (bot-method-196 arg0) + (set! (-> arg0 bot-flags) (logior (bot-flags bf22) (-> arg0 bot-flags))) + (if (demo?) + (send-event *target* 'continue (get-continue-by-name *game-info* "demo-restart")) + ) + (let ((v1-16 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-16 bytes 5) (the-as uint 1)) + (set! (-> v1-16 bytes 6) (the-as uint 41)) + (set! (-> v1-16 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-16) check-done) + (the-as (function sigt-wait-spot sig symbol) (lambda () #f)) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + ) + :speeches (new 'static 'inline-array bot-speech-info 52 + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt003") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt004") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt005") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt006") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt007") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt008") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt020") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt009") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt010") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt011") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt012") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt013") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt014") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt058") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt015") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt021") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt022") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt023") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt024") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt057") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt059") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt025") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt026") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt027") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt028") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt019") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt029") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt030") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt031") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt032") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt039") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt033") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt038") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt036") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt037") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt043") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt044") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt045") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt049") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt046") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt047") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt056") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt082") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt054") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt052") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt053") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt083") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt087") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt089") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt090") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt091") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt092") + ) + :speech-tunings (new 'static 'inline-array bot-speech-tuning 1 + (new 'static 'bot-speech-tuning :fo-min 30 :fo-max #x78 :fo-curve #xb :trans? #t) + ) + :spots (new 'static 'inline-array bot-spot 42 + (new 'static 'bot-spot :center (new 'static 'vector :x 2341970.0 :y 4915.2 :z -3590061.8 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2294497.2 :y 5529.6 :z -3631104.0 :w 49152.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2222940.2 :y 4505.6 :z -3746652.2 :w 28672.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2244567.0 :y 4259.84 :z -3795067.0 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2217410.5 :y 5160.96 :z -3782819.8 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2192261.0 :y 4915.2 :z -3784007.8 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2160926.8 :y 5283.84 :z -3787817.0 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2227036.2 :y 62382.08 :z -3838361.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2204221.5 :y 62382.08 :z -3836395.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2196521.0 :y 62382.08 :z -3837337.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2174771.2 :y 62382.08 :z -3838484.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 2190704.8 :y 62382.08 :z -3870187.5 :w 16384.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2216222.8 :y 62382.08 :z -3853189.0 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2216059.0 :y 62382.08 :z -3863265.2 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2215854.0 :y 62382.08 :z -3873341.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 2239406.0 :y 62382.08 :z -3848929.2 :w 12288.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1997209.6 :y 53739.52 :z -3898613.8 :w 4096.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1988894.8 :y 53739.52 :z -3888701.5 :w 4096.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 2043289.6 :y 53739.52 :z -3884318.8 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1721098.2 :y 53739.52 :z -3884318.8 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1742438.4 :y 53821.44 :z -3885301.8 :w 16384.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1734860.8 :y 53698.56 :z -4004085.8 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1731543.0 :y 53698.56 :z -4017602.5 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 1492582.4 :y 3850.24 :z -3921797.0 :w 73728.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1431347.2 :y 7127.04 :z -4036894.8 :w 16384.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1407754.2 :y 6184.96 :z -4143308.8 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1407426.5 :y 5980.16 :z -4121272.2 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 1414840.4 :y 53698.56 :z -4339835.0 :w 47104.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1394319.4 :y 53698.56 :z -4419051.5 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1453342.8 :y 53575.68 :z -4515963.0 :w 12288.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1591091.2 :y 53698.56 :z -4761313.5 :w 12288.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1732485.1 :y 53493.76 :z -4682547.0 :w 11264.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1879244.8 :y 4628.48 :z -4555899.0 :w 14336.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1847214.1 :y 8028.16 :z -4351385.5 :w 24576.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1859297.2 :y 7536.64 :z -4371702.0 :w 10240.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2036899.9 :y 4956.16 :z -4314726.5 :w 32768.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2024038.4 :y 5201.92 :z -4323574.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2155069.5 :y 4915.2 :z -4291543.0 :w 24576.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2155069.5 :y 4915.2 :z -4291543.0 :w 10240.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2272133.0 :y 5734.4 :z -4268851.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2389196.8 :y 6553.6 :z -4246282.0 :w 12288.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2389196.8 :y 6553.6 :z -4246282.0 :w 26624.0)) + ) + :first-liftcat-speeches (new 'static 'boxed-array :type int16 7 8 19) + :second-liftcat-speeches (new 'static 'boxed-array :type int16 19 8 7) + ) + ) + +(set! (-> *bot-course-table* course 0) *sig0-course*) diff --git a/goal_src/jak2/levels/common/ai/ai-task-h.gc b/goal_src/jak2/levels/common/ai/ai-task-h.gc index e932b8014e..6edd55ca08 100644 --- a/goal_src/jak2/levels/common/ai/ai-task-h.gc +++ b/goal_src/jak2/levels/common/ai/ai-task-h.gc @@ -5,22 +5,261 @@ ;; name in dgo: ai-task-h ;; dgos: ATE, SEB, SWB, LKIDDOGE, UNB, CTYKORA, CTYASHA +(declare-type ai-task-pool basic) +(declare-type bot nav-enemy) + ;; DECOMP BEGINS (deftype ai-task (basic) - ((next basic :offset-assert 4) - (prev basic :offset-assert 8) - (pool basic :offset-assert 12) - (unique-id uint32 :offset-assert 16) - (pad-ik1n231 uint32 3 :offset-assert 20) - (bytes int8 16 :offset-assert 32) + ((next ai-task :offset-assert 4) + (prev ai-task :offset-assert 8) + (pool ai-task-pool :offset-assert 12) + (unique-id uint32 :offset-assert 16) + (bytes uint8 16 :offset 32) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (ai-task-method-9 () none 9) - (ai-task-method-10 () none 10) - (ai-task-method-11 () none 11) + (reset-task! (_type_) none 9) + (ai-task-method-10 (_type_ bot) none 10) + (ai-task-method-11 (_type_ bot) none 11) ) ) + + +(deftype ai-task-pool (basic) + ((anchor ai-task :offset-assert 4) + (tasks (pointer uint32) :offset-assert 8) + (tasks-length uint32 :offset-assert 12) + (unique-id uint32 :offset-assert 16) + ) + :method-count-assert 12 + :size-assert #x14 + :flag-assert #xc00000014 + (:methods + (assign-ids! (_type_ type) ai-task 9) + (set-next-task! (_type_ ai-task) none 10) + (ai-task-pool-method-11 (_type_) ai-task 11) + ) + ) + + +(deftype ai-task-control (basic) + ((anchor ai-task :offset-assert 4) + (pool ai-task-pool :offset-assert 8) + ) + :method-count-assert 18 + :size-assert #xc + :flag-assert #x120000000c + (:methods + (new (symbol type ai-task-pool) _type_ 0) + (ai-task-control-method-9 (_type_) none 9) + (ai-task-control-method-10 (_type_ bot) none 10) + (get-task-by-type (_type_ type bot) ai-task 11) + (ai-task-control-method-12 (_type_ bot) symbol 12) + (ai-task-control-method-13 (_type_ ai-task bot) ai-task 13) + (ai-task-control-method-14 (_type_ ai-task bot) none 14) + (init-task! (_type_ type bot) ai-task 15) + (set-next-task-for-pool! (_type_ ai-task) none 16) + (set-next-task! (_type_ ai-task) none 17) + ) + ) + + +(defmethod ai-task-method-11 ai-task ((obj ai-task) (arg0 bot)) + "Virtual" + 0 + (none) + ) + +(defmethod ai-task-method-10 ai-task ((obj ai-task) (arg0 bot)) + "Virtual" + 0 + (none) + ) + +(defmethod reset-task! ai-task ((obj ai-task)) + "Virtual" + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer uint32) vs ai-task. +(defmethod ai-task-pool-method-11 ai-task-pool ((obj ai-task-pool)) + (set! (-> obj unique-id) (the-as uint 0)) + (let ((t0-0 (the-as (pointer uint32) #f)) + (a1-0 (the-as (pointer uint32) #f)) + (v1-0 (-> obj tasks)) + ) + (let ((a2-0 (-> obj tasks-length))) + (dotimes (a3-0 (the-as int a2-0)) + (set! a1-0 (&+ v1-0 (* 48 a3-0))) + (set! (-> a1-0 2) (the-as uint obj)) + (set! (-> a1-0 3) (the-as uint 0)) + (set! (-> a1-0 1) (the-as uint t0-0)) + (if t0-0 + (set! (-> t0-0 0) (the-as uint a1-0)) + ) + (set! t0-0 a1-0) + ) + ) + (set! (-> a1-0 0) (the-as uint #f)) + (let ((v0-0 (&-> v1-0 0))) + (set! (-> obj anchor) (the-as ai-task v0-0)) + (the-as ai-task v0-0) + ) + ) + ) + +(defmethod assign-ids! ai-task-pool ((obj ai-task-pool) (arg0 type)) + "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" + (let ((v1-1 (-> obj anchor next))) + (when v1-1 + (let ((a2-0 (-> v1-1 prev)) + (a3-0 (-> v1-1 next)) + ) + (set! (-> v1-1 prev) #f) + (set! (-> v1-1 next) #f) + (let ((t0-1 (the-as int (+ (-> obj unique-id) 1)))) + (if (zero? (the-as uint t0-1)) + (set! t0-1 1) + ) + (set! (-> obj unique-id) (the-as uint t0-1)) + (set! (-> v1-1 unique-id) (the-as uint t0-1)) + ) + (set! (-> a2-0 next) a3-0) + (if a3-0 + (set! (-> a3-0 prev) a2-0) + ) + ) + (set! (-> v1-1 type) arg0) + v1-1 + ) + ) + ) + +;; WARN: Return type mismatch ai-task vs none. +(defmethod set-next-task! ai-task-pool ((obj ai-task-pool) (arg0 ai-task)) + "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." + (let* ((v1-0 (-> obj anchor)) + (v0-0 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) v0-0) + ) + (none) + ) + +(defmethod new ai-task-control ((allocation symbol) (type-to-make type) (arg0 ai-task-pool)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 pool) arg0) + (set! (-> s5-0 anchor) (assign-ids! arg0 ai-task)) + s5-0 + ) + ) + +(defmethod ai-task-control-method-12 ai-task-control ((obj ai-task-control) (arg0 bot)) + (let ((gp-0 (-> obj anchor))) + (let ((s3-0 (-> obj anchor next))) + (while s3-0 + (let ((s4-0 (-> s3-0 next))) + (if arg0 + (ai-task-method-10 s3-0 arg0) + ) + (set-next-task! (-> s3-0 pool) s3-0) + (set! s3-0 s4-0) + ) + ) + ) + (set! (-> gp-0 prev) #f) + (set! (-> gp-0 next) #f) + ) + #f + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod ai-task-control-method-9 ai-task-control ((obj ai-task-control)) + (ai-task-control-method-12 obj (the-as bot #f)) + (let ((a1-1 (-> obj anchor))) + (when a1-1 + (set-next-task! (-> a1-1 pool) a1-1) + (set! (-> obj anchor) #f) + ) + ) + (none) + ) + +(defmethod init-task! ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) + "Initialize a task of the given type in the [[ai-task-control]]'s pool." + (let ((s5-0 (assign-ids! (-> obj pool) arg0))) + (if s5-0 + (reset-task! s5-0) + ) + s5-0 + ) + ) + +;; WARN: Return type mismatch ai-task vs none. +(defmethod set-next-task! ai-task-control ((obj ai-task-control) (arg0 ai-task)) + "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." + (let* ((v1-0 (-> obj anchor)) + (a0-1 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) a0-1) + ) + (none) + ) + +(defmethod set-next-task-for-pool! ai-task-control ((obj ai-task-control) (arg0 ai-task)) + (set-next-task! (-> obj pool) arg0) + (none) + ) + +(defmethod get-task-by-type ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (init-task! obj arg0 arg1))) + (if s5-0 + (set-next-task! obj s5-0) + ) + s5-0 + ) + ) + +(defmethod ai-task-control-method-13 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((gp-0 (-> arg0 prev)) + (s5-0 (-> arg0 next)) + ) + (if arg1 + (ai-task-method-10 arg0 arg1) + ) + (set-next-task! (-> obj pool) arg0) + (if gp-0 + (set! (-> gp-0 next) s5-0) + ) + (if s5-0 + (set! (-> s5-0 prev) gp-0) + ) + s5-0 + ) + ) + +(defmethod ai-task-control-method-10 ai-task-control ((obj ai-task-control) (arg0 bot)) + (let ((a0-1 (-> obj anchor next))) + (if a0-1 + (ai-task-method-11 a0-1 arg0) + ) + ) + (none) + ) + +(defmethod ai-task-control-method-14 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((a0-1 (ai-task-control-method-13 obj arg0 arg1))) + (if a0-1 + (ai-task-method-11 a0-1 arg1) + ) + ) + (none) + ) diff --git a/goal_src/jak2/levels/common/ai/bot-h.gc b/goal_src/jak2/levels/common/ai/bot-h.gc index 4b3db255a1..fde7bea248 100644 --- a/goal_src/jak2/levels/common/ai/bot-h.gc +++ b/goal_src/jak2/levels/common/ai/bot-h.gc @@ -5,165 +5,709 @@ ;; name in dgo: bot-h ;; dgos: ATE, SEB, SWB, LKIDDOGE, UNB, CTYKORA, CTYASHA +;; +++bot-h:speech-flags +(defenum speech-flags + :type uint16 + :bitfield #t + (playing) + (sf01) + (sf02) + (sf03) + (sf04) + (sf05) + (sf06) + (sf08) + (sf09) + (sf10) + (sf11) + (sf12) + (sf13) + (sf14) + (sf15) + ) +;; ---bot-h:speech-flags + +;; +++bot-h:bot-flags +(defenum bot-flags + :type uint32 + :bitfield #t + (bf00 0) + (failed 1) + (bf02 2) + (bf03 3) + (bf04 4) + (bf05 5) + (bf06 6) + (attacked 7) + (too-far-fail 8) ;; not sure + (bf09 9) + (bf10 10) + (bf11 11) + (bf12 12) + (bf13 13) + (bf14 14) + (bf15 15) + (bf16 16) + (bf17 17) + (bf18 18) + (bf19 19) + (bf20 20) + (bf21 21) + (bf22 22) + (bf23 23) + (bf24 24) + (bf25 25) + (bf26 26) + (bf27 27) + (bf28 28) + (bf29 29) + (bf30 30) + (bf31 31) + ) +;; ---bot-h:bot-flags + +(declare-type bot nav-enemy) +(declare-type bot-speech-list basic) +(declare-type bot-speech-list-shuffle bot-speech-list) + ;; DECOMP BEGINS (deftype bot-focus-info (structure) - ((max-los-dist float :offset-assert 0) - (fproc basic :offset-assert 4) - (bullseye-xz-dist float :offset-assert 8) - (ry-diff float :offset-assert 12) - (my-facing-ry float :offset-assert 16) - (bullseye-ry float :offset-assert 20) - (los int8 :offset-assert 24) - (update-time time-frame :offset-assert 32) - (bullseye vector :inline :offset-assert 48) - (pos vector :inline :offset-assert 64) - (my-facing-xz-dir vector :inline :offset-assert 80) - (bullseye-xz-dir vector :inline :offset-assert 96) + ((max-los-dist float :offset-assert 0) + (fproc process-focusable :offset-assert 4) + (bullseye-xz-dist float :offset-assert 8) + (ry-diff float :offset-assert 12) + (my-facing-ry float :offset-assert 16) + (bullseye-ry float :offset-assert 20) + (los int8 :offset-assert 24) + (update-time time-frame :offset-assert 32) + (bullseye vector :inline :offset-assert 48) + (pos vector :inline :offset-assert 64) + (my-facing-xz-dir vector :inline :offset-assert 80) + (bullseye-xz-dir vector :inline :offset-assert 96) ) :method-count-assert 9 :size-assert #x70 :flag-assert #x900000070 ) + +(deftype bot-turn-info (structure) + ((facing-ry float :offset-assert 0) + (targ-ry float :offset-assert 4) + (ry-diff float :offset-assert 8) + (predicted-ry-diff float :offset-assert 12) + (predicted-targ-ry float :offset-assert 16) + (facing-dir vector :inline :offset-assert 32) + (targ-pos vector :inline :offset-assert 48) + (predicted-targ-pos vector :inline :offset-assert 64) + (src-quat quaternion :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + + +(deftype bot-speech-tuning (structure) + ((fo-min int32 :offset-assert 0) + (fo-max int32 :offset-assert 4) + (fo-curve int8 :offset-assert 8) + (trans? symbol :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(deftype bot-speech-info (structure) + ((flags speech-flags :offset-assert 0) + (hold-time uint16 :offset-assert 2) + (slave-id int8 :offset-assert 4) + (tuning-id int8 :offset-assert 5) + (name string :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + (deftype bot-spot (structure) - ((center vector :inline :offset-assert 0) - (center-x float :offset 0) - (center-y float :offset 4) - (center-z float :offset 8) - (inside-xz-dist float :offset 12) - (blocked-xz-dist float :offset-assert 16) + ((center vector :inline :offset-assert 0) + (center-x float :offset 0) + (center-y float :offset 4) + (center-z float :offset 8) + (inside-xz-dist float :offset 12) + (blocked-xz-dist float :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) + +(deftype bot-waypoint (basic) + ((waypoint-id int16 :offset-assert 4) + (nav-mesh-index int8 :offset-assert 6) + (skip-to int8 :offset-assert 7) + (on-set (function bot none) :offset-assert 8) + (on-update (function bot none) :offset-assert 12) + (on-skipping-here (function bot none) :offset-assert 16) + (check-too-far symbol :offset-assert 20) + (warn-dist float :offset-assert 24) + (fail-dist-delta float :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + (deftype bot-course (basic) - ((course-id uint8 :offset-assert 4) - (speech-count uint16 :offset-assert 6) - (spot-count uint16 :offset-assert 8) - (retry-cookie uint8 :offset-assert 10) - (too-far-warn-speeches basic :offset-assert 12) - (too-far-fail-speeches basic :offset-assert 16) - (attack-player-speeches basic :offset-assert 20) - (default-check-too-far basic :offset-assert 24) - (waypoints basic :offset-assert 28) - (speeches uint32 :offset-assert 32) - (speech-tunings uint32 :offset-assert 36) - (dirs uint32 :offset-assert 40) - (spots uint32 :offset-assert 44) + ((course-id uint8 :offset-assert 4) + (speech-count uint16 :offset-assert 6) + (spot-count uint16 :offset-assert 8) + (retry-cookie uint8 :offset-assert 10) + (too-far-warn-speeches bot-speech-list-shuffle :offset-assert 12) + (too-far-fail-speeches bot-speech-list-shuffle :offset-assert 16) + (attack-player-speeches bot-speech-list :offset-assert 20) + (default-check-too-far symbol :offset-assert 24) + (waypoints (array bot-waypoint) :offset-assert 28) + (speeches (inline-array bot-speech-info) :offset-assert 32) + (speech-tunings (inline-array bot-speech-tuning) :offset-assert 36) + (dirs (inline-array vector) :offset-assert 40) + (spots (inline-array bot-spot) :offset-assert 44) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 - ;; field default-check-too-far uses ~A with a signed load ) + (deftype bot (nav-enemy) - ((bot-flags uint32 :offset-assert 604) - (min-speed float :offset-assert 608) - (max-speed float :offset-assert 612) - (follow-offset float :offset-assert 616) - (too-far-warn-dist float :offset-assert 620) - (too-far-fail-dist-delta float :offset-assert 624) - (too-far-warn-dist-default float :offset-assert 628) - (too-far-fail-dist-delta-default float :offset-assert 632) - (travel-prev-ry float :offset-assert 636) - (travel-prev-ry1 float :offset-assert 640) - (player-blocking float :offset-assert 644) - (ai-ctrl basic :offset-assert 648) - (course basic :offset-assert 652) - (waypoint basic :offset-assert 656) - (waypoint-bits uint32 :offset-assert 660) - (waypoint-int32a int32 :offset-assert 664) - (bot-task-bits uint32 :offset-assert 668) - (hit-invuln-ignore-me-delay uint32 :offset-assert 672) - (hit-invuln-focus-disable-delay uint32 :offset-assert 676) - (warn-to-fail-timeout uint32 :offset-assert 680) - (warn-min-delay uint32 :offset-assert 684) - (warn-max-delay uint32 :offset-assert 688) - (spot-color uint32 :offset-assert 692) - (waypoint-request int16 :offset-assert 696) - (hit-by-enemy-count uint16 :offset-assert 698) - (hit-by-player-count uint16 :offset-assert 700) - (notice-enemy-dist float :offset-assert 704) - (channel uint8 :offset-assert 708) - (focus-mode int8 :offset-assert 709) - (nav-mesh-index int8 :offset-assert 710) - (delay-too-far-check int8 :offset-assert 711) - (slave-id int8 :offset-assert 712) - (vehicle-seat-index int8 :offset-assert 713) - (bot-health-index int8 :offset-assert 714) - (task basic :offset-assert 716) - (swivel-joint-mod basic :offset-assert 720) - (health-handle uint64 :offset-assert 728) - (poi-handle uint64 :offset-assert 736) - (my-simple-focus uint32 :offset-assert 744) - (attacker-handle uint64 :offset-assert 752) - (scene-player-handle uint64 :offset-assert 760) - (master-handle uint64 :offset-assert 768) - (vehicle-handle uint64 :offset-assert 776) - (hit-invuln-starting-time time-frame :offset-assert 784) - (danger-time time-frame :offset-assert 792) - (attacker-time time-frame :offset-assert 800) - (started-warning-time time-frame :offset-assert 808) - (waypoint-time0 uint64 :offset-assert 816) - (next-too-far-warn-time time-frame :offset-assert 824) - (spot bot-spot :inline :offset-assert 832) - (follow-dir vector :inline :offset-assert 864) - (focus-info bot-focus-info :inline :offset-assert 880) + ((bot-flags bot-flags :offset-assert 604) + (min-speed float :offset-assert 608) + (max-speed float :offset-assert 612) + (follow-offset float :offset-assert 616) + (too-far-warn-dist float :offset-assert 620) + (too-far-fail-dist-delta float :offset-assert 624) + (too-far-warn-dist-default float :offset-assert 628) + (too-far-fail-dist-delta-default float :offset-assert 632) + (travel-prev-ry float :offset-assert 636) + (travel-prev-ry1 float :offset-assert 640) + (player-blocking float :offset-assert 644) + (ai-ctrl ai-task-control :offset-assert 648) + (course bot-course :offset-assert 652) + (waypoint bot-waypoint :offset-assert 656) + (waypoint-bits uint32 :offset-assert 660) + (waypoint-int32a int32 :offset-assert 664) + (bot-task-bits uint32 :offset-assert 668) + (hit-invuln-ignore-me-delay uint32 :offset-assert 672) + (hit-invuln-focus-disable-delay uint32 :offset-assert 676) + (warn-to-fail-timeout uint32 :offset-assert 680) + (warn-min-delay uint32 :offset-assert 684) + (warn-max-delay uint32 :offset-assert 688) + (spot-color uint32 :offset-assert 692) + (waypoint-request int16 :offset-assert 696) + (hit-by-enemy-count uint16 :offset-assert 698) + (hit-by-player-count uint16 :offset-assert 700) + (notice-enemy-dist float :offset-assert 704) + (channel uint8 :offset-assert 708) + (focus-mode int8 :offset-assert 709) + (nav-mesh-index int8 :offset-assert 710) + (delay-too-far-check int8 :offset-assert 711) + (slave-id int8 :offset-assert 712) + (vehicle-seat-index int8 :offset-assert 713) + (bot-health-index int8 :offset-assert 714) + (task game-task-control :offset-assert 716) + (swivel-joint-mod joint-mod :offset-assert 720) + (health-handle handle :offset-assert 728) + (poi-handle handle :offset-assert 736) + (my-simple-focus (pointer simple-focus) :offset-assert 744) + (attacker-handle handle :offset-assert 752) + (scene-player-handle handle :offset-assert 760) + (master-handle handle :offset-assert 768) + (vehicle-handle handle :offset-assert 776) + (hit-invuln-starting-time time-frame :offset-assert 784) + (danger-time time-frame :offset-assert 792) + (attacker-time time-frame :offset-assert 800) + (started-warning-time time-frame :offset-assert 808) + (waypoint-time0 time-frame :offset-assert 816) + (next-too-far-warn-time time-frame :offset-assert 824) + (spot bot-spot :inline :offset-assert 832) + (follow-dir vector :inline :offset-assert 864) + (focus-info bot-focus-info :inline :offset-assert 880) ) + :heap-base #x360 :method-count-assert 225 :size-assert #x3e0 :flag-assert #xe1036003e0 (:methods - (bot-method-178 () none 178) - (bot-method-179 () none 179) - (bot-method-180 () none 180) - (bot-method-181 () none 181) - (bot-method-182 () none 182) - (bot-method-183 () none 183) - (bot-method-184 () none 184) - (bot-method-185 () none 185) - (bot-method-186 () none 186) - (bot-method-187 () none 187) - (bot-method-188 () none 188) - (bot-method-189 () none 189) - (bot-method-190 () none 190) - (bot-method-191 () none 191) - (bot-method-192 () none 192) - (bot-method-193 () none 193) - (bot-method-194 () none 194) - (bot-method-195 () none 195) - (bot-method-196 () none 196) - (bot-method-197 () none 197) - (bot-method-198 () none 198) - (bot-method-199 () none 199) - (bot-method-200 () none 200) - (bot-method-201 () none 201) - (bot-method-202 () none 202) - (bot-method-203 () none 203) - (bot-method-204 () none 204) - (bot-method-205 () none 205) - (bot-method-206 () none 206) - (bot-method-207 () none 207) - (bot-method-208 () none 208) - (bot-method-209 () none 209) - (bot-method-210 () none 210) - (bot-method-211 () none 211) - (bot-method-212 () none 212) - (bot-method-213 () none 213) - (bot-method-214 () none 214) - (bot-method-215 () none 215) - (bot-method-216 () none 216) - (bot-method-217 () none 217) - (bot-method-218 () none 218) - (bot-method-219 () none 219) - (bot-method-220 () none 220) - (bot-method-221 () none 221) - (bot-method-222 () none 222) - (bot-method-223 () none 223) - (bot-method-224 () none 224) + (failed () _type_ :state 178) + (hidden () _type_ :state 179) + (clear-poi-and-focus! (_type_) none 180) + (bot-method-181 (_type_ vector vector vector vector vector float) none 181) + (turn-to-target (_type_ bot-turn-info process-focusable float) none 182) + (alive? (_type_) symbol 183) + (bot-debug-draw-spot-id (_type_) none 184) + (bot-debug-draw-sphere (_type_ vector rgba) none 185) + (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none 186) + (reset-attacker! (_type_) none 187) + (scene-release? (_type_) symbol 188) + (select-focus! (_type_) process 189) + (bot-method-190 (_type_) symbol 190) + (bot-method-191 (_type_) none 191) + (bot-method-192 (_type_) none 192) + (bot-method-193 (_type_) symbol 193) + (outside-spot-radius? (_type_ bot-spot vector symbol) symbol 194) + (attacked-by-player? (_type_ process-focusable) symbol 195) + (bot-method-196 (_type_) none 196) + (fail-mission! (_type_) none 197) + (set-cam-height! (_type_ vector) meters 198) + (cam-move-to-bot (_type_) none 199) + (fail-falling (_type_) none 200) + (set-next-focus! (_type_ enemy enemy-best-focus) none 201) + (choose-spot (_type_ int (pointer uint)) int 202) + (play-attacked-speech (_type_) none 203) + (play-too-far-warn-speech (_type_) symbol 204) + (scene-play (_type_ string symbol) symbol 205) + (play-speech (_type_ int) none 206) + (play-death-sound (_type_ string) none 207) + (bot-method-208 (_type_) symbol 208) + (channel-active? (_type_ uint) symbol 209) + (init! (_type_) none 210) + (clear-speech-flags! (_type_) none 211) + (reset-warn-time! (_type_) none 212) + (go-to-waypoint! (_type_ int symbol) object 213) + (bot-method-214 (_type_) symbol 214) + (skip-waypoint (_type_) none 215) + (bot-method-216 (_type_) none 216) + (speech-ended? (_type_ int) symbol 217) + (speech-playing? (_type_ int) symbol 218) + (player-blocking-spot? (_type_ bot-spot) symbol 219) + (stop-speech (_type_ uint symbol) none 220) + (bot-method-221 (_type_) quaternion 221) + (bot-method-222 (_type_ vector) none 222) + (bot-method-223 (_type_ symbol) none 223) + (bot-check-too-far (_type_) symbol 224) ) ) + + +(define *bot-task-pool* (new 'static 'ai-task-pool + :anchor #f + :tasks (new 'static 'array uint32 240 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + ) + :tasks-length #x14 + ) + ) + +(ai-task-pool-method-11 *bot-task-pool*) + +(deftype bot-speech-list (basic) + ((flags uint8 :offset-assert 4) + (retry-cookie uint8 :offset-assert 5) + (last-local-index int16 :offset-assert 6) + (speech-indexes (array int16) :offset-assert 8) + ) + :method-count-assert 11 + :size-assert #xc + :flag-assert #xb0000000c + (:methods + (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int 9) + (reset-index (_type_ symbol) none 10) + ) + ) + + +(defmethod reset-index bot-speech-list ((obj bot-speech-list) (arg0 symbol)) + (if arg0 + (set! (-> obj flags) (logand -2 (-> obj flags))) + ) + (set! (-> obj last-local-index) -1) + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod bot-speech-list-method-9 bot-speech-list ((sp-list bot-speech-list) (bot bot) (sp-info (inline-array bot-speech-info)) (arg3 speech-flags)) + (let ((v1-1 (-> bot course retry-cookie))) + (when (!= v1-1 (-> sp-list retry-cookie)) + (set! (-> sp-list retry-cookie) (-> bot course retry-cookie)) + (reset-index sp-list #t) + ) + ) + (let ((sp-indexes (-> sp-list speech-indexes)) + (last-idx (-> sp-list last-local-index)) + ) + (when (< last-idx 0) + (when (not (logtest? (-> sp-list flags) 1)) + (logior! (-> sp-list flags) 1) + (set! arg3 (logior arg3 (speech-flags sf02))) + ) + (reset-index sp-list #f) + (if (logtest? (-> sp-list flags) 4) + (set! last-idx (+ (get-rand-int bot (-> sp-indexes length)) -1)) + (set! last-idx -1) + ) + ) + (until #f + (when (>= last-idx (+ (-> sp-indexes length) -1)) + (if (not (logtest? (-> sp-list flags) 2)) + (goto cfg-23) + ) + (reset-index sp-list #f) + (set! last-idx -1) + ) + (+! last-idx 1) + (let* ((idx (-> sp-indexes last-idx)) + (flags (-> sp-info idx flags)) + ) + (when (and (not (logtest? arg3 flags)) + (or (not (logtest? flags (speech-flags sf11))) (not (speech-playing? bot idx))) + ) + (set! (-> sp-list last-local-index) last-idx) + (return idx) + ) + ) + ) + ) + #f + (label cfg-23) + -1 + ) + +(deftype bot-speech-list-shuffle (bot-speech-list) + ((history-mask uint64 :offset-assert 16) + (history-mask-full uint64 :offset-assert 24) + ) + :method-count-assert 11 + :size-assert #x20 + :flag-assert #xb00000020 + ) + + +(defmethod reset-index bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (arg0 symbol)) + (let ((t9-0 (method-of-type bot-speech-list reset-index))) + (t9-0 obj arg0) + ) + (set! (-> obj history-mask) (the-as uint 0)) + (when (zero? (-> obj history-mask-full)) + (let ((v0-2 0)) + (let ((v1-2 1)) + (countdown (a0-3 (-> obj speech-indexes length)) + (set! v0-2 (logior v0-2 v1-2)) + (set! v1-2 (* v1-2 2)) + ) + ) + (set! (-> obj history-mask-full) (the-as uint v0-2)) + ) + ) + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) + (local-vars (sv-16 int)) + (let ((course-cookie (-> bot course retry-cookie))) + (when (!= course-cookie (-> obj retry-cookie)) + (set! (-> obj retry-cookie) (-> bot course retry-cookie)) + (reset-index obj #t) + ) + ) + (set! sv-16 (-> obj last-local-index)) + (when (< sv-16 0) + (when (not (logtest? (-> obj flags) 1)) + (logior! (-> obj flags) 1) + (set! sp-flags (logior sp-flags (speech-flags sf02))) + ) + (reset-index obj #f) + ) + (let ((history-mask 0)) + (if (>= sv-16 0) + (set! history-mask (ash 1 sv-16)) + ) + (if (logtest? (-> obj flags) 8) + (set! history-mask (logior history-mask (-> obj history-mask))) + ) + (until #f + (when (and (= history-mask (-> obj history-mask-full)) (logtest? (-> obj flags) 8)) + (if (not (logtest? (-> obj flags) 2)) + (return -1) + ) + (reset-index obj #f) + (if (>= sv-16 0) + (set! history-mask (ash 1 sv-16)) + (set! history-mask 0) + ) + ) + (let* ((last-idx (enemy-method-120 bot (-> obj speech-indexes length) history-mask)) + (speech-idx (-> obj speech-indexes last-idx)) + (v1-47 (-> sp-info speech-idx flags)) + ) + (set! history-mask (logior history-mask (ash 1 last-idx))) + (when (and (not (logtest? sp-flags v1-47)) + (or (not (logtest? v1-47 (speech-flags sf11))) (not (speech-playing? bot speech-idx))) + ) + (set! (-> obj last-local-index) last-idx) + (logior! (-> obj history-mask) (ash 1 last-idx)) + (return speech-idx) + ) + ) + ) + ) + #f + -1 + ) + +(deftype bot-course-table (basic) + ((course bot-course 18 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + + +(define *bot-course-table* (new 'static 'bot-course-table)) diff --git a/goal_src/jak2/levels/common/ai/bot-states.gc b/goal_src/jak2/levels/common/ai/bot-states.gc index a73f7a2130..13626b0271 100644 --- a/goal_src/jak2/levels/common/ai/bot-states.gc +++ b/goal_src/jak2/levels/common/ai/bot-states.gc @@ -7,3 +7,286 @@ ;; DECOMP BEGINS +(defstate hit (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (stop-speech self (the-as uint 0) #t) + (bot-method-191 self) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) exit))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (get-rand-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override hit-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override hit-anim))) + frames + num-frames + ) + -1 + ) + ) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-36 (-> self enemy-flags))) + (if (logtest? v1-36 (enemy-flag checking-water)) + (set! v1-37 (logior v1-36 (enemy-flag enable-on-active))) + (set! v1-37 (logclear v1-36 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> self mask) (logior (process-mask collectable) (-> self mask))) + (logclear! (-> self mask) (process-mask collectable)) + ) + (let ((v1-44 (-> self enemy-flags))) + (if (logtest? (enemy-flag no-initial-move-to-ground) v1-44) + (set! v1-45 (logior (enemy-flag check-water-backup) v1-44)) + (set! v1-45 (logclear v1-44 (enemy-flag check-water-backup))) + ) + ) + (set! (-> self enemy-flags) v1-45) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> self focus-status) (focus-status hit)) + (enemy-method-72 self) + (none) + ) + ) + +(defstate knocked (bot) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) + (stop-speech self (the-as uint 0) #t) + (if (and (logtest? (-> self bot-flags) (bot-flags attacked)) + (nonzero? (-> self hit-points)) + (zero? (-> self fated-time)) + ) + (logior! (-> self bot-flags) (bot-flags bf12)) + ) + (bot-method-191 self) + (when (zero? (-> self hit-points)) + (set! (-> self hit-points) 1) + (set! (-> self fated-time) (the-as uint (-> self clock frame-counter))) + ) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-2 + (t9-2) + ) + ) + (none) + ) + :exit (behavior () + (let ((gp-0 (-> self incoming attack-id))) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self incoming attack-id) gp-0) + ) + (logior! (-> self bot-flags) (bot-flags bf11)) + (logclear! (-> self bot-flags) (bot-flags bf12)) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (-> self bot-flags) (bot-flags bf12)) (!= (-> self state-time) (-> self clock frame-counter))) + (logclear! (-> self bot-flags) (bot-flags bf12)) + (play-attacked-speech self) + ) + (none) + ) + ) + +(defstate die-falling (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (kill-nearby-enemies (-> self root-override2 trans) 61440.0) + (stop-speech self (the-as uint 0) #f) + (logclear! (-> self bot-flags) (bot-flags bf06 bf11)) + (set! (-> self delay-too-far-check) -1) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (fail-mission! self) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (logclear! (-> self bot-flags) (bot-flags bf13 bf14)) + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) exit))) + (if t9-0 + (t9-0) + ) + ) + (none) + ) + :trans (behavior () + (fail-falling self) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (enemy-method-133 self) + (-> self enemy-info-override die-falling-anim) + (-> self enemy-info-override die-anim) + ) + ) + ) + (f30-0 (get-rand-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (until (not (channel-active? self (the-as uint 0))) + (suspend) + ) + (until #f + (if (and (logtest? (-> self bot-flags) (bot-flags failed)) (reset? *fail-mission-control*)) + (reset! *fail-mission-control*) + ) + (suspend) + ) + #f + (none) + ) + ) + +(defstate failed (bot) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior bot) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type bot die-falling) enter)) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (when (logtest? (-> self bot-flags) (bot-flags failed)) + (let ((a0-1 (-> self course too-far-fail-speeches))) + (when (and (nonzero? a0-1) a0-1) + (let ((a1-1 (bot-speech-list-method-9 a0-1 self (-> self course speeches) (speech-flags)))) + (if (>= a1-1 0) + (play-speech self a1-1) + ) + ) + ) + ) + ) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + ((-> (method-of-type bot die-falling) trans)) + (if (channel-active? self (the-as uint 0)) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (get-rand-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info-override idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (and (logtest? (-> self bot-flags) (bot-flags failed)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) + (reset? *fail-mission-control*) + ) + (cleanup-for-death self) + (process-entity-status! self (entity-perm-status no-kill) #f) + (reset! *fail-mission-control*) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior bot) nav-enemy-die-falling-post) + ) + +(defstate hidden (bot) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior bot) enemy-event-handler) + :enter (behavior () + (logior! (-> self focus-status) (focus-status disable)) + (let ((v1-3 (-> self root-override2 root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self notice-enemy-dist) 0.0) + (logclear! (-> self enemy-flags) (enemy-flag trackable-backup)) + (none) + ) + :exit (behavior () + (local-vars (v0-0 enemy-flag)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self focus-status) (focus-status disable)) + (let ((v1-5 (-> self root-override2 root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? (enemy-flag enable-on-hostile) v1-6) + (set! v0-0 (logior (enemy-flag trackable-backup) v1-6)) + (set! v0-0 (logclear v1-6 (enemy-flag trackable-backup))) + ) + ) + (set! (-> self enemy-flags) v0-0) + (none) + ) + :code (the-as (function none :behavior bot) sleep-code) + :post (the-as (function none :behavior bot) nav-enemy-simple-post) + ) diff --git a/goal_src/jak2/levels/common/ai/bot.gc b/goal_src/jak2/levels/common/ai/bot.gc index 73a15adf6f..eb8cff5f87 100644 --- a/goal_src/jak2/levels/common/ai/bot.gc +++ b/goal_src/jak2/levels/common/ai/bot.gc @@ -7,3 +7,2009 @@ ;; DECOMP BEGINS +(defmethod run-logic? bot ((obj bot)) + #t + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-debug-draw-sphere bot ((obj bot) (arg0 vector) (arg1 rgba)) + (add-debug-sphere #t (bucket-id debug2) (the-as vector (&-> arg0 x)) (-> arg0 w) arg1) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-debug-draw-spot-sphere bot ((obj bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) + (let* ((s2-0 (-> obj spot-color)) + (s1-0 s2-0) + ) + (if (>= arg2 0) + (set! s1-0 (logior (the-as uint (logand #xffffff s2-0)) + (the-as uint (shl (the int (* 0.375 (the float (logand (shr s2-0 24) 255)))) 24)) + ) + ) + ) + (dotimes (s0-0 arg0) + (let* ((v1-5 (-> (the-as (pointer uint8) (&+ arg1 s0-0)))) + (a1-2 (-> obj course spots v1-5)) + ) + (bot-debug-draw-sphere obj (the-as vector a1-2) (if (= v1-5 arg2) + (the-as rgba s2-0) + (the-as rgba s1-0) + ) + ) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-debug-draw-spot-id bot ((obj bot)) + (let ((course (-> obj course))) + (countdown (i (-> course spot-count)) + (let ((spot (-> course spots i))) + (bot-debug-draw-sphere obj (the-as vector spot) (the-as rgba (-> obj spot-color))) + (format (clear *temp-string*) "~d" i) + (let ((spot-id *temp-string*)) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + spot-id + (-> spot center) + (font-color #dadada) + (the-as vector2h #f) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod outside-spot-radius? bot ((obj bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) + "Are we outside of the given [[bot-spot]] radius?" + (if (not spot) + (set! spot (-> obj spot)) + ) + (if (not bot-trans) + (set! bot-trans (-> obj root-override2 trans)) + ) + (let ((f0-0 (vector-vector-xz-distance (-> spot center) bot-trans))) + (if arg3 + (set! f0-0 (+ 819.2 f0-0)) + ) + (>= (-> spot center w) f0-0) + ) + ) + +(defmethod player-blocking-spot? bot ((obj bot) (spot bot-spot)) + (let ((f0-0 (-> spot blocked-xz-dist))) + (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> spot center)))) + ) + ) + +(defmethod choose-spot bot ((obj bot) (num-spots int) (spot-indices (pointer uint))) + "Choose the closest [[bot-spot]] that is not blocked by the player." + (let ((spot-idx 0)) + (let ((f30-0 -1.0) + (bot-trans (-> obj root-override2 trans)) + ) + (countdown (i num-spots) + (let ((spot (-> obj course spots (-> (the-as (pointer uint8) (&+ spot-indices i)))))) + (when (not (player-blocking-spot? obj spot)) + (let ((spot-dist (vector-vector-xz-distance bot-trans (-> spot center)))) + (when (or (< f30-0 0.0) (< spot-dist f30-0)) + (set! f30-0 spot-dist) + (set! spot-idx i) + ) + ) + ) + ) + ) + ) + spot-idx + ) + ) + +(defmethod enemy-method-108 bot ((obj bot) (arg0 enemy) (arg1 event-message-block)) + 0 + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod reset-attacker! bot ((obj bot)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (v1-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (and v1-5 (= (-> v1-5 type) target)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (none) + ) + +(defmethod bot-method-193 bot ((obj bot)) + (let ((gp-0 #f)) + (let ((v1-0 (-> obj incoming penetrate-using))) + (cond + ((logtest? #x800000 v1-0) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (-> *target* gun fire-dir-out)) + ) + (vector-! s5-0 (-> obj root-override2 trans) (target-pos 0)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (if (or (< 28672.0 (vector-vector-xz-distance (-> obj root-override2 trans) (target-pos 0))) + (< (vector-dot s3-0 s5-0) (cos 3640.889)) + ) + (set! gp-0 #t) + ) + ) + ) + ) + ((and (logtest? #x10000 v1-0) (zero? (logand #x20000 v1-0))) + (set! gp-0 #t) + ) + ) + ) + gp-0 + ) + ) + +(defmethod bot-method-190 bot ((obj bot)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (cond + ((< 0.0 (-> obj notice-enemy-dist)) + (let ((s5-0 (new 'stack-no-clear 'connection-pers)) + (s4-0 544) + ) + (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> obj root-override2 trans quad)) + (set! (-> s5-0 param 3) (-> obj notice-enemy-dist)) + (set! (-> s5-0 next) #f) + (set! (-> s5-0 key) 409600000.0) + (set! (-> s5-0 update-time) 0) + (set! *actor-list-length* 0) + (if (logtest? s4-0 512) + (set! *actor-list-length* + (fill-actor-list-for-sphere *actor-hash* (the-as sphere (-> s5-0 param)) *actor-list* 256) + ) + ) + (when (logtest? s4-0 1024) + (let ((a0-5 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-1 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-1) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-3 a2-5) + (f1-2 (+ (-> a1-2 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-3 (* f1-2 f1-2)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 256) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-2) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-4 a2-12) + (f1-6 (+ (-> a1-14 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-4 (* f1-6 f1-6)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let ((v1-26 (-> *actor-list* s3-0))) + (when (logtest? (the-as collide-spec s4-0) (-> v1-26 root-prim prim-core collide-as)) + (let* ((s2-0 (-> v1-26 process)) + (a1-26 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when a1-26 + (set-next-focus! obj (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) + (if (-> s5-0 next) + (return #t) + ) + ) + ) + ) + ) + ) + ) + #f + ) + (else + #f + ) + ) + ) + ) + +(defmethod enemy-method-106 bot ((obj bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) + (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) + (t9-0 obj arg0 arg1 arg2 arg3) + ) + (logclear! (-> obj bot-flags) (bot-flags bf03 bf04)) + (let* ((s3-0 (handle->process (-> obj incoming attacker-handle))) + (s5-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s5-0 + (cond + ((= (-> s5-0 type) target) + (logior! (-> obj bot-flags) (bot-flags bf04)) + (cond + ((bot-method-193 obj) + (logior! (-> obj bot-flags) (bot-flags bf03)) + ) + (else + (+! (-> obj hit-by-player-count) 1) + (when (not (bot-method-190 obj)) + (logior! (-> obj bot-flags) (bot-flags attacked)) + (cond + ((attacked-by-player? obj (the-as process-focusable s5-0)) + (set! (-> obj attacker-handle) (process->handle s5-0)) + (set! (-> obj attacker-time) (-> self clock frame-counter)) + ) + (else + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + ) + ) + ) + ) + ((type? s5-0 enemy) + (+! (-> obj hit-by-enemy-count) 1) + (when (attacked-by-player? obj (the-as process-focusable s5-0)) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! (-> obj attacker-handle) (process->handle s5-0)) + (set! (-> obj attacker-time) (-> self clock frame-counter)) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod enemy-method-56 bot ((obj bot) (arg0 process) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type nav-enemy enemy-method-56)) + (v0-0 (t9-0 obj arg0 arg1)) + ) + (let ((v1-1 (-> obj bot-flags))) + (cond + ((logtest? v1-1 (bot-flags bf03 too-far-fail bf09)) + (set! v0-0 0) + ) + ((logtest? v1-1 (bot-flags bf10)) + (set! v0-0 (-> obj hit-points)) + ) + (else + (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + (set! v0-0 0) + ) + ) + ) + ) + v0-0 + ) + ) + +(defmethod enemy-method-58 bot ((obj bot) (arg0 process) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) + (v0-0 (t9-0 obj arg0 arg1)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags bf03)) + (set! v0-0 #f) + ) + v0-0 + ) + ) + +(defmethod clear-poi-and-focus! bot ((obj bot)) + "Clear our point of interest and focus handles." + (let* ((s4-0 (handle->process (-> obj poi-handle))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-0 + (set! (-> obj poi-handle) (the-as handle #f)) + (let ((s4-1 (handle->process (-> obj focus handle)))) + (if (= (if (type? s4-1 process-focusable) + s4-1 + ) + s5-0 + ) + (clear-focused (-> obj focus)) + ) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod attacked-by-player? bot ((obj bot) (fproc process-focusable)) + "Were we attacked by the player?" + (the-as + symbol + (and (and fproc (zero? (logand (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) + (or (logtest? (process-mask enemy) (-> fproc mask)) + (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod enemy-method-57 bot ((obj bot) (arg0 process-focusable) (arg1 enemy-best-focus)) + (the-as enemy-aware 3) + ) + +(defmethod enemy-method-61 bot ((obj bot) (arg0 int)) + 3 + ) + +(defmethod enemy-method-129 bot ((obj bot)) + (local-vars (s5-1 process)) + (with-pp + (let ((s5-0 (-> obj focus))) + (cond + ((logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags)) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + (else + (enemy-method-97 obj) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + ) + ) + (let ((s4-0 #f)) + (when (or (logtest? (bot-flags bf18) (-> obj bot-flags)) + (and s5-1 (attacked-by-player? obj (the-as process-focusable s5-1))) + ) + (set! (-> obj danger-time) (-> pp clock frame-counter)) + (set! s4-0 #t) + ) + (when (nonzero? (-> obj swivel-joint-mod)) + (if (and s4-0 s5-1 (logtest? (-> obj bot-flags) (bot-flags bf11))) + (bot-method-222 obj (get-trans (the-as process-focusable s5-1) 3)) + (bot-method-221 obj) + ) + ) + ) + (none) + ) + ) + +(defmethod enemy-method-97 bot ((obj bot)) + (with-pp + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 1.5)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 6)) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> obj focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) + (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + (else + (clear-focused (-> obj focus)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + s5-1 + ) + ) + ) + ) + +(defmethod select-focus! bot ((obj bot)) + "Find enemies around our `notice-enemy-dist` and choose a target." + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((coll-spec (collide-spec enemy hit-by-others-list)) + (focus (new 'stack-no-clear 'enemy-best-focus)) + ) + (let ((sphere (new 'stack-no-clear 'sphere)) + (enemy-dist (-> obj notice-enemy-dist)) + ) + (set! (-> focus proc) #f) + (set! (-> focus rating) 409600000.0) + (set! (-> focus aware) (enemy-aware enemy-aware-0)) + (when (< 0.0 enemy-dist) + (set! (-> sphere quad) (-> obj root-override2 trans quad)) + (set! (-> sphere r) (-> obj notice-enemy-dist)) + (set! *actor-list-length* 0) + (if (logtest? (the-as int coll-spec) (collide-spec hit-by-others-list)) + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* sphere *actor-list* 256)) + ) + (when (logtest? (the-as int coll-spec) (collide-spec player-list)) + (let ((next-actor (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-14 (-> next-actor next0))) + (while (!= next-actor (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection next-actor) param1)) + (cshape (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as int coll-spec) (-> cshape prim-core collide-as)) + (let ((ccore (-> cshape prim-core))) + (let ((a2-4 ccore) + (a3-1 sphere) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-2 a2-5) + (f1-3 (+ (-> ccore world-sphere w) (-> sphere r))) + ) + (when (< f0-2 (* f1-3 f1-3)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! next-actor v1-14) + *collide-player-list* + (set! v1-14 (-> v1-14 next0)) + ) + ) + ) + ) + (when (logtest? (the-as int coll-spec) (collide-spec hit-by-player-list)) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-22 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as int coll-spec) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 sphere) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-3 a2-12) + (f1-7 (+ (-> a1-14 world-sphere w) (-> sphere r))) + ) + (when (< f0-3 (* f1-7 f1-7)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-22) + *collide-hit-by-player-list* + (set! v1-22 (-> v1-22 next0)) + ) + ) + ) + ) + (dotimes (i *actor-list-length*) + (let ((actor (-> *actor-list* i))) + (when (logtest? (the-as int coll-spec) (-> actor root-prim prim-core collide-as)) + (let* ((proc (-> actor process)) + (enemy (if (type? proc process-focusable) + proc + ) + ) + ) + (if (and enemy + enemy + (zero? (logand (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) + ) + (set-next-focus! obj (the-as enemy enemy) focus) + ) + ) + ) + ) + ) + ) + ) + (-> focus proc) + ) + ) + ) + +;; WARN: Return type mismatch enemy vs none. +(defmethod set-next-focus! bot ((obj bot) (enemy enemy) (arg2 enemy-best-focus)) + (let ((enemy-dist (new 'stack-no-clear 'vector))) + (vector-! enemy-dist (-> enemy root-override2 trans) (-> obj root-override2 trans)) + (let ((rating (vector-length enemy-dist))) + (when (and (>= (-> obj notice-enemy-dist) rating) (< rating (-> arg2 rating)) (>= 24576.0 (fabs (-> enemy-dist y)))) + (set! (-> arg2 rating) rating) + (set! (-> arg2 proc) enemy) + ) + ) + ) + (none) + ) + +(defmethod alive? bot ((obj bot)) + (and (not (logtest? (-> obj focus-status) (focus-status dead grabbed))) + (nonzero? (-> obj hit-points)) + (zero? (-> obj fated-time)) + ) + ) + +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 87] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 111] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 128] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 141] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 180] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 186] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 192] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 32] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 224] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 232] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 238] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 302] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 312] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 348] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 252] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 267] +;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 5] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 9] +(defmethod enemy-method-74 bot ((obj bot) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 none)) + (with-pp + (let ((v1-0 arg2)) + (the-as + object + (cond + ((= v1-0 'track) + #f + ) + ((= v1-0 'combo) + #f + ) + ((= v1-0 'query) + (case (-> arg3 param 0) + (('waypoint) + (-> obj waypoint waypoint-id) + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ((= v1-0 'request) + (case (-> arg3 param 0) + (('waypoint) + (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) + #t + ) + (('health-meter) + (cond + ((-> arg3 param 1) + (set! v0-0 (the-as none (logior (-> obj bot-flags) (bot-flags bf06)))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + ) + (else + (set! v0-0 (the-as none (logclear (-> obj bot-flags) (bot-flags bf06)))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + ) + ) + v0-0 + ) + (('too-far-fail) + (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag check-water)) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (go (method-of-object obj failed)) + ) + ) + (('move-to-vehicle) + (let ((a0-19 (-> arg3 param 2))) + (cond + ((>= (the-as int a0-19) 0) + (let ((v1-29 (the-as object (-> arg3 param 1)))) + (cond + ((logtest? (focus-status pilot) (-> obj focus-status)) + (if (= (-> obj vehicle-seat-index) a0-19) + (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) + ) + ) + (else + (set! (-> obj vehicle-seat-index) (the-as int a0-19)) + (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) + (logior! (-> obj bot-flags) (bot-flags bf15)) + #t + ) + ) + ) + ) + (else + (when (not (logtest? (focus-status pilot) (-> obj focus-status))) + (set! (-> obj vehicle-seat-index) -1) + (set! (-> obj vehicle-handle) (the-as handle #f)) + (logclear! (-> obj bot-flags) (bot-flags bf15)) + #t + ) + ) + ) + ) + ) + (('exit-vehicle) + (when (logtest? (focus-status pilot) (-> obj focus-status)) + (let ((v1-43 (-> arg3 param 1)) + (s5-1 (-> arg3 param 2)) + ) + (cond + (v1-43 + (set! (-> obj bot-flags) (logior (bot-flags bf16) (-> obj bot-flags))) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) + (set! (-> obj nav-mesh-index) (the-as int s5-1)) + ) + ) + (else + (logclear! (-> obj bot-flags) (bot-flags bf16)) + ) + ) + ) + #t + ) + ) + (('slave-id) + (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) + #t + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ((= v1-0 'notify) + (case (-> arg3 param 0) + (('attack) + (let ((s5-2 (-> arg3 param 1))) + (when (if (type? s5-2 process-focusable) + s5-2 + ) + (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (set! (-> obj hit-focus-time) (the-as uint (-> pp clock frame-counter))) + ) + ) + #t + ) + (('mission-failed) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj bot-flags) (bot-flags bf06)) + #t + ) + (('follow-dir) + (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ((= v1-0 'set-task) + (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> obj bot-task-bits) (ash 1 a1-11)) + ) + #t + ) + ((= v1-0 'clear-task) + (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) + ) + #t + ) + ((= v1-0 'skip) + (skip-waypoint obj) + ) + ((= v1-0 'change-mode) + (when (= (-> arg3 param 0) 'grab) + (set! v0-0 (the-as none (alive? obj))) + (if (and (the-as symbol v0-0) (-> arg3 param 1)) + (logior! (-> obj focus-status) (focus-status grabbed)) + ) + v0-0 + ) + ) + ((= v1-0 'end-mode) + (when (logtest? (-> obj focus-status) (focus-status grabbed)) + (logclear! (-> obj focus-status) (focus-status grabbed)) + #t + ) + ) + ((= v1-0 'hide) + (cond + ((-> arg3 param 0) + (go (method-of-object obj hidden)) + ) + (else + (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) + (enemy-method-72 obj) + ) + ) + ) + ) + ((= v1-0 'draw) + (cond + ((-> arg3 param 0) + (set! v0-0 (the-as none (logclear (-> obj draw status) (draw-control-status no-draw)))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) + ) + (else + (set! v0-0 (the-as none (logior (-> obj draw status) (draw-control-status no-draw)))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + ) + +(defmethod enemy-method-104 bot ((obj bot) (arg0 process) (arg1 uint) (arg2 uint)) + (cond + ((and (= (-> arg0 type) target) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'shove) + (set! (-> a1-1 param 0) (the-as uint #f)) + (let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id)))) + (let* ((a0-6 *game-info*) + (a2-2 (+ (-> a0-6 attack-id) 1)) + ) + (set! (-> a0-6 attack-id) a2-2) + (set! (-> v1-6 id) a2-2) + ) + (set! (-> v1-6 shove-back) 8192.0) + (set! (-> v1-6 shove-up) 6144.0) + (set! (-> a1-1 param 1) (the-as uint v1-6)) + ) + (when (send-event-function arg0 a1-1) + (set! (-> obj root-override2 penetrated-by) (the-as penetrate -1)) + (enemy-method-49 obj) + #t + ) + ) + ) + (else + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'attack) + (set! (-> a1-2 param 0) arg1) + (let ((v1-14 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id)))) + (set! (-> v1-14 id) arg2) + (set! (-> v1-14 shove-back) (-> obj enemy-info-override attack-shove-back)) + (set! (-> v1-14 shove-up) (-> obj enemy-info-override attack-shove-up)) + (set! (-> v1-14 mode) (-> obj enemy-info-override attack-mode)) + (set! (-> a1-2 param 1) (the-as uint v1-14)) + ) + (when (send-event-function arg0 a1-2) + (enemy-method-105 obj arg0) + #t + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod enemy-method-76 bot ((obj bot) (arg0 process) (arg1 event-message-block)) + (the-as + symbol + (cond + ((and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (logtest? (-> obj focus-status) (focus-status dangerous)) + (logtest? (process-mask enemy) (-> arg0 mask)) + (and v1-6 + (zero? (logand (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> obj root-override2) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> obj root-override2) + (collide-action persistent-attack) + (collide-action) + ) + (-> obj persistent-attack-id) + (-> obj attack-id) + ) + ) + ) + (enemy-method-104 obj arg0 s3-0 a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + ) + +(defun bot-simple-check-too-far ((arg0 bot)) + (let ((s5-0 0)) + (let ((f0-0 (vector-vector-xz-distance (-> *target* control trans) (-> arg0 root-override2 trans))) + (f1-0 (-> arg0 too-far-warn-dist)) + ) + (when (>= f0-0 f1-0) + (if (>= (- f0-0 f1-0) (-> arg0 too-far-fail-dist-delta)) + (set! s5-0 2) + (set! s5-0 1) + ) + ) + ) + s5-0 + ) + ) + +(defmethod play-too-far-warn-speech bot ((obj bot)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((idx + (bot-speech-list-method-9 (-> obj course too-far-warn-speeches) obj (-> obj course speeches) (speech-flags)) + ) + ) + (when (>= idx 0) + (play-speech obj idx) + #t + ) + ) + ) + ) + +(defun bot-check-too-far-always-okay () + 0 + (none) + ) + +;; WARN: Using new Jak 2 rtype-of +(defmethod bot-check-too-far bot ((obj bot)) + "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. + If the player is too far, play a warning speech." + (with-pp + (let ((result 0)) + (let ((too-far-check (-> obj delay-too-far-check))) + (cond + ((> too-far-check 0) + (set! (-> obj delay-too-far-check) (+ too-far-check -1)) + ) + ((and (zero? too-far-check) *target* (zero? (logand (-> obj focus-status) (focus-status grabbed)))) + (let ((check-too-far-func (the-as object (-> obj waypoint check-too-far)))) + (if (not (the-as symbol check-too-far-func)) + (set! check-too-far-func (-> obj course default-check-too-far)) + ) + (when (the-as symbol check-too-far-func) + (cond + ((logtest? (the-as int check-too-far-func) 1) + (set! result ((the-as (function bot int) (-> (the-as symbol check-too-far-func) value)) obj)) + ) + ((= (rtype-of (the-as symbol check-too-far-func)) function) + (set! result ((the-as (function bot int) check-too-far-func) obj)) + ) + ) + ) + ) + (if (and (= result 1) + (nonzero? (-> obj started-warning-time)) + (>= (- (-> pp clock frame-counter) (-> obj started-warning-time)) + (the-as time-frame (-> obj warn-to-fail-timeout)) + ) + ) + (set! result 2) + ) + (case result + ((1) + (if (zero? (-> obj started-warning-time)) + (set! (-> obj started-warning-time) (-> pp clock frame-counter)) + ) + (if (and (>= (-> pp clock frame-counter) (-> obj next-too-far-warn-time)) (play-too-far-warn-speech obj)) + (set! (-> obj next-too-far-warn-time) + (+ (-> pp clock frame-counter) + (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + ) + ) + ) + ) + ) + ) + ) + ) + (when (zero? result) + (set! (-> obj started-warning-time) 0) + 0 + ) + (= result 2) + ) + ) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod reset-warn-time! bot ((obj bot)) + (with-pp + (set! (-> obj started-warning-time) 0) + (set! (-> obj next-too-far-warn-time) + (+ (-> pp clock frame-counter) + (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + ) + ) + (none) + ) + ) + +(defmethod enemy-method-55 bot ((obj bot)) + (set! (-> obj travel-prev-ry) (-> obj travel-prev-ry1)) + (set! (-> obj travel-prev-ry1) (quaternion-y-angle (-> obj root-override2 quat))) + (let ((f0-4 (/ (the float (-> obj hit-points)) (the float (-> obj enemy-info-override default-hit-points))))) + (if (nonzero? (-> obj fated-time)) + (set! f0-4 0.0) + ) + (set! (-> *game-info* bot-health (-> obj bot-health-index)) f0-4) + ) + (cond + ((logtest? (-> obj bot-flags) (bot-flags bf06)) + (if (and (not (handle->process (-> obj health-handle))) *target*) + (bot-method-216 obj) + ) + ) + (else + (send-event (handle->process (-> obj health-handle)) 'hide-and-die) + ) + ) + (let ((a0-13 obj)) + (when (not (logtest? (enemy-flag enemy-flag36) (-> a0-13 enemy-flags))) + (let ((a1-4 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-4 options) (overlaps-others-options)) + (set! (-> a1-4 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-4 tlist) *touching-list*) + (find-overlapping-shapes (-> obj root-override2) a1-4) + ) + ) + ) + (let ((t9-4 (method-of-type nav-enemy enemy-method-55))) + (t9-4 obj) + ) + (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) + (let ((t9-5 (-> obj waypoint on-update))) + (if t9-5 + (t9-5 obj) + ) + ) + ) + (if (and (bot-check-too-far obj) (zero? (logand (-> obj bot-flags) (bot-flags bf09)))) + (go (method-of-object obj failed)) + ) + (if (not (logtest? (-> obj bot-flags) (bot-flags bf09))) + (ai-task-control-method-10 (-> obj ai-ctrl) obj) + ) + (if (logtest? (-> obj bot-flags) (bot-flags bf02)) + (bot-method-192 obj) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc08)) + (bot-debug-draw-spot-id obj) + ) + (none) + ) + +(defmethod scene-play bot ((obj bot) (scene string) (grab? symbol)) + "Spawn a [[scene-player]] process for the given scene." + (when (and (process-grab? obj #t) (or grab? (process-grab? *target* #t))) + (process-grab? obj #f) + (if (not grab?) + (process-grab? *target* #f) + ) + (set! (-> obj scene-player-handle) + (ppointer->handle (process-spawn scene-player :init scene-player-init scene #t #f)) + ) + #t + ) + ) + +(defmethod scene-release? bot ((obj bot)) + (when (not (handle->process (-> obj scene-player-handle))) + (process-release? obj) + #t + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod clear-speech-flags! bot ((obj bot)) + "Clear the `playing` flag for all of our speeches." + (let ((speeches (-> obj course speeches))) + (countdown (i (-> obj course speech-count)) + (let ((speech (-> speeches i))) + (logclear! (-> speech flags) (speech-flags playing)) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch gui-connection vs none. +(defmethod play-speech bot ((obj bot) (idx int)) + (let* ((course (-> obj course)) + (speech (-> course speeches idx)) + ) + (logior! (-> speech flags) (speech-flags playing)) + (let* ((hold-time (-> speech hold-time)) + (proc + (add-process + *gui-control* + obj + (the-as gui-channel (-> obj channel)) + (gui-action play) + (-> speech name) + -99.0 + (the-as time-frame hold-time) + ) + ) + (tuning (-> course speech-tunings (-> speech tuning-id))) + ) + (set-falloff! + *gui-control* + proc + (-> tuning trans?) + (-> tuning fo-min) + (-> tuning fo-max) + (-> tuning fo-curve) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-death-sound bot ((obj bot) (sound string)) + "Play one of our death sounds." + (add-process + *gui-control* + obj + (the-as gui-channel (-> obj channel)) + (gui-action play) + sound + -99.0 + (seconds 0.3) + ) + (none) + ) + +(defmethod speech-ended? bot ((obj bot) (idx int)) + "Is the given speech active?" + (let ((speech (-> obj course speeches idx))) + (= (get-status + *gui-control* + (the-as + sound-id + (lookup-gui-connection-id *gui-control* (-> speech name) (gui-channel none) (gui-action none)) + ) + ) + (gui-status unknown) + ) + ) + ) + +(defmethod speech-playing? bot ((obj bot) (idx int)) + "Is the given speech playing?" + (let ((v1-2 (-> obj course speeches idx))) + (logtest? (-> v1-2 flags) (speech-flags playing)) + ) + ) + +(defmethod channel-active? bot ((obj bot) (channel uint)) + "Is the given [[gui-channel]] active?" + (if (zero? channel) + (set! channel (-> obj channel)) + ) + (nonzero? (get-status + *gui-control* + (the-as + sound-id + (lookup-gui-connection-id *gui-control* (the-as string #f) (the-as gui-channel channel) (gui-action none)) + ) + ) + ) + ) + +(defmethod stop-speech bot ((obj bot) (channel uint) (arg1 symbol)) + (if (zero? channel) + (set! channel (-> obj channel)) + ) + (if arg1 + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (the-as gui-channel channel) + (gui-action none) + (the-as string #f) + (lambda :behavior bot + ((arg0 gui-connection)) + (let* ((v1-0 self) + (s5-0 (-> v1-0 course speeches)) + ) + (countdown (s4-0 (-> v1-0 course speech-count)) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= (-> s3-0 name) (-> arg0 name)) + (return (zero? (logand (-> s3-0 flags) (speech-flags sf01)))) + ) + ) + ) + ) + #t + ) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (the-as gui-channel channel) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (none) + ) + +(defmethod go-to-waypoint! bot ((obj bot) (id int) (skipped? symbol)) + "Start moving to the given [[bot-waypoint]]." + (with-pp + (let* ((course (-> obj course)) + (waypoint-count (-> course waypoints length)) + ) + (dotimes (i waypoint-count) + (let ((waypoint (-> course waypoints i))) + (when (= (-> waypoint waypoint-id) id) + (set! (-> obj waypoint) waypoint) + (set! (-> obj waypoint-bits) (the-as uint 0)) + (set! (-> obj waypoint-time0) (-> pp clock frame-counter)) + (set! (-> obj too-far-warn-dist) (-> obj too-far-warn-dist-default)) + (set! (-> obj too-far-fail-dist-delta) (-> obj too-far-fail-dist-delta-default)) + (let ((mesh-idx (-> waypoint nav-mesh-index))) + (when (and (>= mesh-idx 0) (!= (-> obj nav-mesh-index) mesh-idx)) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor mesh-idx) obj) + (set! (-> obj nav-mesh-index) mesh-idx) + ) + ) + (when skipped? + (let ((on-skip (-> waypoint on-skipping-here))) + (when on-skip + (process-entity-status! obj (entity-perm-status no-kill) #t) + (on-skip obj) + ) + ) + ) + (let ((on-set (-> waypoint on-set))) + (if on-set + (on-set obj) + ) + ) + (return #f) + ) + ) + ) + ) + (go process-drawable-art-error "bad waypoint id") + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod skip-waypoint bot ((obj bot)) + (let ((skip-id (-> obj waypoint skip-to))) + (when (>= skip-id 0) + (stop-speech obj (the-as uint 0) #f) + (set! (-> obj delay-too-far-check) 10) + (go-to-waypoint! obj skip-id #t) + ) + ) + (none) + ) + +;; WARN: Return type mismatch nav-enemy vs bot. +(defmethod relocate bot ((obj bot) (arg0 int)) + (if (nonzero? (-> obj ai-ctrl)) + (&+! (-> obj ai-ctrl) arg0) + ) + (if (nonzero? (-> obj task)) + (&+! (-> obj task) arg0) + ) + (if (nonzero? (-> obj swivel-joint-mod)) + (&+! (-> obj swivel-joint-mod) arg0) + ) + (the-as bot ((method-of-type nav-enemy relocate) obj arg0)) + ) + +(defmethod deactivate bot ((obj bot)) + (send-event (handle->process (-> obj health-handle)) 'hide-and-die) + (if (nonzero? (-> obj ai-ctrl)) + (ai-task-control-method-9 (-> obj ai-ctrl)) + ) + ((method-of-type nav-enemy deactivate) obj) + (none) + ) + +(defmethod init! bot ((obj bot)) + "Set defaults for various fields." + (set! (-> obj master-handle) (the-as handle #f)) + (set! (-> obj health-handle) (the-as handle #f)) + (set! (-> obj scene-player-handle) (the-as handle #f)) + (set! (-> obj poi-handle) (the-as handle #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> obj vehicle-handle) (the-as handle #f)) + (set! (-> obj focus-mode) 0) + (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 180)) + (set! (-> obj warn-to-fail-timeout) (the-as uint #x34bc)) + (set! (-> obj warn-min-delay) (the-as uint 2400)) + (set! (-> obj warn-max-delay) (the-as uint 4200)) + (set! (-> obj vehicle-seat-index) -1) + (set! (-> obj nav-mesh-index) -1) + (set! (-> obj too-far-warn-dist-default) 184320.0) + (set! (-> obj too-far-fail-dist-delta-default) 122880.0) + (logior! (-> obj bot-flags) (bot-flags bf11)) + (set! (-> obj delay-too-far-check) 10) + (set! (-> obj focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> obj spot-color) (the-as uint #x500000ff)) + (set-vector! (-> obj follow-dir) 0.0 0.0 1.0 1.0) + 0 + (none) + ) + +(defmethod enemy-method-115 bot ((obj bot)) + "@abstract" + (process-entity-status! obj (entity-perm-status bit-4) #t) + (set! (-> obj ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) + (logclear! (-> obj mask) (process-mask enemy)) + (set! (-> obj mask) (logior (process-mask bot) (-> obj mask))) + (set! (-> obj enemy-flags) (logior (enemy-flag use-notice-distance multi-focus) (-> obj enemy-flags))) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logior! (-> obj focus-status) (focus-status disable)) + (let ((v1-13 (-> obj nav))) + (set! (-> v1-13 sphere-mask) (the-as uint 78)) + ) + 0 + (logclear! (-> obj root-override2 nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-17 (-> obj nav))) + (set! (-> v1-17 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> obj root-override2 dynam) 573440.0) + (let ((a2-3 (res-lump-value (-> obj entity) 'task-actor uint128 :time -1000000000.0))) + (if (nonzero? a2-3) + (set! (-> obj task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) + ) + ) + (let ((s5-0 (res-lump-value (-> obj entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (if (< (the-as int s5-0) 0) + (go process-drawable-art-error "no course") + ) + (let ((s5-1 (-> *bot-course-table* course s5-0))) + (set! (-> obj course) s5-1) + (+! (-> s5-1 retry-cookie) 1) + (mem-copy! (the-as pointer (-> obj spot)) (the-as pointer (-> s5-1 spots 0)) 20) + (let ((v1-36 (-> s5-1 waypoints 0))) + (set! (-> obj nav-mesh-index) (-> v1-36 nav-mesh-index)) + (go-to-waypoint! obj (-> v1-36 waypoint-id) #f) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod bot-method-214 bot ((obj bot)) + (the-as symbol (when (logtest? (-> obj bot-flags) (bot-flags bf00)) + (let ((fproc (handle->process (-> obj focus handle)))) + (and fproc + (= (-> obj focus aware) (enemy-aware enemy-aware-3)) + (attacked-by-player? obj (the-as process-focusable fproc)) + (zero? (logand (-> obj focus-status) (focus-status grabbed))) + ) + ) + ) + ) + ) + +(defmethod bot-method-223 bot ((obj bot) (arg0 symbol)) + (with-pp + (let ((focus (-> obj focus-info)) + (timer (-> pp clock frame-counter)) + (focus-proc (handle->process (-> obj focus handle))) + ) + (when (or (!= timer (-> focus update-time)) (!= focus-proc (-> focus fproc))) + (set! (-> focus update-time) timer) + (set! (-> focus fproc) (the-as process-focusable focus-proc)) + (set! (-> focus los) 0) + (when focus-proc + (set! (-> focus pos quad) (-> (get-trans (the-as process-focusable focus-proc) 0) quad)) + (set! (-> focus bullseye quad) (-> (get-trans (the-as process-focusable focus-proc) 3) quad)) + (vector-z-quaternion! (-> focus my-facing-xz-dir) (-> obj root-override2 quat)) + (set! (-> focus my-facing-xz-dir y) 0.0) + (vector-normalize! (-> focus my-facing-xz-dir) 1.0) + (set! (-> focus my-facing-ry) (atan (-> focus my-facing-xz-dir x) (-> focus my-facing-xz-dir z))) + (vector-! (-> focus bullseye-xz-dir) (-> focus bullseye) (-> obj root-override2 trans)) + (let ((v1-11 (-> focus bullseye-xz-dir))) + (set! (-> focus bullseye-xz-dist) (sqrtf (+ (* (-> v1-11 x) (-> v1-11 x)) (* (-> v1-11 z) (-> v1-11 z))))) + ) + (set! (-> focus bullseye-xz-dir y) 0.0) + (vector-normalize! (-> focus bullseye-xz-dir) 1.0) + (set! (-> focus bullseye-ry) (atan (-> focus bullseye-xz-dir x) (-> focus bullseye-xz-dir z))) + (set! (-> focus ry-diff) (deg- (-> focus bullseye-ry) (-> focus my-facing-ry))) + ) + ) + (when (and arg0 focus-proc (zero? (-> focus los))) + (let ((cquery (new 'stack-no-clear 'collide-query))) + (set! (-> cquery start-pos quad) (-> obj root-override2 trans quad)) + (set! (-> cquery start-pos y) (+ 8192.0 (-> cquery start-pos y))) + (vector-! (-> cquery move-dist) (-> focus bullseye) (-> cquery start-pos)) + (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> cquery move-dist)))))) + (cond + ((< f0-19 (-> focus max-los-dist)) + (vector-normalize! (-> cquery move-dist) f0-19) + (let ((v1-23 cquery)) + (set! (-> v1-23 radius) 2048.0) + (set! (-> v1-23 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-23 ignore-process0) obj) + (set! (-> v1-23 ignore-process1) #f) + (set! (-> v1-23 ignore-pat) (-> obj root-override2 pat-ignore-mask)) + (set! (-> v1-23 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* cquery) 0.0) + (set! (-> focus los) 3) + 0 + ) + (else + (let ((s3-3 1)) + (when (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (let ((a0-31 *target*)) + (when a0-31 + (vector+! (-> cquery move-dist) (-> cquery move-dist) (-> cquery start-pos)) + (if (>= 16384.0 (vector-segment-distance-point! + (get-trans a0-31 3) + (-> cquery start-pos) + (-> cquery move-dist) + (the-as vector #f) + ) + ) + (set! s3-3 4) + ) + ) + ) + ) + (set! (-> focus los) s3-3) + ) + ) + ) + ) + (else + (set! (-> focus los) 2) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod turn-to-target bot ((obj bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((bot-root (-> obj root-override2))) + (quaternion-copy! (-> turn-info src-quat) (-> bot-root quat)) + (vector-z-quaternion! (-> turn-info facing-dir) (-> bot-root quat)) + (set! (-> turn-info facing-ry) (atan (-> turn-info facing-dir x) (-> turn-info facing-dir z))) + (set! (-> turn-info targ-pos quad) (-> (get-trans proc 3) quad)) + (set! (-> turn-info targ-ry) + (atan (- (-> turn-info targ-pos x) (-> bot-root trans x)) (- (-> turn-info targ-pos z) (-> bot-root trans z))) + ) + (let ((proc-vel (get-transv proc)) + (a1-6 (-> turn-info predicted-targ-pos)) + ) + (let ((targ-pos (-> turn-info targ-pos))) + (let ((a2-1 arg3)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> proc-vel quad)) + (.lvf vf4 (&-> targ-pos quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-6 quad) vf6) + ) + (set! (-> turn-info predicted-targ-ry) (atan + (- (-> turn-info predicted-targ-pos x) (-> bot-root trans x)) + (- (-> turn-info predicted-targ-pos z) (-> bot-root trans z)) + ) + ) + ) + (set! (-> turn-info ry-diff) (deg- (-> turn-info targ-ry) (-> turn-info facing-ry))) + (set! (-> turn-info predicted-ry-diff) (deg- (-> turn-info predicted-targ-ry) (-> turn-info facing-ry))) + (none) + ) + ) + +(defmethod bot-method-208 bot ((obj bot)) + (with-pp + (let ((s5-0 #f)) + (when *target* + (let ((target-trans (-> *target* control trans)) + (bot-root (-> obj root-override2)) + (f0-0 14336.0) + ) + (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> bot-root trans) target-trans)) + (let ((v1-8 (-> *target* control transv))) + (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) + (if (logtest? (-> obj nav state flags) (nav-state-flag avoiding-sphere)) + (set! s5-0 #t) + ) + ) + ) + ) + ) + ) + (let* ((f0-8 (-> obj player-blocking)) + (f0-10 (if s5-0 + (seek f0-8 1.0 (-> pp clock seconds-per-frame)) + (seek f0-8 0.0 (-> pp clock seconds-per-frame)) + ) + ) + ) + (set! (-> obj player-blocking) f0-10) + (= f0-10 1.0) + ) + ) + ) + ) + +(defmethod enemy-method-82 bot ((obj bot) (arg0 enemy-jump-info)) + "@abstract" + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (set! (-> v1-0 w) (-> obj nav-radius-backup)) + (add-root-sphere-to-hash! (-> obj nav) v1-0 #x8006a) + ) + ) + +(defmethod bot-method-222 bot ((obj bot) (arg0 vector)) + (with-pp + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> obj root-override2 trans quad)) + (set! (-> v1-0 y) (+ 9216.0 (-> v1-0 y))) + (vector-! s1-0 arg0 v1-0) + (vector-normalize! s1-0 1.0) + (vector-z-quaternion! s2-0 (-> obj root-override2 quat)) + (rot-zxy-from-vector! s4-0 s2-0) + (rot-zxy-from-vector! s3-0 s1-0) + (set! (-> s5-0 x) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 x) (-> s4-0 x))))) + (set! (-> s5-0 y) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 y) (-> s4-0 y))))) + (set! (-> s5-0 z) 0.0) + (let ((s4-1 (new 'stack-no-clear 'quaternion))) + (quaternion-zxy! s4-1 s5-0) + (quaternion-pseudo-seek + (-> obj swivel-joint-mod quat) + (-> obj swivel-joint-mod quat) + s4-1 + (-> pp clock seconds-per-frame) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod bot-method-221 bot ((obj bot)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (quaternion-identity! gp-0) + (quaternion-pseudo-seek + (-> obj swivel-joint-mod quat) + (-> obj swivel-joint-mod quat) + gp-0 + (-> pp clock seconds-per-frame) + ) + ) + ) + ) + +(defmethod play-attacked-speech bot ((obj bot)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((idx + (bot-speech-list-method-9 (-> obj course attack-player-speeches) obj (-> obj course speeches) (speech-flags)) + ) + ) + (if (>= idx 0) + (play-speech obj idx) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch bot-flags vs none. +(defmethod bot-method-196 bot ((obj bot)) + (logior! (-> obj bot-flags) (bot-flags too-far-fail)) + (none) + ) + +;; WARN: Return type mismatch bot-flags vs none. +(defmethod fail-mission! bot ((obj bot)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (let ((mission-failed? #t)) + (let ((master-handle (handle->process (-> obj master-handle)))) + (cond + (master-handle + (if (not (send-event master-handle 'notify 'mission-failed)) + (set! mission-failed? #f) + ) + ) + (else + (let ((fail-params (new 'stack-no-clear 'fail-mission-params))) + (set! (-> fail-params flags) (fail-mission-flags famflags-5)) + (set! (-> fail-params message) (fail-mission-message fammsg-0)) + (set! (-> fail-params retry-continue) #f) + (set! (-> fail-params fail-continue) #f) + (set! (-> fail-params reset-delay) (the-as uint 1500)) + (set! (-> fail-params task) (game-task none)) + (set! (-> fail-params fail-message) (game-text-id null)) + (if (not (start! *fail-mission-control* fail-params)) + (set! mission-failed? #f) + ) + ) + ) + ) + ) + (if mission-failed? + (logior! (-> obj bot-flags) (bot-flags failed bf13)) + ) + ) + (none) + ) + +(defmethod fail-falling bot ((obj bot)) + (if (logtest? (-> obj bot-flags) (bot-flags failed)) + (cam-move-to-bot obj) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod cam-move-to-bot bot ((obj bot)) + (cond + ((logtest? (-> obj bot-flags) (bot-flags bf13)) + (logclear! (-> obj bot-flags) (bot-flags bf13)) + (logior! (-> obj bot-flags) (bot-flags bf14)) + (let ((s4-0 (-> obj move-dest))) + (set-cam-height! obj s4-0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 s4-0 (-> obj root-override2 trans)) + (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) + (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) + (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) + (set-setting! 'string-max-length 'abs f30-0 0) + (set-setting! 'string-min-length 'abs f30-0 0) + ) + ) + ) + (set-setting! 'immediate-string-min-max #f 0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + ) + ((logtest? (-> obj bot-flags) (bot-flags bf14)) + (logclear! (-> obj bot-flags) (bot-flags bf14)) + (send-event *camera* 'change-target obj) + (send-event *camera* 'teleport-to-vector-start-string (-> obj move-dest)) + ) + ) + (none) + ) + +;; WARN: Return type mismatch float vs meters. +(defmethod set-cam-height! bot ((obj bot) (arg0 vector)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (the-as + meters + (if (logtest? (-> obj focus-status) (focus-status under-water)) + (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + ) + ) + ) + +;; WARN: Return type mismatch focus-status vs none. +(defmethod bot-method-191 bot ((obj bot)) + (with-pp + (logior! (-> obj bot-flags) (bot-flags bf02)) + (set! (-> obj hit-invuln-starting-time) (-> pp clock frame-counter)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active)) + (if (nonzero? (-> obj hit-invuln-ignore-me-delay)) + (logior! (-> obj focus-status) (focus-status ignore)) + ) + (if (nonzero? (-> obj hit-invuln-focus-disable-delay)) + (logior! (-> obj focus-status) (focus-status disable)) + ) + (none) + ) + ) + +;; WARN: Return type mismatch bot-flags vs none. +(defmethod bot-method-192 bot ((obj bot)) + (local-vars (a2-7 enemy-flag)) + (with-pp + (let ((a1-0 (-> obj hit-invuln-starting-time)) + (v1-0 #t) + ) + (if (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))) + (set! v1-0 (cond + ((>= (- (-> pp clock frame-counter) a1-0) (seconds 0.6)) + (let ((a2-6 (-> obj enemy-flags))) + (if (logtest? a2-6 (enemy-flag checking-water)) + (set! a2-7 (logior a2-6 (enemy-flag enable-on-active))) + (set! a2-7 (logclear a2-6 (enemy-flag enable-on-active))) + ) + ) + (set! (-> obj enemy-flags) a2-7) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (logtest? (-> obj focus-status) (focus-status ignore)) + (set! v1-0 + (cond + ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-ignore-me-delay))) + (logclear! (-> obj focus-status) (focus-status ignore)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (logtest? (-> obj focus-status) (focus-status disable)) + (set! v1-0 + (cond + ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-focus-disable-delay))) + (logclear! (-> obj focus-status) (focus-status disable)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if v1-0 + (logclear! (-> obj bot-flags) (bot-flags bf02)) + ) + ) + (none) + ) + ) + +(defmethod bot-method-216 bot ((obj bot)) + 0 + (none) + ) + +(defmethod coin-flip? bot ((obj bot)) + "@returns The result of a 50/50 RNG roll" + #f + ) + +(defmethod bot-method-181 bot ((obj bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-1 arg0)) + (let ((v1-10 arg0)) + (let ((a0-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a2-1 f3-7)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t2-1 quad) vf6) + ) + (let ((a2-2 arg0)) + (let ((v1-11 arg0)) + (let ((a0-5 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((a3-2 f1-3)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-2 quad) vf6) + ) + ) + (let ((v1-12 arg0)) + (let ((a0-6 arg0)) + (let ((a1-1 arg3)) + (let ((a2-3 f0-2)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-1 quad)) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-12 quad) vf6) + ) + ) + 0 + (none) + ) + ) diff --git a/goal_src/jak2/levels/hiphog/whack.gc b/goal_src/jak2/levels/hiphog/whack.gc index d840a507e9..4cf7aa1374 100644 --- a/goal_src/jak2/levels/hiphog/whack.gc +++ b/goal_src/jak2/levels/hiphog/whack.gc @@ -7,41 +7,2791 @@ ;; DECOMP BEGINS -(deftype whack-a-metal (process-drawable) - ( - (cabinet handle :offset-assert 200) - (bopper uint32 :offset-assert 208) - (mole object 8 :offset-assert 212) - (score-part basic 2 :offset-assert 244) - (wave int32 :offset-assert 252) - (event int32 :offset-assert 256) - (event-time time-frame :offset-assert 264) - (event-length time-frame :offset-assert 272) - (hud-score int64 :offset-assert 280) - (hud-goal int64 :offset-assert 288) - (score float :offset-assert 296) - (score-time time-frame :offset-assert 304) - (dizzy? symbol :offset-assert 312) - (miss-count int32 :offset-assert 316) - (air-attack-count int32 :offset-assert 320) - (slot-buffer int32 4 :offset-assert 324) - (speech-time time-frame :offset-assert 344) - (speech-count int32 :offset-assert 352) - (speech-last basic 4 :offset-assert 356) +(defpartgroup group-whack-scoreboard-misses + :id 765 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3334 :flags (is-3d launch-asap bit6 bit7) :period 80 :length 9) (sp-item 3335 :flags (bit6))) ) + +(defpart 3335 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1.75)) + (sp-flt spt-rot-x 204.8) + (sp-flt spt-scale-y (meters 2.5)) + (sp-rnd-flt spt-r 64.0 64.0 1.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 12.0 4.0 1.0) + (sp-flt spt-omega 248627.2) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 1024.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 3334 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1b :page #x3d3)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters -0.01)) + (sp-flt spt-z (meters 0.01)) + (sp-flt spt-scale-x (meters 1.03)) + (sp-flt spt-rot-x 16520.533) + (sp-flt spt-scale-y (meters 0.603)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 48.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3e605800 + #x3e605900 + #x3e605a00 + #x3e605b00 + #x3e605c00 + #x3e605d00 + #x3e605e00 + #x3e605f00 + #x3e606000 + #x3e606100 + #x3e606200 + #x3e605300 + #x3e605400 + #x3e605500 + #x3e605600 + #x3e605700 + ) + ) + (sp-func spt-func 'sparticle-texture-animate) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 3336 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x63 :page #x3e6)) + (sp-flt spt-num 1.0) + (sp-rnd-int-flt spt-x (meters -0.3) 4 614.4) + (sp-rnd-int-flt spt-y (meters -0.225) 3 614.4) + (sp-flt spt-z (meters 0.01)) + (sp-flt spt-scale-x (meters 0.125)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 255.0 1.0) + (sp-flt spt-a 255.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-flt spt-userdata 4096.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-whack-scoreboard-points + :id 766 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3337 :flags (is-3d bit7)) + (sp-item 3338 :flags (is-3d bit7)) + (sp-item 3339 :flags (is-3d bit7)) + (sp-item 3340 :flags (is-3d bit7)) + (sp-item 3334 :flags (is-3d launch-asap bit6 bit7) :period 80 :length 9) + (sp-item 3335 :flags (bit6)) + ) + ) + +(defpart 3337 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x49 :page #x3e6)) + (sp-func spt-birth-func 'birth-func-whack-score) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters -0.36)) + (sp-flt spt-z (meters 0.01)) + (sp-flt spt-scale-x (meters 0.2)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-scale-y (meters 0.4)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 255.0 1.0) + (sp-flt spt-a 255.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 + 3 + 0 + 0 + #x3e604900 + #x3e604a00 + #x3e604b00 + #x3e604c00 + #x3e604d00 + #x3e604e00 + #x3e604f00 + #x3e605000 + #x3e605100 + #x3e605200 + ) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 3338 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x49 :page #x3e6)) + (sp-func spt-birth-func 'birth-func-whack-score) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters -0.12)) + (sp-flt spt-z (meters 0.01)) + (sp-flt spt-scale-x (meters 0.2)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-scale-y (meters 0.4)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 255.0 1.0) + (sp-flt spt-a 255.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 + 2 + 0 + 0 + #x3e604900 + #x3e604a00 + #x3e604b00 + #x3e604c00 + #x3e604d00 + #x3e604e00 + #x3e604f00 + #x3e605000 + #x3e605100 + #x3e605200 + ) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 3339 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x49 :page #x3e6)) + (sp-func spt-birth-func 'birth-func-whack-score) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0.12)) + (sp-flt spt-z (meters 0.01)) + (sp-flt spt-scale-x (meters 0.2)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-scale-y (meters 0.4)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 255.0 1.0) + (sp-flt spt-a 255.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 + 1 + 0 + 0 + #x3e604900 + #x3e604a00 + #x3e604b00 + #x3e604c00 + #x3e604d00 + #x3e604e00 + #x3e604f00 + #x3e605000 + #x3e605100 + #x3e605200 + ) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 3340 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x49 :page #x3e6)) + (sp-func spt-birth-func 'birth-func-whack-score) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0.36)) + (sp-flt spt-z (meters 0.01)) + (sp-flt spt-scale-x (meters 0.2)) + (sp-flt spt-rot-x 16384.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-scale-y (meters 0.4)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 255.0) + (sp-rnd-flt spt-b 0.0 255.0 1.0) + (sp-flt spt-a 255.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 + 0 + 0 + 0 + #x3e604900 + #x3e604a00 + #x3e604b00 + #x3e604c00 + #x3e604d00 + #x3e604e00 + #x3e604f00 + #x3e605000 + #x3e605100 + #x3e605200 + ) + ) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-whack-miss + :id 767 + :duration (seconds 0.067) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3341 :flags (bit7) :period 150 :length 5)) + ) + +(defpart 3341 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.01) 1.0) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.16) + (sp-flt spt-accel-y -1.3653333) + (sp-rnd-flt spt-friction 0.8 0.12 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-whack-hit + :id 768 + :duration (seconds 0.067) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3342 :flags (bit7) :period 150 :length 10) + (sp-item 3343 :flags (bit7) :period 150 :length 10) + (sp-item 3344 :flags (is-3d bit7) :period 150 :length 15) + (sp-item 3345 :flags (is-3d bit7) :period 150 :length 15) + (sp-item 3346 :flags (bit7) :period 150 :length 15) + (sp-item 3347 :period 150 :length 5) + ) + ) + +(defpart 3347 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 1)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 3)) + (sp-rnd-flt spt-r 32.0 64.0 1.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters 0.04)) + (sp-flt spt-fade-a -2.56) + (sp-int spt-timer 25) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +(defpart 3342 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.01) 1.0) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.16) + (sp-flt spt-accel-y -1.3653333) + (sp-rnd-flt spt-friction 0.8 0.12 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 3343 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-scale-x (meters 0.25) (meters 0.125) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-copy-from-other spt-b -1) + (sp-rnd-flt spt-a 16.0 16.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.02) 1.0) + (sp-flt spt-scalevel-x (meters 0.0016666667)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.21333334) + (sp-flt spt-accel-y -1.3653333) + (sp-rnd-flt spt-friction 0.9 0.02 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 30.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 3344 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #x3e6)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-scale-x (meters 0.025) (meters 0.075) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 32.0 16.0 1.0) + (sp-rnd-flt spt-b 48.0 16.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.04) 1.0) + (sp-rnd-flt spt-rotvel-x (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.04 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 40 1 0 #x3e604700 #x3e604600 #xb09b00) + ) + (sp-int-plain-rnd spt-next-time 25 149 1) + (sp-launcher-by-id spt-next-launcher 3348) + (sp-rnd-flt spt-conerot-x (degrees 40.0) (degrees 40.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +(defpart 3345 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-func spt-birth-func 'birth-func-texture-group) + (sp-flt spt-num 4.0) + (sp-rnd-flt spt-scale-x (meters 0.025) (meters 0.175) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.025) (meters 0.175) 1.0) + (sp-rnd-flt spt-r 16.0 8.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 24.0 8.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.04) 1.0) + (sp-rnd-flt spt-rotvel-x (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-y (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -4.8) (degrees 9.6) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.04 1.0) + (sp-int spt-timer 300) + (sp-int-plain-rnd spt-next-time 25 149 1) + (sp-launcher-by-id spt-next-launcher 3349) + (sp-rnd-flt spt-conerot-x (degrees 40.0) (degrees 40.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +(defpart 3349 + :init-specs ((sp-rnd-flt spt-r 32.0 16.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-flt spt-b 64.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.013333334) 1.0) + (sp-int-plain-rnd spt-next-time 5 14 1) + (sp-launcher-by-id spt-next-launcher 3350) + ) + ) + +(defpart 3350 + :init-specs ((sp-rnd-flt spt-r 16.0 8.0 1.0) (sp-copy-from-other spt-g -1) (sp-rnd-flt spt-b 24.0 8.0 1.0)) + ) + +(defpart 3346 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x48 :page #x3e6)) + (sp-flt spt-num 8.0) + (sp-rnd-flt spt-scale-x (meters 0.025) (meters 0.025) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-rnd-flt spt-g 32.0 16.0 1.0) + (sp-rnd-flt spt-b 48.0 16.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 1.024 1.024 1.0) + (sp-rnd-flt spt-vel-y (meters 0.02) (meters 0.04) 1.0) + (sp-rnd-flt spt-accel-y -13.653334 6.826667 1.0) + (sp-rnd-flt spt-friction 0.92 0.04 1.0) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + (sp-func spt-func 'sparticle-motion-blur) + (sp-int-plain-rnd spt-next-time 25 149 1) + (sp-launcher-by-id spt-next-launcher 3348) + (sp-rnd-flt spt-conerot-x (degrees 40.0) (degrees 40.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +(defpart 3348 + :init-specs ((sp-rnd-flt spt-r 64.0 32.0 1.0) + (sp-rnd-flt spt-g 96.0 32.0 1.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.013333334) 1.0) + (sp-int-plain-rnd spt-next-time 5 14 1) + (sp-launcher-by-id spt-next-launcher 3351) + ) + ) + +(defpart 3351 + :init-specs ((sp-flt spt-r 32.0) (sp-rnd-flt spt-g 32.0 16.0 1.0) (sp-rnd-flt spt-b 48.0 16.0 1.0)) + ) + +(defpartgroup group-whack-shock + :id 769 + :duration (seconds 0.1) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3352 :flags (launch-asap bit6) :period 150 :length 5) + (sp-item 3353 :flags (launch-asap bit6) :period 150 :length 5) + (sp-item 3354 :flags (bit7) :period 150 :length 10) + ) + ) + +(defpart 3352 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 5)) + (sp-flt spt-r 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-scalevel-x (meters 0.04)) + (sp-flt spt-fade-a -1.28) + (sp-int spt-timer 50) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +(defpart 3353 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0)) + (sp-flt spt-scale-x (meters 1)) + (sp-flt spt-rot-x 122.88) + (sp-flt spt-scale-y (meters 2)) + (sp-flt spt-r 255.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 255.0) + (sp-flt spt-scalevel-x (meters 0.00625)) + (sp-flt spt-scalevel-y (meters 0.01875)) + (sp-flt spt-fade-g 0.8) + (sp-flt spt-fade-b -1.6) + (sp-flt spt-fade-a -3.1875) + (sp-int spt-timer 160) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 4096.0) + ) + ) + +(defpart 3354 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 32.0) + (sp-rnd-flt spt-scale-x (meters 0.1) (meters 0.05) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 96.0 1.0) + (sp-flt spt-omega 4.096) + (sp-rnd-flt spt-vel-y (meters 0.053333335) (meters 0.02) 1.0) + (sp-flt spt-scalevel-x (meters -0.0018750001)) + (sp-rnd-flt spt-rotvel-z (degrees -0.2) (degrees 0.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-rnd-flt spt-friction 0.85 0.02 1.0) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 50.000004) (degrees 35.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpartgroup group-mole-dizzy + :id 770 + :duration (seconds 4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 3356 :flags (launch-asap) :binding 3355) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + (sp-item 3355 :flags (start-dead launch-asap)) + ) + ) + +(defpart 3356 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 32.0) + (sp-flt spt-scale-x (meters 1)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-a 0.0) + (sp-int spt-timer 1200) + (sp-cpuinfo-flags sp-cpuinfo-flag-3) + (sp-func spt-func 'part-tracker-track-root) + ) + ) + +(defpart 3355 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-rnd-flt spt-y (meters -1.3333334) (meters 2.6666667) 1.0) + (sp-rnd-flt spt-z (meters 0.25) (meters 0.25) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.05) (meters 0.025) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 32.0 92.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-omega 0.0 655360.0 1.0) + (sp-rnd-int-flt spt-vel-x (meters -0.053333335) 1 436.90668) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0.00083333335)) + (sp-flt spt-fade-a 0.42666668) + (sp-int spt-timer 3200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch glow) + (sp-flt spt-userdata 0.0) + (sp-int-plain-rnd spt-next-time 75 224 1) + (sp-launcher-by-id spt-next-launcher 3357) + ) + ) + +(defpart 3357 + :init-specs ((sp-flt spt-fade-a 0.0) + (sp-int-plain-rnd spt-next-time 225 224 1) + (sp-launcher-by-id spt-next-launcher 3358) + ) + ) + +(defpart 3358 + :init-specs ((sp-rnd-flt spt-fade-a -0.42666668 -0.42666668 1.0)) + ) + +(deftype hip-mole-event (structure) + ((min-time uint16 :offset 0) + (max-time uint16 :offset 2) + (mode uint8 :offset 4) + ) + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + + +(define *mole-data* (the-as (array (array hip-mole-event)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type hip-mole-event + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x9) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x8) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x9) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x384 :mode #x9) + (new 'static 'hip-mole-event :min-time #x384 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x8) + (new 'static 'hip-mole-event :min-time #x5dc) + (new 'static 'hip-mole-event :min-time #x5dc :mode #x1) + (new 'static 'hip-mole-event :min-time #x5dc :mode #x2) + (new 'static 'hip-mole-event :min-time #x5dc :mode #x3) + (new 'static 'hip-mole-event :min-time #x5dc :mode #x4) + (new 'static 'hip-mole-event :min-time #x5dc :mode #x5) + (new 'static 'hip-mole-event :min-time #x5dc :mode #x6) + (new 'static 'hip-mole-event :min-time #x5dc :mode #x7) + ) + (new 'static 'boxed-array :type hip-mole-event + (new 'static 'hip-mole-event :min-time #x5dc :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #xb) + (new 'static 'hip-mole-event :min-time #x258 :max-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x10e :mode #x9) + (new 'static 'hip-mole-event :min-time #x10e :mode #x9) + (new 'static 'hip-mole-event :min-time #x10e :mode #x8) + (new 'static 'hip-mole-event :min-time #x10e :mode #xb) + (new 'static 'hip-mole-event :min-time #x10e :mode #xa) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #x9) + ) + (new 'static 'boxed-array :type hip-mole-event + (new 'static 'hip-mole-event :min-time #x546 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xa) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xa) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xb) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xa) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xa) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :max-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x1c2 :max-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :max-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x5a :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :max-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :max-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x258 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :max-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :max-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :max-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x10e :mode #x8) + (new 'static 'hip-mole-event :min-time #x10e :mode #xb) + (new 'static 'hip-mole-event :min-time #x10e :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xa) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xb) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x10e :mode #xa) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xb) + (new 'static 'hip-mole-event :min-time #xf0 :mode #xb) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xb) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xb) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xb) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x384 :mode #x9) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #x9) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #x9) + (new 'static 'hip-mole-event :min-time #x41a :mode #x8) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #x9) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #x9) + (new 'static 'hip-mole-event :min-time #x384 :mode #xa) + ) + (new 'static 'boxed-array :type hip-mole-event + (new 'static 'hip-mole-event :min-time #x41a :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x1) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x2) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x3) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x4) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x5) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x6) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x7) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x7) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x6) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x5) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x4) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x3) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x2) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x1) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x7) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x1) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x2) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + ) + (new 'static 'boxed-array :type hip-mole-event + (new 'static 'hip-mole-event :min-time #x2ee :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x168 :mode #x9) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x8) + (new 'static 'hip-mole-event :min-time #x168 :mode #x9) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x8) + (new 'static 'hip-mole-event :min-time #x168 :mode #xa) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x8) + ) + (new 'static 'boxed-array :type hip-mole-event + (new 'static 'hip-mole-event :min-time #x2ee :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x3) + (new 'static 'hip-mole-event :min-time #x12c :mode #x1) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c) + (new 'static 'hip-mole-event :min-time #x12c :mode #x2) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x7) + (new 'static 'hip-mole-event :min-time #x12c :mode #x5) + (new 'static 'hip-mole-event :min-time #x12c :mode #x8) + (new 'static 'hip-mole-event :min-time #x2ee) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x4) + (new 'static 'hip-mole-event :min-time #x2ee :mode #xa) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x2) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x6) + (new 'static 'hip-mole-event :min-time #x2ee :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x3) + (new 'static 'hip-mole-event :min-time #x258 :mode #x1) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #x7) + (new 'static 'hip-mole-event :min-time #x258 :mode #x5) + (new 'static 'hip-mole-event :min-time #x384 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x384 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x384 :mode #x8) + (new 'static 'hip-mole-event :min-time #x258 :mode #x9) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xa) + (new 'static 'hip-mole-event :min-time #x258 :mode #xb) + (new 'static 'hip-mole-event :min-time #x384 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x9) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xb) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #xa5 :mode #xa) + (new 'static 'hip-mole-event :min-time #xa5 :mode #x8) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xa) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #xb) + (new 'static 'hip-mole-event :min-time #x4b0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x546 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + ) + (new 'static 'boxed-array :type hip-mole-event + (new 'static 'hip-mole-event :min-time #x2ee :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #xa) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #xe1 :mode #x8) + (new 'static 'hip-mole-event :min-time #x168 :mode #x9) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x8) + (new 'static 'hip-mole-event :min-time #x168 :mode #x9) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x8) + (new 'static 'hip-mole-event :min-time #x168 :mode #xa) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xb) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x1c2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x177 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x177 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x177 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x177 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x14a :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x14a :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x14a :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x12c :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xf0 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xd2 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #xb4 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #xa) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + (new 'static 'hip-mole-event :min-time #x96 :mode #x9) + (new 'static 'hip-mole-event :min-time #x96 :mode #x8) + ) + ) + ) + ) + +(defskelgroup skel-hip-mole hip-mole 0 3 + ((1 (meters 999999))) + :bounds (static-spherem 0 1 0 1.5) + :origin-joint-index 3 + ) + +(defskelgroup skel-big-bopper big-bopper 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +(deftype hip-mole (process-drawable) + ((cabinet handle :offset-assert 200) + (index int32 :offset-assert 208) + (mode uint8 :offset-assert 212) + (sound-id uint32 :offset-assert 216) + (abort? symbol :offset-assert 220) + ) + :heap-base #x60 + :method-count-assert 22 + :size-assert #xe0 + :flag-assert #x16006000e0 + (:methods + (idle () _type_ :state 20) + (active (time-frame uint) _type_ :state 21) + ) + ) + + +(set! (-> *lightning-spec-id-table* 21) (new 'static 'lightning-spec + :name "lightning-hip-mole-deadly" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.5 + :num-points 32 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 409.6 + :duration 30.0 + :sound (static-sound-spec "shock") + ) + ) + +(defstate idle (hip-mole) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('active) + (go-virtual active (the-as time-frame (-> event param 0)) (-> event param 1)) + ) + ) + ) + :code (behavior () + (setup-masks (-> self draw) 2 1) + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! (-> self draw art-group data 3) :num! min) + (sleep-code) + (none) + ) + :post (behavior () + (let* ((s5-0 (handle->process (-> self cabinet))) + (gp-0 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (when gp-0 + (let* ((v1-4 (-> self index)) + (v1-5 (cond + ((zero? v1-4) + 4 + ) + ((= v1-4 1) + 5 + ) + ((= v1-4 2) + 6 + ) + ((= v1-4 3) + 7 + ) + ((= v1-4 4) + 8 + ) + ((= v1-4 5) + 9 + ) + ((= v1-4 6) + 10 + ) + (else + 11 + ) + ) + ) + ) + (vector<-cspace! (-> self root trans) (-> (the-as process-drawable gp-0) node-list data v1-5)) + ) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable gp-0) root quat)) + ) + ) + (ja-post) + (none) + ) + ) + +(defstate active (hip-mole) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type + (('touch) + (case (-> self mode) + ((10) + (sound-play "whack-wrong") + 'die + ) + ((11) + (sound-play "whack-gold") + (go-virtual idle) + 'gold + ) + (else + (sound-play "whack-hit") + (go-virtual idle) + ) + ) + ) + (('abort) + (let ((v0-2 (the-as object #t))) + (set! (-> self abort?) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + ) + :enter (behavior ((arg0 time-frame) (arg1 uint)) + (set! (-> self mode) arg1) + (case (-> self mode) + ((10) + (set-vector! (-> self draw color-mult) 1.0 0.0 0.0 1.0) + ) + ((11) + (setup-masks (-> self draw) 1 2) + ) + ) + (sound-play "whack-up") + (set! (-> self sound-id) (the-as uint (sound-play "whack-bounce"))) + (set! (-> self abort?) #f) + (none) + ) + :exit (behavior () + (sound-stop (the-as sound-id (-> self sound-id))) + (none) + ) + :trans (behavior () + (case (-> self mode) + ((10) + (when (rand-vu-percent? 0.4) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) + (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) + ) + (+! (-> gp-0 x) (rand-vu-float-range -1638.4 819.2)) + (+! (-> s5-0 x) (rand-vu-float-range -1638.4 819.2)) + (+! (-> gp-0 y) (rand-vu-float-range -1228.8 1228.8)) + (+! (-> s5-0 y) (rand-vu-float-range -1228.8 1228.8)) + (+! (-> gp-0 z) (rand-vu-float-range -1638.4 819.2)) + (+! (-> s5-0 z) (rand-vu-float-range -1638.4 819.2)) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 21) + 0 + #f + #f + gp-0 + s5-0 + :to *entity-pool* + ) + ) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 time-frame) (arg1 uint)) + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.05)) + (let ((s5-0 (-> self clock frame-counter))) + (while (and (< (- (-> self clock frame-counter) s5-0) arg0) (not (-> self abort?))) + (ja :group! (-> self draw art-group data 4) :num! (loop!)) + (suspend) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (sound-play "whack-down") + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (not (-> self abort?)) + (case (-> self mode) + ((10) + ) + (else + (send-event (ppointer->process (-> self parent)) 'done) + ) + ) + ) + (go-virtual idle) + (none) + ) + :post (-> (method-of-type hip-mole idle) post) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior hip-mole-init hip-mole ((arg0 handle) (arg1 int)) + (set! (-> self index) arg1) + (set! (-> self cabinet) arg0) + (set! (-> self abort?) #f) + (set! (-> self level) (level-get *level* 'lwhack)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-mole" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (setup-masks (-> self draw) 2 1) + (go-virtual idle) + (none) + ) + +(deftype whack-a-metal (process-drawable) + ((cabinet handle :offset-assert 200) + (bopper (pointer process) :offset-assert 208) + (mole (pointer hip-mole) 8 :offset-assert 212) + (score-part sparticle-launch-control 2 :offset-assert 244) + (wave int32 :offset-assert 252) + (event int32 :offset-assert 256) + (event-time time-frame :offset-assert 264) + (event-length time-frame :offset-assert 272) + (hud-score handle :offset-assert 280) + (hud-goal handle :offset-assert 288) + (score float :offset-assert 296) + (score-time time-frame :offset-assert 304) + (dizzy? symbol :offset-assert 312) + (miss-count int32 :offset-assert 316) + (air-attack-count int32 :offset-assert 320) + (slot-buffer int32 4 :offset-assert 324) + (speech-time time-frame :offset-assert 344) + (speech-count int32 :offset-assert 352) + (speech-last int32 4 :offset-assert 356) + ) + :heap-base #x100 :method-count-assert 30 :size-assert #x174 :flag-assert #x1e01000174 (:methods - (whack-a-metal-method-21 () none 20) - (whack-a-metal-method-22 () none 21) - (whack-a-metal-method-23 () none 22) - (whack-a-metal-method-24 () none 23) - (whack-a-metal-method-25 () none 24) - (whack-a-metal-method-26 () none 25) - (whack-a-metal-method-27 () none 26) - (whack-a-metal-method-28 () none 27) - (whack-a-metal-method-29 () none 28) - (whack-a-metal-method-30 () none 29) + (hide () _type_ :state 20) + (wait-for-start () _type_ :state 21) + (active (symbol int) _type_ :state 22) + (attack (int) _type_ :state 23) + (lose () _type_ :state 24) + (win () _type_ :state 25) + (whack-a-metal-method-26 (_type_) integer 26) + (whack-a-metal-method-27 (_type_) none 27) + (whack-a-metal-method-28 (_type_) none 28) + (whack-a-metal-method-29 (_type_ int int) int 29) ) ) + + +(defmethod deactivate whack-a-metal ((obj whack-a-metal)) + (dotimes (s5-0 2) + (if (nonzero? (-> obj score-part s5-0)) + (kill-and-free-particles (-> obj score-part s5-0)) + ) + ) + ((the-as (function process none) (find-parent-method whack-a-metal 10)) obj) + (none) + ) + +;; WARN: Return type mismatch process-drawable vs whack-a-metal. +(defmethod relocate whack-a-metal ((obj whack-a-metal) (arg0 int)) + (dotimes (v1-0 2) + (if (nonzero? (-> obj score-part v1-0)) + (&+! (-> obj score-part v1-0) arg0) + ) + ) + (the-as + whack-a-metal + ((the-as (function process-drawable int process-drawable) (find-parent-method whack-a-metal 7)) obj arg0) + ) + ) + +(defmethod whack-a-metal-method-29 whack-a-metal ((obj whack-a-metal) (arg0 int) (arg1 int)) + (let ((v0-1 (mod (+ (-> obj speech-last arg0) (rand-vu-int-range 1 2)) arg1))) + (set! (-> obj speech-last arg0) v0-1) + v0-1 + ) + ) + +;; WARN: Return type mismatch int vs integer. +(defmethod whack-a-metal-method-26 whack-a-metal ((obj whack-a-metal)) + (if (or (-> obj dizzy?) (>= (-> obj miss-count) 20)) + (return (the-as integer -1)) + ) + (let ((v0-0 + (cond + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons up) + ) + 0 + ) + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons right) + ) + 1 + ) + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons down) + ) + 2 + ) + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons left) + ) + 3 + ) + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons triangle) + ) + 4 + ) + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons circle) + ) + 5 + ) + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons x) + ) + 6 + ) + ((logtest? (logior (logior (-> *cpad-list* cpads 0 button0-rel 0) (-> *cpad-list* cpads 0 button0-rel 1)) + (-> *cpad-list* cpads 0 button0-rel 2) + ) + (pad-buttons square) + ) + 7 + ) + (else + -1 + ) + ) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up right down left triangle circle x square)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up right down left triangle circle x square)) + (dotimes (v1-57 4) + (when (< (-> obj slot-buffer v1-57) 0) + (set! (-> obj slot-buffer v1-57) v0-0) + (goto cfg-30) + ) + ) + (label cfg-30) + (if (>= (-> obj slot-buffer 0) 0) + (return (the-as integer (-> obj slot-buffer 0))) + ) + v0-0 + ) + ) + +(defmethod whack-a-metal-method-27 whack-a-metal ((obj whack-a-metal)) + (with-pp + (let ((s4-0 (-> *mole-data* (-> obj wave) (-> obj event))) + (s5-0 #t) + ) + (when (zero? (-> obj event-length)) + (set! (-> obj event-length) + (rand-vu-int-range (the-as int (-> s4-0 min-time)) (the-as int (+ (-> s4-0 min-time) (-> s4-0 max-time)))) + ) + (set! (-> obj event-time) (-> pp clock frame-counter)) + ) + (let ((v1-8 (-> s4-0 mode))) + (cond + ((= v1-8 8) + (set! s5-0 (>= (- (-> pp clock frame-counter) (-> obj event-time)) (-> obj event-length))) + ) + ((or (= v1-8 9) (= v1-8 10) (= v1-8 11)) + (let ((v1-13 (rand-vu-int-range 0 7))) + (let ((s3-0 0)) + (while (let ((a0-20 (-> obj mole v1-13))) + (and (-> (the-as hip-mole (if a0-20 + (the-as hip-mole (-> a0-20 0 self)) + ) + ) + next-state + ) + (let ((a0-26 (-> obj mole v1-13))) + (= (-> (the-as hip-mole (if a0-26 + (the-as hip-mole (-> a0-26 0 self)) + ) + ) + next-state + name + ) + 'active + ) + ) + ) + ) + (set! v1-13 (rand-vu-int-range 0 7)) + (+! s3-0 1) + (if (< 100 s3-0) + (goto cfg-27) + ) + ) + ) + (send-event (ppointer->process (-> obj mole v1-13)) 'active (-> obj event-length) (-> s4-0 mode)) + ) + (label cfg-27) + ) + ((or (zero? v1-8) (= v1-8 1) (= v1-8 2) (= v1-8 3) (= v1-8 4) (= v1-8 5) (= v1-8 6) (= v1-8 7)) + (let ((v1-22 (the-as int (-> s4-0 mode)))) + (let ((s3-1 0)) + (while (let ((a0-49 (-> obj mole v1-22))) + (and (-> (the-as hip-mole (if a0-49 + (the-as hip-mole (-> a0-49 0 self)) + ) + ) + next-state + ) + (let ((a0-55 (-> obj mole v1-22))) + (= (-> (the-as hip-mole (if a0-55 + (the-as hip-mole (-> a0-55 0 self)) + ) + ) + next-state + name + ) + 'active + ) + ) + ) + ) + (set! v1-22 (rand-vu-int-range 0 7)) + (+! s3-1 1) + (if (< 100 s3-1) + (goto cfg-61) + ) + ) + ) + (send-event (ppointer->process (-> obj mole v1-22)) 'active (-> obj event-length) (-> s4-0 mode)) + ) + ) + ) + ) + (label cfg-61) + (when s5-0 + (set! (-> obj event-length) 0) + (+! (-> obj event) 1) + (when (>= (-> obj event) (-> *mole-data* (-> obj wave) length)) + (set! (-> obj event) 0) + (+! (-> obj wave) 1) + (if (>= (-> obj wave) (-> *mole-data* length)) + (set! (-> obj wave) (+ (-> *mole-data* length) -1)) + ) + ) + ) + ) + (when (>= (- (-> pp clock frame-counter) (-> obj speech-time)) (seconds 15)) + (if (nonzero? (cond + ((= (-> obj speech-count) 1) + 0 + ) + ((>= (-> obj score) 1300.0) + (set! (-> obj speech-count) 1) + (let ((v1-50 (whack-a-metal-method-29 obj 0 3))) + (cond + ((zero? v1-50) + (talker-spawn-func (-> *talker-speech* 430) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-50 1) + (talker-spawn-func (-> *talker-speech* 431) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (else + (talker-spawn-func (-> *talker-speech* 432) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (else + (let ((v1-55 (whack-a-metal-method-29 obj 1 20))) + (cond + ((zero? v1-55) + (talker-spawn-func (-> *talker-speech* 395) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 1) + (talker-spawn-func (-> *talker-speech* 396) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 2) + (talker-spawn-func (-> *talker-speech* 397) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 3) + (talker-spawn-func (-> *talker-speech* 398) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 4) + (talker-spawn-func (-> *talker-speech* 401) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 5) + (talker-spawn-func (-> *talker-speech* 403) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 6) + (talker-spawn-func (-> *talker-speech* 404) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 7) + (talker-spawn-func (-> *talker-speech* 405) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 8) + (talker-spawn-func (-> *talker-speech* 406) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 9) + (talker-spawn-func (-> *talker-speech* 407) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 10) + (talker-spawn-func (-> *talker-speech* 408) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 11) + (talker-spawn-func (-> *talker-speech* 409) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 12) + (talker-spawn-func (-> *talker-speech* 410) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 13) + (talker-spawn-func (-> *talker-speech* 411) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 14) + (talker-spawn-func (-> *talker-speech* 412) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 15) + (talker-spawn-func (-> *talker-speech* 413) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 16) + (talker-spawn-func (-> *talker-speech* 414) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 17) + (talker-spawn-func (-> *talker-speech* 415) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-55 18) + (talker-spawn-func (-> *talker-speech* 416) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (else + (talker-spawn-func (-> *talker-speech* 417) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + ) + ) + (set! (-> obj speech-time) (-> pp clock frame-counter)) + ) + ) + (whack-a-metal-method-28 obj) + 0 + (none) + ) + ) + +(defmethod whack-a-metal-method-28 whack-a-metal ((obj whack-a-metal)) + (with-pp + (cond + ((>= (-> *game-info* score) (-> obj score)) + (set! (-> *game-info* score) (-> obj score)) + ) + ((and (< (-> *game-info* score) (-> obj score)) + (>= (- (-> pp clock frame-counter) (-> obj score-time)) (seconds 0.1)) + ) + (sound-play "whack-score") + (seek! (-> *game-info* score) (-> obj score) 2.0) + (set! (-> obj score-time) (-> pp clock frame-counter)) + ) + ) + (let ((s5-1 (handle->process (-> obj cabinet)))) + (when s5-1 + (spawn-with-matrix (-> obj score-part 1) (-> (the-as process-drawable s5-1) node-list data 13 bone transform)) + (spawn-with-matrix (-> obj score-part 0) (-> (the-as process-drawable s5-1) node-list data 12 bone transform)) + (dotimes (s4-1 (- 20 (-> obj miss-count))) + (set! (-> *part-id-table* 3336 init-specs 2 initial-valuef) (+ -1228.8 (* 614.4 (the float (mod s4-1 5))))) + (set! (-> *part-id-table* 3336 init-specs 2 random-rangef) 0.0) + (set! (-> *part-id-table* 3336 init-specs 3 initial-valuef) (- 921.6 (* 614.4 (the float (/ s4-1 5))))) + (set! (-> *part-id-table* 3336 init-specs 3 random-rangef) 0.0) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 3336) + (-> (the-as process-drawable s5-1) node-list data 12 bone transform) + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defstate hide (whack-a-metal) + :virtual #t + :code (behavior () + (ja-channel-set! 0) + (ja-post) + (sleep-code) + (none) + ) + ) + +(defstate wait-for-start (whack-a-metal) + :virtual #t + :code (behavior () + (while (or (not *target*) (not (process-grab? *target* #f))) + (suspend) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'draw) + (set! (-> a1-1 param 0) (the-as uint #f)) + (send-event-function *target* a1-1) + (go-virtual active #t (the-as int a1-1)) + ) + (none) + ) + ) + +(defstate active (whack-a-metal) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('done) + (let ((v0-0 (+ (-> self miss-count) 1))) + (set! (-> self miss-count) v0-0) + v0-0 + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol) (arg1 int)) + (when arg0 + (set! (-> *game-info* score) 0.0) + (sound-play "whack-start") + (add-setting! 'music 'danger3 0 0) + (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0 0) + (set! (-> self bopper) (process-spawn + manipy + :init manipy-init + (-> self root trans) + (entity-by-name "tess-npc-3") + (art-group-get-by-name *level* "skel-big-bopper" (the-as (pointer uint32) #f)) + #f + 0 + :name "big-bopper" + :to self + ) + ) + (send-event (ppointer->process (-> self bopper)) 'anim-mode 'clone-anim) + (set-setting! 'airlock #f 0 0) + (set-setting! 'borrow '((ctywide 1 lwidea #f) (hiphog 0 lwhack special)) 0 0) + (want-display-level *load-state* 'ctyport #f) + (want-display-level *load-state* 'ctywide #f) + (set! (-> self speech-time) (-> self clock frame-counter)) + (if (not (task-node-closed? (game-task-node city-whack-resolution))) + (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) + ) + ) + (none) + ) + :exit (behavior () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'active) (= v1-3 'attack) (= v1-3 'win) (= v1-3 'lose)) + ) + ) + ) + (game-info-method-28 *game-info* (game-score whack) (-> self score)) + (remove-setting! 'music) + (let ((a0-7 (handle->process (-> self hud-score)))) + (if a0-7 + (deactivate a0-7) + ) + ) + (send-event (handle->process (-> self hud-goal)) 'hide-and-die) + (remove-setting! 'entity-name) + (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (process-release? *target*) + ) + (send-event *target* 'draw #t) + (let ((v1-32 (-> self bopper))) + (if v1-32 + (deactivate (-> v1-32 0)) + ) + ) + (remove-setting! 'airlock) + (remove-setting! 'borrow) + (want-display-level *load-state* 'ctyport 'display) + (want-display-level *load-state* 'ctywide 'display) + ) + (none) + ) + :trans (behavior () + (cond + ((or (and *cheat-mode* (cpad-pressed? 0 l1)) (>= (-> self miss-count) 20)) + (go-virtual lose) + ) + ((or (and *cheat-mode* (cpad-pressed? 0 r1)) + (and (>= (-> self score) 1500.0) (not (task-node-closed? (game-task-node city-whack-resolution)))) + ) + (go-virtual win) + ) + ) + (let ((a0-10 (whack-a-metal-method-26 self))) + (if (>= (the-as int a0-10) 0) + (go-virtual attack (the-as int a0-10)) + ) + ) + (logclear! + (-> *cpad-list* cpads 0 button0-abs 0) + (pad-buttons up right down left l1 r1 triangle circle x square) + ) + (logclear! + (-> *cpad-list* cpads 0 button0-rel 0) + (pad-buttons up right down left l1 r1 triangle circle x square) + ) + (none) + ) + :code (behavior ((arg0 symbol) (arg1 int)) + (local-vars + (sv-48 whack-a-metal) + (sv-64 (function vector cspace vector)) + (sv-80 vector) + (sv-96 vector) + (sv-112 (function vector cspace vector)) + (sv-128 vector) + ) + (let ((gp-0 (cond + ((>= (-> self air-attack-count) 10) + (-> self draw art-group data 14) + ) + (#f + (-> self draw art-group data 13) + ) + (else + (-> self draw art-group data 4) + ) + ) + ) + ) + (set! (-> self air-attack-count) 0) + (when (-> self dizzy?) + (sound-play "whack-dizzy") + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 16) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (rand-vu-percent? 0.2) + (let* ((gp-2 (get-process *default-dead-pool* lightning-tracker #x4000)) + (v1-26 + (when gp-2 + (let ((t9-6 (method-of-type lightning-tracker activate))) + (t9-6 + (the-as lightning-tracker gp-2) + self + (symbol->string (-> lightning-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((s5-1 run-function-in-process) + (s4-0 gp-2) + (s3-0 lightning-tracker-init) + (s2-0 (-> *lightning-spec-id-table* 21)) + (s1-0 0) + (s0-0 lightning-probe-callback) + ) + (set! sv-48 self) + (set! sv-64 vector<-cspace!) + (set! sv-80 (new 'stack-no-clear 'vector)) + (let ((a1-9 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1))))) + (set! sv-96 (sv-64 sv-80 a1-9)) + ) + (set! sv-112 vector<-cspace!) + (set! sv-128 (new 'stack-no-clear 'vector)) + (let* ((a1-11 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (t3-0 (sv-112 sv-128 a1-11)) + ) + ((the-as (function object object object object object object object object none) s5-1) + s4-0 + s3-0 + s2-0 + s1-0 + s0-0 + sv-48 + sv-96 + t3-0 + ) + ) + ) + (-> gp-2 ppointer) + ) + ) + ) + (when v1-26 + (set! (-> (the-as lightning-tracker (-> v1-26 0)) user-time 0) 0) + 0 + ) + ) + ) + (+! (-> self event-time) (- (-> self clock frame-counter) (-> self clock old-frame-counter))) + (ja-blend-eval) + (suspend) + (ja :num! (seek!)) + ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 770) + 0 + #f + #f + self + 9 + :to *entity-pool* + ) + (ja-no-eval :group! (-> self draw art-group data 17) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (+! (-> self event-time) (- (-> self clock frame-counter) (-> self clock old-frame-counter))) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self dizzy?) #f) + (dotimes (v1-85 4) + (set! (-> self slot-buffer v1-85) -1) + ) + (ja-no-eval :group! (-> self draw art-group data 18) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 18)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (+! (-> self event-time) (- (-> self clock frame-counter) (-> self clock old-frame-counter))) + (suspend) + (ja :num! (seek!)) + ) + (set! gp-0 (-> self draw art-group data 15)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! gp-0 :num! (identity (ja-aframe 8.0 0))) + (until #f + (ja :group! gp-0 :num! (loop!)) + (ja-blend-eval) + (suspend) + ) + ) + #f + (none) + ) + :post (behavior () + (whack-a-metal-method-27 self) + (ja-post) + (none) + ) + ) + +(defstate attack (whack-a-metal) + :virtual #t + :event (-> (method-of-type whack-a-metal active) event) + :exit (-> (method-of-type whack-a-metal active) exit) + :code (behavior ((arg0 int)) + (sound-play "whack-swish") + (set! (-> self state-time) (-> self clock frame-counter)) + (dotimes (v1-3 3) + (set! (-> self slot-buffer v1-3) (-> self slot-buffer (+ v1-3 1))) + ) + (set! (-> self slot-buffer 3) -1) + (+! (-> self air-attack-count) 1) + (let* ((v1-9 arg0) + (s5-1 (cond + ((zero? v1-9) + (-> self draw art-group data 5) + ) + ((= v1-9 1) + (-> self draw art-group data 7) + ) + ((= v1-9 2) + (-> self draw art-group data 8) + ) + ((= v1-9 3) + (-> self draw art-group data 6) + ) + ((= v1-9 4) + (-> self draw art-group data 9) + ) + ((= v1-9 5) + (-> self draw art-group data 11) + ) + ((= v1-9 6) + (-> self draw art-group data 12) + ) + (else + (-> self draw art-group data 10) + ) + ) + ) + (v1-28 (ja-group)) + (f30-0 (cond + ((and v1-28 (= v1-28 (-> self draw art-group data 4))) + 0.0 + ) + ((>= (ja-aframe-num 0) 22.0) + 0.0 + ) + (else + 6.0 + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! s5-1 :num! (seek! (ja-aframe 10.0 0)) :frame-num (ja-aframe f30-0 0)) + ) + (until (ja-done? 0) + (ja-blend-eval) + (whack-a-metal-method-26 self) + (suspend) + (ja :num! (seek! (ja-aframe 10.0 0))) + ) + ((lambda :behavior whack-a-metal + ((arg0 int)) + (let ((gp-0 (matrix-rotate-y! (new 'stack-no-clear 'matrix) -26396.445))) + (let ((a1-2 (matrix-rotate-x! (new 'stack-no-clear 'matrix) 3640.889))) + (matrix*! gp-0 a1-2 gp-0) + ) + (set! (-> gp-0 trans quad) (-> self mole arg0 0 root trans quad)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'touch) + (case (send-event-function (ppointer->process (-> self mole arg0)) a1-3) + (('die) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 769) + 0 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + (dotimes (v1-15 4) + (set! (-> self slot-buffer v1-15) -1) + ) + (set! (-> self dizzy?) #t) + (+! (-> self miss-count) 2) + (let* ((a0-18 self) + (t9-7 (method-of-object a0-18 whack-a-metal-method-29)) + (a1-9 (the-as object 2)) + ) + (let ((v1-22 (t9-7 a0-18 (the-as int a1-9) 12))) + (cond + ((zero? v1-22) + (let ((gp-1 talker-spawn-func) + (s5-2 (-> *talker-speech* 418)) + ) + (set! a1-9 *entity-pool*) + (gp-1 s5-2 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 1) + (let ((gp-2 talker-spawn-func) + (s5-3 (-> *talker-speech* 419)) + ) + (set! a1-9 *entity-pool*) + (gp-2 s5-3 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 2) + (let ((gp-3 talker-spawn-func) + (s5-4 (-> *talker-speech* 420)) + ) + (set! a1-9 *entity-pool*) + (gp-3 s5-4 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 3) + (let ((gp-4 talker-spawn-func) + (s5-5 (-> *talker-speech* 421)) + ) + (set! a1-9 *entity-pool*) + (gp-4 s5-5 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 4) + (let ((gp-5 talker-spawn-func) + (s5-6 (-> *talker-speech* 422)) + ) + (set! a1-9 *entity-pool*) + (gp-5 s5-6 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 5) + (let ((gp-6 talker-spawn-func) + (s5-7 (-> *talker-speech* 423)) + ) + (set! a1-9 *entity-pool*) + (gp-6 s5-7 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 6) + (let ((gp-7 talker-spawn-func) + (s5-8 (-> *talker-speech* 424)) + ) + (set! a1-9 *entity-pool*) + (gp-7 s5-8 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 7) + (let ((gp-8 talker-spawn-func) + (s5-9 (-> *talker-speech* 425)) + ) + (set! a1-9 *entity-pool*) + (gp-8 s5-9 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 8) + (let ((gp-9 talker-spawn-func) + (s5-10 (-> *talker-speech* 426)) + ) + (set! a1-9 *entity-pool*) + (gp-9 s5-10 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 9) + (let ((gp-10 talker-spawn-func) + (s5-11 (-> *talker-speech* 427)) + ) + (set! a1-9 *entity-pool*) + (gp-10 s5-11 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 10) + (let ((gp-11 talker-spawn-func) + (s5-12 (-> *talker-speech* 428)) + ) + (set! a1-9 *entity-pool*) + (gp-11 s5-12 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ((= v1-22 11) + (let ((gp-12 talker-spawn-func) + (s5-13 (-> *talker-speech* 429)) + ) + (set! a1-9 *entity-pool*) + (gp-12 s5-13 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) + ) + ) + ) + ) + (dotimes (gp-13 8) + (set! a1-9 (new 'stack-no-clear 'event-message-block)) + (set! (-> (the-as event-message-block a1-9) from) (process->ppointer self)) + (set! (-> (the-as event-message-block a1-9) num-params) 0) + (set! (-> (the-as event-message-block a1-9) message) 'abort) + (send-event-function (ppointer->process (-> self mole gp-13)) (the-as event-message-block a1-9)) + ) + (go-virtual active #f (the-as int a1-9)) + ) + ) + ((#f) + (sound-play "whack-miss") + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 767) + 0 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + ) + (('gold) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 768) + 0 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + (set! (-> self score) (+ 50.0 (-> self score))) + ) + (else + (when (>= (- (-> self clock frame-counter) (-> self speech-time)) (seconds 12)) + (let ((v1-78 (whack-a-metal-method-29 self 3 3))) + (cond + ((zero? v1-78) + (talker-spawn-func (-> *talker-speech* 399) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-78 1) + (talker-spawn-func (-> *talker-speech* 400) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (else + (talker-spawn-func (-> *talker-speech* 402) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (set! (-> self speech-time) (-> self clock frame-counter)) + ) + (process-spawn + part-tracker + :init part-tracker-init + (-> *part-group-id-table* 768) + 0 + #f + #f + #f + gp-0 + :to *entity-pool* + ) + (set! (-> self score) (+ 10.0 (-> self score))) + (if (>= (-> self score) 300.0) + (send-event (handle->process (-> self hud-goal)) 'hide-and-die) + ) + ) + ) + ) + ) + (none) + ) + arg0 + ) + (let ((a0-28 (-> self skel root-channel 0))) + (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group frames num-frames) -1))) + (set! (-> a0-28 param 1) 1.0) + (let ((t9-13 joint-control-channel-group!) + (a1-9 #f) + ) + (t9-13 a0-28 (the-as art-joint-anim a1-9) num-func-seek!) + (while (not (ja-done? 0)) + (let ((gp-1 (whack-a-metal-method-26 self))) + (when (>= (the-as int gp-1) 0) + (if (>= (ja-aframe-num 0) 12.0) + (go-virtual attack (the-as int gp-1)) + ) + ) + ) + (suspend) + (ja-eval) + ) + (go-virtual active #f (the-as int a1-9)) + ) + ) + (none) + ) + :post (-> (method-of-type whack-a-metal active) post) + ) + +(defstate lose (whack-a-metal) + :virtual #t + :exit (-> (method-of-type whack-a-metal active) exit) + :code (behavior () + (auto-save-user) + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 (-> self draw art-group data 14)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 14)) + ) + ) + (let* ((v1-9 (rand-vu-int-count 8)) + (gp-1 (cond + ((zero? v1-9) + (talker-spawn-func (-> *talker-speech* 441) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 1) + (talker-spawn-func (-> *talker-speech* 442) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 2) + (talker-spawn-func (-> *talker-speech* 443) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 3) + (talker-spawn-func (-> *talker-speech* 444) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 4) + (talker-spawn-func (-> *talker-speech* 445) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 5) + (talker-spawn-func (-> *talker-speech* 446) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 6) + (talker-spawn-func (-> *talker-speech* 447) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (else + (talker-spawn-func (-> *talker-speech* 448) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (s5-8 (-> self clock frame-counter)) + ) + (while (or (nonzero? (get-status *gui-control* (the-as sound-id gp-1))) + (< (- (-> self clock frame-counter) s5-8) (seconds 2)) + ) + (suspend) + (ja :num! (loop!)) + ) + ) + (let* ((v1-32 (-> *game-info* sub-task-list 226)) + (v1-34 (if (-> v1-32 info) + (-> v1-32 info manager) + (the-as handle #f) + ) + ) + ) + (cond + ((handle->process v1-34) + (send-event (handle->process v1-34) 'fail) + (sleep-code) + ) + (else + (ja-channel-set! 0) + (ja-post) + (set-blackout-frames (seconds 0.2)) + ) + ) + ) + (none) + ) + :post (behavior () + (whack-a-metal-method-28 self) + (ja-post) + (none) + ) + ) + +(defstate win (whack-a-metal) + :virtual #t + :exit (-> (method-of-type whack-a-metal active) exit) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 (-> self draw art-group data 13)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 13)) + ) + ) + (let* ((v1-9 (rand-vu-int-count 8)) + (gp-1 (cond + ((zero? v1-9) + (talker-spawn-func (-> *talker-speech* 433) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 1) + (talker-spawn-func (-> *talker-speech* 434) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 2) + (talker-spawn-func (-> *talker-speech* 435) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 3) + (talker-spawn-func (-> *talker-speech* 436) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 4) + (talker-spawn-func (-> *talker-speech* 437) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 5) + (talker-spawn-func (-> *talker-speech* 438) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-9 6) + (talker-spawn-func (-> *talker-speech* 439) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (else + (talker-spawn-func (-> *talker-speech* 440) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + ) + (s5-8 (-> self clock frame-counter)) + ) + (while (or (nonzero? (get-status *gui-control* (the-as sound-id gp-1))) + (< (- (-> self clock frame-counter) s5-8) (seconds 2)) + ) + (suspend) + (ja :num! (loop!)) + ) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 0) + (set! (-> a1-11 message) 'complete) + (let ((t9-20 send-event-function) + (v1-34 (-> *game-info* sub-task-list 226)) + ) + (t9-20 + (handle->process (if (-> v1-34 info) + (-> v1-34 info manager) + (the-as handle #f) + ) + ) + a1-11 + ) + ) + ) + (ja-channel-set! 0) + (ja-post) + (set-blackout-frames (seconds 0.2)) + (none) + ) + :post (-> (method-of-type whack-a-metal lose) post) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior whack-a-metal-init whack-a-metal ((arg0 entity-actor)) + (set! (-> self entity) arg0) + (set! (-> self level) (level-get *level* 'hiphog)) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-sidekick-highres" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> self skel status) (joint-control-status blend-shape eye-anim)) + (set! (-> self hud-score) (the-as handle #f)) + (set! (-> self hud-goal) (the-as handle #f)) + (let ((a0-7 (-> arg0 extra process))) + (set! (-> self cabinet) (if a0-7 + (process->handle a0-7) + (the-as handle #f) + ) + ) + ) + (dotimes (gp-1 8) + (set! (-> self mole gp-1) (process-spawn hip-mole :init hip-mole-init (-> self cabinet) gp-1 :to self)) + ) + (set! (-> self dizzy?) #f) + (dotimes (v1-20 4) + (set! (-> self slot-buffer v1-20) -1) + ) + (set! (-> self score-part 0) (create-launch-control (-> *part-group-id-table* 765) self)) + (set! (-> self score-part 1) (create-launch-control (-> *part-group-id-table* 766) self)) + (set! (-> *game-info* goal) 1500.0) + (dotimes (v1-31 4) + (set! (-> self speech-last v1-31) 0) + ) + (go-virtual wait-for-start) + (none) + ) + +(set-subtask-hook! + *game-info* + 226 + 0 + (lambda :behavior whack-a-metal () (let ((gp-0 (entity-by-name "hip-whack-a-metal-2"))) + (if gp-0 + (process-spawn whack-a-metal :init whack-a-metal-init gp-0 :to self) + ) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/characters/ashelin/ash-h_REF.gc b/test/decompiler/reference/jak2/characters/ashelin/ash-h_REF.gc new file mode 100644 index 0000000000..e291b8343a --- /dev/null +++ b/test/decompiler/reference/jak2/characters/ashelin/ash-h_REF.gc @@ -0,0 +1,168 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ashelin-course +(deftype ashelin-course (bot-course) + ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) + (victory-speeches bot-speech-list-shuffle :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + +;; definition for method 3 of type ashelin-course +(defmethod inspect ashelin-course ((obj ashelin-course)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) + (format #t "~1Tspots: #x~X~%" (-> obj spots)) + (format #t "~1Touch-speeches: ~A~%" (-> obj ouch-speeches)) + (format #t "~1Tvictory-speeches: ~A~%" (-> obj victory-speeches)) + (label cfg-4) + obj + ) + +;; definition of type ashelin +(deftype ashelin (bot) + ((ash-course ashelin-course :offset 652) + (knocked-anim art-joint-anim :offset-assert 992) + (travel-anim-interp float :offset-assert 996) + (fired-gun-count uint32 :offset-assert 1000) + (last-fire-time time-frame :offset-assert 1008) + (victory-speech-time time-frame :offset-assert 1016) + (frontline plane :inline :offset-assert 1024) + ) + :heap-base #x390 + :method-count-assert 251 + :size-assert #x410 + :flag-assert #xfb03900410 + (:methods + (back-spring () _type_ :state 225) + (cartwheel-left () _type_ :state 226) + (tumble-right () _type_ :state 227) + (chase () _type_ :state 228) + (traveling () _type_ :state 229) + (traveling-blocked () _type_ :state 230) + (waiting-idle () _type_ :state 231) + (standing-idle () _type_ :state 232) + (standing-turn () _type_ :state 233) + (standing-blast () _type_ :state 234) + (ashelin-method-235 (_type_ symbol) symbol 235) + (ashelin-method-236 (_type_ vector float float float float) symbol 236) + (fire-projectile (_type_ vector) none 237) + (ashelin-method-238 (_type_ symbol symbol) symbol 238) + (ashelin-method-239 (_type_) none 239) + (ashelin-method-240 (_type_ int) none 240) + (ashelin-method-241 (_type_) int 241) + (ashelin-method-242 (_type_) int 242) + (ashelin-method-243 (_type_ float) int 243) + (ashelin-method-244 (_type_) none 244) + (ashelin-method-245 (_type_) none 245) + (ashelin-method-246 (_type_) int 246) + (ashelin-method-247 (_type_) symbol 247) + (ashelin-method-248 (_type_) symbol 248) + (ashelin-method-249 (_type_) none 249) + (ashelin-method-250 (_type_ symbol) none 250) + ) + ) + +;; definition for method 3 of type ashelin +(defmethod inspect ashelin ((obj ashelin)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bot inspect))) + (t9-0 obj) + ) + (format #t "~2Tknocked-anim: ~A~%" (-> obj knocked-anim)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) + (format #t "~2Tfired-gun-count: ~D~%" (-> obj fired-gun-count)) + (format #t "~2Tlast-fire-time: ~D~%" (-> obj last-fire-time)) + (format #t "~2Tvictory-speech-time: ~D~%" (-> obj victory-speech-time)) + (format #t "~2Tfrontline: #~%" (-> obj frontline)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-ashelin ashelin ashelin-lod0-jg ashelin-idle0-ja + ((ashelin-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.7) + :shadow ashelin-shadow-mg + :origin-joint-index 13 + ) + +;; definition of type asht-wait-spot +(deftype asht-wait-spot (ai-task) + ((check-done (function asht-wait-spot ashelin symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 6 :offset 38) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type asht-wait-spot +(defmethod inspect asht-wait-spot ((obj asht-wait-spot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (label cfg-4) + obj + ) + +;; definition of type asht-fight-focus +(deftype asht-fight-focus (ai-task) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type asht-fight-focus +(defmethod inspect asht-fight-focus ((obj asht-fight-focus)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/characters/ashelin/ash-states_REF.gc b/test/decompiler/reference/jak2/characters/ashelin/ash-states_REF.gc new file mode 100644 index 0000000000..73a88f7cfa --- /dev/null +++ b/test/decompiler/reference/jak2/characters/ashelin/ash-states_REF.gc @@ -0,0 +1,1180 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate waiting-idle (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + 0 + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 3))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 (-> self draw art-group data 29))) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + (ja-no-eval :group! (-> self draw art-group data 30) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (let ((v1-55 (ja-group))) + (cond + ((and v1-55 (= v1-55 (-> self draw art-group data 30))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 3) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate standing-idle (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (none) + ) + :trans (behavior () + (bot-method-223 self #t) + (cond + ((bot-method-214 self) + (cond + ((ashelin-method-238 self #t #t) + (when (and (ashelin-method-235 self #t) (let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 (-> self draw art-group data 29))) + ) + ) + (cond + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ((ashelin-method-235 self #f) + (go-virtual standing-blast) + ) + (else + (let ((a1-4 (ashelin-method-242 self))) + (if (nonzero? a1-4) + (ashelin-method-240 self a1-4) + ) + ) + ) + ) + ) + (let ((a1-5 (ashelin-method-246 self))) + (cond + ((nonzero? a1-5) + (ashelin-method-240 self a1-5) + ) + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ) + ) + ) + (else + (let ((a1-6 (ashelin-method-246 self))) + (cond + ((nonzero? a1-6) + (ashelin-method-240 self a1-6) + ) + (else + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (ashelin-method-247 self) + ) + (go-virtual chase) + ) + ) + ) + ) + ) + ) + (when (logtest? (bot-flags bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (let ((a1-7 (ashelin-method-241 self))) + (if (nonzero? a1-7) + (ashelin-method-240 self a1-7) + ) + ) + ) + ) + (else + (if (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (ashelin-method-239 self) + ) + ) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 29))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (or (= v1-16 (-> self draw art-group data 27)) + (= v1-16 (-> self draw art-group data 31)) + (= v1-16 (-> self draw art-group data 32)) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + ((let ((v1-31 (ja-group))) + (and v1-31 (= v1-31 (-> self draw art-group data 3))) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 27) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 29) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate standing-turn (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (bot-method-214 self) + (let ((a1-1 (ashelin-method-246 self))) + (if (nonzero? a1-1) + (ashelin-method-240 self a1-1) + ) + ) + (when (logtest? (bot-flags bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flags bf21)) + (let ((a1-2 (ashelin-method-241 self))) + (if (nonzero? a1-2) + (ashelin-method-240 self a1-2) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) + (let ((s5-0 (-> self focus-info fproc))) + (if (not s5-0) + (ashelin-method-239 self) + ) + (turn-to-target self gp-0 s5-0 0.335) + ) + (let ((s4-0 (-> self draw art-group data (if (>= (-> gp-0 predicted-ry-diff) 0.0) + 31 + 32 + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-1 (new 'stack-no-clear 'quaternion)) + (f0-1 (-> gp-0 predicted-ry-diff)) + (f30-0 0.0) + (f28-0 10.0) + ) + (quaternion-rotate-y! s5-1 (-> gp-0 src-quat) f0-1) + (ja-no-eval :group! s4-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)) 2.0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((f0-6 (ja-aframe-num 0))) + (cond + ((< f0-6 f28-0) + (if (>= f0-6 f30-0) + (quaternion-slerp! (-> self root-override2 quat) (-> gp-0 src-quat) s5-1 (/ (- f0-6 f30-0) (- f28-0 f30-0))) + ) + ) + (else + (quaternion-copy! (-> self root-override2 quat) s5-1) + ) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + ) + ) + (go-virtual standing-idle) + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate traveling (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info-override callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-5 enemy-flags)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-165 self) + (set! (-> self player-blocking) 0.0) + (none) + ) + :trans (behavior () + (if (logtest? (-> self focus-status) (focus-status grabbed)) + (go-virtual waiting-idle) + ) + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) + (ashelin-method-239 self) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + (go-virtual traveling-blocked) + ) + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ) + 0 + (none) + ) + :code (behavior () + (until #f + (ashelin-method-249 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self spot)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 center quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate traveling-blocked (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + (go-virtual traveling) + ) + ) + (none) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate stare (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (when (bot-method-214 self) + (if (ashelin-method-238 self #t #f) + (go-virtual standing-idle) + ) + ) + (if (not (nav-enemy-method-163 self)) + (go-virtual traveling) + ) + ) + (none) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + ) + +;; failed to figure out what this is: +(defstate standing-blast (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (if (not (handle->process (-> self focus handle))) + (enemy-method-72 self) + ) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (none) + ) + :code (behavior () + (bot-method-223 self #t) + (if (or (not (bot-method-214 self)) (not (ashelin-method-235 self #f))) + (enemy-method-72 self) + ) + (let ((v1-12 (ja-group))) + (if (and v1-12 (or (= v1-12 (-> self draw art-group data 29)) (= v1-12 (-> self draw art-group data 28)))) + (ja-channel-push! 1 (seconds 0.03)) + (ja-channel-push! 1 (seconds 0.08)) + ) + ) + (let ((gp-0 #f)) + (ja-no-eval :group! (-> self draw art-group data 28) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (and (not gp-0) (>= (ja-aframe-num 0) 7.0)) + (set! gp-0 #t) + (fire-projectile self (-> self focus-info bullseye)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (cond + ((logtest? (-> self bot-flags) (bot-flags attacked)) + (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) + (reset-attacker! self) + ) + ((logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) + (ashelin-method-245 self) + ) + ) + (enemy-method-72 self) + (none) + ) + :post (the-as (function none :behavior ashelin) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate chase (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (nav-enemy-method-166 self) + (none) + ) + :trans (behavior () + (bot-method-223 self #t) + (cond + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ((not (bot-method-214 self)) + (go-virtual traveling) + ) + ) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + (if (or (ashelin-method-238 self #t #f) (ashelin-method-248 self)) + (go-virtual standing-idle) + ) + ) + (let ((gp-0 (-> self nav))) + (set! (-> gp-0 target-speed) (lerp-scale + (-> self enemy-info-override walk-travel-speed) + (-> self enemy-info-override run-travel-speed) + (-> self focus-info bullseye-xz-dist) + 81920.0 + 92160.0 + ) + ) + ) + 0 + (none) + ) + :code (behavior () + (until #f + (ashelin-method-249 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-6 (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate back-spring (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-167 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override2 trans) (-> self move-dest)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root-override2 quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (ja-no-eval :group! (-> self draw art-group data 33) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (quaternion-slerp! (-> self root-override2 quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-30 *game-info*) + (a0-11 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-11) + (set! (-> self attack-id) a0-11) + ) + (countdown (s5-1 2) + (vector-! gp-1 (-> self move-dest) (-> self root-override2 trans)) + (let ((a0-14 (-> self nav state)) + (v1-33 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-33 quad)) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 acceleration) 1638400.0) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-40 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-40 enemy-flags))) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-40 enemy-flags)))) + ) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-40 enemy-flags)))) + (set! (-> v1-40 nav callback-info) (-> v1-40 enemy-info-override callback-info)) + ) + 0 + (let ((f0-13 (* 1.6153771 (vector-length gp-1)))) + (let ((v1-46 (-> self nav))) + (set! (-> v1-46 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 34) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) frames num-frames) -1)) 1.4) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-12 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-12 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-negate! gp-1 gp-1) + (quaternion-set! (-> self root-override2 quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root-override2 quat)) + (suspend) + (ja :num! (seek! max 1.4)) + ) + (bot-method-223 self #f) + (if (or (not (bot-method-214 self)) (!= (ashelin-method-246 self) 1)) + (goto cfg-15) + ) + ) + ) + (label cfg-15) + (let ((v1-92 self)) + (set! (-> v1-92 enemy-flags) (the-as enemy-flag (logclear (-> v1-92 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-92 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! (-> self draw art-group data 35) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate cartwheel-left (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-167 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root-override2 trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root-override2 quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 -16384.0) + (ja-no-eval :group! (-> self draw art-group data 36) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 36)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (quaternion-slerp! (-> self root-override2 quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info-override callback-info)) + ) + 0 + (let ((f0-13 (* 1.0714335 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 37) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 37)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 -16384.0) + (quaternion-set! (-> self root-override2 quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root-override2 quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-78 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! (-> self draw art-group data 38) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 38)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate tumble-right (ashelin) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior ashelin) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-167 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root-override2 trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root-override2 quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 16384.0) + (ja-no-eval :group! (-> self draw art-group data 39) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 39)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (quaternion-slerp! (-> self root-override2 quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info-override callback-info)) + ) + 0 + (let ((f0-13 (* 1.8749386 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! (-> self draw art-group data 40) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 40)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 16384.0) + (quaternion-set! (-> self root-override2 quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root-override2 quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-78 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! (-> self draw art-group data 41) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 41)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hit (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + 0 + (none) + ) + :code (behavior () + (local-vars (v1-7 enemy-flag) (v1-15 enemy-flag)) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? v1-6 (enemy-flag checking-water)) + (set! v1-7 (logior v1-6 (enemy-flag enable-on-active))) + (set! v1-7 (logclear v1-6 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-7) + (if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> self mask) (logior (process-mask collectable) (-> self mask))) + (logclear! (-> self mask) (process-mask collectable)) + ) + (let ((v1-14 (-> self enemy-flags))) + (if (logtest? (enemy-flag no-initial-move-to-ground) v1-14) + (set! v1-15 (logior (enemy-flag check-water-backup) v1-14)) + (set! v1-15 (logclear v1-14 (enemy-flag check-water-backup))) + ) + ) + (set! (-> self enemy-flags) v1-15) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> self focus-status) (focus-status hit)) + (enemy-method-72 self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (ashelin) + :virtual #t + :enter (behavior () + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + (let ((t9-0 (-> (method-of-type bot knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self bot-flags) (bot-flags bf23)) + (when (and (nonzero? (-> self hit-points)) (zero? (-> self fated-time))) + (if (logtest? (-> self bot-flags) (bot-flags bf04)) + (logior! (-> self bot-flags) (bot-flags bf12)) + (set! (-> self bot-flags) (logior (bot-flags bf23) (-> self bot-flags))) + ) + ) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type bot knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (bot-flags bf23) (-> self bot-flags)) (!= (-> self state-time) (-> self clock frame-counter))) + (logclear! (-> self bot-flags) (bot-flags bf23)) + (ashelin-method-244 self) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die-falling (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :code (behavior () + (let ((v1-1 (get-rand-int self 3))) + (cond + ((zero? v1-1) + (play-death-sound self "asha057") + ) + ((= v1-1 1) + (play-death-sound self "asha055") + ) + (else + (play-death-sound self "asha056") + ) + ) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (or (= v1-10 (-> self draw art-group data 9)) (= v1-10 (-> self draw art-group data 12)))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (enemy-method-133 self) + (-> self enemy-info-override die-falling-anim) + (-> self enemy-info-override die-anim) + ) + ) + ) + (f30-0 (get-rand-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + (until #f + (if (and (logtest? (-> self bot-flags) (bot-flags failed)) (reset? *fail-mission-control*)) + (reset! *fail-mission-control*) + ) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate failed (ashelin) + :virtual #t + :enter (behavior () + (go-virtual die-falling) + (none) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc b/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc new file mode 100644 index 0000000000..5a826b4af3 --- /dev/null +++ b/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc @@ -0,0 +1,1443 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ashelin-anim-info +(deftype ashelin-anim-info (structure) + ((anim-index int32 :offset-assert 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type ashelin-anim-info +(defmethod inspect ashelin-anim-info ((obj ashelin-anim-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ashelin-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (label cfg-4) + obj + ) + +;; definition of type ashelin-global-info +(deftype ashelin-global-info (basic) + ((prev-blue-hit int8 :offset-assert 4) + (blue-hit-anim int32 6 :offset-assert 8) + (blue-hit-land-anim int32 6 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + +;; definition for method 3 of type ashelin-global-info +(defmethod inspect ashelin-global-info ((obj ashelin-global-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) + (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "~1Tblue-hit-land-anim[6] @ #x~X~%" (-> obj blue-hit-land-anim)) + (label cfg-4) + obj + ) + +;; definition for symbol *ashelin-global-info*, type ashelin-global-info +(define *ashelin-global-info* (new 'static 'ashelin-global-info + :blue-hit-anim (new 'static 'array int32 6 13 14 15 19 20 21) + :blue-hit-land-anim (new 'static 'array int32 6 16 17 18 22 23 24) + ) + ) + +;; definition for symbol *ashelin-nav-enemy-info*, type nav-enemy-info +(define *ashelin-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x3 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim -1 + :hit-anim 3 + :knocked-anim 10 + :knocked-land-anim 11 + :die-anim 26 + :die-falling-anim 26 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 10 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.7 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 57344.0 + :knocked-soft-vxz-hi 57344.0 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 81920.0 + :knocked-medium-vxz-lo 57344.0 + :knocked-medium-vxz-hi 57344.0 + :knocked-medium-vy-lo 81920.0 + :knocked-medium-vy-hi 81920.0 + :knocked-hard-vxz-lo 57344.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 81920.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 57344.0 + :knocked-yellow-vxz-hi 57344.0 + :knocked-yellow-vy-lo 81920.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 57344.0 + :knocked-red-vxz-hi 57344.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 6 + :taunt-anim -1 + :run-travel-speed (meters 10) + :run-acceleration (meters 25) + :run-turning-acceleration (meters 12) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 5) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 360.0) + :notice-nav-radius (meters 20) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 59 of type ashelin +(defmethod enemy-method-59 ashelin ((obj ashelin)) + (let* ((t9-0 (method-of-type bot enemy-method-59)) + (v0-0 (t9-0 obj)) + ) + (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (set! v0-0 (logior (penetrate jak-yellow-shot) v0-0)) + ) + v0-0 + ) + ) + +;; definition for method 250 of type ashelin +;; WARN: Return type mismatch penetrate vs none. +(defmethod ashelin-method-250 ashelin ((obj ashelin) (arg0 symbol)) + (if arg0 + (set! (-> obj bot-flags) (logior (bot-flags bf22) (-> obj bot-flags))) + (logclear! (-> obj bot-flags) (bot-flags bf22)) + ) + (set! (-> obj root-override2 penetrated-by) (enemy-method-59 obj)) + (none) + ) + +;; definition for method 193 of type ashelin +(defmethod bot-method-193 ashelin ((obj ashelin)) + (let* ((t9-0 (method-of-type bot bot-method-193)) + (v0-0 (t9-0 obj)) + ) + (when (and (not v0-0) (logtest? #x400000 (-> obj incoming penetrate-using))) + (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (set! v0-0 #t) + ) + (set! (-> obj bot-flags) (logior (bot-flags bf21) (-> obj bot-flags))) + ) + v0-0 + ) + ) + +;; definition for method 106 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-106 ashelin ((obj ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) + (let ((t9-0 (method-of-type bot enemy-method-106))) + (t9-0 obj arg0 arg1 arg2 arg3) + ) + (if (!= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) + (set! (-> obj incoming knocked-type) (knocked-type knocked-type-1)) + ) + (none) + ) + +;; definition for method 104 of type ashelin +(defmethod enemy-method-104 ashelin ((obj ashelin) (arg0 process) (arg1 uint) (arg2 uint)) + (if (and (= (-> arg0 type) target) + (-> obj next-state) + (let ((v1-4 (-> obj next-state name))) + (or (= v1-4 'back-spring) (= v1-4 'cartwheel-left) (= v1-4 'tumble-right)) + ) + ) + #f + ((method-of-type bot enemy-method-104) obj arg0 arg1 arg2) + ) + ) + +;; definition for method 97 of type ashelin +(defmethod enemy-method-97 ashelin ((obj ashelin)) + (with-pp + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 5)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 2.5)) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> obj focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) + (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + (else + (clear-focused (-> obj focus)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + s5-1 + ) + ) + ) + ) + +;; definition for method 183 of type ashelin +;; WARN: Return type mismatch object vs symbol. +(defmethod alive? ashelin ((obj ashelin)) + (let ((t9-0 (method-of-type bot alive?))) + (the-as + symbol + (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) + ) + ) + ) + ) + ) + +;; definition for method 114 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-114 ashelin ((obj ashelin)) + "@abstract" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-12 prim-core action) (collide-action solid can-ride deadly)) + (set-vector! (-> v1-12 local-sphere) 0.0 3276.8 0.0 3276.8) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-14 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-14 local-sphere) 0.0 5324.8 0.0 3276.8) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-16 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-16 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-16 local-sphere) 0.0 7372.8 0.0 3276.8) + ) + (set! (-> s5-0 nav-radius) 5120.0) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 7)) + (set! (-> obj root-override2) s5-0) + ) + 0 + (none) + ) + +;; definition for method 115 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-115 ashelin ((obj ashelin)) + "@abstract" + (init! obj) + (set! (-> obj channel) (the-as uint 22)) + (set! (-> obj travel-anim-interp) 0.0) + (set! (-> obj focus-info max-los-dist) 204800.0) + (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 0)) + (set! (-> obj hit-invuln-focus-disable-delay) (the-as uint 750)) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (enemy-method-113 obj *ashelin-nav-enemy-info*) + (let ((v1-10 (-> obj neck))) + (set! (-> v1-10 up) (the-as uint 1)) + (set! (-> v1-10 nose) (the-as uint 2)) + (set! (-> v1-10 ear) (the-as uint 0)) + (set-vector! (-> v1-10 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-10 ignore-angle) 30947.555) + ) + (let ((t9-4 (method-of-type bot enemy-method-115))) + (t9-4 obj) + ) + (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + 0 + (none) + ) + +;; definition for method 238 of type ashelin +;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod ashelin-method-238 ashelin ((obj ashelin) (arg0 symbol) (arg1 symbol)) + (cond + ((and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) + #t + ) + (else + (let ((f0-0 81920.0)) + (if arg1 + (set! f0-0 (+ 6144.0 f0-0)) + ) + (when (>= f0-0 (-> obj focus-info bullseye-xz-dist)) + (let ((v1-9 (-> obj focus-info los))) + (if arg0 + (or (= v1-9 1) (= v1-9 4)) + (= v1-9 1) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 235 of type ashelin +(defmethod ashelin-method-235 ashelin ((obj ashelin) (arg0 symbol)) + (with-pp + (and (>= (- (-> pp clock frame-counter) (-> obj last-fire-time)) (seconds 1)) + (and (>= 8556.089 (fabs (-> obj focus-info ry-diff))) (ashelin-method-238 obj arg0 #t)) + ) + ) + ) + +;; definition for method 243 of type ashelin +(defmethod ashelin-method-243 ashelin ((obj ashelin) (arg0 float)) + (let ((f30-0 (deg- arg0 (-> obj focus-info my-facing-ry)))) + (when (>= 16384.0 (fabs f30-0)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s5-0 (-> obj root-override2 trans)) + (return 1) + ) + (cond + ((< 0.0 f30-0) + (when (ashelin-method-236 obj s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s5-0 (-> obj root-override2 trans)) + (return 2) + ) + ) + (else + (when (ashelin-method-236 obj s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s5-0 (-> obj root-override2 trans)) + (return 3) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 246 of type ashelin +(defmethod ashelin-method-246 ashelin ((obj ashelin)) + (when (>= 32768.0 (-> obj focus-info bullseye-xz-dist)) + (let ((f0-1 (-> obj focus-info bullseye-ry))) + (return (ashelin-method-243 obj f0-1)) + ) + ) + (when (logtest? (bot-flags bf20) (-> obj bot-flags)) + (set! (-> obj root-override2 trans w) 1.0) + (when (>= (vector4-dot (the-as vector (-> obj frontline)) (-> obj root-override2 trans)) 12288.0) + (let ((f0-7 (atan (-> obj frontline x) (-> obj frontline z)))) + (return (ashelin-method-243 obj f0-7)) + ) + ) + ) + 0 + ) + +;; definition for method 241 of type ashelin +(defmethod ashelin-method-241 ashelin ((obj ashelin)) + (let* ((v1-0 (target-pos 0)) + (a1-0 (-> obj root-override2 trans)) + (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) + (f0-5 (deg- f30-0 (-> obj focus-info my-facing-ry))) + (s5-0 0) + ) + (cond + ((or (>= 8192.0 (fabs f0-5)) (>= (fabs f0-5) 24576.0)) + (let ((s3-1 (zero? (get-rand-int obj 2))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s2-0 2) + (cond + (s3-1 + (when (ashelin-method-236 obj s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-0 (-> obj root-override2 trans)) + (set! s5-0 3) + (goto cfg-20) + ) + ) + (else + (when (ashelin-method-236 obj s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-0 (-> obj root-override2 trans)) + (set! s5-0 2) + (goto cfg-20) + ) + ) + ) + (set! s3-1 (not s3-1)) + ) + ) + (label cfg-20) + ) + (else + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-1 (-> obj root-override2 trans)) + (set! s5-0 1) + ) + ) + ) + ) + s5-0 + ) + ) + +;; definition for method 242 of type ashelin +(defmethod ashelin-method-242 ashelin ((obj ashelin)) + (let ((s5-0 0)) + (cond + ((zero? (get-rand-int obj 2)) + (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s4-0 (+ 16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-0 (-> obj root-override2 trans)) + (set! s5-0 3) + ) + ) + ) + ) + (else + (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-236 obj s4-1 (+ -16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> obj move-dest) s4-1 (-> obj root-override2 trans)) + (set! s5-0 2) + ) + ) + ) + ) + ) + s5-0 + ) + ) + +;; definition for method 240 of type ashelin +;; WARN: Return type mismatch object vs none. +(defmethod ashelin-method-240 ashelin ((obj ashelin) (arg0 int)) + (case arg0 + ((3) + (go (method-of-object obj cartwheel-left)) + ) + ((2) + (go (method-of-object obj tumble-right)) + ) + (else + (go (method-of-object obj back-spring)) + ) + ) + (none) + ) + +;; definition for method 247 of type ashelin +;; INFO: Used lq/sq +(defmethod ashelin-method-247 ashelin ((obj ashelin)) + (cond + ((logtest? (bot-flags bf20) (-> obj bot-flags)) + (set! (-> obj root-override2 trans w) 1.0) + (set! (-> obj focus-info bullseye w) 1.0) + (let ((f30-0 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root-override2 trans)))) + (let ((f0-4 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye)))) + (if (or (>= 0.0 f0-4) (>= -8192.0 f30-0)) + (return #t) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root-override2 trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> obj frontline)))) + (return #t) + ) + (if (>= f30-0 0.0) + (return #f) + ) + (let ((a2-0 (new 'stack-no-clear 'vector)) + (a0-8 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a2-0 (the-as vector (-> obj frontline)) (- (-> obj frontline w))) + (set! (-> a0-8 quad) (-> obj root-override2 trans quad)) + (set! (-> a0-8 y) 0.0) + (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> obj frontline)) 8192.0) + ) + ) + ) + ) + (else + #t + ) + ) + ) + +;; definition for method 248 of type ashelin +(defmethod ashelin-method-248 ashelin ((obj ashelin)) + (when (logtest? (bot-flags bf20) (-> obj bot-flags)) + (set! (-> obj root-override2 trans w) 1.0) + (set! (-> obj focus-info bullseye w) 1.0) + (let ((f0-3 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root-override2 trans))) + (f1-1 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye))) + ) + (when (and (< 0.0 f1-1) (< 0.0 f0-3)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root-override2 trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s5-0 (the-as vector (-> obj frontline))) 0.0) + ) + ) + ) + ) + ) + +;; definition for method 70 of type ashelin +(defmethod go-hostile ashelin ((obj ashelin)) + (bot-method-223 obj #t) + (cond + ((not (bot-method-214 obj)) + (enemy-method-72 obj) + ) + ((ashelin-method-238 obj #t #f) + (go (method-of-object obj standing-idle)) + ) + ((ashelin-method-247 obj) + (go (method-of-object obj chase)) + ) + (else + (go (method-of-object obj standing-idle)) + ) + ) + (none) + ) + +;; definition for method 72 of type ashelin +(defmethod enemy-method-72 ashelin ((obj ashelin)) + (if (bot-method-214 obj) + (go-hostile obj) + (ashelin-method-239 obj) + ) + (none) + ) + +;; definition for method 239 of type ashelin +;; WARN: Return type mismatch object vs none. +(defmethod ashelin-method-239 ashelin ((obj ashelin)) + (if (bot-method-214 obj) + (go (method-of-object obj standing-idle)) + (go (method-of-object obj waiting-idle)) + ) + (none) + ) + +;; definition for method 116 of type ashelin +;; WARN: Return type mismatch object vs none. +(defmethod go-idle ashelin ((obj ashelin)) + (go (method-of-object obj hidden)) + (none) + ) + +;; definition for method 237 of type ashelin +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod fire-projectile ashelin ((obj ashelin) (arg0 vector)) + (with-pp + (set! (-> obj last-fire-time) (-> pp clock frame-counter)) + (+! (-> obj fired-gun-count) 1) + (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options account-for-target-velocity proj-options-8000)) + (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 ignore-handle) (process->handle obj)) + (let* ((v1-13 *game-info*) + (a0-10 (+ (-> v1-13 attack-id) 1)) + ) + (set! (-> v1-13 attack-id) a0-10) + (set! (-> s4-0 attack-id) a0-10) + ) + (set! (-> s4-0 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector<-cspace! (-> s4-0 pos) (-> obj node-list data 22)) + (set! (-> s4-0 vel quad) (-> arg0 quad)) + (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) + (vector-normalize! (-> s4-0 vel) 307200.0) + (spawn-projectile ashelin-shot s4-0 obj *default-dead-pool*) + ) + (none) + ) + ) + +;; definition for method 249 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod ashelin-method-249 ashelin ((obj ashelin)) + (with-pp + (let* ((f30-0 (-> obj nav state speed)) + (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) + (f1-0 (-> obj travel-anim-interp)) + (v1-5 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-5 (= v1-5 (-> obj draw art-group data 5))) + (let ((f28-0 f1-0) + (f0-4 (seek f1-0 f0-1 (* 4.0 (-> pp clock seconds-per-frame)))) + ) + (cond + ((logtest? (bot-flags bf19) (-> obj bot-flags)) + (if (< f0-4 1.0) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-17 (-> obj skel root-channel 1))) + (set! (-> v1-17 dist) 13107.2) + (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + ) + (logclear! (-> obj bot-flags) (bot-flags bf19)) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + (else + (if (< 1.0 f0-4) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-27 (-> obj skel root-channel 1))) + (set! (-> v1-27 dist) 43690.68) + (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + ) + (set! (-> obj bot-flags) (logior (bot-flags bf19) (-> obj bot-flags))) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + ) + (set! (-> obj travel-anim-interp) f0-4) + (let ((f0-7 (if (logtest? (bot-flags bf19) (-> obj bot-flags)) + (+ -1.0 f0-4) + (- 1.0 f0-4) + ) + ) + (v1-39 (-> obj skel root-channel 1)) + ) + (set! (-> v1-39 frame-interp 1) f0-7) + (set! (-> v1-39 frame-interp 0) f0-7) + ) + ) + (let* ((f28-1 (current-cycle-distance (-> obj skel))) + (f0-8 (quaternion-y-angle (-> obj root-override2 quat))) + (f1-10 (deg- f0-8 (-> obj travel-prev-ry))) + (f0-11 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-10)))) + (f0-14 (/ (* 16.0 (fmax f30-0 f0-11)) (* 15.0 f28-1))) + (a0-22 (-> obj skel root-channel 0)) + ) + (set! (-> a0-22 param 0) f0-14) + (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-23 (-> obj skel root-channel 1))) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (let ((f30-1 (seek f1-0 f0-1 (* 4.0 (-> pp clock seconds-per-frame))))) + (set! (-> obj travel-anim-interp) f30-1) + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-26 (-> obj skel root-channel 0))) + (set! (-> a0-26 dist) 26214.4) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-26 param 0) 1.0) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + ) + (cond + ((< f30-1 1.0) + (let ((f0-22 (- 1.0 f30-1)) + (a0-27 (-> obj skel root-channel 1)) + ) + (set! (-> a0-27 frame-interp 1) f0-22) + (set! (-> a0-27 frame-interp 0) f0-22) + (set! (-> a0-27 dist) 13107.2) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> a0-27 param 0) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-chan) + ) + (logclear! (-> obj bot-flags) (bot-flags bf19)) + ) + (else + (let ((f0-26 (+ -1.0 f30-1)) + (a0-29 (-> obj skel root-channel 1)) + ) + (set! (-> a0-29 frame-interp 1) f0-26) + (set! (-> a0-29 frame-interp 0) f0-26) + (set! (-> a0-29 dist) 43690.68) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-29 param 0) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + ) + (set! (-> obj bot-flags) (logior (bot-flags bf19) (-> obj bot-flags))) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 51 of type ashelin +;; INFO: Used lq/sq +(defmethod enemy-method-51 ashelin ((obj ashelin)) + (local-vars (v1-36 art-element)) + (let ((f28-0 (quaternion-y-angle (-> obj root-override2 quat)))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let ((a0-4 (handle->process (-> obj focus handle)))) + (when a0-4 + (get-trans (the-as process-focusable a0-4) 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> obj root-override2 transv quad)) + (if (< (vector-dot + (-> obj root-override2 transv) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override2 quat)) + ) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f28-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (vector-z-quaternion! s5-1 (-> obj root-override2 quat)) + (let ((f28-1 (atan (-> s5-1 x) (-> s5-1 z)))) + (enemy-method-50 obj s5-1) + (let* ((f30-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f0-10 (deg- f30-0 f28-1)) + ) + (set! f28-0 (if (>= 16384.0 (fabs f0-10)) + f30-0 + (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48)) + ) + ) + (cond + ((and (>= 8192.0 f0-10) (>= f0-10 -16384.0)) + (set! v1-36 (-> obj draw art-group data 10)) + ) + ((>= f0-10 8192.0) + (set! v1-36 (-> obj draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ((zero? (get-rand-int obj 3)) + (set! v1-36 (-> obj draw art-group data 10)) + ) + (else + (set! v1-36 (-> obj draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ) + ) + ) + ) + (set! (-> obj knocked-anim) (the-as art-joint-anim v1-36)) + ) + ) + f28-0 + ) + ) + +;; definition for method 77 of type ashelin +(defmethod enemy-method-77 ashelin ((obj ashelin) (arg0 (pointer float))) + (local-vars (a2-0 int)) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let ((s5-1 (ash 1 (-> *ashelin-global-info* prev-blue-hit))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + (vector-z-quaternion! s4-0 (-> obj root-override2 quat)) + (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (enemy-method-50 obj s4-0) + (let* ((f0-6 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-8 (fabs (deg- f0-6 f30-0))) + ) + (if (>= 16384.0 f0-8) + (set! a2-0 (logior s5-1 7)) + (set! a2-0 (logior s5-1 56)) + ) + ) + ) + ) + (let* ((v1-9 (enemy-method-120 obj 6 a2-0)) + (s5-2 (-> obj draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9))) + ) + (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) + (let ((v1-12 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-12 (or (= v1-12 (-> obj draw art-group data 16)) + (= v1-12 (-> obj draw art-group data 17)) + (= v1-12 (-> obj draw art-group data 18)) + (= v1-12 (-> obj draw art-group data 22)) + (= v1-12 (-> obj draw art-group data 23)) + (= v1-12 (-> obj draw art-group data 24)) + ) + ) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-38 (-> obj skel root-channel 0))) + (set! (-> a0-38 frame-group) (the-as art-joint-anim s5-2)) + (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) + (set! (-> a0-38 param 1) 1.0) + (set! (-> a0-38 frame-num) 0.0) + (joint-control-channel-group! a0-38 (the-as art-joint-anim s5-2) num-func-seek!) + ) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-40 (-> obj skel root-channel 0))) + (set! (-> a0-40 frame-group) (-> obj knocked-anim)) + (set! (-> a0-40 param 0) (the float (+ (-> obj knocked-anim frames num-frames) -1))) + (set! (-> a0-40 param 1) (-> arg0 0)) + (set! (-> a0-40 frame-num) 0.0) + (joint-control-channel-group! a0-40 (-> obj knocked-anim) num-func-seek!) + ) + #t + ) + ) + ) + +;; definition for method 78 of type ashelin +(defmethod enemy-method-78 ashelin ((obj ashelin) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let* ((v1-1 *ashelin-global-info*) + (s5-0 (-> obj draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit)))) + ) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-7 (-> obj skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim s5-0)) + (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) + (set! (-> a0-7 param 1) 1.0) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim s5-0) num-func-seek!) + ) + ) + #t + ) + (else + (let ((v1-15 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-15 (= v1-15 (-> obj draw art-group data 7))) + (cond + ((or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-14 (-> obj skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 9))) + (set! (-> a0-14 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 9)) frames num-frames) -1)) + ) + (set! (-> a0-14 param 1) 1.0) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 9)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-16 (-> obj skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-16 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 8)) frames num-frames) -1)) + ) + (set! (-> a0-16 param 1) 1.0) + (set! (-> a0-16 frame-num) 0.0) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-seek!) + ) + #t + ) + ) + ) + ((and (or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) (nonzero? (get-rand-int obj 3))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-20 (-> obj skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (set! (-> a0-20 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-20 param 1) 1.0) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-22 (-> obj skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + ) + #t + ) + ) + ) + ) + ) + ) + +;; definition for method 79 of type ashelin +(defmethod enemy-method-79 ashelin ((obj ashelin) (arg0 int) (arg1 enemy-knocked-info)) + (cond + ((= arg0 3) + (let ((s5-0 (ja-done? 0))) + (cond + ((and s5-0 (let ((v1-4 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (and v1-4 (or (= v1-4 (-> obj draw art-group data 16)) + (= v1-4 (-> obj draw art-group data 17)) + (= v1-4 (-> obj draw art-group data 18)) + (= v1-4 (-> obj draw art-group data 22)) + (= v1-4 (-> obj draw art-group data 23)) + (= v1-4 (-> obj draw art-group data 24)) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-21 (-> obj skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 25))) + (set! (-> a0-21 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 25)) frames num-frames) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 25)) num-func-seek!) + ) + (set! s5-0 #f) + ) + (else + (let ((v1-25 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-25 (= v1-25 (-> obj draw art-group data 8))) + (let ((f0-4 (ja-aframe-num 0))) + (cond + ((>= f0-4 22.0) + (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) + (logior! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-4 16.0) + (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (logior! (-> obj focus-status) (focus-status dangerous)) + (let* ((v1-42 *game-info*) + (a0-34 (+ (-> v1-42 attack-id) 1)) + ) + (set! (-> v1-42 attack-id) a0-34) + (set! (-> obj attack-id) a0-34) + ) + ) + ) + ) + ) + ) + ((let ((v1-45 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (and v1-45 (= v1-45 (-> obj draw art-group data 11))) + ) + (let ((f0-5 (ja-aframe-num 0))) + (cond + ((>= f0-5 32.0) + (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) + (logior! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-5 25.0) + (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (logior! (-> obj focus-status) (focus-status dangerous)) + (let* ((v1-62 *game-info*) + (a0-47 (+ (-> v1-62 attack-id) 1)) + ) + (set! (-> v1-62 attack-id) a0-47) + (set! (-> obj attack-id) a0-47) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((a0-48 (-> obj skel root-channel 0))) + (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group frames num-frames) -1))) + (set! (-> a0-48 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type bot enemy-method-79) obj arg0 arg1) + ) + ) + ) + +;; definition for method 236 of type ashelin +;; INFO: Used lq/sq +(defmethod ashelin-method-236 ashelin ((obj ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (local-vars (v1-23 float) (sv-272 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let* ((v1-0 (-> obj nav)) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a1-1 (-> v1-0 sphere-id-array)) + (a2-2 (-> v1-0 state mesh bounds)) + (a3-1 (-> v1-0 root-nav-sphere)) + (t0-1 (-> v1-0 sphere-count)) + ) + (dotimes (t1-1 t0-1) + (let ((t3-0 (-> a0-3 (-> a1-1 t1-1))) + (t2-4 (-> v1-0 sphere-array t1-1)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-2) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-1 w))) + ) + ) + ) + 0 + (let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (vector-! (-> s0-0 current-pos) (-> obj root-override2 trans) (-> obj nav state mesh bounds)) + (set! sv-272 (-> s0-0 travel)) + (set! (-> sv-272 x) (sin arg1)) + (set! (-> sv-272 y) 0.0) + (set! (-> sv-272 z) (cos arg1)) + (set! (-> sv-272 w) 1.0) + (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) + (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) + (avoid-spheres-1! (-> obj nav) s0-0) + (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) + ) + 0 + (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) + (let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-no-gaps + (-> obj nav) + (-> obj root-override2 trans) + (-> obj nav state current-poly) + arg0 + t0-2 + ) + ) + (.lvf vf1 (&-> arg0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-23 vf1) + (let ((f0-11 v1-23) + (f1-1 arg4) + ) + (>= f0-11 (* f1-1 f1-1)) + ) + ) + ) + ) + +;; definition for method 142 of type ashelin +(defmethod nav-enemy-method-142 ashelin ((obj ashelin) (arg0 nav-control)) + (if (not (and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) + ) + ) + ) + ((method-of-type bot nav-enemy-method-142) obj arg0) + ) + (none) + ) + +;; definition for method 216 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-216 ashelin ((obj ashelin)) + (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to obj))) + 0 + (none) + ) + +;; definition for method 203 of type ashelin +(defmethod play-attacked-speech ashelin ((obj ashelin)) + (local-vars (v1-3 int) (a3-0 int)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((v1-2 0)) + (if (logtest? #x3c00000 (-> obj incoming penetrate-using)) + (set! v1-3 (logior v1-2 128)) + (set! v1-3 (logior v1-2 64)) + ) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (set! a3-0 (logior v1-3 256)) + (set! a3-0 (logior v1-3 512)) + ) + (let ((a1-3 (bot-speech-list-method-9 + (-> obj ash-course attack-player-speeches) + obj + (-> obj ash-course speeches) + (the-as speech-flags a3-0) + ) + ) + ) + (if (>= a1-3 0) + (play-speech obj a1-3) + ) + ) + ) + (none) + ) + +;; definition for method 244 of type ashelin +(defmethod ashelin-method-244 ashelin ((obj ashelin)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((a1-2 + (bot-speech-list-method-9 (-> obj ash-course ouch-speeches) obj (-> obj ash-course speeches) (speech-flags)) + ) + ) + (if (>= a1-2 0) + (play-speech obj a1-2) + ) + ) + ) + (none) + ) + +;; definition for method 245 of type ashelin +(defmethod ashelin-method-245 ashelin ((obj ashelin)) + (with-pp + (when (and (not (channel-active? obj (the-as uint 0))) + (>= (-> pp clock frame-counter) (-> obj victory-speech-time)) + ) + (let ((s5-0 (bot-speech-list-method-9 + (-> obj ash-course victory-speeches) + obj + (-> obj ash-course speeches) + (speech-flags) + ) + ) + ) + (when (>= s5-0 0) + (set! (-> obj victory-speech-time) + (the-as time-frame (+ (get-rand-int-range obj 1200 2100) (-> pp clock frame-counter))) + ) + (play-speech obj s5-0) + ) + ) + ) + (none) + ) + ) + +;; definition for method 136 of type ashelin +(defmethod enemy-method-136 ashelin ((obj ashelin)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (the-as int (-> obj hit-focus-time))) (seconds 2)) + (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> obj enemy-flags) v0-0) + v0-0 + ) + ) + ) + ) + +;; definition for method 206 of type ashelin +;; WARN: Return type mismatch enemy-flag vs none. +(defmethod play-speech ashelin ((obj ashelin) (arg0 int)) + (let ((t9-0 (method-of-type bot play-speech))) + (t9-0 obj arg0) + ) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (none) + ) + +;; definition for method 15 of type hud-ashelin +;; WARN: Return type mismatch int vs none. +(defmethod draw hud-ashelin ((obj hud-ashelin)) + (set-hud-piece-position! + (-> obj sprites 2) + (the int (+ 30.0 (* -130.0 (-> obj offset)))) + (the int (+ 30.0 (* -100.0 (-> obj offset)))) + ) + (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 8 2) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +;; definition for method 16 of type hud-ashelin +;; WARN: Return type mismatch int vs none. +(defmethod update-values hud-ashelin ((obj hud-ashelin)) + (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +;; definition for method 17 of type hud-ashelin +;; WARN: Return type mismatch int vs none. +(defmethod init-callback hud-ashelin ((obj hud-ashelin)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 0 scale-x) 12.0) + (set! (-> obj sprites 0 scale-y) 11.2) + (set! (-> obj sprites 0 pos z) #xfffff2) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> obj sprites 1 pos z) #xfffff0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 3 tex) + (lookup-texture-by-name "hud-ashlyn-head" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.4) + (set! (-> obj sprites 3 pos z) #xffffff) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/characters/sig/sig-h_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig-h_REF.gc new file mode 100644 index 0000000000..12e0c5d33b --- /dev/null +++ b/test/decompiler/reference/jak2/characters/sig/sig-h_REF.gc @@ -0,0 +1,507 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sig-plasma +(deftype sig-plasma (structure) + ((flags uint8 :offset-assert 0) + (level float :offset-assert 4) + (min-level float :offset-assert 8) + (charge-speed float :offset-assert 12) + (powerup-sound-id sound-id :offset-assert 16) + (plasma-sound-id sound-id :offset-assert 20) + ) + :pack-me + :method-count-assert 15 + :size-assert #x18 + :flag-assert #xf00000018 + (:methods + (sig-plasma-method-9 (_type_) none 9) + (sig-plasma-method-10 (_type_) symbol 10) + (sig-plasma-method-11 (_type_ symbol) none 11) + (sig-plasma-method-12 (_type_) none 12) + (sig-plasma-method-13 (_type_) symbol 13) + (sig-plasma-method-14 (_type_ process-focusable) none 14) + ) + ) + +;; definition for method 3 of type sig-plasma +(defmethod inspect sig-plasma ((obj sig-plasma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sig-plasma) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tlevel: ~f~%" (-> obj level)) + (format #t "~1Tmin-level: ~f~%" (-> obj min-level)) + (format #t "~1Tcharge-speed: ~f~%" (-> obj charge-speed)) + (format #t "~1Tpowerup-sound-id: ~D~%" (-> obj powerup-sound-id)) + (format #t "~1Tplasma-sound-id: ~D~%" (-> obj plasma-sound-id)) + (label cfg-4) + obj + ) + +;; definition of type sig-path-sample +(deftype sig-path-sample (structure) + ((bytes uint8 32 :offset-assert 0) + (pos vector :inline :offset-assert 32) + (quat quaternion :inline :offset-assert 48) + (flags uint8 :offset 12) + (pos-x float :offset 32) + (pos-y float :offset 36) + (pos-z float :offset 40) + (quat-x float :offset 48) + (quat-y float :offset 52) + (quat-z float :offset 56) + (quat-w float :offset 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type sig-path-sample +;; ERROR: failed type prop at 14: add failed: sig-path-sample + +(defmethod inspect sig-path-sample ((a0-0 sig-path-sample)) + (local-vars + (v0-0 object) + (v0-1 none) + (v0-2 none) + (v0-3 none) + (v0-4 none) + (v0-5 none) + (v0-6 none) + (v0-7 none) + (v0-8 none) + (v0-9 none) + (v0-10 none) + (v0-11 none) + (v0-12 sig-path-sample) + (a0-1 symbol) + (a0-2 symbol) + (a0-3 none) + (a0-4 none) + (a0-5 none) + (a0-6 none) + (a0-7 none) + (a0-8 none) + (a0-9 none) + (a0-10 none) + (a0-11 none) + (a0-12 none) + (a1-0 string) + (a1-1 string) + (a1-2 none) + (a1-3 none) + (a1-4 none) + (a1-5 none) + (a1-6 none) + (a1-7 none) + (a1-8 none) + (a1-9 none) + (a1-10 none) + (a1-11 none) + (a2-0 sig-path-sample) + (a2-1 none) + (a2-2 none) + (a2-3 none) + (a2-4 none) + (a3-0 symbol) + (t9-0 (function _varargs_ object)) + (t9-1 (function _varargs_ object)) + (t9-2 none) + (t9-3 none) + (t9-4 none) + (t9-5 none) + (t9-6 none) + (t9-7 none) + (t9-8 none) + (t9-9 none) + (t9-10 none) + (t9-11 none) + (f0-0 none) + (f0-1 none) + (f0-2 none) + (f0-3 none) + (f0-4 none) + (f0-5 none) + (f0-6 none) + ) + (if (begin (not a0-0)) + (begin (set! a0-0 a0-0) (goto cfg-4)) + ) + (set! t9-0 format) + (set! a0-1 #t) + (set! a1-0 L77) + (set! a2-0 a0-0) + (set! a3-0 'sig-path-sample) + (call! a0-1 a1-0 a2-0 a3-0) + (set! t9-1 format) + (set! a0-2 #t) + (set! a1-1 L70) + (set! a2-1 (the-as none (+ a0-0 0))) + (call!) + (set! t9-2 (the-as none format)) + (set! a0-3 (the-as none #t)) + (set! a1-2 (the-as none L69)) + (set! a2-2 (the-as none (-> a0-0 pos))) + (call!) + (set! t9-3 (the-as none format)) + (set! a0-4 (the-as none #t)) + (set! a1-3 (the-as none L68)) + (set! a2-3 (the-as none (-> a0-0 quat))) + (call!) + (set! t9-4 (the-as none format)) + (set! a0-5 (the-as none #t)) + (set! a1-4 (the-as none L76)) + (set! a2-4 (the-as none (-> a0-0 flags))) + (call!) + (set! t9-5 (the-as none format)) + (set! a0-6 (the-as none #t)) + (set! a1-5 (the-as none L67)) + (set! f0-0 (the-as none (-> a0-0 pos x))) + (set! a2-5 (the-as none (fpr->gpr f0-0))) + (call!) + (set! t9-6 (the-as none format)) + (set! a0-7 (the-as none #t)) + (set! a1-6 (the-as none L66)) + (set! f0-1 (the-as none (-> a0-0 pos y))) + (set! a2-6 (the-as none (fpr->gpr f0-1))) + (call!) + (set! t9-7 (the-as none format)) + (set! a0-8 (the-as none #t)) + (set! a1-7 (the-as none L65)) + (set! f0-2 (the-as none (-> a0-0 pos z))) + (set! a2-7 (the-as none (fpr->gpr f0-2))) + (call!) + (set! t9-8 (the-as none format)) + (set! a0-9 (the-as none #t)) + (set! a1-8 (the-as none L64)) + (set! f0-3 (the-as none (-> a0-0 quat x))) + (set! a2-8 (the-as none (fpr->gpr f0-3))) + (call!) + (set! t9-9 (the-as none format)) + (set! a0-10 (the-as none #t)) + (set! a1-9 (the-as none L63)) + (set! f0-4 (the-as none (-> a0-0 quat y))) + (set! a2-9 (the-as none (fpr->gpr f0-4))) + (call!) + (set! t9-10 (the-as none format)) + (set! a0-11 (the-as none #t)) + (set! a1-10 (the-as none L62)) + (set! f0-5 (the-as none (-> a0-0 quat z))) + (set! a2-10 (the-as none (fpr->gpr f0-5))) + (call!) + (set! t9-11 (the-as none format)) + (set! a0-12 (the-as none #t)) + (set! a1-11 (the-as none L61)) + (set! f0-6 (the-as none (-> a0-0 quat w))) + (set! a2-11 (the-as none (fpr->gpr f0-6))) + (call!) + (label cfg-4) + (set! v0-12 a0-0) + (ret-value v0-12) + ) + +;; definition of type sig-path +(deftype sig-path (basic) + ((sample-count int32 :offset-assert 4) + (samples (inline-array sig-path-sample) :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type sig-path +(defmethod inspect sig-path ((obj sig-path)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tsample-count: ~D~%" (-> obj sample-count)) + (format #t "~1Tsamples: #x~X~%" (-> obj samples)) + (label cfg-4) + obj + ) + +;; definition of type sig +(deftype sig (bot) + ((fired-gun-count uint32 :offset-assert 992) + (sig-path sig-path :offset-assert 996) + (sig-path-clock clock :offset-assert 1000) + (travel-anim-interp float :offset-assert 1004) + (platform-index uint8 :offset-assert 1008) + (played-unjam-time time-frame :offset-assert 1016) + (sig-path-start-time time-frame :offset-assert 1024) + (sig-path-cur-time time-frame :offset-assert 1032) + (sig-path-prev-time time-frame :offset-assert 1040) + (plasma sig-plasma :inline :offset 1048) + (sig-path-prev-pos vector :inline :offset 368) + ) + :heap-base #x3b0 + :method-count-assert 259 + :size-assert #x430 + :flag-assert #x10303b00430 + (:methods + (whip () _type_ :state 225) + (blast () _type_ :state 226) + (chase () _type_ :state 227) + (chase-attack () _type_ :state 228) + (traveling () _type_ :state 229) + (traveling-blocked () _type_ :state 230) + (waiting-far () _type_ :state 231) + (waiting-close () _type_ :state 232) + (waiting-turn () _type_ :state 233) + (waiting-crouched () _type_ :state 234) + (charge-plasma () _type_ :state 235) + (gun-jam () _type_ :state 236) + (repair-gun () _type_ :state 237) + (clean-gun () _type_ :state 238) + (sig-path-run () _type_ :state 239) + (sig-path-jump () _type_ :state 240) + (sig-path-jump-land () _type_ :state 241) + (sig-path-shoot-jump () _type_ :state 242) + (sig-path-shoot-jump-land () _type_ :state 243) + (sig-path-idle () _type_ :state 244) + (sig-method-245 (_type_) symbol 245) + (sig-method-246 (_type_) symbol 246) + (fire-gun (_type_ vector) (pointer process) 247) + (sig-method-248 (_type_ sig-path-sample) none 248) + (sig-method-249 (_type_ sig-path) none 249) + (sig-method-250 (_type_) symbol 250) + (sig-method-251 (_type_) symbol 251) + (sig-method-252 (_type_) symbol 252) + (sig-method-253 (_type_) none 253) + (sig-method-254 (_type_) symbol 254) + (sig-method-255 (_type_) symbol 255) + (sig-method-256 (_type_) none 256) + (sig-method-257 (_type_) symbol 257) + (sig-method-258 (_type_) none 258) + ) + ) + +;; definition for method 3 of type sig +(defmethod inspect sig ((obj sig)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bot inspect))) + (t9-0 obj) + ) + (format #t "~2Tfired-gun-count: ~D~%" (-> obj fired-gun-count)) + (format #t "~2Tsig-path: ~A~%" (-> obj sig-path)) + (format #t "~2Tsig-path-clock: ~A~%" (-> obj sig-path-clock)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) + (format #t "~2Tplatform-index: ~D~%" (-> obj platform-index)) + (format #t "~2Tplayed-unjam-time: ~D~%" (-> obj played-unjam-time)) + (format #t "~2Tsig-path-start-time: ~D~%" (-> obj sig-path-start-time)) + (format #t "~2Tsig-path-cur-time: ~D~%" (-> obj sig-path-cur-time)) + (format #t "~2Tsig-path-prev-time: ~D~%" (-> obj sig-path-prev-time)) + (format #t "~2Tplasma: #~%" (-> obj plasma)) + (format #t "~2Tsig-path-prev-pos: ~`vector`P~%" (-> obj event-param-point)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(defskelgroup skel-sig sig sig-lod0-jg sig-ready0-ja + ((sig-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow sig-shadow-mg + :origin-joint-index 25 + ) + +;; definition of type sigt-wait-spot +(deftype sigt-wait-spot (ai-task) + ((check-done (function sigt-wait-spot sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 6 :offset 38) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type sigt-wait-spot +(defmethod inspect sigt-wait-spot ((obj sigt-wait-spot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (label cfg-4) + obj + ) + +;; definition of type sigt-choose-piston +(deftype sigt-choose-piston (ai-task) + ((check-done (function sigt-choose-piston sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + (actor-indexes uint8 4 :offset 42) + ) + :method-count-assert 15 + :size-assert #x30 + :flag-assert #xf00000030 + (:methods + (sigt-choose-piston-method-12 (_type_ sig) symbol 12) + (sigt-choose-piston-method-13 (_type_ sig) none 13) + (sigt-choose-piston-method-14 (_type_ sig int) symbol 14) + ) + ) + +;; definition for method 3 of type sigt-choose-piston +(defmethod inspect sigt-choose-piston ((obj sigt-choose-piston)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) + (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> obj spot-indexes)) + (format #t "~1Tactor-indexes[4] @ #x~X~%" (-> obj actor-indexes)) + (label cfg-4) + obj + ) + +;; definition of type sigt-riding-piston +(deftype sigt-riding-piston (ai-task) + ((check-done (function sigt-riding-piston sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + ) + :method-count-assert 13 + :size-assert #x30 + :flag-assert #xd00000030 + (:methods + (sigt-riding-piston-method-12 (_type_ sig) symbol 12) + ) + ) + +;; definition for method 3 of type sigt-riding-piston +(defmethod inspect sigt-riding-piston ((obj sigt-riding-piston)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) + (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> obj spot-indexes)) + (label cfg-4) + obj + ) + +;; definition of type sigt-charge-plasma +(deftype sigt-charge-plasma (ai-task) + ((check-done (function sigt-charge-plasma sig symbol) :offset 32) + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 4 :offset 38) + (actor-index uint8 :offset 42) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type sigt-charge-plasma +(defmethod inspect sigt-charge-plasma ((obj sigt-charge-plasma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) + (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> obj spot-indexes)) + (format #t "~1Tactor-index: ~D~%" (-> obj actor-index)) + (label cfg-4) + obj + ) + +;; definition of type sigt-fight-focus +(deftype sigt-fight-focus (ai-task) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type sigt-fight-focus +(defmethod inspect sigt-fight-focus ((obj sigt-fight-focus)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (label cfg-4) + obj + ) + +;; definition of type sigt-repair-gun +(deftype sigt-repair-gun (ai-task) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type sigt-repair-gun +(defmethod inspect sigt-repair-gun ((obj sigt-repair-gun)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/characters/sig/sig-plasma_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig-plasma_REF.gc new file mode 100644 index 0000000000..d360d09728 --- /dev/null +++ b/test/decompiler/reference/jak2/characters/sig/sig-plasma_REF.gc @@ -0,0 +1,285 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function sparticle-sig-plasma-lightning +(defun sparticle-sig-plasma-lightning ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-1 (-> arg1 key proc)) + (a1-2 (cond + ((= (-> v1-1 type) sig-atoll) + (-> v1-1 node-list data 24) + ) + (else + (let ((v1-3 (-> v1-1 parent))) + (-> (the-as sig-atoll (if v1-3 + (the-as sig-atoll (-> v1-3 0 self)) + ) + ) + node-list + data + 52 + ) + ) + ) + ) + ) + (v1-6 (vector<-cspace! (new 'stack-no-clear 'vector) a1-2)) + ) + (set! (-> arg2 x) (-> v1-6 x)) + (set! (-> arg2 y) (-> v1-6 y)) + (set! (-> arg2 z) (-> v1-6 z)) + ) + (sparticle-texture-animate arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-sig-plasma + :id 147 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 665) (sp-item 666 :flags (bit6)) (sp-item 667 :flags (bit6)) (sp-item 668 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 667 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 2.25) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 32.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 668 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 0.1) 1.0) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 16.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 666 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x43b)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 665 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xcc :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.9)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0)) + (sp-flt spt-r 0.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-y (meters 0.0125)) + (sp-flt spt-fade-r 6.4) + (sp-flt spt-fade-g 6.4) + (sp-flt spt-fade-a 6.4) + (sp-int spt-timer 200) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 15 1 0 #xc0cc00 #xc0cd00 #xc0ce00 #xc0cf00 #xc0d000 #xc0d100 #xc0d200) + ) + (sp-func spt-func 'sparticle-sig-plasma-lightning) + (sp-int-plain-rnd spt-next-time 15 4 1) + (sp-launcher-by-id spt-next-launcher 669) + ) + ) + +;; failed to figure out what this is: +(defpart 669 + :init-specs ((sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-flt spt-scalevel-x (meters 0)) + (sp-flt spt-scalevel-y (meters 0)) + (sp-flt spt-fade-r -8.533334) + (sp-flt spt-fade-g -8.533334) + (sp-flt spt-fade-a -8.533334) + (sp-int-plain-rnd spt-next-time 15 4 1) + (sp-launcher-by-id spt-next-launcher 670) + ) + ) + +;; failed to figure out what this is: +(defpart 670 + :init-specs ((sp-rnd-flt spt-scalevel-x (meters -0.00093750004) (meters -0.00093750004) 1.0) + (sp-rnd-flt spt-scalevel-y (meters -0.00078125) (meters -0.00078125) 1.0) + (sp-flt spt-fade-r -0.8) + (sp-flt spt-fade-g -0.8) + (sp-flt spt-fade-a -0.8) + ) + ) + +;; definition for method 14 of type sig-plasma +(defmethod sig-plasma-method-14 sig-plasma ((obj sig-plasma) (arg0 process-focusable)) + (with-pp + (let* ((f0-0 (-> obj level)) + (f30-0 (cond + ((logtest? (-> obj flags) 2) + (seek f0-0 1.0 (* (-> obj charge-speed) (-> pp clock seconds-per-frame))) + ) + (else + (let ((f1-1 (-> obj min-level))) + (when (< f0-0 f1-1) + (set! f1-1 f0-0) + (set! (-> obj min-level) f1-1) + ) + (seek f0-0 f1-1 (* 0.25 (-> pp clock seconds-per-frame))) + ) + ) + ) + ) + ) + (set! (-> obj level) f30-0) + (cond + ((= f30-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) (-> obj powerup-sound-id)) + (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) + ) + (let ((v1-11 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-11 command) (sound-command set-param)) + (set! (-> v1-11 id) (-> obj plasma-sound-id)) + (set! (-> v1-11 params volume) -4) + (set! (-> v1-11 auto-time) 24) + (set! (-> v1-11 auto-from) 2) + (set! (-> v1-11 params mask) (the-as uint 17)) + (-> v1-11 id) + ) + ) + (else + (let ((s4-0 (-> arg0 root-override trans))) + (if (movie?) + (set! s4-0 (camera-pos)) + ) + (let ((f28-0 (+ 0.25 (* 0.75 f30-0)))) + (sound-play-by-name + (static-sound-name "sig-gun-powerup") + (-> obj powerup-sound-id) + (the int (* 1024.0 f28-0)) + (the int (* 1524.0 (+ 0.5 (* 0.5 f30-0)))) + 0 + (sound-group sfx) + s4-0 + ) + (sound-play-by-name + (static-sound-name "sig-gun-plasma") + (-> obj plasma-sound-id) + (the int (* 1024.0 f28-0)) + (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) + 0 + (sound-group sfx) + s4-0 + ) + ) + ) + (when (not (logtest? (-> arg0 draw status) (draw-control-status no-draw))) + (let ((s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data 24)))) + (set! (-> *part-id-table* 667 init-specs 2 initial-valuef) (lerp 409.6 9216.0 f30-0)) + (set! (-> *part-id-table* 667 init-specs 8 initial-valuef) (lerp 0.0 32.0 f30-0)) + (set! (-> *part-id-table* 668 init-specs 2 initial-valuef) (lerp 409.6 32768.0 f30-0)) + (set! (-> *part-id-table* 668 init-specs 8 initial-valuef) (lerp 0.0 16.0 f30-0)) + (set! (-> *part-id-table* 666 init-specs 2 initial-valuef) (lerp 409.6 8192.0 f30-0)) + (set! (-> *part-id-table* 665 init-specs 1 initial-valuef) (lerp 0.1 1.0 f30-0)) + (set! (-> *part-id-table* 665 init-specs 2 initial-valuef) (lerp 409.6 3686.4 f30-0)) + (spawn (-> arg0 part) s5-2) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 12 of type sig-plasma +;; WARN: Return type mismatch uint vs none. +(defmethod sig-plasma-method-12 sig-plasma ((obj sig-plasma)) + (let ((f0-0 (-> obj level))) + (-> obj min-level) + (when (>= f0-0 1.0) + (set! f0-0 0.99) + (set! (-> obj level) f0-0) + ) + (set! (-> obj min-level) (fmax 0.0 (+ -0.5 f0-0))) + ) + (set! (-> obj flags) (logand -23 (-> obj flags))) + (none) + ) + +;; definition for method 11 of type sig-plasma +;; WARN: Return type mismatch uint vs none. +(defmethod sig-plasma-method-11 sig-plasma ((obj sig-plasma) (arg0 symbol)) + (set! (-> obj min-level) 0.0) + (cond + (arg0 + (set! (-> obj level) 0.0) + ) + (else + (if (>= (-> obj level) 1.0) + (set! (-> obj level) 0.99) + ) + ) + ) + (set! (-> obj flags) (logand -24 (-> obj flags))) + (none) + ) + +;; definition for method 9 of type sig-plasma +;; WARN: Return type mismatch uint vs none. +(defmethod sig-plasma-method-9 sig-plasma ((obj sig-plasma)) + (logior! (-> obj flags) 8) + (none) + ) + +;; definition for method 10 of type sig-plasma +(defmethod sig-plasma-method-10 sig-plasma ((obj sig-plasma)) + (logtest? (-> obj flags) 4) + ) + +;; definition for method 13 of type sig-plasma +(defmethod sig-plasma-method-13 sig-plasma ((obj sig-plasma)) + (and (logtest? (-> obj flags) 8) (logtest? (-> obj flags) 16)) + ) + + + + diff --git a/test/decompiler/reference/jak2/characters/sig/sig-shot_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig-shot_REF.gc new file mode 100644 index 0000000000..a8a60cb30d --- /dev/null +++ b/test/decompiler/reference/jak2/characters/sig/sig-shot_REF.gc @@ -0,0 +1,560 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 652 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x45 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.75)) + (sp-flt spt-scale-y (meters 10)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +;; failed to figure out what this is: +(defpart 653 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 3) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 654 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x34 :page #xc)) + (sp-flt spt-num 1.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 16.0 32.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters 0.013333334) (meters 0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.28) + (sp-flt spt-fade-b -1.28) + (sp-flt spt-fade-a -0.48) + (sp-int spt-timer 100) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 655 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x46 :page #xc)) + (sp-func spt-birth-func 'birth-func-set-quat) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2)) + (sp-flt spt-scale-y (meters 4.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -3.6571429) + (sp-int spt-timer 35) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sig-shot-hit + :id 146 + :duration (seconds 1) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 656 :period 600 :length 5) + (sp-item 657 :fade-after (meters 100) :period 600 :length 5) + (sp-item 658 :period 600 :length 5) + (sp-item 659 :fade-after (meters 50) :falloff-to (meters 50) :period 600 :length 200) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 200) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 150) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 125) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 100) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 75) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 65) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 50) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 40) + (sp-item 660 :fade-after (meters 100) :falloff-to (meters 100) :period 600 :length 25) + ) + ) + +;; failed to figure out what this is: +(defpart 659 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.0 0.2 1.0) + (sp-flt spt-y (meters 0.25)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.06666667) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.001) (meters -0.00033333333) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -2.4) 1 873.81335) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.10666667) + (sp-flt spt-fade-b -0.10666667) + (sp-rnd-flt spt-accel-y -1.3653333 -5.4613333 1.0) + (sp-flt spt-friction 0.9) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 200) + (sp-launcher-by-id spt-next-launcher 661) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 660 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 96.0) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.013333334) 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.0005) (meters -0.0005) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.10666667) + (sp-flt spt-fade-b -0.10666667) + (sp-rnd-flt spt-accel-y -1.3653333 -5.4613333 1.0) + (sp-flt spt-friction 0.8) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 200) + (sp-launcher-by-id spt-next-launcher 661) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 661 + :init-specs ((sp-flt spt-fade-a -0.96)) + ) + +;; failed to figure out what this is: +(defpart 657 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 0.1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-rotvel-z (degrees -0.1)) + (sp-flt spt-fade-a -0.32) + (sp-int spt-timer 400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 662) + ) + ) + +;; failed to figure out what this is: +(defpart 662 + :init-specs ((sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-int spt-next-time 5) + (sp-launcher-by-id spt-next-launcher 662) + ) + ) + +;; failed to figure out what this is: +(defpart 658 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 2.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 32.0 8.0 1.0) + (sp-rnd-flt spt-b 32.0 8.0 1.0) + (sp-flt spt-a 48.0) + (sp-flt spt-scalevel-x (meters 0.12857144)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.9142857) + (sp-flt spt-fade-b -0.9142857) + (sp-int spt-timer 400) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2) + (sp-int spt-next-time 35) + (sp-launcher-by-id spt-next-launcher 663) + ) + ) + +;; failed to figure out what this is: +(defpart 663 + :init-specs ((sp-flt spt-scale-x (meters 4.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.010958904)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.38356164) + (sp-flt spt-fade-b 0.0) + (sp-flt spt-fade-a -0.13150685) + ) + ) + +;; failed to figure out what this is: +(defpart 656 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters 0.16666667)) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-int spt-timer 55) + (sp-cpuinfo-flags sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 664) + ) + ) + +;; failed to figure out what this is: +(defpart 664 + :init-specs ((sp-flt spt-scale-x (meters 3.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-scalevel-x (meters -0.0875)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-b -6.4) + ) + ) + +;; definition of type sig-shot +(deftype sig-shot (projectile) + ((tail-pos vector :inline :offset-assert 480) + (hit-pos vector :inline :offset-assert 496) + ) + :heap-base #x180 + :method-count-assert 40 + :size-assert #x200 + :flag-assert #x2801800200 + ) + +;; definition for method 3 of type sig-shot +(defmethod inspect sig-shot ((obj sig-shot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 obj) + ) + (format #t "~2Ttail-pos: #~%" (-> obj tail-pos)) + (format #t "~2Thit-pos: #~%" (-> obj hit-pos)) + (label cfg-4) + obj + ) + +;; definition for method 24 of type sig-shot +;; WARN: Return type mismatch int vs none. +(defmethod draw-laser-sight sig-shot ((obj sig-shot)) + "TODO - confirm If applicable, draw the laser sight particles + :virtual" + (draw-beam (-> *part-id-table* 655) (-> obj tail-pos) (-> obj starting-dir) #f #t) + 0 + (none) + ) + +;; definition for method 25 of type sig-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-impact-particles sig-shot ((obj sig-shot)) + "Spawns associated particles with the projectile if applicable" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((v1-1 (-> obj root-override trans)) + (a1-0 (-> obj tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-2 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> gp-0 quad) vf6) + (let ((f30-0 (-> *part-id-table* 652 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 652 init-specs 4 initial-valuef) (fmin f30-0 (vector-length s5-1))) + (draw-beam (-> *part-id-table* 652) a1-0 s5-1 #f #t) + (set! (-> *part-id-table* 652 init-specs 4 initial-valuef) f30-0) + ) + (vector-normalize! s5-1 1.0) + (let ((t9-2 sp-launch-particles-var) + (a0-5 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 653)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> gp-0 quad)) + (t9-2 a0-5 a1-2 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((f0-4 (vector-dot s5-1 (-> (camera-matrix) vector 2)))) + (when (< 0.0 f0-4) + (let ((f0-5 (* f0-4 f0-4)) + (f30-1 (-> *part-id-table* 654 init-specs 8 initial-valuef)) + (f28-0 (-> *part-id-table* 654 init-specs 8 random-rangef)) + ) + (set! (-> *part-id-table* 654 init-specs 8 initial-valuef) (* f30-1 f0-5)) + (set! (-> *part-id-table* 654 init-specs 8 random-rangef) (* f28-0 f0-5)) + (let ((t9-4 sp-launch-particles-var) + (a0-6 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 654)) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> gp-0 quad)) + (t9-4 a0-6 a1-3 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (set! (-> *part-id-table* 654 init-specs 8 initial-valuef) f30-1) + (set! (-> *part-id-table* 654 init-specs 8 random-rangef) f28-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type sig-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-shell-particles sig-shot ((obj sig-shot)) + "TODO - confirm" + (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) + (when gp-0 + (let ((t9-1 (method-of-type part-tracker activate))) + (t9-1 + (the-as part-tracker gp-0) + *entity-pool* + (symbol->string (-> part-tracker symbol)) + (the-as pointer #x70004000) + ) + ) + (let ((t9-2 run-function-in-process) + (a0-3 gp-0) + (a1-2 part-tracker-init) + (a2-4 (-> *part-group-id-table* 146)) + (a3-1 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 #f) + (t3-0 *launch-matrix*) + ) + (set! (-> t3-0 trans quad) (-> obj root-override trans quad)) + ((the-as (function object object object object object object object object none) t9-2) + a0-3 + a1-2 + a2-4 + a3-1 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + (-> gp-0 ppointer) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type sig-shot +;; WARN: Return type mismatch int vs sound-id. +(defmethod play-impact-sound sig-shot ((obj sig-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "sig-shot-fire") + ) + ((= v1-0 (projectile-options lose-altitude)) + (sound-play "sig-shot-hit") + ) + ) + ) + (the-as sound-id 0) + ) + +;; definition for method 38 of type sig-shot +(defmethod made-impact? sig-shot ((obj sig-shot)) + "TODO - queries the collision cache, return true/false" + (let ((v1-0 (-> obj root-override)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a1-0 t1-0)) + (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a1-0 ignore-process0) obj) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) + ) + ) + +;; definition for function sig-shot-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sig-shot-move ((arg0 sig-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root-override))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 40960.0 f0-0) + (vector-normalize! s4-0 40960.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (let ((v1-9 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-5 (-> arg0 hit-pos)) + ) + (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector+! a1-5 a1-5 v1-9) + (move-to-point! (-> arg0 root-override) a1-5) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type sig-shot +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! sig-shot ((obj sig-shot)) + "Init the [[projectile]]'s [[collide-shape]]" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> obj root-override) s5-0) + ) + (let ((v1-22 (-> obj parent))) + (when (not (logtest? (-> (the-as sig (if v1-22 + (the-as sig (-> v1-22 0 self)) + ) + ) + bot-flags + ) + (bot-flags attacked) + ) + ) + (let* ((a0-16 (-> obj root-override)) + (v1-27 (-> a0-16 root-prim)) + ) + (countdown (a0-17 (-> a0-16 total-prims)) + (logclear! (-> v1-27 prim-core collide-with) (collide-spec jak)) + (&+! v1-27 80) + ) + ) + ) + ) + (set! (-> obj root-override pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) + ) + (none) + ) + +;; definition for method 31 of type sig-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! sig-shot ((obj sig-shot)) + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc + :virtual" + (set! (-> obj tail-pos quad) (-> obj root-override trans quad)) + (set! (-> obj attack-mode) 'eco-yellow) + (set! (-> obj max-speed) 307200.0) + (set! (-> obj move) sig-shot-move) + (set! (-> obj timeout) (seconds 1.335)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/characters/sig/sig-states_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig-states_REF.gc new file mode 100644 index 0000000000..3004feab14 --- /dev/null +++ b/test/decompiler/reference/jak2/characters/sig/sig-states_REF.gc @@ -0,0 +1,2057 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate waiting-crouched (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-active)) + (logior! (-> self focus-status) (focus-status disable)) + (none) + ) + :exit (behavior () + (local-vars (v1-1 enemy-flag)) + (let ((v1-0 (-> self enemy-flags))) + (if (logtest? v1-0 (enemy-flag checking-water)) + (set! v1-1 (logior v1-0 (enemy-flag enable-on-active))) + (set! v1-1 (logclear v1-0 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-1) + (logclear! (-> self focus-status) (focus-status disable)) + (none) + ) + :trans (behavior () + (if (and (not (logtest? (-> self focus-status) (focus-status grabbed))) + (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + ) + (go-virtual traveling) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 47) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 47)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate waiting-far (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ((sig-method-251 self) + (go-virtual charge-plasma) + ) + ((sig-method-254 self) + (go-virtual clean-gun) + ) + ) + ) + (if (and (-> self focus-info fproc) + (or (< (-> self focus-info bullseye-xz-dist) 90112.0) + (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) + ) + ) + (go-virtual waiting-close) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 6))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.2)) + ) + ((let ((v1-17 (ja-group))) + (and v1-17 (= v1-17 (-> self draw art-group data 4))) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate waiting-close (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ((and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) + (go-virtual waiting-turn) + ) + ((sig-method-251 self) + (go-virtual charge-plasma) + ) + ((sig-method-254 self) + (go-virtual clean-gun) + ) + ) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) + (or (not (-> self focus-info fproc)) (>= (-> self focus-info bullseye-xz-dist) 102400.0)) + ) + (go-virtual waiting-far) + ) + (none) + ) + :code (behavior () + (let* ((v1-2 (ja-group)) + (gp-0 + (-> self + draw + art-group + data + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 4))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + 7 + ) + (else + (let ((v1-32 (ja-group))) + (cond + ((and v1-32 (= v1-32 (-> self draw art-group data 5))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + (let ((v1-46 (ja-group))) + (cond + ((and v1-46 (= v1-46 (-> self draw art-group data 7))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + 7 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-62 (ja-group))) + (if (not (and v1-62 (= v1-62 gp-0))) + (ja-channel-push! 1 (seconds 0.3)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate waiting-turn (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + (none) + ) + :code (behavior () + (local-vars (s4-1 art-element) (f0-19 float)) + (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) + (let ((s5-0 (-> self focus-info fproc))) + (if (not s5-0) + (go-virtual waiting-close) + ) + (turn-to-target self gp-0 s5-0 1.4361539) + ) + (let ((v1-8 (ja-group))) + (cond + ((and v1-8 (or (= v1-8 (-> self draw art-group data 4)) (= v1-8 (-> self draw art-group data 6)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.04)) + ) + (else + (let ((v1-38 (ja-group))) + (cond + ((and v1-38 (= v1-38 (-> self draw art-group data 5))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.04)) + ) + (else + (let ((v1-53 (ja-group))) + (if (and v1-53 (= v1-53 (-> self draw art-group data 7))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-channel-push! 1 (seconds 0.3)) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((a2-4 (-> self focus-info fproc))) + (if a2-4 + (turn-to-target self gp-0 a2-4 1.4361539) + ) + ) + (let ((s4-0 (>= (-> gp-0 predicted-ry-diff) 0.0))) + (let ((a1-11 (-> self draw art-group data (if s4-0 + 48 + 52 + ) + ) + ) + ) + (ja-no-eval :group! a1-11 + :num! (seek! (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1)) 1.3) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.3)) + ) + (let ((a2-7 (-> self focus-info fproc))) + (if a2-7 + (turn-to-target self gp-0 a2-7 1.2307693) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'quaternion)) + (f0-18 (-> gp-0 predicted-ry-diff)) + (f30-0 4.0) + (f28-0 28.0) + ) + (cond + (s4-0 + (if (< f0-18 0.0) + (set! f0-18 (+ 65536.0 f0-18)) + ) + (cond + ((< f0-18 18204.445) + (set! f0-19 9102.223) + (set! s4-1 (-> self draw art-group data 49)) + (set! f28-0 18.0) + ) + ((< f0-18 27306.666) + (set! f0-19 18204.445) + (set! s4-1 (-> self draw art-group data 50)) + ) + (else + (set! f0-19 27306.666) + (set! s4-1 (-> self draw art-group data 51)) + ) + ) + ) + (else + (if (>= f0-18 0.0) + (set! f0-18 (+ -65536.0 f0-18)) + ) + (cond + ((< -18204.445 f0-18) + (set! f0-19 -9102.223) + (set! s4-1 (-> self draw art-group data 53)) + (set! f28-0 18.0) + ) + ((< -27306.666 f0-18) + (set! f0-19 -18204.445) + (set! s4-1 (-> self draw art-group data 54)) + ) + (else + (set! f0-19 -27306.666) + (set! s4-1 (-> self draw art-group data 55)) + ) + ) + ) + ) + (quaternion-rotate-y! s5-1 (-> gp-0 src-quat) f0-19) + (ja-no-eval :group! s4-1 + :num! (seek! (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)) 1.3) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((f0-24 (ja-aframe-num 0))) + (cond + ((< f0-24 f28-0) + (if (>= f0-24 f30-0) + (quaternion-slerp! (-> self root-override2 quat) (-> gp-0 src-quat) s5-1 (/ (- f0-24 f30-0) (- f28-0 f30-0))) + ) + ) + (else + (quaternion-copy! (-> self root-override2 quat) s5-1) + ) + ) + ) + (suspend) + (ja :num! (seek! max 1.3)) + ) + ) + ) + ) + (go-virtual waiting-close) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate charge-plasma (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self plasma flags) (logand -29 (-> self plasma flags))) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (set! (-> self plasma flags) (logand -15 (-> self plasma flags))) + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ((not (sig-method-251 self)) + (go-virtual waiting-close) + ) + ) + ) + (if (>= (-> self plasma level) 1.0) + (logior! (-> self plasma flags) 4) + (set! (-> self plasma flags) (logand -5 (-> self plasma flags))) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! (-> self draw art-group data 35) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 35)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (logior! (-> self plasma flags) 2) + (ja-channel-push! 1 (seconds 0.07)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 36) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 36)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (and (logtest? (-> self plasma flags) 4) (logtest? (-> self plasma flags) 8)) + (goto cfg-12) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (label cfg-12) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 37) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 37)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.07)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 38) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 38)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (logtest? (-> self plasma flags) 8) + (logior! (-> self plasma flags) 16) + (set! (-> self plasma flags) (logand -17 (-> self plasma flags))) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (behavior () + (set! (-> self plasma flags) (logand -9 (-> self plasma flags))) + (nav-enemy-simple-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate gun-jam (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 12) :num! (seek! (ja-aframe 8.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 8.0 0))) + ) + (sound-play "sig-gun-jam") + (logclear! (-> self bot-flags) (bot-flags bf20)) + (set! (-> self bot-flags) (logior (bot-flags bf19) (-> self bot-flags))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (go-virtual repair-gun) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate repair-gun (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (if (bot-method-214 self) + (go-hostile self) + ) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) (zero? (-> self played-unjam-time))) + (set! (-> self played-unjam-time) (-> self clock frame-counter)) + (sound-play "sig-gun-unjam") + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 26) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 26)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-channel-push! 1 (seconds 0.07)) + (countdown (gp-0 (get-rand-int-range self 2 4)) + (ja-no-eval :group! (-> self draw art-group data 27) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 27)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 28) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 28)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.13)) + (ja-no-eval :group! (-> self draw art-group data 29) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 31) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.13)) + (ja-no-eval :group! (-> self draw art-group data 30) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 32) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 32)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + (countdown (gp-1 (get-rand-int-range self 2 3)) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 33) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 33)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 34) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) + (>= (- (-> self clock frame-counter) (-> self played-unjam-time)) (seconds 0.35)) + ) + (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) + (go-virtual waiting-close) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate clean-gun (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-110 self) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (countdown (gp-0 2) + 0 + (cond + ((= gp-0 1) + (let ((s5-0 (get-rand-int-range self 1 2))) + (ja-channel-push! 1 (seconds 0.13)) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! (-> self draw art-group data 29) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 29)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (else + (let ((s5-1 (get-rand-int-range self 1 4))) + (ja-channel-push! 1 (seconds 0.13)) + (while (nonzero? s5-1) + (+! s5-1 -1) + (ja-no-eval :group! (-> self draw art-group data 30) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + (when (nonzero? gp-0) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 31) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate traveling (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info-override callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-5 enemy-flags)))) + ) + 0 + (enemy-method-110 self) + (nav-enemy-method-166 self) + (set! (-> self skel top-anim interp) 1.0) + (set! (-> self player-blocking) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) + (go-virtual waiting-close) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + (go-virtual traveling-blocked) + ) + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ) + 0 + (none) + ) + :code (behavior () + (until #f + (sig-method-258 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self spot)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-post quad) (-> v1-1 center quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate traveling-blocked (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (cond + ((bot-method-214 self) + (go-hostile self) + ) + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + (go-virtual traveling) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.3)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate stare (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (when (bot-method-214 self) + (cond + ((sig-method-246 self) + (go-virtual whip) + ) + ((sig-method-245 self) + (go-virtual blast) + ) + ) + ) + (cond + ((sig-method-252 self) + (go-virtual gun-jam) + ) + ((sig-method-255 self) + (go-virtual repair-gun) + ) + ((not (nav-enemy-method-163 self)) + (go-virtual traveling) + ) + ) + ) + (none) + ) + :code (behavior () + (let* ((v1-2 (ja-group)) + (gp-0 + (-> self + draw + art-group + data + (cond + ((and v1-2 (= v1-2 (-> self draw art-group data 4))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 5) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + 7 + ) + (else + (let ((v1-32 (ja-group))) + (cond + ((and v1-32 (= v1-32 (-> self draw art-group data 5))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + (let ((v1-46 (ja-group))) + (cond + ((and v1-46 (= v1-46 (-> self draw art-group data 7))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + 7 + ) + (else + 7 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-62 (ja-group))) + (if (not (and v1-62 (= v1-62 gp-0))) + (ja-channel-push! 1 (seconds 0.3)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate whip (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-11 *game-info*) + (a0-6 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-6) + (set! (-> self attack-id) a0-6) + ) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (enemy-method-46 self 0) + (none) + ) + :trans (behavior () + (bot-method-223 self #f) + (none) + ) + :code (behavior () + (local-vars (a1-2 art-element)) + (enemy-method-46 self 3) + (ja-channel-push! 1 (seconds 0.1)) + 0.0 + (let ((f30-0 (cond + ((< (fabs (-> self focus-info ry-diff)) 8192.0) + (set! a1-2 (-> self draw art-group data 9)) + 18.0 + ) + ((< (-> self focus-info ry-diff) 0.0) + (set! a1-2 (-> self draw art-group data 11)) + 16.0 + ) + (else + (set! a1-2 (-> self draw art-group data 10)) + 18.0 + ) + ) + ) + ) + (ja-no-eval :group! a1-2 + :num! (seek! (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (and (logtest? (-> self focus-status) (focus-status dangerous)) (< f30-0 (ja-aframe-num 0))) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (enemy-method-72 self) + (none) + ) + :post (behavior () + (seek-toward-heading-vec! + (-> self root-override2) + (-> self focus-info bullseye-xz-dir) + 131072.0 + (seconds 0.05) + ) + (nav-enemy-simple-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate blast (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (if (not (handle->process (-> self focus handle))) + (enemy-method-72 self) + ) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (none) + ) + :code (behavior () + (local-vars (gp-0 art-element)) + (let ((f30-0 8.0)) + (cond + ((< (fabs (-> self focus-info ry-diff)) 8192.0) + (ja-channel-push! 1 (seconds 0.1)) + (set! gp-0 (-> self draw art-group data 12)) + ) + ((< (-> self focus-info ry-diff) 0.0) + (ja-channel-push! 1 (seconds 0.1)) + (set! gp-0 (-> self draw art-group data 14)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (set! gp-0 (-> self draw art-group data 13)) + ) + ) + (let ((f30-1 (ja-aframe f30-0 0))) + (ja-no-eval :group! gp-0 :num! (seek! f30-1) :frame-num 0.0) + (until (ja-done? 0) + (seek-toward-heading-vec! + (-> self root-override2) + (-> self focus-info bullseye-xz-dir) + 131072.0 + (seconds 0.05) + ) + (bot-method-223 self #t) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) + (or (not (bot-method-214 self)) (not (sig-method-245 self))) + ) + (enemy-method-72 self) + ) + (suspend) + (ja :num! (seek! f30-1)) + ) + ) + ) + (bot-method-223 self #t) + (if (and (bot-method-214 self) (sig-method-245 self)) + (fire-gun self (-> self focus-info bullseye)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (bot-method-223 self #f) + (if (and (bot-method-214 self) (sig-method-246 self)) + (go-virtual whip) + ) + (suspend) + (ja-eval) + ) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (enemy-method-72 self) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate chase (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (set! (-> self skel top-anim interp) 1.0) + (none) + ) + :trans (behavior () + (bot-method-223 self #t) + (cond + ((and (nav-enemy-method-163 self) + (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self reaction-time))) + ) + (go-stare2 self) + ) + ((not (bot-method-214 self)) + (go-virtual traveling) + ) + ((sig-method-246 self) + (go-virtual whip) + ) + ((sig-method-245 self) + (go-virtual blast) + ) + ((and (not (logtest? (bot-flags bf19) (-> self bot-flags))) + (= (-> self focus-info los) 1) + (-> self focus-info fproc) + (>= 3640.889 (fabs (-> self focus-info ry-diff))) + (>= 81920.0 (-> self focus-info bullseye-xz-dist)) + ) + (go-virtual chase-attack) + ) + ) + (none) + ) + :code (behavior () + (until #f + (sig-method-258 self) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-6 (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate chase-attack (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type sig chase) enter)) + (set! (-> self skel top-anim interp) 1.0) + (if (not (handle->process (-> self focus handle))) + (go-virtual traveling) + ) + (set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags))) + (none) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (none) + ) + :code (behavior () + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim (-> self draw art-group data 45)) + 0.0 + 9 + 9 + 1.0 + 0.0 + #f + ) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.167)) + (sig-method-258 self) + (suspend) + ) + (bot-method-223 self #t) + (let ((a1-2 (-> self focus-info fproc))) + (cond + ((and a1-2 + (logtest? (-> self bot-flags) (bot-flags bf00)) + (not (logtest? (bot-flags bf19) (-> self bot-flags))) + (attacked-by-player? self a1-2) + (= (-> self focus-info los) 1) + ) + (fire-gun self (-> self focus-info bullseye)) + 0 + ) + (else + (push-anim-to-targ + (-> self skel top-anim) + (the-as art-joint-anim (-> self draw art-group data 44)) + 0.0 + 30 + 0 + 1.0 + 0.0 + #f + ) + ) + ) + ) + (until (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.8)) + (sig-method-258 self) + (suspend) + ) + (if (logtest? (-> self bot-flags) (bot-flags attacked)) + (reset-attacker! self) + ) + (go-virtual chase) + (none) + ) + :post (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (-> self nav state)) + (v1-7 (get-trans (the-as process-focusable a0-1) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-post quad) (-> v1-7 quad)) + ) + 0 + ) + ) + (nav-enemy-travel-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hit (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :code (behavior () + (local-vars (v1-31 enemy-flag) (v1-39 enemy-flag)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-30 (-> self enemy-flags))) + (if (logtest? v1-30 (enemy-flag checking-water)) + (set! v1-31 (logior v1-30 (enemy-flag enable-on-active))) + (set! v1-31 (logclear v1-30 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-31) + (if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> self mask) (logior (process-mask collectable) (-> self mask))) + (logclear! (-> self mask) (process-mask collectable)) + ) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? (enemy-flag no-initial-move-to-ground) v1-38) + (set! v1-39 (logior (enemy-flag check-water-backup) v1-38)) + (set! v1-39 (logclear v1-38 (enemy-flag check-water-backup))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> self focus-status) (focus-status hit)) + (enemy-method-72 self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (sig) + :virtual #t + :enter (behavior () + (sig-plasma-method-12 (-> self plasma)) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (let ((t9-1 (-> (method-of-type bot knocked) enter))) + (if t9-1 + (t9-1) + ) + ) + (if (logtest? (bot-flags bf19 bf20) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flags bf12)) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die-falling (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (sig-plasma-method-11 (-> self plasma) #f) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self skel top-anim interp) 0.0) + (play-death-sound self "sigt093") + (none) + ) + ) + +;; failed to figure out what this is: +(defstate failed (sig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot failed) enter))) + (if t9-0 + (t9-0) + ) + ) + (sig-plasma-method-11 (-> self plasma) #f) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self skel top-anim interp) 0.0) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 7) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data 6) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self state-time) (-> self clock frame-counter)) + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (if (and (logtest? (-> self bot-flags) (bot-flags failed)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) + (reset? *fail-mission-control*) + ) + (reset! *fail-mission-control*) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate sig-path-run (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (if (logtest? (-> gp-0 flags) 1) + (go-virtual sig-path-jump) + ) + (if (logtest? (-> gp-0 flags) 2) + (go-virtual sig-path-shoot-jump) + ) + (let ((v1-14 (-> self root-override2))) + (set! (-> v1-14 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-14 trans w) 1.0) + (quaternion-copy! (-> v1-14 quat) (-> gp-0 quat)) + ) + ) + (if (sig-method-257 self) + (go-virtual sig-path-idle) + ) + (none) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (and v1-2 (or (= v1-2 (-> self draw art-group data 58)) (= v1-2 (-> self draw art-group data 60)))) + (ja-channel-push! 1 (seconds 0.07)) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data 56) :num! (loop!)) + (until #f + (suspend) + (let* ((f0-1 (vector-length (-> self root-override2 transv))) + (f0-3 (fmax 0.1 (* 0.000020345053 f0-1))) + ) + (ja :num! (loop! f0-3)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate sig-path-jump (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self bot-flags) (logior (bot-flags bf24) (-> self bot-flags))) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 1)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-jump) + ) + (if (logtest? s5-0 2) + (go-virtual sig-path-shoot-jump) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (go-virtual sig-path-jump-land) + ) + ) + (let ((v1-27 (-> self root-override2))) + (set! (-> v1-27 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-27 trans w) 1.0) + (quaternion-copy! (-> v1-27 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (let ((f30-0 0.0)) + (let ((v1-2 (ja-group))) + (if (and v1-2 (= v1-2 (-> self draw art-group data 57))) + (set! f30-0 1.0) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 57) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 57)) frames num-frames) -1))) + :frame-num f30-0 + ) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate sig-path-jump-land (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 1)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-jump) + ) + (if (logtest? s5-0 2) + (go-virtual sig-path-shoot-jump) + ) + ) + (let ((v1-18 (-> self root-override2))) + (set! (-> v1-18 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-18 trans w) 1.0) + (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (let* ((f0-0 (vector-length (-> self root-override2 transv))) + (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + ) + (ja-no-eval :group! (-> self draw art-group data 58) + :num! (seek! + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 58)) frames num-frames) -1)) + f0-2 + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (suspend) + (let* ((f0-4 (vector-length (-> self root-override2 transv))) + (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + ) + (ja :num! (seek! max f0-6)) + ) + ) + (go-virtual sig-path-run) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate sig-path-shoot-jump (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self bot-flags) (logior (bot-flags bf24) (-> self bot-flags))) + (logclear! (-> self bot-flags) (bot-flags bf25)) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 2)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-shoot-jump) + ) + (if (and (logtest? s5-0 1) (logtest? (bot-flags bf25) (-> self bot-flags))) + (go-virtual sig-path-jump) + ) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (go-virtual sig-path-shoot-jump-land) + ) + ) + (let ((v1-29 (-> self root-override2))) + (set! (-> v1-29 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-29 trans w) 1.0) + (quaternion-copy! (-> v1-29 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (let ((f30-0 0.0)) + (let ((v1-2 (ja-group))) + (if (and v1-2 (= v1-2 (-> self draw art-group data 59))) + (set! f30-0 1.0) + ) + ) + (ja-channel-push! 1 (seconds 0.07)) + (ja-no-eval :group! (-> self draw art-group data 59) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 59)) frames num-frames) -1))) + :frame-num f30-0 + ) + ) + (until (ja-done? 0) + (if (and (not (logtest? (bot-flags bf25) (-> self bot-flags))) + (and (< 5.0 (ja-aframe-num 0)) (sig-method-250 self)) + ) + (set! (-> self bot-flags) (logior (bot-flags bf25) (-> self bot-flags))) + ) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate sig-path-shoot-jump-land (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (none) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'sig-path-sample))) + (sig-method-248 self gp-0) + (let ((s5-0 (-> gp-0 flags))) + (if (not (logtest? s5-0 2)) + (logclear! (-> self bot-flags) (bot-flags bf24)) + ) + (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (go-virtual sig-path-shoot-jump) + ) + (if (logtest? s5-0 1) + (go-virtual sig-path-jump) + ) + ) + (let ((v1-18 (-> self root-override2))) + (set! (-> v1-18 trans quad) (-> gp-0 pos quad)) + (set! (-> v1-18 trans w) 1.0) + (quaternion-copy! (-> v1-18 quat) (-> gp-0 quat)) + ) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (let* ((f0-0 (vector-length (-> self root-override2 transv))) + (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + ) + (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)) + f0-2 + ) + :frame-num 0.0 + ) + ) + (until (ja-done? 0) + (suspend) + (let* ((f0-4 (vector-length (-> self root-override2 transv))) + (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + ) + (ja :num! (seek! max f0-6)) + ) + ) + (go-virtual sig-path-run) + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + +;; failed to figure out what this is: +(defstate sig-path-idle (sig) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior sig) enemy-event-handler) + :enter (behavior () + (set! (-> self state-time) (-> self clock frame-counter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) + ) + 0 + (nav-enemy-method-167 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37)))) + ) + 0 + (enemy-method-109 self 1) + (set! (-> self skel top-anim interp) 0.0) + (set! (-> self travel-anim-interp) 0.0) + (vector-reset! (-> self root-override2 transv)) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (ja-no-eval :group! (-> self draw art-group data 61) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 61)) 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 62) + :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 62)) frames num-frames) -1))) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior sig) nav-enemy-simple-post) + ) + + + + diff --git a/test/decompiler/reference/jak2/characters/sig/sig-task_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig-task_REF.gc new file mode 100644 index 0000000000..80782acd3f --- /dev/null +++ b/test/decompiler/reference/jak2/characters/sig/sig-task_REF.gc @@ -0,0 +1,459 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type sigt-wait-spot +;; WARN: Return type mismatch int vs none. +(defmethod reset-task! sigt-wait-spot ((obj sigt-wait-spot)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 11 of type sigt-wait-spot +(defmethod ai-task-method-11 sigt-wait-spot ((obj sigt-wait-spot) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (when (>= s4-0 0) + (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) + (set! s4-0 -1) + ) + ) + ) + (when (< s4-0 0) + (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) + (set! (-> obj which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + 20 + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + ) + (when (not ((-> obj check-done) obj (the-as sig arg0))) + (let ((a1-10 (handle->process (-> arg0 focus handle)))) + (cond + ((and a1-10 + (attacked-by-player? arg0 (the-as process-focusable a1-10)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ((logtest? (bot-flags bf19) (-> arg0 bot-flags)) + (get-task-by-type (-> arg0 ai-ctrl) sigt-repair-gun arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + ) + (none) + ) + +;; definition for method 11 of type sigt-fight-focus +(defmethod ai-task-method-11 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) + "Virtual" + (let ((a1-1 (handle->process (-> arg0 focus handle)))) + (if (and a1-1 + (attacked-by-player? arg0 (the-as process-focusable a1-1)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (logior! (-> arg0 bot-flags) (bot-flags bf00)) + (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + ) + ) + (none) + ) + +;; definition for method 10 of type sigt-fight-focus +;; WARN: Return type mismatch bot-flags vs none. +(defmethod ai-task-method-10 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) + "Virtual" + (logclear! (-> arg0 bot-flags) (bot-flags bf00)) + (none) + ) + +;; definition for method 11 of type sigt-repair-gun +(defmethod ai-task-method-11 sigt-repair-gun ((obj sigt-repair-gun) (arg0 bot)) + "Virtual" + (cond + ((not (logtest? (bot-flags bf19) (-> arg0 bot-flags))) + (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + ) + (else + (let ((a1-4 (handle->process (-> arg0 focus handle)))) + (when (and a1-4 + (attacked-by-player? arg0 (the-as process-focusable a1-4)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + ) + (none) + ) + +;; definition for method 14 of type sigt-choose-piston +(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig) (arg1 int)) + (let* ((v1-2 (-> arg0 course spots (-> obj spot-indexes arg1))) + (a0-6 (-> arg0 actor-group 0 data (-> obj actor-indexes arg1) actor)) + (gp-0 (if a0-6 + (-> a0-6 extra process) + ) + ) + ) + (or (player-blocking-spot? arg0 v1-2) + (or (not gp-0) + (>= 14336.0 + (vector-vector-xz-distance (target-pos 0) (-> (the-as process-focusable gp-0) root-override trans)) + ) + ) + ) + ) + ) + +;; definition for method 13 of type sigt-choose-piston +;; WARN: Return type mismatch int vs none. +(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) + (let ((s4-0 0)) + (let ((f30-0 -1.0) + (s3-0 (-> arg0 root-override2 trans)) + ) + (countdown (s2-0 (-> obj num-spots)) + (let* ((v1-3 (-> obj spot-indexes s2-0)) + (f28-0 (vector-vector-xz-distance s3-0 (the-as vector (-> arg0 course spots v1-3)))) + ) + (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (not (sigt-choose-piston-method-14 obj arg0 (the-as int s2-0)))) + (set! f30-0 f28-0) + (set! s4-0 (the-as int s2-0)) + ) + ) + ) + ) + (set! (-> obj which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + 20 + ) + (let* ((v1-22 (-> arg0 actor-group 0 data (-> obj actor-indexes s4-0) actor)) + (a0-6 (if v1-22 + (-> v1-22 extra process) + ) + ) + ) + (if a0-6 + (set! (-> arg0 poi-handle) (process->handle a0-6)) + ) + ) + ) + (none) + ) + +;; definition for method 12 of type sigt-choose-piston +;; INFO: Used lq/sq +(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) + (with-pp + (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + (not (sigt-choose-piston-method-14 obj arg0 (-> obj which-spot))) + ) + (let* ((v1-12 (-> arg0 actor-group 0 data (-> obj actor-indexes (-> obj which-spot)) actor)) + (s5-1 (if v1-12 + (-> v1-12 extra process) + ) + ) + ) + (when s5-1 + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'sync) + (let ((v1-19 + (- ((method-of-type sync-info get-timeframe-offset!) (the-as sync-info (send-event-function s5-1 a1-3)) 0) + (-> pp clock frame-counter) + ) + ) + ) + (when (and (< v1-19 (seconds 0.5)) (< (seconds 0.2) v1-19)) + (let ((v1-22 (-> (the-as process-focusable s5-1) root-override)) + (s4-0 (-> arg0 root-override2)) + ) + (when (>= 10012.445 + (fabs (deg- + (atan (- (-> v1-22 trans x) (-> s4-0 trans x)) (- (-> v1-22 trans z) (-> s4-0 trans z))) + (quaternion-y-angle (-> s4-0 quat)) + ) + ) + ) + (set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable)))) + (when (send-event arg0 'jump 4 (-> (the-as process-focusable s5-1) root-override trans)) + (set! (-> arg0 spot center quad) (-> (the-as process-focusable s5-1) root-override trans quad)) + (set! (-> arg0 spot center w) 10240.0) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 9 of type sigt-choose-piston +;; WARN: Return type mismatch int vs none. +(defmethod reset-task! sigt-choose-piston ((obj sigt-choose-piston)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 11 of type sigt-choose-piston +(defmethod ai-task-method-11 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (cond + ((< s4-0 0) + (sigt-choose-piston-method-13 obj (the-as sig arg0)) + ) + ((sigt-choose-piston-method-14 obj (the-as sig arg0) s4-0) + (sigt-choose-piston-method-13 obj (the-as sig arg0)) + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + ) + (when (not ((-> obj check-done) obj (the-as sig arg0))) + (let ((a1-6 (handle->process (-> arg0 focus handle)))) + (when (and a1-6 + (attacked-by-player? arg0 (the-as process-focusable a1-6)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + (none) + ) + +;; definition for method 10 of type sigt-choose-piston +(defmethod ai-task-method-10 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) + "Virtual" + (clear-poi-and-focus! arg0) + (none) + ) + +;; definition for method 12 of type sigt-riding-piston +(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((obj sigt-riding-piston) (arg0 sig)) + (with-pp + (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (let* ((v1-9 (-> arg0 actor-group 0 data (-> arg0 platform-index) actor)) + (a0-4 (if v1-9 + (-> v1-9 extra process) + ) + ) + ) + (when a0-4 + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer pp)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'sync) + (let ((v1-16 + (- ((method-of-type sync-info get-timeframe-offset!) (the-as sync-info (send-event-function a0-4 a1-6)) 0) + (-> pp clock frame-counter) + ) + ) + ) + (when (and (< v1-16 (seconds 2.8)) (< (seconds 1.8) v1-16)) + (let ((v1-19 (-> arg0 nav))) + (set! (-> v1-19 target-speed) 0.0) + ) + 0 + (let ((s5-1 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable)))) + (when (send-event arg0 'jump 0 (-> s5-1 center)) + (mem-copy! (the-as pointer (-> arg0 spot)) (the-as pointer s5-1) 20) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 9 of type sigt-riding-piston +;; WARN: Return type mismatch int vs none. +(defmethod reset-task! sigt-riding-piston ((obj sigt-riding-piston)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 11 of type sigt-riding-piston +;; WARN: Return type mismatch symbol vs none. +(defmethod ai-task-method-11 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) + (set! (-> obj which-spot) s4-0) + (send-event + (ppointer->process (-> arg0 my-simple-focus)) + 'move-trans + (-> arg0 course spots (-> obj spot-indexes s4-0)) + ) + (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + ) + ((-> obj check-done) obj (the-as sig arg0)) + (none) + ) + +;; definition for method 10 of type sigt-riding-piston +(defmethod ai-task-method-10 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) + "Virtual" + (clear-poi-and-focus! arg0) + (none) + ) + +;; definition for method 9 of type sigt-charge-plasma +;; WARN: Return type mismatch int vs none. +(defmethod reset-task! sigt-charge-plasma ((obj sigt-charge-plasma)) + "Virtual" + (set! (-> obj check-done) #f) + (set! (-> obj which-spot) -1) + (set! (-> obj num-spots) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 11 of type sigt-charge-plasma +(defmethod ai-task-method-11 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) + "Virtual" + (let ((s4-0 (-> obj which-spot))) + (when (>= s4-0 0) + (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) + (set! s4-0 -1) + ) + ) + ) + (when (< s4-0 0) + (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) + (set! (-> obj which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + 20 + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-debug-draw-spot-sphere + arg0 + (the-as int (-> obj num-spots)) + (the-as (pointer uint) (-> obj spot-indexes)) + (the-as int (-> obj spot-indexes s4-0)) + ) + ) + (let* ((v1-24 (-> arg0 actor-group 0 data (-> obj actor-index) actor)) + (s3-1 (when v1-24 + (let ((s2-0 (-> v1-24 extra process))) + (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + ) + ) + (cond + (s3-1 + (set! (-> arg0 poi-handle) (process->handle s3-1)) + (set! (-> arg0 focus-mode) 1) + (let ((a1-10 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (if (and (outside-spot-radius? arg0 a1-10 (the-as vector #f) #f) + (enemy-method-95 arg0 (get-trans (the-as process-focusable s3-1) 3) 10012.445) + ) + (logior! (-> arg0 stack 920) 1) + (set! (-> arg0 stack 920) (logand -2 (-> arg0 stack 920))) + ) + ) + ) + (else + (clear-poi-and-focus! arg0) + (set! (-> arg0 stack 920) (logand -2 (-> arg0 stack 920))) + (set! (-> arg0 focus-mode) 0) + 0 + ) + ) + ) + ) + (when (not ((-> obj check-done) obj (the-as sig arg0))) + (let ((a1-14 (handle->process (-> arg0 focus handle)))) + (when (and a1-14 + (attacked-by-player? arg0 (the-as process-focusable a1-14)) + (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + (none) + ) + +;; definition for method 10 of type sigt-charge-plasma +;; WARN: Return type mismatch int vs none. +(defmethod ai-task-method-10 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) + "Virtual" + (clear-poi-and-focus! arg0) + (set! (-> arg0 stack 920) (logand -2 (-> arg0 stack 920))) + (set! (-> arg0 focus-mode) 0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/characters/sig/sig_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig_REF.gc new file mode 100644 index 0000000000..379e733aec --- /dev/null +++ b/test/decompiler/reference/jak2/characters/sig/sig_REF.gc @@ -0,0 +1,1467 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sig-anim-info +(deftype sig-anim-info (structure) + ((anim-index int32 :offset-assert 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type sig-anim-info +(defmethod inspect sig-anim-info ((obj sig-anim-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sig-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (label cfg-4) + obj + ) + +;; definition of type sig-global-info +(deftype sig-global-info (basic) + ((prev-blue-hit int8 :offset-assert 4) + (blue-hit-anim sig-anim-info 3 :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type sig-global-info +(defmethod inspect sig-global-info ((obj sig-global-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) + (label cfg-4) + obj + ) + +;; definition for symbol *sig-global-info*, type sig-global-info +(define *sig-global-info* + (new 'static 'sig-global-info :blue-hit-anim (new 'static 'inline-array sig-anim-info 3 + (new 'static 'sig-anim-info :anim-index 19) + (new 'static 'sig-anim-info :anim-index 20) + (new 'static 'sig-anim-info :anim-index 21) + ) + ) + ) + +;; definition for symbol *sig-nav-enemy-info*, type nav-enemy-info +(define *sig-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'array idle-control-frame 4 + (new 'static 'idle-control-frame :command #x1 :anim #x4 :param0 #x1 :param1 #x1) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim -1 + :hit-anim 4 + :knocked-anim 15 + :knocked-land-anim 15 + :die-anim 25 + :die-falling-anim 25 + :victory-anim -1 + :jump-wind-up-anim 39 + :jump-in-air-anim 40 + :jump-land-anim 41 + :neck-joint 6 + :look-at-joint 7 + :bullseye-joint 5 + :sound-hit (static-sound-name "sig-hit") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 20 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked #xffffffffffffffff + :movement-gravity (meters -100) + :friction 0.7 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 45056.0 + :knocked-soft-vxz-hi 54067.2 + :knocked-soft-vy-lo 38092.8 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 65536.0 + :knocked-medium-vxz-hi 74547.2 + :knocked-medium-vy-lo 65536.0 + :knocked-medium-vy-hi 73728.0 + :knocked-hard-vxz-lo 66355.2 + :knocked-hard-vxz-hi 85196.8 + :knocked-hard-vy-lo 60620.8 + :knocked-hard-vy-hi 101580.8 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 24576.0 + :knocked-yellow-vy-lo 28672.0 + :knocked-yellow-vy-hi 40960.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 73728.0 + :knocked-red-vy-lo 65536.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 8 + :taunt-anim -1 + :run-travel-speed (meters 7) + :run-acceleration (meters 14) + :run-turning-acceleration (meters 6) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 8) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 360.0) + :notice-nav-radius (meters 20) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *sig-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; failed to figure out what this is: +(defpartgroup group-sig-gun-glow + :id 148 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 671 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 671 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-flt spt-rot-x 409.6) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 192.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 16.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 819.2) + ) + ) + +;; definition for method 97 of type sig +(defmethod enemy-method-97 sig ((obj sig)) + (with-pp + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (cond + ((= (-> s4-0 type) target) + (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 1.5)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! s4-0 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 6)) + (set! s4-0 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((v1-23 (-> obj focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? v1-23) + (cond + (s4-0 + (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (>= 16384.0 + (vector-vector-xz-distance (-> obj root-override2 trans) (get-trans (the-as process-focusable s4-0) 3)) + ) + ) + (set! s5-1 s4-0) + ) + ) + (else + (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (set! s5-1 (select-focus! obj)) + (cond + (s5-1 + (empty) + ) + (else + (let ((s4-1 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + ) + ((= v1-23 1) + (cond + (s4-0 + (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (>= 16384.0 + (vector-vector-xz-distance (-> obj root-override2 trans) (get-trans (the-as process-focusable s4-0) 3)) + ) + ) + (set! s5-1 s4-0) + ) + ) + (else + (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (let ((s4-2 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-2 process-focusable) + s4-2 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) + (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + (else + (clear-focused (-> obj focus)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + s5-1 + ) + ) + ) + ) + +;; definition for method 74 of type sig +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 33] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 38] +(defmethod enemy-method-74 sig ((obj sig) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block)) + (let ((v1-0 arg2)) + (the-as object (cond + ((= v1-0 'untrigger) + (sig-plasma-method-11 (-> obj plasma) #t) + ) + ((= v1-0 'sig-path) + (when (and (not (logtest? (-> obj focus-status) (focus-status dead))) + (nonzero? (-> obj hit-points)) + (zero? (-> obj fated-time)) + ) + (let ((a1-2 (-> arg3 param 0))) + (sig-method-249 obj (the-as sig-path a1-2)) + ) + (go (method-of-object obj sig-path-run)) + ) + ) + (else + ((method-of-type bot enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +;; definition for method 55 of type sig +(defmethod enemy-method-55 sig ((obj sig)) + (with-pp + (let ((v1-2 (-> obj skel top-anim frame-group))) + (cond + ((>= (- (-> pp clock frame-counter) (-> obj danger-time)) (seconds 2)) + (cond + ((not v1-2) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + ) + ((= v1-2 (-> obj draw art-group data 44)) + (push-anim-to-targ + (-> obj skel top-anim) + (the-as art-joint-anim (-> obj draw art-group data 46)) + 0.0 + 0 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + ) + ) + ) + (else + (cond + ((not v1-2) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + ) + ((= v1-2 (-> obj draw art-group data 42)) + (push-anim-to-targ + (-> obj skel top-anim) + (the-as art-joint-anim (-> obj draw art-group data 43)) + 0.0 + 0 + 0 + 1.0 + 0.0 + #f + ) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + ) + ) + ) + ) + ) + (let ((t9-2 (method-of-type bot enemy-method-55))) + (t9-2 obj) + ) + (when (logtest? (-> obj bot-flags) (bot-flags too-far-fail)) + (let ((f0-0 (vector-vector-distance (-> obj root-override2 trans) (target-pos 0)))) + (when (or (>= f0-0 491520.0) + (and (>= f0-0 102400.0) + (>= (- (-> pp clock frame-counter) (the-as int (-> obj last-draw-time))) (seconds 10)) + ) + ) + (process-entity-status! obj (entity-perm-status no-kill) #f) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + ) + ) + (sig-plasma-method-14 (-> obj plasma) obj) + (none) + ) + ) + +;; definition for method 213 of type sig +(defmethod go-to-waypoint! sig ((obj sig) (arg0 int) (arg1 symbol)) + "Start moving to the given [[bot-waypoint]]." + (set! (-> obj plasma charge-speed) 0.125) + ((method-of-type bot go-to-waypoint!) obj arg0 arg1) + ) + +;; definition for method 10 of type sig +(defmethod deactivate sig ((obj sig)) + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> obj plasma powerup-sound-id)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 24) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + (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) (-> obj plasma plasma-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) + ) + ((method-of-type bot deactivate) obj) + (none) + ) + +;; definition for method 46 of type sig +;; WARN: Return type mismatch vector vs none. +(defmethod enemy-method-46 sig ((obj sig) (arg0 int)) + "@abstract" + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (let ((v1-2 (-> obj root-override2 root-prim))) + (dotimes (a0-1 4) + (let ((a1-3 (-> (the-as collide-shape-prim-group v1-2) child (+ a0-1 3)))) + (set! (-> a1-3 prim-core collide-with) (collide-spec)) + (set! (-> a1-3 prim-core collide-as) (collide-spec)) + (set! (-> a1-3 transform-index) -2) + ) + ) + ) + ) + ((= v1-0 3) + (let ((v1-5 (the-as collide-shape-prim-group (-> obj root-override2 root-prim)))) + (let ((a0-3 (-> v1-5 child 3))) + (set! (-> a0-3 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> a0-3 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a0-3 transform-index) 23) + (set-vector! (-> a0-3 local-sphere) 0.0 -819.2 -4915.2 1638.4) + ) + (let ((a0-6 (-> v1-5 child 4))) + (set! (-> a0-6 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> a0-6 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a0-6 transform-index) 23) + (set-vector! (-> a0-6 local-sphere) 0.0 0.0 -1638.4 2048.0) + ) + (let ((a0-9 (-> v1-5 child 5))) + (set! (-> a0-9 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> a0-9 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> a0-9 transform-index) 23) + (set-vector! (-> a0-9 local-sphere) 0.0 0.0 2048.0 1638.4) + ) + (let ((v1-7 (-> v1-5 child 6))) + (set! (-> v1-7 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec jak crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-7 transform-index) 23) + (set-vector! (-> v1-7 local-sphere) 0.0 1024.0 6144.0 2457.6) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 114 of type sig +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-114 sig ((obj sig)) + "@abstract" + (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 10240.0 0.0 13721.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 0.0 4096.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 7168.0 0.0 4096.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-17 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-17 local-sphere) 0.0 10240.0 0.0 4096.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) 7372.8) + (let ((v1-27 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-27 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 8)) + (set! (-> obj root-override2) s5-0) + ) + (enemy-method-46 obj 0) + 0 + (none) + ) + +;; definition for method 115 of type sig +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-115 sig ((obj sig)) + "@abstract" + (init! obj) + (set! (-> obj channel) (the-as uint 21)) + (set! (-> obj notice-enemy-dist) 122880.0) + (set! (-> obj travel-anim-interp) 0.0) + (set! (-> obj plasma charge-speed) 0.125) + (set! (-> obj plasma powerup-sound-id) (new-sound-id)) + (set! (-> obj plasma plasma-sound-id) (new-sound-id)) + (set! (-> obj focus-info max-los-dist) 102400.0) + (set! (-> obj sig-path) #f) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-sig" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (enemy-method-113 obj *sig-nav-enemy-info*) + (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 147) obj)) + (add-connection *part-engine* obj 23 obj 671 (new 'static 'sphere :y 327.68 :z 7536.64 :r 163840.0)) + (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1ffc007ffff0))) + (set! (-> obj skel interp-select 1) 0) + (set! (-> obj skel top-anim) (new 'process 'top-anim-joint-control obj)) + (set! (-> obj skel interp-select 0) 0) + (set! (-> obj skel interp-select 1) 0) + (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + (set! (-> obj swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) + (let ((v1-26 (-> obj neck))) + (set! (-> v1-26 up) (the-as uint 1)) + (set! (-> v1-26 nose) (the-as uint 2)) + (set! (-> v1-26 ear) (the-as uint 0)) + (set-vector! (-> v1-26 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-26 ignore-angle) 30947.555) + ) + (let ((t9-10 (method-of-type bot enemy-method-115))) + (t9-10 obj) + ) + (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + 0 + (none) + ) + +;; definition for method 105 of type sig +;; WARN: Return type mismatch sound-id vs enemy-flag. +(defmethod enemy-method-105 sig ((obj sig) (arg0 process)) + (let ((t9-0 (method-of-type bot enemy-method-105))) + (t9-0 obj arg0) + ) + (the-as enemy-flag (if (and (-> obj next-state) (= (-> obj next-state name) 'whip)) + (sound-play "sig-gun-strike") + ) + ) + ) + +;; definition for method 251 of type sig +(defmethod sig-method-251 sig ((obj sig)) + (logtest? (-> obj plasma flags) 1) + ) + +;; definition for method 254 of type sig +(defmethod sig-method-254 sig ((obj sig)) + (logtest? (bot-flags bf22) (-> obj bot-flags)) + ) + +;; definition for method 252 of type sig +(defmethod sig-method-252 sig ((obj sig)) + (logtest? (bot-flags bf20) (-> obj bot-flags)) + ) + +;; definition for method 255 of type sig +(defmethod sig-method-255 sig ((obj sig)) + (logtest? (bot-flags bf19) (-> obj bot-flags)) + ) + +;; definition for method 246 of type sig +(defmethod sig-method-246 sig ((obj sig)) + (>= 16384.0 (-> obj focus-info bullseye-xz-dist)) + ) + +;; definition for method 245 of type sig +(defmethod sig-method-245 sig ((obj sig)) + (and (or (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) + (and (>= 40960.0 (-> obj focus-info bullseye-xz-dist)) (= (-> obj focus-info los) 1)) + ) + (zero? (logand (bot-flags bf19) (-> obj bot-flags))) + ) + ) + +;; definition for method 70 of type sig +(defmethod go-hostile sig ((obj sig)) + (bot-method-223 obj #t) + (cond + ((not (bot-method-214 obj)) + (enemy-method-72 obj) + ) + ((sig-method-246 obj) + (go (method-of-object obj whip)) + ) + ((sig-method-245 obj) + (go (method-of-object obj blast)) + ) + (else + (go (method-of-object obj chase)) + ) + ) + (none) + ) + +;; definition for method 72 of type sig +(defmethod enemy-method-72 sig ((obj sig)) + (cond + ((bot-method-214 obj) + (go-hostile obj) + ) + ((sig-method-252 obj) + (go (method-of-object obj gun-jam)) + ) + ((sig-method-255 obj) + (go (method-of-object obj repair-gun)) + ) + ((not (outside-spot-radius? obj (the-as bot-spot #f) (the-as vector #f) #f)) + (go (method-of-object obj traveling)) + ) + ((and (-> obj focus-info fproc) (>= (fabs (-> obj focus-info ry-diff)) 9102.223)) + (go (method-of-object obj waiting-turn)) + ) + ((sig-method-251 obj) + (go (method-of-object obj charge-plasma)) + ) + ((sig-method-254 obj) + (go (method-of-object obj clean-gun)) + ) + (else + (go (method-of-object obj waiting-close)) + ) + ) + (none) + ) + +;; definition for method 116 of type sig +;; WARN: Return type mismatch object vs none. +(defmethod go-idle sig ((obj sig)) + (go (method-of-object obj waiting-far)) + (none) + ) + +;; definition for method 247 of type sig +;; INFO: Used lq/sq +(defmethod fire-gun sig ((obj sig) (arg0 vector)) + "Increase gun fired counter and spawn projectile." + (+! (-> obj fired-gun-count) 1) + (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options account-for-target-velocity proj-options-8000)) + (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 ignore-handle) (process->handle obj)) + (let* ((v1-11 *game-info*) + (a0-10 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-10) + (set! (-> s5-0 attack-id) a0-10) + ) + (set! (-> s5-0 timeout) (new 'static 'handle :process #x4b0 :u64 #x4b0)) + (vector<-cspace! (-> s5-0 pos) (-> obj node-list data 24)) + (set! (-> s5-0 vel quad) (-> arg0 quad)) + (vector-! (-> s5-0 vel) (-> s5-0 vel) (-> s5-0 pos)) + (vector-normalize! (-> s5-0 vel) 307200.0) + (spawn-projectile sig-shot s5-0 obj *default-dead-pool*) + ) + ) + +;; definition for method 258 of type sig +;; WARN: Return type mismatch int vs none. +(defmethod sig-method-258 sig ((obj sig)) + (with-pp + (let ((f30-0 (-> obj nav state speed))) + (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 16384.0 28672.0))) + (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (-> pp clock seconds-per-frame))) + ) + (let ((f28-0 (-> obj travel-anim-interp)) + (v1-7 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-7 (= v1-7 (-> obj draw art-group data 3))) + (let ((v1-12 (-> obj skel root-channel 1))) + (set! (-> v1-12 frame-interp 1) f28-0) + (set! (-> v1-12 frame-interp 0) f28-0) + ) + (let* ((f28-1 (current-cycle-distance (-> obj skel))) + (f0-5 (quaternion-y-angle (-> obj root-override2 quat))) + (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (f0-8 (fmin 28672.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) + (f0-11 (/ (* 24.0 (fmax f30-0 f0-8)) (* 30.0 f28-1))) + (a0-10 (-> obj skel root-channel 0)) + ) + (set! (-> a0-10 param 0) f0-11) + (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-11 (-> obj skel root-channel 1))) + (set! (-> a0-11 param 0) 0.0) + (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-13 (-> obj skel root-channel 0))) + (set! (-> a0-13 dist) 13107.2) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-13 param 0) 1.0) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + ) + (let ((a0-14 (-> obj skel root-channel 1))) + (set! (-> a0-14 frame-interp 1) f28-0) + (set! (-> a0-14 frame-interp 0) f28-0) + (set! (-> a0-14 dist) 22937.6) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-14 param 0) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-chan) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 77 of type sig +(defmethod enemy-method-77 sig ((obj sig) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (let* ((v1-3 (enemy-method-120 obj 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) + (s5-1 (-> obj draw art-group data (-> *sig-global-info* blue-hit-anim v1-3 anim-index))) + ) + (set! (-> *sig-global-info* prev-blue-hit) v1-3) + (let ((v1-6 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-6 (= v1-6 (-> obj draw art-group data 22))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-15 (-> obj skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim s5-1)) + (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) + (set! (-> a0-15 param 1) 1.0) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim s5-1) num-func-seek!) + ) + ) + #t + ) + (((knocked-type knocked-type-2)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-18 (-> obj skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (set! (-> a0-18 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-18 param 1) 1.0) + (set! (-> a0-18 frame-num) 0.0) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + ) + #t + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (vector-z-quaternion! s4-0 (-> obj root-override2 quat)) + (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (enemy-method-50 obj s4-0) + (let* ((f0-14 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-15 (deg- f0-14 f30-0)) + (f1-0 (fabs f0-15)) + (s4-1 (cond + ((>= 8192.0 f1-0) + (-> obj draw art-group data 16) + ) + ((>= f1-0 24576.0) + (-> obj draw art-group data 15) + ) + ((< f0-15 0.0) + (-> obj draw art-group data 17) + ) + (else + (-> obj draw art-group data 18) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-25 (-> obj skel root-channel 0))) + (set! (-> a0-25 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-25 param 1) (-> arg0 0)) + (set! (-> a0-25 frame-num) 0.0) + (joint-control-channel-group! a0-25 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + ) + ) + #t + ) + ) + ) + +;; definition for method 78 of type sig +(defmethod enemy-method-78 sig ((obj sig) (arg0 (pointer float))) + (case (-> obj incoming knocked-type) + (((knocked-type knocked-type-6)) + (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) + (-> obj draw art-group data 22) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-3 (-> obj skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) 1.0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + ) + #t + ) + ) + (((knocked-type knocked-type-2)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-6 (-> obj skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + ) + (set! (-> a0-6 param 1) 1.0) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + ) + #t + ) + (else + (not (ja-done? 0)) + ) + ) + ) + +;; definition for method 84 of type sig +(defmethod enemy-method-84 sig ((obj sig) (arg0 enemy-jump-info)) + (logclear! (-> obj bot-flags) (bot-flags bf23)) + (let ((f1-0 (vector-vector-xz-distance (-> arg0 dest-pos) (-> arg0 start-pos))) + (f2-1 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) + ) + 2048.0 + (let* ((f0-2 -245760.0) + (v1-6 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + (f1-4 + (cond + ((or (not (and v1-6 (= v1-6 (-> obj draw art-group data 3)))) (or (= (-> obj jump-why) 4) (>= f2-1 8192.0))) + (set! (-> obj bot-flags) (logior (bot-flags bf23) (-> obj bot-flags))) + (let ((f2-3 (fmax 12288.0 (* 0.5 f1-0))) + (f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) + ) + (- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f2-3) (+ 10240.0 f1-3)) f1-3) + ) + ) + (else + (fmax 2048.0 (* 0.2 f1-0)) + ) + ) + ) + ) + (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (* 0.000011111111 f0-2)) + ) + ) + (none) + ) + +;; definition for method 86 of type sig +(defmethod enemy-method-86 sig ((obj sig)) + (let* ((t9-0 (method-of-type bot enemy-method-86)) + (v0-0 (t9-0 obj)) + ) + (when (and (= (-> obj jump-why) 4) (not v0-0)) + (when (< (-> obj root-override2 transv y) 0.0) + (let* ((v1-11 (-> obj actor-group 0 data (-> obj platform-index) actor)) + (a0-5 (if v1-11 + (-> v1-11 extra process) + ) + ) + ) + (when a0-5 + (let ((s4-0 (-> (the-as process-focusable a0-5) root-override trans)) + (s5-0 (-> obj root-override2 trans)) + ) + (when (< 2048.0 (- (-> s4-0 y) (-> s5-0 y))) + (vector-reset! (-> obj root-override2 transv)) + (let ((f30-0 9420.8)) + (when (< f30-0 (vector-vector-xz-distance s4-0 s5-0)) + (vector-! s5-0 s5-0 s4-0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 f30-0) + (vector+! s5-0 s5-0 s4-0) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'collide-query))) + (find-ground (-> obj root-override2) a1-4 (the-as collide-spec (-> obj gnd-collide)) 8192.0 81920.0 1024.0) + ) + (set! (-> s5-0 y) (-> obj root-override2 gspot-pos y)) + (set! v0-0 #t) + ) + ) + ) + ) + ) + ) + v0-0 + ) + ) + +;; definition for method 85 of type sig +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs float. +(defmethod enemy-method-85 sig ((obj sig)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((t9-0 (method-of-type bot enemy-method-85))) + (t9-0 obj) + ) + (let ((s5-0 (static-sound-spec "sig-jland" :mask (reg0)))) + (set! (-> s5-0 reg 0) (the-as uint (-> obj root-override2 ground-pat material))) + (sound-play-by-spec s5-0 (new-sound-id) (the-as vector #t)) + ) + (the-as + float + (cond + ((logtest? (bot-flags bf23) (-> obj bot-flags)) + (let ((v0-3 (the-as object (-> obj root-override2 transv)))) + (.svf (&-> (the-as vector v0-3) quad) vf0) + v0-3 + ) + ) + (else + (let ((v1-9 obj)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) + ) + 0 + (let ((v1-11 obj)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-11 enemy-flags))) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-11 enemy-flags)))) + ) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-11 enemy-flags)))) + (set! (-> v1-11 nav callback-info) (-> v1-11 enemy-info-override callback-info)) + ) + 0 + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> obj root-override2 transv quad)) + (set! (-> s5-1 y) 0.0) + (let ((v1-18 (-> obj nav state))) + (set! (-> v1-18 speed) (fmin (vector-length s5-1) (-> obj nav target-speed))) + ) + 0 + (vector-xz-normalize! s5-1 16384.0) + (let ((v1-21 (-> obj nav state))) + (logior! (-> v1-21 flags) (nav-state-flag directional-mode)) + (set! (-> v1-21 travel quad) (-> s5-1 quad)) + ) + ) + 0.0 + ) + ) + ) + ) + ) + +;; definition for method 89 of type sig +;; WARN: Return type mismatch int vs symbol. +(defmethod enemy-method-89 sig ((obj sig) (arg0 enemy-jump-info)) + (the-as + symbol + (when (logtest? (bot-flags bf23) (-> obj bot-flags)) + (let ((a0-2 (-> obj skel root-channel 0))) + (set! (-> a0-2 param 0) 1.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info-override jump-wind-up-anim))) + (a0-6 (-> obj skel root-channel 0)) + ) + (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) + (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) + (set! (-> a0-6 param 1) (-> arg0 anim-speed)) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim a1-3) num-func-seek!) + ) + ) + ) + ) + +;; definition for method 88 of type sig +;; WARN: Return type mismatch int vs symbol. +(defmethod enemy-method-88 sig ((obj sig) (arg0 enemy-jump-info)) + (the-as + symbol + (when (logtest? (bot-flags bf23) (-> obj bot-flags)) + (let ((a0-2 (-> obj skel root-channel 0))) + (set! (-> a0-2 param 0) 1.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info-override jump-land-anim))) + (a0-6 (-> obj skel root-channel 0)) + ) + (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) + (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) + (set! (-> a0-6 param 1) (-> arg0 anim-speed)) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! a0-6 (the-as art-joint-anim a1-3) num-func-seek!) + ) + ) + ) + ) + +;; definition for method 198 of type sig +;; WARN: Return type mismatch float vs meters. +(defmethod set-cam-height! sig ((obj sig) (arg0 vector)) + (cond + ((and (-> obj next-state) (= (-> obj next-state name) 'failed)) + (set-vector! arg0 0.0 4096.0 28672.0 1.0) + ) + ((logtest? (-> obj focus-status) (focus-status under-water)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + ) + (else + (set-vector! arg0 0.0 20480.0 45056.0 1.0) + ) + ) + (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (the-as + meters + (if (logtest? (-> obj focus-status) (focus-status under-water)) + (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + ) + ) + ) + +;; definition for method 216 of type sig +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-216 sig ((obj sig)) + (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to obj))) + 0 + (none) + ) + +;; definition for method 249 of type sig +;; WARN: Return type mismatch enemy-flag vs none. +(defmethod sig-method-249 sig ((obj sig) (arg0 sig-path)) + (set! (-> obj sig-path) arg0) + (set! (-> obj sig-path-clock) (-> *display* user0-clock)) + (set! (-> obj sig-path-start-time) (-> obj sig-path-clock frame-counter)) + (set! (-> obj sig-path-cur-time) (-> obj sig-path-start-time)) + (set! (-> obj sig-path-prev-time) (-> obj sig-path-start-time)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (none) + ) + +;; definition for method 248 of type sig +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod sig-method-248 sig ((obj sig) (arg0 sig-path-sample)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 (-> obj sig-path-clock frame-counter))) + (when (!= (-> obj sig-path-cur-time) a0-1) + (set! (-> obj sig-path-prev-time) (-> obj sig-path-cur-time)) + (set! (-> obj sig-path-cur-time) a0-1) + (set! (-> obj event-param-point quad) (-> obj root-override2 trans quad)) + ) + ) + (let ((s3-0 (+ (-> obj sig-path sample-count) -1)) + (s2-0 (the int (* 0.05 (the float (- (-> obj sig-path-prev-time) (-> obj sig-path-start-time)))))) + (s4-0 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) + ) + (if (< s3-0 s2-0) + (set! s2-0 s3-0) + ) + (if (< s3-0 s4-0) + (set! s4-0 s3-0) + ) + (cond + ((= s2-0 s4-0) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s2-0)) 64) + ) + (else + (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s4-0)) 64) + (let ((v1-22 0)) + (countdown (a0-9 (- s4-0 s2-0)) + (set! v1-22 (logior v1-22 (logand (-> obj sig-path samples (+ a0-9 s2-0) flags) 3))) + ) + (logior! (-> arg0 flags) v1-22) + ) + ) + ) + (when (< s4-0 s3-0) + (let* ((f0-6 0.05) + (f1-5 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))) + (f30-0 (* f0-6 (- f1-5 (* (the float (the int (/ f1-5 20.0))) 20.0)))) + (v1-30 (-> obj sig-path samples)) + (s3-1 (-> v1-30 s4-0)) + (s4-1 (-> v1-30 (+ s4-0 1))) + (s2-1 (-> arg0 flags)) + ) + (vector-lerp! (-> arg0 pos) (-> s3-1 pos) (-> s4-1 pos) f30-0) + (quaternion-slerp! (-> arg0 quat) (-> s3-1 quat) (-> s4-1 quat) f30-0) + (set! (-> arg0 flags) s2-1) + ) + (vector-! (-> obj root-override2 transv) (-> arg0 pos) (-> obj event-param-point)) + (let ((v0-5 (-> obj root-override2 transv))) + (.lvf vf1 (&-> (-> obj root-override2 transv) quad)) + (let ((f0-7 (-> pp clock frames-per-second))) + (.mov at-0 f0-7) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v0-5 quad) vf1) + ) + ) + ) + (none) + ) + ) + ) + +;; definition for method 256 of type sig +;; WARN: Return type mismatch int vs none. +(defmethod sig-method-256 sig ((obj sig)) + (let* ((v1-3 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) + (v1-4 (- (+ (-> obj sig-path sample-count) -1) v1-3)) + ) + (if (<= v1-4 0) + 0 + (* 20 v1-4) + ) + ) + (none) + ) + +;; definition for method 257 of type sig +(defmethod sig-method-257 sig ((obj sig)) + (>= (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) + (+ (-> obj sig-path sample-count) -1) + ) + ) + +;; definition for method 250 of type sig +;; INFO: Used lq/sq +(defmethod sig-method-250 sig ((obj sig)) + (local-vars (a2-7 float) (a2-14 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((s5-0 (new 'stack-no-clear 'sphere))) + (let ((v1-4 (+ (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) 2)) + (a0-3 (-> obj sig-path sample-count)) + (a1-1 (-> obj sig-path samples)) + ) + (while (< v1-4 a0-3) + (let ((a2-1 (-> a1-1 v1-4))) + (when (not (logtest? (-> a2-1 flags) 4)) + (set! (-> s5-0 quad) (-> a2-1 pos quad)) + (set! (-> s5-0 r) 32768.0) + (goto cfg-8) + ) + ) + (+! v1-4 1) + ) + ) + (return #f) + (label cfg-8) + (let ((s4-0 (the-as process-drawable #f))) + (let ((f30-0 -1.0)) + (set! *actor-list-length* 0) + (if #t + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* s5-0 *actor-list* 256)) + ) + (when #f + (let ((a0-7 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-21 (-> a0-7 next0))) + (while (!= a0-7 (-> *collide-player-list* alive-list-end)) + (let* ((a0-8 (-> (the-as connection a0-7) param1)) + (a1-3 (-> (the-as collide-shape a0-8) root-prim)) + ) + (when (logtest? (collide-spec hit-by-others-list pusher) (-> a1-3 prim-core collide-as)) + (let ((a1-4 (-> a1-3 prim-core))) + (let ((a2-6 a1-4) + (a3-5 s5-0) + ) + (.lvf vf2 (&-> a2-6 world-sphere quad)) + (.lvf vf3 (&-> a3-5 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-7 vf1) + (let ((f0-4 a2-7) + (f1-3 (+ (-> a1-4 world-sphere w) (-> s5-0 r))) + ) + (when (< f0-4 (* f1-3 f1-3)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-8)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-7 v1-21) + *collide-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (when #f + (let ((a0-10 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-28 (-> a0-10 next0))) + (while (!= a0-10 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-11 (-> (the-as connection a0-10) param1)) + (a1-15 (-> (the-as collide-shape a0-11) root-prim)) + ) + (when (logtest? (collide-spec hit-by-others-list pusher) (-> a1-15 prim-core collide-as)) + (let ((a1-16 (-> a1-15 prim-core))) + (let ((a2-13 a1-16) + (a3-7 s5-0) + ) + (.lvf vf2 (&-> a2-13 world-sphere quad)) + (.lvf vf3 (&-> a3-7 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-14 vf1) + (let ((f0-5 a2-14) + (f1-7 (+ (-> a1-16 world-sphere w) (-> s5-0 r))) + ) + (when (< f0-5 (* f1-7 f1-7)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-11)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-10 v1-28) + *collide-hit-by-player-list* + (set! v1-28 (-> v1-28 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let* ((v1-33 (-> *actor-list* s3-0)) + (a0-14 (-> v1-33 root-prim)) + ) + (when (logtest? (collide-spec hit-by-others-list pusher) (-> a0-14 prim-core collide-as)) + (let* ((s1-0 (-> v1-33 process)) + (s2-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-0 + (let ((f0-6 (vector-vector-distance-squared s5-0 (get-trans (the-as process-focusable s2-0) 0)))) + (when (or (< f30-0 0.0) (< f0-6 f30-0)) + (set! f30-0 f0-6) + (set! s4-0 s2-0) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + (s4-0 + (fire-gun obj (get-trans (the-as process-focusable s4-0) 3)) + #t + ) + (else + #f + ) + ) + ) + ) + ) + ) + +;; definition for method 15 of type hud-sig +;; WARN: Return type mismatch int vs none. +(defmethod draw hud-sig ((obj hud-sig)) + (set-hud-piece-position! + (-> obj sprites 2) + (the int (+ 30.0 (* -130.0 (-> obj offset)))) + (the int (+ 30.0 (* -100.0 (-> obj offset)))) + ) + (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 15 2) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +;; definition for method 16 of type hud-sig +;; WARN: Return type mismatch int vs none. +(defmethod update-values hud-sig ((obj hud-sig)) + (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +;; definition for method 17 of type hud-sig +;; WARN: Return type mismatch int vs none. +(defmethod init-callback hud-sig ((obj hud-sig)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 0 scale-x) 12.0) + (set! (-> obj sprites 0 scale-y) 11.2) + (set! (-> obj sprites 0 pos z) #xfffff2) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> obj sprites 1 pos z) #xfffff0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 3 tex) + (lookup-texture-by-name "hud-sig-head" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.4) + (set! (-> obj sprites 3 pos z) #xffffff) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc new file mode 100644 index 0000000000..353467139f --- /dev/null +++ b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc @@ -0,0 +1,483 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ashelin-battle +(deftype ashelin-battle (ashelin) + ((player-in-bounds-time time-frame :offset-assert 1040) + ) + :heap-base #x3a0 + :method-count-assert 252 + :size-assert #x418 + :flag-assert #xfc03a00418 + (:methods + (set-frontline-dist! (_type_) none 251) + ) + ) + +;; definition for method 3 of type ashelin-battle +(defmethod inspect ashelin-battle ((obj ashelin-battle)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ashelin inspect))) + (t9-0 obj) + ) + (format #t "~2Tplayer-in-bounds-time: ~D~%" (-> obj player-in-bounds-time)) + (label cfg-4) + obj + ) + +;; definition for method 251 of type ashelin-battle +;; WARN: Return type mismatch int vs none. +(defmethod set-frontline-dist! ashelin-battle ((obj ashelin-battle)) + (let ((a0-1 *target*)) + (when a0-1 + (set! (-> obj frontline w) (- (+ 40960.0 (vector-dot (the-as vector (-> obj frontline)) (get-trans a0-1 0))))) + 0 + ) + ) + (none) + ) + +;; definition for symbol *ash1-course*, type ashelin-course +(define *ash1-course* + (new 'static 'ashelin-course + :course-id #x1 + :speech-count #x30 + :spot-count #x8 + :attack-player-speeches (new 'static 'bot-speech-list-shuffle + :flags #xe + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 11 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26) + ) + :default-check-too-far #f + :waypoints (new 'static 'boxed-array :type bot-waypoint + (new 'static 'bot-waypoint + :waypoint-id 1 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (clear-speech-flags! arg0) + (move-to-point! (-> arg0 root-override2) (the-as vector (-> arg0 ash-course spots 0))) + (let ((v1-7 (game-task-control-method-9 (-> arg0 task)))) + (if (= (-> v1-7 action) (game-task-action say)) + (add-process + *gui-control* + arg0 + (gui-channel art-load) + (gui-action queue) + (the-as string (-> v1-7 scene)) + -99.0 + 0 + ) + ) + ) + (let ((a0-8 15)) + (set! (-> arg0 hit-points) a0-8) + (set! (-> arg0 enemy-info-override default-hit-points) a0-8) + ) + (set! (-> arg0 waypoint-time0) 0) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 0)) + (set! (-> v1-10 bytes 4) (the-as uint -1)) + (set! (-> (the-as asht-wait-spot v1-10) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (with-pp + (if (and (zero? (-> arg1 waypoint-time0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 0 actor)) + ) + (t9-0 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + ) + (let ((s5-0 (game-task-control-method-9 (-> arg1 task)))) + (cond + ((and (nonzero? (-> arg1 waypoint-time0)) + (and (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 1)) + (let ((f0-0 143360.0)) + (and (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root-override2 trans))) + (= (-> s5-0 action) (game-task-action say)) + ) + ) + ) + ) + (process-entity-status! arg1 (entity-perm-status no-kill) #t) + (when (scene-play arg1 (the-as string (-> s5-0 scene)) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 2 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (process-entity-status! arg1 (entity-perm-status no-kill) #f) + ) + ) + ) + #f + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 2 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 0)) + (set! (-> (the-as asht-wait-spot v1-1) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (when (scene-release? arg1) + (set! (-> arg1 bot-flags) (logior (bot-flags bf20) (-> arg1 bot-flags))) + (let ((s5-0 (-> arg1 ash-course spots))) + (vector-! (the-as vector (-> arg1 frontline)) (the-as vector (-> s5-0 2)) (the-as vector (-> s5-0 1))) + (vector-normalize! (-> arg1 frontline) 1.0) + (set! (-> arg1 frontline w) (- (vector-dot (the-as vector (-> arg1 frontline)) (the-as vector (-> s5-0 1))))) + ) + (set-frontline-dist! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 3 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 3 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (with-pp + (send-event arg0 'hide #f) + (ashelin-method-250 arg0 #t) + (set! (-> arg0 notice-enemy-dist) 245760.0) + (set-setting! 'sound-mode #f 0 1) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set-setting! 'airlock #f 0 0) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer pp)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'trigger) + (let ((t9-4 send-event-function) + (v1-18 (-> arg0 actor-group 0 data 1 actor)) + ) + (t9-4 + (if v1-18 + (-> v1-18 extra process) + ) + a1-4 + ) + ) + ) + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-save-ashelin-res-b" -99.0 0) + (let ((v1-24 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-24 bytes 5) (the-as uint 2)) + (set! (-> v1-24 bytes 6) (the-as uint 3)) + (set! (-> v1-24 bytes 7) (the-as uint 4)) + (set! (-> (the-as asht-wait-spot v1-24) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (with-pp + (when (not (channel-active? arg1 (the-as uint 0))) + (cond + ((and (not (speech-playing? arg1 45)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 2.5)) + ) + (play-speech arg1 45) + ) + ((and (not (speech-playing? arg1 46)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 7)) + ) + (play-speech arg1 46) + ) + ((and (not (speech-playing? arg1 47)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 14)) + ) + (play-speech arg1 47) + ) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer pp)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'query) + (set! (-> a1-8 param 0) (the-as uint 'beaten)) + (let ((t9-7 send-event-function) + (v1-37 (-> arg1 actor-group 0 data 1 actor)) + ) + (when (t9-7 + (if v1-37 + (-> v1-37 extra process) + ) + a1-8 + ) + (logclear! (-> arg1 bot-flags) (bot-flags bf20)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 4 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 ashelin-battle)) + (with-pp + (set-frontline-dist! arg0) + (let ((s5-0 (target-pos 0))) + (if (>= (-> s5-0 y) 176128.0) + (set! (-> arg0 player-in-bounds-time) (-> pp clock frame-counter)) + ) + (if (>= (- (-> pp clock frame-counter) (-> arg0 player-in-bounds-time)) (seconds 4)) + (send-event arg0 'instant-death) + ) + (if (< (-> s5-0 y) 192512.0) + (logior! (-> arg0 bot-flags) (bot-flags bf10)) + (logclear! (-> arg0 bot-flags) (bot-flags bf10)) + ) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 4 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (task-node-close! (game-task-node atoll-battle-battle)) + (remove-setting! 'sound-mode) + (ashelin-method-250 arg0 #f) + (remove-setting! 'airlock) + (logclear! (-> arg0 bot-flags) (bot-flags bf10)) + (when (not (channel-active? arg0 (the-as uint 0))) + (let ((v1-12 (get-rand-int arg0 3))) + (cond + ((zero? v1-12) + (play-speech arg0 42) + ) + ((= v1-12 1) + (play-speech arg0 43) + ) + (else + (play-speech arg0 44) + ) + ) + ) + ) + (let ((v1-20 (game-task-control-method-9 (-> arg0 task)))) + (if (= (-> v1-20 action) (game-task-action say)) + (add-process + *gui-control* + arg0 + (gui-channel art-load) + (gui-action queue) + (the-as string (-> v1-20 scene)) + -99.0 + 0 + ) + ) + ) + (let ((v1-22 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-22 bytes 5) (the-as uint 3)) + (set! (-> v1-22 bytes 6) (the-as uint 5)) + (set! (-> v1-22 bytes 7) (the-as uint 6)) + (set! (-> v1-22 bytes 8) (the-as uint 7)) + (let ((v0-12 + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) + (with-pp + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 1.5)) + (let ((s5-0 (game-task-control-method-9 (-> arg1 task)))) + (when (and (= (-> s5-0 action) (game-task-action say)) + (not (channel-active? arg1 (the-as uint 0))) + (scene-play arg1 (the-as string (-> s5-0 scene)) #f) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 5 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + (set! (-> (the-as asht-wait-spot v1-22) check-done) v0-12) + (the-as symbol v0-12) + ) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 5 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (logclear! (-> arg0 bot-flags) (bot-flags bf06)) + (bot-method-196 arg0) + (let ((v1-5 (-> arg0 root-override2 root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + (set! (-> arg0 root-override2 backup-collide-as) (collide-spec)) + (set! (-> arg0 root-override2 backup-collide-with) (collide-spec)) + 0 + (send-event arg0 'hide #t) + (let ((v1-15 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-15 bytes 5) (the-as uint 3)) + (set! (-> v1-15 bytes 6) (the-as uint 5)) + (set! (-> v1-15 bytes 7) (the-as uint 6)) + (set! (-> v1-15 bytes 8) (the-as uint 7)) + (set! (-> (the-as asht-wait-spot v1-15) check-done) + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) (when (scene-release? arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 6 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 6 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-battle)) + (process-entity-status! arg0 (entity-perm-status bit-4) #f) + (process-entity-status! arg0 (entity-perm-status no-kill) #f) + (logclear! (-> arg0 enemy-flags) (enemy-flag use-notice-distance)) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 3)) + (set! (-> v1-3 bytes 6) (the-as uint 5)) + (set! (-> v1-3 bytes 7) (the-as uint 6)) + (set! (-> v1-3 bytes 8) (the-as uint 7)) + (set! (-> (the-as asht-wait-spot v1-3) check-done) (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) #f)) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + ) + :speeches (new 'static 'inline-array bot-speech-info 48 + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha001") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha008") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha009") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha010") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha011") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha012") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha013") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha002") + (new 'static 'bot-speech-info :flags (speech-flags sf10) :hold-time #x5a :slave-id -1 :name "asha003") + (new 'static 'bot-speech-info :flags (speech-flags sf06) :hold-time #x5a :slave-id -1 :name "asha004") + (new 'static 'bot-speech-info :flags (speech-flags sf06) :hold-time #x5a :slave-id -1 :name "asha005") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha006") + (new 'static 'bot-speech-info :flags (speech-flags sf08) :hold-time #x5a :slave-id -1 :name "asha007") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha018") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha019") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha020") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha021") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha022") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha023") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha024") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha025") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha026") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha027") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha028") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha029") + (new 'static 'bot-speech-info :flags (speech-flags sf10) :hold-time #x5a :slave-id -1 :name "asha030") + (new 'static 'bot-speech-info :flags (speech-flags sf09) :hold-time #x5a :slave-id -1 :name "asha031") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha035") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha036") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha039") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha041") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha050") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha051") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha052") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha054") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha014") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha015") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha016") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha017") + (new 'static 'bot-speech-info :flags (speech-flags sf11) :hold-time #x5a :slave-id -1 :name "asha038") + (new 'static 'bot-speech-info :flags (speech-flags sf11) :hold-time #x5a :slave-id -1 :name "asha044") + (new 'static 'bot-speech-info :flags (speech-flags sf11) :hold-time #x5a :slave-id -1 :name "asha049") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha032") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha033") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha034") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha037") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha047") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "asha042") + ) + :speech-tunings (new 'static 'inline-array bot-speech-tuning 1 + (new 'static 'bot-speech-tuning :fo-min 30 :fo-max 100 :fo-curve #xb :trans? #t) + ) + :spots (new 'static 'inline-array bot-spot 8 + (new 'static 'bot-spot :center (new 'static 'vector :x 2263285.8 :y 213319.69 :z -4552335.5 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2293555.2 :z -4570276.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2235105.2 :z -4669890.5 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2224291.8 :y 222167.05 :z -4707533.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2164695.0 :y 221593.6 :z -4725145.5 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2305392.8 :y 214671.36 :z -4561797.0 :w 8192.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2245959.8 :y 214425.6 :z -4561961.0 :w 8192.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2269757.5 :y 216965.12 :z -4560404.5 :w 8192.0)) + ) + :ouch-speeches (new 'static 'bot-speech-list-shuffle + :flags #x6 + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 35 36 37 38 39 40 41) + ) + :victory-speeches (new 'static 'bot-speech-list-shuffle + :flags #xe + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 0 1 2 3 4 5 6 27 28 29 30 31 32 33 34) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *bot-course-table* course 1) *ash1-course*) + + + + diff --git a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc new file mode 100644 index 0000000000..6a88eae856 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc @@ -0,0 +1,3233 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sig-atoll +(deftype sig-atoll (sig) + ((sig-course sig0-course :offset 652) + ) + :heap-base #x3b0 + :method-count-assert 260 + :size-assert #x430 + :flag-assert #x10403b00430 + (:methods + (sig-atoll-method-259 (_type_) symbol 259) + ) + ) + +;; definition for method 3 of type sig-atoll +(defmethod inspect sig-atoll ((obj sig-atoll)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type sig inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type sig0-course +(deftype sig0-course (bot-course) + ((liftcat-speech-index int8 :offset-assert 48) + (first-liftcat-speeches (array int16) :offset-assert 52) + (second-liftcat-speeches (array int16) :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + +;; definition for method 3 of type sig0-course +(defmethod inspect sig0-course ((obj sig0-course)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) + (format #t "~1Tspots: #x~X~%" (-> obj spots)) + (format #t "~1Tliftcat-speech-index: ~D~%" (-> obj liftcat-speech-index)) + (format #t "~1Tfirst-liftcat-speeches: ~A~%" (-> obj first-liftcat-speeches)) + (format #t "~1Tsecond-liftcat-speeches: ~A~%" (-> obj second-liftcat-speeches)) + (label cfg-4) + obj + ) + +;; definition for method 183 of type sig-atoll +;; WARN: Return type mismatch object vs symbol. +(defmethod alive? sig-atoll ((obj sig-atoll)) + (let ((t9-0 (method-of-type bot alive?))) + (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'waiting-far) + (= v1-3 'waiting-close) + (= v1-3 'waiting-turn) + (= v1-3 'waiting-crouched) + (= v1-3 'charge-plasma) + ) + ) + ) + ) + ) + ) + +;; definition for method 116 of type sig-atoll +;; WARN: Return type mismatch object vs none. +(defmethod go-idle sig-atoll ((obj sig-atoll)) + (cond + ((task-node-closed? (game-task-node atoll-sig-resolution)) + (cleanup-for-death obj) + (go (method-of-object obj die-fast)) + ) + (else + (go (method-of-object obj waiting-crouched)) + ) + ) + (none) + ) + +;; definition for method 259 of type sig-atoll +;; WARN: Return type mismatch object vs symbol. +(defmethod sig-atoll-method-259 sig-atoll ((obj sig-atoll)) + (let ((v1-0 *target*)) + (the-as symbol (and v1-0 + (not (logtest? (-> v1-0 focus-status) (focus-status edge-grab))) + (>= (- (-> v1-0 control trans y) (-> obj sig-course spots 11 center y)) -819.2) + ) + ) + ) + ) + +;; definition for function sig0-first-battle-too-far +(defun sig0-first-battle-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (cond + ((and (zero? gp-0) (< 24576.0 (- (-> (get-trans *target* 1) y) (-> arg0 sig-course spots 2 center y)))) + (set! gp-0 1) + ) + ((>= (-> (target-pos 0) z) -3399680.0) + (set! gp-0 2) + ) + ) + gp-0 + ) + ) + +;; definition for function sig0-tank-check-too-far +(defun sig0-tank-check-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (if (and (zero? gp-0) (not (sig-atoll-method-259 arg0))) + (set! gp-0 1) + ) + gp-0 + ) + ) + +;; definition for function sig0-gangway-check-too-far +(defun sig0-gangway-check-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (when (nonzero? gp-0) + (let* ((s5-1 (-> arg0 sig-course spots)) + (f0-0 (vector-segment-distance-point! + (target-pos 0) + (the-as vector (-> s5-1 18)) + (the-as vector (-> s5-1 19)) + (the-as vector #f) + ) + ) + ) + (cond + ((< f0-0 45056.0) + (set! gp-0 0) + ) + ((< f0-0 110592.0) + (set! gp-0 1) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for function sig0-final-snipers-check-too-far +(defun sig0-final-snipers-check-too-far ((arg0 sig-atoll)) + (let ((gp-0 (bot-simple-check-too-far arg0))) + (when (or (zero? gp-0) (= gp-0 1)) + (let ((f0-1 (- (-> (get-trans *target* 1) y) (-> arg0 sig-course spots 38 center y)))) + (cond + ((>= f0-1 53248.0) + (set! gp-0 2) + ) + ((>= f0-1 34816.0) + (set! gp-0 1) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for function sig0-say-look-out-if-should +(defun sig0-say-look-out-if-should ((arg0 sig-atoll)) + (when (logtest? (-> arg0 bot-task-bits) 4) + (when (not (logtest? (-> arg0 bot-task-bits) 16)) + (let ((s5-0 (handle->process (-> arg0 focus handle)))) + (when s5-0 + (let ((v1-9 (if (type? s5-0 nav-enemy) + s5-0 + ) + ) + ) + (when v1-9 + (if (>= 20480.0 (- (-> (the-as process-focusable v1-9) root-override trans y) (-> arg0 root-override2 trans y))) + (logior! (-> arg0 bot-task-bits) 16) + ) + ) + ) + ) + ) + ) + (if (and (logtest? (-> arg0 bot-task-bits) 16) + (not (speech-playing? arg0 26)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 26) + ) + ) + (none) + ) + +;; definition for function sig-say-waste-the-suckers-if-should +(defun sig-say-waste-the-suckers-if-should ((arg0 sig-atoll)) + (if (and (logtest? (-> arg0 bot-task-bits) 8) + (not (speech-playing? arg0 25)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 25) + ) + (none) + ) + +;; definition for symbol *sig0-course*, type sig0-course +(define *sig0-course* + (new 'static 'sig0-course + :speech-count #x34 + :spot-count #x2a + :too-far-warn-speeches (new 'static 'bot-speech-list-shuffle + :flags #xa + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 35 36 37) + ) + :too-far-fail-speeches (new 'static 'bot-speech-list-shuffle + :flags #xa + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 38 43 44 45 48 49 50 51) + ) + :attack-player-speeches (new 'static 'bot-speech-list + :flags #x2 + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 42 41 39 40 46 47) + ) + :default-check-too-far 'bot-simple-check-too-far + :waypoints (new 'static 'boxed-array :type bot-waypoint + (new 'static 'bot-waypoint + :waypoint-id 1 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll) (arg1 bot-speech-list-shuffle)) + (let ((a0-1 20)) + (set! (-> arg0 hit-points) a0-1) + (set! (-> arg0 enemy-info-override default-hit-points) a0-1) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set-vector! a1-1 0.0 32768.0 0.0 1.0) + (quaternion-zxy! (-> arg0 root-override2 quat) a1-1) + ) + (clear-speech-flags! arg0) + (logior! (-> arg0 focus-status) (focus-status disable)) + (let ((v1-9 (game-task-control-method-9 (-> arg0 task)))) + (if (= (-> v1-9 action) (game-task-action say)) + (add-process + *gui-control* + arg0 + (gui-channel art-load) + (gui-action queue) + (the-as string (-> v1-9 scene)) + -99.0 + 0 + ) + ) + ) + (let ((v1-11 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-11 bytes 5) (the-as uint 1)) + (set! (-> v1-11 bytes 6) (the-as uint 0)) + (set! (-> v1-11 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-11) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when *target* + (let* ((s5-0 (target-pos 0)) + (f1-0 (vector-vector-xz-distance (-> arg1 root-override2 trans) s5-0)) + (f0-1 (- (-> s5-0 x) (-> arg1 root-override2 trans x))) + (f2-2 (- (-> s5-0 z) (-> arg1 root-override2 trans z))) + ) + (when (and (>= f2-2 -40960.0) + (or (>= 40960.0 f1-0) (< f2-2 24576.0) (and (< f2-2 192512.0) (or (< f0-1 -81920.0) (< 53248.0 f0-1)))) + ) + (let ((v1-19 (game-task-control-method-9 (-> arg1 task)))) + (cond + ((= (-> v1-19 action) (game-task-action say)) + (when (scene-play arg1 (the-as string (-> v1-19 scene)) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 2 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 3 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 2 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (stop-speech arg0 (the-as uint 0) #f) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 0)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (scene-release? arg1) + (reset-warn-time! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 3 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 3 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (if (demo?) + (talker-spawn-func (-> *talker-speech* 77) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (process-entity-status! arg0 (entity-perm-status no-kill) #t) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set! (-> arg0 too-far-warn-dist) 286720.0) + (set-setting! 'airlock #f 0 0) + (let ((a1-3 (new 'stack-no-clear 'array 'symbol 3))) + (set! (-> a1-3 2) 'atoll3) + (set! (-> a1-3 1) 'atoll2) + (set! (-> a1-3 0) 'atoll1) + (want-sound-banks *load-state* a1-3) + ) + (play-speech arg0 0) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'trigger) + (let ((t9-7 send-event-function) + (v1-21 (-> arg0 actor-group 0 data 0 actor)) + ) + (t9-7 + (if v1-21 + (-> v1-21 extra process) + ) + a1-5 + ) + ) + ) + (let ((v1-25 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-25 bytes 5) (the-as uint 1)) + (set! (-> v1-25 bytes 6) (the-as uint 1)) + (set! (-> v1-25 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-25) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 4 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 sig-atoll)) + (if (and (logtest? (-> arg0 bot-task-bits) 2) + (not (speech-playing? arg0 33)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 33) + ) + (none) + ) + :on-skipping-here #f + :check-too-far 'sig0-first-battle-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 4 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 286720.0) + (let ((v1-2 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-2 bytes 5) (the-as uint 1)) + (set! (-> v1-2 bytes 6) (the-as uint 2)) + (set! (-> v1-2 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-2) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 0 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 5 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (if (and (logtest? (-> arg0 bot-task-bits) 2) + (not (speech-playing? arg0 33)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 33) + ) + (none) + ) + :on-skipping-here #f + :check-too-far 'sig0-first-battle-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 5 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-choose-piston arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 4)) + (set! (-> v1-1 bytes 6) (the-as uint 3)) + (set! (-> v1-1 bytes 7) (the-as uint 4)) + (set! (-> v1-1 bytes 8) (the-as uint 5)) + (set! (-> v1-1 bytes 9) (the-as uint 6)) + (set! (-> v1-1 bytes 10) (the-as uint 1)) + (set! (-> v1-1 bytes 11) (the-as uint 1)) + (set! (-> v1-1 bytes 12) (the-as uint 2)) + (set! (-> v1-1 bytes 13) (the-as uint 2)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-choose-piston v1-1) check-done) + (lambda ((arg0 sigt-choose-piston) (arg1 sig-atoll)) + (when (sigt-choose-piston-method-12 arg0 arg1) + (reset-warn-time! arg1) + (set! (-> arg1 platform-index) (-> arg0 actor-indexes (-> arg0 which-spot))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 6 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (if (and (not (speech-playing? arg0 1)) + (not (channel-active? arg0 (the-as uint 0))) + (< (-> arg0 root-override2 trans z) (-> (target-pos 0) z)) + ) + (play-speech arg0 1) + ) + (none) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 6 + :nav-mesh-index 1 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (logior! (-> arg0 focus-status) (focus-status ignore)) + (let ((gp-0 7) + (s5-0 8) + ) + (when (= (-> arg0 platform-index) 2) + (set! gp-0 9) + (set! s5-0 10) + ) + (let ((v1-6 (get-task-by-type (-> arg0 ai-ctrl) sigt-riding-piston arg0))) + (set! (-> v1-6 bytes 5) (the-as uint 2)) + (set! (-> v1-6 bytes 6) (the-as uint gp-0)) + (set! (-> v1-6 bytes 7) (the-as uint s5-0)) + (set! (-> v1-6 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-riding-piston v1-6) check-done) + (the-as + (function sigt-riding-piston sig symbol) + (lambda ((arg0 ai-task-control) (arg1 sig-atoll)) (when (ai-task-control-method-12 arg0 arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 7 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (when (not (channel-active? arg0 (the-as uint 0))) + (if (and (not (speech-playing? arg0 1)) (< (-> arg0 root-override2 trans z) (-> (target-pos 0) z))) + (play-speech arg0 1) + ) + ) + (none) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 7 + :nav-mesh-index 1 + :skip-to #xa + :on-set (lambda ((arg0 sig-atoll)) + (reset-warn-time! arg0) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 11)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 3 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (cond + ((sig-atoll-method-259 arg1) + (let ((a0-4 (-> arg1 actor-group 0 data 4 actor))) + (set! (-> arg1 poi-handle) (ppointer->handle (if a0-4 + (process->ppointer (-> a0-4 extra process)) + ) + ) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 8 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ((not (speech-playing? arg1 3)) + (play-speech arg1 3) + (reset-warn-time! arg1) + #f + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-tank-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 8 + :nav-mesh-index 1 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (logclear! (-> arg0 focus-status) (focus-status ignore)) + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sig-tank" -99.0 0) + (let ((v1-6 (-> arg0 entity extra perm))) + (logior! (-> v1-6 status) (entity-perm-status bit-5)) + (set! (-> arg0 plasma charge-speed) (if (logtest? (-> v1-6 user-uint8 0) 1) + 0.5 + 0.25 + ) + ) + ) + (play-speech arg0 2) + (let ((v1-14 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-14 bytes 5) (the-as uint 3)) + (set! (-> v1-14 bytes 6) (the-as uint 12)) + (set! (-> v1-14 bytes 7) (the-as uint 13)) + (set! (-> v1-14 bytes 8) (the-as uint 14)) + (set! (-> v1-14 bytes 10) (the-as uint 4)) + (set! (-> (the-as sigt-charge-plasma v1-14) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (if (and (not (channel-active? arg1 (the-as uint 0))) (sig-atoll-method-259 arg1)) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sig-tank" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 9 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-tank-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 9 + :nav-mesh-index 1 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 15)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (scene-release? arg1) + (clear-poi-and-focus! arg1) + (reset-warn-time! arg1) + (let ((v1-8 (-> arg1 entity extra perm))) + (logior! (-> v1-8 status) (entity-perm-status bit-5)) + (set! (-> v1-8 user-int8 0) (the-as int (logior (-> v1-8 user-uint8 0) 1))) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 10 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 10 + :nav-mesh-index 2 + :skip-to #xf + :on-set (lambda ((arg0 sig-atoll)) + (play-speech arg0 4) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 36864.0) + (let ((v1-6 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-6 bytes 5) (the-as uint 2)) + (set! (-> v1-6 bytes 6) (the-as uint 16)) + (set! (-> v1-6 bytes 7) (the-as uint 17)) + (set! (-> v1-6 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-6) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (cond + ((and (logtest? (-> arg1 actor-group 0 data 5 actor extra perm status) (entity-perm-status dead)) + (logtest? (-> arg1 actor-group 0 data 6 actor extra perm status) (entity-perm-status dead)) + ) + (logclear! (-> arg1 focus-status) (focus-status disable)) + (set! (-> arg1 notice-enemy-dist) 122880.0) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 11 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + (else + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (if (and (not (speech-playing? arg1 5)) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-1 73728.0)) + (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root-override2 trans))) + ) + ) + (play-speech arg1 5) + ) + ) + #f + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here (lambda ((arg0 sig-atoll)) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel art-load) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (process-entity-status! arg0 (entity-perm-status no-kill) #t) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (clear-poi-and-focus! arg0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 16)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-hiding-behind-blocks")) + (none) + ) + :check-too-far 'sig0-gangway-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 11 + :nav-mesh-index 2 + :skip-to #xf + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 sig-course liftcat-speech-index) 0) + (let ((f0-0 (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + (f1-0 98304.0) + ) + (if (>= f0-0 (* f1-0 f1-0)) + (logior! (-> arg0 waypoint-bits) 2) + ) + ) + (play-speech arg0 6) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 20)) + (set! (-> v1-10 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-10) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (when (and (not (logtest? (-> arg1 waypoint-bits) 4)) + (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + ) + (set! (-> arg1 waypoint-bits) (logand -5 (-> arg1 waypoint-bits))) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-14 (-> arg1 actor-group 0 data 7 actor)) + ) + (t9-1 + (if v1-14 + (-> v1-14 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'query) + (let ((t9-2 send-event-function) + (v1-21 (-> arg1 actor-group 0 data 8 actor)) + ) + (case (t9-2 + (if v1-21 + (-> v1-21 extra process) + ) + a1-3 + ) + ((2) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (logior! (-> arg1 waypoint-bits) 1) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer pp)) + (set! (-> a1-4 num-params) 0) + (set! (-> a1-4 message) 'beaten) + (let ((t9-3 send-event-function) + (v1-34 (-> arg1 actor-group 0 data 7 actor)) + ) + (t9-3 + (if v1-34 + (-> v1-34 extra process) + ) + a1-4 + ) + ) + ) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'query) + (set! (-> a1-5 param 0) (the-as uint 'beaten)) + (let ((t9-4 send-event-function) + (v1-43 (-> arg1 actor-group 0 data 7 actor)) + ) + (when (and (t9-4 + (if v1-43 + (-> v1-43 extra process) + ) + a1-5 + ) + (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 12 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (cond + ((and (logtest? (-> arg0 waypoint-bits) 2) + (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + ) + (set! (-> arg0 waypoint-bits) (logand -3 (-> arg0 waypoint-bits))) + (let ((f0-0 98304.0)) + (if (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + (play-speech arg0 34) + ) + ) + ) + ((and (logtest? (-> arg0 waypoint-bits) 2) + (let ((f0-3 49152.0)) + (>= (* f0-3 f0-3) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + ) + ) + (set! (-> arg0 waypoint-bits) (logand -3 (-> arg0 waypoint-bits))) + (play-speech arg0 34) + ) + (else + (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + (not (channel-active? arg0 (the-as uint 0))) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer pp)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'query) + (let ((t9-9 send-event-function) + (v1-28 (-> arg0 actor-group 0 data 8 actor)) + ) + (when (and (zero? (t9-9 + (if v1-28 + (-> v1-28 extra process) + ) + a1-7 + ) + ) + (let ((f0-6 98304.0)) + (>= (* f0-6 f0-6) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root-override2 trans))) + ) + ) + (when (and (demo?) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 1)) + (logtest? (-> arg0 waypoint-bits) 16) + ) + (set! (-> arg0 waypoint-bits) (logand -17 (-> arg0 waypoint-bits))) + (talker-spawn-func (-> *talker-speech* 80) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (or (not (logtest? (-> arg0 waypoint-bits) 8)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (if (and (demo?) (zero? (logand (-> arg0 waypoint-bits) 8))) + (logior! (-> arg0 waypoint-bits) 16) + ) + (logior! (-> arg0 waypoint-bits) 8) + (let* ((s5-4 (-> arg0 sig-course)) + (s4-1 (-> s5-4 liftcat-speech-index)) + ) + (play-speech arg0 (-> s5-4 first-liftcat-speeches s4-1)) + (let ((v1-62 (+ s4-1 1))) + (if (>= v1-62 (-> s5-4 first-liftcat-speeches length)) + (set! v1-62 0) + ) + (set! (-> s5-4 liftcat-speech-index) v1-62) + ) + ) + (set! (-> arg0 waypoint-time0) (-> pp clock frame-counter)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far 'sig0-gangway-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 12 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (if (< -86016.0 (- (-> (target-pos 0) z) (-> arg0 sig-course spots 20 center z))) + (play-speech arg0 9) + ) + (let ((a0-3 (-> arg0 actor-group 0 data 10 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-3 + (process->ppointer (-> a0-3 extra process)) + ) + ) + ) + ) + (let ((v1-13 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-13 bytes 5) (the-as uint 2)) + (set! (-> v1-13 bytes 6) (the-as uint 21)) + (set! (-> v1-13 bytes 7) (the-as uint 22)) + (set! (-> v1-13 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-13) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((not (logtest? (-> arg1 waypoint-bits) 1)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 81920.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (logior! (-> arg1 waypoint-bits) 1) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 10) + (set-setting! 'entity-name "camera-68" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 81920.0) + (set! (-> arg1 too-far-fail-dist-delta) 225280.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 2)) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 13 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 2) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 13 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-a" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 9 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 2)) + (set! (-> v1-10 bytes 6) (the-as uint 21)) + (set! (-> v1-10 bytes 7) (the-as uint 22)) + (set! (-> v1-10 bytes 10) (the-as uint 10)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 9 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (let ((s5-0 *target*)) + (if (and s5-0 (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-21 (-> arg1 actor-group 0 data 9 actor)) + ) + (and (t9-2 + (if v1-21 + (-> v1-21 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) + (>= (- (-> s5-0 control trans y) (-> arg1 root-override2 trans y)) -4096.0) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sniper-a" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 14 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer pp)) + (set! (-> a1-8 num-params) 0) + (set! (-> a1-8 message) 'resume) + (let ((t9-10 send-event-function) + (v1-54 (-> arg1 actor-group 0 data 9 actor)) + ) + (t9-10 + (if v1-54 + (-> v1-54 extra process) + ) + a1-8 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 14 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 2)) + (set! (-> v1-1 bytes 6) (the-as uint 21)) + (set! (-> v1-1 bytes 7) (the-as uint 22)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (scene-release? arg1) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set-vector! a1-1 0.0 -16384.0 0.0 1.0) + (quaternion-zxy! (-> arg1 root-override2 quat) a1-1) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((v1-6 (-> arg1 sig-course spots))) + (vector-lerp! s5-0 (the-as vector (-> v1-6 21)) (the-as vector (-> v1-6 22)) 0.5) + ) + (move-to-point! (-> arg1 root-override2) s5-0) + ) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 15 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 15 + :nav-mesh-index 3 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (play-speech arg0 11) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 23)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (when (or (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 11 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-2 + ) + ) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 16 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (b! (not (channel-active? arg0 (the-as uint 0))) cfg-2 :delay (empty-form)) + (set! (-> arg0 waypoint-time0) (-> pp clock frame-counter)) + (b! #t cfg-21 :delay (nop!)) + (label cfg-2) + (b! + (not (and (not (speech-playing? arg0 12)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.75)) + ) + ) + cfg-7 + :delay (empty-form) + ) + (play-speech arg0 12) + (b! #t cfg-21 :delay (nop!)) + (label cfg-7) + (if (and (not (speech-playing? arg0 13)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.5)) + (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer pp)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'query) + (set! (-> a1-5 param 0) (the-as uint 'beaten)) + (let ((t9-5 send-event-function) + (v1-26 (-> arg0 actor-group 0 data 11 actor)) + ) + (not (t9-5 + (if v1-26 + (-> v1-26 extra process) + ) + a1-5 + ) + ) + ) + ) + ) + (play-speech arg0 13) + ) + (label cfg-21) + (none) + ) + ) + :on-skipping-here (lambda ((arg0 sig-atoll)) + (with-pp + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (clear-poi-and-focus! arg0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-2 send-event-function) + (v1-8 (-> arg0 actor-group 0 data 7 actor)) + ) + (t9-2 + (if v1-8 + (-> v1-8 extra process) + ) + a1-1 + ) + ) + ) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 21)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-down-ramp")) + (none) + ) + ) + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 16 + :nav-mesh-index 3 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 24)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 11 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 17 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (if (and (not (speech-playing? arg0 13)) + (not (channel-active? arg0 (the-as uint 0))) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-11 (-> arg0 actor-group 0 data 11 actor)) + ) + (not (t9-2 + (if v1-11 + (-> v1-11 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + (play-speech arg0 13) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 17 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 waypoint-time0) 0) + (let ((a0-1 (-> arg0 actor-group 0 data 13 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-1 + (process->ppointer (-> a0-1 extra process)) + ) + ) + ) + ) + (play-speech arg0 14) + (let ((v1-9 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-9 bytes 5) (the-as uint 2)) + (set! (-> v1-9 bytes 6) (the-as uint 25)) + (set! (-> v1-9 bytes 7) (the-as uint 26)) + (set! (-> v1-9 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-9) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 73728.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (play-speech arg1 15) + (reset-warn-time! arg1) + (set-setting! 'entity-name "camera-69" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 73728.0) + (set! (-> arg1 too-far-fail-dist-delta) 233472.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 18 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 18 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-b" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 12 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (play-speech arg0 16) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 2)) + (set! (-> v1-12 bytes 6) (the-as uint 25)) + (set! (-> v1-12 bytes 7) (the-as uint 26)) + (set! (-> v1-12 bytes 10) (the-as uint 13)) + (set! (-> (the-as sigt-charge-plasma v1-12) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 12 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (if (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 12 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sniper-b" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 19 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'resume) + (let ((t9-12 send-event-function) + (v1-53 (-> arg1 actor-group 0 data 12 actor)) + ) + (t9-12 + (if v1-53 + (-> v1-53 extra process) + ) + a1-9 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 19 + :nav-mesh-index 3 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 2)) + (set! (-> v1-1 bytes 6) (the-as uint 25)) + (set! (-> v1-1 bytes 7) (the-as uint 26)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (remove-setting! 'sound-mode) + (clear-poi-and-focus! arg1) + (reset-warn-time! arg1) + (play-speech arg1 17) + (logior! (-> arg1 waypoint-bits) 1) + ) + (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 20 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 20 + :nav-mesh-index 4 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 27)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 21 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (if (and (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 1.5)) + (not (speech-playing? arg0 18)) + (not (channel-active? arg0 (the-as uint 0))) + ) + (play-speech arg0 18) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 21 + :nav-mesh-index 5 + :skip-to #x17 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 sig-course liftcat-speech-index) 0) + (let ((v1-2 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-2 bytes 5) (the-as uint 1)) + (set! (-> v1-2 bytes 6) (the-as uint 29)) + (set! (-> v1-2 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-2) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'query) + (let* ((t9-0 send-event-function) + (v1-4 (-> arg1 actor-group 0 data 15 actor)) + (v1-6 (t9-0 + (if v1-4 + (-> v1-4 extra process) + ) + a1-1 + ) + ) + ) + (cond + ((zero? v1-6) + (when (not (channel-active? arg1 (the-as uint 0))) + (let ((s5-0 (-> arg1 root-override2 trans)) + (s4-0 (-> arg1 sig-course spots)) + (f0-0 163840.0) + ) + (when (and (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (target-pos 0))) + (let ((f0-3 86016.0)) + (or (>= (* f0-3 f0-3) (vector-vector-xz-distance-squared s5-0 (the-as vector (-> s4-0 28)))) + (let ((f0-6 102400.0)) + (>= (* f0-6 f0-6) (vector-vector-xz-distance-squared s5-0 (the-as vector (-> s4-0 29)))) + ) + ) + ) + ) + (when (or (not (logtest? (-> arg1 waypoint-bits) 2)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg1 waypoint-bits) 2) + (let* ((s5-1 (-> arg1 sig-course)) + (s4-1 (-> s5-1 liftcat-speech-index)) + ) + (play-speech arg1 (-> s5-1 second-liftcat-speeches s4-1)) + (let ((v1-35 (+ s4-1 1))) + (if (>= v1-35 (-> s5-1 second-liftcat-speeches length)) + (set! v1-35 0) + ) + (set! (-> s5-1 liftcat-speech-index) v1-35) + ) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + ) + ) + ) + ) + ) + ((= v1-6 2) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (logior! (-> arg1 waypoint-bits) 1) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer pp)) + (set! (-> a1-8 num-params) 0) + (set! (-> a1-8 message) 'beaten) + (let ((t9-7 send-event-function) + (v1-48 (-> arg1 actor-group 0 data 14 actor)) + ) + (t9-7 + (if v1-48 + (-> v1-48 extra process) + ) + a1-8 + ) + ) + ) + ) + (if (and (not (speech-playing? arg1 20)) (not (channel-active? arg1 (the-as uint 0)))) + (play-speech arg1 20) + ) + (when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((a1-13 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-13 from) (process->ppointer pp)) + (set! (-> a1-13 num-params) 1) + (set! (-> a1-13 message) 'query) + (set! (-> a1-13 param 0) (the-as uint 'beaten)) + (let ((t9-12 send-event-function) + (v1-68 (-> arg1 actor-group 0 data 14 actor)) + ) + (t9-12 + (if v1-68 + (-> v1-68 extra process) + ) + a1-13 + ) + ) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 22 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 22 + :nav-mesh-index #x6 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 waypoint-time0) 0) + (let ((a0-1 (-> arg0 actor-group 0 data 16 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-1 + (process->ppointer (-> a0-1 extra process)) + ) + ) + ) + ) + (if (not (speech-playing? arg0 20)) + (play-speech arg0 20) + ) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 1)) + (set! (-> v1-12 bytes 6) (the-as uint 30)) + (set! (-> v1-12 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-12) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 61440.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 21) + (set-setting! 'entity-name "camera-70" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 61440.0) + (set! (-> arg1 too-far-fail-dist-delta) 245760.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 23 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 23 + :nav-mesh-index #x6 + :skip-to #x1f + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-c" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 17 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 30)) + (set! (-> v1-10 bytes 10) (the-as uint 16)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 17 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (if (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 17 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) + (and (>= (- (-> (target-pos 0) y) (-> arg1 sig-course spots 30 center y)) -8192.0) + (scene-play arg1 "atoll-sniper-c" #f) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 24 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'resume) + (let ((t9-13 send-event-function) + (v1-57 (-> arg1 actor-group 0 data 17 actor)) + ) + (t9-13 + (if v1-57 + (-> v1-57 extra process) + ) + a1-9 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here (lambda ((arg0 sig-atoll)) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (clear-poi-and-focus! arg0) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 30)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-charge-gun-for-sniper-c")) + (none) + ) + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 24 + :nav-mesh-index #x6 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 30)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (scene-release? arg1) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (play-speech arg1 22) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 25 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 25 + :nav-mesh-index #x6 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 36864.0) + (let ((v1-4 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-4 bytes 5) (the-as uint 1)) + (set! (-> v1-4 bytes 6) (the-as uint 31)) + (set! (-> v1-4 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-4) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 26 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) (sig-say-waste-the-suckers-if-should arg0) (none)) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 26 + :nav-mesh-index #x7 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 32)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 27 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) (sig-say-waste-the-suckers-if-should arg0) (none)) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 27 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (let ((v1-4 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-4 bytes 5) (the-as uint 1)) + (set! (-> v1-4 bytes 6) (the-as uint 33)) + (set! (-> v1-4 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-4) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 18 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 28 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) (sig-say-waste-the-suckers-if-should arg0) (none)) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 28 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 waypoint-time0) 0) + (let ((a1-0 (-> arg0 actor-group 0 data 19 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a1-0 + (process->ppointer (-> a1-0 extra process)) + ) + ) + ) + ) + (let ((v1-7 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-7 bytes 5) (the-as uint 1)) + (set! (-> v1-7 bytes 6) (the-as uint 34)) + (set! (-> v1-7 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-7) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (set! (-> arg1 too-far-warn-dist) 184320.0) + (set! (-> arg1 too-far-fail-dist-delta) 122880.0) + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 73728.0) + ) + (cond + ((and (< f0-2 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 23) + (set-setting! 'entity-name "camera-71" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 73728.0) + (set! (-> arg1 too-far-fail-dist-delta) 233472.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.1)) + ) + (remove-setting! 'string-startup-vector) + (logior! (-> arg1 waypoint-bits) 2) + ) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 29 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 2)) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 29 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-d" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 20 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 34)) + (set! (-> v1-10 bytes 10) (the-as uint 19)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 20 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (if (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 20 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sniper-d" #f)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 30 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'resume) + (let ((t9-12 send-event-function) + (v1-53 (-> arg1 actor-group 0 data 20 actor)) + ) + (t9-12 + (if v1-53 + (-> v1-53 extra process) + ) + a1-9 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 30 + :nav-mesh-index #x8 + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 34)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (play-speech arg1 24) + (logior! (-> arg1 waypoint-bits) 1) + ) + (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 31 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 31 + :nav-mesh-index #x9 + :skip-to #x25 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 36864.0) + (let ((v1-6 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-6 bytes 5) (the-as uint 1)) + (set! (-> v1-6 bytes 6) (the-as uint 35)) + (set! (-> v1-6 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-6) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (not (channel-active? arg1 (the-as uint 0))) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 32 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (cond + ((not (logtest? (-> arg0 bot-task-bits) 4)) + (when (and (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.25)) + (< (-> arg0 sig-course spots 36 center x) (-> (target-pos 0) x)) + ) + (logior! (-> arg0 bot-task-bits) 4) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-14 (-> arg0 actor-group 0 data 21 actor)) + ) + (t9-1 + (if v1-14 + (-> v1-14 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (else + (sig0-say-look-out-if-should arg0) + ) + ) + (none) + ) + ) + :on-skipping-here (lambda ((arg0 sig-atoll)) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (clear-poi-and-focus! arg0) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 34)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-cross-water")) + (none) + ) + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 32 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (when (not (logtest? (-> arg0 bot-task-bits) 4)) + (logior! (-> arg0 bot-task-bits) 4) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-14 (-> arg0 actor-group 0 data 21 actor)) + ) + (t9-0 + (if v1-14 + (-> v1-14 extra process) + ) + a1-0 + ) + ) + ) + ) + (let ((v1-18 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-18 bytes 5) (the-as uint 1)) + (set! (-> v1-18 bytes 6) (the-as uint 37)) + (set! (-> v1-18 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-18) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (logtest? (-> arg1 waypoint-bits) 1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 33 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (sig0-say-look-out-if-should arg0) + (when (and (not (logtest? (-> arg0 waypoint-bits) 1)) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 16384.0) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 33 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 38)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (cond + ((logtest? (bot-flags bf19) (-> arg1 bot-flags)) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 34 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + (else + (if (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (set! (-> arg1 bot-flags) (logior (bot-flags bf20) (-> arg1 bot-flags))) + (logclear! (-> arg1 bot-flags) (bot-flags bf20)) + ) + #f + ) + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 34 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'die-count)) + (let ((t9-0 send-event-function) + (v1-8 (-> arg0 actor-group 0 data 21 actor)) + ) + (set! (-> arg0 waypoint-int32a) (the-as int (t9-0 + (if v1-8 + (-> v1-8 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 1)) + (set! (-> v1-12 bytes 6) (the-as uint 38)) + (set! (-> v1-12 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-12) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (not (logtest? (bot-flags bf19) (-> arg1 bot-flags))) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 35 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update (lambda ((arg0 sig-atoll)) + (with-pp + (cond + ((not (speech-playing? arg0 27)) + (if (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 0.5)) + (play-speech arg0 27) + ) + ) + ((not (logtest? (-> arg0 waypoint-bits) 1)) + (when (speech-ended? arg0 27) + (logior! (-> arg0 waypoint-bits) 1) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (set! (-> arg0 waypoint-time0) (-> pp clock frame-counter)) + ) + ) + ((not (logtest? (-> arg0 waypoint-bits) 2)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'die-count)) + (let ((t9-3 send-event-function) + (v1-26 (-> arg0 actor-group 0 data 21 actor)) + ) + (cond + ((or (>= (- (the-as int (t9-3 + (if v1-26 + (-> v1-26 extra process) + ) + a1-3 + ) + ) + (the-as uint (-> arg0 waypoint-int32a)) + ) + 5 + ) + (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 10)) + ) + (set! (-> arg0 bot-flags) (logior (bot-flags bf21) (-> arg0 bot-flags))) + (logior! (-> arg0 waypoint-bits) 2) + ) + (else + (if (and (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 4)) + (not (speech-playing? arg0 28)) + ) + (play-speech arg0 28) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 35 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (play-speech arg0 29) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-8 (-> arg0 actor-group 0 data 21 actor)) + ) + (t9-1 + (if v1-8 + (-> v1-8 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-12 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-12 bytes 5) (the-as uint 1)) + (set! (-> v1-12 bytes 6) (the-as uint 37)) + (set! (-> v1-12 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-12) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'beaten)) + (let ((t9-0 send-event-function) + (v1-6 (-> arg1 actor-group 0 data 21 actor)) + ) + (when (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + (clear-poi-and-focus! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 36 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 36 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-3 bytes 5) (the-as uint 1)) + (set! (-> v1-3 bytes 6) (the-as uint 39)) + (set! (-> v1-3 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-3) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (not (channel-active? arg1 (the-as uint 0))) + ) + (let ((f0-0 122880.0)) + (if (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (play-speech arg1 30) + ) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 37 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 37 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (set! (-> arg0 too-far-warn-dist) 327680.0) + (set! (-> arg0 too-far-fail-dist-delta) 163840.0) + (set! (-> arg0 waypoint-time0) 0) + (let ((a0-1 (-> arg0 actor-group 0 data 22 actor))) + (set! (-> arg0 poi-handle) (ppointer->handle (if a0-1 + (process->ppointer (-> a0-1 extra process)) + ) + ) + ) + ) + (reset-warn-time! arg0) + (let ((v1-11 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-11 bytes 5) (the-as uint 1)) + (set! (-> v1-11 bytes 6) (the-as uint 40)) + (set! (-> v1-11 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-11) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((zero? (-> arg1 waypoint-time0)) + (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) + (let ((f0-0 (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + (f1-0 61440.0) + ) + (cond + ((and (< f0-0 (* f1-0 f1-0)) + (not (channel-active? arg1 (the-as uint 0))) + (process-grab? arg1 #t) + (process-grab? *target* #t) + ) + (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) + (process-grab? arg1 #f) + (process-grab? *target* #f) + (reset-warn-time! arg1) + (play-speech arg1 31) + (set-setting! 'entity-name "camera-72" 0 0) + ) + (else + (set! (-> arg1 too-far-warn-dist) 61440.0) + (set! (-> arg1 too-far-fail-dist-delta) 430080.0) + ) + ) + ) + ) + ) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.1)) + ) + (remove-setting! 'string-startup-vector) + (logior! (-> arg1 waypoint-bits) 2) + ) + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 4.5)) + (process-release? arg1) + (process-release? *target*) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 38 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 3)) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) + (remove-setting! 'entity-name) + (logior! (-> arg1 waypoint-bits) 1) + (set-setting! 'sound-mode #f 0 1) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here (lambda ((arg0 sig-atoll)) + (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) + (logclear! (-> arg0 focus-status) (focus-status disable)) + (logior! (-> arg0 bot-flags) (bot-flags bf06)) + (set! (-> arg0 notice-enemy-dist) 122880.0) + (clear-poi-and-focus! arg0) + (send-event arg0 'move-trans (-> arg0 sig-course spots 38)) + (send-event *target* 'continue (get-continue-by-name *game-info* "sig0-show-sniper-e")) + (none) + ) + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 38 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (with-pp + (add-process *gui-control* arg0 (gui-channel art-load) (gui-action queue) "atoll-sniper-e" -99.0 0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-6 (-> arg0 actor-group 0 data 23 actor)) + ) + (t9-1 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + (let ((v1-10 (get-task-by-type (-> arg0 ai-ctrl) sigt-charge-plasma arg0))) + (set! (-> v1-10 bytes 5) (the-as uint 1)) + (set! (-> v1-10 bytes 6) (the-as uint 40)) + (set! (-> v1-10 bytes 10) (the-as uint 22)) + (set! (-> (the-as sigt-charge-plasma v1-10) check-done) + (the-as + (function sigt-charge-plasma sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) + (with-pp + (cond + ((sig-plasma-method-10 (-> arg1 plasma)) + (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'beaten) + (let ((t9-1 send-event-function) + (v1-9 (-> arg1 actor-group 0 data 23 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (logior! (-> arg1 waypoint-bits) 1) + ) + (when (and *target* + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'beaten)) + (let ((t9-2 send-event-function) + (v1-22 (-> arg1 actor-group 0 data 23 actor)) + ) + (and (t9-2 + (if v1-22 + (-> v1-22 extra process) + ) + a1-2 + ) + (not (channel-active? arg1 (the-as uint 0))) + (let ((f0-0 102400.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root-override2 trans) (target-pos 0))) + ) + ) + ) + ) + ) + (sig-plasma-method-9 (-> arg1 plasma)) + (if (and (not (speech-playing? arg1 32)) + (and (>= (-> arg1 plasma level) 1.0) (-> arg1 next-state) (= (-> arg1 next-state name) 'charge-plasma)) + ) + (play-speech arg1 32) + ) + ) + (when (and (sig-plasma-method-13 (-> arg1 plasma)) + (not (channel-active? arg1 (the-as uint 0))) + (scene-play arg1 "atoll-sniper-e" #f) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 39 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + (return #t) + ) + ) + (else + (when (logtest? (-> arg1 waypoint-bits) 1) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer pp)) + (set! (-> a1-12 num-params) 0) + (set! (-> a1-12 message) 'resume) + (let ((t9-15 send-event-function) + (v1-66 (-> arg1 actor-group 0 data 23 actor)) + ) + (t9-15 + (if v1-66 + (-> v1-66 extra process) + ) + a1-12 + ) + ) + ) + (set! (-> arg1 waypoint-bits) (logand -2 (-> arg1 waypoint-bits))) + ) + ) + ) + #f + ) + ) + ) + ) + ) + (none) + ) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'sig0-final-snipers-check-too-far + ) + (new 'static 'bot-waypoint + :waypoint-id 39 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (let ((v1-1 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-1 bytes 5) (the-as uint 1)) + (set! (-> v1-1 bytes 6) (the-as uint 40)) + (set! (-> v1-1 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-1) check-done) + (the-as + (function sigt-wait-spot sig symbol) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (scene-release? arg1) + (clear-poi-and-focus! arg1) + (remove-setting! 'sound-mode) + (reset-warn-time! arg1) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 40 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) + ) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + (new 'static 'bot-waypoint + :waypoint-id 40 + :nav-mesh-index #xa + :skip-to -1 + :on-set (lambda ((arg0 sig-atoll)) + (task-node-close! (game-task-node atoll-sig-resolution)) + (process-entity-status! arg0 (entity-perm-status bit-4) #f) + (logclear! (-> arg0 enemy-flags) (enemy-flag use-notice-distance)) + (logclear! (-> arg0 bot-flags) (bot-flags bf06)) + (bot-method-196 arg0) + (set! (-> arg0 bot-flags) (logior (bot-flags bf22) (-> arg0 bot-flags))) + (if (demo?) + (send-event *target* 'continue (get-continue-by-name *game-info* "demo-restart")) + ) + (let ((v1-16 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) + (set! (-> v1-16 bytes 5) (the-as uint 1)) + (set! (-> v1-16 bytes 6) (the-as uint 41)) + (set! (-> v1-16 bytes 4) (the-as uint -1)) + (set! (-> (the-as sigt-wait-spot v1-16) check-done) + (the-as (function sigt-wait-spot sig symbol) (lambda () #f)) + ) + ) + (none) + ) + :on-update #f + :on-skipping-here #f + :check-too-far 'bot-check-too-far-always-okay + ) + ) + :speeches (new 'static 'inline-array bot-speech-info 52 + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt003") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt004") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt005") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt006") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt007") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt008") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt020") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt009") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt010") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt011") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt012") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt013") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt014") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt058") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt015") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt021") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt022") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt023") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt024") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt057") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt059") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt025") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt026") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt027") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt028") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt019") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt029") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt030") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt031") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt032") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt039") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt033") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt038") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt036") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt037") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt043") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt044") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt045") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt049") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt046") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt047") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt056") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt082") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt054") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt052") + (new 'static 'bot-speech-info :flags (speech-flags sf01) :hold-time #x5a :slave-id -1 :name "sigt053") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt083") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt087") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt089") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt090") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt091") + (new 'static 'bot-speech-info :hold-time #x5a :slave-id -1 :name "sigt092") + ) + :speech-tunings (new 'static 'inline-array bot-speech-tuning 1 + (new 'static 'bot-speech-tuning :fo-min 30 :fo-max #x78 :fo-curve #xb :trans? #t) + ) + :spots (new 'static 'inline-array bot-spot 42 + (new 'static 'bot-spot :center (new 'static 'vector :x 2341970.0 :y 4915.2 :z -3590061.8 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2294497.2 :y 5529.6 :z -3631104.0 :w 49152.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2222940.2 :y 4505.6 :z -3746652.2 :w 28672.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2244567.0 :y 4259.84 :z -3795067.0 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2217410.5 :y 5160.96 :z -3782819.8 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2192261.0 :y 4915.2 :z -3784007.8 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2160926.8 :y 5283.84 :z -3787817.0 :w 8192.0) + :blocked-xz-dist 12288.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2227036.2 :y 62382.08 :z -3838361.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2204221.5 :y 62382.08 :z -3836395.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2196521.0 :y 62382.08 :z -3837337.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2174771.2 :y 62382.08 :z -3838484.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 2190704.8 :y 62382.08 :z -3870187.5 :w 16384.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2216222.8 :y 62382.08 :z -3853189.0 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2216059.0 :y 62382.08 :z -3863265.2 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 2215854.0 :y 62382.08 :z -3873341.5 :w 4096.0) + :blocked-xz-dist 8192.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 2239406.0 :y 62382.08 :z -3848929.2 :w 12288.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1997209.6 :y 53739.52 :z -3898613.8 :w 4096.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1988894.8 :y 53739.52 :z -3888701.5 :w 4096.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 2043289.6 :y 53739.52 :z -3884318.8 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1721098.2 :y 53739.52 :z -3884318.8 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1742438.4 :y 53821.44 :z -3885301.8 :w 16384.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1734860.8 :y 53698.56 :z -4004085.8 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1731543.0 :y 53698.56 :z -4017602.5 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 1492582.4 :y 3850.24 :z -3921797.0 :w 73728.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1431347.2 :y 7127.04 :z -4036894.8 :w 16384.0)) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1407754.2 :y 6184.96 :z -4143308.8 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot + :center (new 'static 'vector :x 1407426.5 :y 5980.16 :z -4121272.2 :w 6144.0) + :blocked-xz-dist 6144.0 + ) + (new 'static 'bot-spot :center (new 'static 'vector :x 1414840.4 :y 53698.56 :z -4339835.0 :w 47104.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1394319.4 :y 53698.56 :z -4419051.5 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1453342.8 :y 53575.68 :z -4515963.0 :w 12288.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1591091.2 :y 53698.56 :z -4761313.5 :w 12288.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1732485.1 :y 53493.76 :z -4682547.0 :w 11264.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1879244.8 :y 4628.48 :z -4555899.0 :w 14336.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1847214.1 :y 8028.16 :z -4351385.5 :w 24576.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 1859297.2 :y 7536.64 :z -4371702.0 :w 10240.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2036899.9 :y 4956.16 :z -4314726.5 :w 32768.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2024038.4 :y 5201.92 :z -4323574.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2155069.5 :y 4915.2 :z -4291543.0 :w 24576.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2155069.5 :y 4915.2 :z -4291543.0 :w 10240.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2272133.0 :y 5734.4 :z -4268851.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2389196.8 :y 6553.6 :z -4246282.0 :w 12288.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2389196.8 :y 6553.6 :z -4246282.0 :w 26624.0)) + ) + :first-liftcat-speeches (new 'static 'boxed-array :type int16 7 8 19) + :second-liftcat-speeches (new 'static 'boxed-array :type int16 19 8 7) + ) + ) + +;; failed to figure out what this is: +(set! (-> *bot-course-table* course 0) *sig0-course*) + + + + diff --git a/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc new file mode 100644 index 0000000000..d97713c52c --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc @@ -0,0 +1,323 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ai-task +(deftype ai-task (basic) + ((next ai-task :offset-assert 4) + (prev ai-task :offset-assert 8) + (pool ai-task-pool :offset-assert 12) + (unique-id uint32 :offset-assert 16) + (bytes uint8 16 :offset 32) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + (:methods + (reset-task! (_type_) none 9) + (ai-task-method-10 (_type_ bot) none 10) + (ai-task-method-11 (_type_ bot) none 11) + ) + ) + +;; definition for method 3 of type ai-task +(defmethod inspect ai-task ((obj ai-task)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (label cfg-4) + obj + ) + +;; definition of type ai-task-pool +(deftype ai-task-pool (basic) + ((anchor ai-task :offset-assert 4) + (tasks (pointer uint32) :offset-assert 8) + (tasks-length uint32 :offset-assert 12) + (unique-id uint32 :offset-assert 16) + ) + :method-count-assert 12 + :size-assert #x14 + :flag-assert #xc00000014 + (:methods + (assign-ids! (_type_ type) ai-task 9) + (set-next-task! (_type_ ai-task) none 10) + (ai-task-pool-method-11 (_type_) ai-task 11) + ) + ) + +;; definition for method 3 of type ai-task-pool +(defmethod inspect ai-task-pool ((obj ai-task-pool)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tanchor: ~A~%" (-> obj anchor)) + (format #t "~1Ttasks: #x~X~%" (-> obj tasks)) + (format #t "~1Ttasks-length: ~D~%" (-> obj tasks-length)) + (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (label cfg-4) + obj + ) + +;; definition of type ai-task-control +(deftype ai-task-control (basic) + ((anchor ai-task :offset-assert 4) + (pool ai-task-pool :offset-assert 8) + ) + :method-count-assert 18 + :size-assert #xc + :flag-assert #x120000000c + (:methods + (new (symbol type ai-task-pool) _type_ 0) + (ai-task-control-method-9 (_type_) none 9) + (ai-task-control-method-10 (_type_ bot) none 10) + (get-task-by-type (_type_ type bot) ai-task 11) + (ai-task-control-method-12 (_type_ bot) symbol 12) + (ai-task-control-method-13 (_type_ ai-task bot) ai-task 13) + (ai-task-control-method-14 (_type_ ai-task bot) none 14) + (init-task! (_type_ type bot) ai-task 15) + (set-next-task-for-pool! (_type_ ai-task) none 16) + (set-next-task! (_type_ ai-task) none 17) + ) + ) + +;; definition for method 3 of type ai-task-control +(defmethod inspect ai-task-control ((obj ai-task-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tanchor: ~A~%" (-> obj anchor)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (label cfg-4) + obj + ) + +;; definition for method 11 of type ai-task +;; WARN: Return type mismatch int vs none. +(defmethod ai-task-method-11 ai-task ((obj ai-task) (arg0 bot)) + "Virtual" + 0 + (none) + ) + +;; definition for method 10 of type ai-task +;; WARN: Return type mismatch int vs none. +(defmethod ai-task-method-10 ai-task ((obj ai-task) (arg0 bot)) + "Virtual" + 0 + (none) + ) + +;; definition for method 9 of type ai-task +;; WARN: Return type mismatch int vs none. +(defmethod reset-task! ai-task ((obj ai-task)) + "Virtual" + 0 + (none) + ) + +;; definition for method 11 of type ai-task-pool +;; WARN: Return type mismatch (pointer uint32) vs ai-task. +(defmethod ai-task-pool-method-11 ai-task-pool ((obj ai-task-pool)) + (set! (-> obj unique-id) (the-as uint 0)) + (let ((t0-0 (the-as (pointer uint32) #f)) + (a1-0 (the-as (pointer uint32) #f)) + (v1-0 (-> obj tasks)) + ) + (let ((a2-0 (-> obj tasks-length))) + (dotimes (a3-0 (the-as int a2-0)) + (set! a1-0 (&+ v1-0 (* 48 a3-0))) + (set! (-> a1-0 2) (the-as uint obj)) + (set! (-> a1-0 3) (the-as uint 0)) + (set! (-> a1-0 1) (the-as uint t0-0)) + (if t0-0 + (set! (-> t0-0 0) (the-as uint a1-0)) + ) + (set! t0-0 a1-0) + ) + ) + (set! (-> a1-0 0) (the-as uint #f)) + (let ((v0-0 (&-> v1-0 0))) + (set! (-> obj anchor) (the-as ai-task v0-0)) + (the-as ai-task v0-0) + ) + ) + ) + +;; definition for method 9 of type ai-task-pool +(defmethod assign-ids! ai-task-pool ((obj ai-task-pool) (arg0 type)) + "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" + (let ((v1-1 (-> obj anchor next))) + (when v1-1 + (let ((a2-0 (-> v1-1 prev)) + (a3-0 (-> v1-1 next)) + ) + (set! (-> v1-1 prev) #f) + (set! (-> v1-1 next) #f) + (let ((t0-1 (the-as int (+ (-> obj unique-id) 1)))) + (if (zero? (the-as uint t0-1)) + (set! t0-1 1) + ) + (set! (-> obj unique-id) (the-as uint t0-1)) + (set! (-> v1-1 unique-id) (the-as uint t0-1)) + ) + (set! (-> a2-0 next) a3-0) + (if a3-0 + (set! (-> a3-0 prev) a2-0) + ) + ) + (set! (-> v1-1 type) arg0) + v1-1 + ) + ) + ) + +;; definition for method 10 of type ai-task-pool +;; WARN: Return type mismatch ai-task vs none. +(defmethod set-next-task! ai-task-pool ((obj ai-task-pool) (arg0 ai-task)) + "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." + (let* ((v1-0 (-> obj anchor)) + (v0-0 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) v0-0) + ) + (none) + ) + +;; definition for method 0 of type ai-task-control +(defmethod new ai-task-control ((allocation symbol) (type-to-make type) (arg0 ai-task-pool)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 pool) arg0) + (set! (-> s5-0 anchor) (assign-ids! arg0 ai-task)) + s5-0 + ) + ) + +;; definition for method 12 of type ai-task-control +(defmethod ai-task-control-method-12 ai-task-control ((obj ai-task-control) (arg0 bot)) + (let ((gp-0 (-> obj anchor))) + (let ((s3-0 (-> obj anchor next))) + (while s3-0 + (let ((s4-0 (-> s3-0 next))) + (if arg0 + (ai-task-method-10 s3-0 arg0) + ) + (set-next-task! (-> s3-0 pool) s3-0) + (set! s3-0 s4-0) + ) + ) + ) + (set! (-> gp-0 prev) #f) + (set! (-> gp-0 next) #f) + ) + #f + ) + +;; definition for method 9 of type ai-task-control +;; WARN: Return type mismatch symbol vs none. +(defmethod ai-task-control-method-9 ai-task-control ((obj ai-task-control)) + (ai-task-control-method-12 obj (the-as bot #f)) + (let ((a1-1 (-> obj anchor))) + (when a1-1 + (set-next-task! (-> a1-1 pool) a1-1) + (set! (-> obj anchor) #f) + ) + ) + (none) + ) + +;; definition for method 15 of type ai-task-control +(defmethod init-task! ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) + "Initialize a task of the given type in the [[ai-task-control]]'s pool." + (let ((s5-0 (assign-ids! (-> obj pool) arg0))) + (if s5-0 + (reset-task! s5-0) + ) + s5-0 + ) + ) + +;; definition for method 17 of type ai-task-control +;; WARN: Return type mismatch ai-task vs none. +(defmethod set-next-task! ai-task-control ((obj ai-task-control) (arg0 ai-task)) + "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." + (let* ((v1-0 (-> obj anchor)) + (a0-1 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) a0-1) + ) + (none) + ) + +;; definition for method 16 of type ai-task-control +(defmethod set-next-task-for-pool! ai-task-control ((obj ai-task-control) (arg0 ai-task)) + (set-next-task! (-> obj pool) arg0) + (none) + ) + +;; definition for method 11 of type ai-task-control +(defmethod get-task-by-type ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (init-task! obj arg0 arg1))) + (if s5-0 + (set-next-task! obj s5-0) + ) + s5-0 + ) + ) + +;; definition for method 13 of type ai-task-control +(defmethod ai-task-control-method-13 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((gp-0 (-> arg0 prev)) + (s5-0 (-> arg0 next)) + ) + (if arg1 + (ai-task-method-10 arg0 arg1) + ) + (set-next-task! (-> obj pool) arg0) + (if gp-0 + (set! (-> gp-0 next) s5-0) + ) + (if s5-0 + (set! (-> s5-0 prev) gp-0) + ) + s5-0 + ) + ) + +;; definition for method 10 of type ai-task-control +(defmethod ai-task-control-method-10 ai-task-control ((obj ai-task-control) (arg0 bot)) + (let ((a0-1 (-> obj anchor next))) + (if a0-1 + (ai-task-method-11 a0-1 arg0) + ) + ) + (none) + ) + +;; definition for method 14 of type ai-task-control +(defmethod ai-task-control-method-14 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((a0-1 (ai-task-control-method-13 obj arg0 arg1))) + (if a0-1 + (ai-task-method-11 a0-1 arg1) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc new file mode 100644 index 0000000000..8d67a7bd2e --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc @@ -0,0 +1,916 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bot-focus-info +(deftype bot-focus-info (structure) + ((max-los-dist float :offset-assert 0) + (fproc process-focusable :offset-assert 4) + (bullseye-xz-dist float :offset-assert 8) + (ry-diff float :offset-assert 12) + (my-facing-ry float :offset-assert 16) + (bullseye-ry float :offset-assert 20) + (los int8 :offset-assert 24) + (update-time time-frame :offset-assert 32) + (bullseye vector :inline :offset-assert 48) + (pos vector :inline :offset-assert 64) + (my-facing-xz-dir vector :inline :offset-assert 80) + (bullseye-xz-dir vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type bot-focus-info +(defmethod inspect bot-focus-info ((obj bot-focus-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bot-focus-info) + (format #t "~1Tmax-los-dist: ~f~%" (-> obj max-los-dist)) + (format #t "~1Tfproc: ~A~%" (-> obj fproc)) + (format #t "~1Tbullseye-xz-dist: ~f~%" (-> obj bullseye-xz-dist)) + (format #t "~1Try-diff: ~f~%" (-> obj ry-diff)) + (format #t "~1Tmy-facing-ry: ~f~%" (-> obj my-facing-ry)) + (format #t "~1Tbullseye-ry: ~f~%" (-> obj bullseye-ry)) + (format #t "~1Tlos: ~D~%" (-> obj los)) + (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) + (format #t "~1Tbullseye: #~%" (-> obj bullseye)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tmy-facing-xz-dir: #~%" (-> obj my-facing-xz-dir)) + (format #t "~1Tbullseye-xz-dir: #~%" (-> obj bullseye-xz-dir)) + (label cfg-4) + obj + ) + +;; definition of type bot-turn-info +(deftype bot-turn-info (structure) + ((facing-ry float :offset-assert 0) + (targ-ry float :offset-assert 4) + (ry-diff float :offset-assert 8) + (predicted-ry-diff float :offset-assert 12) + (predicted-targ-ry float :offset-assert 16) + (facing-dir vector :inline :offset-assert 32) + (targ-pos vector :inline :offset-assert 48) + (predicted-targ-pos vector :inline :offset-assert 64) + (src-quat quaternion :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition for method 3 of type bot-turn-info +(defmethod inspect bot-turn-info ((obj bot-turn-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bot-turn-info) + (format #t "~1Tfacing-ry: ~f~%" (-> obj facing-ry)) + (format #t "~1Ttarg-ry: ~f~%" (-> obj targ-ry)) + (format #t "~1Try-diff: ~f~%" (-> obj ry-diff)) + (format #t "~1Tpredicted-ry-diff: ~f~%" (-> obj predicted-ry-diff)) + (format #t "~1Tpredicted-targ-ry: ~f~%" (-> obj predicted-targ-ry)) + (format #t "~1Tfacing-dir: #~%" (-> obj facing-dir)) + (format #t "~1Ttarg-pos: #~%" (-> obj targ-pos)) + (format #t "~1Tpredicted-targ-pos: #~%" (-> obj predicted-targ-pos)) + (format #t "~1Tsrc-quat: #~%" (-> obj src-quat)) + (label cfg-4) + obj + ) + +;; definition of type bot-speech-tuning +(deftype bot-speech-tuning (structure) + ((fo-min int32 :offset-assert 0) + (fo-max int32 :offset-assert 4) + (fo-curve int8 :offset-assert 8) + (trans? symbol :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type bot-speech-tuning +(defmethod inspect bot-speech-tuning ((obj bot-speech-tuning)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bot-speech-tuning) + (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) + (format #t "~1Ttrans?: ~A~%" (-> obj trans?)) + (label cfg-4) + obj + ) + +;; definition of type bot-speech-info +(deftype bot-speech-info (structure) + ((flags speech-flags :offset-assert 0) + (hold-time uint16 :offset-assert 2) + (slave-id int8 :offset-assert 4) + (tuning-id int8 :offset-assert 5) + (name string :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type bot-speech-info +(defmethod inspect bot-speech-info ((obj bot-speech-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bot-speech-info) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Thold-time: ~D~%" (-> obj hold-time)) + (format #t "~1Tslave-id: ~D~%" (-> obj slave-id)) + (format #t "~1Ttuning-id: ~D~%" (-> obj tuning-id)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (label cfg-4) + obj + ) + +;; definition of type bot-spot +(deftype bot-spot (structure) + ((center vector :inline :offset-assert 0) + (center-x float :offset 0) + (center-y float :offset 4) + (center-z float :offset 8) + (inside-xz-dist float :offset 12) + (blocked-xz-dist float :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type bot-spot +(defmethod inspect bot-spot ((obj bot-spot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bot-spot) + (format #t "~1Tcenter: #~%" (-> obj center)) + (format #t "~1Tcenter-x: ~f~%" (-> obj center x)) + (format #t "~1Tcenter-y: ~f~%" (-> obj center y)) + (format #t "~1Tcenter-z: ~f~%" (-> obj center z)) + (format #t "~1Tinside-xz-dist: ~f~%" (-> obj center w)) + (format #t "~1Tblocked-xz-dist: ~f~%" (-> obj blocked-xz-dist)) + (label cfg-4) + obj + ) + +;; definition of type bot-waypoint +(deftype bot-waypoint (basic) + ((waypoint-id int16 :offset-assert 4) + (nav-mesh-index int8 :offset-assert 6) + (skip-to int8 :offset-assert 7) + (on-set (function bot none) :offset-assert 8) + (on-update (function bot none) :offset-assert 12) + (on-skipping-here (function bot none) :offset-assert 16) + (check-too-far symbol :offset-assert 20) + (warn-dist float :offset-assert 24) + (fail-dist-delta float :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type bot-waypoint +(defmethod inspect bot-waypoint ((obj bot-waypoint)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twaypoint-id: ~D~%" (-> obj waypoint-id)) + (format #t "~1Tnav-mesh-index: ~D~%" (-> obj nav-mesh-index)) + (format #t "~1Tskip-to: ~D~%" (-> obj skip-to)) + (format #t "~1Ton-set: ~A~%" (-> obj on-set)) + (format #t "~1Ton-update: ~A~%" (-> obj on-update)) + (format #t "~1Ton-skipping-here: ~A~%" (-> obj on-skipping-here)) + (format #t "~1Tcheck-too-far: ~A~%" (-> obj check-too-far)) + (format #t "~1Twarn-dist: ~f~%" (-> obj warn-dist)) + (format #t "~1Tfail-dist-delta: ~f~%" (-> obj fail-dist-delta)) + (label cfg-4) + obj + ) + +;; definition of type bot-course +(deftype bot-course (basic) + ((course-id uint8 :offset-assert 4) + (speech-count uint16 :offset-assert 6) + (spot-count uint16 :offset-assert 8) + (retry-cookie uint8 :offset-assert 10) + (too-far-warn-speeches bot-speech-list-shuffle :offset-assert 12) + (too-far-fail-speeches bot-speech-list-shuffle :offset-assert 16) + (attack-player-speeches bot-speech-list :offset-assert 20) + (default-check-too-far symbol :offset-assert 24) + (waypoints (array bot-waypoint) :offset-assert 28) + (speeches (inline-array bot-speech-info) :offset-assert 32) + (speech-tunings (inline-array bot-speech-tuning) :offset-assert 36) + (dirs (inline-array vector) :offset-assert 40) + (spots (inline-array bot-spot) :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type bot-course +(defmethod inspect bot-course ((obj bot-course)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) + (format #t "~1Tspots: #x~X~%" (-> obj spots)) + (label cfg-4) + obj + ) + +;; definition of type bot +(deftype bot (nav-enemy) + ((bot-flags bot-flags :offset-assert 604) + (min-speed float :offset-assert 608) + (max-speed float :offset-assert 612) + (follow-offset float :offset-assert 616) + (too-far-warn-dist float :offset-assert 620) + (too-far-fail-dist-delta float :offset-assert 624) + (too-far-warn-dist-default float :offset-assert 628) + (too-far-fail-dist-delta-default float :offset-assert 632) + (travel-prev-ry float :offset-assert 636) + (travel-prev-ry1 float :offset-assert 640) + (player-blocking float :offset-assert 644) + (ai-ctrl ai-task-control :offset-assert 648) + (course bot-course :offset-assert 652) + (waypoint bot-waypoint :offset-assert 656) + (waypoint-bits uint32 :offset-assert 660) + (waypoint-int32a int32 :offset-assert 664) + (bot-task-bits uint32 :offset-assert 668) + (hit-invuln-ignore-me-delay uint32 :offset-assert 672) + (hit-invuln-focus-disable-delay uint32 :offset-assert 676) + (warn-to-fail-timeout uint32 :offset-assert 680) + (warn-min-delay uint32 :offset-assert 684) + (warn-max-delay uint32 :offset-assert 688) + (spot-color uint32 :offset-assert 692) + (waypoint-request int16 :offset-assert 696) + (hit-by-enemy-count uint16 :offset-assert 698) + (hit-by-player-count uint16 :offset-assert 700) + (notice-enemy-dist float :offset-assert 704) + (channel uint8 :offset-assert 708) + (focus-mode int8 :offset-assert 709) + (nav-mesh-index int8 :offset-assert 710) + (delay-too-far-check int8 :offset-assert 711) + (slave-id int8 :offset-assert 712) + (vehicle-seat-index int8 :offset-assert 713) + (bot-health-index int8 :offset-assert 714) + (task game-task-control :offset-assert 716) + (swivel-joint-mod joint-mod :offset-assert 720) + (health-handle handle :offset-assert 728) + (poi-handle handle :offset-assert 736) + (my-simple-focus (pointer simple-focus) :offset-assert 744) + (attacker-handle handle :offset-assert 752) + (scene-player-handle handle :offset-assert 760) + (master-handle handle :offset-assert 768) + (vehicle-handle handle :offset-assert 776) + (hit-invuln-starting-time time-frame :offset-assert 784) + (danger-time time-frame :offset-assert 792) + (attacker-time time-frame :offset-assert 800) + (started-warning-time time-frame :offset-assert 808) + (waypoint-time0 time-frame :offset-assert 816) + (next-too-far-warn-time time-frame :offset-assert 824) + (spot bot-spot :inline :offset-assert 832) + (follow-dir vector :inline :offset-assert 864) + (focus-info bot-focus-info :inline :offset-assert 880) + ) + :heap-base #x360 + :method-count-assert 225 + :size-assert #x3e0 + :flag-assert #xe1036003e0 + (:methods + (failed () _type_ :state 178) + (hidden () _type_ :state 179) + (clear-poi-and-focus! (_type_) none 180) + (bot-method-181 (_type_ vector vector vector vector vector float) none 181) + (turn-to-target (_type_ bot-turn-info process-focusable float) none 182) + (alive? (_type_) symbol 183) + (bot-debug-draw-spot-id (_type_) none 184) + (bot-debug-draw-sphere (_type_ vector rgba) none 185) + (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none 186) + (reset-attacker! (_type_) none 187) + (scene-release? (_type_) symbol 188) + (select-focus! (_type_) process 189) + (bot-method-190 (_type_) symbol 190) + (bot-method-191 (_type_) none 191) + (bot-method-192 (_type_) none 192) + (bot-method-193 (_type_) symbol 193) + (outside-spot-radius? (_type_ bot-spot vector symbol) symbol 194) + (attacked-by-player? (_type_ process-focusable) symbol 195) + (bot-method-196 (_type_) none 196) + (fail-mission! (_type_) none 197) + (set-cam-height! (_type_ vector) meters 198) + (cam-move-to-bot (_type_) none 199) + (fail-falling (_type_) none 200) + (set-next-focus! (_type_ enemy enemy-best-focus) none 201) + (choose-spot (_type_ int (pointer uint)) int 202) + (play-attacked-speech (_type_) none 203) + (play-too-far-warn-speech (_type_) symbol 204) + (scene-play (_type_ string symbol) symbol 205) + (play-speech (_type_ int) none 206) + (play-death-sound (_type_ string) none 207) + (bot-method-208 (_type_) symbol 208) + (channel-active? (_type_ uint) symbol 209) + (init! (_type_) none 210) + (clear-speech-flags! (_type_) none 211) + (reset-warn-time! (_type_) none 212) + (go-to-waypoint! (_type_ int symbol) object 213) + (bot-method-214 (_type_) symbol 214) + (skip-waypoint (_type_) none 215) + (bot-method-216 (_type_) none 216) + (speech-ended? (_type_ int) symbol 217) + (speech-playing? (_type_ int) symbol 218) + (player-blocking-spot? (_type_ bot-spot) symbol 219) + (stop-speech (_type_ uint symbol) none 220) + (bot-method-221 (_type_) quaternion 221) + (bot-method-222 (_type_ vector) none 222) + (bot-method-223 (_type_ symbol) none 223) + (bot-check-too-far (_type_) symbol 224) + ) + ) + +;; definition for method 3 of type bot +(defmethod inspect bot ((obj bot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 obj) + ) + (format #t "~2Tbot-flags: ~D~%" (-> obj bot-flags)) + (format #t "~2Tmin-speed: ~f~%" (-> obj min-speed)) + (format #t "~2Tmax-speed: ~f~%" (-> obj max-speed)) + (format #t "~2Tfollow-offset: ~f~%" (-> obj follow-offset)) + (format #t "~2Ttoo-far-warn-dist: ~f~%" (-> obj too-far-warn-dist)) + (format #t "~2Ttoo-far-fail-dist-delta: ~f~%" (-> obj too-far-fail-dist-delta)) + (format #t "~2Ttoo-far-warn-dist-default: ~f~%" (-> obj too-far-warn-dist-default)) + (format #t "~2Ttoo-far-fail-dist-delta-default: ~f~%" (-> obj too-far-fail-dist-delta-default)) + (format #t "~2Ttravel-prev-ry: ~f~%" (-> obj travel-prev-ry)) + (format #t "~2Ttravel-prev-ry1: ~f~%" (-> obj travel-prev-ry1)) + (format #t "~2Tplayer-blocking: ~f~%" (-> obj player-blocking)) + (format #t "~2Tai-ctrl: ~A~%" (-> obj ai-ctrl)) + (format #t "~2Tcourse: ~A~%" (-> obj course)) + (format #t "~2Twaypoint: ~A~%" (-> obj waypoint)) + (format #t "~2Twaypoint-bits: ~D~%" (-> obj waypoint-bits)) + (format #t "~2Twaypoint-int32a: ~D~%" (-> obj waypoint-int32a)) + (format #t "~2Tbot-task-bits: ~D~%" (-> obj bot-task-bits)) + (format #t "~2Thit-invuln-ignore-me-delay: ~D~%" (-> obj hit-invuln-ignore-me-delay)) + (format #t "~2Thit-invuln-focus-disable-delay: ~D~%" (-> obj hit-invuln-focus-disable-delay)) + (format #t "~2Twarn-to-fail-timeout: ~D~%" (-> obj warn-to-fail-timeout)) + (format #t "~2Twarn-min-delay: ~D~%" (-> obj warn-min-delay)) + (format #t "~2Twarn-max-delay: ~D~%" (-> obj warn-max-delay)) + (format #t "~2Tspot-color: ~D~%" (-> obj spot-color)) + (format #t "~2Twaypoint-request: ~D~%" (-> obj waypoint-request)) + (format #t "~2Thit-by-enemy-count: ~D~%" (-> obj hit-by-enemy-count)) + (format #t "~2Thit-by-player-count: ~D~%" (-> obj hit-by-player-count)) + (format #t "~2Tnotice-enemy-dist: ~f~%" (-> obj notice-enemy-dist)) + (format #t "~2Tchannel: ~D~%" (-> obj channel)) + (format #t "~2Tfocus-mode: ~D~%" (-> obj focus-mode)) + (format #t "~2Tnav-mesh-index: ~D~%" (-> obj nav-mesh-index)) + (format #t "~2Tdelay-too-far-check: ~D~%" (-> obj delay-too-far-check)) + (format #t "~2Tslave-id: ~D~%" (-> obj slave-id)) + (format #t "~2Tvehicle-seat-index: ~D~%" (-> obj vehicle-seat-index)) + (format #t "~2Tbot-health-index: ~D~%" (-> obj bot-health-index)) + (format #t "~2Ttask: ~A~%" (-> obj task)) + (format #t "~2Tswivel-joint-mod: ~A~%" (-> obj swivel-joint-mod)) + (format #t "~2Thealth-handle: ~D~%" (-> obj health-handle)) + (format #t "~2Tpoi-handle: ~D~%" (-> obj poi-handle)) + (format #t "~2Tmy-simple-focus: #x~X~%" (-> obj my-simple-focus)) + (format #t "~2Tattacker-handle: ~D~%" (-> obj attacker-handle)) + (format #t "~2Tscene-player-handle: ~D~%" (-> obj scene-player-handle)) + (format #t "~2Tmaster-handle: ~D~%" (-> obj master-handle)) + (format #t "~2Tvehicle-handle: ~D~%" (-> obj vehicle-handle)) + (format #t "~2Thit-invuln-starting-time: ~D~%" (-> obj hit-invuln-starting-time)) + (format #t "~2Tdanger-time: ~D~%" (-> obj danger-time)) + (format #t "~2Tattacker-time: ~D~%" (-> obj attacker-time)) + (format #t "~2Tstarted-warning-time: ~D~%" (-> obj started-warning-time)) + (format #t "~2Twaypoint-time0: ~D~%" (-> obj waypoint-time0)) + (format #t "~2Tnext-too-far-warn-time: ~D~%" (-> obj next-too-far-warn-time)) + (format #t "~2Tspot: #~%" (-> obj spot)) + (format #t "~2Tfollow-dir: #~%" (-> obj follow-dir)) + (format #t "~2Tfocus-info: #~%" (-> obj focus-info)) + (label cfg-4) + obj + ) + +;; definition for symbol *bot-task-pool*, type ai-task-pool +(define *bot-task-pool* (new 'static 'ai-task-pool + :anchor #f + :tasks (new 'static 'array uint32 240 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + ) + :tasks-length #x14 + ) + ) + +;; failed to figure out what this is: +(ai-task-pool-method-11 *bot-task-pool*) + +;; definition of type bot-speech-list +(deftype bot-speech-list (basic) + ((flags uint8 :offset-assert 4) + (retry-cookie uint8 :offset-assert 5) + (last-local-index int16 :offset-assert 6) + (speech-indexes (array int16) :offset-assert 8) + ) + :method-count-assert 11 + :size-assert #xc + :flag-assert #xb0000000c + (:methods + (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int 9) + (reset-index (_type_ symbol) none 10) + ) + ) + +;; definition for method 3 of type bot-speech-list +(defmethod inspect bot-speech-list ((obj bot-speech-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) + (format #t "~1Tlast-local-index: ~D~%" (-> obj last-local-index)) + (format #t "~1Tspeech-indexes: ~A~%" (-> obj speech-indexes)) + (label cfg-4) + obj + ) + +;; definition for method 10 of type bot-speech-list +;; WARN: Return type mismatch int vs none. +(defmethod reset-index bot-speech-list ((obj bot-speech-list) (arg0 symbol)) + (if arg0 + (set! (-> obj flags) (logand -2 (-> obj flags))) + ) + (set! (-> obj last-local-index) -1) + (none) + ) + +;; definition for method 9 of type bot-speech-list +;; WARN: new jak 2 until loop case, check carefully +(defmethod bot-speech-list-method-9 bot-speech-list ((sp-list bot-speech-list) (bot bot) (sp-info (inline-array bot-speech-info)) (arg3 speech-flags)) + (let ((v1-1 (-> bot course retry-cookie))) + (when (!= v1-1 (-> sp-list retry-cookie)) + (set! (-> sp-list retry-cookie) (-> bot course retry-cookie)) + (reset-index sp-list #t) + ) + ) + (let ((sp-indexes (-> sp-list speech-indexes)) + (last-idx (-> sp-list last-local-index)) + ) + (when (< last-idx 0) + (when (not (logtest? (-> sp-list flags) 1)) + (logior! (-> sp-list flags) 1) + (set! arg3 (logior arg3 (speech-flags sf02))) + ) + (reset-index sp-list #f) + (if (logtest? (-> sp-list flags) 4) + (set! last-idx (+ (get-rand-int bot (-> sp-indexes length)) -1)) + (set! last-idx -1) + ) + ) + (until #f + (when (>= last-idx (+ (-> sp-indexes length) -1)) + (if (not (logtest? (-> sp-list flags) 2)) + (goto cfg-23) + ) + (reset-index sp-list #f) + (set! last-idx -1) + ) + (+! last-idx 1) + (let* ((idx (-> sp-indexes last-idx)) + (flags (-> sp-info idx flags)) + ) + (when (and (not (logtest? arg3 flags)) + (or (not (logtest? flags (speech-flags sf11))) (not (speech-playing? bot idx))) + ) + (set! (-> sp-list last-local-index) last-idx) + (return idx) + ) + ) + ) + ) + #f + (label cfg-23) + -1 + ) + +;; definition of type bot-speech-list-shuffle +(deftype bot-speech-list-shuffle (bot-speech-list) + ((history-mask uint64 :offset-assert 16) + (history-mask-full uint64 :offset-assert 24) + ) + :method-count-assert 11 + :size-assert #x20 + :flag-assert #xb00000020 + ) + +;; definition for method 3 of type bot-speech-list-shuffle +(defmethod inspect bot-speech-list-shuffle ((obj bot-speech-list-shuffle)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) + (format #t "~1Tlast-local-index: ~D~%" (-> obj last-local-index)) + (format #t "~1Tspeech-indexes: ~A~%" (-> obj speech-indexes)) + (format #t "~1Thistory-mask: ~D~%" (-> obj history-mask)) + (format #t "~1Thistory-mask-full: ~D~%" (-> obj history-mask-full)) + (label cfg-4) + obj + ) + +;; definition for method 10 of type bot-speech-list-shuffle +;; WARN: Return type mismatch int vs none. +(defmethod reset-index bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (arg0 symbol)) + (let ((t9-0 (method-of-type bot-speech-list reset-index))) + (t9-0 obj arg0) + ) + (set! (-> obj history-mask) (the-as uint 0)) + (when (zero? (-> obj history-mask-full)) + (let ((v0-2 0)) + (let ((v1-2 1)) + (countdown (a0-3 (-> obj speech-indexes length)) + (set! v0-2 (logior v0-2 v1-2)) + (set! v1-2 (* v1-2 2)) + ) + ) + (set! (-> obj history-mask-full) (the-as uint v0-2)) + ) + ) + (none) + ) + +;; definition for method 9 of type bot-speech-list-shuffle +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: new jak 2 until loop case, check carefully +(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) + (local-vars (sv-16 int)) + (let ((course-cookie (-> bot course retry-cookie))) + (when (!= course-cookie (-> obj retry-cookie)) + (set! (-> obj retry-cookie) (-> bot course retry-cookie)) + (reset-index obj #t) + ) + ) + (set! sv-16 (-> obj last-local-index)) + (when (< sv-16 0) + (when (not (logtest? (-> obj flags) 1)) + (logior! (-> obj flags) 1) + (set! sp-flags (logior sp-flags (speech-flags sf02))) + ) + (reset-index obj #f) + ) + (let ((history-mask 0)) + (if (>= sv-16 0) + (set! history-mask (ash 1 sv-16)) + ) + (if (logtest? (-> obj flags) 8) + (set! history-mask (logior history-mask (-> obj history-mask))) + ) + (until #f + (when (and (= history-mask (-> obj history-mask-full)) (logtest? (-> obj flags) 8)) + (if (not (logtest? (-> obj flags) 2)) + (return -1) + ) + (reset-index obj #f) + (if (>= sv-16 0) + (set! history-mask (ash 1 sv-16)) + (set! history-mask 0) + ) + ) + (let* ((last-idx (enemy-method-120 bot (-> obj speech-indexes length) history-mask)) + (speech-idx (-> obj speech-indexes last-idx)) + (v1-47 (-> sp-info speech-idx flags)) + ) + (set! history-mask (logior history-mask (ash 1 last-idx))) + (when (and (not (logtest? sp-flags v1-47)) + (or (not (logtest? v1-47 (speech-flags sf11))) (not (speech-playing? bot speech-idx))) + ) + (set! (-> obj last-local-index) last-idx) + (logior! (-> obj history-mask) (ash 1 last-idx)) + (return speech-idx) + ) + ) + ) + ) + #f + -1 + ) + +;; definition of type bot-course-table +(deftype bot-course-table (basic) + ((course bot-course 18 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +;; definition for method 3 of type bot-course-table +(defmethod inspect bot-course-table ((obj bot-course-table)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcourse[18] @ #x~X~%" (-> obj course)) + (label cfg-4) + obj + ) + +;; definition for symbol *bot-course-table*, type bot-course-table +(define *bot-course-table* (new 'static 'bot-course-table)) + + + + diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc new file mode 100644 index 0000000000..1c5cef6c22 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc @@ -0,0 +1,295 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate hit (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (stop-speech self (the-as uint 0) #t) + (bot-method-191 self) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) exit))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-45 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (get-rand-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override hit-anim)) + :num! (seek! + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override hit-anim))) + frames + num-frames + ) + -1 + ) + ) + f30-0 + ) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-36 (-> self enemy-flags))) + (if (logtest? v1-36 (enemy-flag checking-water)) + (set! v1-37 (logior v1-36 (enemy-flag enable-on-active))) + (set! v1-37 (logclear v1-36 (enemy-flag enable-on-active))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> self mask) (logior (process-mask collectable) (-> self mask))) + (logclear! (-> self mask) (process-mask collectable)) + ) + (let ((v1-44 (-> self enemy-flags))) + (if (logtest? (enemy-flag no-initial-move-to-ground) v1-44) + (set! v1-45 (logior (enemy-flag check-water-backup) v1-44)) + (set! v1-45 (logclear v1-44 (enemy-flag check-water-backup))) + ) + ) + (set! (-> self enemy-flags) v1-45) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> self focus-status) (focus-status hit)) + (enemy-method-72 self) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (bot) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) + (stop-speech self (the-as uint 0) #t) + (if (and (logtest? (-> self bot-flags) (bot-flags attacked)) + (nonzero? (-> self hit-points)) + (zero? (-> self fated-time)) + ) + (logior! (-> self bot-flags) (bot-flags bf12)) + ) + (bot-method-191 self) + (when (zero? (-> self hit-points)) + (set! (-> self hit-points) 1) + (set! (-> self fated-time) (the-as uint (-> self clock frame-counter))) + ) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-2 + (t9-2) + ) + ) + (none) + ) + :exit (behavior () + (let ((gp-0 (-> self incoming attack-id))) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self incoming attack-id) gp-0) + ) + (logior! (-> self bot-flags) (bot-flags bf11)) + (logclear! (-> self bot-flags) (bot-flags bf12)) + (none) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (-> self bot-flags) (bot-flags bf12)) (!= (-> self state-time) (-> self clock frame-counter))) + (logclear! (-> self bot-flags) (bot-flags bf12)) + (play-attacked-speech self) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate die-falling (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (kill-nearby-enemies (-> self root-override2 trans) 61440.0) + (stop-speech self (the-as uint 0) #f) + (logclear! (-> self bot-flags) (bot-flags bf06 bf11)) + (set! (-> self delay-too-far-check) -1) + (logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere)) + (fail-mission! self) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (logclear! (-> self bot-flags) (bot-flags bf13 bf14)) + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) exit))) + (if t9-0 + (t9-0) + ) + ) + (none) + ) + :trans (behavior () + (fail-falling self) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (enemy-method-133 self) + (-> self enemy-info-override die-falling-anim) + (-> self enemy-info-override die-anim) + ) + ) + ) + (f30-0 (get-rand-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (until (not (channel-active? self (the-as uint 0))) + (suspend) + ) + (until #f + (if (and (logtest? (-> self bot-flags) (bot-flags failed)) (reset? *fail-mission-control*)) + (reset! *fail-mission-control*) + ) + (suspend) + ) + #f + (none) + ) + ) + +;; failed to figure out what this is: +(defstate failed (bot) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior bot) enemy-event-handler) + :enter (behavior () + ((-> (method-of-type bot die-falling) enter)) + (logclear! (-> self bot-flags) (bot-flags bf11)) + (when (logtest? (-> self bot-flags) (bot-flags failed)) + (let ((a0-1 (-> self course too-far-fail-speeches))) + (when (and (nonzero? a0-1) a0-1) + (let ((a1-1 (bot-speech-list-method-9 a0-1 self (-> self course speeches) (speech-flags)))) + (if (>= a1-1 0) + (play-speech self a1-1) + ) + ) + ) + ) + ) + (none) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flags bf11)) + (none) + ) + :trans (behavior () + ((-> (method-of-type bot die-falling) trans)) + (if (channel-active? self (the-as uint 0)) + (set! (-> self state-time) (-> self clock frame-counter)) + ) + (none) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (get-rand-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info-override idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 + :num! (seek! (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)) f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (when (and (logtest? (-> self bot-flags) (bot-flags failed)) + (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) + (reset? *fail-mission-control*) + ) + (cleanup-for-death self) + (process-entity-status! self (entity-perm-status no-kill) #f) + (reset! *fail-mission-control*) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior bot) nav-enemy-die-falling-post) + ) + +;; failed to figure out what this is: +(defstate hidden (bot) + :virtual #t + :event (the-as (function process int symbol event-message-block object :behavior bot) enemy-event-handler) + :enter (behavior () + (logior! (-> self focus-status) (focus-status disable)) + (let ((v1-3 (-> self root-override2 root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self notice-enemy-dist) 0.0) + (logclear! (-> self enemy-flags) (enemy-flag trackable-backup)) + (none) + ) + :exit (behavior () + (local-vars (v0-0 enemy-flag)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self focus-status) (focus-status disable)) + (let ((v1-5 (-> self root-override2 root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root-override2 backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root-override2 backup-collide-with)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? (enemy-flag enable-on-hostile) v1-6) + (set! v0-0 (logior (enemy-flag trackable-backup) v1-6)) + (set! v0-0 (logclear v1-6 (enemy-flag trackable-backup))) + ) + ) + (set! (-> self enemy-flags) v0-0) + (none) + ) + :code (the-as (function none :behavior bot) sleep-code) + :post (the-as (function none :behavior bot) nav-enemy-simple-post) + ) + + + + diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc new file mode 100644 index 0000000000..bd73cf23c4 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc @@ -0,0 +1,2094 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 12 of type bot +(defmethod run-logic? bot ((obj bot)) + #t + ) + +;; definition for method 185 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-debug-draw-sphere bot ((obj bot) (arg0 vector) (arg1 rgba)) + (add-debug-sphere #t (bucket-id debug2) (the-as vector (&-> arg0 x)) (-> arg0 w) arg1) + (none) + ) + +;; definition for method 186 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-debug-draw-spot-sphere bot ((obj bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) + (let* ((s2-0 (-> obj spot-color)) + (s1-0 s2-0) + ) + (if (>= arg2 0) + (set! s1-0 (logior (the-as uint (logand #xffffff s2-0)) + (the-as uint (shl (the int (* 0.375 (the float (logand (shr s2-0 24) 255)))) 24)) + ) + ) + ) + (dotimes (s0-0 arg0) + (let* ((v1-5 (-> (the-as (pointer uint8) (&+ arg1 s0-0)))) + (a1-2 (-> obj course spots v1-5)) + ) + (bot-debug-draw-sphere obj (the-as vector a1-2) (if (= v1-5 arg2) + (the-as rgba s2-0) + (the-as rgba s1-0) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 184 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-debug-draw-spot-id bot ((obj bot)) + (let ((course (-> obj course))) + (countdown (i (-> course spot-count)) + (let ((spot (-> course spots i))) + (bot-debug-draw-sphere obj (the-as vector spot) (the-as rgba (-> obj spot-color))) + (format (clear *temp-string*) "~d" i) + (let ((spot-id *temp-string*)) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + spot-id + (-> spot center) + (font-color #dadada) + (the-as vector2h #f) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 194 of type bot +(defmethod outside-spot-radius? bot ((obj bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) + "Are we outside of the given [[bot-spot]] radius?" + (if (not spot) + (set! spot (-> obj spot)) + ) + (if (not bot-trans) + (set! bot-trans (-> obj root-override2 trans)) + ) + (let ((f0-0 (vector-vector-xz-distance (-> spot center) bot-trans))) + (if arg3 + (set! f0-0 (+ 819.2 f0-0)) + ) + (>= (-> spot center w) f0-0) + ) + ) + +;; definition for method 219 of type bot +(defmethod player-blocking-spot? bot ((obj bot) (spot bot-spot)) + (let ((f0-0 (-> spot blocked-xz-dist))) + (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> spot center)))) + ) + ) + +;; definition for method 202 of type bot +(defmethod choose-spot bot ((obj bot) (num-spots int) (spot-indices (pointer uint))) + "Choose the closest [[bot-spot]] that is not blocked by the player." + (let ((spot-idx 0)) + (let ((f30-0 -1.0) + (bot-trans (-> obj root-override2 trans)) + ) + (countdown (i num-spots) + (let ((spot (-> obj course spots (-> (the-as (pointer uint8) (&+ spot-indices i)))))) + (when (not (player-blocking-spot? obj spot)) + (let ((spot-dist (vector-vector-xz-distance bot-trans (-> spot center)))) + (when (or (< f30-0 0.0) (< spot-dist f30-0)) + (set! f30-0 spot-dist) + (set! spot-idx i) + ) + ) + ) + ) + ) + ) + spot-idx + ) + ) + +;; definition for method 108 of type bot +(defmethod enemy-method-108 bot ((obj bot) (arg0 enemy) (arg1 event-message-block)) + 0 + ) + +;; definition for method 187 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod reset-attacker! bot ((obj bot)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (v1-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (and v1-5 (= (-> v1-5 type) target)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (none) + ) + +;; definition for method 193 of type bot +(defmethod bot-method-193 bot ((obj bot)) + (let ((gp-0 #f)) + (let ((v1-0 (-> obj incoming penetrate-using))) + (cond + ((logtest? #x800000 v1-0) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (-> *target* gun fire-dir-out)) + ) + (vector-! s5-0 (-> obj root-override2 trans) (target-pos 0)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (if (or (< 28672.0 (vector-vector-xz-distance (-> obj root-override2 trans) (target-pos 0))) + (< (vector-dot s3-0 s5-0) (cos 3640.889)) + ) + (set! gp-0 #t) + ) + ) + ) + ) + ((and (logtest? #x10000 v1-0) (zero? (logand #x20000 v1-0))) + (set! gp-0 #t) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 190 of type bot +;; INFO: Used lq/sq +(defmethod bot-method-190 bot ((obj bot)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (cond + ((< 0.0 (-> obj notice-enemy-dist)) + (let ((s5-0 (new 'stack-no-clear 'connection-pers)) + (s4-0 544) + ) + (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> obj root-override2 trans quad)) + (set! (-> s5-0 param 3) (-> obj notice-enemy-dist)) + (set! (-> s5-0 next) #f) + (set! (-> s5-0 key) 409600000.0) + (set! (-> s5-0 update-time) 0) + (set! *actor-list-length* 0) + (if (logtest? s4-0 512) + (set! *actor-list-length* + (fill-actor-list-for-sphere *actor-hash* (the-as sphere (-> s5-0 param)) *actor-list* 256) + ) + ) + (when (logtest? s4-0 1024) + (let ((a0-5 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-1 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-1) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-3 a2-5) + (f1-2 (+ (-> a1-2 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-3 (* f1-2 f1-2)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 256) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-2) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-4 a2-12) + (f1-6 (+ (-> a1-14 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-4 (* f1-6 f1-6)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let ((v1-26 (-> *actor-list* s3-0))) + (when (logtest? (the-as collide-spec s4-0) (-> v1-26 root-prim prim-core collide-as)) + (let* ((s2-0 (-> v1-26 process)) + (a1-26 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when a1-26 + (set-next-focus! obj (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) + (if (-> s5-0 next) + (return #t) + ) + ) + ) + ) + ) + ) + ) + #f + ) + (else + #f + ) + ) + ) + ) + +;; definition for method 106 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-106 bot ((obj bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) + (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) + (t9-0 obj arg0 arg1 arg2 arg3) + ) + (logclear! (-> obj bot-flags) (bot-flags bf03 bf04)) + (let* ((s3-0 (handle->process (-> obj incoming attacker-handle))) + (s5-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s5-0 + (cond + ((= (-> s5-0 type) target) + (logior! (-> obj bot-flags) (bot-flags bf04)) + (cond + ((bot-method-193 obj) + (logior! (-> obj bot-flags) (bot-flags bf03)) + ) + (else + (+! (-> obj hit-by-player-count) 1) + (when (not (bot-method-190 obj)) + (logior! (-> obj bot-flags) (bot-flags attacked)) + (cond + ((attacked-by-player? obj (the-as process-focusable s5-0)) + (set! (-> obj attacker-handle) (process->handle s5-0)) + (set! (-> obj attacker-time) (-> self clock frame-counter)) + ) + (else + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + ) + ) + ) + ) + ((type? s5-0 enemy) + (+! (-> obj hit-by-enemy-count) 1) + (when (attacked-by-player? obj (the-as process-focusable s5-0)) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! (-> obj attacker-handle) (process->handle s5-0)) + (set! (-> obj attacker-time) (-> self clock frame-counter)) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 56 of type bot +(defmethod enemy-method-56 bot ((obj bot) (arg0 process) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type nav-enemy enemy-method-56)) + (v0-0 (t9-0 obj arg0 arg1)) + ) + (let ((v1-1 (-> obj bot-flags))) + (cond + ((logtest? v1-1 (bot-flags bf03 too-far-fail bf09)) + (set! v0-0 0) + ) + ((logtest? v1-1 (bot-flags bf10)) + (set! v0-0 (-> obj hit-points)) + ) + (else + (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + (set! v0-0 0) + ) + ) + ) + ) + v0-0 + ) + ) + +;; definition for method 58 of type bot +(defmethod enemy-method-58 bot ((obj bot) (arg0 process) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) + (v0-0 (t9-0 obj arg0 arg1)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags bf03)) + (set! v0-0 #f) + ) + v0-0 + ) + ) + +;; definition for method 180 of type bot +(defmethod clear-poi-and-focus! bot ((obj bot)) + "Clear our point of interest and focus handles." + (let* ((s4-0 (handle->process (-> obj poi-handle))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-0 + (set! (-> obj poi-handle) (the-as handle #f)) + (let ((s4-1 (handle->process (-> obj focus handle)))) + (if (= (if (type? s4-1 process-focusable) + s4-1 + ) + s5-0 + ) + (clear-focused (-> obj focus)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 195 of type bot +;; WARN: Return type mismatch object vs symbol. +(defmethod attacked-by-player? bot ((obj bot) (fproc process-focusable)) + "Were we attacked by the player?" + (the-as + symbol + (and (and fproc (zero? (logand (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) + (or (logtest? (process-mask enemy) (-> fproc mask)) + (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) + ) + ) + ) + ) + +;; definition for method 57 of type bot +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod enemy-method-57 bot ((obj bot) (arg0 process-focusable) (arg1 enemy-best-focus)) + (the-as enemy-aware 3) + ) + +;; definition for method 61 of type bot +(defmethod enemy-method-61 bot ((obj bot) (arg0 int)) + 3 + ) + +;; definition for method 129 of type bot +(defmethod enemy-method-129 bot ((obj bot)) + (local-vars (s5-1 process)) + (with-pp + (let ((s5-0 (-> obj focus))) + (cond + ((logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags)) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + (else + (enemy-method-97 obj) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + ) + ) + (let ((s4-0 #f)) + (when (or (logtest? (bot-flags bf18) (-> obj bot-flags)) + (and s5-1 (attacked-by-player? obj (the-as process-focusable s5-1))) + ) + (set! (-> obj danger-time) (-> pp clock frame-counter)) + (set! s4-0 #t) + ) + (when (nonzero? (-> obj swivel-joint-mod)) + (if (and s4-0 s5-1 (logtest? (-> obj bot-flags) (bot-flags bf11))) + (bot-method-222 obj (get-trans (the-as process-focusable s5-1) 3)) + (bot-method-221 obj) + ) + ) + ) + (none) + ) + ) + +;; definition for method 97 of type bot +(defmethod enemy-method-97 bot ((obj bot)) + (with-pp + (let* ((s5-0 (handle->process (-> obj attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 1.5)) + ) + (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (reset-attacker! obj) + ) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (>= (- (-> pp clock frame-counter) (-> obj attacker-time)) (seconds 6)) + (set! v1-3 (the-as process #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> obj focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> obj poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (select-focus! obj)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) + (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + (else + (clear-focused (-> obj focus)) + (logclear! (-> obj bot-flags) (bot-flags attacked)) + ) + ) + s5-1 + ) + ) + ) + ) + +;; definition for method 189 of type bot +;; INFO: Used lq/sq +(defmethod select-focus! bot ((obj bot)) + "Find enemies around our `notice-enemy-dist` and choose a target." + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((coll-spec (collide-spec enemy hit-by-others-list)) + (focus (new 'stack-no-clear 'enemy-best-focus)) + ) + (let ((sphere (new 'stack-no-clear 'sphere)) + (enemy-dist (-> obj notice-enemy-dist)) + ) + (set! (-> focus proc) #f) + (set! (-> focus rating) 409600000.0) + (set! (-> focus aware) (enemy-aware enemy-aware-0)) + (when (< 0.0 enemy-dist) + (set! (-> sphere quad) (-> obj root-override2 trans quad)) + (set! (-> sphere r) (-> obj notice-enemy-dist)) + (set! *actor-list-length* 0) + (if (logtest? (the-as int coll-spec) (collide-spec hit-by-others-list)) + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* sphere *actor-list* 256)) + ) + (when (logtest? (the-as int coll-spec) (collide-spec player-list)) + (let ((next-actor (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-14 (-> next-actor next0))) + (while (!= next-actor (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection next-actor) param1)) + (cshape (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as int coll-spec) (-> cshape prim-core collide-as)) + (let ((ccore (-> cshape prim-core))) + (let ((a2-4 ccore) + (a3-1 sphere) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-2 a2-5) + (f1-3 (+ (-> ccore world-sphere w) (-> sphere r))) + ) + (when (< f0-2 (* f1-3 f1-3)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! next-actor v1-14) + *collide-player-list* + (set! v1-14 (-> v1-14 next0)) + ) + ) + ) + ) + (when (logtest? (the-as int coll-spec) (collide-spec hit-by-player-list)) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-22 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as int coll-spec) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 sphere) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-3 a2-12) + (f1-7 (+ (-> a1-14 world-sphere w) (-> sphere r))) + ) + (when (< f0-3 (* f1-7 f1-7)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-22) + *collide-hit-by-player-list* + (set! v1-22 (-> v1-22 next0)) + ) + ) + ) + ) + (dotimes (i *actor-list-length*) + (let ((actor (-> *actor-list* i))) + (when (logtest? (the-as int coll-spec) (-> actor root-prim prim-core collide-as)) + (let* ((proc (-> actor process)) + (enemy (if (type? proc process-focusable) + proc + ) + ) + ) + (if (and enemy + enemy + (zero? (logand (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) + ) + (set-next-focus! obj (the-as enemy enemy) focus) + ) + ) + ) + ) + ) + ) + ) + (-> focus proc) + ) + ) + ) + +;; definition for method 201 of type bot +;; WARN: Return type mismatch enemy vs none. +(defmethod set-next-focus! bot ((obj bot) (enemy enemy) (arg2 enemy-best-focus)) + (let ((enemy-dist (new 'stack-no-clear 'vector))) + (vector-! enemy-dist (-> enemy root-override2 trans) (-> obj root-override2 trans)) + (let ((rating (vector-length enemy-dist))) + (when (and (>= (-> obj notice-enemy-dist) rating) (< rating (-> arg2 rating)) (>= 24576.0 (fabs (-> enemy-dist y)))) + (set! (-> arg2 rating) rating) + (set! (-> arg2 proc) enemy) + ) + ) + ) + (none) + ) + +;; definition for method 183 of type bot +(defmethod alive? bot ((obj bot)) + (and (not (logtest? (-> obj focus-status) (focus-status dead grabbed))) + (nonzero? (-> obj hit-points)) + (zero? (-> obj fated-time)) + ) + ) + +;; definition for method 74 of type bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 87] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 111] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 128] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 141] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 180] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 186] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 192] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 32] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 224] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 232] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 238] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 213] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 302] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 312] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 348] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 252] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 267] +;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 5] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 9] +(defmethod enemy-method-74 bot ((obj bot) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 none)) + (with-pp + (let ((v1-0 arg2)) + (the-as + object + (cond + ((= v1-0 'track) + #f + ) + ((= v1-0 'combo) + #f + ) + ((= v1-0 'query) + (case (-> arg3 param 0) + (('waypoint) + (-> obj waypoint waypoint-id) + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ((= v1-0 'request) + (case (-> arg3 param 0) + (('waypoint) + (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) + #t + ) + (('health-meter) + (cond + ((-> arg3 param 1) + (set! v0-0 (the-as none (logior (-> obj bot-flags) (bot-flags bf06)))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + ) + (else + (set! v0-0 (the-as none (logclear (-> obj bot-flags) (bot-flags bf06)))) + (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + ) + ) + v0-0 + ) + (('too-far-fail) + (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag check-water)) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (go (method-of-object obj failed)) + ) + ) + (('move-to-vehicle) + (let ((a0-19 (-> arg3 param 2))) + (cond + ((>= (the-as int a0-19) 0) + (let ((v1-29 (the-as object (-> arg3 param 1)))) + (cond + ((logtest? (focus-status pilot) (-> obj focus-status)) + (if (= (-> obj vehicle-seat-index) a0-19) + (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) + ) + ) + (else + (set! (-> obj vehicle-seat-index) (the-as int a0-19)) + (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) + (logior! (-> obj bot-flags) (bot-flags bf15)) + #t + ) + ) + ) + ) + (else + (when (not (logtest? (focus-status pilot) (-> obj focus-status))) + (set! (-> obj vehicle-seat-index) -1) + (set! (-> obj vehicle-handle) (the-as handle #f)) + (logclear! (-> obj bot-flags) (bot-flags bf15)) + #t + ) + ) + ) + ) + ) + (('exit-vehicle) + (when (logtest? (focus-status pilot) (-> obj focus-status)) + (let ((v1-43 (-> arg3 param 1)) + (s5-1 (-> arg3 param 2)) + ) + (cond + (v1-43 + (set! (-> obj bot-flags) (logior (bot-flags bf16) (-> obj bot-flags))) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) + (set! (-> obj nav-mesh-index) (the-as int s5-1)) + ) + ) + (else + (logclear! (-> obj bot-flags) (bot-flags bf16)) + ) + ) + ) + #t + ) + ) + (('slave-id) + (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) + #t + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ((= v1-0 'notify) + (case (-> arg3 param 0) + (('attack) + (let ((s5-2 (-> arg3 param 1))) + (when (if (type? s5-2 process-focusable) + s5-2 + ) + (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (set! (-> obj hit-focus-time) (the-as uint (-> pp clock frame-counter))) + ) + ) + #t + ) + (('mission-failed) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (logclear! (-> obj bot-flags) (bot-flags bf06)) + #t + ) + (('follow-dir) + (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ((= v1-0 'set-task) + (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> obj bot-task-bits) (ash 1 a1-11)) + ) + #t + ) + ((= v1-0 'clear-task) + (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) + ) + #t + ) + ((= v1-0 'skip) + (skip-waypoint obj) + ) + ((= v1-0 'change-mode) + (when (= (-> arg3 param 0) 'grab) + (set! v0-0 (the-as none (alive? obj))) + (if (and (the-as symbol v0-0) (-> arg3 param 1)) + (logior! (-> obj focus-status) (focus-status grabbed)) + ) + v0-0 + ) + ) + ((= v1-0 'end-mode) + (when (logtest? (-> obj focus-status) (focus-status grabbed)) + (logclear! (-> obj focus-status) (focus-status grabbed)) + #t + ) + ) + ((= v1-0 'hide) + (cond + ((-> arg3 param 0) + (go (method-of-object obj hidden)) + ) + (else + (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) + (enemy-method-72 obj) + ) + ) + ) + ) + ((= v1-0 'draw) + (cond + ((-> arg3 param 0) + (set! v0-0 (the-as none (logclear (-> obj draw status) (draw-control-status no-draw)))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) + ) + (else + (set! v0-0 (the-as none (logior (-> obj draw status) (draw-control-status no-draw)))) + (set! (-> obj draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + (else + ((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + ) + +;; definition for method 104 of type bot +(defmethod enemy-method-104 bot ((obj bot) (arg0 process) (arg1 uint) (arg2 uint)) + (cond + ((and (= (-> arg0 type) target) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'shove) + (set! (-> a1-1 param 0) (the-as uint #f)) + (let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id)))) + (let* ((a0-6 *game-info*) + (a2-2 (+ (-> a0-6 attack-id) 1)) + ) + (set! (-> a0-6 attack-id) a2-2) + (set! (-> v1-6 id) a2-2) + ) + (set! (-> v1-6 shove-back) 8192.0) + (set! (-> v1-6 shove-up) 6144.0) + (set! (-> a1-1 param 1) (the-as uint v1-6)) + ) + (when (send-event-function arg0 a1-1) + (set! (-> obj root-override2 penetrated-by) (the-as penetrate -1)) + (enemy-method-49 obj) + #t + ) + ) + ) + (else + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'attack) + (set! (-> a1-2 param 0) arg1) + (let ((v1-14 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id)))) + (set! (-> v1-14 id) arg2) + (set! (-> v1-14 shove-back) (-> obj enemy-info-override attack-shove-back)) + (set! (-> v1-14 shove-up) (-> obj enemy-info-override attack-shove-up)) + (set! (-> v1-14 mode) (-> obj enemy-info-override attack-mode)) + (set! (-> a1-2 param 1) (the-as uint v1-14)) + ) + (when (send-event-function arg0 a1-2) + (enemy-method-105 obj arg0) + #t + ) + ) + ) + ) + ) + +;; definition for method 76 of type bot +;; WARN: Return type mismatch object vs symbol. +(defmethod enemy-method-76 bot ((obj bot) (arg0 process) (arg1 event-message-block)) + (the-as + symbol + (cond + ((and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (logtest? (-> obj focus-status) (focus-status dangerous)) + (logtest? (process-mask enemy) (-> arg0 mask)) + (and v1-6 + (zero? (logand (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> obj root-override2) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> obj root-override2) + (collide-action persistent-attack) + (collide-action) + ) + (-> obj persistent-attack-id) + (-> obj attack-id) + ) + ) + ) + (enemy-method-104 obj arg0 s3-0 a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function bot-simple-check-too-far +(defun bot-simple-check-too-far ((arg0 bot)) + (let ((s5-0 0)) + (let ((f0-0 (vector-vector-xz-distance (-> *target* control trans) (-> arg0 root-override2 trans))) + (f1-0 (-> arg0 too-far-warn-dist)) + ) + (when (>= f0-0 f1-0) + (if (>= (- f0-0 f1-0) (-> arg0 too-far-fail-dist-delta)) + (set! s5-0 2) + (set! s5-0 1) + ) + ) + ) + s5-0 + ) + ) + +;; definition for method 204 of type bot +(defmethod play-too-far-warn-speech bot ((obj bot)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((idx + (bot-speech-list-method-9 (-> obj course too-far-warn-speeches) obj (-> obj course speeches) (speech-flags)) + ) + ) + (when (>= idx 0) + (play-speech obj idx) + #t + ) + ) + ) + ) + +;; definition for function bot-check-too-far-always-okay +;; WARN: Return type mismatch int vs none. +(defun bot-check-too-far-always-okay () + 0 + (none) + ) + +;; definition for method 224 of type bot +;; WARN: Using new Jak 2 rtype-of +(defmethod bot-check-too-far bot ((obj bot)) + "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. + If the player is too far, play a warning speech." + (with-pp + (let ((result 0)) + (let ((too-far-check (-> obj delay-too-far-check))) + (cond + ((> too-far-check 0) + (set! (-> obj delay-too-far-check) (+ too-far-check -1)) + ) + ((and (zero? too-far-check) *target* (zero? (logand (-> obj focus-status) (focus-status grabbed)))) + (let ((check-too-far-func (the-as object (-> obj waypoint check-too-far)))) + (if (not (the-as symbol check-too-far-func)) + (set! check-too-far-func (-> obj course default-check-too-far)) + ) + (when (the-as symbol check-too-far-func) + (cond + ((logtest? (the-as int check-too-far-func) 1) + (set! result ((the-as (function bot int) (-> (the-as symbol check-too-far-func) value)) obj)) + ) + ((= (rtype-of (the-as symbol check-too-far-func)) function) + (set! result ((the-as (function bot int) check-too-far-func) obj)) + ) + ) + ) + ) + (if (and (= result 1) + (nonzero? (-> obj started-warning-time)) + (>= (- (-> pp clock frame-counter) (-> obj started-warning-time)) + (the-as time-frame (-> obj warn-to-fail-timeout)) + ) + ) + (set! result 2) + ) + (case result + ((1) + (if (zero? (-> obj started-warning-time)) + (set! (-> obj started-warning-time) (-> pp clock frame-counter)) + ) + (if (and (>= (-> pp clock frame-counter) (-> obj next-too-far-warn-time)) (play-too-far-warn-speech obj)) + (set! (-> obj next-too-far-warn-time) + (+ (-> pp clock frame-counter) + (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + ) + ) + ) + ) + ) + ) + ) + ) + (when (zero? result) + (set! (-> obj started-warning-time) 0) + 0 + ) + (= result 2) + ) + ) + ) + +;; definition for method 212 of type bot +;; WARN: Return type mismatch time-frame vs none. +(defmethod reset-warn-time! bot ((obj bot)) + (with-pp + (set! (-> obj started-warning-time) 0) + (set! (-> obj next-too-far-warn-time) + (+ (-> pp clock frame-counter) + (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + ) + ) + (none) + ) + ) + +;; definition for method 55 of type bot +(defmethod enemy-method-55 bot ((obj bot)) + (set! (-> obj travel-prev-ry) (-> obj travel-prev-ry1)) + (set! (-> obj travel-prev-ry1) (quaternion-y-angle (-> obj root-override2 quat))) + (let ((f0-4 (/ (the float (-> obj hit-points)) (the float (-> obj enemy-info-override default-hit-points))))) + (if (nonzero? (-> obj fated-time)) + (set! f0-4 0.0) + ) + (set! (-> *game-info* bot-health (-> obj bot-health-index)) f0-4) + ) + (cond + ((logtest? (-> obj bot-flags) (bot-flags bf06)) + (if (and (not (handle->process (-> obj health-handle))) *target*) + (bot-method-216 obj) + ) + ) + (else + (send-event (handle->process (-> obj health-handle)) 'hide-and-die) + ) + ) + (let ((a0-13 obj)) + (when (not (logtest? (enemy-flag enemy-flag36) (-> a0-13 enemy-flags))) + (let ((a1-4 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-4 options) (overlaps-others-options)) + (set! (-> a1-4 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-4 tlist) *touching-list*) + (find-overlapping-shapes (-> obj root-override2) a1-4) + ) + ) + ) + (let ((t9-4 (method-of-type nav-enemy enemy-method-55))) + (t9-4 obj) + ) + (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) + (let ((t9-5 (-> obj waypoint on-update))) + (if t9-5 + (t9-5 obj) + ) + ) + ) + (if (and (bot-check-too-far obj) (zero? (logand (-> obj bot-flags) (bot-flags bf09)))) + (go (method-of-object obj failed)) + ) + (if (not (logtest? (-> obj bot-flags) (bot-flags bf09))) + (ai-task-control-method-10 (-> obj ai-ctrl) obj) + ) + (if (logtest? (-> obj bot-flags) (bot-flags bf02)) + (bot-method-192 obj) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc08)) + (bot-debug-draw-spot-id obj) + ) + (none) + ) + +;; definition for method 205 of type bot +(defmethod scene-play bot ((obj bot) (scene string) (grab? symbol)) + "Spawn a [[scene-player]] process for the given scene." + (when (and (process-grab? obj #t) (or grab? (process-grab? *target* #t))) + (process-grab? obj #f) + (if (not grab?) + (process-grab? *target* #f) + ) + (set! (-> obj scene-player-handle) + (ppointer->handle (process-spawn scene-player :init scene-player-init scene #t #f)) + ) + #t + ) + ) + +;; definition for method 188 of type bot +(defmethod scene-release? bot ((obj bot)) + (when (not (handle->process (-> obj scene-player-handle))) + (process-release? obj) + #t + ) + ) + +;; definition for method 211 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod clear-speech-flags! bot ((obj bot)) + "Clear the `playing` flag for all of our speeches." + (let ((speeches (-> obj course speeches))) + (countdown (i (-> obj course speech-count)) + (let ((speech (-> speeches i))) + (logclear! (-> speech flags) (speech-flags playing)) + ) + ) + ) + (none) + ) + +;; definition for method 206 of type bot +;; WARN: Return type mismatch gui-connection vs none. +(defmethod play-speech bot ((obj bot) (idx int)) + (let* ((course (-> obj course)) + (speech (-> course speeches idx)) + ) + (logior! (-> speech flags) (speech-flags playing)) + (let* ((hold-time (-> speech hold-time)) + (proc + (add-process + *gui-control* + obj + (the-as gui-channel (-> obj channel)) + (gui-action play) + (-> speech name) + -99.0 + (the-as time-frame hold-time) + ) + ) + (tuning (-> course speech-tunings (-> speech tuning-id))) + ) + (set-falloff! + *gui-control* + proc + (-> tuning trans?) + (-> tuning fo-min) + (-> tuning fo-max) + (-> tuning fo-curve) + ) + ) + ) + (none) + ) + +;; definition for method 207 of type bot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-death-sound bot ((obj bot) (sound string)) + "Play one of our death sounds." + (add-process + *gui-control* + obj + (the-as gui-channel (-> obj channel)) + (gui-action play) + sound + -99.0 + (seconds 0.3) + ) + (none) + ) + +;; definition for method 217 of type bot +(defmethod speech-ended? bot ((obj bot) (idx int)) + "Is the given speech active?" + (let ((speech (-> obj course speeches idx))) + (= (get-status + *gui-control* + (the-as + sound-id + (lookup-gui-connection-id *gui-control* (-> speech name) (gui-channel none) (gui-action none)) + ) + ) + (gui-status unknown) + ) + ) + ) + +;; definition for method 218 of type bot +(defmethod speech-playing? bot ((obj bot) (idx int)) + "Is the given speech playing?" + (let ((v1-2 (-> obj course speeches idx))) + (logtest? (-> v1-2 flags) (speech-flags playing)) + ) + ) + +;; definition for method 209 of type bot +(defmethod channel-active? bot ((obj bot) (channel uint)) + "Is the given [[gui-channel]] active?" + (if (zero? channel) + (set! channel (-> obj channel)) + ) + (nonzero? (get-status + *gui-control* + (the-as + sound-id + (lookup-gui-connection-id *gui-control* (the-as string #f) (the-as gui-channel channel) (gui-action none)) + ) + ) + ) + ) + +;; definition for method 220 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod stop-speech bot ((obj bot) (channel uint) (arg1 symbol)) + (if (zero? channel) + (set! channel (-> obj channel)) + ) + (if arg1 + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (the-as gui-channel channel) + (gui-action none) + (the-as string #f) + (lambda :behavior bot + ((arg0 gui-connection)) + (let* ((v1-0 self) + (s5-0 (-> v1-0 course speeches)) + ) + (countdown (s4-0 (-> v1-0 course speech-count)) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= (-> s3-0 name) (-> arg0 name)) + (return (zero? (logand (-> s3-0 flags) (speech-flags sf01)))) + ) + ) + ) + ) + #t + ) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (the-as gui-channel channel) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (none) + ) + +;; definition for method 213 of type bot +(defmethod go-to-waypoint! bot ((obj bot) (id int) (skipped? symbol)) + "Start moving to the given [[bot-waypoint]]." + (with-pp + (let* ((course (-> obj course)) + (waypoint-count (-> course waypoints length)) + ) + (dotimes (i waypoint-count) + (let ((waypoint (-> course waypoints i))) + (when (= (-> waypoint waypoint-id) id) + (set! (-> obj waypoint) waypoint) + (set! (-> obj waypoint-bits) (the-as uint 0)) + (set! (-> obj waypoint-time0) (-> pp clock frame-counter)) + (set! (-> obj too-far-warn-dist) (-> obj too-far-warn-dist-default)) + (set! (-> obj too-far-fail-dist-delta) (-> obj too-far-fail-dist-delta-default)) + (let ((mesh-idx (-> waypoint nav-mesh-index))) + (when (and (>= mesh-idx 0) (!= (-> obj nav-mesh-index) mesh-idx)) + (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor mesh-idx) obj) + (set! (-> obj nav-mesh-index) mesh-idx) + ) + ) + (when skipped? + (let ((on-skip (-> waypoint on-skipping-here))) + (when on-skip + (process-entity-status! obj (entity-perm-status no-kill) #t) + (on-skip obj) + ) + ) + ) + (let ((on-set (-> waypoint on-set))) + (if on-set + (on-set obj) + ) + ) + (return #f) + ) + ) + ) + ) + (go process-drawable-art-error "bad waypoint id") + ) + ) + +;; definition for method 215 of type bot +;; WARN: Return type mismatch object vs none. +(defmethod skip-waypoint bot ((obj bot)) + (let ((skip-id (-> obj waypoint skip-to))) + (when (>= skip-id 0) + (stop-speech obj (the-as uint 0) #f) + (set! (-> obj delay-too-far-check) 10) + (go-to-waypoint! obj skip-id #t) + ) + ) + (none) + ) + +;; definition for method 7 of type bot +;; WARN: Return type mismatch nav-enemy vs bot. +(defmethod relocate bot ((obj bot) (arg0 int)) + (if (nonzero? (-> obj ai-ctrl)) + (&+! (-> obj ai-ctrl) arg0) + ) + (if (nonzero? (-> obj task)) + (&+! (-> obj task) arg0) + ) + (if (nonzero? (-> obj swivel-joint-mod)) + (&+! (-> obj swivel-joint-mod) arg0) + ) + (the-as bot ((method-of-type nav-enemy relocate) obj arg0)) + ) + +;; definition for method 10 of type bot +(defmethod deactivate bot ((obj bot)) + (send-event (handle->process (-> obj health-handle)) 'hide-and-die) + (if (nonzero? (-> obj ai-ctrl)) + (ai-task-control-method-9 (-> obj ai-ctrl)) + ) + ((method-of-type nav-enemy deactivate) obj) + (none) + ) + +;; definition for method 210 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod init! bot ((obj bot)) + "Set defaults for various fields." + (set! (-> obj master-handle) (the-as handle #f)) + (set! (-> obj health-handle) (the-as handle #f)) + (set! (-> obj scene-player-handle) (the-as handle #f)) + (set! (-> obj poi-handle) (the-as handle #f)) + (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> obj vehicle-handle) (the-as handle #f)) + (set! (-> obj focus-mode) 0) + (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 180)) + (set! (-> obj warn-to-fail-timeout) (the-as uint #x34bc)) + (set! (-> obj warn-min-delay) (the-as uint 2400)) + (set! (-> obj warn-max-delay) (the-as uint 4200)) + (set! (-> obj vehicle-seat-index) -1) + (set! (-> obj nav-mesh-index) -1) + (set! (-> obj too-far-warn-dist-default) 184320.0) + (set! (-> obj too-far-fail-dist-delta-default) 122880.0) + (logior! (-> obj bot-flags) (bot-flags bf11)) + (set! (-> obj delay-too-far-check) 10) + (set! (-> obj focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> obj spot-color) (the-as uint #x500000ff)) + (set-vector! (-> obj follow-dir) 0.0 0.0 1.0 1.0) + 0 + (none) + ) + +;; definition for method 115 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-115 bot ((obj bot)) + "@abstract" + (process-entity-status! obj (entity-perm-status bit-4) #t) + (set! (-> obj ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) + (logclear! (-> obj mask) (process-mask enemy)) + (set! (-> obj mask) (logior (process-mask bot) (-> obj mask))) + (set! (-> obj enemy-flags) (logior (enemy-flag use-notice-distance multi-focus) (-> obj enemy-flags))) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logior! (-> obj focus-status) (focus-status disable)) + (let ((v1-13 (-> obj nav))) + (set! (-> v1-13 sphere-mask) (the-as uint 78)) + ) + 0 + (logclear! (-> obj root-override2 nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-17 (-> obj nav))) + (set! (-> v1-17 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> obj root-override2 dynam) 573440.0) + (let ((a2-3 (res-lump-value (-> obj entity) 'task-actor uint128 :time -1000000000.0))) + (if (nonzero? a2-3) + (set! (-> obj task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) + ) + ) + (let ((s5-0 (res-lump-value (-> obj entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (if (< (the-as int s5-0) 0) + (go process-drawable-art-error "no course") + ) + (let ((s5-1 (-> *bot-course-table* course s5-0))) + (set! (-> obj course) s5-1) + (+! (-> s5-1 retry-cookie) 1) + (mem-copy! (the-as pointer (-> obj spot)) (the-as pointer (-> s5-1 spots 0)) 20) + (let ((v1-36 (-> s5-1 waypoints 0))) + (set! (-> obj nav-mesh-index) (-> v1-36 nav-mesh-index)) + (go-to-waypoint! obj (-> v1-36 waypoint-id) #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 214 of type bot +;; WARN: Return type mismatch object vs symbol. +(defmethod bot-method-214 bot ((obj bot)) + (the-as symbol (when (logtest? (-> obj bot-flags) (bot-flags bf00)) + (let ((fproc (handle->process (-> obj focus handle)))) + (and fproc + (= (-> obj focus aware) (enemy-aware enemy-aware-3)) + (attacked-by-player? obj (the-as process-focusable fproc)) + (zero? (logand (-> obj focus-status) (focus-status grabbed))) + ) + ) + ) + ) + ) + +;; definition for method 223 of type bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-223 bot ((obj bot) (arg0 symbol)) + (with-pp + (let ((focus (-> obj focus-info)) + (timer (-> pp clock frame-counter)) + (focus-proc (handle->process (-> obj focus handle))) + ) + (when (or (!= timer (-> focus update-time)) (!= focus-proc (-> focus fproc))) + (set! (-> focus update-time) timer) + (set! (-> focus fproc) (the-as process-focusable focus-proc)) + (set! (-> focus los) 0) + (when focus-proc + (set! (-> focus pos quad) (-> (get-trans (the-as process-focusable focus-proc) 0) quad)) + (set! (-> focus bullseye quad) (-> (get-trans (the-as process-focusable focus-proc) 3) quad)) + (vector-z-quaternion! (-> focus my-facing-xz-dir) (-> obj root-override2 quat)) + (set! (-> focus my-facing-xz-dir y) 0.0) + (vector-normalize! (-> focus my-facing-xz-dir) 1.0) + (set! (-> focus my-facing-ry) (atan (-> focus my-facing-xz-dir x) (-> focus my-facing-xz-dir z))) + (vector-! (-> focus bullseye-xz-dir) (-> focus bullseye) (-> obj root-override2 trans)) + (let ((v1-11 (-> focus bullseye-xz-dir))) + (set! (-> focus bullseye-xz-dist) (sqrtf (+ (* (-> v1-11 x) (-> v1-11 x)) (* (-> v1-11 z) (-> v1-11 z))))) + ) + (set! (-> focus bullseye-xz-dir y) 0.0) + (vector-normalize! (-> focus bullseye-xz-dir) 1.0) + (set! (-> focus bullseye-ry) (atan (-> focus bullseye-xz-dir x) (-> focus bullseye-xz-dir z))) + (set! (-> focus ry-diff) (deg- (-> focus bullseye-ry) (-> focus my-facing-ry))) + ) + ) + (when (and arg0 focus-proc (zero? (-> focus los))) + (let ((cquery (new 'stack-no-clear 'collide-query))) + (set! (-> cquery start-pos quad) (-> obj root-override2 trans quad)) + (set! (-> cquery start-pos y) (+ 8192.0 (-> cquery start-pos y))) + (vector-! (-> cquery move-dist) (-> focus bullseye) (-> cquery start-pos)) + (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> cquery move-dist)))))) + (cond + ((< f0-19 (-> focus max-los-dist)) + (vector-normalize! (-> cquery move-dist) f0-19) + (let ((v1-23 cquery)) + (set! (-> v1-23 radius) 2048.0) + (set! (-> v1-23 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-23 ignore-process0) obj) + (set! (-> v1-23 ignore-process1) #f) + (set! (-> v1-23 ignore-pat) (-> obj root-override2 pat-ignore-mask)) + (set! (-> v1-23 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* cquery) 0.0) + (set! (-> focus los) 3) + 0 + ) + (else + (let ((s3-3 1)) + (when (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (let ((a0-31 *target*)) + (when a0-31 + (vector+! (-> cquery move-dist) (-> cquery move-dist) (-> cquery start-pos)) + (if (>= 16384.0 (vector-segment-distance-point! + (get-trans a0-31 3) + (-> cquery start-pos) + (-> cquery move-dist) + (the-as vector #f) + ) + ) + (set! s3-3 4) + ) + ) + ) + ) + (set! (-> focus los) s3-3) + ) + ) + ) + ) + (else + (set! (-> focus los) 2) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 182 of type bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod turn-to-target bot ((obj bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((bot-root (-> obj root-override2))) + (quaternion-copy! (-> turn-info src-quat) (-> bot-root quat)) + (vector-z-quaternion! (-> turn-info facing-dir) (-> bot-root quat)) + (set! (-> turn-info facing-ry) (atan (-> turn-info facing-dir x) (-> turn-info facing-dir z))) + (set! (-> turn-info targ-pos quad) (-> (get-trans proc 3) quad)) + (set! (-> turn-info targ-ry) + (atan (- (-> turn-info targ-pos x) (-> bot-root trans x)) (- (-> turn-info targ-pos z) (-> bot-root trans z))) + ) + (let ((proc-vel (get-transv proc)) + (a1-6 (-> turn-info predicted-targ-pos)) + ) + (let ((targ-pos (-> turn-info targ-pos))) + (let ((a2-1 arg3)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> proc-vel quad)) + (.lvf vf4 (&-> targ-pos quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-6 quad) vf6) + ) + (set! (-> turn-info predicted-targ-ry) (atan + (- (-> turn-info predicted-targ-pos x) (-> bot-root trans x)) + (- (-> turn-info predicted-targ-pos z) (-> bot-root trans z)) + ) + ) + ) + (set! (-> turn-info ry-diff) (deg- (-> turn-info targ-ry) (-> turn-info facing-ry))) + (set! (-> turn-info predicted-ry-diff) (deg- (-> turn-info predicted-targ-ry) (-> turn-info facing-ry))) + (none) + ) + ) + +;; definition for method 208 of type bot +(defmethod bot-method-208 bot ((obj bot)) + (with-pp + (let ((s5-0 #f)) + (when *target* + (let ((target-trans (-> *target* control trans)) + (bot-root (-> obj root-override2)) + (f0-0 14336.0) + ) + (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> bot-root trans) target-trans)) + (let ((v1-8 (-> *target* control transv))) + (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) + (if (logtest? (-> obj nav state flags) (nav-state-flag avoiding-sphere)) + (set! s5-0 #t) + ) + ) + ) + ) + ) + ) + (let* ((f0-8 (-> obj player-blocking)) + (f0-10 (if s5-0 + (seek f0-8 1.0 (-> pp clock seconds-per-frame)) + (seek f0-8 0.0 (-> pp clock seconds-per-frame)) + ) + ) + ) + (set! (-> obj player-blocking) f0-10) + (= f0-10 1.0) + ) + ) + ) + ) + +;; definition for method 82 of type bot +;; INFO: Used lq/sq +(defmethod enemy-method-82 bot ((obj bot) (arg0 enemy-jump-info)) + "@abstract" + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (set! (-> v1-0 w) (-> obj nav-radius-backup)) + (add-root-sphere-to-hash! (-> obj nav) v1-0 #x8006a) + ) + ) + +;; definition for method 222 of type bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-222 bot ((obj bot) (arg0 vector)) + (with-pp + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> obj root-override2 trans quad)) + (set! (-> v1-0 y) (+ 9216.0 (-> v1-0 y))) + (vector-! s1-0 arg0 v1-0) + (vector-normalize! s1-0 1.0) + (vector-z-quaternion! s2-0 (-> obj root-override2 quat)) + (rot-zxy-from-vector! s4-0 s2-0) + (rot-zxy-from-vector! s3-0 s1-0) + (set! (-> s5-0 x) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 x) (-> s4-0 x))))) + (set! (-> s5-0 y) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 y) (-> s4-0 y))))) + (set! (-> s5-0 z) 0.0) + (let ((s4-1 (new 'stack-no-clear 'quaternion))) + (quaternion-zxy! s4-1 s5-0) + (quaternion-pseudo-seek + (-> obj swivel-joint-mod quat) + (-> obj swivel-joint-mod quat) + s4-1 + (-> pp clock seconds-per-frame) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 221 of type bot +(defmethod bot-method-221 bot ((obj bot)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (quaternion-identity! gp-0) + (quaternion-pseudo-seek + (-> obj swivel-joint-mod quat) + (-> obj swivel-joint-mod quat) + gp-0 + (-> pp clock seconds-per-frame) + ) + ) + ) + ) + +;; definition for method 203 of type bot +(defmethod play-attacked-speech bot ((obj bot)) + (when (not (channel-active? obj (the-as uint 0))) + (let ((idx + (bot-speech-list-method-9 (-> obj course attack-player-speeches) obj (-> obj course speeches) (speech-flags)) + ) + ) + (if (>= idx 0) + (play-speech obj idx) + ) + ) + ) + (none) + ) + +;; definition for method 196 of type bot +;; WARN: Return type mismatch bot-flags vs none. +(defmethod bot-method-196 bot ((obj bot)) + (logior! (-> obj bot-flags) (bot-flags too-far-fail)) + (none) + ) + +;; definition for method 197 of type bot +;; WARN: Return type mismatch bot-flags vs none. +(defmethod fail-mission! bot ((obj bot)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> obj mask) (process-mask collectable)) + (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (logior! (-> obj bot-flags) (bot-flags bf09)) + (let ((mission-failed? #t)) + (let ((master-handle (handle->process (-> obj master-handle)))) + (cond + (master-handle + (if (not (send-event master-handle 'notify 'mission-failed)) + (set! mission-failed? #f) + ) + ) + (else + (let ((fail-params (new 'stack-no-clear 'fail-mission-params))) + (set! (-> fail-params flags) (fail-mission-flags famflags-5)) + (set! (-> fail-params message) (fail-mission-message fammsg-0)) + (set! (-> fail-params retry-continue) #f) + (set! (-> fail-params fail-continue) #f) + (set! (-> fail-params reset-delay) (the-as uint 1500)) + (set! (-> fail-params task) (game-task none)) + (set! (-> fail-params fail-message) (game-text-id null)) + (if (not (start! *fail-mission-control* fail-params)) + (set! mission-failed? #f) + ) + ) + ) + ) + ) + (if mission-failed? + (logior! (-> obj bot-flags) (bot-flags failed bf13)) + ) + ) + (none) + ) + +;; definition for method 200 of type bot +(defmethod fail-falling bot ((obj bot)) + (if (logtest? (-> obj bot-flags) (bot-flags failed)) + (cam-move-to-bot obj) + ) + (none) + ) + +;; definition for method 199 of type bot +;; WARN: Return type mismatch object vs none. +(defmethod cam-move-to-bot bot ((obj bot)) + (cond + ((logtest? (-> obj bot-flags) (bot-flags bf13)) + (logclear! (-> obj bot-flags) (bot-flags bf13)) + (logior! (-> obj bot-flags) (bot-flags bf14)) + (let ((s4-0 (-> obj move-dest))) + (set-cam-height! obj s4-0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 s4-0 (-> obj root-override2 trans)) + (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) + (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) + (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) + (set-setting! 'string-max-length 'abs f30-0 0) + (set-setting! 'string-min-length 'abs f30-0 0) + ) + ) + ) + (set-setting! 'immediate-string-min-max #f 0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + ) + ((logtest? (-> obj bot-flags) (bot-flags bf14)) + (logclear! (-> obj bot-flags) (bot-flags bf14)) + (send-event *camera* 'change-target obj) + (send-event *camera* 'teleport-to-vector-start-string (-> obj move-dest)) + ) + ) + (none) + ) + +;; definition for method 198 of type bot +;; WARN: Return type mismatch float vs meters. +(defmethod set-cam-height! bot ((obj bot) (arg0 vector)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (the-as + meters + (if (logtest? (-> obj focus-status) (focus-status under-water)) + (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + ) + ) + ) + +;; definition for method 191 of type bot +;; WARN: Return type mismatch focus-status vs none. +(defmethod bot-method-191 bot ((obj bot)) + (with-pp + (logior! (-> obj bot-flags) (bot-flags bf02)) + (set! (-> obj hit-invuln-starting-time) (-> pp clock frame-counter)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active)) + (if (nonzero? (-> obj hit-invuln-ignore-me-delay)) + (logior! (-> obj focus-status) (focus-status ignore)) + ) + (if (nonzero? (-> obj hit-invuln-focus-disable-delay)) + (logior! (-> obj focus-status) (focus-status disable)) + ) + (none) + ) + ) + +;; definition for method 192 of type bot +;; WARN: Return type mismatch bot-flags vs none. +(defmethod bot-method-192 bot ((obj bot)) + (local-vars (a2-7 enemy-flag)) + (with-pp + (let ((a1-0 (-> obj hit-invuln-starting-time)) + (v1-0 #t) + ) + (if (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))) + (set! v1-0 (cond + ((>= (- (-> pp clock frame-counter) a1-0) (seconds 0.6)) + (let ((a2-6 (-> obj enemy-flags))) + (if (logtest? a2-6 (enemy-flag checking-water)) + (set! a2-7 (logior a2-6 (enemy-flag enable-on-active))) + (set! a2-7 (logclear a2-6 (enemy-flag enable-on-active))) + ) + ) + (set! (-> obj enemy-flags) a2-7) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (logtest? (-> obj focus-status) (focus-status ignore)) + (set! v1-0 + (cond + ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-ignore-me-delay))) + (logclear! (-> obj focus-status) (focus-status ignore)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (logtest? (-> obj focus-status) (focus-status disable)) + (set! v1-0 + (cond + ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-focus-disable-delay))) + (logclear! (-> obj focus-status) (focus-status disable)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if v1-0 + (logclear! (-> obj bot-flags) (bot-flags bf02)) + ) + ) + (none) + ) + ) + +;; definition for method 216 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-216 bot ((obj bot)) + 0 + (none) + ) + +;; definition for method 60 of type bot +(defmethod coin-flip? bot ((obj bot)) + "@returns The result of a 50/50 RNG roll" + #f + ) + +;; definition for method 181 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-181 bot ((obj bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-1 arg0)) + (let ((v1-10 arg0)) + (let ((a0-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a2-1 f3-7)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t2-1 quad) vf6) + ) + (let ((a2-2 arg0)) + (let ((v1-11 arg0)) + (let ((a0-5 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((a3-2 f1-3)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-2 quad) vf6) + ) + ) + (let ((v1-12 arg0)) + (let ((a0-6 arg0)) + (let ((a1-1 arg3)) + (let ((a2-3 f0-2)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-1 quad)) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-12 quad) vf6) + ) + ) + 0 + (none) + ) + ) + + + + diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index e76c8a3765..cf0adc57dc 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -279,7 +279,8 @@ "(method 23 dig-tether)", // working around annoying decomp array output "(method 16 sew-light-control)", // skipped for now, looking for a caller "(method 3 rhino)", - "(method 193 grunt-mech)" // .mula.s + "(method 193 grunt-mech)", // .mula.s + "(method 3 sig-path-sample)" ], "skip_compile_states": {