diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 1c749613f6..f68b9da9a9 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -2648,6 +2648,7 @@ (reg1) (reg2) (unk) + (unk2) ) (defenum stream-status @@ -4489,6 +4490,7 @@ (base pointer :offset-assert 8) ;; guessed by decompiler (end pointer :offset-assert 12) ;; guessed by decompiler (real-buffer-end int32 :offset-assert 16) + (data-buffer uint8 :dynamic :offset 16) ;; added (data uint64 1 :offset 32) ;; guessed by decompiler ) (:methods @@ -7176,6 +7178,7 @@ ((value float :offset-assert 0) (scale float :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 @@ -7763,7 +7766,7 @@ (login-begin "Start logging in loaded level data." (_type_) _type_) ;; 19 (debug-print-region-splitbox (_type_ vector object) none) ;; 20 (get-art-group-by-name "Look up art-group in this level by name." (_type_ string) art-group) ;; 21 - (level-method-22 () none) ;; 22 ;; (level-method-22 (_type_ symbol) int) + (set-proto-vis! (_type_ symbol) int) ;; 22 (lookup-text (_type_ text-id symbol) string) ;; 23 (level-method-24 () none) ;; 24 ;; (level-method-24 () none) (birth "Start running a level." (_type_) _type_) ;; 25 @@ -9644,6 +9647,7 @@ :bitfield #t (tnf0 0) ;; unused?? (tnf1 1) + (tnf2 2) ) (defenum conn-flag @@ -9668,13 +9672,14 @@ (flags trail-node-flag :offset-assert 18) (conn-count uint8 :offset-assert 19) ) + :pack-me :method-count-assert 12 :size-assert #x14 :flag-assert #xc00000014 (:methods - (trail-node-method-9 () none) ;; 9 ;; (get-dist-score (_type_ vector) uint) - (trail-node-method-10 () none) ;; 10 ;; (debug-draw (_type_ int) none) - (trail-node-method-11 () none) ;; 11 ;; (get-position (_type_ vector) vector) + (get-dist-score (_type_ vector) uint) ;; 9 + (debug-draw (_type_ int) none) ;; 10 + (get-position (_type_ vector) vector) ;; 11 ) ) @@ -9698,6 +9703,7 @@ :flag-assert #x900000020 ) +(declare-type trail-graph basic) (deftype trail-conn (structure) ((head-id uint16 :offset-assert 0) (tail-id uint16 :offset-assert 2) @@ -9705,11 +9711,12 @@ (visgroup-id uint8 :offset-assert 5) (cost uint16 :offset-assert 6) ) + :pack-me :method-count-assert 10 :size-assert #x8 :flag-assert #xa00000008 (:methods - (trail-conn-method-9 () none) ;; 9 ;; (debug-draw (_type_ trail-graph int) none) + (debug-draw (_type_ trail-graph int) none) ;; 9 ) ) @@ -9719,6 +9726,7 @@ (pov-count uint8 :offset-assert 3) (first-pov uint16 :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x6 :flag-assert #x900000006 @@ -9811,31 +9819,31 @@ :size-assert #x190 :flag-assert #x2200000190 (:methods - (trail-graph-method-9 () none) ;; 9 ;; (trail-graph-method-9 (_type_ int) none) - (trail-graph-method-10 () none) ;; 10 ;; (trail-graph-method-10 (_type_ int) none) - (trail-graph-method-11 () none) ;; 11 ;; (trail-graph-method-11 (_type_ int int) trail-node) - (trail-graph-method-12 () none) ;; 12 - (trail-graph-method-13 () none) ;; 13 ;; (debug-draw-cell (_type_ int) none) + (trail-graph-method-9 (_type_ int) none) ;; 9 ;; (trail-graph-method-9 (_type_ int) none) + (trail-graph-method-10 (_type_ int) none) ;; 10 ;; (trail-graph-method-10 (_type_ int) none) + (trail-graph-method-11 (_type_ int int) trail-node) ;; 11 ;; (trail-graph-method-11 (_type_ int int) trail-node) + (trail-graph-method-12 (_type_) none) ;; 12 + (trail-graph-method-13 (_type_ vector vector) none) ;; 13 ;; (debug-draw-cell (_type_ int) none) (debug-draw (_type_) none) ;; 14 ;; (debug-draw-path (_type_ int (pointer uint16) vector vector rgba float) symbol) - (trail-graph-method-15 () none) ;; 15 ;; (do-path (_type_ vector vector) int) - (trail-graph-method-16 () none) ;; 16 ;; (trail-graph-method-16 () none) - (trail-graph-method-17 () none) ;; 17 ;; (get-node-location-by-id (_type_ uint vector) vector) - (trail-graph-method-18 () none) ;; 18 ;; (get-path-to-root (_type_ (pointer uint16) int (pointer int32) (pointer float)) int) - (trail-graph-method-19 () none) ;; 19 ;; (trail-graph-method-19 (_type_ int int) symbol) - (trail-graph-method-20 () none) ;; 20 ;; (try-initialize (_type_) symbol) - (trail-graph-method-21 () none) ;; 21 ;; (update-node-flags-for-conn (_type_ int trail-node-flag trail-node-flag) none) - (trail-graph-method-22 () none) ;; 22 ;; (trail-graph-method-22 (_type_ int) none) - (trail-graph-method-23 () none) ;; 23 ;; (reset-search-state (_type_) none) - (trail-graph-method-24 () none) ;; 24 ;; (get-next-to-explore (_type_) int) - (trail-graph-method-25 () none) ;; 25 ;; (trail-graph-method-25 (_type_ trail-conn-search int int) none) - (trail-graph-method-26 () none) ;; 26 ;; (do-search! (_type_ vector vector trail-cached-search-info) none) - (trail-graph-method-27 () none) ;; 27 ;; (do-some-work (_type_) int) - (trail-graph-method-28 () none) ;; 28 ;; (run-until-done-or-timeout (_type_ int) none) - (trail-graph-method-29 () none) ;; 29 - (trail-graph-method-30 () none) ;; 30 - (trail-graph-method-31 () none) ;; 31 - (trail-graph-method-32 () none) ;; 32 - (trail-graph-method-33 () none) ;; 33 + (trail-graph-method-15 (_type_ int) none) ;; 15 ;; (do-path (_type_ vector vector) int) + (trail-graph-method-16 (_type_ int (pointer uint16) vector vector rgba float) none) ;; 16 ;; (trail-graph-method-16 () none) + (trail-graph-method-17 (_type_) none) ;; 17 ;; (get-node-location-by-id (_type_ uint vector) vector) + (trail-graph-method-18 (_type_ vector) int) ;; 18 ;; (get-path-to-root (_type_ (pointer uint16) int (pointer int32) (pointer float)) int) + (trail-graph-method-19 (_type_) none) ;; 19 ;; (trail-graph-method-19 (_type_ int int) symbol) + (trail-graph-method-20 (_type_ uint vector) none) ;; 20 ;; (try-initialize (_type_) symbol) + (trail-graph-method-21 (_type_) none) ;; 21 ;; (update-node-flags-for-conn (_type_ int trail-node-flag trail-node-flag) none) + (trail-graph-method-22 (_type_) none) ;; 22 ;; (trail-graph-method-22 (_type_ int) none) + (trail-graph-method-23 (_type_) none) ;; 23 ;; (reset-search-state (_type_) none) + (trail-graph-method-24 (_type_) none) ;; 24 ;; (get-next-to-explore (_type_) int) + (trail-graph-method-25 (_type_ int) none) ;; 25 ;; (trail-graph-method-25 (_type_ trail-conn-search int int) none) + (trail-graph-method-26 (_type_) none) ;; 26 ;; (do-search! (_type_ vector vector trail-cached-search-info) none) + (trail-graph-method-27 (_type_) none) ;; 27 ;; (do-some-work (_type_) int) + (trail-graph-method-28 (_type_) none) ;; 28 ;; (run-until-done-or-timeout (_type_ int) none) + (trail-graph-method-29 (_type_) none) ;; 29 + (trail-graph-method-30 (_type_) none) ;; 30 + (trail-graph-method-31 (_type_ int) none) ;; 31 + (trail-graph-method-32 (_type_) none) ;; 32 + (trail-graph-method-33 (_type_) none) ;; 33 ) ) @@ -10055,13 +10063,13 @@ (deftype minimap-table-entry (structure) ((corner vector :inline :offset-assert 0) - (level-name basic :offset-assert 16) - (tex-name basic :offset-assert 20) + (level-name symbol :offset-assert 16) + (tex-name string :offset-assert 20) (meters-per-texel float :offset-assert 24) (pos-scale float :offset-assert 28) (min-inv-scale float :offset-assert 32) (max-inv-scale float :offset-assert 36) - (switch-immediate basic :offset-assert 40) + (switch-immediate symbol :offset-assert 40) ) :method-count-assert 9 :size-assert #x2c @@ -10071,7 +10079,7 @@ (deftype minimap-class-node (structure) ((default-position vector :inline :offset-assert 0) (flags minimap-flag :offset-assert 16) - (name basic :offset-assert 20) + (name string :offset-assert 20) (icon-xy vector2ub :inline :offset-assert 24) (class minimap-class :offset-assert 26) ;; minimap-class (scale float :offset-assert 28) @@ -10081,13 +10089,13 @@ :size-assert #x24 :flag-assert #xa00000024 (:methods - (minimap-class-node-method-9 () none) ;; 9 + (minimap-class-node-method-9 (_type_) symbol) ;; 9 ) ) (deftype connection-minimap (connection-pers) ((next connection-minimap :offset-assert 0 :override) ;; connection-pers - (handle handle :offset-assert 8 :overlay-at update-time) ;; + (handle handle :offset-assert 8 :overlay-at update-time :score 1) (position vector :offset-assert 16 :overlay-at (-> param 0)) ;; object (alpha float :offset-assert 20 :overlay-at (-> param 1)) (flags minimap-flag :offset-assert 24 :overlay-at (-> param 2)) @@ -10127,7 +10135,7 @@ :flag-assert #xb000000d0 (:methods (get-distance-with-path (_type_ vector vector) float) ;; 9 - (minimap-trail-method-10 () none) ;; 10 ;; (reset (_type_) none) + (reset (_type_) none) ;; 10 ) ) @@ -10183,24 +10191,24 @@ :size-assert #x658 :flag-assert #x1c00000658 (:methods - (minimap-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) + (debug-draw (_type_) none) ;; 9 (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) ;; 10 - (minimap-method-11 () none) ;; 11 ;; (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol) + (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol) ;; 11 (add-icon! (_type_ process uint int vector int) connection-minimap) ;; 12 - (minimap-method-13 () none) ;; 13 ;; (free-trail-by-connection (_type_ connection-minimap) none) - (minimap-method-14 () none) ;; 14 ;; (update-trails (_type_) none) + (free-trail-by-connection (_type_ connection-minimap) none) ;; 13 + (update-trails (_type_) none) ;; 14 (draw-1 (_type_ dma-buffer vector4w symbol) none) ;; 15 - (minimap-method-16 () none) ;; 16 ;; (draw-connection (_type_ minimap-draw-work connection-minimap) none) - (minimap-method-17 () none) ;; 17 ;; (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none) - (minimap-method-18 () none) ;; 18 ;; (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none) - (minimap-method-19 () none) ;; 19 ;; (sub-draw-1-2 (_type_ minimap-draw-work) none) + (draw-connection (_type_ minimap-draw-work connection-minimap) none) ;; 16 + (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none) ;; 17 + (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none) ;; 18 + (sub-draw-1-2 (_type_ minimap-draw-work) none) ;; 19 (update! (_type_) symbol) ;; 20 - (minimap-method-21 () none) ;; 21 ;; (sub-draw-1-1 (_type_ minimap-draw-work) none) - (minimap-method-22 () none) ;; 22 ;; (set-color (_type_ vector) none) - (minimap-method-23 () none) ;; 23 ;; (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none) + (sub-draw-1-1 (_type_ minimap-draw-work) none) ;; 21 + (set-color (_type_ vector) none) ;; 22 + (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none) ;; 23 (draw-sprite2 (_type_ dma-buffer vector4w symbol) none) ;; 24 (set-race-texture (_type_ texture float level) none) ;; 25 - (minimap-method-26 () none) ;; 26 ;; (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none) + (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none) ;; 26 (set-race-corner (_type_ float float) none) ;; 27 ) ) @@ -10247,7 +10255,7 @@ (tpage external-art-buffer :offset-assert 20) ;; guessed by decompiler (tpage2 basic :offset-assert 24) (progress-minimap texture-page :offset-assert 28) ;; guessed by decompiler - (progress-minimap2 basic :offset-assert 32) + (progress-minimap2 texture-page :offset-assert 32) (load-index uint32 :offset-assert 36) (x0 int32 :offset-assert 40) (y0 int32 :offset-assert 44) @@ -10274,7 +10282,7 @@ (new (symbol type) _type_) ;; 0 ;; (new (symbol type) _type_) (bigmap-method-9 () none) ;; 9 ;; (initialize (_type_) none) (update (_type_) none) ;; 10 - (draw (_type_ int int int int) int) ;; 11 + (bigmap-method-11 (_type_) symbol) ;; 11 (bigmap-method-12 () none) ;; 12 ;; (handle-cpad-inputs (_type_) int) (bigmap-method-13 () none) ;; 13 ;; (compress-all (_type_) int) (enable-drawing (_type_) none) ;; 14 @@ -10337,7 +10345,7 @@ (feature36 36) (board-launch 37) (board-trail 38) - (feature39 39) + (board-zap 39) (darkjak 40) (darkjak-smack 41) (darkjak-bomb0 42) @@ -10354,7 +10362,7 @@ (armor1 53) (armor2 54) (armor3 55) - (feature56 56) + (jakc 56) (lighteco 57) (darkeco 58) (feature59 59) @@ -12741,6 +12749,39 @@ ) ;; ---traffic-h:traffic-type +;; +++traffic-h:vehicle-type +(defenum vehicle-type + :type int32 + (h-bike-a 0) + (h-bike-b 1) + (h-bike-c 2) + (h-car-a 3) + (h-car-b 4) + (h-car-c 5) + (h-bike-d 6) + (h-hellcat 7) + (h-warf 8) + (h-glider 9) + (h-sled 10) + (h-kg-pickup 11) + (v-turtle 12) + (v-snake 13) + (v-scorpion 14) + (v-toad 15) + (v-fox 16) + (v-rhino 17) + (v-mirage 18) + (v-x-ride 19) + (v-marauder 20) + (v-faccar 21) + (v-catapult 22) + (v-marauder-b 23) + (test-car 25) + (wbike-test 26) + (evan-test-bike 29) + ) +;; ---traffic-h:vehicle-type + (deftype traffic-danger-info (structure) ((sphere sphere :inline :offset-assert 0) (velocity vector :inline :offset-assert 16) @@ -12799,7 +12840,7 @@ (vehicle-level basic :offset-assert 4) (race-vehicle-level basic :offset-assert 8) (traffic-object-levels level 29 :offset-assert 12) - (vehicle-levels level 44 :offset-assert 128) + (vehicle-levels symbol 44 :offset-assert 128) (traffic-object-type-from-vehicle-type traffic-type 44 :offset-assert 304) (restore-speech-callback basic :offset-assert 348) ) @@ -14039,11 +14080,11 @@ :flag-assert #xe00000050 ;; field on-open uses ~A with a signed load. field on-close uses ~A with a signed load. (:methods - (game-task-node-info-method-9 () none) ;; 9 ;; (close! (_type_ symbol) int) + (get-idx-in-task-list (_type_) int) ;; 9 ;; (close! (_type_ symbol) int) (open! (_type_ symbol) int) ;; 10 ;; (open! (_type_ symbol) int) (game-task-node-info-method-11 (_type_ symbol) none) ;; 11 ;; (open? (_type_) symbol) (game-task-node-info-method-12 (_type_) symbol) ;; 12 ;; (copy-hooks! (_type_ game-task-node-info) game-task-node-info) - (game-task-node-info-method-13 () none) ;; 13 ;; (eval-add (_type_) int) + (eval-game-task-cmd! (_type_) none) ;; 13 ;; (eval-add (_type_) int) ) ) @@ -14099,25 +14140,27 @@ :method-count-assert 32 :size-assert #xf0 :flag-assert #x20007000f0 + (:state-methods + wait ;; 14 + active ;; 15 + complete ;; 16 + resolution ;; 17 + (fail resetter-params) ;; 18 + (restart symbol) ;; 19 + ) (:methods - (task-manager-method-14 () none) ;; 14 ;; (wait () _type_ :state) - (task-manager-method-15 () none) ;; 15 ;; (active () _type_ :state) - (task-manager-method-16 () none) ;; 16 ;; (complete () _type_ :state) - (task-manager-method-17 () none) ;; 17 ;; (fail () _type_ :state) - (task-manager-method-18 () none) ;; 18 ;; (retry () _type_ :state) - (task-manager-method-19 () none) ;; 19 ;; (initialize! (_type_) int) - (task-manager-method-20 () none) ;; 20 ;; (kill-all-children (_type_) int) - (task-manager-method-21 () none) ;; 21 ;; (check-time (_type_) int) - (task-manager-method-22 () none) ;; 22 ;; (task-manager-method-22 (_type_) symbol) - (task-manager-method-23 () none) ;; 23 - (task-manager-method-24 () none) ;; 24 - (task-manager-method-25 () none) ;; 25 - (task-manager-method-26 () none) ;; 26 - (task-manager-method-27 () none) ;; 27 - (task-manager-method-28 () none) ;; 28 - (task-manager-method-29 () none) ;; 29 - (task-manager-method-30 () none) ;; 30 - (task-manager-method-31 (_type_ symbol) resetter-spec) ;; 31 + (init! (_type_) none) ;; 20 + (set-time-limit (_type_) none) ;; + (kill-all-children (_type_) none) ;; 22 ;; (task-manager-method-22 (_type_) symbol) + (hud-timer-handler (_type_) none) ;; 23 + (ready? (_type_) object) ;; 24 + (task-manager-method-25 (_type_) none) ;; 25 + (task-manager-method-26 (_type_) none) ;; 26 + (task-manager-method-27 (_type_) none) ;; 27 + (task-manager-method-28 (_type_) none) ;; 28 + (go-fail (_type_) object) ;; 29 + (taskman-event-handler (_type_ process int symbol event-message-block) object) ;; 30 + (on-fail (_type_ symbol) resetter-params) ;; 31 ) ) @@ -14131,9 +14174,9 @@ :size-assert #x10 :flag-assert #xc00000010 (:methods - (ambient-control-method-9 () none) ;; 9 ;; (dummy-9 () none) - (ambient-control-method-10 () none) ;; 10 ;; (dummy-10 () none) - (ambient-control-method-11 () none) ;; 11 ;; (dummy-11 () none) + (ambient-control-method-9 () none) ;; 9 + (ambient-control-method-10 () none) ;; 10 + (ambient-control-method-11 () none) ;; 11 ) ) @@ -14872,6 +14915,7 @@ ((lod lod-group 6 :inline :offset-assert 0) ;; guessed by decompiler (max-lod int8 :offset-assert 48) ) + :allow-misaligned :method-count-assert 10 :size-assert #x31 :flag-assert #xa00000031 @@ -15516,7 +15560,7 @@ (timer uint8 :offset-assert 6) (overlap uint8 :offset-assert 7) (effect uint32 :offset-assert 8) - (sound symbol :offset-assert 12) ;; guessed by decompiler + (sound string :offset-assert 12) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x10 @@ -16615,14 +16659,14 @@ (amulet0 0) (amulet1 1) (amulet2 2) - (pass-wascity 3) + (pass-front-gate 3) (seal-of-mar 4) - (pass-factory 5) + (cypher-gliph 5) (artifact-holocube 6) - (artifact-quantum-reflector 7) - (artifact-prism 8) - (artifact-beam-generator 9) - (artifact-time-map 10) + (artifact-av-reflector 7) + (artifact-av-prism 8) + (artifact-av-generator 9) + (artifact-av-map 10) (light-eco-crystal0 11) (light-eco-crystal1 12) (light-eco-crystal2 13) @@ -16712,7 +16756,7 @@ (play-list (array game-task-info) :offset-assert 404) (sub-task-list (array game-task-node-info) :offset-assert 408) (mission-list (array game-task-node-info) :offset-assert 412) - (task-node-commands (array uint8) :offset-assert 416) + (task-node-commands (array game-task-node-command) :offset-assert 416) (task-node-exclusive (array uint16) :offset-assert 420) (task-counter uint32 :offset-assert 424) (unknown-arr4 (array uint16) :offset-assert 428) @@ -18965,6 +19009,32 @@ (jak-dark-nuke 35) (jak-dark-blackhole 36) (emp-blast 37) + (penetrate38 38) + (penetrate39 39) + (penetrate40 40) + (penetrate41 41) + (penetrate42 42) + (penetrate43 43) + (penetrate44 44) + (penetrate45 45) + (penetrate46 46) + (penetrate47 47) + (penetrate48 48) + (penetrate49 49) + (penetrate50 50) + (penetrate51 51) + (penetrate52 52) + (penetrate53 53) + (penetrate54 54) + (penetrate55 55) + (penetrate56 56) + (penetrate57 57) + (penetrate58 58) + (penetrate59 59) + (penetrate60 60) + (penetrate61 61) + (penetrate64 62) + (penetrate63 63) ) ;; ---penetrate-h:penetrate @@ -20537,6 +20607,16 @@ ) ;; ---collide-shape-h:collide-list-enum +;; +++collide-shape-h:nav-flags +(defenum nav-flags + :type uint8 + :bitfield #t + (has-root-sphere 0) + (has-extra-sphere 1) + (has-child-spheres 2) + ) +;; ---collide-shape-h:nav-flags + (declare-type collide-query structure) (declare-type water-info structure) (deftype collide-shape (trsqv) @@ -20545,7 +20625,7 @@ ((actor-hash-index int16 :offset 12) (process process-drawable :offset-assert 140) ;; guessed by decompiler (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) ;; nav-flags + (nav-flags nav-flags :offset-assert 145) ;; nav-flags (total-prims uint8 :offset-assert 146) (num-riders uint8 :offset-assert 147) (pat-ignore-mask pat-surface :offset-assert 148) ;; somehow is missing from inspect?? @@ -21941,7 +22021,7 @@ (:methods (new (symbol type process-drawable) _type_) ;; 0 (effect-control-method-9 (_type_) none) ;; 9 - (do-effect (_type_ symbol float int) none) ;; 10 + (do-effect (_type_ string float int) none) ;; 10 (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) ;; 11 (play-effect-sound (_type_ symbol float int basic sound-name) int) ;; 12 (set-channel-offset! (_type_ int) none) ;; 13 @@ -22446,7 +22526,7 @@ (get-max-angle-for-joint-idx (_type_ int) degrees) ;; 22 (ragdoll-method-23 (_type_ vector vector float symbol) none) ;; 23 (ragdoll-method-24 (_type_ vector int) none) ;; 24 - (ragdoll-method-25 (_type_ process-drawable) none) ;; 25 + (enable-ragdoll! (_type_ process-drawable) none) ;; 25 ) ) @@ -23012,13 +23092,13 @@ (target-pilot-edge-grab pilot-edge-grab-info) (target-pilot-start handle symbol symbol) target-pilot-get-on - target-pilot-get-off + (target-pilot-get-off handle) target-pilot-stance target-pilot-grab target-pilot-impact - target-pilot-hit ;; associated process guessed by decompiler, old: (state symbol attack-info target) - target-pilot-death ;; associated process guessed by decompiler, old: (state symbol target) - target-pilot-clone-anim ;; associated process guessed by decompiler, old: (state handle target) + (target-pilot-hit symbol attack-info) + (target-pilot-death symbol) + (target-pilot-clone-anim handle) target-pilot-daxter-perch ;; indax (target-indax-start handle object) ;; associated process guessed by decompiler, old: (state handle target) @@ -24458,7 +24538,8 @@ ) (deftype hfrag-packed-index (uint16) - () + ((bit11 uint8 :offset 11 :size 5) + ) :flag-assert #x900000002 ) @@ -24709,14 +24790,14 @@ ((start-corner vector :inline :offset-assert 32) (spheres uint32 :offset-assert 48) (visids uint32 :offset-assert 52) - (shaders (inline-array adgif-shader) :offset-assert 56) + (shaders (inline-array adgif-shader) :offset-assert 56) (colors basic :offset-assert 60) (montage uint32 :offset-assert 64) (buckets-far uint32 :offset-assert 68) (buckets-mid uint32 :offset-assert 72) (buckets-near uint32 :offset-assert 76) - (verts uint32 :offset-assert 80) - (pat-array uint32 :offset-assert 84) + (verts (inline-array hfrag-vertex) :offset-assert 80) + (pat-array (pointer pat-surface) :offset-assert 84) (pat-length uint16 :offset-assert 88) (num-buckets-far uint16 :offset-assert 90) (num-buckets-mid uint16 :offset-assert 92) @@ -24729,9 +24810,9 @@ (:methods (hfragment-method-17 (_type_ collide-cache collide-query) none) ;; 17 (hfragment-method-18 (_type_ collide-cache collide-query) none) ;; 18 - (hfragment-method-19 () none) ;; 19 - (hfragment-method-20 () none) ;; 20 - (hfragment-method-21 () none) ;; 21 + (hfragment-method-19 (_type_ collide-cache collide-query int int int int) none) ;; 19 + (hfragment-method-20 (_type_ collide-cache int int uint uint uint pat-surface) none) ;; 20 + (hfragment-method-21 (_type_ collide-cache int int uint uint uint pat-surface) none) ;; 21 ) ) @@ -26058,6 +26139,7 @@ (sym symbol :offset 4) ;; guessed by decompiler (sound sound-spec :offset 4) ;; guessed by decompiler ) + :allow-misaligned :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 @@ -27921,7 +28003,7 @@ (path-control-method-25 (_type_ vector) float) ;; 25 (path-control-method-26 (_type_ float float) float) ;; 26 ;; (displacement-between-two-points! (_type_ vector float float) vector) (path-control-method-27 (_type_ vector) vector) ;; 27 - (path-control-method-28 (_type_ vector float float) float) ;; 28 + (path-control-method-28 (_type_ vector vector symbol) float) ;; 28 (path-control-method-29 (_type_ vector int float) float) ;; 29 (should-display-marks? (_type_) symbol) ;; 30 (displacement-between-two-points! (_type_ vector float float) vector) ;; 31 @@ -28151,47 +28233,47 @@ :flag-assert #x3200000070 ;; field nav-mesh-flag is likely a value type. (:methods - (nav-mesh-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) - (nav-mesh-method-10 () none) ;; 10 ;; (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly) - (nav-mesh-method-11 () none) ;; 11 ;; (poly-centroid (_type_ nav-poly vector) vector) - (nav-mesh-method-12 () none) ;; 12 ;; (poly-centroid-local (_type_ nav-poly vector) vector) - (nav-mesh-method-13 () none) ;; 13 ;; (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly) - (nav-mesh-method-14 () none) ;; 14 ;; (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex)) - (nav-mesh-method-15 () none) ;; 15 ;; (initialize-mesh! (_type_) none) - (nav-mesh-method-16 () none) ;; 16 - (nav-mesh-method-17 () none) ;; 17 ;; (try-move-along-ray (_type_ nav-poly vector vector float) meters) - (advance-ray-to-nearest-poly-edge-or-dest! (_type_ nav-ray) none) ;; 18 ;; (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) - (nav-mesh-method-19 () none) ;; 19 ;; (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) - (nav-mesh-method-20 () none) ;; 20 ;; (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none) - (nav-mesh-method-21 () none) ;; 21 ;; (find-adjacent-bounds-one (_type_ vector nav-poly int int) none) - (nav-mesh-method-22 () none) ;; 22 - (nav-mesh-method-23 () none) ;; 23 ;; (init-from-entity (_type_ entity-nav-mesh) none) - (compute-bounding-box-from-vertices (_type_ vector vector) none) ;; 24 ;; (handle-birth (_type_) none) - (nav-mesh-method-25 () none) ;; 25 ;; (handle-kill (_type_) none) - (nav-mesh-method-26 () none) ;; 26 ;; (update-navigation (_type_) none) - (nav-mesh-method-27 () none) ;; 27 ;; (new-nav-control (_type_ process-drawable) nav-control) - (nav-mesh-method-28 () none) ;; 28 ;; (remove-nav-control (_type_ nav-control) none) - (nav-mesh-method-29 () none) ;; 29 ;; (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none) - (nav-mesh-method-30 () none) ;; 30 ;; (remove-process-drawable (_type_ process-drawable) none) - (nav-mesh-method-31 () none) ;; 31 ;; (change-to (_type_ process-drawable) none) - (nav-mesh-method-32 () none) ;; 32 ;; (link-by-id (_type_ uint) symbol) - (nav-mesh-method-33 () none) ;; 33 ;; (unlink-by-id (_type_ uint) symbol) - (nav-mesh-method-34 () none) ;; 34 ;; (nav-mesh-method-34 (_type_ vector vector float) float) - (nav-mesh-method-35 () none) ;; 35 ;; (nav-mesh-method-35 (_type_ vector vector float) float) - (nav-mesh-method-36 () none) ;; 36 ;; (debug-draw-poly (_type_ nav-poly rgba) none) - (nav-mesh-method-37 () none) ;; 37 ; - (nav-mesh-method-38 () none) ;; 38 ;; (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector) - (nav-mesh-method-39 () none) ;; 39 - (point-in-poly? "Check if a point is inside a poly of this mesh" (_type_ nav-poly vector) symbol) ;; 40 ;; (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none) - (nav-mesh-method-41 () none) ;; 41 + (debug-draw (_type_) none) ;; 9 + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly) ;; 10 + (nav-mesh-method-11 (_type_ vector) none) ;; 11 + (nav-mesh-method-12 (_type_ vector float nav-poly) symbol) ;; 12 + (poly-centroid (_type_ nav-poly vector) vector) ;; 13 + (poly-centroid-local (_type_ nav-poly vector) vector) ;; 14 + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly) ;; 15 + (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex)) ;; 16 + (initialize-mesh! (_type_) none) ;; 17 + (advance-ray-to-nearest-poly-edge-or-dest! (_type_ nav-ray) none) ;; 18 + (try-move-along-ray (_type_ nav-poly vector vector float) meters) ;; 19 + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) ;; 20 + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) ;; 21 + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none) ;; 22 + (find-adjacent-bounds-one (_type_ vector nav-poly int int) none) ;; 23 + (compute-bounding-box-from-vertices (_type_ vector vector) none) ;; 24 + (init-from-entity (_type_ entity-nav-mesh) none) ;; 25 + (handle-birth (_type_) none) ;; 26 + (handle-kill (_type_) none) ;; 27 + (update-navigation (_type_) none) ;; 28 + (new-nav-control (_type_) nav-control) ;; 29 + (remove-nav-control (_type_ nav-control) none) ;; 30 + (add-process-drawable-to-nav-mesh (_type_ process-drawable symbol) none) ;; 31 + (remove-process-drawable (_type_ process-drawable) none) ;; 32 + (change-to (_type_ process-drawable) none) ;; 33 + (link-by-id (_type_ uint) symbol) ;; 34 + (unlink-by-id (_type_ uint) symbol) ;; 35 + (nav-mesh-method-36 (_type_ vector vector float) float) ;; 36 + (nav-mesh-method-37 (_type_ vector vector float) float) ;; 37 + (nav-mesh-method-38 (_type_ nav-poly) none) ;; 38 + (debug-draw-poly (_type_ nav-poly rgba) none) ;; 39 + (point-in-poly? "Check if a point is inside a poly of this mesh" (_type_ nav-poly vector) symbol) ;; 40 + (nav-mesh-method-41 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector) ;; 41 (closest-point-on-boundary "Find the point on the polygon edge that is closest to the query point." (_type_ nav-poly vector vector) vector) ;; 42 ;; (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly) - (nav-mesh-method-43 () none) ;; 43 ;; (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms) - (project-point-into-poly-2d "Find the point in the polygon closest to the query point." (_type_ nav-poly vector vector) vector) ;; 44 ;; (is-in-mesh-local? (_type_ vector float float) symbol) - (nav-mesh-method-45 () none) ;; 45 ;; (link-to-other-mesh (_type_ nav-mesh-link) symbol) - (nav-mesh-method-46 () none) ;; 46 ;; (unlink-mesh (_type_ nav-mesh-link) none) - (nav-mesh-method-47 () none) ;; 47 - (nav-mesh-method-48 () none) ;; 48 - (nav-mesh-method-49 () none) ;; 49 + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none) ;; 43 ;; (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms) + (project-point-into-poly-2d "Find the point in the polygon closest to the query point." (_type_ nav-poly vector vector) vector) ;; 44 + (nav-mesh-method-45 (_type_ nav-poly) nav-poly) ;; 45 + (nav-mesh-method-46 (_type_ nav-poly) nav-poly) ;; 46 + (is-in-mesh-local? (_type_ vector float float) symbol) ;; 47 + (link-to-other-mesh (_type_ nav-mesh-link) symbol) ;; 48 + (unlink-mesh (_type_ nav-mesh-link) none) ;; 49 ) ) @@ -28310,53 +28392,53 @@ :size-assert #xb0 :flag-assert #x38000000b0 (:methods - (nav-state-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) - (nav-state-method-10 () none) ;; 10 ;; (nav-state-method-10 (_type_) none) - (nav-state-method-11 () none) ;; 11 ;; (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol) - (nav-state-method-12 () none) ;; 12 ;; (get-velocity (_type_ vector) vector) - (nav-state-method-13 () none) ;; 13 ;; (get-travel (_type_ vector) vector) - (nav-state-method-14 () none) ;; 14 ;; (get-heading (_type_ vector) vector) - (nav-state-method-15 () none) ;; 15 ;; (get-target-post (_type_ vector) vector) - (nav-state-method-16 () none) ;; 16 ;; (get-speed (_type_) meters) - (nav-state-method-17 () none) ;; 17 ;; (get-rotation-rate (_type_) float) - (nav-state-method-18 () none) ;; 18 ;; (try-projecting-to-current-poly (_type_ vector object vector) symbol) - (nav-state-method-19 () none) ;; 19 ;; (get-current-poly (_type_) nav-poly) - (nav-state-method-20 () none) ;; 20 ;; (copy-nav-state! (_type_ (pointer nav-state)) none) - (nav-state-method-21 () none) ;; 21 ;; (nav-state-method-21 () none) - (nav-state-method-22 () none) ;; 22 ;; (nav-state-method-22 () none) - (nav-state-method-23 () none) ;; 23 ;; (nav-state-method-23 () none) - (nav-state-method-24 () none) ;; 24 ;; (turn-and-navigate-to-destination (_type_) none) - (nav-state-method-25 () none) ;; 25 ;; (navigate-using-route-portals-wrapper (_type_) none) - (nav-state-method-26 () none) ;; 26 ;; (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none) - (nav-state-method-27 () none) ;; 27 ;; (navigate-within-poly-wrapper (_type_) none) - (nav-state-method-28 () none) ;; 28 ;; (compute-travel-speed (_type_) none) - (nav-state-method-29 () none) ;; 29 ;; (nav-state-method-29 (_type_) none) - (nav-state-method-30 () none) ;; 30 ;; (nav-state-method-30 (_type_) none) - (nav-state-method-31 () none) ;; 31 ;; (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none) - (nav-state-method-32 () none) ;; 32 ;; (update-travel-dir-from-spheres (_type_) none) - (nav-state-method-33 () none) ;; 33 ;; (compute-speed-simple (_type_) none) + (debug-draw (_type_) none) ;; 9 + (nav-state-method-10 (_type_) none) ;; 10 + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol) ;; 11 + (get-velocity (_type_ vector) vector) ;; 12 + (get-travel (_type_ vector) vector) ;; 13 + (get-heading (_type_ vector) vector) ;; 14 + (get-target-pos (_type_ vector) vector) ;; 15 + (get-speed (_type_) meters) ;; 16 + (get-rotation-rate (_type_) float) ;; 17 + (try-projecting-to-current-poly (_type_ vector vector vector) symbol) ;; 18 + (get-current-poly (_type_) nav-poly) ;; 19 + (copy-nav-state! (_type_ (pointer nav-state)) none) ;; 20 + (nav-state-method-21 () none) ;; 21 + (nav-state-method-22 () none) ;; 22 + (nav-state-method-23 () none) ;; 23 + (turn-and-navigate-to-destination (_type_) none) ;; 24 + (navigate-using-route-portals-wrapper (_type_) none) ;; 25 + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none) ;; 26 + (navigate-within-poly-wrapper (_type_) none) ;; 27 + (compute-travel-speed (_type_) none) ;; 28 + (nav-state-method-29 (_type_) none) ;; 29 + (nav-state-method-30 (_type_) none) ;; 30 + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none) ;; 31 + (update-travel-dir-from-spheres (_type_) none) ;; 32 + (compute-speed-simple (_type_) none) ;; 33 (navigate-v1! (_type_) none) ;; 34 - (nav-state-method-35 () none) ;; 35 ;; (reset-target! (_type_) none) - (nav-state-method-36 () none) ;; 36 ;; (add-offset-to-target! (_type_ vector) none) - (nav-state-method-37 () none) ;; 37 ;; (navigate-v2! (_type_) none) - (nav-state-method-38 () none) ;; 38 ;; (set-current-poly! (_type_ nav-poly) none) - (nav-state-method-39 () none) ;; 39 ;; (nav-state-method-39 (_type_) symbol) + (reset-target! (_type_) none) ;; 35 + (add-offset-to-target! (_type_ vector) none) ;; 36 + (navigate-v2! (_type_) none) ;; 37 + (set-current-poly! (_type_ nav-poly) none) ;; 38 + (nav-state-method-39 (_type_) symbol) ;; 39 (do-navigation-to-destination (_type_ vector) none) ;; 40 - (nav-state-method-41 () none) ;; 41 ;; (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol) - (nav-state-method-42 () none) ;; 42 ;; (set-target-post! (_type_ vector) none) - (nav-state-method-43 () none) ;; 43 ;; (set-travel! (_type_ vector) none) - (nav-state-method-44 () none) ;; 44 ;; (set-velocity! (_type_ vector) none) - (nav-state-method-45 () none) ;; 45 ;; (set-heading! (_type_ vector) none) - (nav-state-method-46 () none) ;; 46 ;; (set-speed! (_type_ meters) none) - (nav-state-method-47 () none) ;; 47 ;; (reset! (_type_ nav-control) none) - (nav-state-method-48 () none) ;; 48 ;; (nav-state-method-48 () none) - (nav-state-method-49 () none) ;; 49 ;; (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none) - (nav-state-method-50 () none) ;; 50 ;; (nav-state-method-50 (_type_) none) - (nav-state-method-51 () none) ;; 51 ;; (navigate-using-route-portals (_type_) none) - (nav-state-method-52 () none) ;; 52 ;; (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none) - (nav-state-method-53 () none) ;; 53 ;; (navigate-within-poly (_type_) none) - (nav-state-method-54 () none) ;; 54 ;; (clamp-travel-vector (_type_) none) - (nav-state-method-55 () none) ;; 55 + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol) ;; 41 + (set-target-pos! (_type_ vector) none) ;; 42 + (set-virtual-cur-pos! (_type_ vector) none) ;; 43 + (set-travel! (_type_ vector) none) ;; 44 + (set-velocity! (_type_ vector) none) ;; 45 + (set-heading! (_type_ vector) none) ;; 46 + (set-speed! (_type_ meters) none) ;; 47 + (reset! (_type_ nav-control) none) ;; 48 + (nav-state-method-49 () none) ;; 49 + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none) ;; 50 ;; (nav-state-method-50 (_type_) none) + (nav-state-method-51 (_type_) none) ;; 51 + (navigate-using-route-portals (_type_) none) ;; 52 + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none) ;; 53 + (navigate-within-poly (_type_) none) ;; 54 + (clamp-travel-vector (_type_) none) ;; 55 ) ) @@ -28391,43 +28473,43 @@ :flag-assert #x2f00000120 (:methods (debug-draw (_type_) none) ;; 9 - (nav-control-method-10 () none) ;; 10 ;; (point-in-bsphere? (_type_ vector) symbol) + (point-in-bsphere? (_type_ vector) symbol) ;; 10 (find-poly-containing-point-1 (_type_ vector) nav-poly) ;; 11 - (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) ;; 12 - (nav-control-method-13 () none) ;; 13 ;; (find-nearest-poly-to-point (_type_ vector) nav-poly) - (nav-control-method-14 () none) ;; 14 ;; (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none) - (nav-control-method-15 () none) ;; 15 ;; (find-poly-containing-point-2 (_type_ vector) nav-poly) - (nav-control-method-16 () none) ;; 16 ;; (is-above-poly-max-height? (_type_ vector float) symbol) - (nav-control-method-17 () none) ;; 17 ;; (is-in-mesh? (_type_ vector float) symbol) - (nav-control-method-18 () none) ;; 18 ;; (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol) - (nav-control-method-19 () none) ;; 19 ;; (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol) - (nav-control-method-20 () none) ;; 20 ;; (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) - (nav-control-method-21 () none) ;; 21 ;; (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) - (nav-control-method-22 () none) ;; 22 ;; (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) - (nav-control-method-23 () none) ;; 23 ;; (set-spheres-from-nav-ids (_type_) none) - (nav-control-method-24 () none) ;; 24 ;; (add-root-sphere-to-hash! (_type_ vector int) symbol) - (nav-control-method-25 () none) ;; 25 ;; (get-max-rotation-rate (_type_) float) - (nav-control-method-26 () none) ;; 26 ;; (get-sphere-mask (_type_) uint) - (nav-control-method-27 () none) ;; 27 ;; (get-target-speed (_type_) meters) - (nav-control-method-28 () none) ;; 28 ;; (enable-extra-sphere! (_type_) none) - (nav-control-method-29 () none) ;; 29 ;; (disable-extra-sphere! (_type_) none) - (nav-control-method-30 () none) ;; 30 ;; (copy-extra-nav-sphere! (_type_ sphere) none) - (nav-control-method-31 () none) ;; 31 ;; (set-extra-nav-sphere-xyz! (_type_ sphere) none) - (nav-control-method-32 () none) ;; 32 ;; (set-extra-nav-sphere-radius! (_type_ float) none) - (nav-control-method-33 () none) ;; 33 ;; (set-nearest-y-thres! (_type_ float) none) - (nav-control-method-34 () none) ;; 34 ;; (set-nav-cull-radius! (_type_ meters) none) - (nav-control-method-35 () none) ;; 35 ;; (set-speed-scale! (_type_ float) none) - (nav-control-method-36 () none) ;; 36 ;; (set-target-speed! (_type_ meters) none) - (nav-control-method-37 () none) ;; 37 ;; (set-acceleration! (_type_ meters) none) - (nav-control-method-38 () none) ;; 38 ;; (set-turning-acceleration! (_type_ meters) none) - (nav-control-method-39 () none) ;; 39 ;; (set-max-rotation-rate! (_type_ float) none) - (nav-control-method-40 () none) ;; 40 ;; (set-sphere-mask! (_type_ uint) none) - (nav-control-method-41 () none) ;; 41 ;; (remove! (_type_) none) - (nav-control-method-42 () none) ;; 42 ;; (init! (_type_ collide-shape) none) - (nav-control-method-43 () none) ;; 43 ;; (display-marks? (_type_) symbol) - (nav-control-method-44 () none) ;; 44 ;; (nav-control-method-44 () none) - (nav-control-method-45 () none) ;; 45 ;; (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere) - (nav-control-method-46 () none) ;; 46 ;; (find-sphere-ids-from-sphere-hash (_type_ symbol) none) + (closest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) ;; 12 + (find-nearest-poly-to-point (_type_ vector) nav-poly) ;; 13 + (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none) ;; 14 + (find-poly-containing-point-2 (_type_ vector) nav-poly) ;; 15 + (is-above-poly-max-height? (_type_ vector float) symbol) ;; 16 + (is-in-mesh? (_type_ vector float) symbol) ;; 17 + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol) ;; 18 + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol) ;; 19 + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) ;; 20 + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) ;; 21 + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) ;; 22 + (set-spheres-from-nav-ids (_type_) none) ;; 23 + (add-root-sphere-to-hash! (_type_ vector int) symbol) ;; 24 + (get-max-rotation-rate (_type_) float) ;; 25 + (get-sphere-mask (_type_) uint) ;; 26 + (get-target-speed (_type_) meters) ;; 27 + (enable-extra-sphere! (_type_) none) ;; 28 + (disable-extra-sphere! (_type_) none) ;; 29 + (copy-extra-nav-sphere! (_type_ sphere) none) ;; 30 + (set-extra-nav-sphere-xyz! (_type_ sphere) none) ;; 31 + (set-extra-nav-sphere-radius! (_type_ float) none) ;; 32 + (set-nearest-y-thres! (_type_ float) none) ;; 33 + (set-nav-cull-radius! (_type_ meters) none) ;; 34 + (set-speed-scale! (_type_ float) none) ;; 35 + (set-target-speed! (_type_ meters) none) ;; 36 + (set-acceleration! (_type_ meters) none) ;; 37 + (set-turning-acceleration! (_type_ meters) none) ;; 38 + (set-max-rotation-rate! (_type_ float) none) ;; 39 + (set-sphere-mask! (_type_ uint) none) ;; 40 + (remove! (_type_) none) ;; 41 + (init! (_type_ collide-shape) none) ;; 42 + (display-marks? (_type_) symbol) ;; 43 + (nav-control-method-44 () none) ;; 44 + (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere) ;; 45 + (find-sphere-ids-from-sphere-hash (_type_ symbol) none) ;; 46 ) ) @@ -28513,6 +28595,34 @@ :flag-assert #x900000020 ) +(deftype nav-stack-type (structure) + "nav-mesh::12" + ((nav-id-params find-nav-sphere-ids-params :inline :offset 0) + (vec1 vector :inline :offset 32) + (vec2 vector :inline :offset 48) + (vec3 vector :inline :offset 64) + (byte01 int8 :offset 64) + (byte02 int8 :offset 65) + (byte03 int8 :offset 66) + (byte04 int8 :offset 67) + (vec4 vector :inline :offset 80) + (vec5 vector :inline :offset 96) + (vec6 vector :inline :offset 112) + (byte-arr uint8 20 :offset 128) + ) + ) + +(deftype nav-stack-type2 (structure) + "nav-mesh::25" + ((float00 float :offset 0) + (float01 float :offset 8) + (word00 int32 :offset 16) + (word01 int32 :offset 20) + (word02 int32 :offset 24) + (word03 int32 :offset 28) + ) + ) + (deftype sphere-hash (grid-hash) "An extension of grid hash that holds spheres inside of the grid." ((sphere-array (inline-array sphere) :offset-assert 88) ;; guessed by decompiler @@ -28530,8 +28640,8 @@ (add-a-sphere (_type_ vector) int) ;; 26 (add-a-sphere-with-flag (_type_ vector int) int) ;; 27 (update-from-spheres (_type_) none) ;; 28 - (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none) ;; 29 - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none) ;; 30 + (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) ;; 29 + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) ;; 30 (add-sphere-with-mask-and-id (_type_ vector int int) symbol) ;; 31 (sphere-hash-method-32 (_type_ sphere int) symbol) ;; 32 ) @@ -28806,11 +28916,11 @@ (disable-physics! (_type_) none) ;; 41 (rigid-body-object-method-42 (_type_) none) ;; 42 (rigid-body-object-method-43 (_type_) none) ;; 43 - (impulse-handler (_type_) none) ;; 44 ;; (apply-damage (_type_ float rigid-body-impact) none) + (impulse-handler (_type_) none) ;; 44 (go-active (_type_) object) ;; 45 - (rigid-body-object-method-46 (_type_) none) ;; 46 + (apply-damage (_type_ float rigid-body-impact) none) ;; 46 (impulse-force<-penetrate (_type_ rigid-body-impact attack-info penetrate) none) ;; 47 - (rigid-body-object-method-48 (_type_) none) ;; 48 + (on-impact (_type_ rigid-body-impact) none) ;; 48 (rbody-event-handler (_type_ process int symbol event-message-block) object) ;; 49 (attack-handler (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol) ;; 50 (touch-handler (_type_ process-focusable touching-shapes-entry) symbol) ;; 51 @@ -28832,7 +28942,7 @@ (:methods (init-queue! (_type_ process) none) ;; 9 (rigid-body-queue-method-10 (_type_) none) ;; 10 ;; (rigid-body-queue-method-10 (_type_) none) - (rigid-body-queue-method-11 (_type_ process int) none) ;; 11 ;; (rigid-body-queue-method-11 (_type_ rigid-body-object) none) + (rigid-body-queue-method-11 (_type_ process) none) ;; 11 ;; (rigid-body-queue-method-11 (_type_ rigid-body-object) none) (rigid-body-queue-method-12 (_type_ int int) none) ;; 12 ;; (rigid-body-queue-method-12 (_type_ int int) none) (rigid-body-queue-method-13 (_type_ int process) none) ;; 13 ;; (rigid-body-queue-method-13 (_type_ int rigid-body-object) none) (rigid-body-queue-method-14 (_type_ int) none) ;; 14 ;; (rigid-body-queue-method-14 (_type_ int) none) @@ -31005,7 +31115,7 @@ (define-extern sparticle-2d-spline-align (function object sparticle-cpuinfo sprite-vec-data-2d object none)) (define-extern sparticle-2d-spline-align-instant (function object sparticle-cpuinfo sprite-vec-data-2d none)) (define-extern birth-func-inherit-size (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) -(define-extern birth-func-texture-group-2d (function object sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-texture-group-2d (function object sparticle-cpuinfo sparticle-launchinfo object object none)) (define-extern birth-func-set-vel-2d (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) (define-extern sparticle-3d-rotate-xz-to-camera (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none)) (define-extern spt-func-relative-pos (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none)) @@ -32490,15 +32600,15 @@ ;; merc-death ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *merc-death-globals* object) ;; vector -;; (define-extern birth-func-death-sparks function) ;; (function none) -;; (define-extern death-seed death-info) ;; death-info -;; (define-extern start-seed-effect function) ;; (function process-drawable vector cspace none) -;; (define-extern death-default death-info) ;; death-info -;; (define-extern death-warp-in death-info) ;; death-info -;; (define-extern death-warp-out death-info) ;; death-info -;; (define-extern sparticle-texture-glow-soft function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern merc-death-spawn function) ;; (function int vector vector none) +(define-extern *merc-death-globals* vector) +(define-extern birth-func-death-sparks (function none)) +(define-extern death-seed death-info) +(define-extern start-seed-effect (function process-drawable vector cspace none)) +(define-extern death-default death-info) +(define-extern death-warp-in death-info) +(define-extern death-warp-out death-info) +(define-extern sparticle-texture-glow-soft (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern merc-death-spawn (function int vector vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; water-h ;; @@ -34353,20 +34463,20 @@ :size-assert #x74 :flag-assert #x1700000074 (:methods - (lightning-bolt-method-9 (_type_ int int lightning-appearance) none) ;; 9 - (lightning-bolt-method-10 () none) ;; 10 + (init! (_type_ int int lightning-appearance) none) ;; 9 + (reset-spans! (_type_) none) ;; 10 (lightning-bolt-method-11 (_type_) none) ;; 11 (lightning-bolt-method-12 (_type_) none) ;; 12 (lightning-bolt-method-13 (_type_ int) none) ;; 13 (lightning-bolt-method-14 (_type_) int) ;; 14 - (lightning-bolt-method-15 () none) ;; 15 - (lightning-bolt-method-16 () none) ;; 16 - (lightning-bolt-method-17 () none) ;; 17 - (lightning-bolt-method-18 () none) ;; 18 - (lightning-bolt-method-19 () none) ;; 19 - (lightning-bolt-method-20 () none) ;; 20 - (lightning-bolt-method-21 () none) ;; 21 - (lightning-bolt-method-22 () none) ;; 22 + (lightning-bolt-method-15 (_type_ object int lightning-span-internal) none) ;; 15 + (lightning-bolt-method-16 (_type_ vector float float vector matrix) none) ;; 16 + (lightning-bolt-method-17 (_type_ uint float float curve2d-fast float) float) ;; 17 + (lightning-bolt-method-18 (_type_ prim-strip vector rgba float float) none) ;; 18 + (lightning-bolt-method-19 (_type_ vector int int matrix float float) none) ;; 19 + (lightning-bolt-method-20 (_type_ int lightning-span-internal) vector) ;; 20 + (lightning-bolt-method-21 (_type_ int int float) none) ;; 21 + (lightning-bolt-method-22 (_type_) none) ;; 22 ) ) @@ -34378,9 +34488,9 @@ :method-count-assert 16 :size-assert #x98 :flag-assert #x1000200098 - (:methods - (lightning-new-tracker-method-14 () none) ;; 14 - (lightning-new-tracker-method-15 () none) ;; 15 + (:state-methods + active ;; 14 + die ;; 15 ) ) @@ -34455,13 +34565,13 @@ ;; lightning-new ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *lightning-alpha-additive* object) -;; (define-extern *lightning-alpha-blend* object) -;; (define-extern *lightning-alpha-subtractive* object) -;; (define-extern matrix<-vector-yz2! function) -;; (define-extern choose-nice-perp function) -;; (define-extern lightning-new-tracker-init-by-other function) -;; (define-extern create-lightning-tracker-new function) +(define-extern *lightning-alpha-additive* gs-alpha) +(define-extern *lightning-alpha-blend* gs-alpha) +(define-extern *lightning-alpha-subtractive* gs-alpha) +(define-extern matrix<-vector-yz2! (function matrix vector vector matrix)) +(define-extern choose-nice-perp (function vector vector)) +(define-extern lightning-new-tracker-init-by-other (function lightning-tracker-init-params object :behavior lightning-new-tracker)) +(define-extern create-lightning-tracker-new (function lightning-tracker-init-params lightning-new-tracker)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; carry-h ;; @@ -37472,25 +37582,23 @@ ;; nav-engine ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-engine-spr-buffer (structure) ((mem-addr (pointer nav-mesh) :offset-assert 0) ;; guessed by decompiler - (mem-nav uint32 :offset-assert 0) + (mem-nav uint32 :offset 0) (spr-addr (inline-array nav-control) :offset-assert 4) ;; guessed by decompiler - (spr-nav uint32 :offset-assert 4) + (spr-nav uint32 :offset 4) (q-size uint32 :offset-assert 8) (i-nav uint8 :offset-assert 12) (done int8 :offset-assert 13) (nav-count int8 :offset-assert 14) (i-pass int8 :offset-assert 15) ) + :pack-me :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype nav-engine (structure) ((spr-addr uint32 :offset-assert 0) (nav-work-addr uint32 :offset-assert 4) @@ -37501,15 +37609,15 @@ (buf-nav-control-count int8 :offset-assert 24) (max-pass-count int8 :offset-assert 25) (output-sphere-hash uint8 :offset-assert 26) - (work-buf-array nav-engine-spr-buffer 3 :offset-assert 28) ;; guessed by decompiler - (spr-work nav-mesh-work :offset-assert 4) + (work-buf-array nav-engine-spr-buffer 3 :inline :offset-assert 28) ;; guessed by decompiler + (spr-work nav-mesh-work :offset 4) (mem-work nav-mesh-work :offset-assert 76) - (spr-mesh nav-mesh :offset-assert 8) ;; guessed by decompiler + (spr-mesh nav-mesh :offset 8) ;; guessed by decompiler (mem-mesh nav-mesh :offset-assert 80) ;; guessed by decompiler - (spr-poly-array uint32 :offset-assert 12) + (spr-poly-array uint32 :offset 12) (mem-poly-array (inline-array nav-poly) :offset-assert 84) ;; guessed by decompiler - (hash-sphere-list uint32 :offset-assert 16) - (hash-buckets uint32 :offset-assert 20) + (hash-sphere-list uint32 :offset 16) + (hash-buckets uint32 :offset 20) (to-spr-wait uint32 :offset-assert 88) (from-spr-wait uint32 :offset-assert 92) ) @@ -37517,81 +37625,77 @@ :size-assert #x60 :flag-assert #x1600000060 (:methods - (nav-engine-method-9 () none) ;; 9 ;; (inc-spr-addr! (_type_ uint) uint) - (nav-engine-method-10 () none) ;; 10 ;; (lay-out-spad-memory (_type_ nav-mesh) none) - (nav-engine-method-11 () none) ;; 11 ;; (set-up-mem-work (_type_) none) - (nav-engine-method-12 () none) ;; 12 ;; (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none) - (nav-engine-method-13 () none) ;; 13 ;; (add-all-spheres (_type_) none) - (nav-engine-method-14 () none) ;; 14 ;; (do-sphere-lookups (_type_) none) - (nav-engine-method-15 () none) ;; 15 ;; (update-nav-controls-pipelined-in-spr (_type_) none) - (nav-engine-method-16 () none) ;; 16 ;; (update-nav-controls-in-spr (_type_) none) - (nav-engine-method-17 () none) ;; 17 ;; (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none) - (nav-engine-method-18 () none) ;; 18 ;; (download-nav-from-spr (_type_ nav-engine-spr-buffer) none) - (nav-engine-method-19 () none) ;; 19 ;; (do-callbacks (_type_ nav-engine-spr-buffer) none) - (nav-engine-method-20 () none) ;; 20 ;; (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none) - (nav-engine-method-21 () none) ;; 21 ;; (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none) + (inc-spr-addr! (_type_ uint) uint) ;; 9 + (lay-out-spad-memory (_type_ nav-mesh) none) ;; 10 + (set-up-mem-work (_type_) none) ;; 11 + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none) ;; 12 + (add-all-spheres (_type_) none) ;; 13 + (do-sphere-lookups (_type_) none) ;; 14 + (update-nav-controls-pipelined-in-spr (_type_) none) ;; 15 + (update-nav-controls-in-spr (_type_) none) ;; 16 + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none) ;; 17 + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none) ;; 18 + (do-callbacks (_type_ nav-engine-spr-buffer) none) ;; 19 + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none) ;; 20 + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none) ;; 21 ) ) -|# -;; (define-extern nav-dma-send-to-spr-no-flush function) ;; (function pointer pointer int none) -;; (define-extern nav-dma-send-from-spr-no-flush function) ;; (function pointer pointer int none) -;; (define-extern inc-mod3 function) ;; (function int int) -;; (define-extern nav-state-patch-pointers function) ;; (function nav-state int none) +(define-extern nav-dma-send-to-spr-no-flush (function pointer pointer int none)) +(define-extern nav-dma-send-from-spr-no-flush (function pointer pointer int none)) +(define-extern inc-mod3 (function int int)) +(define-extern nav-state-patch-pointers (function nav-state int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-mesh ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-find-clear-spot-work (structure) - ((id-array UNKNOWN 16 :offset-assert 0) - (sphere-array UNKNOWN 16 :offset-assert 16) + ((id-array int8 16 :offset-assert 0) + (sphere-array sphere 16 :inline :offset-assert 16) ) :method-count-assert 9 :size-assert #x110 :flag-assert #x900000110 ) -|# -;; (define-extern *debug-nav-control-output* object) ;; symbol -;; (define-extern *debug-nav-control* object) ;; symbol -;; (define-extern *debug-nav-mesh-output* object) ;; symbol -;; (define-extern *debug-nav-ray* object) ;; nav-ray -;; (define-extern *debug-ray-offset* object) ;; vector -;; (define-extern *debug-offset* object) ;; vector -;; (define-extern *nav-mesh-work* object) ;; nav-mesh-work -;; (define-extern *default-nav-mesh* nav-mesh) ;; nav-mesh +(define-extern *debug-nav-control-output* symbol) +(define-extern *debug-nav-control* symbol) +(define-extern *debug-nav-mesh-output* symbol) +(define-extern *debug-nav-ray* nav-ray) +(define-extern *debug-ray-offset* vector) +(define-extern *debug-offset* vector) +(define-extern *nav-mesh-work* nav-mesh-work) +(define-extern *default-nav-mesh* nav-mesh) (define-extern nav-mesh-connect-from-ent (function process-drawable symbol)) -;; (define-extern connection-validate function) ;; (function connection none) -;; (define-extern connection-list-validate function) ;; (function (inline-array connection) symbol) -;; (define-extern nav-control-validate function) ;; (function process-drawable none) -;; (define-extern debug-validate-nav-poly function) ;; (function nav-mesh-link nav-poly none) -;; (define-extern vu-point-triangle-intersection? function) ;; (function vector vector vector vector symbol) -;; (define-extern poly-in-height-range? function) ;; (function nav-poly float float symbol) -;; (define-extern init-ray-local function) ;; (function nav-ray nav-poly vector vector none) -;; (define-extern init-ray-dir-local function) ;; (function nav-ray nav-poly vector vector float none) -;; (define-extern nav-ray-test function) ;; (function nav-mesh nav-poly vector vector meters) -;; (define-extern point-poly-distance-min function) ;; (function nav-mesh-work nav-poly float nav-poly float) -;; (define-extern nav-mesh-route-table-bit-index function) ;; (function nav-mesh uint int int) -;; (define-extern ray-ccw-line-segment-intersection? function) ;; (function vector vector vector vector symbol) -;; (define-extern ray-line-segment-intersection? function) ;; (function vector vector vector vector symbol) -;; (define-extern plane-height-at-xz-point function) ;; (function plane vector float) -;; (define-extern nav-normal-from-3-points function) ;; (function vector vector vector vector none) +(define-extern connection-validate (function connection none)) +(define-extern connection-list-validate (function (inline-array connection) symbol)) +(define-extern nav-control-validate (function process-drawable none)) +(define-extern debug-validate-nav-poly (function nav-mesh-link nav-poly none)) +(define-extern vu-point-triangle-intersection? (function vector vector vector vector symbol)) +(define-extern poly-in-height-range? (function nav-poly float float symbol)) +(define-extern init-ray-local (function nav-ray nav-poly vector vector none)) +(define-extern init-ray-dir-local (function nav-ray nav-poly vector vector float none)) +(define-extern nav-ray-test (function nav-mesh nav-poly vector vector meters)) +(define-extern point-poly-distance-min (function nav-mesh-work nav-poly float nav-poly float)) +(define-extern nav-mesh-route-table-bit-index (function nav-mesh uint int int)) +(define-extern ray-ccw-line-segment-intersection? (function vector vector vector vector symbol)) +(define-extern ray-line-segment-intersection? (function vector vector vector vector symbol)) +(define-extern plane-height-at-xz-point (function plane vector float)) +(define-extern nav-normal-from-3-points (function vector vector vector vector none)) (define-extern get-nav-mesh (function actor-id nav-mesh)) (define-extern find-nearest-nav-mesh (function vector float nav-mesh)) -;; (define-extern point-to-poly-boundary function) ;; (function nav-poly vector vector float) +(define-extern point-to-poly-boundary (function nav-poly vector vector float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-control-cfs-work (structure) ((in-dir vector :inline :offset-assert 0) (right-dir vector :inline :offset-assert 16) - (best-dir vector 2 :offset-assert 32) ;; guessed by decompiler - (temp-dir vector 2 :offset-assert 64) ;; guessed by decompiler + (best-dir vector 2 :inline :offset-assert 32) ;; guessed by decompiler + (temp-dir vector 2 :inline :offset-assert 64) ;; guessed by decompiler (away-dir vector :inline :offset-assert 96) (best-dir-angle degrees 2 :offset-assert 112) ;; guessed by decompiler (ignore-mask uint64 :offset-assert 120) @@ -37612,24 +37716,23 @@ :size-assert #xc0 :flag-assert #x9000000c0 ) -|# -;; (define-extern *nav-triangle-test-count* object) ;; int -;; (define-extern *nav-last-triangle-test-count* object) ;; int -;; (define-extern debug-nav-validate-current-poly function) ;; (function nav-mesh nav-poly vector symbol) -;; (define-extern debug-report-nav-stats function) ;; (function none) -;; (define-extern get-nav-control function) ;; (function process-drawable nav-mesh none) -;; (define-extern add-nav-sphere function) ;; (function nav-control sphere int none) -;; (define-extern add-collide-shape-spheres function) ;; (function nav-control collide-shape sphere none) -;; (define-extern circle-tangent-directions function) ;; (function vector vector vector vector vector) -;; (define-extern circle-ray-intersection? function) ;; (function vector vector float vector symbol) -;; (define-extern find-closest-circle-ray-intersection function) ;; (function vector vector float int (inline-array vector) int int) -;; (define-extern compute-dir-parm function) ;; (function vector vector vector float) -;; (define-extern vector-rotate-y-sincos! function) ;; (function vector vector float float float) -;; (define-extern test-xz-point-on-line-segment? function) ;; (function vector vector vector float symbol) -;; (define-extern *null-nav-callback-info* object) -;; (define-extern *default-nav-callback-info* object) -;; (define-extern *physics-nav-callback-info* object) +(define-extern *nav-triangle-test-count* int) +(define-extern *nav-last-triangle-test-count* int) +(define-extern debug-nav-validate-current-poly (function nav-mesh nav-poly vector symbol)) +(define-extern debug-report-nav-stats (function none)) +(define-extern get-nav-control (function process-drawable nav-mesh none)) +(define-extern add-nav-sphere (function nav-control sphere int none)) +(define-extern add-collide-shape-spheres (function nav-control collide-shape sphere none)) +(define-extern circle-tangent-directions (function vector vector vector vector vector)) +(define-extern circle-ray-intersection? (function vector vector float vector symbol)) +(define-extern find-closest-circle-ray-intersection (function vector vector float int (inline-array vector) int int)) +(define-extern compute-dir-parm (function vector vector vector float)) +(define-extern vector-rotate-y-sincos! (function vector vector float float float)) +(define-extern test-xz-point-on-line-segment? (function vector vector vector float symbol)) +(define-extern *null-nav-callback-info* nav-callback-info) +(define-extern *default-nav-callback-info* nav-callback-info) +(define-extern *physics-nav-callback-info* nav-callback-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; aligner ;; @@ -38045,88 +38148,84 @@ ;; task-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype resetter-control (basic) - ((process uint64 :offset-assert 8) - (handle-init-hack basic :offset-assert 8) + ((process handle :offset-assert 8) + (handle-init-hack symbol :offset 8) ) :method-count-assert 13 :size-assert #x10 :flag-assert #xd00000010 (:methods - (resetter-control-method-9 () none) ;; 9 - (resetter-control-method-10 () none) ;; 10 - (resetter-control-method-11 () none) ;; 11 - (resetter-control-method-12 () none) ;; 12 + (check-reset (_type_) object) ;; 9 + (get-resetter (_type_) process) ;; 10 + (spawn-resetter! (_type_ resetter-params game-task-node-info) symbol) ;; 11 + (do-reset (_type_) object) ;; 12 ) ) -|# -#| (deftype resetter (process) ((params resetter-params :inline :offset-assert 128) - (message uint8 :offset-assert 128) - (flags uint16 :offset-assert 130) - (reset-delay uint32 :offset-assert 164) - (task uint8 :offset-assert 168) - (text-message uint32 :offset-assert 172) - (retry resetter-spec :inline :offset-assert 148) - (retry-continue basic :offset-assert 148) - (retry-node uint16 :offset-assert 152) - (retry-reset-mode basic :offset-assert 156) - (fail resetter-spec :inline :offset-assert 132) - (fail-continue basic :offset-assert 132) - (fail-node uint16 :offset-assert 136) - (fail-reset-mode basic :offset-assert 140) - (resetter-id uint32 :offset-assert 176) - (grabbed-player? basic :offset-assert 180) - (grabbed-time uint64 :offset-assert 184) - (dead-player? basic :offset-assert 192) - (retry? basic :offset-assert 196) - (message-id uint32 :offset-assert 200) + (message resetter-message :offset 128) + (flags resetter-flag :offset 130) + (reset-delay uint32 :offset 164 :decomp-as time-frame) + (task game-task :offset 168) + (text-message text-id :offset 172) + (retry resetter-spec :inline :offset 148) + (retry-continue continue-point :offset 148) + (retry-node game-task-node :offset 152) + (retry-reset-mode symbol :offset 156) + (fail resetter-spec :inline :offset 132) + (fail-continue continue-point :offset 132) + (fail-node game-task-node :offset 136) + (fail-reset-mode symbol :offset 140) + (resetter-id text-id :offset 176) + (grabbed-player? symbol :offset 180) + (grabbed-time time-frame :offset-assert 184) + (dead-player? symbol :offset-assert 192) + (retry? symbol :offset-assert 196) + (message-id text-id :offset-assert 200) (stinger uint32 :offset-assert 204) - (start-time uint64 :offset-assert 208) + (start-time time-frame :offset-assert 208) ) :method-count-assert 17 :size-assert #xd8 :flag-assert #x11006000d8 - (:methods - (resetter-method-16 () none) ;; 16 - ) (:state-methods - resetting ;; 15 idle ;; 14 + resetting ;; 15 + ) + (:methods + (resetter-method-16 (_type_) none) ;; 16 ) ) -|# -;; (define-extern *resetter-control* resetter-control) +(define-extern *resetter-control* resetter-control) (define-extern game-task-node->string (function game-task-node string)) -;; (define-extern reset-city-squad-control function) -;; (define-extern city-task-faction-commands function) -;; (define-extern evaluate-faction-commands function) +(define-extern reset-city-squad-control (function symbol none)) +(define-extern city-task-faction-commands (function object)) +(define-extern evaluate-faction-commands (function pair object)) (define-extern update-task-masks (function symbol int)) (define-extern play-clean (function symbol int)) (define-extern play-task (function game-task symbol symbol string)) (define-extern restart-mission (function int)) -;; (define-extern fail-mission function) ;; type -;; (define-extern task-node-by-name function) ;; (function string game-task-node-info) +(define-extern fail-mission (function none)) +(define-extern task-node-by-name (function string game-task-node-info)) (define-extern task-node-index-by-name (function string int)) (define-extern task-resolution-close! (function game-task symbol)) (define-extern task-close! (function string symbol)) -;; (define-extern task-closed? function) ;; (function string symbol) -;; (define-extern open-task-nodes function) ;; (function (array game-task-node-info) (array game-task-node-info)) +(define-extern task-closed? (function string symbol)) +(define-extern open-task-nodes (function (array game-task-node-info) (array game-task-node-info))) (define-extern task-node-closed? (function game-task-node symbol)) -(define-extern task-node-close! (function game-task-node int)) -;; (define-extern task-open? function) +(define-extern task-node-close! (function game-task-node symbol int)) +(define-extern task-open? (function string symbol)) (define-extern task-node-open? (function game-task-node symbol)) (define-extern task-node-open! (function game-task-node symbol int)) -;; (define-extern task-node-close-upwards function) +(define-extern task-node-close-upwards (function (array game-task-node-info) int none)) (define-extern task-node-reset (function symbol int)) -;; (define-extern task-node-dump function) ;; (function symbol symbol) -;; (define-extern resetter-init-by-other function) +(define-extern task-node-dump (function symbol symbol)) +(define-extern resetter-init-by-other (function resetter-params game-task-node-info object :behavior resetter)) (define-extern task-manager-init-by-other (function game-task-node-info symbol object :behavior task-manager)) -;; (define-extern task-manager-event-handler function) ;; (function process int symbol event-message-block object :behavior task-manager) +(define-extern task-manager-event-handler (function process int symbol event-message-block object :behavior task-manager)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; scene ;; @@ -38498,7 +38597,6 @@ ;; minimap ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype minimap-texture-name-array (structure) ((data string 35 :offset-assert 0) ;; guessed by decompiler ) @@ -38506,26 +38604,21 @@ :size-assert #x8c :flag-assert #x90000008c ) -|# -#| (deftype minimap-corner-array (structure) - ((data vector 35 :offset-assert 0) ;; guessed by decompiler + ((data vector 35 :inline :offset-assert 0) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x230 :flag-assert #x900000230 ) -|# -;; engine-minimap is already defined! - -;; (define-extern *minimap-texture-name-array* object) ;; minimap-texture-name-array -;; (define-extern *minimap-corner-array* object) ;; minimap-corner-array +(define-extern *minimap-texture-name-array* minimap-texture-name-array) +(define-extern *minimap-corner-array* minimap-corner-array) (define-extern *minimap* minimap) -;; (define-extern *minimap-class-list* object) ;; (inline-array minimap-class-node) -;; (define-extern lookup-minimap-texture-by-name function) ;; (function string string (pointer texture-page) texture) -;; (define-extern *minimap-table-entry-array* array) +(define-extern *minimap-class-list* (inline-array minimap-class-node)) +(define-extern lookup-minimap-texture-by-name (function string string (pointer texture-page) texture)) +(define-extern *minimap-table-entry-array* (array minimap-table-entry)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bigmap ;; @@ -40621,6 +40714,14 @@ (death-start 34) (auto-death-phase-out 35) (has-gem 36) + (ef37 37) + (ef38 38) + (ef39 39) + (ef40 40) + (ef41 41) + (ef42 42) + (ef43 43) + (ef44 44) ) ;; ---enemy-h:enemy-flag @@ -40725,7 +40826,7 @@ (gem-seg uint32 :offset-assert 392) (gem-no-seg uint32 :offset-assert 396) (gem-offset sphere :inline :offset-assert 400) - (knocked-off basic :offset-assert 416) + (knocked-off symbol :offset-assert 416) ) :method-count-assert 10 :size-assert #x1a4 @@ -40924,7 +41025,7 @@ (enemy-method-88 (_type_ enemy-knocked-info) symbol) ;; 88 (within-gspot-range? (_type_) symbol) ;; 89 (enemy-method-90 (_type_ ragdoll-proc) none) ;; 90 - (enemy-method-91 (_type_) symbol) ;; 91 + (enemy-method-91 (_type_ enemy-jump-info) object) ;; 91 (init-jump-info! (_type_ enemy-jump-info) none) ;; 92 (setup-jump! (_type_ enemy-jump-info) none) ;; 93 (move-to-gspot! (_type_) float) ;; 94 @@ -40934,14 +41035,14 @@ (jump-wind-up-anim (_type_ enemy-jump-info) symbol) ;; 98 (jump-anim-handler (_type_ int enemy-jump-info) symbol) ;; 99 (in-jump-handler (_type_ int enemy-jump-info) none) ;; 100 - (enemy-method-101 (_type_) none) ;; 101 + (enemy-method-101 (_type_ int enemy-jump-info) none) ;; 101 (go-directed2 (_type_) object) ;; 102 (enemy-method-103 (_type_ vector float) symbol) ;; 103 (enemy-method-104 (_type_ vector float) symbol) ;; 104 (enemy-method-105 (_type_ float symbol) symbol) ;; 105 (find-best-focus (_type_) process) ;; 106 - (enemy-method-107 (_type_) symbol) ;; 107 - (enemy-method-108 (_type_) symbol) ;; 108 + (is-pfoc-in-mesh? (_type_ process-focusable vector) symbol) ;; 107 + (enemy-method-108 (_type_ process-focusable) symbol) ;; 108 (enemy-method-109 (_type_) symbol) ;; 109 (send-attack (_type_ process touching-shapes-entry uint) symbol) ;; 110 (on-attack (_type_ process-focusable) none) ;; 111 @@ -41059,41 +41160,36 @@ debug-control ;; 159 ) (:methods - ;; (nav-enemy-method-155 () none) ;; 155 ;; (nav-enemy-method-155 (_type_) none) - ;; (nav-enemy-method-156 () none) ;; 156 ;; (nav-enemy-method-156 (_type_) none) - ;; (nav-enemy-method-157 () none) ;; 157 ;; (nav-enemy-method-157 (_type_ vector) nav-poly) - ;; (nav-enemy-method-158 () none) ;; 158 ;; (nav-enemy-method-158 (_type_ vector) object) - ;; (nav-enemy-method-159 () none) ;; 159 ;; (nav-enemy-method-159 (_type_ vector) symbol) - (nav-enemy-method-160 (_type_) none) ;; 160 ;; (nav-enemy-method-160 (_type_) none) - (nav-enemy-method-161 (_type_) none) ;; 161 ;; (nav-enemy-method-161 (_type_) none) - (nav-enemy-method-162 (_type_) none) ;; 162 ;; (nav-enemy-method-162 (_type_) none) - (nav-enemy-method-163 (_type_) none) ;; 163 ;; (nav-enemy-method-163 (_type_) symbol) - (nav-enemy-method-164 (_type_) none) ;; 164 ;; (nav-enemy-method-164 (_type_) none) - (nav-enemy-method-165 (_type_) none) ;; 165 ;; (nav-enemy-method-165 (_type_) none) - (nav-enemy-method-166 (_type_) none) ;; 166 ;; (nav-enemy-method-166 (_type_) none) - (nav-enemy-method-167 (_type_) none) ;; 167 ;; (nav-enemy-method-167 (_type_) none) - (nav-enemy-method-168 (_type_) none) ;; 168 ;; (nav-enemy-method-168 (_type_) float) - (nav-enemy-method-169 (_type_) none) ;; 169 ;; (nav-enemy-method-169 (_type_ float symbol) float) - (nav-enemy-method-170 (_type_) none) ;; 170 ;; (nav-enemy-method-170 (_type_) none) - (nav-enemy-method-171 (_type_) none) ;; 171 ;; (nav-enemy-method-171 (_type_) none) - (nav-enemy-method-172 (_type_) none) ;; 172 ;; (nav-enemy-method-172 (_type_) none) - (nav-enemy-method-173 (_type_) none) ;; 173 ;; (nav-enemy-method-173 (_type_) none) - (nav-enemy-method-174 (_type_) none) ;; 174 ;; (nav-enemy-method-174 (_type_) symbol) - (nav-enemy-method-175 (_type_) none) ;; 175 ;; (nav-enemy-method-175 (_type_) symbol) - (nav-enemy-method-176 (_type_) none) ;; 176 ;; (nav-enemy-method-176 (_type_) none) - (nav-enemy-method-177 (_type_) none) ;; 177 ;; (nav-enemy-method-177 (_type_) none) + (normalize-heading! (_type_ nav-control) none) ;; 160 + (nav-enemy-method-161 (_type_ nav-control) none) ;; 161 + (nav-enemy-method-162 (_type_) none) ;; 162 + (nav-enemy-method-163 (_type_) none) ;; 163 + (nav-enemy-method-164 (_type_) none) ;; 164 + (nav-enemy-method-165 (_type_ vector vector) none) ;; 165 + (nav-enemy-method-166 (_type_ vector vector) vector) ;; 166 + (nav-enemy-method-167 (_type_) vector) ;; 167 + (nav-enemy-method-168 (_type_ vector) nav-poly) ;; 168 + (nav-enemy-method-169 (_type_ vector) object) ;; 169 + (is-notice-point-in-mesh? (_type_ vector) symbol) ;; 170 + (nav-enemy-method-171 (_type_) none) ;; 171 + (nav-enemy-method-172 (_type_) none) ;; 172 + (nav-enemy-method-173 (_type_) none) ;; 173 + (nav-enemy-method-174 (_type_) symbol) ;; 174 + (nav-enemy-method-175 (_type_) none) ;; 175 + (nav-enemy-method-176 (_type_) none) ;; 176 + (nav-enemy-method-177 (_type_) none) ;; 177 (nav-enemy-method-178 (_type_) none) ;; 178 (nav-enemy-method-179 (_type_) none) ;; 179 - (nav-enemy-method-180 (_type_) none) ;; 180 + (nav-enemy-method-180 (_type_ float float) none) ;; 180 (nav-enemy-method-181 (_type_) none) ;; 181 (nav-enemy-method-182 (_type_) none) ;; 182 (nav-enemy-method-183 (_type_) none) ;; 183 (nav-enemy-method-184 (_type_) none) ;; 184 - (nav-enemy-method-185 (_type_) none) ;; 185 - (nav-enemy-method-186 (_type_) none) ;; 186 + (nav-enemy-method-185 (_type_) symbol) ;; 185 + (nav-enemy-method-186 (_type_) symbol) ;; 186 (nav-enemy-method-187 (_type_) none) ;; 187 (nav-enemy-method-188 (_type_) none) ;; 188 - (nav-enemy-method-189 (_type_) none) ;; 189 + (copy-nav-state-vel! (_type_ vector) none) ;; 189 ) ) @@ -42421,76 +42517,79 @@ ;; grunt ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype grunt-anim-info (structure) ((anim-index int32 :offset-assert 0) (travel-speed meters :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype grunt-global-info (basic) - ((patrol-anim grunt-anim-info 4 :offset-assert 4) ;; guessed by decompiler - (charge-anim grunt-anim-info 3 :offset-assert 36) ;; guessed by decompiler - (attack-anim grunt-anim-info 2 :offset-assert 60) ;; guessed by decompiler + ((patrol-anim grunt-anim-info 4 :inline :offset-assert 4) ;; guessed by decompiler + (charge-anim grunt-anim-info 3 :inline :offset-assert 36) ;; guessed by decompiler + (attack-anim grunt-anim-info 2 :inline :offset-assert 60) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x4c :flag-assert #x90000004c ) -|# -#| +;; +++grunt:grunt-flags +(defenum grunt-flags + :type uint8 + :bitfield #t + (gf0 0) + (gf1 1) + (gf2 2) + ) +;; ---grunt:grunt-flags + (deftype grunt (nav-enemy) ((patrol-anim grunt-anim-info :offset-assert 620) (charge-anim grunt-anim-info :offset-assert 624) (attack-anim grunt-anim-info :offset-assert 628) (intro-path path-control :offset-assert 632) ;; guessed by decompiler - (use-charge-anim-index int8 :offset-assert 640) + (use-charge-anim-index int8 :offset 640) (jumping-ambush-path-pt int8 :offset-assert 641) - (grunt-flags uint8 :offset-assert 642) - (state-timeout2 uint64 :offset-assert 648) - (next-warn-time uint64 :offset-assert 656) ;; time-frame + (grunt-flags grunt-flags :offset-assert 642) + (state-timeout2 time-frame :offset-assert 648) + (next-warn-time time-frame :offset-assert 656) ;; time-frame (dest vector :inline :offset-assert 672) - (focus-pos vector :inline :offset-assert 352) - (minimap connection-minimap :offset-assert 704) + (minimap connection-minimap :offset 704) ) :method-count-assert 198 :size-assert #x2c4 :flag-assert #xc6025002c4 - (:methods - (grunt-method-196 () none) ;; 196 - (grunt-method-197 () none) ;; 197 - ) (:state-methods knocked-recover ;; 32 - stop-chase ;; 158 - circling ;; 157 - pacing ;; 156 - spin-attack ;; 195 - wait-for-focus ;; 194 - hostile ;; 38 - attack ;; 190 active ;; 34 - jumping-ambush-cont ;; 193 - jumping-ambush ;; 192 + hostile ;; 38 + pacing ;; 156 + circling ;; 157 + stop-chase ;; 158 + attack ;; 190 falling-ambush ;; 191 + jumping-ambush ;; 192 + jumping-ambush-cont ;; 193 + wait-for-focus ;; 194 + spin-attack ;; 195 + ) + (:methods + (grunt-method-196 (_type_ float) process-focusable) ;; 196 + (get-enemy-info (_type_) nav-enemy-info) ;; 197 ) ) -|# -;; (define-extern *grunt-global-info* grunt-global-info) ;; grunt-global-info -;; (define-extern *grunt-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info +(define-extern *grunt-global-info* grunt-global-info) +(define-extern *grunt-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; battle ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype battle-info (basic) ((id int8 :offset-assert 4) (notice-spec uint64 :offset-assert 8) @@ -42513,9 +42612,7 @@ :size-assert #x48 :flag-assert #x900000048 ) -|# -#| (deftype battle-ally (structure) ((entity entity-actor :offset-assert 0) ;; guessed by decompiler ) @@ -42523,19 +42620,15 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype battle-ally-array (inline-array-class) - ((data battle-ally :dynamic :offset-assert 16) ;; guessed by decompiler + ((data battle-ally :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype battle-breed (structure) ((breed-type type :offset-assert 0) ;; guessed by decompiler (percent float :offset-assert 4) @@ -42544,21 +42637,25 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype battle-breed-array (inline-array-class) - ((data battle-breed :dynamic :offset-assert 16) ;; guessed by decompiler + ((data battle-breed :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| +;; +++battle:battle-spawner-flags +(defenum battle-spawner-flags + :bitfield #t + :type int64 + (hit) + ) +;; ---battle:battle-spawner-flags + (deftype battle-spawner (structure) - ((flags uint64 :offset-assert 0) ;; battle-spawner-flags + ((flags battle-spawner-flags :offset-assert 0) ;; battle-spawner-flags (entity entity-actor :offset-assert 8) ;; guessed by decompiler (breeds battle-breed-array :offset-assert 12) ;; guessed by decompiler (creature-index int8 :offset-assert 16) @@ -42567,31 +42664,39 @@ (mode uint8 :offset-assert 19) (intro-path path-control :offset-assert 20) ;; guessed by decompiler (notice-attack-delay uint32 :offset-assert 24) - (creature uint64 :offset-assert 32) ;; handle - (last-spawn-time uint64 :offset-assert 40) ;; time-frame - (noticed-attack-time uint64 :offset-assert 48) ;; time-frame + (creature handle :offset-assert 32) ;; handle + (last-spawn-time time-frame :offset-assert 40) ;; time-frame + (noticed-attack-time time-frame :offset-assert 48) ;; time-frame (attack-pos vector :inline :offset-assert 64) ) :method-count-assert 9 :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype battle-spawner-array (inline-array-class) - ((data battle-spawner :dynamic :offset-assert 16) ;; guessed by decompiler + ((data battle-spawner :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| +;; +++battle:battle-flags +(defenum battle-flags + :bitfield #t + :type uint8 + (noticed) + (active) + (beaten) + (no-spawner-block) + (battle-music-set) + ) +;; ---battle:battle-flags + (deftype battle (process-drawable) ((info battle-info :offset-assert 200) ;; guessed by decompiler - (flags uint8 :offset-assert 204) ;; battle-flags + (flags battle-flags :offset-assert 204) ;; battle-flags (spawn-initial-creatures? symbol :offset-assert 208) ;; guessed by decompiler (next-spawn-delay uint32 :offset-assert 212) (on-notice basic :offset-assert 216) @@ -42601,8 +42706,8 @@ (count uint32 :offset-assert 232) (die-count uint32 :offset-assert 236) (stat-child-count uint16 :offset-assert 240) - (cant-spawn-time uint64 :offset-assert 248) ;; time-frame - (jammed-starting-time uint64 :offset-assert 256) ;; time-frame + (cant-spawn-time time-frame :offset-assert 248) ;; time-frame + (jammed-starting-time time-frame :offset-assert 256) ;; time-frame (spawners battle-spawner-array :offset-assert 264) ;; guessed by decompiler (allies battle-ally-array :offset-assert 268) ;; guessed by decompiler ) @@ -42610,48 +42715,47 @@ :size-assert #x110 :flag-assert #x3500900110 ;; field on-notice uses ~A with a signed load. field on-hostile uses ~A with a signed load. field on-beaten uses ~A with a signed load. - (:methods - (battle-method-21 () none) ;; 21 ;; (battle-state-21 () _type_ :state) - (battle-method-25 () none) ;; 25 ;; (spawner-blocked? (_type_ battle-spawner) symbol) - (battle-method-26 () none) ;; 26 ;; (spawner-blocked-by-collide? (_type_ battle-spawner) symbol) - (battle-method-27 () none) ;; 27 ;; (draw-battle-marks (_type_) none) - (battle-method-28 () none) ;; 28 ;; (initialize-enemy-lists (_type_) none) - (battle-method-29 () none) ;; 29 ;; (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none) - (battle-method-30 () none) ;; 30 ;; (get-spawner-for-enemy (_type_ process) battle-spawner) - (battle-method-31 () none) ;; 31 ;; (initialize-ally (_type_ battle-ally entity-actor) none) - (battle-method-32 () none) ;; 32 ;; (initialize-spawner (_type_ battle-spawner entity-actor) none) - (battle-method-33 () none) ;; 33 ;; (initialize-battle (_type_) none) - (battle-method-34 () none) ;; 34 ;; (init-go (_type_) int) - (battle-method-35 () none) ;; 35 ;; (get-spawn-delay (_type_) int) - (battle-method-36 () none) ;; 36 ;; (get-best-spawner (_type_) battle-spawner) - (battle-method-37 () none) ;; 37 ;; (spawner-free? (_type_ battle-spawner) symbol) - (battle-method-38 () none) ;; 38 ;; (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle) - (battle-method-39 () none) ;; 39 ;; (spawn-from-spawner (_type_ battle-spawner symbol) none) - (battle-method-40 () none) ;; 40 ;; (spawn-initial-creatures (_type_) none) - (battle-method-41 () none) ;; 41 ;; (get-random-breed (_type_ battle-spawner) battle-breed) - (battle-method-42 () none) ;; 42 ;; (spawner-hit (_type_ battle-spawner process) symbol) - (battle-method-43 () none) ;; 43 ;; (spawner-try-jump (_type_ battle-spawner enemy) symbol) - (battle-method-44 () none) ;; 44 ;; (spawner-do-jump (_type_ battle-spawner) int) - (battle-method-45 () none) ;; 45 ;; (spawner-hittable? (_type_ battle-spawner) symbol) - (battle-method-46 () none) ;; 46 ;; (spawner-in-intro? (_type_ battle-spawner) symbol) - (battle-method-47 () none) ;; 47 ;; (set-battle-music (_type_) none) - (battle-method-48 () none) ;; 48 ;; (unset-battle-music (_type_) none) - (battle-method-49 () none) ;; 49 ;; (update-allies-list (_type_) int) - (battle-method-50 () none) ;; 50 ;; (beaten? (_type_) symbol) - (battle-method-51 () none) ;; 51 ;; (spawner-active? (_type_ battle-spawner symbol) symbol) - (battle-method-52 () none) ;; 52 ;; (spawner-active-count (_type_) int) - ) (:state-methods - beaten ;; 24, old: (beaten () _type_ :state) - hostile ;; 23, old: (hostile () _type_ :state) - notice ;; 22, old: (notice () _type_ :state) - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 + undefined ;; 21, not defined + notice ;; 22 + hostile ;; 23 + beaten ;; 24 + ) + (:methods + (spawner-blocked? (_type_ battle-spawner) symbol) ;; 25 + (spawner-blocked-by-collide? (_type_ battle-spawner) symbol) ;; 26 + (draw-battle-marks (_type_) none) ;; 27 + (initialize-enemy-lists (_type_) none) ;; 28 + (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none) ;; 29 + (get-spawner-for-enemy (_type_ process) battle-spawner) ;; 30 + (initialize-ally (_type_ battle-ally entity-actor) none) ;; 31 + (initialize-spawner (_type_ battle-spawner entity-actor) none) ;; 32 + (initialize-battle (_type_) none) ;; 33 + (init-go (_type_) int) ;; 34 + (get-spawn-delay (_type_) int) ;; 35 + (get-best-spawner (_type_) battle-spawner) ;; 36 + (spawner-free? (_type_ battle-spawner) symbol) ;; 37 + (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle) ;; 38 + (spawn-from-spawner (_type_ battle-spawner symbol) none) ;; 39 + (spawn-initial-creatures (_type_) none) ;; 40 + (get-random-breed (_type_ battle-spawner) battle-breed) ;; 41 + (spawner-hit (_type_ battle-spawner process) symbol) ;; 42 + (spawner-try-jump (_type_ battle-spawner enemy) symbol) ;; 43 + (spawner-do-jump (_type_ battle-spawner) int) ;; 44 + (spawner-hittable? (_type_ battle-spawner) symbol) ;; 45 + (spawner-in-intro? (_type_ battle-spawner) symbol) ;; 46 + (set-battle-music (_type_) none) ;; 47 + (unset-battle-music (_type_) none) ;; 48 + (update-allies-list (_type_) int) ;; 49 + (beaten? (_type_) symbol) ;; 50 + (spawner-active? (_type_ battle-spawner symbol) symbol) ;; 51 + (spawner-active-count (_type_) int) ;; 52 ) ) -|# -;; (define-extern *battles* array) ;; (array battle-info) -;; (define-extern battle-event-handler function) ;; (function process int symbol event-message-block object :behavior battle) +(define-extern *battles* (array battle-info)) +(define-extern battle-event-handler (function process int symbol event-message-block object :behavior battle)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hover-formation-h ;; @@ -44287,36 +44391,43 @@ ;; jump-pad ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype jump-pad (bouncer) ((fan-quat quaternion :inline :offset-assert 224) (rot-vel float :offset-assert 240) - (fan-loop-sound-id uint32 :offset-assert 244) - (fan-loop-sound basic :offset-assert 248) - (jump-sound basic :offset-assert 252) + (fan-loop-sound-id sound-id :offset-assert 244) + (fan-loop-sound sound-spec :offset-assert 248) + (jump-sound sound-spec :offset-assert 252) ) :method-count-assert 30 :size-assert #x100 :flag-assert #x1e00800100 - (:methods - (jump-pad-method-27 () none) ;; 27 - (jump-pad-method-28 () none) ;; 28 - (jump-pad-method-29 () none) ;; 29 - ) (:state-methods - fire ;; 21 idle ;; 20 + fire ;; 21 + ) + (:methods + (get-skel (_type_) art-group) ;; 27 + (get-fan-joint-idx (_type_) int) ;; 28 + (init-sounds (_type_) none) ;; 29 ) ) -|# -;; (define-extern jump-pad-joint-fan function) +(define-extern jump-pad-joint-fan (function cspace quaternion none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; roboguard ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++roboguard:roboguard-flag +(defenum roboguard-flag + :type uint16 + :bitfield #t + (rf0 0) + (rf1 1) + (rf2 2) + ) +;; ---roboguard:roboguard-flag + (deftype roboguard (nav-enemy) ((los los-control :inline :offset-assert 624) (rotation-matrix matrix :inline :offset-assert 800) @@ -44326,54 +44437,53 @@ (focus-formation-source vector :inline :offset-assert 960) (me-to-focus-dir vector :inline :offset-assert 976) (me-to-focus-angle float :offset-assert 992) - (flags uint16 :offset-assert 996) + (flags roboguard-flag :offset-assert 996) (torso-aim-blend float :offset-assert 1000) (torso-angle float :offset-assert 1004) (torso-seek-speed float :offset-assert 1008) (torso-to-focus-angle float :offset-assert 1012) (last-torso-frame-num float :offset-assert 1016) (stand-angle-threshold float :offset-assert 1020) - (arm-rot-mult UNKNOWN 2 :offset-assert 1024) - (arm-rot UNKNOWN 2 :offset-assert 1032) - (fire-time uint64 :offset-assert 1040) + (arm-rot-mult float 2 :offset-assert 1024) + (arm-rot degrees 2 :offset-assert 1032) + (fire-time time-frame :offset-assert 1040) (fire-count uint32 :offset-assert 1048) - (last-attack-time uint64 :offset-assert 1056) - (update-focus-pos basic :offset-assert 1064) + (last-attack-time time-frame :offset-assert 1056) + (update-focus-pos symbol :offset-assert 1064) (formation-angle-sign float :offset-assert 1068) (last-hit-points int32 :offset-assert 1072) ) :method-count-assert 197 :size-assert #x434 :flag-assert #xc503c00434 - (:methods - (roboguard-method-194 () none) ;; 194 - (roboguard-method-195 () none) ;; 195 - (roboguard-method-196 () none) ;; 196 - ) (:state-methods - die ;; 40 - knocked-recover ;; 32 knocked ;; 31 - shoot-attack ;; 192 - hostile-stand ;; 190 - hostile ;; 38 - explode ;; 193 - stare ;; 37 - close-attack ;; 191 - notice ;; 35 + knocked-recover ;; 32 idle ;; 33 + notice ;; 35 + stare ;; 37 + hostile ;; 38 + die ;; 40 + hostile-stand ;; 190 + close-attack ;; 191 + shoot-attack ;; 192 + explode ;; 193 + ) + (:methods + (roboguard-method-194 (_type_ vector float) symbol) ;; 194 + (roboguard-method-195 (_type_) none) ;; 195 + (roboguard-method-196 (_type_ int) none) ;; 196 ) ) -|# -;; (define-extern *roboguard-exploder-params* joint-exploder-static-params) -;; (define-extern *roboguard-explode-joints* array) -;; (define-extern *roboguard-debris-array-params* array) -;; (define-extern *fact-info-roboguard-defaults* fact-info-enemy-defaults) -;; (define-extern *roboguard-nav-enemy-info* nav-enemy-info) -;; (define-extern roboguard-turn-torso-post function) -;; (define-extern roboguard-turret-code function) -;; (define-extern *roboguard-formation-table* array) +(define-extern *roboguard-exploder-params* joint-exploder-static-params) +(define-extern *roboguard-explode-joints* (array int32)) +(define-extern *roboguard-debris-array-params* (array debris-static-params)) +(define-extern *fact-info-roboguard-defaults* fact-info-enemy-defaults) +(define-extern *roboguard-nav-enemy-info* nav-enemy-info) +(define-extern roboguard-turn-torso-post (function none :behavior roboguard)) +(define-extern roboguard-turret-code (function none :behavior roboguard)) +(define-extern *roboguard-formation-table* (array float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; robo-hover ;; @@ -44442,37 +44552,33 @@ ;; kg-grunt ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype kg-grunt-anim-info (structure) ((anim-index int32 :offset-assert 0) (travel-speed meters :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype kg-grunt-global-info (basic) ((prev-knocked-anim-index int32 :offset-assert 4) (prev-yellow-hit-anim-index int32 :offset-assert 8) (prev-blue-hit-anim-index int32 :offset-assert 12) - (patrol-anim UNKNOWN 4 :offset-assert 16) - (charge-anim UNKNOWN 3 :offset-assert 48) - (attack-anim UNKNOWN 2 :offset-assert 72) - (knocked-anim UNKNOWN 4 :offset-assert 88) - (knocked-land-anim UNKNOWN 4 :offset-assert 120) - (yellow-hit-anim UNKNOWN 4 :offset-assert 152) - (blue-hit-anim UNKNOWN 6 :offset-assert 184) + (patrol-anim kg-grunt-anim-info 4 :inline :offset-assert 16) + (charge-anim kg-grunt-anim-info 3 :inline :offset-assert 48) + (attack-anim kg-grunt-anim-info 2 :inline :offset-assert 72) + (knocked-anim kg-grunt-anim-info 4 :inline :offset-assert 88) + (knocked-land-anim kg-grunt-anim-info 4 :inline :offset-assert 120) + (yellow-hit-anim kg-grunt-anim-info 4 :inline :offset-assert 152) + (blue-hit-anim kg-grunt-anim-info 6 :inline :offset-assert 184) ) :method-count-assert 9 :size-assert #xe8 :flag-assert #x9000000e8 ) -|# -#| (deftype kg-grunt (nav-enemy) ((patrol-anim kg-grunt-anim-info :offset-assert 620) (charge-anim kg-grunt-anim-info :offset-assert 624) @@ -44480,50 +44586,48 @@ (knocked-anim kg-grunt-anim-info :offset-assert 632) (yellow-hit-anim kg-grunt-anim-info :offset-assert 636) (blue-hit-anim kg-grunt-anim-info :offset-assert 640) - (intro-path basic :offset-assert 644) - (use-charge-anim-index int8 :offset-assert 652) + (intro-path path-control :offset-assert 644) + (use-charge-anim-index int8 :offset 652) (knocked-anim-index int8 :offset-assert 653) (jumping-ambush-path-pt int8 :offset-assert 654) (kg-grunt-flags uint8 :offset-assert 655) - (state-timeout2 uint64 :offset-assert 656) - (next-warn-time uint64 :offset-assert 664) + (state-timeout2 time-frame :offset-assert 656) + (next-warn-time time-frame :offset-assert 664) (dest vector :inline :offset-assert 672) - (focus-pos vector :inline :offset-assert 352) - (minimap connection-minimap :offset-assert 704) + (minimap connection-minimap :offset 704) (debris-count uint32 :offset-assert 708) (debris-mask uint32 :offset-assert 712) ) :method-count-assert 199 :size-assert #x2cc :flag-assert #xc7025002cc - (:methods - (kg-grunt-method-197 () none) ;; 197 - (kg-grunt-method-198 () none) ;; 198 - ) (:state-methods - stop-chase ;; 158 - pacing ;; 156 - spin-attack ;; 195 - wait-for-focus ;; 194 - hostile ;; 38 - attack ;; 190 active ;; 34 - jumping-ambush-cont ;; 193 - jumping-ambush ;; 192 - falling-ambush ;; 191 + hostile ;; 38 + pacing ;; 156 circling ;; 157 + stop-chase ;; 158 + attack ;; 190 + falling-ambush ;; 191 + jumping-ambush ;; 192 + jumping-ambush-cont ;; 193 + wait-for-focus ;; 194 + spin-attack ;; 195 explode ;; 196 ) + (:methods + (go-attack (_type_ float) process-focusable) ;; 197 + (get-nav-enemy-info (_type_) nav-enemy-info) ;; 198 + ) ) -|# -;; (define-extern *kg-grunt-debris-params* debris-static-params) -;; (define-extern *kg-grunt-debris-elbow-shoulder-params* debris-static-params) -;; (define-extern *kg-grunt-debris-array-params* array) -;; (define-extern *kg-grunt-debris-knee-hip-params* debris-static-params) -;; (define-extern *kg-grunt-global-info* kg-grunt-global-info) -;; (define-extern *fact-info-kg-grunt-defaults* fact-info-enemy-defaults) -;; (define-extern *kg-grunt-nav-enemy-info* nav-enemy-info) +(define-extern *kg-grunt-debris-params* debris-static-params) +(define-extern *kg-grunt-debris-elbow-shoulder-params* debris-static-params) +(define-extern *kg-grunt-debris-array-params* (array debris-static-params)) +(define-extern *kg-grunt-debris-knee-hip-params* debris-static-params) +(define-extern *kg-grunt-global-info* kg-grunt-global-info) +(define-extern *fact-info-kg-grunt-defaults* fact-info-enemy-defaults) +(define-extern *kg-grunt-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hover-nav-sewb ;; @@ -44559,26 +44663,25 @@ ;; sewer-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-color-sewer-gas* curve-color-fast) -;; (define-extern *range-alpha-sewer-gas* curve2d-fast) -;; (define-extern *range-scale-sewer-gas-x* curve2d-fast) -;; (define-extern *range-scale-sewer-gas-y* curve2d-fast) -;; (define-extern *r-curve-sewer-gas* curve2d-fast) -;; (define-extern *g-curve-sewer-gas* curve2d-fast) -;; (define-extern *b-curve-sewer-gas* curve2d-fast) -;; (define-extern *curve-alpha-sewer-gas* curve2d-fast) -;; (define-extern *curve-sewer-gas-x* curve2d-fast) -;; (define-extern *curve-sewer-gas-y* curve2d-fast) -;; (define-extern *part-sewer-steam-puff-curve-settings* object) -;; (define-extern *steam-particle-list* array) -;; (define-extern birth-func-texture-group-steam function) -;; (define-extern spt-func-birth-on-bubble-pop function) +(define-extern *range-color-sewer-gas* curve-color-fast) +(define-extern *range-alpha-sewer-gas* curve2d-fast) +(define-extern *range-scale-sewer-gas-x* curve2d-fast) +(define-extern *range-scale-sewer-gas-y* curve2d-fast) +(define-extern *r-curve-sewer-gas* curve2d-fast) +(define-extern *g-curve-sewer-gas* curve2d-fast) +(define-extern *b-curve-sewer-gas* curve2d-fast) +(define-extern *curve-alpha-sewer-gas* curve2d-fast) +(define-extern *curve-sewer-gas-x* curve2d-fast) +(define-extern *curve-sewer-gas-y* curve2d-fast) +(define-extern *part-sewer-steam-puff-curve-settings* particle-curve-settings) +(define-extern *steam-particle-list* (array int32)) +(define-extern birth-func-texture-group-steam (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-func-birth-on-bubble-pop (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sewer-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sewb-states (structure) ((pulse pulse-state :inline :offset-assert 0) ) @@ -44586,9 +44689,7 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype sewc-states (structure) ((pulse pulse-state :inline :offset-assert 0) (electricity electricity-state :inline :offset-assert 16) @@ -44598,9 +44699,7 @@ :size-assert #x1c :flag-assert #x90000001c ) -|# -#| (deftype sewd-states (structure) ((pulse pulse-state :inline :offset-assert 0) (electricity electricity-state :inline :offset-assert 16) @@ -44610,31 +44709,25 @@ :size-assert #x1c :flag-assert #x90000001c ) -|# -#| (deftype sewg-states (structure) - ((electricity UNKNOWN 2 :offset-assert 0) - (rot float :offset-assert 32) + ((electricity electricity-state 2 :inline :offset-assert 0) + (rot float :offset 32) ) :method-count-assert 9 :size-assert #x24 :flag-assert #x900000024 ) -|# -#| (deftype sewh-states (structure) - ((electricity UNKNOWN 5 :offset-assert 0) - (turret-value float :offset-assert 80) + ((electricity electricity-state 5 :inline :offset-assert 0) + (turret-value float :offset 80) ) :method-count-assert 9 :size-assert #x54 :flag-assert #x900000054 ) -|# -#| (deftype sewj-states (structure) ((rot float :offset-assert 0) ) @@ -44642,40 +44735,33 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| -(deftype sewa-states (UNKNOWN) +(deftype sewa-states (structure) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 ) -|# -;; (define-extern update-sewer-lights function) ;; (function mood-context none) -;; (define-extern update-mood-sewa function) -;; (define-extern init-mood-sewb function) -;; (define-extern update-mood-sewb function) -;; (define-extern init-mood-sewc function) -;; (define-extern update-mood-sewc function) -;; (define-extern init-mood-sewd function) -;; (define-extern update-mood-sewd function) -;; (define-extern set-sewd-light! function) -;; (define-extern init-mood-sewg function) -;; (define-extern update-mood-sewg function) -;; (define-extern set-sewg-electricity-scale! function) -;; (define-extern init-mood-sewh function) -;; (define-extern update-mood-sewh function) -;; (define-extern set-sewh-electricity-scale! function) -;; (define-extern set-sewh-turret-flash! function) -;; (define-extern update-mood-sewj function) +(define-extern update-sewer-lights (function mood-context none)) +(define-extern update-mood-sewa (function mood-context float int none :behavior time-of-day-proc)) +(define-extern init-mood-sewb (function mood-context float)) +(define-extern update-mood-sewb (function mood-context float int none :behavior time-of-day-proc)) +(define-extern init-mood-sewc (function mood-context float)) +(define-extern update-mood-sewc (function mood-context float int none :behavior time-of-day-proc)) +(define-extern init-mood-sewd (function mood-context float)) +(define-extern update-mood-sewd (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-sewd-light! (function float none)) +(define-extern init-mood-sewg (function mood-context float)) +(define-extern update-mood-sewg (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-sewg-electricity-scale! (function float int none)) +(define-extern init-mood-sewh (function mood-context float)) +(define-extern update-mood-sewh (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-sewh-electricity-scale! (function float int none)) +(define-extern set-sewh-turret-flash! (function none)) +(define-extern update-mood-sewj (function mood-context float int none :behavior time-of-day-proc)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sew-laser-guard ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype gun-turret-params (structure) ((normal-sg skeleton-group :offset-assert 0) ;; guessed by decompiler (explode-sg skeleton-group :offset-assert 4) ;; guessed by decompiler @@ -44691,39 +44777,35 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype sew-laser-guard (enemy) ((params gun-turret-params :offset-assert 552) (aim-pos vector :inline :offset-assert 560) - (smoke-part basic :offset-assert 576) - (casing-part basic :offset-assert 580) + (smoke-part sparticle-launch-control :offset-assert 576) + (casing-part sparticle-launch-control :offset-assert 580) (sync-orient sync-linear :inline :offset-assert 584) (start-orient quaternion :inline :offset-assert 608) (end-orient quaternion :inline :offset-assert 624) - (last-play-sweep-dir-positive? basic :offset-assert 640) + (last-play-sweep-dir-positive? symbol :offset-assert 640) (last-play-sweep-sync float :offset-assert 644) - (sound-hum uint32 :offset-assert 648) - (sound-scorch uint32 :offset-assert 652) + (sound-hum sound-id :offset-assert 648) + (sound-scorch sound-id :offset-assert 652) ) :method-count-assert 157 :size-assert #x290 :flag-assert #x9d02100290 - (:methods - (sew-laser-guard-method-155 () none) ;; 155 - (sew-laser-guard-method-156 () none) ;; 156 - ) (:state-methods hit ;; 30 - die ;; 40 stare ;; 37 hostile ;; 38 + die ;; 40 + ) + (:methods + (sew-laser-guard-method-155 (_type_) none) ;; 155 + (sew-laser-guard-method-156 (_type_) none) ;; 156 ) ) -|# -#| (deftype sew-laser-shot (projectile) () :method-count-assert 41 @@ -44733,40 +44815,34 @@ dissipate ;; 21 ) ) -|# -;; (define-extern sew-laser-shot-move function) -;; (define-extern *sew-laser-guard-enemy-info* enemy-info) -;; (define-extern fire-laser! function) +(define-extern sew-laser-shot-move (function sew-laser-shot none)) +(define-extern *sew-laser-guard-enemy-info* enemy-info) +(define-extern fire-laser! (function vector vector sew-laser-guard float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sewer-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sew-curved-door (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 ) -|# -#| (deftype sew-floating-plat (elevator) () :method-count-assert 52 :size-assert #x1a0 :flag-assert #x34012001a0 ) -|# -#| (deftype sew-cam-sequencer (process) - ((activate-script basic :offset-assert 132) - (enter-script basic :offset-assert 136) - (exit-script basic :offset-assert 140) - (timeout uint64 :offset-assert 144) + ((activate-script pair :offset 132) + (enter-script pair :offset-assert 136) + (exit-script pair :offset-assert 140) + (timeout time-frame :offset-assert 144) (offset uint64 :offset-assert 152) ) :method-count-assert 15 @@ -44777,32 +44853,26 @@ active ;; 14 ) ) -|# -#| (deftype sew-floor-switch (process-drawable) () :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 (:state-methods - idle-down ;; 22 - going-down ;; 21 idle-up ;; 20 + going-down ;; 21 + idle-down ;; 22 ) ) -|# -#| (deftype sew-jump-pad (jump-pad) () :method-count-assert 30 :size-assert #x100 :flag-assert #x1e00800100 ) -|# -#| (deftype sew-fan (enemy) ((activate-distance float :offset-assert 552) (path-pos float :offset-assert 556) @@ -44814,93 +44884,83 @@ (dest-quat quaternion :inline :offset-assert 624) (fan-rot float :offset-assert 640) (fan-rot-vel float :offset-assert 644) - (hostile-part basic :offset-assert 648) - (gust-part basic :offset-assert 652) - (sound-fan-loop-id uint32 :offset-assert 656) + (hostile-part sparticle-launch-control :offset-assert 648) + (gust-part sparticle-launch-control :offset-assert 652) + (sound-fan-loop-id sound-id :offset-assert 656) ) :method-count-assert 155 :size-assert #x294 :flag-assert #x9b02200294 (:state-methods - die ;; 40 - hostile ;; 38 + idle ;; 33 active ;; 34 notice ;; 35 - idle ;; 33 + hostile ;; 38 + die ;; 40 ) ) -|# -#| (deftype sew-elevator (process-drawable) () :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (sew-elevator-method-21 () none) ;; 21 - ) (:state-methods idle ;; 20 ) + (:methods + (init-collision! (_type_) none) ;; 21 + ) ) -|# -#| (deftype sew-gate (process-drawable) - ((play-time uint64 :offset-assert 200) - (sound-played1 basic :offset-assert 208) - (sound-played2 basic :offset-assert 212) + ((play-time time-frame :offset-assert 200) + (sound-played1 symbol :offset-assert 208) + (sound-played2 symbol :offset-assert 212) ) :method-count-assert 23 :size-assert #xd8 :flag-assert #x17006000d8 (:state-methods - opened ;; 22 - open ;; 21 idle ;; 20 + open ;; 21 + opened ;; 22 ) ) -|# -#| (deftype sew-wall-switch (process-drawable) - ((actor-group uint32 :offset-assert 196) - (actor-group-count int32 :offset-assert 200) - (minimap connection-minimap :offset-assert 204) + ((actor-group (pointer actor-group) :offset-assert 200) + (actor-group-count int32 :offset-assert 204) + (minimap connection-minimap :offset-assert 208) ) :method-count-assert 23 :size-assert #xd4 :flag-assert #x17006000d4 (:state-methods - opened ;; 22 - open ;; 21 idle ;; 20 + open ;; 21 + opened ;; 22 ) ) -|# -#| (deftype sew-fence-gate (process-drawable) () :method-count-assert 24 :size-assert #xc8 :flag-assert #x18005000c8 (:state-methods - closing ;; 23 - opening ;; 22 - open ;; 21 closed ;; 20 + open ;; 21 + opening ;; 22 + closing ;; 23 ) ) -|# -#| (deftype sew-vent (process-drawable) ((sync sync-linear :inline :offset-assert 200) (attack-id int32 :offset-assert 216) (last-sync-val float :offset-assert 220) - (vent-sound uint32 :offset-assert 224) + (vent-sound sound-id :offset-assert 224) ) :method-count-assert 21 :size-assert #xe4 @@ -44909,27 +44969,23 @@ idle ;; 20 ) ) -|# -#| (deftype sew-power-switch (process-drawable) () :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 (:state-methods - turned-off ;; 21 idle ;; 20 + turned-off ;; 21 ) ) -|# -#| (deftype sew-gas-step (base-plat) - ((sound-id uint32 :offset-assert 272) + ((sound-id sound-id :offset-assert 272) (sync sync-linear :inline :offset-assert 280) (last-sync-val float :offset-assert 296) - (gas-time uint64 :offset-assert 304) + (gas-time time-frame :offset-assert 304) (attack-id int32 :offset-assert 312) ) :method-count-assert 36 @@ -44939,34 +44995,32 @@ idle ;; 35 ) ) -|# -;; (define-extern sewer-login function) -;; (define-extern sewer-logout function) -;; (define-extern sewb-activate function) -;; (define-extern sewc-activate function) -;; (define-extern sewg-activate function) -;; (define-extern sewl-activate function) -;; (define-extern sewo-activate function) -;; (define-extern sewj-activate function) -;; (define-extern sew-cam-sequencer-init-by-other function) -;; (define-extern sew-cam-eval-script function) -;; (define-extern *sew-fan-enemy-info* enemy-info) -;; (define-extern *sew-fan-exploder-params* joint-exploder-static-params) -;; (define-extern update-surface-float function) -;; (define-extern update-idle function) -;; (define-extern update-hostile function) -;; (define-extern sew-fan-joint-fan function) -;; (define-extern sew-fan-joint-floor function) +(define-extern sewer-login (function none)) +(define-extern sewer-logout (function none)) +(define-extern sewb-activate (function none)) +(define-extern sewc-activate (function none)) +(define-extern sewg-activate (function none)) +(define-extern sewl-activate (function none)) +(define-extern sewo-activate (function none)) +(define-extern sewj-activate (function none)) +(define-extern sew-cam-sequencer-init-by-other (function entity-actor object :behavior sew-cam-sequencer)) +(define-extern sew-cam-eval-script (function pair object)) +(define-extern *sew-fan-enemy-info* enemy-info) +(define-extern *sew-fan-exploder-params* joint-exploder-static-params) +(define-extern update-surface-float (function float :behavior sew-fan)) +(define-extern update-idle (function none :behavior sew-fan)) +(define-extern update-hostile (function none :behavior sew-fan)) +(define-extern sew-fan-joint-fan (function cspace transformq none)) +(define-extern sew-fan-joint-floor (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sewer-obs2 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sew-laser-beam (process-drawable) ((sync sync-linear :inline :offset-assert 200) - (sound-id uint32 :offset-assert 216) + (sound-id sound-id :offset-assert 216) ) :method-count-assert 21 :size-assert #xdc @@ -44975,41 +45029,35 @@ idle ;; 20 ) ) -|# -#| (deftype sew-m-gate (process-drawable) - ((actor-group uint32 :offset-assert 196) - (actor-group-count int32 :offset-assert 200) + ((actor-group (pointer actor-group) :offset-assert 200) + (actor-group-count int32 :offset-assert 204) ) :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 (:state-methods - raised ;; 22 + idle ;; 20 open ;; 21 - idle ;; 20 + raised ;; 22 ) ) -|# -#| (deftype sew-pipe (process-drawable) - ((actor-group uint32 :offset-assert 196) - (actor-group-count int32 :offset-assert 200) + ((actor-group (pointer actor-group) :offset-assert 200) + (actor-group-count int32 :offset-assert 204) ) :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 (:state-methods - down ;; 22 - lower ;; 21 idle ;; 20 + lower ;; 21 + down ;; 22 ) ) -|# -#| (deftype sew-grate-plat (process-drawable) ((test-pos vector :inline :offset-assert 208) (closed-x float :offset-assert 224) @@ -45019,52 +45067,47 @@ :size-assert #xe8 :flag-assert #x18007000e8 (:state-methods - close ;; 23 - opened ;; 22 - open ;; 21 closed ;; 20 + open ;; 21 + opened ;; 22 + close ;; 23 ) ) -|# -;; (define-extern fire-sew-laser-beam! function) -;; (define-extern *sew-laser-beam-shadow-control* shadow-control) +(define-extern fire-sew-laser-beam! (function vector vector sew-laser-beam none)) +(define-extern *sew-laser-beam-shadow-control* shadow-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sewer-move-turret ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sew-move-turret (process-drawable) - ((sound-id uint32 :offset-assert 200) - (use-doppler? basic :offset-assert 204) + ((sound-id sound-id :offset-assert 200) + (use-doppler? symbol :offset-assert 204) ) :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 - (:methods - (sew-move-turret-method-22 () none) ;; 22 - ) (:state-methods - active ;; 21 idle ;; 20 + active ;; 21 + ) + (:methods + (sew-move-turret-method-22 (_type_ int) none) ;; 22 ) ) -|# -#| (deftype sew-move-turret-shot (guard-shot) - ((doppler-sound uint32 :offset-assert 544) - (use-doppler? basic :offset-assert 548) + ((doppler-sound sound-id :offset-assert 544) + (use-doppler? symbol :offset-assert 548) ) :method-count-assert 41 :size-assert #x228 :flag-assert #x2901b00228 ) -|# -;; (define-extern sew-turret-shot-move function) -;; (define-extern spawn-sew-move-turret-projectile function) +(define-extern sew-turret-shot-move (function sew-move-turret-shot none)) +(define-extern spawn-sew-move-turret-projectile (function sew-move-turret vector vector float vector (pointer sew-move-turret-shot))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sewer-scenes ;; @@ -45093,60 +45136,57 @@ ;; gun-turret-params is already defined! -#| (deftype sew-laser-turret (enemy) ((params gun-turret-params :offset-assert 552) (aim-pos vector :inline :offset-assert 560) - (smoke-part basic :offset-assert 576) - (casing-part basic :offset-assert 580) - (flash-state basic :offset-assert 584) - (can-shoot basic :offset-assert 588) - (last-active-time uint64 :offset-assert 592) + (smoke-part sparticle-launch-control :offset-assert 576) + (casing-part sparticle-launch-control :offset-assert 580) + (flash-state symbol :offset-assert 584) + (can-shoot symbol :offset-assert 588) + (last-active-time time-frame :offset-assert 592) (target-distance float :offset-assert 600) - (target-on-ground basic :offset-assert 604) - (was-hit basic :offset-assert 608) + (target-on-ground symbol :offset-assert 604) + (was-hit symbol :offset-assert 608) (awareness-radius float :offset-assert 612) - (ring-rate uint64 :offset-assert 616) + (ring-rate time-frame :offset-assert 616) (max-num-rings int32 :offset-assert 624) (last-spawn-index int32 :offset-assert 628) - (spin-sound-id uint32 :offset-assert 632) - (last-play-time uint64 :offset-assert 640) - (strip basic :offset-assert 648) + (spin-sound-id sound-id :offset-assert 632) + (last-play-time time-frame :offset-assert 640) + (strip prim-strip :offset-assert 648) ) :method-count-assert 164 :size-assert #x28c :flag-assert #xa40210028c - (:methods - (sew-laser-turret-method-159 () none) ;; 159 - (sew-laser-turret-method-160 () none) ;; 160 - (sew-laser-turret-method-161 () none) ;; 161 - (sew-laser-turret-method-162 () none) ;; 162 - (sew-laser-turret-method-163 () none) ;; 163 - ) (:state-methods - turn-off ;; 158 hostile ;; 38 - alert ;; 155 die ;; 40 - spinning-down ;; 157 + alert ;; 155 spinning-up ;; 156 + spinning-down ;; 157 + turn-off ;; 158 + ) + (:methods + (start-firing (_type_ symbol int) none) ;; 159 + (sew-laser-turret-method-160 (_type_) none) ;; 160 + (generate-prim-verts! (_type_ float float) none) ;; 161 + (check-suitable-focus (_type_) symbol) ;; 162 + (sew-laser-turret-method-163 (_type_) none) ;; 163 ) ) -|# -;; (define-extern *sew-laser-turret-enemy-info* enemy-info) -;; (define-extern do-spin function) -;; (define-extern compute-ring-period function) -;; (define-extern compute-ring-position function) -;; (define-extern compute-num-rings-to-draw function) -;; (define-extern compute-ring-size function) -;; (define-extern check-enemy function) +(define-extern *sew-laser-turret-enemy-info* enemy-info) +(define-extern do-spin (function sew-laser-turret float quaternion)) +(define-extern compute-ring-period (function int float)) +(define-extern compute-ring-position (function int int float)) +(define-extern compute-num-rings-to-draw (function time-frame time-frame float int int)) +(define-extern compute-ring-size (function float float float)) +(define-extern check-enemy (function sew-laser-turret float process-focusable symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sew-platforms ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sew-plat-updown (base-plat) ((sync sync-eased :inline :offset-assert 272) (path-pos float :offset-assert 316) @@ -45154,19 +45194,17 @@ :method-count-assert 38 :size-assert #x140 :flag-assert #x2600c00140 - (:methods - (sew-plat-updown-method-37 () none) ;; 37 - ) (:state-methods - active ;; 36 idle ;; 35 + active ;; 36 + ) + (:methods + (get-skel (_type_) art-group) ;; 37 ) ) -|# -#| (deftype sew-slide-step (sew-plat-updown) - ((last-played-start? basic :offset-assert 320) + ((last-played-start? symbol :offset-assert 320) ) :method-count-assert 38 :size-assert #x144 @@ -45175,11 +45213,9 @@ active ;; 36 ) ) -|# -#| (deftype sew-moving-step-a (sew-plat-updown) - ((last-played-start? basic :offset-assert 320) + ((last-played-start? symbol :offset-assert 320) (last-val float :offset-assert 324) ) :method-count-assert 38 @@ -45189,36 +45225,32 @@ active ;; 36 ) ) -|# -#| (deftype sew-moving-step-b (process-drawable) ((sync sync-linear :inline :offset-assert 200) (num-steps int8 :offset-assert 216) - (step-delay uint64 :offset-assert 224) + (step-delay time-frame :offset-assert 224) (start-step-pos vector :inline :offset-assert 240) (end-step-pos vector :inline :offset-assert 256) (last-sync-val float :offset-assert 272) - (sound-idle uint32 :offset-assert 276) + (sound-idle sound-id :offset-assert 276) ) :method-count-assert 27 :size-assert #x118 :flag-assert #x1b00a00118 - (:methods - (sew-moving-step-b-method-22 () none) ;; 22 - (sew-moving-step-b-method-23 () none) ;; 23 - (sew-moving-step-b-method-24 () none) ;; 24 - (sew-moving-step-b-method-25 () none) ;; 25 - (sew-moving-step-b-method-26 () none) ;; 26 - ) (:state-methods - active ;; 21 idle ;; 20 + active ;; 21 + ) + (:methods + (sew-moving-step-b-method-22 (_type_ float) int) ;; 22 + (sew-moving-step-b-method-23 (_type_) float) ;; 23 + (sew-moving-step-b-method-24 (_type_) int) ;; 24 + (alloc-trsqv! (_type_) none) ;; 25 + (sew-moving-step-b-method-26 (_type_ int float) float) ;; 26 ) ) -|# -#| (deftype sew-moving-step-b-step (base-plat) ((start-pos vector :inline :offset-assert 272) (end-pos vector :inline :offset-assert 288) @@ -45236,25 +45268,21 @@ die ;; 36 ) ) -|# -#| (deftype sew-moving-step-b-step-param (structure) ((start-pos vector :inline :offset-assert 0) (end-pos vector :inline :offset-assert 16) - (ent basic :offset-assert 32) - (period uint64 :offset-assert 40) + (ent entity-actor :offset-assert 32) + (period time-frame :offset-assert 40) (offset float :offset-assert 48) ) :method-count-assert 9 :size-assert #x34 :flag-assert #x900000034 ) -|# -#| (deftype sew-rove-plat (sew-plat-updown) - ((sound-id uint32 :offset-assert 320) + ((sound-id sound-id :offset-assert 320) ) :method-count-assert 38 :size-assert #x144 @@ -45263,12 +45291,10 @@ active ;; 36 ) ) -|# -#| (deftype sew-move-plat (base-plat) - ((sound-id uint32 :offset-assert 272) - (positions UNKNOWN 2 :offset-assert 288) + ((sound-id sound-id :offset-assert 272) + (positions vector 2 :inline :offset-assert 288) (current-pos-index int8 :offset-assert 320) (dest-pos-index int8 :offset-assert 321) (speed float :offset-assert 324) @@ -45276,27 +45302,25 @@ :method-count-assert 38 :size-assert #x148 :flag-assert #x2600d00148 - (:methods - (sew-move-plat-method-37 () none) ;; 37 - ) (:state-methods - active ;; 36 waiting ;; 35 + active ;; 36 + ) + (:methods + (sew-move-plat-method-37 (_type_) int) ;; 37 ) ) -|# -;; (define-extern sew-moving-step-b-step-init-by-other function) -;; (define-extern fmod function) -;; (define-extern spawn-moving-step-b-step function) +(define-extern sew-moving-step-b-step-init-by-other (function sew-moving-step-b-step-param object :behavior sew-moving-step-b-step)) +(define-extern fmod (function float float float)) +(define-extern spawn-moving-step-b-step (function sew-moving-step-b float sew-moving-step-b-step)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sew-whirlpool ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sew-whirlpool (process-drawable) - ((spool-sound-id uint32 :offset-assert 200) + ((spool-sound-id sound-id :offset-assert 200) ) :method-count-assert 21 :size-assert #xcc @@ -45305,239 +45329,262 @@ idle ;; 20 ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; saberfish ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype saberfish-jump-info (structure) ((windup-anim uint32 :offset-assert 0) (air-anim uint32 :offset-assert 4) (land-anim uint32 :offset-assert 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype saberfish-init-by-other-params (enemy-init-by-other-params) - ((spawn-parent uint64 :offset-assert 48) - (message basic :offset-assert 56) + ((spawn-parent handle :offset-assert 48) + (message symbol :offset-assert 56) (pos vector :inline :offset-assert 64) (orient quaternion :inline :offset-assert 80) - (initial-state basic :offset-assert 96) + (initial-state symbol :offset-assert 96) ) :method-count-assert 9 :size-assert #x64 :flag-assert #x900000064 ) -|# -#| +;; +++saberfish:saberfish-query-type +(defenum saberfish-query-type + :type uint64 + (set-nav-idx) + (set-mesh) + (set-in-water) + (can-go-to-ground?) + ) +;; ---saberfish:saberfish-query-type + +;; +++saberfish:saberfish-find-behavior +(defenum saberfish-find-behavior + :type uint64 + (none) + (behavior1) + (behavior2) + ) +;; ---saberfish:saberfish-find-behavior + (deftype saberfish-spawner-query-msg (structure) - ((query-type uint64 :offset-assert 0) + ((query-type saberfish-query-type :offset-assert 0) (closest-nav-mesh-index int8 :offset-assert 8) (pos vector :inline :offset-assert 16) - (behavior uint64 :offset-assert 32) - (nav-mesh-index int8 :offset-assert 8) - (mesh basic :offset-assert 16) - (in-water? basic :offset-assert 40) - (can-go-to-ground? basic :offset-assert 40) + (behavior saberfish-find-behavior :offset-assert 32) + (nav-mesh-index int8 :offset 8) + (mesh nav-mesh :offset 16 :score 1) + (in-water? symbol :offset 40) + (can-go-to-ground? symbol :offset 40) ) :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ) -|# -#| +;; +++saberfish:saberfish-command +(defenum saberfish-command + :type int32 + (attack 0) + (hostile-orient 1) + (hostile 2) + (spin-attack 3) + (stare 4) + (start-terrain-transition 5) + ) +;; ---saberfish:saberfish-command + (deftype saberfish (nav-enemy) ((initial-y-angle float :offset-assert 620) - (last-attack-time uint64 :offset-assert 624) - (in-pursuit? basic :offset-assert 632) - (flee-to-readjust? basic :offset-assert 636) - (use-stored-flee-point? basic :offset-assert 640) - (scare-start-time uint64 :offset-assert 648) - (scare-time uint64 :offset-assert 656) + (last-attack-time time-frame :offset-assert 624) + (in-pursuit? symbol :offset-assert 632) + (flee-to-readjust? symbol :offset-assert 636) + (use-stored-flee-point? symbol :offset-assert 640) + (scare-start-time time-frame :offset-assert 648) + (scare-time time-frame :offset-assert 656) (jump-point-start vector :inline :offset-assert 672) (jump-point-end vector :inline :offset-assert 688) - (align basic :offset-assert 148) - (jump saberfish-jump-info :inline :offset-assert 708) + (jump saberfish-jump-info :inline :offset 708) (flee-point-temp vector :inline :offset-assert 720) - (last-land-check-time uint64 :offset-assert 736) - (last-target-check-time uint64 :offset-assert 744) - (is-submerged? basic :offset-assert 752) + (last-land-check-time time-frame :offset-assert 736) + (last-target-check-time time-frame :offset-assert 744) + (is-submerged? symbol :offset-assert 752) (current-nav-mesh-index int8 :offset-assert 756) (dest-nav-mesh-index int8 :offset-assert 757) (desired-dest-nav-point vector :inline :offset-assert 768) (desired-dest-mesh-index int8 :offset-assert 784) (flee-point vector :inline :offset-assert 800) - (spawn-parent uint64 :offset-assert 816) + (spawn-parent handle :offset-assert 816) (pos-start vector :inline :offset-assert 832) (quat-start quaternion :inline :offset-assert 848) - (move-to-ground? basic :offset-assert 864) + (move-to-ground? symbol :offset-assert 864) (swim-final-rotate-deg float :offset-assert 868) (swim-travel-anim int8 :offset-assert 872) (swim-speed float :offset-assert 876) (swim-rotate-last-dot float :offset-assert 880) (swim-anim-last-dot float :offset-assert 884) - (last-swim-flip-time uint64 :offset-assert 888) + (last-swim-flip-time time-frame :offset-assert 888) (saberfish-y-rotate float :offset-assert 896) - (doing-180-spin? basic :offset-assert 900) - (adjusted-y-yet? basic :offset-assert 904) + (doing-180-spin? symbol :offset-assert 900) + (adjusted-y-yet? symbol :offset-assert 904) (attack-dir vector :inline :offset-assert 912) (rotate-anim-quat quaternion :inline :offset-assert 928) (post-spinflip-expected-heading vector :inline :offset-assert 944) (nav-velocity vector :inline :offset-assert 960) (nav-dir vector :inline :offset-assert 976) - (initial-state basic :offset-assert 992) - (knocked-under-water? basic :offset-assert 996) + (initial-state symbol :offset-assert 992) + (knocked-under-water? symbol :offset-assert 996) (ground-state uint8 :offset-assert 1000) (jump-start-ground-state uint8 :offset-assert 1001) - (ground-only? basic :offset-assert 1004) + (ground-only? symbol :offset-assert 1004) ) :method-count-assert 245 :size-assert #x3f0 :flag-assert #xf5037003f0 - (:methods - (saberfish-method-195 () none) ;; 195 - (saberfish-method-199 () none) ;; 199 - (saberfish-method-201 () none) ;; 201 - (saberfish-method-202 () none) ;; 202 - (saberfish-method-210 () none) ;; 210 - (saberfish-method-214 () none) ;; 214 - (saberfish-method-215 () none) ;; 215 - (saberfish-method-216 () none) ;; 216 - (saberfish-method-217 () none) ;; 217 - (saberfish-method-218 () none) ;; 218 - (saberfish-method-219 () none) ;; 219 - (saberfish-method-220 () none) ;; 220 - (saberfish-method-221 () none) ;; 221 - (saberfish-method-222 () none) ;; 222 - (saberfish-method-223 () none) ;; 223 - (saberfish-method-224 () none) ;; 224 - (saberfish-method-225 () none) ;; 225 - (saberfish-method-226 () none) ;; 226 - (saberfish-method-227 () none) ;; 227 - (saberfish-method-228 () none) ;; 228 - (saberfish-method-229 () none) ;; 229 - (saberfish-method-230 () none) ;; 230 - (saberfish-method-231 () none) ;; 231 - (saberfish-method-232 () none) ;; 232 - (saberfish-method-233 () none) ;; 233 - (saberfish-method-234 () none) ;; 234 - (saberfish-method-235 () none) ;; 235 - (saberfish-method-236 () none) ;; 236 - (saberfish-method-237 () none) ;; 237 - (saberfish-method-238 () none) ;; 238 - (saberfish-method-239 () none) ;; 239 - (saberfish-method-240 () none) ;; 240 - (saberfish-method-241 () none) ;; 241 - (saberfish-method-242 () none) ;; 242 - (saberfish-method-243 () none) ;; 243 - (saberfish-method-244 () none) ;; 244 - ) (:state-methods - saberfish-swimming ;; 213 - saberfish-crawl-out-of-tube ;; 209 - notice ;; 35 - command-mode ;; 206 + hit ;; 30 + knocked ;; 31 knocked-recover ;; 32 + idle ;; 33 + active ;; 34 + notice ;; 35 flee ;; 36 + stare ;; 37 + hostile ;; 38 + attack ;; 190 + hostile-orient ;; 191 + swimming-hostile ;; 192 + spin-attack ;; 193 + stare-idle ;; 194 + undefined0 ;; 195, not defined transition-terrain-move-towards-initial-jump ;; 196 transition-terrain-orient-towards-initial-jump ;; 197 transition-terrain-jump ;; 198 - knocked ;; 31 - water-impact ;; 205 - base-saberfish-state ;; 203 - attack ;; 190 - diving-into-water ;; 204 - hit ;; 30 - knocked-recover-water ;; 212 - hostile ;; 38 - stare-idle ;; 194 - idle ;; 33 - swim-180-spin ;; 207 - hostile-orient ;; 191 - saberfish-sitting-on-land ;; 211 - stare ;; 37 - spin-attack ;; 193 + undefined1 ;; 199, not defined water-land ;; 200 - active ;; 34 + undefined2 ;; 201, not defined + undefined3 ;; 202, not defined + base-saberfish-state ;; 203 + diving-into-water ;; 204 + water-impact ;; 205 + command-mode ;; 206 + swim-180-spin ;; 207 swimming-base ;; 208 - swimming-hostile ;; 192 + saberfish-crawl-out-of-tube ;; 209 + undefined4 ;; 210, not defined + saberfish-sitting-on-land ;; 211 + knocked-recover-water ;; 212 + saberfish-swimming ;; 213 + ) + (:methods + (saberfish-method-214 (_type_ vector) float) ;; 214 + (saberfish-method-215 (_type_) float) ;; 215 + (get-cmd (_type_) saberfish-command) ;; 216 + (saberfish-method-217 (_type_) none) ;; 217 + (saberfish-method-218 (_type_) none) ;; 218 + (saberfish-method-219 (_type_) none) ;; 219 + (saberfish-method-220 (_type_) none) ;; 220 + (handle-cmd (_type_ saberfish-command) object) ;; 221 + (attack-delay-elapsed? (_type_) symbol) ;; 222 + (saberfish-method-223 (_type_) none) ;; 223 + (go-terrain-transition (_type_ symbol) object) ;; 224 + (get-nav-mesh-idx (_type_ vector saberfish-find-behavior) int) ;; 225 + (start-terrain-transition (_type_) object) ;; 226 + (desired-nav-idx-valid? (_type_) symbol) ;; 227 + (saberfish-method-228 (_type_) symbol) ;; 228 + (set-dest-nav! (_type_ vector saberfish-find-behavior) none) ;; 229 + (change-nav-mesh (_type_) none) ;; 230 + (saberfish-method-231 (_type_ vector float symbol vector) symbol) ;; 231 + (do-jump (_type_) object) ;; 232 + (saberfish-method-233 (_type_) nav-poly) ;; 233 + (saberfish-method-234 (_type_ vector) none) ;; 234 + (on-submerged (_type_ symbol) none) ;; 235 + (saberfish-method-236 (_type_ int) nav-mesh) ;; 236 + (saberfish-method-237 (_type_ int) symbol) ;; 237 + (saberfish-method-238 (_type_ symbol float float) object) ;; 238 + (saberfish-method-239 (_type_ vector) float) ;; 239 + (saberfish-method-240 (_type_ time-frame) none) ;; 240 + (saberfish-method-241 (_type_) symbol) ;; 241 + (get-ground-state (_type_) int) ;; 242 + (saberfish-method-243 (_type_) symbol) ;; 243 + (set-should-move-to-ground (_type_) none) ;; 244 + ) + (:states + transition-terrain-jump-from-water + transition-terrain-jump-from-land ) ) -|# -;; (define-extern find-behavior<-in-water? function) -;; (define-extern in-water<-find-behavior function) -;; (define-extern *saberfish-nav-enemy-info* nav-enemy-info) -;; (define-extern get-spawn-parent function) -;; (define-extern saberfish-water-post function) -;; (define-extern saberfish-chase-post function) -;; (define-extern saberfish-orient-code-setup function) -;; (define-extern saberfish-orient-code-single-pass function) -;; (define-extern saberfish-orient-code function) -;; (define-extern saberfish-swim-code function) -;; (define-extern saberfish-swim-travel-trans function) -;; (define-extern swimming-base-exit function) -;; (define-extern transition-terrain-jump-from-water state) -;; (define-extern jump-from-land-dive-anim function) -;; (define-extern transition-terrain-jump-from-land state) -;; (define-extern transition-pursue-behavior function) -;; (define-extern turbo-swim function) -;; (define-extern saberfish-command-event-handler function) -;; (define-extern saberfish-init-by-other function) -;; (define-extern find-ground-for-obj function) +(define-extern find-behavior<-in-water? (function symbol saberfish-find-behavior)) +(define-extern in-water<-find-behavior (function saberfish-find-behavior symbol)) +(define-extern *saberfish-nav-enemy-info* nav-enemy-info) +(define-extern get-spawn-parent (function process :behavior saberfish)) +(define-extern saberfish-water-post (function none :behavior saberfish)) +(define-extern saberfish-chase-post (function none :behavior saberfish)) +(define-extern saberfish-orient-code-setup (function none :behavior saberfish)) +(define-extern saberfish-orient-code-single-pass (function float float :behavior saberfish)) +(define-extern saberfish-orient-code (function none :behavior saberfish)) +(define-extern saberfish-swim-code (function none :behavior saberfish)) +(define-extern saberfish-swim-travel-trans (function none :behavior saberfish)) +(define-extern swimming-base-exit (function none :behavior saberfish)) +(define-extern jump-from-land-dive-anim (function none :behavior saberfish)) +(define-extern transition-pursue-behavior (function none :behavior saberfish)) +(define-extern turbo-swim (function symbol :behavior saberfish)) +(define-extern saberfish-command-event-handler (function process int symbol event-message-block object :behavior saberfish)) +(define-extern saberfish-init-by-other (function process-drawable saberfish-init-by-other-params object :behavior saberfish)) +(define-extern find-ground-for-obj (function process-focusable int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; saberfish-spawner ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; path-index-array is already defined! - -#| -(deftype nav-mesh-jump (structure) - ((mesh basic :offset-assert 0) - (paths basic :offset-assert 4) - (in-water? basic :offset-assert 8) - ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c - ) -|# - -#| -(deftype nav-mesh-jump-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) +(deftype path-index-array (inline-array-class) + ((data int8 :dynamic :offset-assert 16) ;; guessed by decompiler + ) + :method-count-assert 14 + :size-assert #x10 + :flag-assert #xe00000010 + ) + +(deftype nav-mesh-jump (structure) + ((mesh nav-mesh :offset-assert 0) + (paths path-index-array :offset-assert 4) + (in-water? symbol :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype nav-mesh-jump-array (inline-array-class) + ((data nav-mesh-jump :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype saberfish-spawner-command (structure) - ((command basic :offset-assert 0) - (message basic :offset-assert 4) - (initial-state basic :offset-assert 8) - (parent uint64 :offset-assert 16) + ((command symbol :offset-assert 0) + (message symbol :offset-assert 4) + (initial-state symbol :offset-assert 8) + (parent handle :offset-assert 16) ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype saberfish-spawn-query (structure) ((alive-count int16 :offset-assert 0) ) @@ -45545,61 +45592,55 @@ :size-assert #x2 :flag-assert #x900000002 ) -|# -#| (deftype saberfish-spawner (process-drawable) - ((jump-paths basic :offset-assert 200) - (nav-mesh-jumps basic :offset-assert 204) + ((jump-paths (array path-control) :offset-assert 200) + (nav-mesh-jumps nav-mesh-jump-array :offset-assert 204) (live-count int8 :offset-assert 208) - (last-spawned-process uint64 :offset-assert 216) - (mgr-parent uint64 :offset-assert 224) - (spawned-saberfish UNKNOWN 128 :offset-assert 232) + (last-spawned-process handle :offset-assert 216) + (mgr-parent handle :offset-assert 224) + (spawned-saberfish handle 128 :offset-assert 232) (num-spawned-saberfish int32 :offset-assert 1256) ) :method-count-assert 27 :size-assert #x4ec :flag-assert #x1b047004ec - (:methods - (saberfish-spawner-method-21 () none) ;; 21 - (saberfish-spawner-method-22 () none) ;; 22 - (saberfish-spawner-method-23 () none) ;; 23 - (saberfish-spawner-method-24 () none) ;; 24 - (saberfish-spawner-method-25 () none) ;; 25 - (saberfish-spawner-method-26 () none) ;; 26 - ) (:state-methods saberfish-spawner-base-state ;; 20 ) + (:methods + (saberfish-spawner-method-21 (_type_) none) ;; 21 + (saberfish-spawner-method-22 (_type_ vector saberfish-find-behavior) int) ;; 22 + (draw-paths (_type_) none) ;; 23 + (saberfish-spawner-method-24 (_type_ saberfish) int) ;; 24 + (spawn-saberfish (_type_ symbol symbol process) none) ;; 25 + (saberfish-spawner-method-26 (_type_ process int symbol event-message-block) object) ;; 26 + ) ) -|# -#| (deftype saberfish-spawn-manager-base (process) - ((actor-group uint32 :offset-assert 124) - (actor-group-count int32 :offset-assert 128) - (total-num-spawned int32 :offset-assert 132) - (total-alive int32 :offset-assert 136) - (spawn-timer uint64 :offset-assert 140) - (state-time uint64 :offset-assert 148) - (allowed-on-land-count int8 :offset-assert 156) + ((actor-group (pointer actor-group) :offset-assert 128) + (actor-group-count int32 :offset-assert 132) + (total-num-spawned int32 :offset-assert 136) + (total-alive int32 :offset-assert 140) + (spawn-timer time-frame :offset-assert 144) + (state-time time-frame :offset-assert 152) + (allowed-on-land-count int8 :offset-assert 160) ) :method-count-assert 19 :size-assert #xa1 :flag-assert #x13003000a1 - (:methods - (saberfish-spawn-manager-base-method-16 () none) ;; 16 - (saberfish-spawn-manager-base-method-17 () none) ;; 17 - (saberfish-spawn-manager-base-method-18 () none) ;; 18 - ) (:state-methods - idle ;; 15 active ;; 14 + idle ;; 15 + ) + (:methods + (go-active (_type_) object) ;; 16 + (get-alive-count (_type_) int) ;; 17 + (get-alive-count-grounded (_type_ int) int) ;; 18 ) ) -|# -#| (deftype saberfish-mgr-room1 (saberfish-spawn-manager-base) () :method-count-assert 19 @@ -45609,25 +45650,22 @@ active ;; 14 ) ) -|# -#| (deftype saberfish-mgr-room2 (saberfish-spawn-manager-base) () :method-count-assert 22 :size-assert #xa1 :flag-assert #x16003000a1 (:state-methods - stage-2 ;; 21 - stage-1 ;; 20 stage-0 ;; 19 + stage-1 ;; 20 + stage-2 ;; 21 ) ) -|# -;; (define-extern *temporary-closest-nav-mesh-indices* object) -;; (define-extern *temporary-num-paths-per-nav-mesh-count* object) -;; (define-extern saberfish-mgr-event-handler function) +(define-extern *temporary-closest-nav-mesh-indices* (pointer int8)) +(define-extern *temporary-num-paths-per-nav-mesh-count* (pointer uint8)) +(def-event-handler saberfish-mgr-event-handler saberfish-spawn-manager-base) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; needle-fish ;; @@ -45694,66 +45732,72 @@ ;; sewer-frog ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sewer-frog (nav-enemy) - ((scared-timer uint64 :offset-assert 624) + ((scared-timer time-frame :offset-assert 624) ) :method-count-assert 193 :size-assert #x278 :flag-assert #xc102000278 - (:methods - (sewer-frog-method-192 () none) ;; 192 - ) (:state-methods knocked ;; 31 - flee ;; 36 - hostile ;; 38 - stare ;; 37 - attack ;; 190 active ;; 34 + flee ;; 36 + stare ;; 37 + hostile ;; 38 + attack ;; 190 turn-to-face-focus ;; 191 ) + (:methods + (sewer-frog-method-192 (_type_) none) ;; 192 + ) ) -|# -;; (define-extern *fact-info-sewer-frog-defaults* fact-info-enemy-defaults) -;; (define-extern *sewer-frog-nav-enemy-info* nav-enemy-info) -;; (define-extern sewer-frog-hop function) -;; (define-extern sewer-frog-turn-to-face function) -;; (define-extern sewer-frog-check-hop function) +(define-extern *fact-info-sewer-frog-defaults* fact-info-enemy-defaults) +(define-extern *sewer-frog-nav-enemy-info* nav-enemy-info) +(define-extern sewer-frog-hop (function none :behavior sewer-frog)) +(define-extern sewer-frog-turn-to-face (function vector none :behavior sewer-frog)) +(define-extern sewer-frog-check-hop (function none :behavior sewer-frog)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; spydroid-orig ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++spydroid-orig:spydroid-orig-flag +(defenum spydroid-orig-flag + :type uint64 + :bitfield #t + (sof0 0) + (sof1 1) + (sof2 2) + ) +;; ---spydroid-orig:spydroid-orig-flag + (deftype spydroid-orig (nav-enemy) ((old-y-deg float :offset-assert 620) (diff-angle float :offset-assert 624) - (flags uint64 :offset-assert 632) - (lightning UNKNOWN 4 :offset-assert 640) + (flags spydroid-orig-flag :offset-assert 632) + (lightning lightning-control 4 :offset-assert 640) (floor float :offset-assert 656) - (explode-part basic :offset-assert 660) + (explode-part sparticle-launch-control :offset-assert 660) ) :method-count-assert 192 :size-assert #x298 :flag-assert #xc002200298 (:state-methods stare ;; 37 + notice ;; 35 + hostile ;; 38 + die-falling ;; 41 pacing ;; 156 circling ;; 157 - hostile ;; 38 attack ;; 190 - die-falling ;; 41 - notice ;; 35 explode ;; 191 ) ) -|# -;; (define-extern *spydroid-orig-exploder-params* joint-exploder-static-params) -;; (define-extern *fact-info-spydroid-orig-defaults* fact-info-enemy-defaults) -;; (define-extern *spydroid-orig-nav-enemy-info* nav-enemy-info) +(define-extern *spydroid-orig-exploder-params* joint-exploder-static-params) +(define-extern *fact-info-spydroid-orig-defaults* fact-info-enemy-defaults) +(define-extern *spydroid-orig-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; flyingsaw ;; @@ -45838,13 +45882,12 @@ ;; kg-hopper ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype kg-hopper (nav-enemy) ((speed-y float :offset-assert 620) (accel-y float :offset-assert 624) (next-jump-time int32 :offset-assert 628) - (path-intro basic :offset-assert 632) - (can-go-knocked? basic :offset-assert 636) + (path-intro path-control :offset-assert 632) + (can-go-knocked? symbol :offset-assert 636) (land-anim-index int32 :offset-assert 640) (step-num int32 :offset-assert 644) (best-point vector :inline :offset-assert 656) @@ -45863,57 +45906,52 @@ :method-count-assert 194 :size-assert #x2f0 :flag-assert #xc2027002f0 - (:methods - (kg-hopper-method-191 () none) ;; 191 - (kg-hopper-method-192 () none) ;; 192 - (kg-hopper-method-193 () none) ;; 193 - ) (:state-methods + active ;; 34 notice ;; 35 - hostile ;; 38 stare ;; 37 + hostile ;; 38 jump ;; 44 ambush ;; 47 - active ;; 34 explode ;; 190 ) + (:methods + (kg-hopper-method-191 (_type_) symbol) ;; 191 + (kg-hopper-method-192 () none) ;; 192 + (get-skel (_type_) art-group) ;; 193 + ) ) -|# -#| (deftype kg-hopper-anim-info (structure) ((hit-anim-index int32 :offset-assert 0) (land-anim-index int32 :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype kg-hopper-global-info (basic) ((prev-yellow-hit int8 :offset-assert 4) (prev-blue-hit int8 :offset-assert 5) - (yellow-hit-anim UNKNOWN 3 :offset-assert 8) - (blue-hit-anim UNKNOWN 3 :offset-assert 32) + (yellow-hit-anim kg-hopper-anim-info 3 :inline :offset-assert 8) + (blue-hit-anim kg-hopper-anim-info 3 :inline :offset-assert 32) ) :method-count-assert 9 :size-assert #x38 :flag-assert #x900000038 ) -|# -;; (define-extern *kg-hopper-debris-params* debris-static-params) -;; (define-extern *kg-hopper-global-info* kg-hopper-global-info) -;; (define-extern *kg-hopper-nav-enemy-info* nav-enemy-info) -;; (define-extern *kg-hopper-next-jump-time* object) +(define-extern *kg-hopper-debris-params* debris-static-params) +(define-extern *kg-hopper-global-info* kg-hopper-global-info) +(define-extern *kg-hopper-nav-enemy-info* nav-enemy-info) +(define-extern *kg-hopper-next-jump-time* time-frame) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; neo-grenadier ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype bank-info (structure) ((circle sphere :inline :offset-assert 0) (tangent-pos vector :inline :offset-assert 16) @@ -45924,53 +45962,60 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| +;; +++neo-grenadier:grenadier-status-flag +(defenum grenadier-status-flag + :type uint64 + :bitfield #t + (gsf0 0) + (gsf1 1) + (gsf2 2) + (gsf3 3) + ) +;; ---neo-grenadier:grenadier-status-flag + (deftype neo-grenadier (nav-enemy) ((shot-trajectory trajectory :inline :offset-assert 624) - (hostile-path basic :offset-assert 664) + (hostile-path path-control :offset-assert 664) (bank bank-info :inline :offset-assert 672) (joint joint-mod-blend-world :offset-assert 736) - (heading basic :offset-assert 740) + (heading symbol :offset-assert 740) (move-pos vector :inline :offset-assert 752) (move-angle float :offset-assert 768) - (status-flags uint64 :offset-assert 776) - (suppress-knockaside-timer uint64 :offset-assert 784) + (status-flags grenadier-status-flag :offset-assert 776) + (suppress-knockaside-timer time-frame :offset-assert 784) ) :method-count-assert 196 :size-assert #x318 :flag-assert #xc402a00318 - (:methods - (neo-grenadier-method-193 () none) ;; 193 - (neo-grenadier-method-194 () none) ;; 194 - (neo-grenadier-method-195 () none) ;; 195 - ) (:state-methods - victory ;; 39 hit ;; 30 - spin-kick ;; 192 - hostile ;; 38 - backup ;; 191 - notice ;; 35 - attack ;; 190 active ;; 34 + notice ;; 35 + hostile ;; 38 + victory ;; 39 + attack ;; 190 + backup ;; 191 + spin-kick ;; 192 + ) + (:methods + (neo-grenadier-method-193 (_type_) none) ;; 193 + (set-bank-info! (_type_ vector) none) ;; 194 + (neo-grenadier-method-195 (_type_) none) ;; 195 ) ) -|# -;; (define-extern *fact-info-neo-grenadier-defaults* fact-info-enemy-defaults) -;; (define-extern *neo-grenadier-nav-enemy-info* nav-enemy-info) -;; (define-extern pos-rotate-y<-vector+vector function) ;; (function vector vector float) +(define-extern *fact-info-neo-grenadier-defaults* fact-info-enemy-defaults) +(define-extern *neo-grenadier-nav-enemy-info* nav-enemy-info) +(define-extern pos-rotate-y<-vector+vector (function vector vector float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; neo-juicer ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype neo-juicer-shot (projectile) - ((lightning UNKNOWN 5 :offset-assert 512) - (victim uint64 :offset-assert 536) + ((lightning lightning-control 5 :offset-assert 512) + (victim handle :offset-assert 536) ) :method-count-assert 41 :size-assert #x220 @@ -45979,87 +46024,81 @@ dissipate ;; 21 ) ) -|# -#| (deftype neo-juicer-anim-info (structure) ((anim-index int32 :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype neo-juicer-global-info (basic) ((prev-yellow-hit int8 :offset-assert 4) (prev-blue-hit int8 :offset-assert 5) - (idle-anim UNKNOWN 3 :offset-assert 8) - (patrol-anim UNKNOWN 2 :offset-assert 20) - (notice-anim UNKNOWN 2 :offset-assert 28) - (charge-anim UNKNOWN 2 :offset-assert 36) - (knocked-anim UNKNOWN 2 :offset-assert 44) - (celebrate-anim UNKNOWN 2 :offset-assert 52) - (yellow-hit-anim UNKNOWN 4 :offset-assert 60) - (blue-hit-anim UNKNOWN 6 :offset-assert 76) + (idle-anim neo-juicer-anim-info 3 :inline :offset-assert 8) + (patrol-anim neo-juicer-anim-info 2 :inline :offset-assert 20) + (notice-anim neo-juicer-anim-info 2 :inline :offset-assert 28) + (charge-anim neo-juicer-anim-info 2 :inline :offset-assert 36) + (knocked-anim neo-juicer-anim-info 2 :inline :offset-assert 44) + (celebrate-anim neo-juicer-anim-info 2 :inline :offset-assert 52) + (yellow-hit-anim neo-juicer-anim-info 4 :inline :offset-assert 60) + (blue-hit-anim neo-juicer-anim-info 6 :inline :offset-assert 76) ) :method-count-assert 9 :size-assert #x64 :flag-assert #x900000064 ) -|# -#| (deftype neo-juicer (nav-enemy) ((los los-control :inline :offset-assert 624) - (intro-path basic :offset-assert 788) - (joint basic :offset-assert 792) - (joint-enable basic :offset-assert 796) + (intro-path path-control :offset-assert 788) + (joint joint-mod :offset-assert 792) + (joint-enable symbol :offset-assert 796) (joint-blend float :offset-assert 800) - (last-fire-time uint64 :offset-assert 808) - (heading basic :offset-assert 816) + (last-fire-time time-frame :offset-assert 808) + (heading symbol :offset-assert 816) (move-angle float :offset-assert 820) - (torso-track-player basic :offset-assert 824) - (circle-backward? basic :offset-assert 832) - (using-turn-anim basic :offset-assert 836) - (hit-focus basic :offset-assert 840) + (torso-track-player joint-mod :offset-assert 824) + (circle-backward? symbol :offset 832) + (using-turn-anim symbol :offset-assert 836) + (hit-focus focus :offset-assert 840) (ambush-path-pt int8 :offset-assert 844) (charge-index int8 :offset-assert 845) (hostile-dest vector :inline :offset-assert 848) - (current-projectile uint64 :offset-assert 864) + (current-projectile handle :offset-assert 864) ) :method-count-assert 197 :size-assert #x368 :flag-assert #xc502f00368 - (:methods - (neo-juicer-method-192 () none) ;; 192 - (neo-juicer-method-193 () none) ;; 193 - (neo-juicer-method-194 () none) ;; 194 - (neo-juicer-method-195 () none) ;; 195 - (neo-juicer-method-196 () none) ;; 196 - ) (:state-methods - stare ;; 37 hit ;; 30 - circling ;; 157 - taunt ;; 155 + active ;; 34 + notice ;; 35 + stare ;; 37 hostile ;; 38 victory ;; 39 - attack ;; 191 - notice ;; 35 - ambush-cont ;; 190 ambush ;; 47 - active ;; 34 + taunt ;; 155 + circling ;; 157 + ambush-cont ;; 190 + attack ;; 191 + ) + (:methods + (go-die-or-knocked (_type_) object) ;; 192 + (spawn-proj! (_type_ process-focusable uint) none) ;; 193 + (track-focus! (_type_) none) ;; 194 + (start-tracking (_type_) none) ;; 195 + (toggle-deadly-flag (_type_ symbol) none) ;; 196 ) ) -|# -;; (define-extern neo-juicer-proj-move function) -;; (define-extern *neo-juicer-global-info* neo-juicer-global-info) -;; (define-extern *fact-info-neo-juicer-defaults* fact-info-enemy-defaults) -;; (define-extern *neo-juicer-nav-enemy-info* nav-enemy-info) -;; (define-extern neo-juicer-face-player-post function) +(define-extern neo-juicer-proj-move (function neo-juicer-shot none)) +(define-extern *neo-juicer-global-info* neo-juicer-global-info) +(define-extern *fact-info-neo-juicer-defaults* fact-info-enemy-defaults) +(define-extern *neo-juicer-nav-enemy-info* nav-enemy-info) +(define-extern neo-juicer-face-player-post (function none :behavior neo-juicer)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mh-wasp-part ;; @@ -47631,18 +47670,52 @@ ;; nav-graph-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(defenum nav-branch-clock-type + :type uint8 + (no-clock 0) + (clock2 1) + (clock3 2) + (clock4 3) + ) + +(defenum nav-branch-clock-mask + :type uint8 + :bitfield #t + (phase-1 0) + (phase-1a 1) + (phase-2 2) + (phase-2a 3) + (phase-3 4) + (phase-3a 5) + (phase-4 6) + (phase-4a 7) + ) + +(defenum nav-branch-flags + :bitfield #t + :type uint8 + (nabflags-0) + (nabflags-1) + (nabflags-2) + (nabflags-3) + (nabflags-4) + (nabflags-5) + (nabflags-6) + (nabflags-7) + ) + +(declare-type nav-node structure) (deftype nav-branch (structure) ((node nav-node 2 :offset-assert 0) ;; guessed by decompiler - (src-node nav-node :offset-assert 0) ;; guessed by decompiler - (dest-node nav-node :offset-assert 4) ;; guessed by decompiler - (temp-dest-node-id int32 :offset-assert 4) + (src-node nav-node :offset 0) ;; guessed by decompiler + (dest-node nav-node :offset 4) ;; guessed by decompiler + (temp-dest-node-id int32 :offset 4) (speed-limit uint8 :offset-assert 8) (density uint8 :offset-assert 9) - (clock-type uint8 :offset-assert 10) ;; nav-branch-clock-type - (clock-mask uint8 :offset-assert 11) ;; nav-branch-clock-mask - (territory uint8 :offset-assert 10) - (exclusive-branch-id uint8 :offset-assert 11) + (clock-type nav-branch-clock-type :offset-assert 10) + (clock-mask nav-branch-clock-mask :offset-assert 11) + (territory uint8 :offset 10) + (exclusive-branch-id uint8 :offset 11) (max-user-count uint8 :offset-assert 12) (user-count uint8 :offset-assert 13) (width uint8 :offset-assert 14) @@ -47666,24 +47739,33 @@ (nav-branch-method-20 () none) ;; 20 ;; (set-dst-node (_type_ nav-node) none) ) ) -|# -#| +(defenum nav-node-flag-byte + "The same as [[nav-node-flag]] but more compact" + :type uint8 + :bitfield #t + (visited 0) + (blocked 1) + (pedestrian 2) + (selected 3) + (hidden 4) + ) + (deftype nav-node (structure) - ((data uint32 32 :offset-assert 0) ;; guessed by decompiler - (position vector :inline :offset-assert 0) - (pos-x float :offset-assert 0) - (pos-y float :offset-assert 4) - (pos-z float :offset-assert 8) - (angle uint16 :offset-assert 12) - (id uint16 :offset-assert 14) - (radius uint8 :offset-assert 16) - (branch-count int8 :offset-assert 17) - (flags nav-node-flag :offset-assert 18) ;; nav-node-flag-byte - (pad0 int8 1 :offset-assert 19) ;; guessed by decompiler - (branch-array (inline-array nav-branch) :offset-assert 20) ;; guessed by decompiler - (nav-mesh-id uint32 :offset-assert 24) - (level symbol :offset-assert 28) ;; guessed by decompiler + ((data uint32 8 :offset-assert 0 :score -1) ;; guessed by decompiler + (position vector :inline :offset 0) + (pos-x float :offset 0) + (pos-y float :offset 4) + (pos-z float :offset 8) + (angle uint16 :offset 12) + (id uint16 :offset 14) + (radius uint8 :offset 16) + (branch-count int8 :offset 17) + (flags nav-node-flag-byte :offset 18) ;; nav-node-flag-byte + (pad0 int8 1 :offset 19) ;; guessed by decompiler + (branch-array (inline-array nav-branch) :offset 20) ;; guessed by decompiler + (nav-mesh-id uint32 :offset 24) + (level symbol :offset 28) ;; guessed by decompiler ) :method-count-assert 22 :size-assert #x20 @@ -47705,9 +47787,7 @@ (nav-node-method-21 () none) ;; 21 ;; (get-radius (_type_) float) ) ) -|# -#| (deftype nav-graph-link (structure) ((id uint32 :offset-assert 0) (dest-graph-id uint32 :offset-assert 4) @@ -47720,7 +47800,6 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# #| (deftype nav-graph (basic) @@ -47782,7 +47861,6 @@ ) |# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cty-borrow-manager-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -47952,7 +48030,7 @@ ) |# -;; (define-extern *cty-faction-manager* object) +(define-extern *cty-faction-manager* symbol) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; traffic-engine-h ;; @@ -48325,6 +48403,22 @@ ;; vehicle-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum vehicle-controller-flag + :type uint32 + :bitfield #t + (debug) + (draw-marks) + (left-turn) + (on-straightaway) + (do-turn) + (blocking-dest-node) + (attached) + (off-path) + (ignore-others) + (direct-mode) + (recovery-mode) + (no-slowing-for-turns) + ) #| (deftype vehicle-controller (structure) ((flags vehicle-controller-flag :offset-assert 0) @@ -48869,10 +48963,10 @@ ;; (define-extern *default-faction-info* array) ;; (define-extern *default-faction-mod* object) ;; (define-extern *default-faction-strength-mod* object) -;; (define-extern setup-city-task-faction function) +(define-extern setup-city-task-faction (function object)) ;; (define-extern *exclusive-nav-mesh-list* array) ;; (define-extern map-symbol-to-nav-territory-type function) -;; (define-extern cty-faction-evaluate-commands function) +(define-extern cty-faction-evaluate-commands (function pair object)) ;; (define-extern is-faction-level-loaded? function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -49056,9 +49150,9 @@ ;; (define-extern city-target-type->cty-faction function) ;; (define-extern city-target-type->traffic-object-type function) ;; (define-extern symbol->city-target-type function) -;; (define-extern *cty-attack-controller* object) +(define-extern *cty-attack-controller* symbol) ;; (define-extern initialize-cty-attack-controller function) -;; (define-extern cty-attack-reset function) +(define-extern cty-attack-reset (function symbol symbol symbol none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; flee-info ;; @@ -52258,7 +52352,7 @@ ;; hfrag ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *hfrag-debug* object) +(define-extern *hfrag-debug* symbol) ;; (define-extern hfrag-vert-print function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -52493,7 +52587,6 @@ ;; squad-control-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype squad-unit-settings (structure) ((target-count int8 :offset-assert 0) (shot-count int8 :offset-assert 1) @@ -52509,13 +52602,23 @@ :size-assert #x12 :flag-assert #x900000012 ) -|# -#| +;; +++squad-control-h:squad-target-flag +(defenum squad-target-flag + :type uint8 + :bitfield #t + (visible-now) + (visible-recently) + (visible-ever) + (updated) + (force-visible) + ) +;; ---squad-control-h:squad-target-flag + (deftype squad-target-status (structure) ((flags squad-target-flag :offset-assert 0) - (handle uint64 :offset-assert 8) - (last-seen-time uint64 :offset-assert 16) + (handle handle :offset-assert 8) + (last-seen-time time-frame :offset-assert 16) (position vector :inline :offset-assert 32) (velocity vector :inline :offset-assert 48) (threat-level float :offset-assert 64) @@ -52525,9 +52628,21 @@ :flag-assert #x900000044 ;; field squad-target-flag is likely a value type. ) -|# -#| +;; +++squad-control-h:squad-alert-flag +(defenum squad-alert-flag + :type uint8 + :bitfield #t + (alert-ending) + (alarm-on) + (guard-multi-focus) + (sticky-guard-settings) + (disable-pursuit-control) + (update-target-search) + (war) + ) +;; ---squad-control-h:squad-alert-flag + (deftype squad-alert-state (structure) ((flags squad-alert-flag :offset-assert 0) (level uint8 :offset-assert 1) @@ -52536,78 +52651,89 @@ (guard-aim-count int8 :offset-assert 4) (guard-inaccuracy-factor float :offset-assert 8) (guard-target-level float :offset-assert 12) - (duration uint32 :offset-assert 16) - (start-time uint64 :offset-assert 24) - (notify-time uint64 :offset-assert 32) - (alarm-sound-id uint32 :offset-assert 40) - (target-status-array UNKNOWN 3 :offset-assert 48) - (target-status squad-target-status :inline :offset-assert 48) + (duration uint32 :offset-assert 16 :decomp-as time-frame) + (start-time time-frame :offset-assert 24) + (notify-time time-frame :offset-assert 32) + (alarm-sound-id sound-id :offset-assert 40) + (target-status-array squad-target-status 3 :inline :offset-assert 48) + (target-status squad-target-status :inline :offset 48) ) :method-count-assert 10 :size-assert #x120 :flag-assert #xa00000120 ;; field squad-alert-flag is likely a value type. (:methods - (squad-alert-state-method-9 () none) ;; 9 + (init! (_type_) none) ;; 9 ) ) -|# -#| (deftype primary-target-pos-vel (structure) ((position vector :inline :offset-assert 0) (velocity vector :inline :offset-assert 16) - (time uint32 :offset-assert 28) + (time uint32 :offset 28 :score 1) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype squad-control (basic) ((sync-clock uint8 :offset-assert 4) (sync-mask-8 uint8 :offset-assert 5) (sync-mask-16 uint16 :offset-assert 6) (sync-mask-32 uint32 :offset-assert 8) (alert-state squad-alert-state :inline :offset-assert 16) - (primary-target-history UNKNOWN 16 :offset-assert 304) + (primary-target-history primary-target-pos-vel 16 :inline :offset-assert 304) ) :method-count-assert 34 :size-assert #x330 :flag-assert #x2200000330 (:methods - (squad-control-method-9 () none) ;; 9 - (squad-control-method-10 () none) ;; 10 - (squad-control-method-11 () none) ;; 11 - (squad-control-method-12 () none) ;; 12 - (squad-control-method-13 () none) ;; 13 - (squad-control-method-14 () none) ;; 14 - (squad-control-method-15 () none) ;; 15 - (squad-control-method-16 () none) ;; 16 - (squad-control-method-17 () none) ;; 17 - (squad-control-method-18 () none) ;; 18 - (squad-control-method-19 () none) ;; 19 - (squad-control-method-20 () none) ;; 20 - (squad-control-method-21 () none) ;; 21 - (squad-control-method-22 () none) ;; 22 - (squad-control-method-23 () none) ;; 23 - (squad-control-method-24 () none) ;; 24 - (squad-control-method-25 () none) ;; 25 - (squad-control-method-26 () none) ;; 26 - (squad-control-method-27 () none) ;; 27 - (squad-control-method-28 () none) ;; 28 - (squad-control-method-29 () none) ;; 29 - (squad-control-method-30 () none) ;; 30 - (squad-control-method-31 () none) ;; 31 - (squad-control-method-32 () none) ;; 32 - (squad-control-method-33 () none) ;; 33 + (initialize (_type_ process) none) ;; 9 + (squad-control-method-10 (_type_) none) ;; 10 + (stop-alarm-sound (_type_) none) ;; 11 + (init-alert (_type_) none) ;; 12 + (update (_type_) none) ;; 13 + (set-sync-mask (_type_) none) ;; 14 + (probe-backgnd-collision (_type_ vector vector) symbol) ;; 15 + (squad-control-method-16 (_type_ vector process-focusable squad-target-status) none) ;; 16 + (squad-control-method-17 (_type_ vector int squad-target-status) none) ;; 17 + (squad-control-method-18 (_type_ int process) int) ;; 18 + (set-alert-level0 (_type_ int) int) ;; 19 + (start-alert (_type_ int) none) ;; 20 + (set-alert-level (_type_ int) none) ;; 21 + (get-alert-level (_type_) int) ;; 22 + (set-alert-duration (_type_ time-frame) none) ;; 23 + (squad-control-method-24 (_type_) int) ;; 24 + (squad-control-method-25 (_type_ primary-target-pos-vel time-frame) none) ;; 25 + (set-pos-vel (_type_ primary-target-pos-vel) primary-target-pos-vel) ;; 26 + (squad-control-method-27 (_type_ process float) none) ;; 27 + (get-idx-in-status-arr (_type_ handle) int) ;; 28 + (valid-target-handle? (_type_ handle) symbol) ;; 29 + (get-target-focus (_type_) process-focusable) ;; 30 + (squad-control-method-31 (_type_ vector process-focusable handle float float) none) ;; 31 + (get-handle-pos (_type_ handle vector) vector) ;; 32 + (get-focus-in-range (_type_ process-focusable) process-focusable) ;; 33 ) ) -|# -;; (define-extern *waswide-squad-control* object) +;; added +(deftype squad-control-stack-type0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (float0 float :offset 32) + (byte0 int8 :offset 36) + (mesh nav-mesh :offset 40) + (cquery collide-query :inline :offset 64) + (vec2 vector :inline :offset 272) + (vec3 vector :inline :offset 288) + (float1 float :offset 604) + (float2 float :offset 608) + (float3 float :offset 612) + ) + ) + +(define-extern *waswide-squad-control* squad-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; squad-control ;; @@ -52618,17 +52744,14 @@ ;; vehicle-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype vehicle-info (structure) - ((handle-by-vehicle-type UNKNOWN 44 :offset-assert 0) + ((handle-by-vehicle-type handle 44 :offset-assert 0) ) :method-count-assert 9 :size-assert #x160 :flag-assert #x900000160 ) -|# -#| (deftype vehicle-lookup-info (structure) ((turn-radius meters :offset-assert 0) (throttle-turning float :offset-assert 4) @@ -52638,9 +52761,7 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype vehicle-control-point (structure) ((local-pos vector :inline :offset-assert 0) (normal vector :inline :offset-assert 16) @@ -52649,9 +52770,7 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype vehicle-attach-point (structure) ((local-pos vector :inline :offset-assert 0) (rot vector :inline :offset-assert 16) @@ -52660,13 +52779,26 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| +;; +++vehicle-h:vehicle-wheel-flag +(defenum vehicle-wheel-flag + :type uint64 + :bitfield #t + (vwf0 0) + (vwf1 1) + (vwf2 2) + (vwf3 3) + (vwf4 4) + (vwf5 5) + ) +;; ---vehicle-h:vehicle-wheel-flag + +(declare-type vehicle-wheel-state structure) + (deftype vehicle-wheel-info (structure) ((local-pos vector :inline :offset-assert 0) - (flags uint64 :offset-assert 16) - (callback basic :offset-assert 24) + (flags vehicle-wheel-flag :offset-assert 16) + (callback (function rigid-body-object vehicle-wheel-state vehicle-wheel-info none) :offset-assert 24) (inertia float :offset-assert 28) (radius float :offset-assert 32) (susp-arm-length float :offset-assert 36) @@ -52683,16 +52815,14 @@ (camber float :offset-assert 80) (settle-pos float :offset-assert 84) (probe-radius float :offset-assert 88) - (tread-texture basic :offset-assert 92) - (tread-tid uint32 :offset-assert 96) + (tread-texture string :offset-assert 92) + (tread-tid texture-id :offset-assert 96) ) :method-count-assert 9 :size-assert #x64 :flag-assert #x900000064 ) -|# -#| (deftype vehicle-engine-info (structure) ((max-torque float :offset-assert 0) (inertia float :offset-assert 4) @@ -52705,28 +52835,25 @@ (peak-torque-rpm float :offset-assert 32) (powerband-width-rpm float :offset-assert 36) ) + :pack-me :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype vehicle-transmission-info (structure) ((inertia float :offset-assert 0) (upshift-rpm float :offset-assert 4) (downshift-rpm float :offset-assert 8) (final-drive-ratio float :offset-assert 12) - (gear-ratio-array UNKNOWN 8 :offset-assert 16) + (gear-ratio-array float 8 :offset-assert 16) (gear-count int8 :offset-assert 48) ) :method-count-assert 9 :size-assert #x31 :flag-assert #x900000031 ) -|# -#| (deftype vehicle-handling-info (structure) ((max-engine-thrust meters :offset-assert 0) (inv-max-engine-thrust float :offset-assert 4) @@ -52734,7 +52861,7 @@ (engine-intake-factor float :offset-assert 12) (brake-factor float :offset-assert 16) (turbo-boost-factor float :offset-assert 20) - (turbo-boost-duration uint16 :offset-assert 24) + (turbo-boost-duration uint16 :offset-assert 24 :decomp-as time-frame) (max-xz-speed meters :offset-assert 28) (player-turn-anim-bias float :offset-assert 32) (player-turn-anim-min float :offset-assert 36) @@ -52784,21 +52911,20 @@ (ai-steering-factor float :offset-assert 212) (ai-throttle-factor float :offset-assert 216) ) + :pack-me :method-count-assert 9 :size-assert #xdc :flag-assert #x9000000dc ) -|# -#| (deftype vehicle-physics-model-info (structure) ((lift-thruster-count int8 :offset-assert 0) (roll-thruster-count int8 :offset-assert 1) (stabilizer-count int8 :offset-assert 2) (inv-lift-thruster-count float :offset-assert 4) - (lift-thruster-array UNKNOWN 4 :offset-assert 16) - (roll-thruster-array UNKNOWN 2 :offset-assert 144) - (stabilizer-array UNKNOWN 6 :offset-assert 208) + (lift-thruster-array vehicle-attach-point 4 :inline :offset-assert 16) + (roll-thruster-array vehicle-attach-point 2 :inline :offset-assert 144) + (stabilizer-array vehicle-attach-point 6 :inline :offset-assert 208) (engine-thrust-local-pos vector :inline :offset-assert 400) (brake-local-pos vector :inline :offset-assert 416) (wheel-count int8 :offset-assert 432) @@ -52810,9 +52936,7 @@ :size-assert #x294 :flag-assert #x900000294 ) -|# -#| (deftype vehicle-camera-info (structure) ((string-min-height meters :offset-assert 0) (string-max-height meters :offset-assert 4) @@ -52825,21 +52949,19 @@ (normal-max-angle-offset float :offset-assert 32) (air-max-angle-offset float :offset-assert 36) (max-lookaround-speed float :offset-assert 40) - (look-pos-array UNKNOWN 4 :offset-assert 48) - (look-front vector :inline :offset-assert 48) - (look-left vector :inline :offset-assert 64) - (look-right vector :inline :offset-assert 80) - (look-rear vector :inline :offset-assert 96) + (look-pos-array vector 4 :inline :offset-assert 48) + (look-front vector :inline :offset 48) + (look-left vector :inline :offset 64) + (look-right vector :inline :offset 80) + (look-rear vector :inline :offset 96) ) :method-count-assert 9 :size-assert #x70 :flag-assert #x900000070 ) -|# -#| (deftype vehicle-sound-loop-info (structure) - ((sound uint128 :offset-assert 0) + ((sound sound-name :offset-assert 0) (speed float :offset-assert 16) (min-speed float :offset-assert 20) (max-speed float :offset-assert 24) @@ -52852,87 +52974,99 @@ :size-assert #x2c :flag-assert #x90000002c ) -|# -#| (deftype vehicle-sound-info (structure) ((engine-pitch-scale float :offset-assert 0) (engine-pitch-offset float :offset-assert 4) (engine-pitch-mod-amp float :offset-assert 8) (engine-sound-select int8 :offset-assert 12) - (thrust-sound uint8 16 :offset-assert 16) ;; field uses ~g print with a quadword load! - (scrape-sound uint8 16 :offset-assert 32) ;; field uses ~g print with a quadword load! - (glance-sound uint8 16 :offset-assert 48) ;; field uses ~g print with a quadword load! - (impact-sound uint8 16 :offset-assert 64) ;; field uses ~g print with a quadword load! - (impact2-sound uint8 16 :offset-assert 80) ;; field uses ~g print with a quadword load! - (explode-sound uint8 16 :offset-assert 96) ;; field uses ~g print with a quadword load! - (explode2-sound uint8 16 :offset-assert 112) ;; field uses ~g print with a quadword load! - (extra-sound uint8 16 :offset-assert 128) ;; field uses ~g print with a quadword load! - (water-sound uint8 16 :offset-assert 144) ;; field uses ~g print with a quadword load! - (jump-sound uint8 16 :offset-assert 160) ;; field uses ~g print with a quadword load! - (turbo-sound uint8 16 :offset-assert 176) ;; field uses ~g print with a quadword load! - (damage-sound uint8 16 :offset-assert 192) ;; field uses ~g print with a quadword load! - (bank-replace basic :offset-assert 208) + ; (thrust-sound uint8 16 :offset 16) ;; field uses ~g print with a quadword load! + ; (scrape-sound uint8 16 :offset-assert 32) ;; field uses ~g print with a quadword load! + ; (glance-sound uint8 16 :offset-assert 48) ;; field uses ~g print with a quadword load! + ; (impact-sound uint8 16 :offset-assert 64) ;; field uses ~g print with a quadword load! + ; (impact2-sound uint8 16 :offset-assert 80) ;; field uses ~g print with a quadword load! + ; (explode-sound uint8 16 :offset-assert 96) ;; field uses ~g print with a quadword load! + ; (explode2-sound uint8 16 :offset-assert 112) ;; field uses ~g print with a quadword load! + ; (extra-sound uint8 16 :offset-assert 128) ;; field uses ~g print with a quadword load! + ; (water-sound uint8 16 :offset-assert 144) ;; field uses ~g print with a quadword load! + ; (jump-sound uint8 16 :offset-assert 160) ;; field uses ~g print with a quadword load! + ; (turbo-sound uint8 16 :offset-assert 176) ;; field uses ~g print with a quadword load! + ; (damage-sound uint8 16 :offset-assert 192) ;; field uses ~g print with a quadword load! + (thrust-sound sound-name :offset 16) + (scrape-sound sound-name :offset-assert 32) + (glance-sound sound-name :offset-assert 48) + (impact-sound sound-name :offset-assert 64) + (impact2-sound sound-name :offset-assert 80) + (explode-sound sound-name :offset-assert 96) + (explode2-sound sound-name :offset-assert 112) + (extra-sound sound-name :offset-assert 128) + (water-sound sound-name :offset-assert 144) + (jump-sound sound-name :offset-assert 160) + (turbo-sound sound-name :offset-assert 176) + (damage-sound sound-name :offset-assert 192) + (bank-replace pair :offset-assert 208) (idle-rpm float :offset-assert 212) (idle-pitch-scale float :offset-assert 216) (idle-crossover-rpm float :offset-assert 220) (engine-rpm float :offset-assert 224) (engine-crossover-rpm float :offset-assert 228) - (start-sound uint8 16 :offset-assert 240) ;; field uses ~g print with a quadword load! - (stop-sound uint8 16 :offset-assert 256) ;; field uses ~g print with a quadword load! - (idle-sound uint8 16 :offset-assert 272) ;; field uses ~g print with a quadword load! - (engine-sound uint8 16 :offset-assert 288) ;; field uses ~g print with a quadword load! - (engine-load-sound uint8 16 :offset-assert 304) ;; field uses ~g print with a quadword load! - (susp-creak-sound uint8 16 :offset-assert 320) ;; field uses ~g print with a quadword load! - (susp-bottom-out-sound uint8 16 :offset-assert 336) ;; field uses ~g print with a quadword load! + ; (start-sound uint8 16 :offset 240) ;; field uses ~g print with a quadword load! + ; (stop-sound uint8 16 :offset-assert 256) ;; field uses ~g print with a quadword load! + ; (idle-sound uint8 16 :offset-assert 272) ;; field uses ~g print with a quadword load! + ; (engine-sound uint8 16 :offset-assert 288) ;; field uses ~g print with a quadword load! + ; (engine-load-sound uint8 16 :offset-assert 304) ;; field uses ~g print with a quadword load! + ; (susp-creak-sound uint8 16 :offset-assert 320) ;; field uses ~g print with a quadword load! + ; (susp-bottom-out-sound uint8 16 :offset-assert 336) ;; field uses ~g print with a quadword load! + (start-sound sound-name :offset 240) + (stop-sound sound-name :offset-assert 256) + (idle-sound sound-name :offset-assert 272) + (engine-sound sound-name :offset-assert 288) + (engine-load-sound sound-name :offset-assert 304) + (susp-creak-sound sound-name :offset-assert 320) + (susp-bottom-out-sound sound-name :offset-assert 336) (susp-speed-threshold float :offset-assert 352) - (tire-roll-sounds UNKNOWN 4 :offset-assert 368) - (tire-slide-sounds UNKNOWN 2 :offset-assert 560) - (tire-roll-hum-sound vehicle-sound-loop-info :inline :offset-assert 368) - (tire-roll-dirt-sound vehicle-sound-loop-info :inline :offset-assert 416) - (tire-roll-sand-sound vehicle-sound-loop-info :inline :offset-assert 464) - (tire-roll-knobby-sound vehicle-sound-loop-info :inline :offset-assert 512) - (tire-slide-road-sound vehicle-sound-loop-info :inline :offset-assert 560) - (tire-slide-dirt-sound vehicle-sound-loop-info :inline :offset-assert 608) + (tire-roll-sounds vehicle-sound-loop-info 4 :inline :offset-assert 368) + (tire-slide-sounds vehicle-sound-loop-info 2 :inline :offset-assert 560) + (tire-roll-hum-sound vehicle-sound-loop-info :inline :offset 368) + (tire-roll-dirt-sound vehicle-sound-loop-info :inline :offset 416) + (tire-roll-sand-sound vehicle-sound-loop-info :inline :offset 464) + (tire-roll-knobby-sound vehicle-sound-loop-info :inline :offset 512) + (tire-slide-road-sound vehicle-sound-loop-info :inline :offset 560) + (tire-slide-dirt-sound vehicle-sound-loop-info :inline :offset 608) ) :method-count-assert 9 :size-assert #x290 :flag-assert #x900000290 ) -|# -#| (deftype vehicle-particle-info (structure) ((headlight-count int8 :offset-assert 0) (taillight-count int8 :offset-assert 1) (thruster-flame-width meters :offset-assert 4) (thruster-flame-length meters :offset-assert 8) - (thruster-local-pos UNKNOWN 2 :offset-assert 16) - (exhaust-local-pos UNKNOWN 2 :offset-assert 48) - (exhaust-local-dir UNKNOWN 2 :offset-assert 80) - (smoke-local-pos UNKNOWN 2 :offset-assert 112) - (smoke-local-vel UNKNOWN 2 :offset-assert 144) - (headlight-local-pos UNKNOWN 3 :offset-assert 176) - (taillight-local-pos UNKNOWN 2 :offset-assert 224) + (thruster-local-pos vector 2 :inline :offset-assert 16) + (exhaust-local-pos vector 2 :inline :offset-assert 48) + (exhaust-local-dir vector 2 :inline :offset-assert 80) + (smoke-local-pos vector 2 :inline :offset-assert 112) + (smoke-local-vel vector 2 :inline :offset-assert 144) + (headlight-local-pos vector 3 :inline :offset-assert 176) + (taillight-local-pos vector 2 :inline :offset-assert 224) ) :method-count-assert 9 :size-assert #x100 :flag-assert #x900000100 ) -|# -#| (deftype vehicle-section-info (structure) ((damage-seg-array uint64 3 :offset-assert 0) ;; guessed by decompiler (damage-seg-count int8 :offset-assert 24) ) + :pack-me :method-count-assert 9 :size-assert #x19 :flag-assert #x900000019 ) -|# -#| (deftype vehicle-damage-info (structure) ((inv-toughness-factor float :offset-assert 0) (hit-points float :offset-assert 4) @@ -52943,21 +53077,19 @@ (hit-deadly float :offset-assert 24) (impact-damage-factor float :offset-assert 28) (section-count int8 :offset-assert 32) - (section-array UNKNOWN 4 :offset-assert 40) - (section-bike-front vehicle-section-info :inline :offset-assert 40) - (section-bike-rear vehicle-section-info :inline :offset-assert 72) - (section-car-front-left vehicle-section-info :inline :offset-assert 40) - (section-car-rear-left vehicle-section-info :inline :offset-assert 72) - (section-car-front-right vehicle-section-info :inline :offset-assert 104) - (section-car-rear-right vehicle-section-info :inline :offset-assert 136) + (section-array vehicle-section-info 4 :inline :offset-assert 40) + (section-bike-front vehicle-section-info :inline :offset 40) + (section-bike-rear vehicle-section-info :inline :offset 72) + (section-car-front-left vehicle-section-info :inline :offset 40) + (section-car-rear-left vehicle-section-info :inline :offset 72) + (section-car-front-right vehicle-section-info :inline :offset 104) + (section-car-rear-right vehicle-section-info :inline :offset 136) ) :method-count-assert 9 :size-assert #xa8 :flag-assert #x9000000a8 ) -|# -#| (deftype vehicle-setup-info (structure) ((settle-height float :offset-assert 0) (settle-rot-x float :offset-assert 4) @@ -52966,63 +53098,67 @@ (look-select uint8 :offset-assert 16) (color-option-count int8 :offset-assert 17) (color-option-select int8 :offset-assert 18) + (color vector :offset-assert 20) ;; added (gun-yaw-min float :offset-assert 24) (gun-yaw-max float :offset-assert 28) (gun-pitch-min float :offset-assert 32) (gun-pitch-max float :offset-assert 36) (gun-z-offset float :offset-assert 40) ) + :pack-me :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ) -|# -#| +;; +++vehicle-h:vehicle-seat-flag +(defenum vehicle-seat-flag + :type uint8 + :bitfield #t + (vsf0 0) + (vsf1 1) + (vsf2 2) + ) +;; ---vehicle-h:vehicle-seat-flag + (deftype vehicle-seat-info (structure) - ((data uint8 16 :offset-assert 0) ;; guessed by decompiler - (position vector :inline :offset-assert 0) - (pos-x float :offset-assert 0) - (pos-y float :offset-assert 4) - (pos-z float :offset-assert 8) - (angle int16 :offset-assert 12) - (flags uint8 :offset-assert 14) + ((data uint8 16 :offset-assert 0 :score -1) ;; guessed by decompiler + (position vector :inline :offset 0) + (pos-x float :offset 0) + (pos-y float :offset 4) + (pos-z float :offset 8) + (angle int16 :offset 12) + (flags vehicle-seat-flag :offset 14) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype vehicle-grab-rail-info (structure) - ((local-pos vector 2 :offset-assert 0) ;; guessed by decompiler + ((local-pos vector 2 :inline :offset-assert 0) ;; guessed by decompiler (normal vector :inline :offset-assert 32) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype vehicle-rider-info (structure) ((seat-count int8 :offset-assert 0) (rider-stance uint8 :offset-assert 1) (grab-rail-count int8 :offset-assert 2) (attach-point-count int8 :offset-assert 3) - (grab-rail-array uint32 :offset-assert 4) - (seat-array UNKNOWN 4 :offset-assert 16) - (rider-hand-offset UNKNOWN 2 :offset-assert 80) - (attach-point-array uint32 :offset-assert 112) + (grab-rail-array (pointer vehicle-grab-rail-info) :offset-assert 4) + (seat-array vehicle-seat-info 4 :inline :offset-assert 16) + (rider-hand-offset vector 2 :inline :offset-assert 80) + (attach-point-array (inline-array vehicle-attach-point) :offset-assert 112) ) :method-count-assert 9 :size-assert #x74 :flag-assert #x900000074 ) -|# -#| (deftype vehicle-explosion-info (joint-exploder-static-params) ((skel skeleton-group :offset-assert 40) ;; guessed by decompiler (skel-name string :offset-assert 44) ;; guessed by decompiler @@ -53032,11 +53168,17 @@ :size-assert #x34 :flag-assert #x900000034 ) -|# -#| +;; bunch of fields missing from inspect (deftype vehicle-particle-common-info (structure) - ((headlight-glow-template sprite-glow-data :offset-assert 28) + ((sp-system2d sparticle-system :offset-assert 0) + (sp-system3d sparticle-system :offset-assert 4) + (part-thruster sparticle-launcher :offset-assert 8) + (part-thruster-x sp-field-init-spec :offset-assert 12) + (part-spec2 sp-field-init-spec :offset-assert 16) + (part-quat quaternion :offset-assert 20) + (part-vel vector :offset-assert 24) + (headlight-glow-template sprite-glow-data :offset-assert 28) (taillight-glow-template sprite-glow-data :offset-assert 32) (thruster-glow-template sprite-glow-data :offset-assert 36) ) @@ -53044,17 +53186,22 @@ :size-assert #x28 :flag-assert #xa00000028 (:methods - (vehicle-particle-common-info-method-9 () none) ;; 9 + (init! (_type_) none) ;; 9 ) ) -|# -#| +;; +++vehicle-h:vehicle-type-u8 +(defenum vehicle-type-u8 + :type uint8 + :copy-entries vehicle-type + ) +;; ---vehicle-h:vehicle-type-u8 + (deftype rigid-body-vehicle-constants (rigid-body-object-constants) ((flags uint32 :offset-assert 208) (object-type uint8 :offset-assert 212) (guard-type uint8 :offset-assert 213) - (vehicle-type uint8 :offset-assert 214) + (vehicle-type vehicle-type-u8 :offset-assert 214) (engine vehicle-engine-info :inline :offset-assert 216) (transmission vehicle-transmission-info :inline :offset-assert 256) (handling vehicle-handling-info :inline :offset-assert 308) @@ -53069,193 +53216,307 @@ (rider vehicle-rider-info :inline :offset-assert 2448) (explosion vehicle-explosion-info :offset-assert 2564) ;; guessed by decompiler (explosion-part int32 :offset-assert 2568) - (debris basic :offset-assert 2572) - (name-text uint32 :offset-assert 2576) + (debris debris-static-params :offset-assert 2572) + (name-text text-id :offset-assert 2576) (particle-common vehicle-particle-common-info :offset-assert 2580) ) :method-count-assert 10 :size-assert #xa18 :flag-assert #xa00000a18 (:methods - (rigid-body-vehicle-constants-method-9 () none) ;; 9 ;; (rigid-body-vehicle-constants-method-9 (_type_) none) + (init-part! (_type_) none) ;; 9 ) ) -|# -#| (deftype vehicle-section (structure) ((damage float :offset-assert 0) ) + :allow-misaligned :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| +;; +++vehicle-h:vehicle-flag +(defenum vehicle-flag + :type uint64 + :bitfield #t + (enable-collision 0) + (disturbed 1) + (damaged 2) + (dead 3) + (player-touching 4) + (player-edge-grabbing 5) + (player-standing-on 6) + (player-impulse-force 7) + (player-contact-force 8) + (persistent 9) + (impact 10) + (in-air 11) + (on-ground 12) + (on-flight-level 13) + (riding 14) + (player-grabbed 15) + (player-dismounting 16) + (player-driving 17) + (net-player-driving 18) + (ai-driving 19) + (waiting-for-player 20) + (ignition 21) + (nav-spheres 22) + (turbo-boost 23) + (reverse-gear 24) + (traffic-managed 25) + (flight-level-transition 26) + (flight-level-transition-ending 27) + (camera-bike-mode 28) + (camera-rapid-tracking-mode 29) + (camera 30) + (camera-inside-view 31) + (camera-look-mode 32) + (alert 33) + (in-pursuit 34) + (target-in-sight 35) + (rammed-target 36) + (sounds 37) + (particles 38) + (joints 39) + (lights-on 40) + (lights-update 41) + (lights-dead 42) + (no-hijack 43) + (unique 44) + (tracking-mode 45) + (overturned 46) + (gun-dark-2-zero-g 47) + (ignore-damage 48) + (ignore-impulse 49) + (player-killed 50) + (draw-marks 51) + (vf52 52) + (vf53 53) + (vf54 54) + (vf55 55) + (vf56 56) + ) +;; ---vehicle-h:vehicle-flag + +(deftype mystery-vehicle-type1 (structure) + "vehicle::94" + ((vec0 vector :inline :offset 0) + (time uint32 :offset 0) + (word01 uint32 :offset 4) + (word00 uint32 :offset 8) + (float00 float :offset 16) + (word02 uint32 :offset 20) + ) + ) + +(deftype mystery-vehicle-type2 (structure) + "vehicle::93" + ((time uint32 :offset 0) + (word01 uint32 :offset 4) + (word00 uint32 :offset 8) + (float00 float :offset 16) + (word02 uint32 :offset 20) + ) + ) + +;; added +(deftype vehicle-thruster-work (structure) + ((quat0 quaternion :inline :offset 0) + (vec0 vector :inline :offset 32) + (vec1 vector :inline :offset 48) + (quat1 quaternion :inline :offset 64) + (vec2 vector :inline :offset 80) + (vec3 vector :inline :offset 96) + (vec4 vector :inline :offset 112) + (float0 float :offset 128) + (float1 float :offset 132) + (glow sprite-glow-data :inline :offset 144) + ) + ) + +(deftype vehicle-stack-type3 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 vector :inline :offset 32) + (vec3 vector :inline :offset 48) + (mat0 matrix :inline :offset 64) + (glow sprite-glow-data :inline :offset 128) + (float0 float :offset 192) + (float1 float :offset 196) + (byte0 int8 :offset 200) + ) + ) + +(declare-type vehicle-physics-work structure) + (deftype vehicle (rigid-body-object) - ((flags vehicle-flag :offset-assert 212) ;; rigid-body-object-flag - (squad basic :offset-assert 300) - (control-hook basic :offset-assert 304) - (controls vehicle-controls :inline :offset-assert 308) - (prev-controls vehicle-controls :inline :offset-assert 332) - (engine-power-factor float :offset-assert 356) - (force-scale float :offset-assert 360) - (target-distance2 meters :offset-assert 364) - (water-flags uint32 :offset-assert 368) - (target-acceleration vector :inline :offset-assert 380) - (impact-pos vector :inline :offset-assert 396) - (impact-local-pos vector :inline :offset-assert 412) - (lin-acceleration vector :inline :offset-assert 428) - (hit-points float :offset-assert 444) - (damage-factor float :offset-assert 448) - (crash-level int8 :offset-assert 452) - (force-level int8 :offset-assert 453) - (traffic-hash-id int8 :offset-assert 454) - (traffic-priority-id int8 :offset-assert 455) - (power-fluctuation-factor float :offset-assert 456) - (power-level float :offset-assert 460) - (overlap-player-counter uint8 :offset-assert 464) - (physics-counter uint8 :offset-assert 465) - (cam-view int8 :offset-assert 466) - (brake-factor float :offset-assert 468) - (cam-speed-interp float :offset-assert 472) - (camera-dist2 float :offset-assert 476) - (player-dist2 float :offset-assert 480) - (bound-radius float :offset-assert 484) - (rider-array handle 4 :offset-assert 492) ;; guessed by decompiler - (impact-proc uint64 :offset-assert 524) - (impact-pat uint32 :offset-assert 532) - (impact-time uint32 :offset-assert 536) - (prev-impact-time uint32 :offset-assert 540) - (sent-attack-time time-frame :offset-assert 544) ;; guessed by decompiler - (air-time time-frame :offset-assert 548) ;; guessed by decompiler - (water-time uint32 :offset-assert 552) - (offscreen-time uint32 :offset-assert 556) - (crash-time time-frame :offset-assert 560) ;; guessed by decompiler - (turbo-boost-time time-frame :offset-assert 564) ;; guessed by decompiler - (player-dismount-time uint32 :offset-assert 568) - (crash-duration uint16 :offset-assert 572) - (turbo-boost-duration uint16 :offset-assert 574) - (turbo-boost-factor float :offset-assert 576) - (crash-impulse float :offset-assert 580) - (water-height float :offset-assert 584) - (lights-factor float :offset-assert 588) - (outgoing-attack-id uint32 :offset-assert 592) - (fog-fade float :offset-assert 596) - (scrape-sound-id sound-id :offset-assert 600) ;; guessed by decompiler - (damage-zap-sound-id sound-id :offset-assert 604) ;; guessed by decompiler - (scrape-sound-envelope float :offset-assert 608) - (exhaust-part-accum basic 2 :offset-assert 612) ;; guessed by decompiler - (smoke-part-accum basic 2 :offset-assert 620) ;; guessed by decompiler - (section-array vehicle-section 4 :offset-assert 628) ;; guessed by decompiler + ((info rigid-body-vehicle-constants :override) + (v-flags vehicle-flag :offset 216 :score 1) ;; rigid-body-object-flag + (unknown-flags vehicle-flag :offset 296) + (squad squad-control :offset-assert 304) + (control-hook (function vehicle vehicle-controls) :offset-assert 308) + (controls vehicle-controls :inline :offset-assert 312) + (prev-controls vehicle-controls :inline :offset-assert 336) + (engine-power-factor float :offset-assert 360) + (force-scale float :offset-assert 364) + (target-distance2 meters :offset-assert 368) + (water-flags uint32 :offset-assert 372) + (target-acceleration vector :inline :offset-assert 384) + (impact-pos vector :inline :offset-assert 400) + (impact-local-pos vector :inline :offset-assert 416) + (lin-acceleration vector :inline :offset-assert 432) + (hit-points float :offset-assert 448) + (damage-factor float :offset-assert 452) + (crash-level int8 :offset-assert 456) + (force-level int8 :offset-assert 457) + (traffic-hash-id int8 :offset-assert 458) + (traffic-priority-id int8 :offset-assert 459) + (power-fluctuation-factor float :offset-assert 460) + (power-level float :offset-assert 464) + (overlap-player-counter uint8 :offset-assert 468) + (physics-counter uint8 :offset-assert 469) + (cam-view int8 :offset-assert 470) + (brake-factor float :offset-assert 472) + (cam-speed-interp float :offset-assert 476) + (camera-dist2 float :offset-assert 480) + (player-dist2 float :offset-assert 484) + (bound-radius float :offset-assert 488) + (rider-array handle 4 :offset-assert 496) ;; guessed by decompiler + (impact-proc handle :offset-assert 528) + (impact-pat uint32 :offset-assert 536) + (impact-time uint32 :offset-assert 540) + (prev-impact-time uint32 :offset-assert 544) + (sent-attack-time uint32 :offset-assert 548) ;; guessed by decompiler + (air-time uint32 :offset-assert 552) ;; guessed by decompiler + (water-time uint32 :offset-assert 556) + (offscreen-time uint32 :offset-assert 560) + (crash-time uint32 :offset-assert 564) ;; guessed by decompiler + (turbo-boost-time uint32 :offset-assert 568) ;; guessed by decompiler + (player-dismount-time uint32 :offset-assert 572) + (crash-duration uint16 :offset-assert 576) + (turbo-boost-duration uint16 :offset-assert 578) + (turbo-boost-factor float :offset-assert 580) + (crash-impulse float :offset-assert 584) + (water-height float :offset-assert 588) + (lights-factor float :offset-assert 592) + (outgoing-attack-id uint32 :offset-assert 596) + (fog-fade float :offset-assert 600) + (scrape-sound-id sound-id :offset-assert 604) ;; guessed by decompiler + (damage-zap-sound-id sound-id :offset-assert 608) ;; guessed by decompiler + (scrape-sound-envelope float :offset-assert 612) + (exhaust-part-accum sparticle-launch-control 2 :offset-assert 616) ;; guessed by decompiler + (smoke-part-accum sparticle-launch-control 2 :offset-assert 624) ;; guessed by decompiler + (section-array vehicle-section 4 :inline :offset-assert 632) ;; guessed by decompiler ) :method-count-assert 152 :size-assert #x2b8 :flag-assert #x98024002b8 ;; field vehicle-flag is likely a value type. + (:state-methods + inactive ;; 56 + waiting ;; 57 + player-control ;; 58 + crash ;; 59 + explode ;; 60 + die ;; 61 + ) (:methods - (vehicle-method-56 () none) ;; 56 ;; (vehicle-state-56 () _type_ :state) - (vehicle-method-57 () none) ;; 57 ;; (player-control () _type_ :state) - (vehicle-method-58 () none) ;; 58 ;; (crash () _type_ :state) - (vehicle-method-59 () none) ;; 59 ;; (explode () _type_ :state) - (vehicle-method-60 () none) ;; 60 ;; (die () _type_ :state) - (vehicle-method-61 () none) ;; 61 ;; (measure-control-parameters () _type_ :state) - (vehicle-method-62 () none) ;; 62 ;; (vehicle-method-62 (_type_ float) none) - (vehicle-method-63 () none) ;; 63 ;; (vehicle-method-63 (_type_ float) none) - (vehicle-method-64 () none) ;; 64 ;; (vehicle-method-64 () none) - (vehicle-method-65 () none) ;; 65 ;; (start-jump (_type_) none) - (vehicle-method-66 () none) ;; 66 ;; (vehicle-method-66 (_type_) none) - (vehicle-method-67 () none) ;; 67 ;; (get-seat-count (_type_) int) - (vehicle-method-68 () none) ;; 68 ;; (compute-seat-position (_type_ vector int) none) - (vehicle-method-69 () none) ;; 69 ;; (get-rider-in-seat (_type_ int) process) - (vehicle-method-70 () none) ;; 70 ;; (vehicle-method-70 (_type_) process) - (vehicle-method-71 () none) ;; 71 ;; (put-rider-in-seat (_type_ int process-focusable) none) - (vehicle-method-72 () none) ;; 72 ;; (vehicle-method-72 (_type_) uint) - (vehicle-method-73 () none) ;; 73 ;; (get-best-seat-for-vehicle (_type_ vector int int) int) - (vehicle-method-74 () none) ;; 74 ;; (remove-rider (_type_ process) none) - (vehicle-method-75 () none) ;; 75 ;; (vehicle-method-75 (_type_) float) - (vehicle-method-76 () none) ;; 76 ;; (vehicle-method-76 (_type_ int uint) none) - (vehicle-method-77 () none) ;; 77 ;; (vehicle-method-77 (_type_) none) - (vehicle-method-78 () none) ;; 78 ;; (vehicle-method-78 (_type_ int) none) - (vehicle-method-79 () none) ;; 79 ;; (vehicle-method-79 (_type_) none) - (vehicle-method-80 () none) ;; 80 ;; (vehicle-method-80 (_type_) none) - (vehicle-method-81 () none) ;; 81 ;; (vehicle-method-81 (_type_) none) - (vehicle-method-82 () none) ;; 82 ;; (vehicle-method-82 (_type_) none) - (vehicle-method-83 () none) ;; 83 ;; (vehicle-method-83 (_type_) none) - (vehicle-method-84 () none) ;; 84 ;; (draw-thruster (_type_ vector vector float float) none) - (vehicle-method-85 () none) ;; 85 ;; (draw-thrusters (_type_) none) - (vehicle-method-86 () none) ;; 86 ;; (update-joint-mods (_type_) none) - (vehicle-method-87 () none) ;; 87 ;; (vehicle-method-87 (_type_) none) - (vehicle-method-88 () none) ;; 88 ;; (vehicle-method-88 (_type_) none) - (vehicle-method-89 () none) ;; 89 ;; (vehicle-method-89 (_type_) none) - (vehicle-method-90 () none) ;; 90 ;; (vehicle-method-90 (_type_) none) - (vehicle-method-91 () none) ;; 91 ;; (vehicle-method-91 (_type_) none) - (vehicle-method-92 () none) ;; 92 ;; (vehicle-method-92 (_type_) none) - (vehicle-method-93 () none) ;; 93 ;; (vehicle-method-93 (_type_) none) - (vehicle-method-94 () none) ;; 94 ;; (vehicle-method-94 (_type_) none) - (vehicle-method-95 () none) ;; 95 ;; (vehicle-method-95 (_type_ vector) none) - (vehicle-method-96 () none) ;; 96 ;; (vehicle-method-96 (_type_) none) - (vehicle-method-97 () none) ;; 97 ;; (vehicle-method-97 (_type_) none) - (vehicle-method-98 () none) ;; 98 ;; (vehicle-method-98 (_type_ float) none) - (vehicle-method-99 () none) ;; 99 ;; (vehicle-method-99 (_type_ float) none) - (vehicle-method-100 () none) ;; 100 ;; (vehicle-method-100 (_type_ float vehicle-physics-work) none) - (vehicle-method-101 () none) ;; 101 ;; (vehicle-method-101 (_type_) none) - (vehicle-method-102 () none) ;; 102 ;; (shadow-enable (_type_) none) - (vehicle-method-103 () none) ;; 103 ;; (shadow-disable (_type_) none) - (vehicle-method-104 () none) ;; 104 ;; (vehicle-method-104 (_type_) none) - (vehicle-method-105 () none) ;; 105 ;; (vehicle-method-105 (_type_) symbol) - (vehicle-method-106 () none) ;; 106 ;; (vehicle-method-106 (_type_) none) - (vehicle-method-107 () none) ;; 107 ;; (vehicle-method-107 (_type_) none) - (vehicle-method-108 () none) ;; 108 ;; (vehicle-method-108 (_type_) none) - (vehicle-method-109 () none) ;; 109 ;; (vehicle-method-109 (_type_) none) - (vehicle-method-110 () none) ;; 110 ;; (vehicle-method-110 (_type_) none) - (vehicle-method-111 () none) ;; 111 ;; (vehicle-method-111 (_type_ object target) none) - (vehicle-method-112 () none) ;; 112 ;; (decrease-traffic-alert-level (_type_ int) int) - (vehicle-method-113 () none) ;; 113 ;; (vehicle-method-113 (_type_) none) - (vehicle-method-114 () none) ;; 114 ;; (vehicle-method-114 (_type_) none) - (vehicle-method-115 () none) ;; 115 ;; (vehicle-method-115 (_type_ vector) none) - (vehicle-method-116 () none) ;; 116 ;; (vehicle-method-116 (_type_ (pointer vehicle-controls)) none) - (vehicle-method-117 () none) ;; 117 ;; (vehicle-method-117 (_type_ vector int int) none) - (vehicle-method-118 () none) ;; 118 ;; (vehicle-method-118 (_type_ int) none) - (vehicle-method-119 () none) ;; 119 ;; (vehicle-method-119 (_type_) none) - (vehicle-method-120 () none) ;; 120 ;; (vehicle-method-120 (_type_) none) - (vehicle-method-121 () none) ;; 121 ;; (vehicle-method-121 (_type_) none) - (vehicle-method-122 () none) ;; 122 ;; (vehicle-method-122 (_type_) none) - (vehicle-method-123 () none) ;; 123 ;; (vehicle-method-123 (_type_) none) - (vehicle-method-124 () none) ;; 124 ;; (vehicle-method-124 (_type_) none) - (vehicle-method-125 () none) ;; 125 ;; (vehicle-method-125 (_type_ float) none) - (vehicle-method-126 () none) ;; 126 ;; (vehicle-method-126 (_type_ float) none) - (vehicle-method-127 () none) ;; 127 ;; (vehicle-method-127 (_type_) none) - (vehicle-method-128 () none) ;; 128 ;; (vehicle-method-128 (_type_) none) - (vehicle-method-129 () none) ;; 129 ;; (vehicle-method-129 (_type_) none) - (vehicle-method-130 () none) ;; 130 ;; (vehicle-method-130 (_type_ traffic-object-spawn-params) none) - (vehicle-method-131 () none) ;; 131 ;; (vehicle-method-131 (_type_) none) - (vehicle-method-132 () none) ;; 132 ;; (vehicle-method-132 (_type_) none) - (vehicle-method-133 () none) ;; 133 ;; (check-player-get-on (_type_) none) - (vehicle-method-134 () none) ;; 134 ;; (vehicle-method-134 (_type_ process) none) - (vehicle-method-135 () none) ;; 135 ;; (vehicle-method-135 (_type_ traffic-object-spawn-params) none) - (vehicle-method-136 () none) ;; 136 ;; (vehicle-method-136 (_type_ traffic-object-spawn-params) none) - (vehicle-method-137 () none) ;; 137 ;; (vehicle-method-137 (_type_ traffic-object-spawn-params) none) - (vehicle-method-138 () none) ;; 138 ;; (vehicle-method-138 (_type_) none) - (vehicle-method-139 () none) ;; 139 ;; (vehicle-method-139 (_type_) none) - (vehicle-method-140 () none) ;; 140 ;; (vehicle-method-140 (_type_) none) - (vehicle-method-141 () none) ;; 141 ;; (vehicle-method-141 (_type_) none) - (vehicle-method-142 () none) ;; 142 ;; (vehicle-method-142 (_type_) none) - (vehicle-method-143 () none) ;; 143 ;; (vehicle-method-143 (_type_) none) - (vehicle-method-144 () none) ;; 144 - (vehicle-method-145 () none) ;; 145 - (vehicle-method-146 () none) ;; 146 - (vehicle-method-147 () none) ;; 147 - (vehicle-method-148 () none) ;; 148 - (vehicle-method-149 () none) ;; 149 - (vehicle-method-150 () none) ;; 150 - (vehicle-method-151 () none) ;; 151 + (vehicle-method-62 (_type_) none) ;; 62 ;; (vehicle-method-62 (_type_ float) none) + (vehicle-method-63 (_type_) none) ;; 63 ;; (vehicle-method-63 (_type_ float) none) + (vehicle-method-64 (_type_) none) ;; 64 + (vehicle-method-65 (_type_) int) ;; 65 ;; (start-jump (_type_) none) + (vehicle-method-66 (_type_ vector int) none) ;; 66 + (get-rider-in-seat (_type_ int) process) ;; 67 ;; (get-seat-count (_type_) int) + (vehicle-method-68 (_type_) none) ;; 68 ;; (compute-seat-position (_type_ vector int) none) + (put-rider-in-seat (_type_ int process) none) ;; 69 ;; (get-rider-in-seat (_type_ int) process) + (vehicle-method-70 (_type_) none) ;; 70 ;; (vehicle-method-70 (_type_) process) + (get-best-seat (_type_ vector vehicle-seat-flag int) int) ;; 71 ;; (put-rider-in-seat (_type_ int process-focusable) none) + (remove-riders (_type_ handle) none) ;; 72 ;; (vehicle-method-72 (_type_) uint) + (vehicle-method-73 (_type_) none) ;; 73 ;; (get-best-seat-for-vehicle (_type_ vector int int) int) + (vehicle-method-74 (_type_ int time-frame) none) ;; 74 ;; (remove-rider (_type_ process) none) + (vehicle-method-75 (_type_) none) ;; 75 ;; (vehicle-method-75 (_type_) float) + (vehicle-method-76 (_type_) none) ;; 76 ;; (vehicle-method-76 (_type_ int uint) none) + (vehicle-method-77 (_type_) none) ;; 77 + (vehicle-method-78 (_type_) none) ;; 78 ;; (vehicle-method-78 (_type_ int) none) + (vehicle-method-79 (_type_) none) ;; 79 + (vehicle-method-80 (_type_) none) ;; 80 + (vehicle-method-81 (_type_) none) ;; 81 + (vehicle-method-82 (_type_) none) ;; 82 + (vehicle-method-83 (_type_) none) ;; 83 + (vehicle-method-84 (_type_) none) ;; 84 ;; (draw-thruster (_type_ vector vector float float) none) + (vehicle-method-85 (_type_) none) ;; 85 ;; (draw-thrusters (_type_) none) + (vehicle-method-86 (_type_) none) ;; 86 ;; (update-joint-mods (_type_) none) + (vehicle-method-87 (_type_) none) ;; 87 + (vehicle-method-88 (_type_ vehicle-controls) none) ;; 88 + (init-reverse (_type_ vehicle-controls) none) ;; 89 + (control-hook-ai (_type_ vehicle-controls) none) ;; 90 + (control-hook-player (_type_ vehicle-controls) none) ;; 91 + (vehicle-method-92 (_type_ vehicle-controls) none) ;; 92 + (vehicle-method-93 (_type_) none) ;; 93 + (vehicle-method-94 (_type_) none) ;; 94 + (vehicle-method-95 (_type_ vector float) none) ;; 95 ;; (vehicle-method-95 (_type_ vector) none) + (vehicle-method-96 (_type_ float) none) ;; 96 + (vehicle-method-97 (_type_ float vehicle-physics-work) none) ;; 97 + (vehicle-method-98 (_type_) none) ;; 98 ;; (vehicle-method-98 (_type_ float) none) + (vehicle-method-99 (_type_) none) ;; 99 ;; (vehicle-method-99 (_type_ float) none) + (vehicle-method-100 (_type_) none) ;; 100 ;; (vehicle-method-100 (_type_ float vehicle-physics-work) none) + (vehicle-method-101 (_type_) none) ;; 101 + (vehicle-method-102 (_type_) symbol) ;; 102 ;; (shadow-enable (_type_) none) + (vehicle-method-103 (_type_) none) ;; 103 ;; (shadow-disable (_type_) none) + (vehicle-method-104 (_type_) none) ;; 104 + (vehicle-method-105 (_type_) none) ;; 105 ;; (vehicle-method-105 (_type_) symbol) + (vehicle-method-106 (_type_) none) ;; 106 + (vehicle-method-107 (_type_ int process) none) ;; 107 + (vehicle-method-108 (_type_ int) none) ;; 108 + (vehicle-method-109 (_type_) none) ;; 109 + (vehicle-method-110 (_type_) none) ;; 110 + (get-linear-accel! (_type_ vector) none) ;; 111 ;; (vehicle-method-111 (_type_ object target) none) + (copy-vehicle-controls! (_type_ vehicle-controls) none) ;; 112 ;; (decrease-traffic-alert-level (_type_ int) int) + (vehicle-method-113 (_type_ vector int int) none) ;; 113 + (vehicle-method-114 (_type_ int) none) ;; 114 + (vehicle-method-115 (_type_) none) ;; 115 ;; (vehicle-method-115 (_type_ vector) none) + (vehicle-method-116 (_type_ symbol) none) ;; 116 ;; (vehicle-method-116 (_type_ (pointer vehicle-controls)) none) + (vehicle-method-117 (_type_) none) ;; 117 ;; (vehicle-method-117 (_type_ vector int int) none) + (vehicle-method-118 (_type_) none) ;; 118 ;; (vehicle-method-118 (_type_ int) none) + (vehicle-method-119 (_type_) none) ;; 119 + (apply-gravity (_type_ float) none) ;; 120 + (apply-gravity1 (_type_ float) none) ;; 121 + (vehicle-method-122 (_type_) none) ;; 122 + (vehicle-method-123 (_type_) none) ;; 123 + (vehicle-method-124 (_type_) none) ;; 124 + (vehicle-method-125 (_type_) none) ;; 125 ;; (vehicle-method-125 (_type_ float) none) + (vehicle-method-126 (_type_) none) ;; 126 ;; (vehicle-method-126 (_type_ float) none) + (check-player-get-on (_type_ process-focusable) symbol) ;; 127 ;; (vehicle-method-127 (_type_) none) + (vehicle-method-128 (_type_) symbol) ;; 128 + (vehicle-method-129 (_type_) none) ;; 129 + (vehicle-method-130 (_type_) none) ;; 130 ;; (vehicle-method-130 (_type_ traffic-object-spawn-params) none) + (vehicle-method-131 (_type_) none) ;; 131 + (vehicle-method-132 (_type_ traffic-object-spawn-params) none) ;; 132 + (vehicle-method-133 (_type_) none) ;; 133 ;; (check-player-get-on (_type_) none) + (vehicle-method-134 (_type_) none) ;; 134 ;; (vehicle-method-134 (_type_ process) none) + (vehicle-method-135 (_type_) none) ;; 135 ;; (vehicle-method-135 (_type_ traffic-object-spawn-params) none) + (vehicle-method-136 (_type_) none) ;; 136 ;; (vehicle-method-136 (_type_ traffic-object-spawn-params) none) + (vehicle-method-137 (_type_) none) ;; 137 ;; (vehicle-method-137 (_type_ traffic-object-spawn-params) none) + (vehicle-method-138 (_type_) none) ;; 138 + (vehicle-method-139 (_type_) none) ;; 139 + (vehicle-method-140 (_type_) none) ;; 140 + (vehicle-method-141 (_type_) symbol) ;; 141 + (vehicle-method-142 (_type_) none) ;; 142 + (vehicle-method-143 (_type_ process) object) ;; 143 + (vehicle-method-144 (_type_) none) ;; 144 + (vehicle-method-145 (_type_) none) ;; 145 + (vehicle-method-146 (_type_ vector) none) ;; 146 + (vehicle-method-147 (_type_) none) ;; 147 + (vehicle-method-148 (_type_) none) ;; 148 + (vehicle-method-149 (_type_) none) ;; 149 + (vehicle-method-150 (_type_) none) ;; 150 + (set-hit-points (_type_ float) none) ;; 151 ) ) -|# -#| (deftype vehicle-probe-work (structure) ((local-pos vector :inline :offset-assert 0) (local-normal vector :inline :offset-assert 16) @@ -53272,9 +53533,7 @@ :size-assert #xa0 :flag-assert #x9000000a0 ) -|# -#| (deftype vehicle-physics-work (structure) ((mat matrix :inline :offset-assert 0) (force vector :inline :offset-assert 64) @@ -53294,15 +53553,13 @@ (vel-dot-norm float :offset-assert 276) (friction-coef float :offset-assert 280) (speed-factor float :offset-assert 284) - (probe-work-array vehicle-probe-work 4 :offset-assert 288) ;; guessed by decompiler + (probe-work-array vehicle-probe-work 4 :inline :offset-assert 288) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x3a0 :flag-assert #x9000003a0 ) -|# -#| (deftype vehicle-draw-thruster-params (structure) ((quat quaternion :inline :offset-assert 0) (trans vector :inline :offset-assert 16) @@ -53315,14 +53572,21 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# ;; (deftype debug-vehicle-work (basic) ;; () ;; :flag-assert #x900000070 ;; ) -;; (define-extern meters-per-sec->mph function) +(deftype debug-vehicle-work (basic) + ((impact-time time-frame :offset-assert 8) + (impact rigid-body-impact :inline :offset-assert 16) + (prim-sphere1 sphere :inline :offset-assert 80) + (prim-sphere2 sphere :inline :offset-assert 96) + ) + ) + +(define-extern meters-per-sec->mph (function float float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vehicle-part ;; @@ -53333,55 +53597,62 @@ ;; vehicle-effects ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern calc-fade-vals function) ;; (function float none) -;; (define-extern *vehicle-headlight-glow-template* object) ;; sprite-glow-data -;; (define-extern *vehicle-taillight-glow-template* object) ;; sprite-glow-data -;; (define-extern *vehicle-thruster-glow-template* object) ;; sprite-glow-data -;; (define-extern *vehicle-particle-common-info* object) -;; (define-extern vehicle-draw-thruster function) +(define-extern calc-fade-vals (function float none)) +(define-extern *vehicle-headlight-glow-template* sprite-glow-data) +(define-extern *vehicle-taillight-glow-template* sprite-glow-data) +(define-extern *vehicle-thruster-glow-template* sprite-glow-data) +(define-extern *vehicle-particle-common-info* vehicle-particle-common-info) +(define-extern vehicle-draw-thruster (function vehicle-particle-common-info vehicle-draw-thruster-params none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vehicle ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *debug-vehicle-work* debug-vehicle-work) ;; debug-vehicle-work -;; (define-extern *vehicle-shadow-control* shadow-control) ;; shadow-control -;; (define-extern *vehicle-shadow-control-disabled* shadow-control) ;; shadow-control -;; (define-extern vehicle-event-handler function) ;; (function process int symbol event-message-block object :behavior vehicle) +(define-extern *debug-vehicle-work* debug-vehicle-work) +(define-extern *vehicle-shadow-control* shadow-control) +(define-extern *vehicle-shadow-control-disabled* shadow-control) +(define-extern vehicle-event-handler (function process int symbol event-message-block object :behavior vehicle)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vehicle-util ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(deftype mystery-vehicle-type0 (structure) + "vehicle::check-player-get-on" + ((mat matrix 3 :inline :offset-assert 0) + (vec vector 2 :inline :offset-assert 192) + (proc handle 2 :offset-assert 224) + (cquery collide-query :inline :offset-assert 240) + (floats float 5 :offset-assert 780) + ) + ) + (deftype vehicle-hud-request (structure) - ((handle uint64 :offset-assert 0) ;; handle - (hack-handle-init basic :offset-assert 0) + ((handle handle :offset-assert 0) ;; handle + (hack-handle-init symbol :offset 0) (priority float :offset-assert 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype vehicle-hud-requests (structure) - ((time uint64 :offset-assert 0) ;; time-frame - (requests vehicle-hud-request 4 :offset-assert 8) ;; guessed by decompiler + ((time time-frame :offset-assert 0) ;; time-frame + (requests vehicle-hud-request 4 :inline :offset-assert 8) ;; guessed by decompiler ) + :pack-me :method-count-assert 12 :size-assert #x48 :flag-assert #xc00000048 (:methods - (vehicle-hud-requests-method-9 () none) ;; 9 ;; (vehicle-hud-requests-method-9 (_type_) none) - (vehicle-hud-requests-method-10 () none) ;; 10 ;; (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) - (vehicle-hud-requests-method-11 () none) ;; 11 ;; (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request) + (vehicle-hud-requests-method-9 (_type_) none) ;; 9 + (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) ;; 10 ;; (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) + (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request) ;; 11 ) ) -|# -#| (deftype vehicle-hud-chooser (structure) ((cur vehicle-hud-requests :inline :offset-assert 0) (last vehicle-hud-requests :inline :offset-assert 72) @@ -53390,13 +53661,12 @@ :size-assert #x90 :flag-assert #xa00000090 (:methods - (vehicle-hud-chooser-method-9 () none) ;; 9 ;; (vehicle-hud-chooser-method-9 (_type_ handle float) symbol) + (vehicle-hud-chooser-method-9 (_type_ handle float) symbol) ;; 9 ) ) -|# -;; (define-extern *vehicle-hud-chooser* object) ;; vehicle-hud-chooser -;; (define-extern *pilot-edge-grab-info* object) ;; pilot-edge-grab-info +(define-extern *vehicle-hud-chooser* vehicle-hud-chooser) +(define-extern *pilot-edge-grab-info* pilot-edge-grab-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vehicle-physics ;; @@ -53407,7 +53677,7 @@ ;; vehicle-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern vehicle-explode-post function) ;; (function none :behavior vehicle) +(define-extern vehicle-explode-post (function none :behavior vehicle)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vehicle-manager ;; @@ -53419,47 +53689,96 @@ :size-assert #x80 :flag-assert #x1200000080 (:state-methods - active ;; 15 idle ;; 14 + active ;; 15 ) (:methods - (vehicle-manager-method-16 () none) ;; 16 - (vehicle-manager-method-17 () none) ;; 17 + (vehicle-manager-method-16 (_type_) none) ;; 16 + (vehicle-manager-method-17 (_type_) none) ;; 17 ) ) -;; (define-extern *vehicle-rigid-body-queue* object) -;; (define-extern *vehicle-info* object) -;; (define-extern vehicle-entity-hack function) -;; (define-extern vehicle-manager-event-handler function) -;; (define-extern vehicle-manager-init-by-other function) -;; (define-extern vehicle-manager-start function) -;; (define-extern vehicle-manager-kill function) -;; (define-extern vehicle-init-by-other function) ;; (function traffic-object-spawn-params none :behavior vehicle) -;; (define-extern vehicle-spawn-hack function) -(define-extern vehicle-spawn (function process type traffic-object-spawn-params process-drawable)) -;; (define-extern type-from-vehicle-type function) ;; (function vehicle-type type) +(define-extern *vehicle-rigid-body-queue* rigid-body-queue) +(define-extern *vehicle-info* vehicle-info) +(define-extern vehicle-entity-hack (function int none)) +(def-event-handler vehicle-manager-event-handler vehicle-manager) +(define-extern vehicle-manager-init-by-other (function object :behavior vehicle-manager)) +(define-extern vehicle-manager-start (function process none)) +(define-extern vehicle-manager-kill (function none)) +(define-extern vehicle-init-by-other (function int traffic-object-spawn-params object :behavior vehicle)) +(define-extern vehicle-spawn-hack (function type traffic-object-spawn-params process vehicle)) +(define-extern vehicle-spawn (function vehicle-type traffic-object-spawn-params process-drawable)) +(define-extern type-from-vehicle-type (function vehicle-type type)) + +(define-extern h-bike-a type) +(declare-type h-bike-a vehicle) +(define-extern h-bike-b type) +(declare-type h-bike-b vehicle) +(define-extern h-bike-c type) +(declare-type h-bike-c vehicle) +(define-extern h-bike-d type) +(declare-type h-bike-d vehicle) +(define-extern h-car-a type) +(declare-type h-car-a vehicle) +(define-extern h-car-b type) +(declare-type h-car-b vehicle) +(define-extern h-car-c type) +(declare-type h-car-c vehicle) +(define-extern h-car-d type) +(declare-type h-car-d vehicle) +(define-extern h-hellcat type) +(declare-type h-hellcat vehicle) +(define-extern h-warf type) +(declare-type h-warf vehicle) +(define-extern h-glider type) +(declare-type h-glider vehicle) +(define-extern h-sled type) +(declare-type h-sled vehicle) +(define-extern h-kg-pickup type) +(declare-type h-kg-pickup vehicle) +(define-extern v-scorpion type) +(declare-type v-scorpion vehicle) +(define-extern v-toad type) +(declare-type v-toad vehicle) +(define-extern v-fox type) +(declare-type v-fox vehicle) +(define-extern v-rhino type) +(declare-type v-rhino vehicle) +(define-extern v-mirage type) +(declare-type v-mirage vehicle) +(define-extern v-x-ride type) +(declare-type v-x-ride vehicle) +(declare-type v-marauder vehicle) +(define-extern v-faccar type) +(declare-type v-faccar vehicle) +(define-extern v-catapult type) +(declare-type v-catapult vehicle) +(define-extern v-marauder-b type) +(declare-type v-marauder-b vehicle) +(define-extern evan-test-bike type) +(declare-type evan-test-bike vehicle) +(define-extern wbike-test type) +(declare-type wbike-test vehicle) +(define-extern test-car type) +(declare-type test-car vehicle) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; vehicle-hud ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hud-vehicle-health (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -;; (define-extern hud-vehicle-health-spawn function) +(define-extern hud-vehicle-health-spawn (function vehicle hud-vehicle-health)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; turret-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype turret-barrel-info (structure) ((local-pos vector :inline :offset-assert 0) (local-dir vector :inline :offset-assert 16) @@ -53468,11 +53787,35 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| +(deftype turret-control-stack-var0 (structure) + ((params projectile-init-by-other-params :inline :offset 0) + (mat0 matrix :inline :offset 128) + (vec2 vector :inline :offset 192) + (vec3 vector :inline :offset 208) + ) + ) + +(deftype turret-control-stack-var1 (structure) + "TODO - sigh...another one that i cant seem to find a fit" + ((vec-1 vector :inline :offset-assert 0) + (vec-2 vector :inline :offset-assert 16) + (vec-3 vector :inline :offset-assert 32) + (vec-4 vector :inline :offset-assert 48) + (vec-5 vector :inline :offset-assert 64) + (vec-6 vector :inline :offset-assert 80) + (vec-7 vector :inline :offset-assert 96) + (mat-1 matrix :inline :offset-assert 112) + (vec-8 vector :inline :offset-assert 176) + (vec-9 vector :inline :offset-assert 192) + (vec-10 vector :inline :offset-assert 208) + (vec-11 vector :inline :offset-assert 224) + (vec-12 vector :inline :offset-assert 240) + ) + ) + (deftype turret-control-info (structure) - ((shot-type basic :offset-assert 0) + ((shot-type type :offset-assert 0) (joint-index int8 :offset-assert 4) (barrel-count int8 :offset-assert 5) (shot-speed float :offset-assert 8) @@ -53482,21 +53825,30 @@ (vehicle-impulse-factor float :offset-assert 24) (rot-min float 2 :offset-assert 28) ;; guessed by decompiler (rot-max float 2 :offset-assert 36) ;; guessed by decompiler - (rot-x-min float :offset-assert 28) - (rot-x-max float :offset-assert 36) - (rot-y-min float :offset-assert 32) - (rot-y-max float :offset-assert 40) + (rot-x-min float :offset 28) + (rot-x-max float :offset 36) + (rot-y-min float :offset 32) + (rot-y-max float :offset 40) (local-pos vector :inline :offset-assert 48) (local-dir vector :inline :offset-assert 64) - (barrel-array turret-barrel-info 4 :offset-assert 80) ;; guessed by decompiler + (barrel-array turret-barrel-info 4 :inline :offset-assert 80) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #xd0 :flag-assert #x9000000d0 ) -|# -#| +(defenum turret-flag + :bitfield #t + :type uint8 + (firing 0) + (aiming 1) + (should-shoot 2) + (targetting-laser 3) + (display-marks 4) + (no-rot-y-clamp 5) + ) + (deftype turret-control (structure) ((info turret-control-info :offset-assert 0) (guard-settings squad-unit-settings :offset-assert 4) ;; traffic-guard-type-settings @@ -53508,69 +53860,76 @@ (target-dist float :offset-assert 16) (inaccuracy float :offset-assert 20) (burst-delay-factor float :offset-assert 24) - (aim-offset-angle float :offset-assert 28) ;; degrees + (aim-offset-angle degrees :offset-assert 28) ;; degrees (aim-rot float 2 :offset-assert 32) ;; guessed by decompiler (aim-rot-vel float 2 :offset-assert 40) ;; guessed by decompiler (aim-rot-offset float 2 :offset-assert 48) ;; guessed by decompiler - (aim-rot-x float :offset-assert 32) - (aim-rot-y float :offset-assert 36) - (aim-rot-vel-x float :offset-assert 40) - (aim-rot-vel-y float :offset-assert 44) - (target-in-sight-time uint64 :offset-assert 56) ;; time-frame - (aim-acquire-time uint64 :offset-assert 64) ;; time-frame - (shoot-time uint64 :offset-assert 72) ;; time-frame - (owner-handle uint64 :offset-assert 80) ;; handle - (ignore-handle uint64 :offset-assert 88) + (aim-rot-x float :offset 32) + (aim-rot-y float :offset 36) + (aim-rot-vel-x float :offset 40) + (aim-rot-vel-y float :offset 44) + (target-in-sight-time time-frame :offset-assert 56) ;; time-frame + (aim-acquire-time time-frame :offset-assert 64) ;; time-frame + (shoot-time time-frame :offset-assert 72) ;; time-frame + (owner-handle handle :offset-assert 80) ;; handle + (ignore-handle handle :offset-assert 88) ) :method-count-assert 18 :size-assert #x60 :flag-assert #x1200000060 ;; field turret-flag is likely a value type. (:methods - (turret-control-method-9 () none) ;; 9 ;; (turret-control-method-9 (_type_ vehicle vector vector) none) - (turret-control-method-10 () none) ;; 10 ;; (turret-control-method-10 (_type_ vehicle) none) - (turret-control-method-11 () none) ;; 11 ;; (turret-control-method-11 (_type_ object object vector) none) - (turret-control-method-12 () none) ;; 12 ;; (update-joint-mod (_type_ joint-mod-rotate-local) none) - (turret-control-method-13 () none) ;; 13 ;; (turret-control-method-13 (_type_) none) - (turret-control-method-14 () none) ;; 14 ;; (turret-control-method-14 (_type_) none) - (turret-control-method-15 () none) ;; 15 ;; (set-info (_type_ turret-control-info) none) - (turret-control-method-16 () none) ;; 16 ;; (turret-control-method-16 (_type_ float float) none) - (turret-control-method-17 () none) ;; 17 ;; (turret-control-method-17 (_type_ vehicle) none) + (turret-control-method-9 (_type_ vehicle vector vector) none) ;; 9 + (turret-control-method-10 (_type_ vehicle) none) ;; 10 + (turret-control-method-11 (_type_ object object vector) none) ;; 11 + (update-joint-mod (_type_ joint-mod-rotate-local) none) ;; 12 + (turret-control-method-13 (_type_) none) ;; 13 + (turret-control-method-14 (_type_) none) ;; 14 + (set-info (_type_ turret-control-info) none) ;; 15 + (turret-control-method-16 (_type_ float float) none) ;; 16 + (turret-control-method-17 (_type_ vehicle) none) ;; 17 ) ) -|# -;; (define-extern vehicle-los-clear? function) ;; (function vector vector symbol) -;; (define-extern vehicle-draw-beam function) ;; (function sparticle-launcher vector vector object symbol none) -;; (define-extern vehicle-draw-laser-spot function) ;; (function vector vector symbol none) -;; (define-extern vehicle-draw-laser function) ;; (function vector vector none) +(define-extern vehicle-los-clear? (function vector vector symbol)) +(define-extern vehicle-draw-beam (function sparticle-launcher vector vector object symbol none)) +(define-extern vehicle-draw-laser-spot (function vector vector symbol none)) +(define-extern vehicle-draw-laser (function vector vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-pilot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *pilot-mods* surface) ;; surface -;; (define-extern target-pilot-handler function) ;; (function process int symbol event-message-block object :behavior target) -;; (define-extern target-pilot-pidax-enter function) ;; (function object :behavior target) -;; (define-extern target-pilot-pidax-exit function) ;; (function object :behavior target) -;; (define-extern target-pilot-exit function) ;; (function object :behavior target) -;; (define-extern target-pilot-init function) ;; (function handle symbol object :behavior target) -;; (define-extern pilot-on-ground? function) ;; (function symbol :behavior target) -;; (define-extern target-pilot-post function) ;; (function none :behavior target) +(deftype cquery-with-5vec (structure) + "target-pilot-post" + ((cquery collide-query :inline) + (vec vector 5 :inline) + ) + ) + +(define-extern h-warf type) +(define-extern *pilot-mods* surface) +(define-extern target-pilot-handler (function process int symbol event-message-block object :behavior target)) +(define-extern target-pilot-pidax-enter (function object :behavior target)) +(define-extern target-pilot-pidax-exit (function object :behavior target)) +(define-extern target-pilot-exit (function object :behavior target)) +(define-extern target-pilot-init (function handle symbol object :behavior target)) +(define-extern pilot-on-ground? (function symbol :behavior target)) +(define-extern target-pilot-post (function none :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; pilot-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern target-pilot-bike-anim-loop function) ;; (function none :behavior target) -;; (define-extern target-pilot-car-anim-loop function) ;; (function none :behavior target) -;; (define-extern target-pilot-wcar-anim-loop function) -;; (define-extern target-pilot-glider-anim-loop function) -;; (define-extern target-daxter-pilot-car-anim-loop function) ;; (function none :behavior target) -;; (define-extern target-pilot-trans function) ;; (function none :behavior target) -;; (define-extern target-pilot-signal-ready function) ;; (function object :behavior target) -;; (define-extern *pilot-get-on-mods* object) ;; surface -;; (define-extern *pilot-get-off-mods* object) ;; surface +(define-extern target-pilot-bike-anim-loop (function none :behavior target)) +(define-extern target-pilot-car-anim-loop (function none :behavior target)) +(define-extern target-pilot-wcar-anim-loop (function none :behavior target)) +(define-extern target-pilot-glider-anim-loop (function none :behavior target)) +(define-extern target-daxter-pilot-car-anim-loop (function none :behavior target)) +(define-extern target-pilot-trans (function none :behavior target)) +(define-extern target-pilot-signal-ready (function object :behavior target)) +(define-extern *pilot-get-on-mods* surface) +(define-extern *pilot-get-off-mods* surface) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; height-map ;; @@ -54020,7 +54379,6 @@ ;; elec-gate ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype elec-gate-params (structure) ((bolt-spec lightning-spec :offset-assert 0) ;; guessed by decompiler (ring-spec lightning-spec :offset-assert 4) ;; guessed by decompiler @@ -54037,9 +54395,7 @@ :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype elec-gate-bolt (structure) ((ring lightning-control 2 :offset-assert 0) ;; guessed by decompiler (bolt lightning-control :offset-assert 8) ;; guessed by decompiler @@ -54050,9 +54406,7 @@ :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype elec-wall (structure) ((pos vector :inline :offset-assert 0) (dir vector :inline :offset-assert 16) @@ -54061,24 +54415,22 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype elec-gate (process-drawable) ((params elec-gate-params :offset-assert 200) - (path-l path-control :offset-assert 152) ;; guessed by decompiler + (path-l path-control :offset 152) ;; guessed by decompiler (path-r path-control :offset-assert 204) ;; guessed by decompiler - (l-bolt elec-gate-bolt 5 :offset-assert 208) ;; guessed by decompiler - (part-on sparticle-launch-control :offset-assert 168) ;; guessed by decompiler + (l-bolt elec-gate-bolt 5 :inline :offset-assert 208) ;; guessed by decompiler + (part-on sparticle-launch-control :offset 168) ;; guessed by decompiler (part-off sparticle-launch-control :offset-assert 368) ;; guessed by decompiler (part-spawner-left part-spawner :offset-assert 372) ;; guessed by decompiler (part-spawner-right part-spawner :offset-assert 376) ;; guessed by decompiler (on-start pair :offset-assert 380) ;; guessed by decompiler (on-stop pair :offset-assert 384) ;; guessed by decompiler - (on-shutdown basic :offset-assert 388) - (on-trigger basic :offset-assert 392) + (on-shutdown pair :offset-assert 388) + (on-trigger pair :offset-assert 392) (dividing-wall elec-wall :inline :offset-assert 400) - (plane elec-wall 2 :offset-assert 432) ;; guessed by decompiler + (plane elec-wall 2 :inline :offset-assert 432) ;; guessed by decompiler (wall-y float :offset-assert 496) (wall-xz float :offset-assert 500) (lightning-quality float :offset-assert 504) @@ -54088,25 +54440,23 @@ :size-assert #x200 :flag-assert #x1f01800200 ;; field on-start uses ~A with a signed load. field on-stop uses ~A with a signed load. field on-shutdown uses ~A with a signed load. field on-trigger uses ~A with a signed load. - (:methods - (elec-gate-method-24 () none) ;; 24 ;; (elec-gate-method-24 (_type_) none) - (elec-gate-method-25 () none) ;; 25 ;; (set-palette! (_type_) none) - (elec-gate-method-26 () none) ;; 26 ;; (set-state! (_type_) none) - (elec-gate-method-27 () none) ;; 27 ;; (spawn-particles (_type_ sparticle-launch-control) none) - (elec-gate-method-28 () none) ;; 28 ;; (set-elec-scale-if-close! (_type_ float) none) - (elec-gate-method-29 () none) ;; 29 ;; (set-elec-scale! (_type_ float) none) - (elec-gate-method-30 () none) ;; 30 - ) (:state-methods - shutdown ;; 23, old: (get-params (_type_) elec-gate-params) - shutdown-camera ;; 22, old: (shutdown () _type_ :state) - active ;; 21, old: (active () _type_ :state) - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 + active ;; 21 + shutdown-camera ;; 22 + shutdown ;; 23 + ) + (:methods + (get-params (_type_) elec-gate-params) ;; 24 + (elec-gate-method-25 (_type_) none) ;; 25 ;; (set-palette! (_type_) none) + (elec-gate-method-26 (_type_) none) ;; 26 ;; (set-state! (_type_) none) + (go-initial-state (_type_) object) ;; 27 + (spawn-particles (_type_ sparticle-launch-control) none) ;; 28 ;; (set-elec-scale-if-close! (_type_ float) none) + (set-elec-scale! (_type_ float) none) ;; 29 + (elec-gate-method-30 (_type_ float) none) ;; 30 ) ) -|# -#| (deftype sewer-elec-gate (elec-gate) ((gate-index int32 :offset-assert 512) ) @@ -54114,10 +54464,9 @@ :size-assert #x204 :flag-assert #x1f01900204 ) -|# -;; (define-extern *default-elec-gate-params* object) ;; elec-gate-params -;; (define-extern elec-gate-post function) ;; (function none :behavior elec-gate) +(define-extern *default-elec-gate-params* elec-gate-params) +(define-extern elec-gate-post (function none :behavior elec-gate)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; intro-part ;; @@ -54520,15 +54869,27 @@ ;; prebot-eco-creature ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++prebot-eco-creature:eco-creature-flag +(defenum eco-creature-flag + :type uint64 + :bitfield #t + (ecf0 0) + (ecf1 1) + (ecf2 2) + (ecf3 3) + (ecf4 4) + (ecf5 5) + ) +;; ---prebot-eco-creature:eco-creature-flag + (deftype prebot-large-eco-creature (nav-enemy) ((old-y-deg float :offset-assert 620) (diff-angle float :offset-assert 624) - (attack-anims basic :offset-assert 628) - (victory-anims basic :offset-assert 632) + (attack-anims (array int32) :offset-assert 628) + (victory-anims (array int32) :offset-assert 632) (turn-left-anim int32 :offset-assert 636) (turn-right-anim int32 :offset-assert 640) - (split-type basic :offset-assert 644) + (split-type type :offset-assert 644) (attack-stop-frame float :offset-assert 648) (traj trajectory :inline :offset-assert 656) (which-trajectory int8 :offset-assert 696) @@ -54536,35 +54897,33 @@ (y-rotate float :offset-assert 704) (launch-pos vector :inline :offset-assert 720) (launch vector :inline :offset-assert 736) - (spin-jm basic :offset-assert 752) - (trail-part basic :offset-assert 756) - (trail-sound uint32 :offset-assert 760) - (flags uint64 :offset-assert 768) + (spin-jm joint-mod :offset-assert 752) + (trail-part sparticle-launch-control :offset-assert 756) + (trail-sound sound-id :offset-assert 760) + (flags eco-creature-flag :offset-assert 768) ) :method-count-assert 196 :size-assert #x308 :flag-assert #xc402900308 - (:methods - (prebot-large-eco-creature-method-194 () none) ;; 194 - (prebot-large-eco-creature-method-195 () none) ;; 195 - ) (:state-methods - unfold ;; 190 + knocked ;; 31 + notice ;; 35 + stare ;; 37 + hostile ;; 38 victory ;; 39 pacing ;; 156 circling ;; 157 - hostile ;; 38 + unfold ;; 190 fly-to-dest ;; 191 - notice ;; 35 attack ;; 192 - stare ;; 37 wait-for-children ;; 193 - knocked ;; 31 + ) + (:methods + (prebot-large-eco-creature-method-194 (_type_) none) ;; 194 + (prebot-large-eco-creature-method-195 (_type_) none) ;; 195 ) ) -|# -#| (deftype prebot-medium-eco-creature (prebot-large-eco-creature) ((is-top basic :offset-assert 776) (is-bottom basic :offset-assert 780) @@ -54574,76 +54933,63 @@ :method-count-assert 198 :size-assert #x318 :flag-assert #xc602a00318 - (:methods - (prebot-medium-eco-creature-method-196 () none) ;; 196 - (prebot-medium-eco-creature-method-197 () none) ;; 197 - ) (:state-methods knocked-recover ;; 32 ) + (:methods + (prebot-medium-eco-creature-method-196 (_type_) none) ;; 196 + (prebot-medium-eco-creature-method-197 (_type_) none) ;; 197 + ) ) -|# -#| (deftype prebot-small-eco-creature (prebot-medium-eco-creature) () :method-count-assert 198 :size-assert #x318 :flag-assert #xc602a00318 ) -|# -#| (deftype medium-eco-creature-launched (prebot-medium-eco-creature) () :method-count-assert 198 :size-assert #x318 :flag-assert #xc602a00318 ) -|# -#| (deftype small-eco-creature-launched (prebot-small-eco-creature) () :method-count-assert 198 :size-assert #x318 :flag-assert #xc602a00318 ) -|# -#| (deftype large-eco-creature (prebot-large-eco-creature) () :method-count-assert 196 :size-assert #x308 :flag-assert #xc402900308 ) -|# -#| (deftype medium-eco-creature (prebot-medium-eco-creature) () :method-count-assert 198 :size-assert #x318 :flag-assert #xc602a00318 ) -|# -#| (deftype small-eco-creature (prebot-small-eco-creature) () :method-count-assert 198 :size-assert #x318 :flag-assert #xc602a00318 ) -|# -;; (define-extern *prebot-large-eco-creature-nav-enemy-info* nav-enemy-info) -;; (define-extern large-eco-creature-split function) -;; (define-extern *prebot-medium-eco-creature-nav-enemy-info* nav-enemy-info) -;; (define-extern prebot-eco-creature-joint-callback function) -;; (define-extern adjust-split-joints function) -;; (define-extern *prebot-small-eco-creature-nav-enemy-info* nav-enemy-info) +(define-extern *prebot-large-eco-creature-nav-enemy-info* nav-enemy-info) +(define-extern large-eco-creature-split (function none :behavior prebot-large-eco-creature)) +(define-extern *prebot-medium-eco-creature-nav-enemy-info* nav-enemy-info) +(define-extern prebot-eco-creature-joint-callback (function cspace transformq none)) +(define-extern adjust-split-joints (function none :behavior prebot-medium-eco-creature)) +(define-extern *prebot-small-eco-creature-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; deswalk-part ;; @@ -55597,18 +55943,15 @@ ;; race-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype race-turbo-pad (structure) ((position vector :inline :offset-assert 0) - (handle uint64 :offset-assert 16) ;; handle + (handle handle :offset-assert 16) ;; handle ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype race-decision-point (structure) ((pos float :offset-assert 0) (decision-type uint8 :offset-assert 4) @@ -55619,22 +55962,32 @@ :size-assert #x7 :flag-assert #x900000007 ) -|# -#| +;; +++race-h:racer-info-flag +(defenum racer-info-flag + :type uint8 + :bitfield #t + ) +;; ---race-h:racer-info-flag + (deftype race-racer-info (structure) ((rider uint8 :offset-assert 0) (vehicle uint8 :offset-assert 1) - (flags uint8 :offset-assert 2) ;; racer-info-flags + (flags racer-info-flag :offset-assert 2) ;; racer-info-flags (seek-offset int8 :offset-assert 3) ) :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| +;; +++race-h:race-info-flag +(defenum race-info-flag + :type uint8 + :bitfield #t + ) +;; ---race-h:race-info-flag + (deftype race-info (basic) ((race-mesh-name string :offset-assert 4) ;; guessed by decompiler (path-group-name string :offset-assert 8) ;; guessed by decompiler @@ -55648,7 +56001,7 @@ (finish-sphere sphere :inline :offset-assert 64) (finish-dir vector :inline :offset-assert 80) (player-intro-pos vector :inline :offset-assert 96) - (flags uint8 :offset-assert 112) ;; race-info-flags + (flags racer-info-flag :offset-assert 112) ;; race-info-flags (score uint8 :offset-assert 113) (lap-count int8 :offset-assert 114) (racer-count int8 :offset-assert 115) @@ -55662,8 +56015,8 @@ (level symbol :offset-assert 132) ;; guessed by decompiler (borrow-level symbol :offset-assert 136) ;; guessed by decompiler (borrow pair :offset-assert 140) ;; guessed by decompiler - (manager uint64 :offset-assert 144) ;; handle - (manager-handle-init-hack basic :offset-assert 144) + (manager handle :offset-assert 144) ;; handle + (manager-handle-init-hack symbol :offset 144) (hatch-actor-name string :offset-assert 152) ;; guessed by decompiler (countdown-scene string :offset-assert 156) ;; guessed by decompiler (complete-continue string :offset-assert 160) ;; guessed by decompiler @@ -55678,13 +56031,18 @@ (race-info-method-9 () none) ;; 9 ;; (initialize-mesh (_type_) none) ) ) -|# -#| +;; +++race-h:racer-state-flags +(defenum racer-state-flags + :type uint8 + :bitfield #t + ) +;; ---race-h:racer-state-flags + (deftype racer-state (structure) ((position vector :inline :offset-assert 0) - (racer uint64 :offset-assert 16) ;; handle - (flags uint8 :offset-assert 24) ;; racer-flags + (racer handle :offset-assert 16) ;; handle + (flags racer-state-flags :offset-assert 24) ;; racer-flags (rank int8 :offset-assert 25) (finish-count int8 :offset-assert 26) (lap-count int8 :offset-assert 27) @@ -55712,34 +56070,44 @@ (racer-state-method-13 () none) ;; 13 ;; (init-racer! (_type_ process-drawable) none) ) ) -|# -#| +;; +++race-h:race-state-enum +(defenum race-state-enum + :type uint8 + ) +;; ---race-h:race-state-enum + +;; +++race-h:race-flag +(defenum race-flag + :type uint8 + ) +;; ---race-h:race-flag + (deftype race-state (structure) ((info race-info :offset-assert 0) ;; guessed by decompiler - (flags uint8 :offset-assert 4) ;; race-flags - (state uint8 :offset-assert 5) ;; race-state-enum + (flags race-flag :offset-assert 4) ;; race-flags + (state race-state-enum :offset-assert 5) ;; race-state-enum (racer-count int8 :offset-assert 6) (finished-count int8 :offset-assert 7) (i-player int8 :offset-assert 8) (i-countdown int8 :offset-assert 9) - (manager uint64 :offset-assert 16) ;; handle - (scene-player uint64 :offset-assert 24) ;; handle - (race-signal uint64 :offset-assert 32) ;; handle - (arrow uint64 :offset-assert 40) ;; handle - (hud-timer uint64 :offset-assert 48) ;; handle - (hud-lap-counter uint64 :offset-assert 56) ;; handle - (hud-turbo-counter uint64 :offset-assert 64) ;; handle - (hud-position uint64 :offset-assert 72) ;; handle + (manager handle :offset-assert 16) ;; handle + (scene-player handle :offset-assert 24) ;; handle + (race-signal handle :offset-assert 32) ;; handle + (arrow handle :offset-assert 40) ;; handle + (hud-timer handle :offset-assert 48) ;; handle + (hud-lap-counter handle :offset-assert 56) ;; handle + (hud-turbo-counter handle :offset-assert 64) ;; handle + (hud-position handle :offset-assert 72) ;; handle (current-time uint32 :offset-assert 80) (countdown-start-time uint32 :offset-assert 84) (race-start-time uint32 :offset-assert 88) (rankings int8 10 :offset-assert 92) ;; guessed by decompiler (target-pos float :offset-assert 104) (suck-factor float :offset-assert 108) - (player-win? basic :offset-assert 112) - (new-score? basic :offset-assert 116) - (racer-array racer-state 10 :offset-assert 128) ;; guessed by decompiler + (player-win? symbol :offset-assert 112) + (new-score? symbol :offset-assert 116) + (racer-array racer-state 10 :inline :offset-assert 128) ;; guessed by decompiler (player-intro-curve cubic-curve :inline :offset-assert 1248) ) :method-count-assert 21 @@ -55760,16 +56128,14 @@ (race-state-method-20 () none) ;; 20 ) ) -|# -#| (deftype race-manager (process) ((race-state race-state :offset-assert 128) - (state-time uint64 :offset-assert 136) ;; time-frame - (player-on-track-time uint64 :offset-assert 144) ;; time-frame + (state-time time-frame :offset-assert 136) ;; time-frame + (player-on-track-time time-frame :offset-assert 144) ;; time-frame (message-id sound-id :offset-assert 152) ;; guessed by decompiler (finish-sound-id sound-id :offset-assert 156) ;; guessed by decompiler - (show-stats? basic :offset-assert 160) + (show-stats? symbol :offset-assert 160) ) :method-count-assert 28 :size-assert #xa4 @@ -55791,82 +56157,68 @@ (race-manager-method-27 () none) ;; 27 ;; (stop-speech (_type_) none) ) ) -|# -#| (deftype hud-race-timer (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype hud-race-lap-counter (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype hud-race-turbo-counter (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype hud-race-position (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -;; (define-extern *race-manager* object) ;; (pointer race-manager) +(define-extern *race-manager* (pointer race-manager)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; race-mesh ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype race-mesh-hash-search (structure) ((best-dist float :offset-assert 0) (debug-cells-searched int32 :offset-assert 4) (debug-slices-searched int32 :offset-assert 8) (bounds bounding-box4w :inline :offset-assert 16) - (cell-quads vector 2 :offset-assert 48) ;; guessed by decompiler - (slice-quads vector 4 :offset-assert 80) ;; guessed by decompiler - (cell-bits vector16ub 2 :offset-assert 48) ;; guessed by decompiler - (slice-bits vector16ub 2 :offset-assert 80) ;; guessed by decompiler + (cell-quads vector 2 :inline :offset-assert 48) ;; guessed by decompiler + (slice-quads vector 4 :inline :offset-assert 80) ;; guessed by decompiler + (cell-bits vector16ub 2 :inline :offset 48) ;; guessed by decompiler + (slice-bits vector16ub 2 :inline :offset 80) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x90 :flag-assert #x900000090 ) -|# -#| (deftype race-mesh-slice-query (structure) ((slice-id int16 :offset-assert 0) (lap-dist float :offset-assert 4) (pt-on-slice vector :inline :offset-assert 16) - (slice-corners vector 4 :offset-assert 32) ;; guessed by decompiler + (slice-corners vector 4 :inline :offset-assert 32) ;; guessed by decompiler (search-sphere sphere :inline :offset-assert 96) ) :method-count-assert 9 :size-assert #x70 :flag-assert #x900000070 ) -|# -#| (deftype race-path-edge-info (structure) ((sample-t float :offset-assert 0) ) @@ -55874,25 +56226,21 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype race-path-sample (structure) - ((bytes uint8 32 :offset-assert 0) ;; guessed by decompiler - (pos vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (stick-x int8 :offset-assert 12) - (stick-y int8 :offset-assert 13) - (throttle uint8 :offset-assert 14) - (flags uint8 :offset-assert 15) + ((bytes uint8 32 :offset-assert 0 :score -1) ;; guessed by decompiler + (pos vector :inline :offset 0) + (quat quaternion :inline :offset 16) + (stick-x int8 :offset 12) + (stick-y int8 :offset 13) + (throttle uint8 :offset 14) + (flags uint8 :offset 15) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype race-path (structure) ((sample-count uint16 :offset-assert 0) (record-id int8 :offset-assert 2) @@ -55904,15 +56252,13 @@ :size-assert #xc :flag-assert #xd0000000c (:methods - (race-path-method-9 () none) ;; 9 ;; (draw-path-debug (_type_ rgba rgba) none) - (race-path-method-10 () none) ;; 10 ;; (race-path-method-10 (_type_ vector float float) none) - (race-path-method-11 () none) ;; 11 ;; (race-path-method-11 (_type_ race-path-sample vector float) none) - (race-path-method-12 () none) ;; 12 ;; (race-path-method-12 (_type_ vector float float) float) + (draw-path-debug (_type_ rgba rgba) none) ;; 9 + (race-path-method-10 (_type_ vector float float) none) ;; 10 + (race-path-method-11 (_type_ race-path-sample vector float) none) ;; 11 + (race-path-method-12 (_type_ vector float float) float) ;; 12 ) ) -|# -#| (deftype race-path-group (structure) ((name string :offset-assert 0) ;; guessed by decompiler (path-count int8 :offset-assert 4) @@ -55923,33 +56269,28 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype race-mesh-edge (structure) ((left vector :inline :offset-assert 0) (right vector :inline :offset-assert 16) - (lap-dist float :offset-assert 12) + (lap-dist float :offset 12) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype race-mesh-slice (structure) ((edge-index-array uint16 2 :offset-assert 0) ;; guessed by decompiler - (start-edge int16 :offset-assert 0) - (end-edge int16 :offset-assert 2) + (start-edge int16 :offset 0) + (end-edge int16 :offset 2) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype race-mesh-hash-cell (structure) ((first-slice int16 :offset-assert 0) (slice-count uint8 :offset-assert 2) @@ -55959,9 +56300,7 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype race-mesh-hash (structure) ((cells-wide int8 :offset-assert 0) (cells-tall int8 :offset-assert 1) @@ -55974,13 +56313,20 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| +;; +++race-h:race-mesh-flag +(defenum race-mesh-flag + :type uint8 + :bitfield #t + (rmf0 0) + (rmf1 1) + ) +;; ---race-h:race-mesh-flag + (deftype race-mesh (basic) ((version uint8 :offset-assert 4) (path-group-count uint8 :offset-assert 5) - (flags uint8 :offset-assert 6) ;; race-mesh-flags + (flags race-mesh-flag :offset-assert 6) ;; race-mesh-flags (pad uint8 1 :offset-assert 7) ;; guessed by decompiler (slice-count int16 :offset-assert 8) (edge-count int16 :offset-assert 10) @@ -55993,27 +56339,24 @@ :size-assert #x1c :flag-assert #x140000001c (:methods - (race-mesh-method-9 () none) ;; 9 ;; (debug-draw-path (_type_ int int rgba rgba) none) - (race-mesh-method-10 () none) ;; 10 ;; (debug-draw-path-from-history (_type_ int int) symbol) - (race-mesh-method-11 () none) ;; 11 ;; (debug-draw-slice (_type_ int) none) - (race-mesh-method-12 () none) ;; 12 ;; (debug-draw-edges (_type_) none) - (race-mesh-method-13 () none) ;; 13 ;; (race-mesh-method-13 (_type_ race-mesh-slice-query) none) - (race-mesh-method-14 () none) ;; 14 ;; (race-mesh-method-14 (_type_ race-mesh-slice-query) none) - (race-mesh-method-15 () none) ;; 15 ;; (race-mesh-method-15 (_type_ int race-mesh-slice-query) none) - (race-mesh-method-16 () none) ;; 16 ;; (race-mesh-method-16 (_type_ race-mesh-slice-query) none) - (race-mesh-method-17 () none) ;; 17 ;; (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol) - (race-mesh-method-18 () none) ;; 18 ;; (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none) - (race-mesh-method-19 () none) ;; 19 ;; (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol) + (debug-draw-path (_type_ int int rgba rgba) none) ;; 9 + (debug-draw-path-from-history (_type_ int int) symbol) ;; 10 + (debug-draw-slice (_type_ int) none) ;; 11 + (debug-draw-edges (_type_) none) ;; 12 + (race-mesh-method-13 (_type_ race-mesh-slice-query) none) ;; 13 + (race-mesh-method-14 (_type_ race-mesh-slice-query) none) ;; 14 + (race-mesh-method-15 (_type_ int race-mesh-slice-query) none) ;; 15 + (race-mesh-method-16 (_type_ race-mesh-slice-query) none) ;; 16 + (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol) ;; 17 + (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none) ;; 18 + (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol) ;; 19 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; race-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype race-control (structure) ((state race-state :offset-assert 0) (mesh race-mesh :offset-assert 4) ;; guessed by decompiler @@ -56030,20 +56373,19 @@ :size-assert #x60 :flag-assert #xd00000060 (:methods - (race-control-method-9 () none) ;; 9 ;; (race-control-method-9 (_type_ int vector) none) - (race-control-method-10 () none) ;; 10 ;; (race-control-method-10 (_type_ race-state racer-state) none) - (race-control-method-11 () none) ;; 11 ;; (race-control-method-11 (_type_ float) none) - (race-control-method-12 () none) ;; 12 ;; (race-control-method-12 (_type_ vector) none) + (race-control-method-9 (_type_ int vector) none) ;; 9 + (race-control-method-10 (_type_ race-state racer-state) none) ;; 10 + (race-control-method-11 (_type_ float) none) ;; 11 + (race-control-method-12 (_type_ vector) none) ;; 12 ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; race-info ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *race-info-array* array) ;; (array race-info) +(define-extern *race-info-array* (array race-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; race-manager ;; @@ -57069,9 +57411,8 @@ ;; was-squad-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype was-squad-control (squad-control) - ((manager uint64 :offset-assert 816) + ((manager handle :offset-assert 816) (target-count int8 :offset-assert 824) (process-count int8 :offset-assert 825) (active-count int8 :offset-assert 826) @@ -57084,62 +57425,73 @@ (inaccuracy-factor float :offset-assert 852) (attack-delay-factor float :offset-assert 856) (target-speed float :offset-assert 860) - (nav-mesh basic :offset-assert 864) - (units UNKNOWN 10 :offset-assert 872) + (nav-mesh nav-mesh :offset-assert 864) + (units handle 10 :offset-assert 872) ) :method-count-assert 37 :size-assert #x3b8 :flag-assert #x25000003b8 (:methods - (was-squad-control-method-34 () none) ;; 34 - (was-squad-control-method-35 () none) ;; 35 - (was-squad-control-method-36 () none) ;; 36 + (spawn-unit (_type_ vector quaternion) none) ;; 34 + (spawn-unit-offscreen (_type_) none) ;; 35 + (add-unit (_type_ process-focusable) none) ;; 36 ) ) -|# -#| (deftype was-squad-manager (process) - ((squad basic :offset-assert 128) + ((squad squad-control :offset-assert 128) ) :method-count-assert 17 :size-assert #x84 :flag-assert #x1100100084 - (:methods - (was-squad-manager-method-15 () none) ;; 15 - (was-squad-manager-method-16 () none) ;; 16 - ) (:state-methods idle ;; 14 ) + (:methods + (was-squad-manager-method-15 (_type_) none) ;; 15 + (was-squad-manager-method-16 (_type_) none) ;; 16 + ) ) -|# -;; (define-extern *was-squad-control* was-squad-control) -;; (define-extern *was-squad-manager* object) -;; (define-extern was-squad-manager-event-handler function) -;; (define-extern was-squad-manager-init-by-other function) -;; (define-extern was-squad-manager-start function) -;; (define-extern was-squad-manager-kill function) -;; (define-extern wvh function) +(deftype mystery-traffic-object-spawn-params0 (structure) + "was-squad-control::spawn-unit" + ((params traffic-object-spawn-params :inline) + (vec vector :inline) + (quat quaternion :inline) + ) + ) + +(define-extern *was-squad-control* was-squad-control) +(define-extern *was-squad-manager* object) +(def-event-handler was-squad-manager-event-handler was-squad-manager) +(define-extern was-squad-manager-init-by-other (function object :behavior was-squad-manager)) +(define-extern was-squad-manager-start function) +(define-extern was-squad-manager-kill function) +(define-extern wvh function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wvehicle-sound-loop-state (structure) - ((id uint32 :offset-assert 0) + ((id sound-id :offset-assert 0) (vol float :offset-assert 4) (pitch float :offset-assert 8) ) + :allow-misaligned :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| +;; +++wvehicle-h:vehicle-wheel-surface-flag +(defenum vehicle-wheel-surface-flag + :type uint8 + :bitfield #t + (moving) + ) +;; ---wvehicle-h:vehicle-wheel-surface-flag + (deftype vehicle-wheel-surface (structure) ((flags vehicle-wheel-surface-flag :offset-assert 0) (surface-type uint8 :offset-assert 1) @@ -57147,28 +57499,26 @@ (drag float :offset-assert 8) (depth float :offset-assert 12) (damage float :offset-assert 16) - (tire-roll-mix UNKNOWN 4 :offset-assert 20) - (tire-roll-hum float :offset-assert 20) - (tire-roll-dirt float :offset-assert 24) - (tire-roll-sand float :offset-assert 28) - (tire-roll-knobby float :offset-assert 32) - (tire-slide-mix UNKNOWN 2 :offset-assert 36) - (tire-slide-road float :offset-assert 36) - (tire-slide-dirt float :offset-assert 40) + (tire-roll-mix float 4 :offset-assert 20) + (tire-roll-hum float :offset 20) + (tire-roll-dirt float :offset 24) + (tire-roll-sand float :offset 28) + (tire-roll-knobby float :offset 32) + (tire-slide-mix float 2 :offset-assert 36) + (tire-slide-road float :offset 36) + (tire-slide-dirt float :offset 40) ) :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c ;; field vehicle-wheel-surface-flag is likely a value type. ) -|# -#| (deftype vehicle-wheel-state (structure) ((info vehicle-wheel-info :offset-assert 0) (flags uint8 :offset-assert 4) (prev-flags uint8 :offset-assert 5) - (handle uint64 :offset-assert 8) + (handle handle :offset-assert 8) (probe-local-pos vector :inline :offset-assert 16) (probe-local-dir vector :inline :offset-assert 32) (local-axis vector :inline :offset-assert 48) @@ -57177,7 +57527,7 @@ (ground-normal vector :inline :offset-assert 96) (trans vector :inline :offset-assert 112) (quat quaternion :inline :offset-assert 128) - (trail-pos UNKNOWN 2 :offset-assert 144) + (trail-pos vector 2 :inline :offset-assert 144) (surface vehicle-wheel-surface :offset-assert 176) (pos float :offset-assert 180) (pos2 float :offset-assert 184) @@ -57198,17 +57548,15 @@ (sink-depth float :offset-assert 244) (sin-susp-ang float :offset-assert 248) (cos-susp-ang float :offset-assert 252) - (part-birth-accum UNKNOWN 4 :offset-assert 256) + (part-birth-accum sparticle-launch-control 4 :offset-assert 256) (tread-time uint32 :offset-assert 272) - (tread-tracker uint64 :offset-assert 280) + (tread-tracker handle :offset-assert 280) ) :method-count-assert 9 :size-assert #x120 :flag-assert #x900000120 ) -|# -#| (deftype wvehicle-probe-work (structure) ((local-pos vector :inline :offset-assert 0) (local-normal vector :inline :offset-assert 16) @@ -57224,9 +57572,7 @@ :size-assert #x84 :flag-assert #x900000084 ) -|# -#| (deftype wvehicle-physics-work (structure) ((mat matrix :inline :offset-assert 0) (force vector :inline :offset-assert 64) @@ -57264,16 +57610,18 @@ (surface-type uint8 :offset-assert 396) (surface-depth float :offset-assert 400) (material uint64 :offset-assert 408) - (probe-work-array UNKNOWN 4 :offset-assert 416) + (probe-work-array wvehicle-probe-work 4 :inline :offset-assert 416) (cquery collide-query :inline :offset-assert 992) ) :method-count-assert 9 :size-assert #x5fc :flag-assert #x9000005fc ) -|# -#| +(declare-type vehicle-wheel-init-params structure) +(declare-type wvehicle-wheel-launcher-spec structure) +(declare-type wvehicle-part-work structure) + (deftype wvehicle (vehicle) ((race race-control :inline :offset-assert 704) (target-status squad-target-status :inline :offset-assert 800) @@ -57316,7 +57664,7 @@ (next-gear-select int8 :offset-assert 1017) (shift-time uint32 :offset-assert 1020) (impact rigid-body-impact :inline :offset-assert 1024) - (wheel UNKNOWN 4 :offset-assert 1088) + (wheel vehicle-wheel-state 4 :inline :offset-assert 1088) (gravity-dir vector :inline :offset-assert 2240) (ai-target-point vector :inline :offset-assert 2256) (surface-velocity vector :inline :offset-assert 2272) @@ -57333,14 +57681,14 @@ (gun-pitch-vel float :offset-assert 2364) (gun-kick float :offset-assert 2368) (lock-turret basic :offset-assert 2372) - (tire-roll-loop-state UNKNOWN 4 :offset-assert 2376) - (tire-slide-loop-state UNKNOWN 2 :offset-assert 2440) - (engine1-sound-id uint32 :offset-assert 2472) - (engine2-sound-id uint32 :offset-assert 2476) - (engine3-sound-id uint32 :offset-assert 2480) - (damage-sound-id uint32 :offset-assert 2484) - (water-sound-id uint32 :offset-assert 2488) - (turbo-sound-id uint32 :offset-assert 2492) + (tire-roll-loop-state wvehicle-sound-loop-state 4 :inline :offset-assert 2376) + (tire-slide-loop-state wvehicle-sound-loop-state 2 :inline :offset-assert 2440) + (engine1-sound-id sound-id :offset 2472) + (engine2-sound-id sound-id :offset-assert 2476) + (engine3-sound-id sound-id :offset-assert 2480) + (damage-sound-id sound-id :offset-assert 2484) + (water-sound-id sound-id :offset-assert 2488) + (turbo-sound-id sound-id :offset-assert 2492) (shortcut-time uint32 :offset-assert 2496) (overturned-time uint32 :offset-assert 2500) (splash-time uint32 :offset-assert 2504) @@ -57351,7 +57699,7 @@ (jump-time uint32 :offset-assert 2524) (ground-time uint32 :offset-assert 2528) (ram-time uint32 :offset-assert 2532) - (attached-array UNKNOWN 16 :offset-assert 2536) + (attached-array handle 16 :offset-assert 2536) (eng1-vol float :offset-assert 2664) (eng2-vol float :offset-assert 2668) (eng3-vol float :offset-assert 2672) @@ -57362,151 +57710,149 @@ (eng-pitch-offset float :offset-assert 2692) (eng-flutter-envelope float :offset-assert 2696) (water-sound-envelope float :offset-assert 2700) - (other-proc uint64 :offset-assert 2704) + (other-proc handle :offset-assert 2704) (other-pos vector :inline :offset-assert 2720) ) + :allow-misaligned :method-count-assert 203 :size-assert #xab0 :flag-assert #xcb0a300ab0 + (:state-methods + hostile ;; 152 + undefined0 ;; 153, not defined + race-waiting ;; 154 + race-racing ;; 155 + race-finished ;; 156 + undefined1 ;; 157, not defined + explode-into-nothing ;; 158 + sink ;; 159 + ) (:methods - (wvehicle-method-152 () none) ;; 152 - (wvehicle-method-153 () none) ;; 153 - (wvehicle-method-154 () none) ;; 154 - (wvehicle-method-155 () none) ;; 155 - (wvehicle-method-156 () none) ;; 156 - (wvehicle-method-157 () none) ;; 157 - (wvehicle-method-158 () none) ;; 158 - (wvehicle-method-159 () none) ;; 159 - (wvehicle-method-160 () none) ;; 160 - (wvehicle-method-161 () none) ;; 161 - (wvehicle-method-162 () none) ;; 162 - (wvehicle-method-163 () none) ;; 163 - (wvehicle-method-164 () none) ;; 164 - (wvehicle-method-165 () none) ;; 165 - (wvehicle-method-166 () none) ;; 166 - (wvehicle-method-167 () none) ;; 167 - (wvehicle-method-168 () none) ;; 168 - (wvehicle-method-169 () none) ;; 169 - (wvehicle-method-170 () none) ;; 170 - (wvehicle-method-171 () none) ;; 171 - (wvehicle-method-172 () none) ;; 172 - (wvehicle-method-173 () none) ;; 173 - (wvehicle-method-174 () none) ;; 174 - (wvehicle-method-175 () none) ;; 175 - (wvehicle-method-176 () none) ;; 176 - (wvehicle-method-177 () none) ;; 177 - (wvehicle-method-178 () none) ;; 178 - (wvehicle-method-179 () none) ;; 179 - (wvehicle-method-180 () none) ;; 180 - (wvehicle-method-181 () none) ;; 181 - (wvehicle-method-182 () none) ;; 182 - (wvehicle-method-183 () none) ;; 183 - (wvehicle-method-184 () none) ;; 184 - (wvehicle-method-185 () none) ;; 185 - (wvehicle-method-186 () none) ;; 186 - (wvehicle-method-187 () none) ;; 187 - (wvehicle-method-188 () none) ;; 188 - (wvehicle-method-189 () none) ;; 189 - (wvehicle-method-190 () none) ;; 190 - (wvehicle-method-191 () none) ;; 191 - (wvehicle-method-192 () none) ;; 192 - (wvehicle-method-193 () none) ;; 193 - (wvehicle-method-194 () none) ;; 194 - (wvehicle-method-195 () none) ;; 195 - (wvehicle-method-196 () none) ;; 196 - (wvehicle-method-197 () none) ;; 197 - (wvehicle-method-198 () none) ;; 198 - (wvehicle-method-199 () none) ;; 199 - (wvehicle-method-200 () none) ;; 200 - (wvehicle-method-201 () none) ;; 201 - (wvehicle-method-202 () none) ;; 202 + (wvehicle-method-160 (_type_ wvehicle-physics-work) none) ;; 160 + (spawn-wheels! (_type_ skeleton-group skeleton-group skeleton-group skeleton-group) none) ;; 161 + (wvehicle-method-162 (_type_ float) none) ;; 162 + (wvehicle-method-163 (_type_) none) ;; 163 + (wvehicle-method-164 (_type_ vehicle-wheel-state vehicle-wheel-info) none) ;; 164 + (wvehicle-method-165 (_type_) none) ;; 165 + (wvehicle-method-166 (_type_ float float) float) ;; 166 + (wvehicle-method-167 (_type_) none) ;; 167 + (wvehicle-method-168 (_type_) none) ;; 168 + (wvehicle-method-169 (_type_) none) ;; 169 + (wvehicle-method-170 (_type_) none) ;; 170 + (wvehicle-method-171 (_type_ vector int) none) ;; 171 + (wvehicle-method-172 (_type_ quaternion int) none) ;; 172 + (wvehicle-method-173 (_type_ vector) int) ;; 173 + (get-attached-by-idx (_type_ int) process-focusable) ;; 174 + (add-attached-at-idx (_type_ int process-focusable) none) ;; 175 + (remove-attached-from-arr (_type_ process-focusable) symbol) ;; 176 + (wvehicle-method-177 (_type_ vehicle-controls) none) ;; 177 + (wvehicle-method-178 (_type_) none) ;; 178 + (wvehicle-method-179 (_type_) none) ;; 179 + (wvehicle-method-180 (_type_ uint) none) ;; 180 + (wvehicle-method-181 (_type_) none) ;; 181 + (wvehicle-method-182 (_type_) none) ;; 182 + (wvehicle-method-183 (_type_) none) ;; 183 + (wvehicle-method-184 (_type_) none) ;; 184 + (wvehicle-method-185 (_type_) none) ;; 185 + (wvehicle-method-186 (_type_) none) ;; 186 + (wvehicle-method-187 (_type_) none) ;; 187 + (wvehicle-method-188 (_type_) none) ;; 188 + (wvehicle-method-189 (_type_ vehicle-wheel-state wvehicle-part-work wvehicle-wheel-launcher-spec) none) ;; 189 + (wvehicle-method-190 (_type_ vehicle-wheel-state wvehicle-part-work) none) ;; 190 + (wvehicle-method-191 (_type_ vehicle-wheel-state wvehicle-part-work) symbol) ;; 191 + (wvehicle-method-192 (_type_ vehicle-wheel-state wvehicle-part-work) none) ;; 192 + (wvehicle-method-193 (_type_ vehicle-wheel-state wvehicle-part-work) none) ;; 193 + (wvehicle-method-194 (_type_ vehicle-wheel-state wvehicle-part-work) none) ;; 194 + (wvehicle-method-195 (_type_) none) ;; 195 + (wvehicle-method-196 (_type_) none) ;; 196 + (wvehicle-method-197 (_type_) symbol) ;; 197 + (wvehicle-method-198 (_type_) none) ;; 198 + (wvehicle-method-199 (_type_) none) ;; 199 + (wvehicle-method-200 (_type_ vector wvehicle-part-work) none) ;; 200 + (wvehicle-method-201 (_type_) none) ;; 201 + (wvehicle-method-202 (_type_) none) ;; 202 ) ) -|# -#| (deftype wvehicle-ai-drop-off-params (structure) ((dest vector :inline :offset-assert 0) - (proc basic :offset-assert 16) + (proc process :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -;; (define-extern rpm->radians-per-sec function) -;; (define-extern radians-per-sec->rpm function) -;; (define-extern wvehicle-surface-type-from-material function) +(define-extern rpm->radians-per-sec (function float degrees)) +(define-extern radians-per-sec->rpm (function degrees float)) +(define-extern wvehicle-surface-type-from-material (function int int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern sparticle-motion-blur-dirt function) -;; (define-extern spt-birth-func-brightness-buggy-rocks function) -;; (define-extern spt-birth-func-part-buggy-rocks function) -;; (define-extern spt-birth-func-part-dbuggy-debris function) -;; (define-extern *range-wv-wsplash-color* curve-color-fast) -;; (define-extern *range-wv-wsplash-alpha* curve2d-fast) -;; (define-extern *range-wv-wsplash-scale-x* curve2d-fast) -;; (define-extern *range-wv-wsplash-scale-y* curve2d-fast) -;; (define-extern *curve-wv-wsplash-alpha* curve2d-fast) -;; (define-extern *curve-wv-wsplash-scale-x* curve2d-fast) -;; (define-extern *curve-wv-wsplash-scale-y* curve2d-fast) -;; (define-extern *part-wv-water-splash-curve-settings* object) -;; (define-extern *range-wv-splash-color* curve-color-fast) -;; (define-extern *range-wv-splash-alpha* curve2d-fast) -;; (define-extern *range-wv-splash-scale-x* curve2d-fast) -;; (define-extern *range-wv-splash-scale-y* curve2d-fast) -;; (define-extern *curve-wv-splash-alpha* curve2d-fast) -;; (define-extern *curve-wv-splash-scale-x* curve2d-fast) -;; (define-extern *curve-wv-splash-scale-y* curve2d-fast) -;; (define-extern *part-wv-water-splash-center-curve-settings* object) -;; (define-extern check-scorp-shell-level1 function) -;; (define-extern check-scorp-shell-level2 function) -;; (define-extern *curve-toad-linear-up-red* object) -;; (define-extern *trail-color-curve-toad-grenade* curve-color-fast) -;; (define-extern *curve-grenade-linear-toad-trail* curve2d-fast) -;; (define-extern *toad-grenade-trail* object) +(define-extern sparticle-motion-blur-dirt (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern spt-birth-func-brightness-buggy-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-part-buggy-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-dbuggy-debris (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *range-wv-wsplash-color* curve-color-fast) +(define-extern *range-wv-wsplash-alpha* curve2d-fast) +(define-extern *range-wv-wsplash-scale-x* curve2d-fast) +(define-extern *range-wv-wsplash-scale-y* curve2d-fast) +(define-extern *curve-wv-wsplash-alpha* curve2d-fast) +(define-extern *curve-wv-wsplash-scale-x* curve2d-fast) +(define-extern *curve-wv-wsplash-scale-y* curve2d-fast) +(define-extern *part-wv-water-splash-curve-settings* particle-curve-settings) +(define-extern *range-wv-splash-color* curve-color-fast) +(define-extern *range-wv-splash-alpha* curve2d-fast) +(define-extern *range-wv-splash-scale-x* curve2d-fast) +(define-extern *range-wv-splash-scale-y* curve2d-fast) +(define-extern *curve-wv-splash-alpha* curve2d-fast) +(define-extern *curve-wv-splash-scale-x* curve2d-fast) +(define-extern *curve-wv-splash-scale-y* curve2d-fast) +(define-extern *part-wv-water-splash-center-curve-settings* particle-curve-settings) +(define-extern check-scorp-shell-level1 (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern check-scorp-shell-level2 (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern *curve-toad-linear-up-red* curve2d-piecewise) +(define-extern *trail-color-curve-toad-grenade* curve-color-fast) +(define-extern *curve-grenade-linear-toad-trail* curve2d-fast) +(define-extern *toad-grenade-trail* light-trail-composition) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype turbo-pickup (process-drawable) - ((available symbol :offset-assert 200) ;; guessed by decompiler - (persistent basic :offset-assert 204) - (birth-time uint64 :offset-assert 208) - (collector uint64 :offset-assert 216) + ((root collide-shape :override) + (available symbol :offset-assert 200) ;; guessed by decompiler + (persistent symbol :offset-assert 204) + (birth-time time-frame :offset-assert 208) + (collector handle :offset-assert 216) ) :method-count-assert 23 :size-assert #xe0 :flag-assert #x17006000e0 - (:methods - (turbo-pickup-method-22 () none) ;; 22 ;; (find-ground (_type_) symbol) - ) (:state-methods - die ;; 21, old: (die () _type_ :state) - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 + die ;; 21 + ) + (:methods + (find-ground (_type_) symbol) ;; 22 ) ) -|# -;; (define-extern turbo-pickup-init-by-other function) ;; (function vector none :behavior turbo-pickup) -;; (define-extern race-turbo-pickup-spawn function) -;; (define-extern turbo-pickup-spawn function) ;; (function process vector turbo-pickup :behavior turbo-pickup) +(define-extern turbo-pickup-init-by-other (function vector symbol none :behavior turbo-pickup)) +(define-extern race-turbo-pickup-spawn (function process vector turbo-pickup)) +(define-extern turbo-pickup-spawn (function process vector turbo-pickup :behavior turbo-pickup)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle-wheel ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype vehicle-wheel-init-params (structure) - ((skel basic :offset-assert 0) - (skel-blur basic :offset-assert 4) - (level basic :offset-assert 8) + ((skel skeleton-group :offset-assert 0) + (skel-blur skeleton-group :offset-assert 4) + (level symbol :offset-assert 8) (radius float :offset-assert 12) (collision-mesh-index int8 :offset-assert 16) (position vector :inline :offset-assert 32) @@ -57517,11 +57863,9 @@ :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype vehicle-wheel (rigid-body-object) - ((collision-enable? basic :offset-assert 288) + ((collision-enable? symbol :offset-assert 288) (normal-look lod-set :inline :offset-assert 292) (blur-look lod-set :inline :offset-assert 344) ) @@ -57529,27 +57873,28 @@ :size-assert #x189 :flag-assert #x3b01100189 (:state-methods - die ;; 58 - fade-out ;; 57 - explode ;; 56 idle ;; 28 + explode ;; 56 + fade-out ;; 57 + die ;; 58 + ) + (:methods + (init-collision! (_type_ vehicle-wheel-init-params) none :replace) ) ) -|# -;; (define-extern *vehicle-wheel-constants* object) -;; (define-extern vehicle-wheel-init-by-other function) -;; (define-extern vehicle-wheel-spawn function) +(define-extern *vehicle-wheel-constants* rigid-body-object-constants) +(define-extern vehicle-wheel-init-by-other (function vehicle-wheel-init-params object :behavior vehicle-wheel)) +(define-extern vehicle-wheel-spawn (function process vehicle-wheel-init-params vehicle-wheel)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle-effects ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wvehicle-wheel-launcher-spec (structure) ((mat matrix :offset-assert 0) - (particle-system basic :offset-assert 4) - (launcher basic :offset-assert 8) + (particle-system sparticle-system :offset-assert 4) + (launcher sparticle-launcher :offset-assert 8) (num-spec sp-field-init-spec :offset-assert 12) (r-spec sp-field-init-spec :offset-assert 16) (g-spec sp-field-init-spec :offset-assert 20) @@ -57558,16 +57903,78 @@ (scale-x-spec sp-field-init-spec :offset-assert 32) (scale-y-spec sp-field-init-spec :offset-assert 36) (fade-a-spec sp-field-init-spec :offset-assert 40) - (ptr-birth-accum uint32 :offset-assert 44) + (ptr-birth-accum (pointer sparticle-launch-control) :offset-assert 44) (i-birth-accum int8 :offset-assert 48) ) + :pack-me :method-count-assert 9 :size-assert #x31 :flag-assert #x900000031 ) -|# -#| +;; added +(deftype wvehicle-draw-thruster-params (structure) + ((quat quaternion :inline :offset-assert 0) + (trans vector :inline :offset-assert 16) + (mat matrix :inline :offset 48) + (thrust float :offset 32) + (width float :offset 36) + (length float :offset 40) + (fog-fade float :offset 44) + ) + ) + +(deftype wvehicle-stack-type0 (structure) + ((float-arr float 4 :offset 0) + (vec00 vector :inline :offset 96) + (float03326 float :offset 16) + (float0335 float :offset 20) + (float032 float :offset 24) + (float03623423 float :offset 28) + (word00 uint32 :offset 28 :score 1) + (float00 float :offset 80) + (float01 float :offset 96) + (float000 float :offset 116) + (float8 float :offset 120) + (float02 float :offset 124) + (float03 float :offset 128) + (float04 float :offset 132) + (float05 float :offset 136) + (float06 float :offset 140) + (float07 float :offset 144) + ) + ) + +;; added +(deftype wvehicle-stack-type5 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 vector :inline :offset 32) + (vec3 vector :inline :offset 48) + (vec4 vector :inline :offset 64) + (vec5 vector :inline :offset 80) + (vec6 vector :inline :offset 96) + (vec7 vector :inline :offset 112) + (vec8 vector :inline :offset 128) + (vec9 vector :inline :offset 144) + ) + ) + +(deftype wvehicle-stack-type6 (structure) + ((mat0 matrix :inline :offset 0) + (quat0 quaternion :inline :offset 64) + (quat1 quaternion :inline :offset 80) + (quat2 quaternion :inline :offset 96) + (quat3 quaternion :inline :offset 112) + (quat4 quaternion :inline :offset 128) + (vec0 vector :inline :offset 144) + (vec1 vector :inline :offset 160) + (vec2 vector :inline :offset 176) + (vec3 vector :inline :offset 192) + (float0 float :offset 240) + ) + ) + (deftype wvehicle-part-work (structure) ((local-mat matrix :inline :offset-assert 0) (world-mat matrix :inline :offset-assert 64) @@ -57608,33 +58015,27 @@ :size-assert #x25c :flag-assert #x90000025c ) -|# -#| (deftype tire-trail-crumb (light-trail-breadcrumb) ((offset vector :inline :offset-assert 16) - (uu float :offset-assert 28) + (uu float :offset 28) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype tire-trail (light-trail) () :method-count-assert 24 :size-assert #x80 :flag-assert #x1800000080 (:methods - (tire-trail-method-22 () none) ;; 22 - (tire-trail-method-23 () none) ;; 23 + (tire-trail-method-22 (_type_) none) ;; 22 + (tire-trail-method-23 (_type_) none) ;; 23 ) ) -|# -#| (deftype tire-trail-tracker (light-trail-tracker) () :method-count-assert 21 @@ -57644,9 +58045,7 @@ tracking ;; 14 ) ) -|# -#| (deftype wvehicle-sound-loop-params (structure) ((speed float :offset-assert 0) (weight float :offset-assert 4) @@ -57655,22 +58054,30 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype wvehicle-sound-work (structure) - ((roll-basis-params UNKNOWN 4 :offset-assert 0) - (slide-basis-params UNKNOWN 2 :offset-assert 64) + ((roll-basis-params wvehicle-sound-loop-params 4 :inline :offset-assert 0) + (slide-basis-params wvehicle-sound-loop-params 2 :inline :offset-assert 64) ) :method-count-assert 9 :size-assert #x60 :flag-assert #x900000060 ) -|# -;; (define-extern *wheel-trail-info* object) -;; (define-extern tire-trail-tracker-init-by-other function) -;; (define-extern spawn-tire-trail-tracker function) +(deftype wvehicle-stack-type7 (structure) + ((work wvehicle-sound-work :inline :offset 0) + (vec0 vector :inline :offset 96) + (float3 float :offset 116) + (float2 float :offset 120) + (float0 float :offset 124) + (vec1 vector :inline :offset 128) + (float1 float :offset 144) + ) + ) + +(define-extern *wheel-trail-info* light-trail-composition) +(define-extern tire-trail-tracker-init-by-other (function light-trail-tracker-spawn-params object :behavior tire-trail-tracker)) +(define-extern spawn-tire-trail-tracker (function process light-trail-tracker-spawn-params tire-trail-tracker)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle ;; @@ -57681,25 +58088,70 @@ ;; wvehicle-util ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype kill-player-process (process) - ((player uint64 :offset-assert 128) - (mode basic :offset-assert 136) + ((player handle :offset-assert 128) + (mode symbol :offset-assert 136) ) :method-count-assert 16 :size-assert #x8c :flag-assert #x100010008c (:state-methods - die ;; 15 idle ;; 14 + die ;; 15 ) ) -|# -;; (define-extern have-earned-vehicle-v-type? function) +;; added +(deftype wvehicle-stack-type1 (structure) + ((vec00 vector :inline :offset 0) + (float00 float :offset 16) + (float01 float :offset 20) + (byte00 int8 :offset 24) + ) + ) + +(deftype wvehicle-stack-type2 (structure) + ((cquery collide-query :inline :offset 0) + (mat0 matrix :inline :offset 544) + (vec0 vector :inline :offset 592) + (vec1 vector :inline :offset 624) + (vec2 vector :inline :offset 640) + (vec3 vector :inline :offset 656) + (float0 float :offset 672) + ) + ) + +(deftype wvehicle-stack-type3 (structure) + ((vec0 vector :inline :offset 0) + (mat0 matrix :inline :offset 16) + (float0 float :offset 80) + ) + ) + +(deftype wvehicle-stack-type4 (structure) + ((byte0 int8 :offset 0) + (float0 float :offset 4) + (float1 float :offset 8) + (float2 float :offset 12) + ) + ) + +;; added +(deftype wvehicle-jmod-work (structure) + ((quat0 quaternion :inline :offset 0) + (quat1 quaternion :inline :offset 16) + (mat0 matrix :inline :offset 32) + (vec0 vector :inline :offset 96) + (float0 float :offset 112) + (float1 float :offset 116) + (float2 float :offset 120) + ) + ) + +(define-extern have-earned-vehicle-v-type? (function int symbol)) (define-extern have-vehicle-v-type? (function int symbol)) -;; (define-extern kill-player-process-init-by-other function) -;; (define-extern kill-player-process-spawn function) +(define-extern kill-player-process-init-by-other (function process symbol object :behavior kill-player-process)) +(define-extern kill-player-process-spawn (function process process symbol kill-player-process)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle-ai ;; @@ -57720,31 +58172,28 @@ ;; wvehicle-physics ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *wvehicle-surfaces* object) +(define-extern *wvehicle-surfaces* (inline-array vehicle-wheel-surface)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wvehicle-hud ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hud-vehicle-turbo (hud) - ((tex-rim basic :offset-assert 2756) - (tex-on basic :offset-assert 2760) - (tex-off basic :offset-assert 2764) + ((tex-rim texture :offset-assert 2756) + (tex-on texture :offset-assert 2760) + (tex-off texture :offset-assert 2764) ) :method-count-assert 27 :size-assert #xad0 :flag-assert #x1b0a500ad0 ) -|# -;; (define-extern hud-vehicle-turbo-spawn function) +(define-extern hud-vehicle-turbo-spawn (function process hud-vehicle-turbo)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-projectiles ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-scorp-shot (projectile) ((init-pos vector :inline :offset-assert 512) (init-dir vector :inline :offset-assert 528) @@ -57754,106 +58203,112 @@ :size-assert #x230 :flag-assert #x2901b00230 ) -|# -#| (deftype v-snake-shot (v-scorp-shot) () :method-count-assert 41 :size-assert #x230 :flag-assert #x2901b00230 ) -|# -#| (deftype v-rhino-shot (guard-shot) () :method-count-assert 41 :size-assert #x220 :flag-assert #x2901a00220 ) -|# -#| (deftype v-toad-shot (projectile) - ((trail-tracker uint64 :offset-assert 512) + ((trail-tracker handle :offset-assert 512) (blast-radius float :offset-assert 520) ) :method-count-assert 42 :size-assert #x20c :flag-assert #x2a0190020c - (:methods - (v-toad-shot-method-41 () none) ;; 41 - ) (:state-methods impact ;; 22 ) + (:methods + (set-y-vel (_type_) none) ;; 41 + ) ) -|# -#| (deftype v-marauder-shot (guard-shot) () :method-count-assert 41 :size-assert #x220 :flag-assert #x2901a00220 ) -|# -;; (define-extern v-scorp-shot-move function) -;; (define-extern cshape-reaction-scorp-shot function) +(define-extern v-scorp-shot-move (function v-scorp-shot none)) +(define-extern cshape-reaction-scorp-shot (function control-info collide-query vector vector collide-status)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wcar-base (wvehicle) - ((rider-hand-joint-array UNKNOWN 2 :offset-assert 2736) + ((rider-hand-joint-array int8 2 :offset-assert 2736) ) :method-count-assert 203 :size-assert #xab2 :flag-assert #xcb0a400ab2 ) -|# -#| (deftype wcar-snake-base (wcar-base) - ((local-gun-pos UNKNOWN 2 :offset-assert 2752) - (jmod-axles UNKNOWN 4 :offset-assert 2784) - (jmod-shock-tops UNKNOWN 4 :offset-assert 2912) - (jmod-shock-mids UNKNOWN 4 :offset-assert 3040) - (jmod-guns UNKNOWN 2 :offset-assert 3296) + ((local-gun-pos vector 2 :inline :offset-assert 2752) + (jmod-axles joint-mod-rotate-local 4 :inline :offset-assert 2784) + (jmod-shock-tops joint-mod-rotate-local 4 :inline :offset-assert 2912) + (jmod-shock-mids joint-mod-set-local 4 :inline :offset-assert 3040) + (jmod-guns joint-mod-set-local 2 :inline :offset-assert 3296) ) :method-count-assert 203 :size-assert #xd60 :flag-assert #xcb0ce00d60 ) -|# -;; (define-extern *v-turtle-constants* object) -;; (define-extern *v-snake-constants* object) -;; (define-extern *v-scorpion-constants* object) -;; (define-extern *v-toad-constants* object) -;; (define-extern *v-fox-constants* object) -;; (define-extern *v-rhino-constants* object) -;; (define-extern *v-mirage-constants* object) -;; (define-extern *v-x-ride-constants* object) -;; (define-extern *v-marauder-constants* object) -;; (define-extern *v-faccar-constants* object) -;; (define-extern *v-catapult-constants* object) -;; (define-extern *wcar-explosion-info* vehicle-explosion-info) +;; added +(deftype wcar-proj-init-by-other-params (structure) + ((params projectile-init-by-other-params :inline :offset 0) + (vec1 vector :inline :offset 32) + (mat0 matrix :inline :offset 128) + (mat1 matrix :inline :offset 192) + (vec0 vector 8 :inline :offset 256) + (barrel-idx int8 :offset 384) + ) + ) + +(deftype wcar-stack-type1 (structure) + ((vec0 vector 10 :inline :offset 0) + (vec1 vector 3 :inline :offset 176) + (float01 float :offset 252) + (float0 float :offset 256) + (float2 float :offset 260) + ) + ) + +(define-extern *v-turtle-constants* rigid-body-vehicle-constants) +(define-extern *v-snake-constants* rigid-body-vehicle-constants) +(define-extern *v-scorpion-constants* rigid-body-vehicle-constants) +(define-extern *v-toad-constants* rigid-body-vehicle-constants) +(define-extern *v-fox-constants* rigid-body-vehicle-constants) +(define-extern *v-rhino-constants* rigid-body-vehicle-constants) +(define-extern *v-mirage-constants* rigid-body-vehicle-constants) +(define-extern *v-x-ride-constants* rigid-body-vehicle-constants) +(define-extern *v-marauder-constants* rigid-body-vehicle-constants) +(define-extern *v-faccar-constants* rigid-body-vehicle-constants) +(define-extern *v-catapult-constants* rigid-body-vehicle-constants) +(define-extern *wcar-explosion-info* vehicle-explosion-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-turtle ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-turtle (wcar-base) - ((jmod-axles UNKNOWN 4 :offset-assert 2752) - (jmod-shock-tops UNKNOWN 4 :offset-assert 2880) - (jmod-shock-mids UNKNOWN 4 :offset-assert 3008) - (jmod-antenna UNKNOWN 4 :offset-assert 3264) + ((jmod-axles joint-mod-rotate-local 4 :inline :offset-assert 2752) + (jmod-shock-tops joint-mod-rotate-local 4 :inline :offset-assert 2880) + (jmod-shock-mids joint-mod-set-local 4 :inline :offset-assert 3008) + (jmod-antenna joint-mod-rotate-local 4 :inline :offset-assert 3264) (ant-tip-vel vector :inline :offset-assert 3392) (spring-pos vector :inline :offset-assert 3408) (spring-vel vector :inline :offset-assert 3424) @@ -57862,33 +58317,27 @@ :size-assert #xd70 :flag-assert #xcb0cf00d70 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-snake ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-snake (wcar-snake-base) () :method-count-assert 203 :size-assert #xd60 :flag-assert #xcb0ce00d60 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-scorpion ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-scorpion (wcar-base) - ((jmod-axles UNKNOWN 4 :offset-assert 2752) - (jmod-shock-tops UNKNOWN 4 :offset-assert 2880) - (jmod-shock-mids UNKNOWN 4 :offset-assert 3008) - (jmod-shock-bots UNKNOWN 4 :offset-assert 3264) + ((jmod-axles joint-mod-rotate-local 4 :inline :offset-assert 2752) + (jmod-shock-tops joint-mod-rotate-local 4 :inline :offset-assert 2880) + (jmod-shock-mids joint-mod-set-local 4 :inline :offset-assert 3008) + (jmod-shock-bots joint-mod-set-local 4 :inline :offset-assert 3264) (jmod-gun-kick joint-mod-add-local :inline :offset-assert 3520) (jmod-gun-tilt joint-mod-add-local :inline :offset-assert 3584) (jmod-gun-turn joint-mod-rotate-local :inline :offset-assert 3648) @@ -57897,50 +58346,71 @@ :size-assert #xe60 :flag-assert #xcb0de00e60 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-toad ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(deftype wcar-toad-stack-var0 (structure) + ((params projectile-init-by-other-params :inline :offset 0) + (mat0 matrix :inline :offset 128) + (vec0 vector :inline :offset 256) + (vec1 vector :inline :offset 272) + (vec2 vector :inline :offset 288) + (vec3 vector :inline :offset 304) + (vec4 vector :inline :offset 320) + (vec5 vector :inline :offset 336) + (vec6 vector :inline :offset 368) + (vec7 vector :inline :offset 384) + (vec8 vector :inline :offset 416) + (vec9 vector :inline :offset 432) + (vec10 vector :inline :offset 448) + (vec11 vector :inline :offset 464) + (barrel-idx int8 :offset 480) + ) + ) + (deftype v-toad (wcar-base) - ((jmod-axles UNKNOWN 4 :offset-assert 2752) - (jmod-shock-tops UNKNOWN 2 :offset-assert 2880) - (jmod-shock-bots UNKNOWN 2 :offset-assert 2944) + ((jmod-axles joint-mod-rotate-local 4 :inline :offset-assert 2752) + (jmod-shock-tops joint-mod-rotate-local 2 :inline :offset-assert 2880) + (jmod-shock-bots joint-mod-set-local 2 :inline :offset-assert 2944) ) :method-count-assert 204 :size-assert #xc00 :flag-assert #xcc0b800c00 (:methods - (v-toad-method-203 () none) ;; 203 + (v-toad-method-203 (_type_ vehicle-wheel-state vehicle-wheel-info) none) ;; 203 ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-fox ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-fox (wcar-snake-base) () :method-count-assert 203 :size-assert #xd60 :flag-assert #xcb0ce00d60 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-rhino ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; added +(deftype wcar-rhino-proj-params (structure) + ((mat matrix :inline :offset 0) + (gun-local-pos vector :inline :offset 64) + (gun-local-dir vector :inline :offset 80) + (gun-dir vector :inline :offset 96) + (params projectile-init-by-other-params :inline :offset 128) + ) + ) + (deftype v-rhino (wcar-base) - ((jmod-axles UNKNOWN 4 :offset-assert 2752) + ((jmod-axles joint-mod-rotate-local 4 :inline :offset-assert 2752) (jmod-gun-kick joint-mod-add-local :inline :offset-assert 2880) (jmod-gun-turn joint-mod-rotate-local :inline :offset-assert 2944) ) @@ -57948,44 +58418,35 @@ :size-assert #xba0 :flag-assert #xcb0b200ba0 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-mirage ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-mirage (wcar-snake-base) () :method-count-assert 203 :size-assert #xd60 :flag-assert #xcb0ce00d60 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-x-ride ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-x-ride (wcar-snake-base) () :method-count-assert 203 :size-assert #xd60 :flag-assert #xcb0ce00d60 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-marauder ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype v-marauder (wcar-base) - ((jmod-axles UNKNOWN 4 :offset-assert 2752) + ((jmod-axles joint-mod-rotate-local 4 :inline :offset-assert 2752) (jmod-gun-x joint-mod-rotate-local :inline :offset-assert 2880) (jmod-gun-y joint-mod-rotate-local :inline :offset-assert 2912) (jmod-hatch joint-mod-rotate-local :inline :offset-assert 2944) @@ -57997,48 +58458,45 @@ :method-count-assert 204 :size-assert #xc09 :flag-assert #xcc0b900c09 - (:methods - (v-marauder-method-203 () none) ;; 203 - ) (:state-methods explode ;; 60 ) + (:methods + (v-marauder-method-203 () none) ;; 203 + ) ) -|# -;; (define-extern *v-marauder-turret-control-info* object) -;; (define-extern *v-marauder-turret-guard-settings* object) +(define-extern *v-marauder-turret-control-info* object) +(define-extern *v-marauder-turret-guard-settings* object) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; w-parking-spot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype w-parking-spot (process-drawable) - ((vehicle uint64 :offset-assert 200) - (should-spawn? basic :offset-assert 208) - (should-cleanup? basic :offset-assert 212) - (v-type uint8 :offset-assert 216) + ((vehicle handle :offset-assert 200) + (should-spawn? symbol :offset-assert 208) + (should-cleanup? symbol :offset-assert 212) + (v-type game-vehicle-u8 :offset-assert 216) (minimap connection-minimap :offset-assert 220) (test-sphere sphere :inline :offset-assert 224) - (arrow uint64 :offset-assert 240) + (arrow handle :offset-assert 240) ) :method-count-assert 27 :size-assert #xf8 :flag-assert #x1b008000f8 - (:methods - (w-parking-spot-method-21 () none) ;; 21 - (w-parking-spot-method-22 () none) ;; 22 - (w-parking-spot-method-23 () none) ;; 23 - (w-parking-spot-method-24 () none) ;; 24 - (w-parking-spot-method-25 () none) ;; 25 - (w-parking-spot-method-26 () none) ;; 26 - ) (:state-methods idle ;; 20 ) + (:methods + (w-parking-spot-method-21 (_type_) none) ;; 21 + (w-parking-spot-method-22 (_type_) none) ;; 22 + (w-parking-spot-method-23 (_type_) none) ;; 23 + (w-parking-spot-method-24 (_type_) none) ;; 24 + (w-parking-spot-method-25 (_type_) symbol) ;; 25 + (w-parking-spot-method-26 (_type_) int) ;; 26 + ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -58854,9 +59312,20 @@ ;; basebutton ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++basebutton:button-status +(defenum button-status + :type uint16 + :bitfield #t + (pressed) + (button-status-1) + (button-status-2) + (button-status-3) + (button-status-4) + ) +;; ---basebutton:button-status + (deftype basebutton (process-focusable) - ((button-status uint16 :offset-assert 208) ;; button-status + ((button-status button-status :offset-assert 208) ;; button-status (notify-actor entity :offset-assert 212) ;; guessed by decompiler (actor-group (pointer actor-group) :offset-assert 216) ;; guessed by decompiler (actor-group-count int32 :offset-assert 220) @@ -58873,26 +59342,25 @@ :method-count-assert 40 :size-assert #x120 :flag-assert #x2800a00120 - (:methods - (basebutton-method-32 () none) ;; 32 ;; (idle-state-transition (_type_) object) - (basebutton-method-33 () none) ;; 33 ;; (basebutton-method-33 (_type_) none) - (basebutton-method-34 () none) ;; 34 ;; (basebutton-method-34 (_type_) none) - (basebutton-method-35 () none) ;; 35 ;; (prepare-trigger-event! (_type_) none) - (basebutton-method-36 () none) ;; 36 ;; (send-event! (_type_ symbol) none) - (basebutton-method-37 () none) ;; 37 ;; (move-to! (_type_ vector quaternion) none) - (basebutton-method-38 () none) ;; 38 ;; (press! (_type_ symbol) entity-perm-status) - (basebutton-method-39 () none) ;; 39 - ) (:state-methods - going-up ;; 30, old: (up-idle () _type_ :state) - down-idle ;; 28, old: (going-down () _type_ :state) - going-down ;; 29, old: (going-up () _type_ :state) - up-idle ;; 31, old: (reset! (_type_) none) + down-idle ;; 28 + going-down ;; 29 + going-up ;; 30 + up-idle ;; 31 + ) + (:methods + (init! (_type_) none) ;; 32 + (idle-state-transition (_type_) object) ;; 33 + (init-skel-and-ja! (_type_) none) ;; 34 + (init-collision! (_type_) none) ;; 35 + (prepare-trigger-event! (_type_) none) ;; 36 + (send-event! (_type_ symbol) none) ;; 37 + (move-to! (_type_ vector quaternion) none) ;; 38 + (press! (_type_ symbol) entity-perm-status) ;; 39 ) ) -|# -;; (define-extern basebutton-init-by-other function) ;; (function entity-actor vector quaternion entity-actor symbol float none :behavior basebutton) +(define-extern basebutton-init-by-other (function entity-actor vector quaternion entity-actor symbol float none :behavior basebutton)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mine-obs-h ;; @@ -58903,28 +59371,27 @@ ;; mine-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-explo-dust-color* curve-color-fast) -;; (define-extern *range-explo-dust-alpha* curve2d-fast) -;; (define-extern *range-explo-dust-scale-x* curve2d-fast) -;; (define-extern *range-explo-dust-scale-y* curve2d-fast) -;; (define-extern *curve-explo-dust-alpha* curve2d-fast) -;; (define-extern *curve-explo-dust-scale-x* curve2d-fast) -;; (define-extern *curve-explo-dust-scale-y* curve2d-fast) -;; (define-extern *part-bomb-train-explosion-dust-in-curve-settings* object) -;; (define-extern *range-explo-color* curve-color-fast) -;; (define-extern *range-explo-alpha* curve2d-fast) -;; (define-extern *range-explo-scale-x* curve2d-fast) -;; (define-extern *range-explo-scale-y* curve2d-fast) -;; (define-extern *curve-explo-alpha* curve2d-fast) -;; (define-extern *curve-explo-scale-x* curve2d-fast) -;; (define-extern *curve-explo-scale-y* curve2d-fast) -;; (define-extern *part-bomb-train-explosion-texture-curve-settings* object) +(define-extern *range-explo-dust-color* curve-color-fast) +(define-extern *range-explo-dust-alpha* curve2d-fast) +(define-extern *range-explo-dust-scale-x* curve2d-fast) +(define-extern *range-explo-dust-scale-y* curve2d-fast) +(define-extern *curve-explo-dust-alpha* curve2d-fast) +(define-extern *curve-explo-dust-scale-x* curve2d-fast) +(define-extern *curve-explo-dust-scale-y* curve2d-fast) +(define-extern *part-bomb-train-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-explo-color* curve-color-fast) +(define-extern *range-explo-alpha* curve2d-fast) +(define-extern *range-explo-scale-x* curve2d-fast) +(define-extern *range-explo-scale-y* curve2d-fast) +(define-extern *curve-explo-alpha* curve2d-fast) +(define-extern *curve-explo-scale-x* curve2d-fast) +(define-extern *curve-explo-scale-y* curve2d-fast) +(define-extern *part-bomb-train-explosion-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mine-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mineb-light-state (structure) ((current float :offset-assert 0) (target float :offset-assert 4) @@ -58933,19 +59400,15 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype mineb-states (structure) - ((lights UNKNOWN 3 :offset-assert 0) + ((lights mineb-light-state 3 :inline :offset-assert 0) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype minec-states (structure) ((light light-state :inline :offset-assert 0) (electricity electricity-state :inline :offset-assert 8) @@ -58954,53 +59417,47 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -;; (define-extern init-mood-minea function) -;; (define-extern update-mood-minea function) -;; (define-extern init-mood-mineb function) -;; (define-extern update-mood-mineb function) -;; (define-extern set-mineb-lights! function) -;; (define-extern init-mood-minec function) -;; (define-extern update-mood-minec function) +(define-extern init-mood-minea (function mood-context float)) +(define-extern update-mood-minea (function mood-context float int none :behavior time-of-day-proc)) +(define-extern init-mood-mineb (function mood-context float)) +(define-extern update-mood-mineb (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-mineb-lights! (function int float none)) +(define-extern init-mood-minec (function mood-context float)) +(define-extern update-mood-minec (function mood-context float int none :behavior time-of-day-proc)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mine-platforms ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mine-platform-base (base-plat) () :method-count-assert 38 :size-assert #x110 :flag-assert #x2600900110 - (:methods - (mine-platform-base-method-36 () none) ;; 36 - (mine-platform-base-method-37 () none) ;; 37 - ) (:state-methods plat-base-state ;; 35 ) + (:methods + (get-skel (_type_) art-group) ;; 36 + (alloc-path! (_type_ entity) none) ;; 37 + ) ) -|# -#| (deftype min-moving-plat-spooler (process-drawable) - ((spool-sound uint32 :offset-assert 200) + ((spool-sound sound-id :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc - (:methods - (min-moving-plat-spooler-method-21 () none) ;; 21 - ) (:state-methods active ;; 20 ) + (:methods + (queue-drill-sound (_type_) none) ;; 21 + ) ) -|# -#| (deftype min-moving-plat (mine-platform-base) ((animation-speed float :offset-assert 272) (sync sync-linear :inline :offset-assert 280) @@ -59011,137 +59468,123 @@ (sound-bit uint32 :offset-assert 312) (sound-gear uint32 :offset-assert 316) (last-frame float :offset-assert 320) - (spooler uint64 :offset-assert 328) + (spooler handle :offset-assert 328) (sync-offset float :offset-assert 336) ) :method-count-assert 40 :size-assert #x154 :flag-assert #x2800e00154 (:state-methods - active ;; 39 idle ;; 38 + active ;; 39 ) ) -|# -#| (deftype min-rotating-plat (mine-platform-base) ((animation-speed float :offset-assert 272) (sync sync-linear :inline :offset-assert 280) - (sound-loop-id uint32 :offset-assert 296) + (sound-loop-id sound-id :offset-assert 296) ) :method-count-assert 40 :size-assert #x12c :flag-assert #x2800b0012c (:state-methods - active ;; 39 idle ;; 38 + active ;; 39 ) ) -|# -#| (deftype min-falling-elevator (elevator) ((wheel-angle float :offset-assert 416) - (stop-sound basic :offset-assert 420) + (stop-sound symbol :offset-assert 420) + (pad uint8 4) ) :method-count-assert 55 :size-assert #x1ac :flag-assert #x37013001ac (:state-methods - resetting ;; 54 - falling ;; 53 - unstable ;; 52 - arrived ;; 38 running ;; 37 + arrived ;; 38 + unstable ;; 52 + falling ;; 53 + resetting ;; 54 ) ) -|# -#| (deftype min-falling-step (mine-platform-base) - ((should-fall basic :offset-assert 268) - (actor-group uint32 :offset-assert 272) - (actor-group-count int32 :offset-assert 276) + ((should-fall symbol :offset-assert 272) + (actor-group (pointer actor-group) :offset-assert 276) + (actor-group-count int32 :offset-assert 280) ) :method-count-assert 41 :size-assert #x11c :flag-assert #x2900a0011c (:state-methods - lowered ;; 40 - lowering ;; 39 idle ;; 38 + lowering ;; 39 + lowered ;; 40 ) ) -|# -#| (deftype min-elev-track (elevator) () :method-count-assert 52 :size-assert #x1a0 :flag-assert #x34012001a0 ) -|# -#| (deftype min-folding-plat (process-drawable) - ((stop-sound basic :offset-assert 200) - (sound-id uint32 :offset-assert 204) + ((root collide-shape-moving :override) + (stop-sound symbol :offset-assert 200) + (sound-id sound-id :offset-assert 204) ) :method-count-assert 24 :size-assert #xd0 :flag-assert #x18005000d0 - (:methods - (min-folding-plat-method-23 () none) ;; 23 - ) (:state-methods - extended ;; 22 - extend ;; 21 idle ;; 20 + extend ;; 21 + extended ;; 22 + ) + (:methods + (set-bounds! (_type_) none) ;; 23 ) ) -|# -#| (deftype min-ramp (process-drawable) - ((angle float :offset-assert 200) - (play-anim? basic :offset-assert 204) - (play-ramp-sound? basic :offset-assert 208) - (stop-ramp-sound basic :offset-assert 212) - (ramp-sound uint32 :offset-assert 216) + ((angle degrees :offset-assert 200) + (play-anim? symbol :offset-assert 204) + (play-ramp-sound? symbol :offset-assert 208) + (stop-ramp-sound symbol :offset-assert 212) + (ramp-sound sound-id :offset-assert 216) ) :method-count-assert 23 :size-assert #xdc :flag-assert #x17006000dc (:state-methods - rotated ;; 22 - rotating ;; 21 idle ;; 20 + rotating ;; 21 + rotated ;; 22 ) ) -|# -#| (deftype min-bridge (process-drawable) - ((stop-bridge-sound basic :offset-assert 200) - (bridge-sound uint32 :offset-assert 204) + ((stop-bridge-sound symbol :offset-assert 200) + (bridge-sound sound-id :offset-assert 204) ) :method-count-assert 24 :size-assert #xd0 :flag-assert #x18005000d0 - (:methods - (min-bridge-method-23 () none) ;; 23 - ) (:state-methods - extended ;; 22 - extend ;; 21 idle ;; 20 + extend ;; 21 + extended ;; 22 + ) + (:methods + (init-collision! (_type_) none) ;; 23 ) ) -|# -#| (deftype min-plat-updown (base-plat) ((sync sync-eased :inline :offset-assert 272) (path-pos float :offset-assert 316) @@ -59149,17 +59592,15 @@ :method-count-assert 38 :size-assert #x140 :flag-assert #x2600c00140 - (:methods - (min-plat-updown-method-37 () none) ;; 37 - ) (:state-methods - active ;; 36 idle ;; 35 + active ;; 36 + ) + (:methods + (get-skel (_type_) art-group) ;; 37 ) ) -|# -#| (deftype min-moving-step (min-plat-updown) ((holding? basic :offset-assert 320) ) @@ -59171,9 +59612,7 @@ dormant ;; 38 ) ) -|# -#| (deftype min-elevator (elevator) () :method-count-assert 52 @@ -59183,115 +59622,106 @@ running ;; 37 ) ) -|# -;; (define-extern min-moving-plat-spooler-init-by-other function) -;; (define-extern *drill-loop-mid-curve* object) -;; (define-extern min-falling-elevator-callback function) -;; (define-extern min-ramp-callback function) +(define-extern min-moving-plat-spooler-init-by-other (function vector object :behavior min-moving-plat-spooler)) +(define-extern *drill-loop-mid-curve* curve2d-piecewise) +(define-extern min-falling-elevator-callback (function cspace transformq none)) +(define-extern min-ramp-callback (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mine-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype rat-light-manager (process) - ((actor-group uint32 :offset-assert 124) - (actor-group-count int32 :offset-assert 128) + ((actor-group (pointer actor-group) :offset-assert 128) + (actor-group-count int32 :offset-assert 132) ) :method-count-assert 17 :size-assert #x88 :flag-assert #x1100100088 - (:methods - (rat-light-manager-method-15 () none) ;; 15 - (rat-light-manager-method-16 () none) ;; 16 - ) (:state-methods idle ;; 14 ) + (:methods + (rat-light-manager-method-15 (_type_ int int symbol) none) ;; 15 + (rat-light-manager-method-16 (_type_ int symbol) none) ;; 16 + ) ) -|# -#| (deftype min-rat-engine (process-drawable) - ((init-quat quaternion :inline :offset-assert 204) - (force-pos vector :inline :offset-assert 220) - (actor-group uint32 :offset-assert 236) - (actor-group-count int32 :offset-assert 240) - (rot-speed float :offset-assert 244) - (ang-momentum float :offset-assert 248) - (rat-timer uint64 :offset-assert 252) - (notify-actor basic :offset-assert 260) - (sound-id uint32 :offset-assert 264) - (rat-sound-id uint32 :offset-assert 268) - (rat-wheel-sound-id uint32 :offset-assert 272) - (light-index uint32 :offset-assert 276) - (light-target float :offset-assert 280) - (wheel-angle float :offset-assert 284) - (wheel-sound-volume float :offset-assert 288) - (last-turn-time uint64 :offset-assert 292) - (rat-count uint32 :offset-assert 300) + ((root collide-shape-moving :override) + (init-quat quaternion :inline :offset-assert 208) + (force-pos vector :inline :offset-assert 224) + (actor-group (pointer actor-group) :offset-assert 240) + (actor-group-count int32 :offset-assert 244) + (rot-speed float :offset-assert 248) + (ang-momentum float :offset-assert 252) + (rat-timer time-frame :offset-assert 256) + (notify-actor entity-actor :offset-assert 264) + (sound-id sound-id :offset-assert 268) + (rat-sound-id sound-id :offset-assert 272) + (rat-wheel-sound-id sound-id :offset-assert 276) + (light-index uint32 :offset-assert 280) + (light-target float :offset-assert 284) + (wheel-angle float :offset-assert 288) + (wheel-sound-volume float :offset-assert 292) + (last-turn-time time-frame :offset-assert 296) + (rat-count uint32 :offset-assert 304) ) :method-count-assert 29 :size-assert #x134 :flag-assert #x1d00c00134 - (:methods - (min-rat-engine-method-24 () none) ;; 24 - (min-rat-engine-method-25 () none) ;; 25 - (min-rat-engine-method-26 () none) ;; 26 - (min-rat-engine-method-27 () none) ;; 27 - (min-rat-engine-method-28 () none) ;; 28 - ) (:state-methods - shutdown ;; 23 - running ;; 22 - active ;; 21 inactive ;; 20 + active ;; 21 + running ;; 22 + shutdown ;; 23 + ) + (:methods + (min-rat-engine-method-24 (_type_) none) ;; 24 + (min-rat-engine-method-25 (_type_) none) ;; 25 + (min-rat-engine-method-26 (_type_ float float float float) symbol) ;; 26 + (min-rat-engine-method-27 (_type_ process focus) none) ;; 27 + (min-rat-engine-method-28 (_type_) none) ;; 28 ) ) -|# -#| (deftype min-crane (process-drawable) () :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (min-crane-method-21 () none) ;; 21 - ) (:state-methods idle ;; 20 ) + (:methods + (min-crane-method-21 (_type_) none) ;; 21 + ) ) -|# -#| (deftype min-target-sign (mine-platform-base) - ((off-part basic :offset-assert 272) - (on-part basic :offset-assert 276) + ((off-part sparticle-launch-control :offset-assert 272) + (on-part sparticle-launch-control :offset-assert 276) (track-pos vector :inline :offset-assert 288) - (alt-actor basic :offset-assert 304) - (touched-train? basic :offset-assert 308) + (alt-actor entity-actor :offset-assert 304) + (touched-train? symbol :offset-assert 308) ) :method-count-assert 43 :size-assert #x138 :flag-assert #x2b00c00138 - (:methods - (min-target-sign-method-42 () none) ;; 42 - ) (:state-methods - idle-down ;; 41 - lowering ;; 40 - idle ;; 39 dormant ;; 38 + idle ;; 39 + lowering ;; 40 + idle-down ;; 41 + ) + (:methods + (spawn-on-off-part (_type_ symbol) object) ;; 42 ) ) -|# -#| (deftype min-bomb-elevator (elevator) - ((alt-actor basic :offset-assert 416) + ((alt-actor entity-actor :offset-assert 416) (bomb-train-offset float :offset-assert 420) (wheel-angle float :offset-assert 424) ) @@ -59299,195 +59729,176 @@ :size-assert #x1ac :flag-assert #x34013001ac (:state-methods - arrived ;; 38 - running ;; 37 waiting ;; 36 + running ;; 37 + arrived ;; 38 ) ) -|# -#| (deftype min-elev-doors (process-drawable) () :method-count-assert 24 :size-assert #xc8 :flag-assert #x18005000c8 - (:methods - (min-elev-doors-method-23 () none) ;; 23 - ) (:state-methods - opened ;; 22 - open ;; 21 idle ;; 20 + open ;; 21 + opened ;; 22 + ) + (:methods + (min-elev-doors-method-23 (_type_) none) ;; 23 ) ) -|# -#| (deftype min-crane-switch (basebutton) - ((rog uint64 :offset-assert 288) + ((rog handle :offset-assert 288) ) :method-count-assert 40 :size-assert #x128 :flag-assert #x2800b00128 (:state-methods - up-idle ;; 31 down-idle ;; 28 + up-idle ;; 31 ) ) -|# -#| (deftype min-door (process-drawable) () :method-count-assert 24 :size-assert #xc8 :flag-assert #x18005000c8 - (:methods - (min-door-method-22 () none) ;; 22 - (min-door-method-23 () none) ;; 23 - ) (:state-methods - exploded ;; 21 idle ;; 20 + exploded ;; 21 + ) + (:methods + (min-door-method-22 (_type_) none) ;; 22 + (min-door-method-23 (_type_) none) ;; 23 ) ) -|# -#| (deftype min-elec-gate (elec-gate) () :method-count-assert 31 :size-assert #x200 :flag-assert #x1f01800200 ) -|# -#| (deftype min-boss-elev (elevator) - ((going-down? basic :offset-assert 416) - (sound-rotating-loop basic :offset-assert 420) + ((going-down? symbol :offset-assert 416) + (sound-rotating-loop sound-spec :offset-assert 420) ) :method-count-assert 52 :size-assert #x1a8 :flag-assert #x34013001a8 (:state-methods - running ;; 37 dormant ;; 35 + running ;; 37 ) ) -|# -#| (deftype min-airlock-door (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 ) -|# -#| (deftype mine-music-manager (task-manager) () :method-count-assert 32 :size-assert #xf0 :flag-assert #x20007000f0 ) -|# -;; (define-extern mineb-activate function) -;; (define-extern min-rat-engine-handler function) -;; (define-extern min-rat-engine-post function) -;; (define-extern joint-mod-rat-engine-callback function) -;; (define-extern target-sign-event-handler function) -;; (define-extern min-bomb-elevator-callback function) +(define-extern mineb-activate (function none)) +(define-extern min-rat-engine-handler (function process int symbol event-message-block object :behavior min-rat-engine)) +(define-extern min-rat-engine-post (function none :behavior min-rat-engine)) +(define-extern joint-mod-rat-engine-callback (function cspace transformq none)) +(define-extern target-sign-event-handler (function process int symbol event-message-block object :behavior min-target-sign)) +(define-extern min-bomb-elevator-callback (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mine-train ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype min-bomb-train (process-focusable) ((path-pos float :offset-assert 208) (path-length float :offset-assert 212) (speed float :offset-assert 216) (fall-travel-time float :offset-assert 220) - (actor-group uint32 :offset-assert 224) + (actor-group (pointer actor-group) :offset-assert 224) (actor-group-count int32 :offset-assert 228) - (wheel-angle float :offset-assert 232) - (sound-loop-id uint32 :offset-assert 236) + (wheel-angle degrees :offset-assert 232) + (sound-loop-id sound-id :offset-assert 236) (attack-id uint32 :offset-assert 240) - (spark-part basic :offset-assert 244) - (smoke-part basic :offset-assert 248) - (light-part basic :offset-assert 252) - (doors-exploded? basic :offset-assert 256) - (taskman uint64 :offset-assert 264) + (spark-part sparticle-launch-control :offset-assert 244) + (smoke-part sparticle-launch-control :offset-assert 248) + (light-part sparticle-launch-control :offset-assert 252) + (doors-exploded? symbol :offset-assert 256) + (taskman handle :offset-assert 264) (current-rail uint8 :offset-assert 272) (suck-level float :offset-assert 276) - (minimap basic :offset-assert 280) + (minimap (array connection-minimap) :offset-assert 280) ) :method-count-assert 41 :size-assert #x11c :flag-assert #x2900a0011c - (:methods - (min-bomb-train-method-35 () none) ;; 35 - (min-bomb-train-method-36 () none) ;; 36 - (min-bomb-train-method-37 () none) ;; 37 - (min-bomb-train-method-38 () none) ;; 38 - (min-bomb-train-method-39 () none) ;; 39 - (min-bomb-train-method-40 () none) ;; 40 - ) (:state-methods - explode-doors ;; 34 + idle ;; 28 + wait ;; 29 + active ;; 30 explode ;; 31 fall ;; 32 die ;; 33 - active ;; 30 - wait ;; 29 - idle ;; 28 + explode-doors ;; 34 + ) + (:methods + (alloc-path! (_type_) symbol) ;; 35 + (init-collision! (_type_) none) ;; 36 + (get-path-progress (_type_ float float) float) ;; 37 + (update-task-manager (_type_) object) ;; 38 + (spawn-debris (_type_) none) ;; 39 + (explode-sound (_type_) none) ;; 40 ) ) -|# -;; (define-extern *min-bomb-train-times* array) -;; (define-extern *min-bomb-train-debris-params* debris-static-params) -;; (define-extern min-bomb-train-callback function) +(define-extern *min-bomb-train-times* (array float)) +(define-extern *min-bomb-train-debris-params* debris-static-params) +(define-extern min-bomb-train-callback (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mine-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype leggings (process-drawable) - ((alt-actor basic :offset-assert 200) + ((alt-actor entity-actor :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 ) ) -|# -;; (define-extern *range-explo-door-dust-color* curve-color-fast) -;; (define-extern *range-explo-door-dust-alpha* curve2d-fast) -;; (define-extern *range-explo-door-dust-scale-x* curve2d-fast) -;; (define-extern *range-explo-door-dust-scale-y* curve2d-fast) -;; (define-extern *curve-explo-door-dust-alpha* curve2d-fast) -;; (define-extern *curve-explo-door-dust-scale-x* curve2d-fast) -;; (define-extern *curve-explo-door-dust-scale-y* curve2d-fast) -;; (define-extern *part-bomb-door-explosion-dust-in-curve-settings* object) -;; (define-extern *range-explo-door-color* curve-color-fast) -;; (define-extern *range-explo-door-alpha* curve2d-fast) -;; (define-extern *range-explo-door-scale-x* curve2d-fast) -;; (define-extern *range-explo-door-scale-y* curve2d-fast) -;; (define-extern *curve-explo-door-alpha* curve2d-fast) -;; (define-extern *curve-explo-door-scale-x* curve2d-fast) -;; (define-extern *curve-explo-door-scale-y* curve2d-fast) -;; (define-extern *part-bomb-door-explosion-texture-curve-settings* object) +(define-extern *range-explo-door-dust-color* curve-color-fast) +(define-extern *range-explo-door-dust-alpha* curve2d-fast) +(define-extern *range-explo-door-dust-scale-x* curve2d-fast) +(define-extern *range-explo-door-dust-scale-y* curve2d-fast) +(define-extern *curve-explo-door-dust-alpha* curve2d-fast) +(define-extern *curve-explo-door-dust-scale-x* curve2d-fast) +(define-extern *curve-explo-door-dust-scale-y* curve2d-fast) +(define-extern *part-bomb-door-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-explo-door-color* curve-color-fast) +(define-extern *range-explo-door-alpha* curve2d-fast) +(define-extern *range-explo-door-scale-x* curve2d-fast) +(define-extern *range-explo-door-scale-y* curve2d-fast) +(define-extern *curve-explo-door-alpha* curve2d-fast) +(define-extern *curve-explo-door-scale-x* curve2d-fast) +(define-extern *curve-explo-door-scale-y* curve2d-fast) +(define-extern *part-bomb-door-explosion-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mine-ocean ;; @@ -59504,104 +59915,109 @@ ;; manta ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++manta:manta-flags +(defenum manta-flags + :type uint16 + :bitfield #t + (mf0 0) + (mf1 1) + ) +;; ---manta:manta-flags + (deftype manta (nav-enemy) - ((info rigid-body-object-constants :offset-assert 616) - (move-matrix matrix :inline :offset-assert 620) - (curve-matrix matrix :inline :offset-assert 684) - (move-vel vector :inline :offset-assert 748) - (move-u float :offset-assert 764) - (move-du float :offset-assert 768) - (move-force float :offset-assert 772) - (flags uint16 :offset-assert 776) - (go-enable basic :offset-assert 780) - (orbit-speed float :offset-assert 784) - (max-time-step float :offset-assert 788) - (gravity float :offset-assert 792) - (landed-pos vector :inline :offset-assert 796) - (dest-pos vector :inline :offset-assert 812) - (attack-pos vector :inline :offset-assert 828) - (up-dir vector :inline :offset-assert 844) - (forward-dir vector :inline :offset-assert 860) - (knocked-force vector :inline :offset-assert 876) - (knocked-force-mult float :offset-assert 892) - (default-y-offset float :offset-assert 896) - (y-offset float :offset-assert 900) - (last-attack-time uint64 :offset-assert 908) - (attack-y-offset float :offset-assert 916) - (attack-path-blocked-time uint64 :offset-assert 924) - (track-timer uint64 :offset-assert 932) - (angle-to-player float :offset-assert 940) - (offset-difference float :offset-assert 944) - (sound-volume float :offset-assert 948) - (restart-fly-anims basic :offset-assert 952) - (fly-anim-speed float :offset-assert 956) - (hit-ground-count uint32 :offset-assert 960) - (fade-level float :offset-assert 964) - (actor-group uint32 :offset-assert 496) - (actor-group-count int32 :offset-assert 500) + ((info rigid-body-object-constants :offset-assert 620) + (move-matrix matrix :inline :offset-assert 624) + (curve-matrix matrix :inline :offset-assert 688) + (move-vel vector :inline :offset-assert 752) + (move-u float :offset-assert 768) + (move-du float :offset-assert 772) + (move-force float :offset-assert 776) + (flags manta-flags :offset-assert 780) + (go-enable symbol :offset-assert 784) + (orbit-speed float :offset-assert 788) + (max-time-step float :offset-assert 792) + (gravity float :offset-assert 796) + (landed-pos vector :inline :offset-assert 800) + (dest-pos vector :inline :offset-assert 816) + (attack-pos vector :inline :offset-assert 832) + (up-dir vector :inline :offset-assert 848) + (forward-dir vector :inline :offset-assert 864) + (knocked-force vector :inline :offset-assert 880) + (knocked-force-mult float :offset-assert 896) + (default-y-offset float :offset-assert 900) + (y-offset float :offset-assert 904) + (last-attack-time time-frame :offset-assert 912) + (attack-y-offset float :offset-assert 920) + (attack-path-blocked-time time-frame :offset-assert 928) + (track-timer time-frame :offset-assert 936) + (angle-to-player float :offset-assert 944) + (offset-difference float :offset-assert 948) + (sound-volume float :offset-assert 952) + (restart-fly-anims symbol :offset-assert 956) + (fly-anim-speed float :offset-assert 960) + (hit-ground-count uint32 :offset-assert 964) + (fade-level float :offset-assert 968) + ; (actor-group (pointer actor-group) :offset-assert 496) + ; (actor-group-count int32 :offset-assert 500) + (pad uint8 8) ) :method-count-assert 209 :size-assert #x3d4 :flag-assert #xd1036003d4 - (:methods - (manta-method-195 () none) ;; 195 - (manta-method-196 () none) ;; 196 - (manta-method-197 () none) ;; 197 - (manta-method-198 () none) ;; 198 - (manta-method-199 () none) ;; 199 - (manta-method-200 () none) ;; 200 - (manta-method-201 () none) ;; 201 - (manta-method-202 () none) ;; 202 - (manta-method-203 () none) ;; 203 - (manta-method-204 () none) ;; 204 - (manta-method-205 () none) ;; 205 - (manta-method-206 () none) ;; 206 - (manta-method-207 () none) ;; 207 - (manta-method-208 () none) ;; 208 - ) (:state-methods - knocked-recover ;; 32 knocked ;; 31 - attack-end ;; 194 - hostile ;; 38 - attack ;; 193 - stare ;; 37 - notice-to-fly ;; 192 - land ;; 191 - ambush ;; 47 - active ;; 34 - land-approach ;; 190 + knocked-recover ;; 32 idle ;; 33 + active ;; 34 + stare ;; 37 + hostile ;; 38 + ambush ;; 47 + land-approach ;; 190 + land ;; 191 + notice-to-fly ;; 192 + attack ;; 193 + attack-end ;; 194 + ) + (:methods + (manta-method-195 (_type_) none) ;; 195 + (manta-method-196 (_type_) symbol) ;; 196 + (manta-method-197 (_type_) none) ;; 197 + (manta-method-198 (_type_) none) ;; 198 + (manta-method-199 (_type_) none) ;; 199 + (manta-method-200 (_type_) none) ;; 200 + (manta-method-201 (_type_ float) none) ;; 201 + (do-impact (_type_) none) ;; 202 + (manta-method-203 (_type_ float) none) ;; 203 + (manta-method-204 (_type_) none) ;; 204 + (update-target-pos! (_type_) none) ;; 205 + (manta-method-206 (_type_) none) ;; 206 + (alloc-rbody! (_type_ rigid-body-object-constants) none) ;; 207 + (manta-method-208 (_type_) none) ;; 208 ) ) -|# -;; (define-extern *manta-rigid-body-constants* object) -;; (define-extern *fact-info-manta-defaults* fact-info-enemy-defaults) -;; (define-extern *manta-nav-enemy-info* nav-enemy-info) -;; (define-extern manta-hostile-post function) -;; (define-extern manta-attack-post function) -;; (define-extern manta-fly-code function) +(define-extern *manta-rigid-body-constants* rigid-body-object-constants) +(define-extern *fact-info-manta-defaults* fact-info-enemy-defaults) +(define-extern *manta-nav-enemy-info* nav-enemy-info) +(define-extern manta-hostile-post (function none :behavior manta)) +(define-extern manta-attack-post (function none :behavior manta)) +(define-extern manta-fly-code (function none :behavior manta)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gekko ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype gekko-foot-info (structure) ((ground-pos vector :inline :offset-assert 0) (ground-normal vector :inline :offset-assert 16) (foot-transform transformq :inline :offset-assert 32) - (leg-ik basic :offset-assert 80) + (leg-ik joint-mod-ik :offset-assert 80) ) :method-count-assert 9 :size-assert #x54 :flag-assert #x900000054 ) -|# -#| (deftype gekko-ik-setup (structure) ((elbow-index int32 :offset-assert 0) (hand-index int32 :offset-assert 4) @@ -59612,200 +60028,197 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype gekko-shadow-spot (structure) ((position vector :inline :offset-assert 0) (normal vector :inline :offset-assert 16) - (valid? basic :offset-assert 32) + (valid? symbol :offset-assert 32) (pat uint32 :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -#| +;; +++gekko:gekko-flag +(defenum gekko-flag + :type uint16 + :bitfield #t + (update-foot-position?) + (follow-terrain) + (update-tilt) + (on-wall?) + (falling-off-wall?) + ) +;; ---gekko:gekko-flag + (deftype gekko (nav-enemy) - ((shadow-spot gekko-shadow-spot :inline :offset-assert 620) - (foot UNKNOWN 4 :offset-assert 668) - (rot-matrix matrix :inline :offset-assert 1052) - (gspot-normal vector :inline :offset-assert 1116) - (tilt-quat quaternion :inline :offset-assert 1132) - (dest-to-me-dir vector :inline :offset-assert 1148) - (turn-face-point vector :inline :offset-assert 1164) - (flags gekko-flag :offset-assert 1180) - (attack-time uint64 :offset-assert 1188) - (last-turn-time uint64 :offset-assert 1196) - (fade float :offset-assert 1204) - (rot-mult float :offset-assert 1208) - (move-speed float :offset-assert 1212) - (move-decel float :offset-assert 1216) - (turn-next-state basic :offset-assert 1220) - (path-wall basic :offset-assert 1224) - (scared-timer uint64 :offset-assert 1228) - (scale float :offset-assert 1236) - (probe-len float :offset-assert 1240) + ((shadow-spot gekko-shadow-spot :inline :offset-assert 624) + (foot gekko-foot-info 4 :inline :offset-assert 672) + (rot-matrix matrix :inline :offset-assert 1056) + (gspot-normal vector :inline :offset-assert 1120) + (tilt-quat quaternion :inline :offset-assert 1136) + (dest-to-me-dir vector :inline :offset-assert 1152) + (turn-face-point vector :inline :offset-assert 1168) + (flags gekko-flag :offset-assert 1184) + (attack-time time-frame :offset-assert 1192) + (last-turn-time time-frame :offset-assert 1200) + (fade float :offset-assert 1208) + (rot-mult float :offset-assert 1212) + (move-speed float :offset-assert 1216) + (move-decel float :offset-assert 1220) + (turn-next-state (state gekko) :offset-assert 1224) + (path-wall path-control :offset-assert 1228) + (scared-timer time-frame :offset-assert 1232) + (scale float :offset-assert 1240) + (probe-len float :offset-assert 1244) ) :method-count-assert 209 :size-assert #x4e0 :flag-assert #xd1046004e0 ;; field gekko-flag is likely a value type. - (:methods - (gekko-method-202 () none) ;; 202 - (gekko-method-203 () none) ;; 203 - (gekko-method-204 () none) ;; 204 - (gekko-method-205 () none) ;; 205 - (gekko-method-206 () none) ;; 206 - (gekko-method-207 () none) ;; 207 - (gekko-method-208 () none) ;; 208 - ) (:state-methods - knocked-recover ;; 32 knocked ;; 31 - jump ;; 44 - turn-quick ;; 201 - turn ;; 200 - attack ;; 199 - pre-attack ;; 198 - hostile ;; 38 + knocked-recover ;; 32 idle ;; 33 - active-wall ;; 190 active ;; 34 notice ;; 35 + flee ;; 36 + stare ;; 37 + hostile ;; 38 + jump ;; 44 + active-wall ;; 190 hostile-wall ;; 191 turn-wall ;; 192 - flee ;; 36 attack-wall ;; 193 - stare ;; 37 knocked-wall ;; 194 jump-off-wall ;; 195 jump-off-wall-falling ;; 196 jump-off-wall-recover ;; 197 + pre-attack ;; 198 + attack ;; 199 + turn ;; 200 + turn-quick ;; 201 + ) + (:methods + (gekko-method-202 (_type_) none) ;; 202 + (gekko-method-203 (_type_) none) ;; 203 + (gekko-method-204 (_type_) none) ;; 204 + (gekko-method-205 (_type_) none) ;; 205 + (gekko-method-206 (_type_) none) ;; 206 + (gekko-method-207 (_type_) none) ;; 207 + (gekko-method-208 (_type_) none) ;; 208 ) ) -|# -#| (deftype gecko (gekko) () :method-count-assert 209 :size-assert #x4e0 :flag-assert #xd1046004e0 ) -|# -;; (define-extern *gekko-ik-setup* object) -;; (define-extern *gekko-foot-offset* array) -;; (define-extern *fact-info-gekko-defaults* fact-info-enemy-defaults) -;; (define-extern *gekko-nav-enemy-info* nav-enemy-info) -;; (define-extern hostile-wall-trans function) -;; (define-extern gekko-stare-code function) -;; (define-extern gekko-foot-rot-handler function) -;; (define-extern gekko-postbind function) -;; (define-extern gekko-postbind-callback function) +(define-extern *gekko-ik-setup* (inline-array gekko-ik-setup)) +(define-extern *gekko-foot-offset* (array gekko-foot-info)) +(define-extern *fact-info-gekko-defaults* fact-info-enemy-defaults) +(define-extern *gekko-nav-enemy-info* nav-enemy-info) +(define-extern hostile-wall-trans (function none :behavior gekko)) +(define-extern gekko-stare-code (function none :behavior gekko)) +(define-extern gekko-foot-rot-handler (function cspace transformq none)) +(define-extern gekko-postbind (function draw-control cspace-array none)) +(define-extern gekko-postbind-callback (function draw-control cspace-array joint-control none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; rat ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype rat (nav-enemy) ((init-quat quaternion :inline :offset-assert 624) (roll-transform transformq :inline :offset-assert 640) (face-dir vector :inline :offset-assert 688) (flee-focus-pos vector :inline :offset-assert 704) - (wheel-actor basic :offset-assert 720) - (permanently-scared basic :offset-assert 724) + (wheel-actor entity-actor :offset-assert 720) + (permanently-scared symbol :offset-assert 724) (slide-sound-id uint32 :offset-assert 728) - (scared-timer uint64 :offset-assert 736) - (scared-interval uint64 :offset-assert 744) - (return-to-nav-mesh? basic :offset-assert 752) + (scared-timer time-frame :offset-assert 736) + (scared-interval time-frame :offset-assert 744) + (return-to-nav-mesh? symbol :offset-assert 752) ) :method-count-assert 198 :size-assert #x2f4 :flag-assert #xc6028002f4 - (:methods - (rat-method-195 () none) ;; 195 - ) (:state-methods - wheel-die ;; 197 - running-in-wheel ;; 196 + knocked ;; 31 knocked-recover ;; 32 idle ;; 33 active ;; 34 - wait-by-wheel-seek ;; 190 - ambush ;; 47 - active-turn ;; 192 - flee ;; 36 notice ;; 35 - wait-by-wheel-wait ;; 191 - hostile ;; 38 - flee-stare ;; 194 - attack ;; 193 + flee ;; 36 stare ;; 37 - knocked ;; 31 + hostile ;; 38 + ambush ;; 47 + wait-by-wheel-seek ;; 190 + wait-by-wheel-wait ;; 191 + active-turn ;; 192 + attack ;; 193 + flee-stare ;; 194 + undefined ;; 195, not defined + running-in-wheel ;; 196 + wheel-die ;; 197 ) ) -|# -#| (deftype rat-spawner (process) - ((rats-spawned uint32 :offset-assert 124) - (wheel-entity basic :offset-assert 128) - (state-time uint64 :offset-assert 132) - (active? basic :offset-assert 140) - (rats-to-spawn uint32 :offset-assert 144) - (actor-group uint32 :offset-assert 148) - (actor-group-count int32 :offset-assert 152) + ((rats-spawned uint32 :offset-assert 128) + (wheel-entity entity-actor :offset-assert 132) + (state-time time-frame :offset-assert 136) + (active? symbol :offset-assert 144) + (rats-to-spawn uint32 :offset-assert 148) + (actor-group (pointer actor-group) :offset-assert 152) + (actor-group-count int32 :offset-assert 156) ) :method-count-assert 16 :size-assert #xa0 :flag-assert #x10002000a0 (:state-methods - die ;; 15 idle ;; 14 + die ;; 15 ) ) -|# -;; (define-extern *fact-info-rat-defaults* fact-info-enemy-defaults) -;; (define-extern *rat-nav-enemy-info* nav-enemy-info) -;; (define-extern rat-run-code function) -;; (define-extern rat-falling-post function) -;; (define-extern rat-joint-mod-roll function) +(define-extern *fact-info-rat-defaults* fact-info-enemy-defaults) +(define-extern *rat-nav-enemy-info* nav-enemy-info) +(define-extern rat-run-code (function none :behavior rat)) +(define-extern rat-falling-post (function none :behavior rat)) +(define-extern rat-joint-mod-roll (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; monster-frog ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype monster-frog (nav-enemy) () :method-count-assert 193 :size-assert #x26c :flag-assert #xc101f0026c (:state-methods - turn ;; 192 - hostile ;; 38 - stare ;; 37 - circling ;; 157 - pacing ;; 156 - attack-recover ;; 191 - notice ;; 35 - attack ;; 190 active ;; 34 + notice ;; 35 + stare ;; 37 + hostile ;; 38 ambush ;; 47 + pacing ;; 156 + circling ;; 157 + (attack vector) ;; 190 + attack-recover ;; 191 + turn ;; 192 ) ) -|# -;; (define-extern *fact-info-monster-frog-defaults* fact-info-enemy-defaults) -;; (define-extern *monster-frog-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info -;; (define-extern monster-frog-hop-slow-code function) ;; (function symbol :behavior monster-frog) -;; (define-extern monster-frog-hop-fast-code function) ;; (function symbol :behavior monster-frog) +(define-extern *fact-info-monster-frog-defaults* fact-info-enemy-defaults) +(define-extern *monster-frog-nav-enemy-info* nav-enemy-info) +(define-extern monster-frog-hop-slow-code (function symbol :behavior monster-frog)) +(define-extern monster-frog-hop-fast-code (function symbol :behavior monster-frog)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mhcityb-texture ;; @@ -62033,24 +62446,19 @@ ;; wascitya-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wascity-stad-door (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 ) -|# -#| (deftype waspala-elevator (elevator) () :method-count-assert 52 :size-assert #x1a0 :flag-assert #x34012001a0 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desertf-obs ;; @@ -64659,10 +65067,9 @@ ;; forest-obs-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype shaker (structure) ((axis vector :inline :offset-assert 0) - (start-time uint64 :offset-assert 16) ;; time-frame + (start-time time-frame :offset-assert 16) ;; time-frame (decay-time float :offset-assert 24) (amplitude float :offset-assert 28) (freq float :offset-assert 32) @@ -64676,10 +65083,9 @@ :size-assert #x38 :flag-assert #xa00000038 (:methods - (shaker-method-9 () none) ;; 9 ;; (shaker-method-9 (_type_) none) + (shaker-method-9 (_type_) none) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -65716,68 +66122,55 @@ ;; ctymark-obs-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype market-object (crate) - ((sound-explode basic :offset-assert 288) - (part-explode basic :offset-assert 292) + ((sound-explode sound-spec :offset-assert 288) + (part-explode sparticle-launch-group :offset-assert 292) (explode-matrix matrix :inline :offset-assert 304) ) :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 (:state-methods - die ;; 30 idle ;; 29 + ;; (die symbol int) ;; 30 ) ) -|# -#| (deftype market-basket-a (market-object) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype market-basket-b (market-object) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype market-crate (market-object) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype market-sack-a (market-object) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype market-sack-b (market-object) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype fruit-stand (process-focusable) ((incoming-attack-id uint32 :offset-assert 208) (hack-counter uint32 :offset-assert 212) @@ -65785,31 +66178,32 @@ (first-sparts uint32 :offset-assert 220) (num-sparts uint32 :offset-assert 224) (sparts-index uint32 4 :offset-assert 228) ;; guessed by decompiler - (sparts-pos vector 4 :offset-assert 256) ;; guessed by decompiler - (parts-alive? basic :offset-assert 320) + (sparts-pos vector 4 :inline :offset-assert 256) ;; guessed by decompiler + (parts-alive? symbol :offset-assert 320) ) :method-count-assert 31 :size-assert #x144 :flag-assert #x1f00d00144 + (:state-methods + idle ;; 28 + ) (:methods - (fruit-stand-method-28 () none) ;; 28 ;; (fruit-stand-method-28 (_type_) none) - (fruit-stand-method-29 () none) ;; 29 ;; (fruit-stand-method-29 (_type_) none) - (fruit-stand-method-30 () none) ;; 30 + (fruit-stand-method-29 (_type_) none) ;; 29 + (fruit-stand-method-30 (_type_) none) ;; 30 ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctymark-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern check-market-piece-ground function) ;; (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern market-activate function) ;; (function level none) -;; (define-extern *fruit-check-ground-counter* object) ;; int -;; (define-extern fruit-check-ground-bounce function) ;; (function sparticle-system sparticle-cpuinfo sparticle-launchinfo matrix float) -;; (define-extern fruit-sparticle-next-on-mode-1 function) ;; (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float) -;; (define-extern fruit-stand-event-handler function) ;; (function process int symbol event-message-block object :behavior fruit-stand) +(define-extern check-market-piece-ground (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern market-activate (function level none)) +(define-extern *fruit-check-ground-counter* int) +(define-extern fruit-check-ground-bounce (function sparticle-system sparticle-cpuinfo sparticle-launchinfo matrix float)) +(define-extern fruit-sparticle-next-on-mode-1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float)) +(define-extern fruit-stand-event-handler (function process int symbol event-message-block object :behavior fruit-stand)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wasteland-scenes ;; @@ -65966,67 +66360,66 @@ ;; waswide-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern spt-birth-func-brightness-sat-scrape-dirt function) -;; (define-extern spt-birth-func-part-sat-scrape-dirt function) -;; (define-extern spt-birth-func-part-sat-scrape-rocks function) -;; (define-extern *range-sat-explo-scene-color* curve-color-fast) -;; (define-extern *range-sat-explo-scene-alpha* curve2d-fast) -;; (define-extern *range-sat-explo-scene-scale-x* curve2d-fast) -;; (define-extern *range-sat-explo-scene-scale-y* curve2d-fast) -;; (define-extern *curve-sat-explo-scene-alpha* curve2d-fast) -;; (define-extern *curve-sat-explo-scene-scale-x* curve2d-fast) -;; (define-extern *curve-sat-explo-scene-scale-y* curve2d-fast) -;; (define-extern *part-neo-satellite-explosion-texture-scene-curve-settings* object) -;; (define-extern *range-color-wascity-palace-fire-beacon-flame* curve-color-fast) -;; (define-extern *range-alpha-wascity-palace-fire-beacon-flame* curve2d-fast) -;; (define-extern *range-scale-wascity-palace-fire-beacon-flame-x* curve2d-fast) -;; (define-extern *range-scale-wascity-palace-fire-beacon-flame-y* curve2d-fast) -;; (define-extern *r-curve-wascity-palace-fire-beacon-flame* curve2d-fast) -;; (define-extern *g-curve-wascity-palace-fire-beacon-flame* curve2d-fast) -;; (define-extern *b-curve-wascity-palace-fire-beacon-flame* curve2d-fast) -;; (define-extern *curve-alpha-wascity-palace-fire-beacon-flame* curve2d-fast) -;; (define-extern *curve-wascity-palace-fire-beacon-flame-x* curve2d-fast) -;; (define-extern *curve-wascity-palace-fire-beacon-flame-y* curve2d-fast) -;; (define-extern *part-wascity-palace-fire-beacon-flame-curve-settings* object) -;; (define-extern *range-wrsplash-color* curve-color-fast) -;; (define-extern *range-wrsplash-alpha* curve2d-fast) -;; (define-extern *range-wrsplash-scale-x* curve2d-fast) -;; (define-extern *range-wrsplash-scale-y* curve2d-fast) -;; (define-extern *curve-wrsplash-alpha* curve2d-fast) -;; (define-extern *curve-wrsplash-scale-x* curve2d-fast) -;; (define-extern *curve-wrsplash-scale-y* curve2d-fast) -;; (define-extern *part-water-rocks-splash-curve-settings* object) -;; (define-extern part-wascityb-bird1-path function) -;; (define-extern part-wascityb-bird2-path function) -;; (define-extern part-wascityb-bird3-path function) -;; (define-extern part-wascityb-bird4-path function) -;; (define-extern part-wascityb-bird5-path function) -;; (define-extern part-wascityb-bird6-path function) -;; (define-extern part-wascityb-bird7-path function) -;; (define-extern part-wascityb-bird8-path function) -;; (define-extern part-wascityb-bird9-path function) -;; (define-extern part-wascityb-bird10-path function) -;; (define-extern part-wascitya-fly1-path function) -;; (define-extern part-wascitya-fly2-path function) -;; (define-extern part-wascitya-fly3-path function) -;; (define-extern *range-color-flame* curve-color-fast) -;; (define-extern *range-alpha-flame* curve2d-fast) -;; (define-extern *range-scale-flame-x* curve2d-fast) -;; (define-extern *range-scale-flame-y* curve2d-fast) -;; (define-extern *r-curve-flame* curve2d-fast) -;; (define-extern *g-curve-flame* curve2d-fast) -;; (define-extern *b-curve-flame* curve2d-fast) -;; (define-extern *curve-alpha-flame* curve2d-fast) -;; (define-extern *curve-flame-x* curve2d-fast) -;; (define-extern *curve-flame-y* curve2d-fast) -;; (define-extern *part-gas-lamp-flame-curve-settings* object) -;; (define-extern *part-talltorch-flame-curve-settings* object) +(define-extern spt-birth-func-brightness-sat-scrape-dirt (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-part-sat-scrape-dirt (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-sat-scrape-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *range-sat-explo-scene-color* curve-color-fast) +(define-extern *range-sat-explo-scene-alpha* curve2d-fast) +(define-extern *range-sat-explo-scene-scale-x* curve2d-fast) +(define-extern *range-sat-explo-scene-scale-y* curve2d-fast) +(define-extern *curve-sat-explo-scene-alpha* curve2d-fast) +(define-extern *curve-sat-explo-scene-scale-x* curve2d-fast) +(define-extern *curve-sat-explo-scene-scale-y* curve2d-fast) +(define-extern *part-neo-satellite-explosion-texture-scene-curve-settings* particle-curve-settings) +(define-extern *range-color-wascity-palace-fire-beacon-flame* curve-color-fast) +(define-extern *range-alpha-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *range-scale-wascity-palace-fire-beacon-flame-x* curve2d-fast) +(define-extern *range-scale-wascity-palace-fire-beacon-flame-y* curve2d-fast) +(define-extern *r-curve-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *g-curve-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *b-curve-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *curve-alpha-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *curve-wascity-palace-fire-beacon-flame-x* curve2d-fast) +(define-extern *curve-wascity-palace-fire-beacon-flame-y* curve2d-fast) +(define-extern *part-wascity-palace-fire-beacon-flame-curve-settings* particle-curve-settings) +(define-extern *range-wrsplash-color* curve-color-fast) +(define-extern *range-wrsplash-alpha* curve2d-fast) +(define-extern *range-wrsplash-scale-x* curve2d-fast) +(define-extern *range-wrsplash-scale-y* curve2d-fast) +(define-extern *curve-wrsplash-alpha* curve2d-fast) +(define-extern *curve-wrsplash-scale-x* curve2d-fast) +(define-extern *curve-wrsplash-scale-y* curve2d-fast) +(define-extern *part-water-rocks-splash-curve-settings* particle-curve-settings) +(define-extern part-wascityb-bird1-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird2-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird3-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird4-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird5-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird6-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird7-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird8-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird9-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascityb-bird10-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascitya-fly1-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascitya-fly2-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern part-wascitya-fly3-path (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern *range-color-flame* curve-color-fast) +(define-extern *range-alpha-flame* curve2d-fast) +(define-extern *range-scale-flame-x* curve2d-fast) +(define-extern *range-scale-flame-y* curve2d-fast) +(define-extern *r-curve-flame* curve2d-fast) +(define-extern *g-curve-flame* curve2d-fast) +(define-extern *b-curve-flame* curve2d-fast) +(define-extern *curve-alpha-flame* curve2d-fast) +(define-extern *curve-flame-x* curve2d-fast) +(define-extern *curve-flame-y* curve2d-fast) +(define-extern *part-gas-lamp-flame-curve-settings* particle-curve-settings) +(define-extern *part-talltorch-flame-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; waswide-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wascity-windmill (process-drawable) ((quat quaternion :inline :offset-assert 208) ) @@ -66037,61 +66430,49 @@ idle ;; 20 ) ) -|# -#| (deftype wascity-flag-base (process-drawable) () :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 - (:methods - (wascity-flag-base-method-21 () none) ;; 21 - (wascity-flag-base-method-22 () none) ;; 22 - ) (:state-methods idle ;; 20 ) + (:methods + (wascity-flag-base-method-21 (_type_) none) ;; 21 + (wascity-flag-base-method-22 (_type_) none) ;; 22 + ) ) -|# -#| (deftype wascity-flag-a (wascity-flag-base) () :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 ) -|# -#| (deftype wascity-flag-b (wascity-flag-base) () :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 ) -|# -#| (deftype wascity-flag-c (wascity-flag-base) () :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 ) -|# -#| (deftype wascity-flag-d (wascity-flag-base) () :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 ) -|# -#| (deftype wascity-wind-fan (process-drawable) ((quat quaternion :inline :offset-assert 208) ) @@ -66102,86 +66483,70 @@ idle ;; 20 ) ) -|# ;; shaker is already defined! -#| (deftype wascity-cactus (process-focusable) - ((shakers UNKNOWN 6 :offset-assert 208) + ((shakers shaker 6 :inline :offset-assert 208) (incoming-attack-id uint32 :offset-assert 592) - (incoming-attack-time uint64 :offset-assert 600) + (incoming-attack-time time-frame :offset-assert 600) (hit-points float :offset-assert 608) ) :method-count-assert 32 :size-assert #x264 :flag-assert #x2001f00264 - (:methods - (wascity-cactus-method-30 () none) ;; 30 - (wascity-cactus-method-31 () none) ;; 31 - ) (:state-methods idle ;; 28 die ;; 29 ) + (:methods + (wascity-cactus-method-30 (_type_) none) ;; 30 + (wascity-cactus-method-31 (_type_) none) ;; 31 + ) ) -|# -#| (deftype wascity-market-crate (market-crate) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype wascity-market-basket-a (market-basket-a) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype wascity-market-basket-b (market-basket-b) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype wascity-market-sack-a (market-sack-a) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype wascity-market-sack-b (market-sack-b) () :method-count-assert 43 :size-assert #x170 :flag-assert #x2b00f00170 ) -|# -#| (deftype wascity-fruit-stand (fruit-stand) () :method-count-assert 31 :size-assert #x144 :flag-assert #x1f00d00144 ) -|# -#| (deftype wascity-water-pump (process-drawable) () :method-count-assert 21 @@ -66191,38 +66556,31 @@ idle ;; 20 ) ) -|# -#| (deftype wascity-awning-a (bouncer) () :method-count-assert 27 :size-assert #xd8 :flag-assert #x1b006000d8 ) -|# -#| (deftype wascity-awning-b (bouncer) () :method-count-assert 27 :size-assert #xd8 :flag-assert #x1b006000d8 ) -|# -#| (deftype monk-npc (process-taskable) () :method-count-assert 40 :size-assert #x118 :flag-assert #x2800a00118 ) -|# -;; (define-extern wascity-windmill-callback function) -;; (define-extern *wascity-cactus-exploder-params* joint-exploder-static-params) -;; (define-extern wascity-cactus-callback function) +(define-extern wascity-windmill-callback (function cspace transformq none)) +(define-extern *wascity-cactus-exploder-params* joint-exploder-static-params) +(define-extern wascity-cactus-callback (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wascity-ocean ;; @@ -66274,29 +66632,27 @@ ;; dogat ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype dogat (nav-enemy) ((rotation-matrix matrix :inline :offset-assert 624) - (scared-timer uint64 :offset-assert 688) + (scared-timer time-frame :offset-assert 688) ) :method-count-assert 192 :size-assert #x2b8 :flag-assert #xc0024002b8 - (:methods - (dogat-method-191 () none) ;; 191 - ) (:state-methods - flee ;; 36 - notice ;; 35 - active ;; 34 - sit-idle ;; 190 idle ;; 33 + active ;; 34 + notice ;; 35 + flee ;; 36 + sit-idle ;; 190 + ) + (:methods + (dogat-method-191 (_type_) none) ;; 191 ) ) -|# -;; (define-extern *dogat-nav-enemy-info* nav-enemy-info) -;; (define-extern dogat-travel-post function) +(define-extern *dogat-nav-enemy-info* nav-enemy-info) +(define-extern dogat-travel-post (function none :behavior dogat)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; blow-tower-shared ;; @@ -70214,7 +70570,6 @@ ;; trail ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype trail-vis-work (structure) ((best-count uint32 :offset-assert 0) (best-dist float :offset-assert 4) @@ -70227,9 +70582,8 @@ :size-assert #xb0 :flag-assert #x9000000b0 ) -|# -;; (define-extern *trail-graph* object) ;; trail-graph +(define-extern *trail-graph* trail-graph) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; minee-scenes ;; @@ -71354,95 +71708,84 @@ ;; wasall-init ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *wasall-reserve* object) -;; (define-extern wasall-login function) -;; (define-extern wasall-logout function) -;; (define-extern wasall-activate function) -;; (define-extern wasall-deactivate function) -;; (define-extern desert-game-activate function) -;; (define-extern desert-race-level-activate function) -;; (define-extern desert-race-level-deactivate function) +(define-extern *wasall-reserve* symbol) +(define-extern wasall-login (function level none)) +(define-extern wasall-logout (function level none)) +(define-extern wasall-activate (function level none)) +(define-extern wasall-deactivate (function level none)) +(define-extern desert-game-activate (function level none)) +(define-extern desert-race-level-activate (function level none)) +(define-extern desert-race-level-deactivate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wasall-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern spt-birth-func-brightness-buggy-dirt-bits function) -;; (define-extern spt-birth-func-part-buggy-dirt-bits function) -;; (define-extern spt-birth-func-part-buggy-skid-bits function) -;; (define-extern *wasdoors-range-color-flame* curve-color-fast) -;; (define-extern *wasdoors-range-alpha-flame* curve2d-fast) -;; (define-extern *wasdoors-range-scale-flame-x* curve2d-fast) -;; (define-extern *wasdoors-range-scale-flame-y* curve2d-fast) -;; (define-extern *r-wasdoors-curve-flame* curve2d-fast) -;; (define-extern *g-wasdoors-curve-flame* curve2d-fast) -;; (define-extern *b-wasdoors-curve-flame* curve2d-fast) -;; (define-extern *wasdoors-curve-alpha-flame* curve2d-fast) -;; (define-extern *wasdoors-curve-flame-x* curve2d-fast) -;; (define-extern *wasdoors-curve-flame-y* curve2d-fast) -;; (define-extern *part-wasdoors-gas-lamp-flame-curve-settings* object) -;; (define-extern spt-birth-func-brightness-part-desert-boss-slide-dust function) +(define-extern spt-birth-func-brightness-buggy-dirt-bits (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-part-buggy-dirt-bits (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-buggy-skid-bits (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *wasdoors-range-color-flame* curve-color-fast) +(define-extern *wasdoors-range-alpha-flame* curve2d-fast) +(define-extern *wasdoors-range-scale-flame-x* curve2d-fast) +(define-extern *wasdoors-range-scale-flame-y* curve2d-fast) +(define-extern *r-wasdoors-curve-flame* curve2d-fast) +(define-extern *g-wasdoors-curve-flame* curve2d-fast) +(define-extern *b-wasdoors-curve-flame* curve2d-fast) +(define-extern *wasdoors-curve-alpha-flame* curve2d-fast) +(define-extern *wasdoors-curve-flame-x* curve2d-fast) +(define-extern *wasdoors-curve-flame-y* curve2d-fast) +(define-extern *part-wasdoors-gas-lamp-flame-curve-settings* particle-curve-settings) +(define-extern spt-birth-func-brightness-part-desert-boss-slide-dust (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wasall-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype wascity-airlock (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 ) -|# -#| (deftype wascity-airlock-small (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 ) -|# -#| (deftype wascity-elevator-door (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 - (:state-methods - open ;; 20 - ) ) -|# -#| (deftype tentacle (process-drawable) ((init-pos vector :inline :offset-assert 208) (focus-pos vector :inline :offset-assert 224) - (nav-mesh basic :offset-assert 240) - (active-timer uint64 :offset-assert 248) + (nav-mesh nav-mesh :offset-assert 240) + (active-timer time-frame :offset-assert 248) (fade-level float :offset-assert 256) - (sound-id-loop uint32 :offset-assert 260) - (sound-id-attack uint32 :offset-assert 264) + (sound-id-loop sound-id :offset-assert 260) + (sound-id-attack sound-id :offset-assert 264) ) :method-count-assert 26 :size-assert #x10c :flag-assert #x1a0090010c (:state-methods - wait ;; 25 - kill-player ;; 24 - attacking-1 ;; 23 - attacking-0 ;; 22 - un-dive-player ;; 21 dormant ;; 20 + un-dive-player ;; 21 + attacking-0 ;; 22 + attacking-1 ;; 23 + kill-player ;; 24 + wait ;; 25 ) ) -|# -;; (define-extern tentacle-follow-post function) -;; (define-extern tentacle-attack-handler function) +(define-extern tentacle-follow-post (function none :behavior tentacle)) +(define-extern tentacle-attack-handler (function process int symbol event-message-block object :behavior tentacle)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wasall-tasks ;; @@ -72583,81 +72926,78 @@ ;; mined-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mined-states (structure) - ((filter UNKNOWN 2 :offset-assert 0) - (light UNKNOWN 2 :offset-assert 32) + ((filter vector 2 :inline :offset-assert 0) + (light light-sphere 2 :offset-assert 32) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -;; (define-extern set-mined-filter-light! function) -;; (define-extern init-mood-mined function) -;; (define-extern update-mood-mined function) -;; (define-extern set-mined-filter! function) +(define-extern set-mined-filter-light! (function string light-hash vector light-sphere light-sphere)) +(define-extern init-mood-mined (function mood-context float)) +(define-extern update-mood-mined (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-mined-filter! (function vector int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mined-texture ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *mined-tfrag-texture-anim-array* texture-anim-array) -;; (define-extern set-mined-pillar-texture! function) +(define-extern *mined-tfrag-texture-anim-array* texture-anim-array) +(define-extern set-mined-pillar-texture! (function float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; prebot-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern birth-func-pillar-rocks-bounce function) -;; (define-extern spt-func-pillar-rocks-bounce1 function) -;; (define-extern spt-func-pillar-rocks-bounce2 function) -;; (define-extern spt-func-pillar-rocks-bounce3 function) -;; (define-extern spt-birth-func-brightness-prebot-eco-pillar-rocks function) -;; (define-extern spt-birth-func-brightness-prebot-eco-pillar-rocks2 function) -;; (define-extern spt-birth-func-brightness-prebot-eco-pillar-rocks3 function) -;; (define-extern spt-birth-func-part-prebot-eco-pillar-rocks function) -;; (define-extern spt-func-part-prebot-eco-pillar-rocks function) -;; (define-extern spt-birth-func-part-prebot-eco-pillar-rocks-bounce1 function) -;; (define-extern spt-func-part-prebot-eco-pillar-rocks-bounce1 function) -;; (define-extern spt-birth-func-part-prebot-eco-pillar-rocks-bounce2 function) -;; (define-extern *range-mine-boss-stuck-flame-color* curve-color-fast) -;; (define-extern *range-mine-boss-stuck-flame-alpha* curve2d-fast) -;; (define-extern *range-mine-boss-stuck-flame-scale-x* curve2d-fast) -;; (define-extern *range-mine-boss-stuck-flame-scale-y* curve2d-fast) -;; (define-extern *r-curve-mine-boss-stuck-flame* curve2d-fast) -;; (define-extern *g-curve-mine-boss-stuck-flame* curve2d-fast) -;; (define-extern *b-curve-mine-boss-stuck-flame* curve2d-fast) -;; (define-extern *curve-mine-boss-stuck-flame-alpha* curve2d-fast) -;; (define-extern *curve-mine-boss-stuck-flame-scale-x* curve2d-fast) -;; (define-extern *curve-mine-boss-stuck-flame-scale-y* curve2d-fast) -;; (define-extern *part-prebot-stuck-flame-curve-settings* object) -;; (define-extern *range-mine-boss-explo-color* curve-color-fast) -;; (define-extern *range-mine-boss-explo-alpha* curve2d-fast) -;; (define-extern *range-mine-boss-explo-scale-x* curve2d-fast) -;; (define-extern *range-mine-boss-explo-scale-y* curve2d-fast) -;; (define-extern *curve-mine-boss-explo-alpha* curve2d-fast) -;; (define-extern *curve-mine-boss-explo-scale-x* curve2d-fast) -;; (define-extern *curve-mine-boss-explo-scale-y* curve2d-fast) -;; (define-extern *part-prebot-chasm-explosion-texture-curve-settings* object) -;; (define-extern *range-final-mine-boss-explo-color* curve-color-fast) -;; (define-extern *range-final-mine-boss-explo-alpha* curve2d-fast) -;; (define-extern *range-final-mine-boss-explo-scale-x* curve2d-fast) -;; (define-extern *range-final-mine-boss-explo-scale-y* curve2d-fast) -;; (define-extern *curve-final-mine-boss-explo-alpha* curve2d-fast) -;; (define-extern *curve-final-mine-boss-explo-scale-x* curve2d-fast) -;; (define-extern *curve-final-mine-boss-explo-scale-y* curve2d-fast) -;; (define-extern *part-final-prebot-chasm-explosion-texture-curve-settings* object) -;; (define-extern spt-birth-func-brightness-prebot-pillar-shatter-rocks function) -;; (define-extern spt-birth-func-part-prebot-eco-pillar-shatter function) -;; (define-extern spt-func-part-prebot-eco-pillar-shatter function) +(define-extern birth-func-pillar-rocks-bounce (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-func-pillar-rocks-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-func-pillar-rocks-bounce2 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-func-pillar-rocks-bounce3 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-brightness-prebot-eco-pillar-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-brightness-prebot-eco-pillar-rocks2 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-brightness-prebot-eco-pillar-rocks3 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-part-prebot-eco-pillar-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-prebot-eco-pillar-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-prebot-eco-pillar-rocks-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-prebot-eco-pillar-rocks-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-prebot-eco-pillar-rocks-bounce2 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *range-mine-boss-stuck-flame-color* curve-color-fast) +(define-extern *range-mine-boss-stuck-flame-alpha* curve2d-fast) +(define-extern *range-mine-boss-stuck-flame-scale-x* curve2d-fast) +(define-extern *range-mine-boss-stuck-flame-scale-y* curve2d-fast) +(define-extern *r-curve-mine-boss-stuck-flame* curve2d-fast) +(define-extern *g-curve-mine-boss-stuck-flame* curve2d-fast) +(define-extern *b-curve-mine-boss-stuck-flame* curve2d-fast) +(define-extern *curve-mine-boss-stuck-flame-alpha* curve2d-fast) +(define-extern *curve-mine-boss-stuck-flame-scale-x* curve2d-fast) +(define-extern *curve-mine-boss-stuck-flame-scale-y* curve2d-fast) +(define-extern *part-prebot-stuck-flame-curve-settings* particle-curve-settings) +(define-extern *range-mine-boss-explo-color* curve-color-fast) +(define-extern *range-mine-boss-explo-alpha* curve2d-fast) +(define-extern *range-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *range-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *curve-mine-boss-explo-alpha* curve2d-fast) +(define-extern *curve-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *curve-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *part-prebot-chasm-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *range-final-mine-boss-explo-color* curve-color-fast) +(define-extern *range-final-mine-boss-explo-alpha* curve2d-fast) +(define-extern *range-final-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *range-final-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *curve-final-mine-boss-explo-alpha* curve2d-fast) +(define-extern *curve-final-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *curve-final-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *part-final-prebot-chasm-explosion-texture-curve-settings* particle-curve-settings) +(define-extern spt-birth-func-brightness-prebot-pillar-shatter-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-prebot-eco-pillar-shatter (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-prebot-eco-pillar-shatter (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; prebot-setup ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype prebot-eco-pillar-launch-spec (structure) ((offset vector :offset-assert 0) (height float :offset-assert 4) @@ -72667,223 +73007,232 @@ :size-assert #x9 :flag-assert #x900000009 ) -|# -#| (deftype prebot-eco-pillar (process-drawable) - ((vulnerable basic :offset-assert 200) - (hot basic :offset-assert 204) + ((root collide-shape-moving :override) + (vulnerable symbol :offset-assert 200) + (hot symbol :offset-assert 204) (start-y float :offset-assert 208) (end-y float :offset-assert 212) - (heat-part basic :offset-assert 216) - (cool-part basic :offset-assert 220) + (heat-part sparticle-launch-control :offset-assert 216) + (cool-part sparticle-launch-control :offset-assert 220) ) :method-count-assert 26 :size-assert #xe0 :flag-assert #x1a006000e0 - (:methods - (prebot-eco-pillar-method-20 () none) ;; 20 - (prebot-eco-pillar-method-21 () none) ;; 21 - (prebot-eco-pillar-method-22 () none) ;; 22 - (prebot-eco-pillar-method-23 () none) ;; 23 - (prebot-eco-pillar-method-24 () none) ;; 24 - (prebot-eco-pillar-method-25 () none) ;; 25 + (:state-methods + wait-to-die ;; 20 + heat-up ;; 21 + grow ;; 22 + cool-down ;; 23 + wait-to-cool ;; 24 + idle ;; 25 ) ) -|# -#| (deftype cav-railblocker (process-focusable) ((incoming-attack-id uint32 :offset-assert 208) (hit-points float :offset-assert 212) - (notify-on-die basic :offset-assert 216) - (notify-on-die-2 basic :offset-assert 220) - (trackable basic :offset-assert 224) - (red-tip-change-time uint64 :offset-assert 232) - (alt-red-tip-on basic :offset-assert 240) + (notify-on-die entity :offset-assert 216) + (notify-on-die-2 entity :offset-assert 220) + (trackable symbol :offset-assert 224) + (red-tip-change-time time-frame :offset-assert 232) + (alt-red-tip-on symbol :offset-assert 240) ) :method-count-assert 31 :size-assert #xf4 :flag-assert #x1f008000f4 + (:state-methods + idle ;; 28 + fall ;; 29 + ) (:methods - (cav-railblocker-method-28 () none) ;; 28 - (cav-railblocker-method-29 () none) ;; 29 - (cav-railblocker-method-30 () none) ;; 30 + (cav-railblocker-method-30 (_type_ symbol) none) ;; 30 ) ) -|# -#| (deftype cav-minecar (process-drawable) () :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (cav-minecar-method-20 () none) ;; 20 + (:state-methods + idle ;; 20 ) ) -|# -#| +(declare-type prebot process-focusable) + (deftype prebot-sword (process-drawable) - ((prefix basic :offset-assert 200) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string :offset-assert 200) (blade-scale cam-float-seeker :inline :offset-assert 204) - (blade-jm basic :offset-assert 228) - (sword-sound uint32 :offset-assert 232) - (sword-sound-playing basic :offset-assert 236) + (blade-jm joint-mod :offset-assert 228) + (sword-sound sound-id :offset-assert 232) + (sword-sound-playing symbol :offset-assert 236) (prev-position vector :inline :offset-assert 240) - (use-pos-pitch basic :offset-assert 256) + (use-pos-pitch symbol :offset-assert 256) (old-target-dist float :offset-assert 260) - (alternate-sound basic :offset-assert 264) + (alternate-sound sound-spec :offset-assert 264) (whoosh-lead float :offset-assert 268) - (allow-whoosh basic :offset-assert 272) + (allow-whoosh symbol :offset-assert 272) (current-volume float :offset-assert 276) ) :method-count-assert 21 :size-assert #x118 :flag-assert #x1500a00118 - (:methods - (prebot-sword-method-20 () none) ;; 20 + (:state-methods + idle ;; 20 ) ) -|# -#| (deftype prebot-shockwave (process-drawable) () :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (prebot-shockwave-method-20 () none) ;; 20 + (:state-methods + idle ;; 20 ) ) -|# -#| (deftype prebot-gun (process-drawable) - ((prefix basic :offset-assert 200) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string :offset-assert 200) ) :method-count-assert 21 :size-assert #xcc :flag-assert #x15005000cc - (:methods - (prebot-gun-method-20 () none) ;; 20 + (:state-methods + idle ;; 20 ) ) -|# -#| (deftype prebot-tentacle (process-drawable) - ((prefix basic :offset-assert 200) - (aim-jm basic :offset-assert 204) - (half-aim-jm basic :offset-assert 208) - (laser-sound uint32 :offset-assert 212) - (laser-sound-playing basic :offset-assert 216) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string :offset-assert 200) + (aim-jm joint-mod-polar-look-at :offset-assert 204) + (half-aim-jm joint-mod-polar-look-at :offset-assert 208) + (laser-sound sound-id :offset-assert 212) + (laser-sound-playing symbol :offset-assert 216) ) :method-count-assert 21 :size-assert #xdc :flag-assert #x15006000dc - (:methods - (prebot-tentacle-method-20 () none) ;; 20 + (:state-methods + idle ;; 20 ) ) -|# -#| (deftype prebot-ammo-tracker (structure) - ((handle uint64 :offset-assert 0) + ((handle handle :offset-assert 0) (where vector :inline :offset-assert 16) - (birth-next-time basic :offset-assert 32) - (timer uint64 :offset-assert 40) + (birth-next-time symbol :offset-assert 32) + (timer time-frame :offset-assert 40) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| +;; +++prebot-setup:prebot-flag +(defenum prebot-flag + :type uint32 + :bitfield #t + (pf0 0) + (pf1 1) + (pf2 2) + (pf3 3) + (pf4 4) + (pf5 5) + (pf6 6) + (pf7 7) + (pf8 8) + ) +;; ---prebot-setup:prebot-flag + (deftype prebot (process-focusable) - ((critters UNKNOWN 28 :offset-assert 208) + ((critters handle 28 :offset-assert 208) (critters-to-launch int8 :offset-assert 432) - (gun uint64 :offset-assert 440) - (swords UNKNOWN 2 :offset-assert 448) - (tentacles UNKNOWN 5 :offset-assert 464) - (beam-projectile uint64 :offset-assert 504) - (pillars UNKNOWN 5 :offset-assert 512) + (gun handle :offset-assert 440) + (swords handle 2 :offset-assert 448) + (tentacles handle 5 :offset-assert 464) + (beam-projectile handle :offset-assert 504) + (pillars handle 5 :offset-assert 512) (original-position vector :inline :offset-assert 560) (position cam-vector-seeker :inline :offset-assert 576) (stage int8 :offset-assert 636) (stage-hit-points float :offset-assert 640) (last-attack-id uint32 :offset-assert 644) (neck-angle cam-float-seeker :inline :offset-assert 648) - (no-collision-timer uint64 :offset-assert 672) + (no-collision-timer time-frame :offset-assert 672) (num-attacks uint8 :offset-assert 680) - (shoulder-aim-jm basic :offset-assert 684) + (shoulder-aim-jm joint-mod-polar-look-at :offset-assert 684) (shot-extra-y float :offset-assert 688) (shot-extra-xz float :offset-assert 692) (which-movie int8 :offset-assert 696) (light-flash cam-vector-seeker :inline :offset-assert 704) (light-pulse oscillating-vector :inline :offset-assert 768) (light-pulse-flicker delayed-rand-vector :inline :offset-assert 832) - (laugh-played basic :offset-assert 880) - (grunt-played basic :offset-assert 884) - (trythis-played basic :offset-assert 888) - (laugh-timer uint64 :offset-assert 896) - (blocker uint64 :offset-assert 904) - (flags uint32 :offset-assert 912) - (pillar-hint-timer uint64 :offset-assert 920) - (minecar-hint-timer uint64 :offset-assert 928) - (ammo UNKNOWN 20 :offset-assert 944) + (laugh-played symbol :offset-assert 880) + (grunt-played symbol :offset-assert 884) + (trythis-played symbol :offset-assert 888) + (laugh-timer time-frame :offset-assert 896) + (blocker handle :offset-assert 904) + (flags prebot-flag :offset-assert 912) + (pillar-hint-timer time-frame :offset-assert 920) + (minecar-hint-timer time-frame :offset-assert 928) + (ammo prebot-ammo-tracker 20 :inline :offset-assert 944) ) :method-count-assert 47 :size-assert #x770 :flag-assert #x2f06f00770 + (:state-methods + beaten ;; 28 + play-fma ;; 29 + play-hit-movie ;; 30 + destroy-pillars ;; 31 + watch-pillars ;; 32 + create-pillars ;; 33 + activate-tentacles ;; 34 + watch-critters ;; 35 + launch-critters ;; 36 + sweep-done + sweep + slam-done + slam + pre-slam + jump-to-hover + hidden + test + ) (:methods - (prebot-method-28 () none) ;; 28 - (prebot-method-29 () none) ;; 29 - (prebot-method-30 () none) ;; 30 - (prebot-method-31 () none) ;; 31 - (prebot-method-32 () none) ;; 32 - (prebot-method-33 () none) ;; 33 - (prebot-method-34 () none) ;; 34 - (prebot-method-35 () none) ;; 35 - (prebot-method-36 () none) ;; 36 - (prebot-method-37 () none) ;; 37 - (prebot-method-38 () none) ;; 38 - (prebot-method-39 () none) ;; 39 - (prebot-method-40 () none) ;; 40 - (prebot-method-41 () none) ;; 41 - (prebot-method-42 () none) ;; 42 - (prebot-method-43 () none) ;; 43 - (prebot-method-44 () none) ;; 44 - (prebot-method-45 () none) ;; 45 - (prebot-method-46 () none) ;; 46 + (prebot-method-45 (_type_) none) ;; 45 + (prebot-method-46 (_type_) none) ;; 46 ) ) -|# -;; (define-extern *cav-railblocker-exploder-params* joint-exploder-static-params) -;; (define-extern prebot-eco-pillar-init-by-other function) -;; (define-extern *prebot-sword-color-curve* object) -;; (define-extern *prebot-sword-white-red-curve* object) -;; (define-extern *prebot-sword-width-curve* curve2d-fast) -;; (define-extern *prebot-sword-color-array* object) -;; (define-extern prebot-sword-init-by-other function) -;; (define-extern prebot-shockwave-init-by-other function) -;; (define-extern prebot-gun-init-by-other function) -;; (define-extern prebot-tentacle-init-by-other function) +(define-extern *cav-railblocker-exploder-params* joint-exploder-static-params) +(define-extern prebot-eco-pillar-init-by-other (function vector prebot-eco-pillar-launch-spec object :behavior prebot-eco-pillar)) +(define-extern *prebot-sword-color-curve* curve-color-piecewise) +(define-extern *prebot-sword-white-red-curve* curve-color-piecewise) +(define-extern *prebot-sword-width-curve* curve2d-fast) +(define-extern *prebot-sword-color-array* light-trail-composition) +(define-extern prebot-sword-init-by-other (function string vector basic sound-spec object :behavior prebot-sword)) +(define-extern prebot-shockwave-init-by-other (function vector quaternion object :behavior prebot-shockwave)) +(define-extern prebot-gun-init-by-other (function string vector object :behavior prebot-gun)) +(define-extern prebot-tentacle-init-by-other (function string vector int object :behavior prebot-tentacle)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; prebot-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-prebot (task-manager) - ((manager-entity basic :offset-assert 240) - (check-timer uint64 :offset-assert 248) + ((manager-entity entity :offset-assert 240) + (check-timer time-frame :offset-assert 248) ) :method-count-assert 32 :size-assert #x100 @@ -72892,27 +73241,25 @@ active ;; 15 ) ) -|# -;; (define-extern prebot-neck-callback function) -;; (define-extern prebot-light-pulse-off function) -;; (define-extern prebot-light-pulse-on function) -;; (define-extern prebot-light-flash function) -;; (define-extern prebot-prespool function) -;; (define-extern prebot-common function) -;; (define-extern prebot-go-next-stage function) -;; (define-extern prebot-handler function) -;; (define-extern prebot-set-cam-slave-fov function) -;; (define-extern prebot-setup-shot-offsets function) -;; (define-extern prebot-fire-tentacle function) -;; (define-extern prebot-launch-critter function) -;; (define-extern prebot-spawn-shockwave function) +(define-extern prebot-neck-callback (function cspace transformq none :behavior prebot)) +(define-extern prebot-light-pulse-off (function none :behavior prebot)) +(define-extern prebot-light-pulse-on (function float float float vector :behavior prebot)) +(define-extern prebot-light-flash (function float float float vector :behavior prebot)) +(define-extern prebot-prespool (function object :behavior prebot)) +(define-extern prebot-common (function object :behavior prebot)) +(define-extern prebot-go-next-stage (function object :behavior prebot)) +(define-extern prebot-handler (function process int symbol event-message-block object :behavior prebot)) +(define-extern prebot-set-cam-slave-fov (function float float :behavior prebot)) +(define-extern prebot-setup-shot-offsets (function object :behavior prebot)) +(define-extern prebot-fire-tentacle (function handle vector object :behavior prebot)) +(define-extern prebot-launch-critter (function object :behavior prebot)) +(define-extern prebot-spawn-shockwave (function object :behavior prebot)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; prebot-extras ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cav-break-bridge (process-drawable) () :method-count-assert 21 @@ -72922,9 +73269,7 @@ idle ;; 20 ) ) -|# -#| (deftype prebot-shockwave-joint-position (structure) ((joint-index int8 :offset-assert 0) (position vector :inline :offset-assert 16) @@ -72933,9 +73278,7 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype prebot-gun-shot (projectile) ((whoosh-sound uint32 :offset-assert 512) ) @@ -72947,9 +73290,7 @@ moving ;; 23 ) ) -|# -#| (deftype cav-exit-door (process-drawable) ((initial-y float :offset-assert 200) ) @@ -72961,32 +73302,29 @@ rise ;; 21 ) ) -|# -;; (define-extern *prebot-eco-pillar-debris-params* debris-static-params) -;; (define-extern prebot-eco-pillar-handler function) +(define-extern *prebot-eco-pillar-debris-params* debris-static-params) +(define-extern prebot-eco-pillar-handler (function process int symbol event-message-block object :behavior prebot-eco-pillar)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mined-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cav-airlock-door (com-airlock) () :method-count-assert 30 :size-assert #x1b0 :flag-assert #x1e013001b0 ) -|# -;; (define-extern prebot-darken function) -;; (define-extern scene-prebot-gun-spawn function) -;; (define-extern spt-birth-func-brightness-mine-boss-fma-dust-trailer function) -;; (define-extern spt-birth-func-brightness-mine-boss-fma-dust function) -;; (define-extern spt-birth-func-part-mine-boss-fma-dust function) -;; (define-extern spt-birth-func-part-mine-boss-fma-rocks function) -;; (define-extern spt-birth-func-part-mine-boss-fma-dust2 function) -;; (define-extern spt-birth-func-part-mine-boss-fma-rocks2 function) +(define-extern prebot-darken function) +(define-extern scene-prebot-gun-spawn function) +(define-extern spt-birth-func-brightness-mine-boss-fma-dust-trailer function) +(define-extern spt-birth-func-brightness-mine-boss-fma-dust function) +(define-extern spt-birth-func-part-mine-boss-fma-dust function) +(define-extern spt-birth-func-part-mine-boss-fma-rocks function) +(define-extern spt-birth-func-part-mine-boss-fma-dust2 function) +(define-extern spt-birth-func-part-mine-boss-fma-rocks2 function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; volcanox-texture ;; diff --git a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc index 4b17f641ea..47448a6b9a 100644 --- a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc @@ -562,5 +562,58 @@ [72, "(function object)"], [73, "(function object :behavior target)"], [74, "(function object :behavior target)"] + ], + "nav-control": [ + [0, "(function object nav-control none)"], + [1, "(function object nav-control none)"], + [2, "(function object nav-control none)"], + [3, "(function object nav-control none)"], + [4, "(function object nav-control none)"], + [5, "(function object nav-control none)"], + [6, "(function object nav-control none)"], + [7, "(function object nav-control none)"], + [8, "(function object nav-control none)"], + [9, "(function object nav-control none)"] + ], + "nav-enemy": [[7, "(function enemy-jump-info none :behavior nav-enemy)"]], + "task-control": [ + [53, "(function game-task-node-info symbol object)"], + [54, "(function game-task-node-info object)"], + [67, "(function pair symbol)"] + ], + "merc-death": [[3, "(function time-frame :behavior process-drawable)"]], + "vehicle-states": [ + [10, "(function collide-shape-prim none)"], + [12, "(function collide-shape-prim none)"] + ], + "prebot-states": [[21, "(function vector :behavior prebot)"]], + "wasall-obs": [ + [0, "(function object)"], + [1, "(function object)"], + [2, "(function object)"], + [3, "(function object)"] + ], + "roboguard": [ + [1, "(function cspace transformq none)"], + [2, "(function cspace transformq none)"], + [25, "(function int int float object :behavior roboguard)"], + [45, "(function roboguard symbol object)"] + ], + "vehicle": [ + [6, "(function collide-shape-prim none)"], + [7, "(function collide-shape-prim none)"] + ], + "wvehicle-wheel": [ + [7, "(function collide-shape-prim none)"], + [11, "(function collide-shape-prim none)"], + [17, "(function collide-shape-prim none)"] + ], + "wvehicle-states": [ + [20, "(function collide-shape-prim none)"], + [22, "(function collide-shape-prim none)"] + ], + "wvehicle": [[6, "(function collide-shape-prim none)"]], + "pilot-states": [ + [15, "(function surface surface surface int object :behavior target)"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/hacks.jsonc b/decompiler/config/jak3/ntsc_v1/hacks.jsonc index 34928d3456..25223ccee9 100644 --- a/decompiler/config/jak3/ntsc_v1/hacks.jsonc +++ b/decompiler/config/jak3/ntsc_v1/hacks.jsonc @@ -386,7 +386,35 @@ "(anon-function 17 target-ladder)": [0, 1], "command-get-process": [46], "foreground-draw-hud": [0, 7, 8, 9, 16, 22], - "target-flut-falling-anim-trans": [8, 9] + "target-flut-falling-anim-trans": [8, 9], + "(method 12 nav-mesh)": [0, 1, 2, 9], + "(method 20 nav-mesh)": [9], + "(method 21 nav-mesh)": [7], + "(method 29 nav-mesh)": [0, 1, 2, 4], + "(method 33 nav-mesh)": [10, 11, 12, 13], + "(method 34 nav-mesh)": [0, 1, 2, 4], + "(method 35 nav-mesh)": [0, 1, 2, 4], + "(method 36 nav-mesh)": [1, 2], + "(method 37 nav-mesh)": [4], + "(method 45 nav-mesh)": [1, 2], + "(method 46 nav-mesh)": [1, 2, 19, 20], + "(method 48 nav-mesh)": [4, 5, 6, 8], + "(method 49 nav-mesh)": [0, 1, 2, 3, 5], + "(method 18 nav-control)": [11, 12, 19, 20, 31, 34], + "(method 19 nav-control)": [9, 10], + "(method 40 nav-state)": [1, 2], + "point-poly-distance-min": [0, 1, 2, 3, 4, 5, 6, 7, 10], + "find-closest-circle-ray-intersection": [0, 4, 15, 16, 17, 18], + "(method 39 vehicle)": [0, 10, 12, 15], + "(anon-function 7 vehicle-states)": [0, 2], + "(method 11 vehicle-hud-requests)": [0, 6, 7, 10], + "(anon-function 12 neo-juicer)": [29, 30], + "(method 160 neo-grenadier)": [1, 2, 3], + "(method 82 spydroid-orig)": [13], + "(method 118 vehicle)": [3, 4, 7, 8, 9, 10, 17, 26, 30, 31, 33], + "(method 25 squad-control)": [0, 4, 5, 7], + "target-pilot-post": [0, 29], + "(method 36 was-squad-control)": [0, 8, 11, 12, 14, 16] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -415,7 +443,12 @@ "(method 10 menu-loading-option)": [[113, 1]], "(method 10 menu-icon-info-option)": [[150, 1]], "(method 17 hud-goal)": [[71, 0]], - "(method 17 hud-miss)": [[71, 0]] + "(method 17 hud-miss)": [[71, 0]], + "(method 16 resetter)": [ + [68, 1], + [101, 1], + [130, 1] + ] }, "mips2c_functions_by_name": [ @@ -546,7 +579,8 @@ "(method 9 font-work)", "(method 9 prim-strip)", "live-func-curve", - "birth-func-curve" + "birth-func-curve", + "sparticle-motion-blur-dirt" ], "mips2c_jump_table_functions": {}, @@ -562,8 +596,10 @@ ["lfacctyb", 0, 0], ["intpfall", 0, 0], ["lfaccity", 0, 0], + ["lfacctyb-vis", 0, 0], ["ltowcity", 0, 0], - ["powergd", 0, 0] + ["powergd", 0, 0], + ["lcitysml", 0, 0] ], // some object files have garbage pad data at the end which makes the decompiler diff --git a/decompiler/config/jak3/ntsc_v1/inputs.jsonc b/decompiler/config/jak3/ntsc_v1/inputs.jsonc index cf55ccbbb8..10fa70a385 100644 --- a/decompiler/config/jak3/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak3/ntsc_v1/inputs.jsonc @@ -8,292 +8,314 @@ // the DGOs will be processed in this order. Usually it's best to have KERNEL, ENGINE, then the levels when // you want to run on the entire game. "dgo_names": [ - //"CGO/ART.CGO", - "CGO/KERNEL.CGO", - // "CGO/ENGINE.CGO", - "CGO/GAME.CGO", + // engine files + // "CGO/ART.CGO", // "CGO/COMMON.CGO", - // "DGO/LJKDMPK.DGO", - // "DGO/LBBSDRP1.DGO", - // "DGO/LTNJXHIP.DGO", - // "DGO/MIC.DGO", + // "CGO/ENGINE.CGO", + "CGO/KERNEL.CGO", + "CGO/GAME.CGO", + // wascity + "DGO/WASALL.DGO", + "DGO/WWD.DGO", // waswide + "DGO/WSD.DGO", // wasdoors (garage) + "DGO/WASCHASE.DGO", + "DGO/WASDEFEN.DGO", + "DGO/WASLEAPR.DGO", + "DGO/WASPALA.DGO", + "DGO/WASSEEM.DGO", + "DGO/WASPGAME.DGO", + "DGO/WCA.DGO", + "DGO/WCB.DGO", + "DGO/WCASEEM.DGO", + "DGO/WASCAST.DGO", + // // arena + // "DGO/WASSTADA.DGO", + // "DGO/WASSTADB.DGO", + // "DGO/WASSTADC.DGO", + // "DGO/ARENACST.DGO", + // // desert + // "DGO/DESA.DGO", + // "DGO/DESB.DGO", + // "DGO/DESBATTL.DGO", + // "DGO/DESBCST.DGO", + // "DGO/DESBOSS1.DGO", + // "DGO/DESBOSS2.DGO", + // "DGO/DESC.DGO", + // "DGO/DESCHASE.DGO", + // "DGO/DESD.DGO", + // "DGO/DESE.DGO", + // "DGO/DESERROL.DGO", + // "DGO/DESF.DGO", + // "DGO/DESG.DGO", + // "DGO/DESH.DGO", + // "DGO/DESHOVER.DGO", + // "DGO/DESHUNT.DGO", + // "DGO/DESINTER.DGO", + // "DGO/DESJUMP.DGO", + // "DGO/DESLIZ.DGO", + // "DGO/DESOASIS.DGO", + // "DGO/DESRACE1.DGO", + // "DGO/DESRACE2.DGO", + // "DGO/DESRALLY.DGO", + // "DGO/DESRESC.DGO", + // "DGO/DESRESCC.DGO", + // "DGO/DESRESCG.DGO", + // "DGO/DESTRACK.DGO", + // "DGO/DESW.DGO", + "DGO/DST.DGO", // "DGO/OASISCST.DGO", - // "DGO/CTYPEPA.DGO", - // "DGO/LPRENME.DGO", + // "DGO/WARPCAST.DGO", // air train + // // nest + // "DGO/NSA.DGO", + // "DGO/NSB.DGO", + // // temple + // "DGO/TEMA.DGO", + // "DGO/TEMB.DGO", + // "DGO/TEMC.DGO", + // "DGO/TEMD.DGO", + // "DGO/TEMP.DGO", + // "DGO/TEMPLEE.DGO", + // "DGO/TEMX.DGO", + // // hang + // "DGO/HGA.DGO", + // "DGO/HGB.DGO", + // // volcano + // "DGO/VOCA.DGO", + // "DGO/VOCX.DGO", + // mine + "DGO/MIA.DGO", + "DGO/MIB.DGO", + "DGO/MIC.DGO", + "DGO/MINED.DGO", + "DGO/MINEE.DGO", + // // city + // "DGO/CWI.DGO", // ctywide + // "DGO/CFA.DGO", // ctyfarm + // "DGO/CFB.DGO", + // "DGO/CGB.DGO", // ctygen + // "DGO/CIA.DGO", // ctyind + // "DGO/CIB.DGO", + // "DGO/CPO.DGO", // ctyport + // "DGO/CTA.DGO", // ctyslum + // "DGO/CTB.DGO", + // "DGO/CTC.DGO", + // "DGO/CTYPEPA.DGO", // citizens + // "DGO/CTYPEPB.DGO", // predator + // "DGO/CTYPEPC.DGO", // empty + // "DGO/CTYPESA.DGO", // guards + // "DGO/CTYPESB.DGO", // metal heads + // "DGO/CTYPESC.DGO", // kg + // "DGO/CTYCARA.DGO", // cars + // "DGO/CTYCARB.DGO", // bikes + // "DGO/CTYCARC.DGO", // hellcat + // "DGO/CTYCARKG.DGO", // empty + // "DGO/ONINTENT.DGO", + // "DGO/VIN.DGO", + // "DGO/HHG.DGO", // hiphog + // "DGO/GGA.DGO", // gungame + // "DGO/GUNGAME1.DGO", + // "DGO/GUNGAME2.DGO", + // "DGO/POWERGD.DGO", + // "DGO/FREEHQ.DGO", + // "DGO/FREECAST.DGO", + // "DGO/CITYCAST.DGO", + // "DGO/GRIDCST.DGO", // city-destroy-grid-res + // "DGO/SLUMBSET.DGO", // sewer-met-hum-intro + // sewer + "DGO/SEA.DGO", + // "DGO/SEB.DGO", + // "DGO/SEC.DGO", + // "DGO/SED.DGO", + // "DGO/SEE.DGO", + // "DGO/SEF.DGO", + // "DGO/SEG.DGO", + // "DGO/SEH.DGO", + // "DGO/SEI.DGO", + // "DGO/SEJ.DGO", + // "DGO/SEK.DGO", + // "DGO/SEL.DGO", + // "DGO/SEM.DGO", + // "DGO/SEN.DGO", + // "DGO/SEO.DGO", + // // mhcity + // "DGO/MHCA.DGO", + // "DGO/MHCB.DGO", + // "DGO/MHCTYCST.DGO", + // // forest + "DGO/FRSTA.DGO", + "DGO/FRSTB.DGO", + "DGO/FRSTX.DGO", + // // factory + // "DGO/FACTORYA.DGO", + // "DGO/FACB.DGO", + // "DGO/FACC.DGO", + // "DGO/FACD.DGO", + // // tower + // "DGO/TOWB.DGO", + // "DGO/TOWERA.DGO", + // "DGO/TOWERC.DGO", + // "DGO/TOWERCST.DGO", + // // stadium + // "DGO/STA.DGO", + // "DGO/STAA.DGO", + // "DGO/STB.DGO", + // // rubble + // "DGO/RUBA.DGO", + // "DGO/RUBA2.DGO", + // "DGO/RUBB.DGO", + // "DGO/RUBC.DGO", + // "DGO/RBCT.DGO", + // // comb + // "DGO/COMBA.DGO", + // "DGO/COMBB.DGO", + // "DGO/COMBC.DGO", + // "DGO/COMBD.DGO", + // "DGO/COMBE.DGO", + // "DGO/COMBN.DGO", + // "DGO/COMBX.DGO", + // "DGO/RAILA.DGO", + // "DGO/RAILB.DGO", + // "DGO/RAILB2.DGO", + // "DGO/RAILC.DGO", + // "DGO/RAILCST.DGO", + // "DGO/RAILD.DGO", + // "DGO/RAILE.DGO", + // "DGO/RAILF.DGO", + // "DGO/RAILX.DGO", + // // precursor + // "DGO/PRECA.DGO", + // "DGO/PRECB.DGO", + // "DGO/PRECC.DGO", + // "DGO/PRECD.DGO", + // // title/intro + // "DGO/WIN.DGO", // wasintro + // "DGO/TITLE.DGO", + // "DGO/INTTITLE.DGO", + // "DGO/INTPALRF.DGO", // intro-palace-roof + // "DGO/IPF.DGO", // intro-palace-fall + // "DGO/INTROCST.DGO", + // // outro + // "DGO/OUTCAST3.DGO", + // "DGO/OUTROCST.DGO", + // // museum + // "DGO/MUSEUM.DGO", + // "DGO/MUSEUM2.DGO", + // "DGO/MUSEUM3.DGO", + // "DGO/MUSEUM3B.DGO", + // "DGO/MUSEUM4.DGO", + // "DGO/MUSEUM4B.DGO", + // test + "DGO/HALFPIPE.DGO", + // // borrow + // "DGO/LASHELIN.DGO", + // "DGO/LBBRING1.DGO", + // "DGO/LBBRING2.DGO", + // "DGO/LBBRING3.DGO", + // "DGO/LBBRING4.DGO", + // "DGO/LBBRING5.DGO", + // "DGO/LBBRING6.DGO", + // "DGO/LBBSDRP1.DGO", + // "DGO/LBBSDRP2.DGO", + // "DGO/LBBSDRP3.DGO", + // "DGO/LBBSPID.DGO", + // "DGO/LBBSPIRT.DGO", + // "DGO/LBBSPRT2.DGO", + // "DGO/LBBSPRT3.DGO", + // "DGO/LBBTCHA1.DGO", + // "DGO/LBBTCHA2.DGO", + // "DGO/LBBTCHA3.DGO", + // "DGO/LBIPED.DGO", + // "DGO/LBLOWCST.DGO", + // "DGO/LBLOWTKG.DGO", + // "DGO/LBLOWTMH.DGO", + // "DGO/LBOMBBOT.DGO", + // "DGO/LCITYSML.DGO", + // "DGO/LCTYASS.DGO", + // "DGO/LCTYBLOW.DGO", + // "DGO/LCTYDEST.DGO", + // "DGO/LCTYHIJK.DGO", + // "DGO/LCTYPALT.DGO", + // "DGO/LCTYPATK.DGO", + // "DGO/LCTYPROT.DGO", + // "DGO/LCTYSNPR.DGO", + // "DGO/LDAMKLEV.DGO", + // "DGO/LDAMPECK.DGO", + // "DGO/LDAMPKSM.DGO", + // "DGO/LDAMSIG.DGO", + // "DGO/LDAX.DGO", + // "DGO/LDESGCST.DGO", + // "DGO/LDMPCKGN.DGO", + // "DGO/LERROL.DGO", + // "DGO/LFACB.DGO", + // "DGO/LFACCAR.DGO", + // "DGO/LFACCITY.DGO", + // "DGO/LFACO.DGO", + // "DGO/LFACRM1.DGO", + // "DGO/LFACRM2.DGO", + // "DGO/LFACTORY.DGO", + // "DGO/LFORM.DGO", + // "DGO/LFORP.DGO", + // "DGO/LFORRING.DGO", // "DGO/LFREEOUT.DGO", // "DGO/LGUNNORM.DGO", - // "DGO/LTOWA.DGO", - // "DGO/TEMA.DGO", - // "DGO/CTA.DGO", - // "DGO/LPRECC.DGO", - // "DGO/LJKDXVIN.DGO", - // "DGO/CTYPEPC.DGO", - // "DGO/SEA.DGO", - // "DGO/COMBE.DGO", - // "DGO/CTYPESA.DGO", - // "DGO/LBLOWCST.DGO", - // "DGO/WSD.DGO", - // "DGO/LBBRING3.DGO", - // "DGO/LCTYPATK.DGO", - // "DGO/WCB.DGO", - // "DGO/DESRESC.DGO", - // "DGO/LBBRING4.DGO", - // "DGO/GRIDCST.DGO", - // "DGO/RAILX.DGO", - // "DGO/SEJ.DGO", - // "DGO/LJAKC.DGO", - // "DGO/CTB.DGO", - // "DGO/CTYCARC.DGO", - "DGO/LMECH.DGO", - // "DGO/LBBSDRP2.DGO", - // "DGO/NSA.DGO", - // "DGO/LBBTCHA3.DGO", - // "DGO/GUNGAME2.DGO", - // "DGO/CTC.DGO", - // "DGO/LVINCST.DGO", - // "DGO/COMBX.DGO", - // "DGO/DESH.DGO", - // "DGO/DESRACE2.DGO", - // "DGO/RAILD.DGO", - // "DGO/FACC.DGO", - // "DGO/CTYPESC.DGO", - // "DGO/LWASBBV.DGO", - // "DGO/TOWB.DGO", - // "DGO/HGA.DGO", - // "DGO/SEH.DGO", - // "DGO/MHCTYCST.DGO", - // "DGO/GUNGAME1.DGO", - // "DGO/INTROCST.DGO", - // "DGO/DESJUMP.DGO", - // "DGO/SEM.DGO", - // "DGO/SEI.DGO", - // "DGO/DESG.DGO", - // "DGO/DESW.DGO", - // "DGO/LOUTRO3.DGO", - // "DGO/LDAMKLEV.DGO", - // "DGO/DESERROL.DGO", - // "DGO/RAILB2.DGO", - // "DGO/LERROL.DGO", - // "DGO/IPF.DGO", - // "DGO/RAILB.DGO", - // "DGO/LCTYHIJK.DGO", - // "DGO/CTYPEPB.DGO", - "DGO/PRECB.DGO", - // "DGO/LFORM.DGO", - // "DGO/WASLEAPR.DGO", - // "DGO/LKEIRA.DGO", - // "DGO/LJAK.DGO", - // "DGO/SLUMBSET.DGO", - // "DGO/FACD.DGO", - // "DGO/LWASSIG.DGO", - // "DGO/LBIPED.DGO", - // "DGO/DESD.DGO", - // "DGO/CFB.DGO", - // "DGO/FREECAST.DGO", - // "DGO/SEG.DGO", - // "DGO/FACTORYA.DGO", - // "DGO/LPATK.DGO", - // "DGO/FRSTX.DGO", - // "DGO/SEB.DGO", - // "DGO/DESBCST.DGO", - // "DGO/DESE.DGO", - // "DGO/DESOASIS.DGO", - // "DGO/CTYCARA.DGO", - // "DGO/LSIGKLV.DGO", - // "DGO/CIB.DGO", - // "DGO/LBBRING2.DGO", - // "DGO/LTNFXHIP.DGO", - // "DGO/MIA.DGO", - // "DGO/MHCB.DGO", - // "DGO/LNSTOBC.DGO", - // "DGO/COMBD.DGO", - // "DGO/RBCT.DGO", - // "DGO/LTORNJNX.DGO", - // "DGO/DESBATTL.DGO", - // "DGO/SEK.DGO", - // "DGO/LSNKWHLS.DGO", - // "DGO/LMHCB.DGO", - // "DGO/LBOMBBOT.DGO", - // "DGO/OUTCAST3.DGO", - // "DGO/LBLOWTMH.DGO", - // "DGO/TEMD.DGO", - // "DGO/LTOWCITY.DGO", - // "DGO/OUTROCST.DGO", - // "DGO/WASCAST.DGO", - // "DGO/LFACRM2.DGO", - // "DGO/WASPGAME.DGO", - // "DGO/RAILE.DGO", - // "DGO/CTYPESB.DGO", - // "DGO/DESBOSS1.DGO", - // "DGO/FREEHQ.DGO", - // "DGO/LTORN.DGO", - // "DGO/TOWERA.DGO", - // "DGO/LSAMOS.DGO", - // "DGO/LFORP.DGO", - // "DGO/CFA.DGO", - // "DGO/LJINX.DGO", - // "DGO/SEO.DGO", - "DGO/PRECA.DGO", - // "DGO/TOWERC.DGO", - // "DGO/WCA.DGO", - // "DGO/SEC.DGO", - // "DGO/DESF.DGO", - // "DGO/SEL.DGO", - // "DGO/LCTYDEST.DGO", - // "DGO/LTORNSAM.DGO", - // "DGO/MUSEUM3B.DGO", - // "DGO/SEE.DGO", - // "DGO/DESHUNT.DGO", - // "DGO/RAILA.DGO", - // "DGO/TITLE.DGO", - // "DGO/RUBC.DGO", - // "DGO/DESB.DGO", - // "DGO/LFACCAR.DGO", - // "DGO/LNSTOA.DGO", - // "DGO/MUSEUM3.DGO", - // "DGO/ONINTENT.DGO", - // "DGO/STA.DGO", - // "DGO/WASSTADA.DGO", - // "DGO/POWERGD.DGO", - // "DGO/LKLEEVER.DGO", - // "DGO/FACB.DGO", - // "DGO/LCTYASS.DGO", - // "DGO/MHCA.DGO", - // "DGO/LTOWB.DGO", - // "DGO/LNSTCST.DGO", - // "DGO/DESRESCG.DGO", - // "DGO/INTPALRF.DGO", - // "DGO/LMHCA.DGO", - // "DGO/TOWERCST.DGO", - // "DGO/RAILF.DGO", - // "DGO/CIA.DGO", - // "DGO/CTYCARKG.DGO", - // "DGO/WASCHASE.DGO", - // "DGO/LFACO.DGO", - // "DGO/WIN.DGO", - // "DGO/TEMPLEE.DGO", - // "DGO/LBBSPIRT.DGO", - // "DGO/MUSEUM2.DGO", - // "DGO/INTTITLE.DGO", - // "DGO/STAA.DGO", - // "DGO/MUSEUM4B.DGO", - // "DGO/PRECD.DGO", - // "DGO/SEF.DGO", - // "DGO/CTYCARB.DGO", - // "DGO/WASDEFEN.DGO", - // "DGO/LBLOWTKG.DGO", - // "DGO/DESA.DGO", - // "DGO/COMBB.DGO", - // "DGO/WASSTADC.DGO", - // "DGO/DESC.DGO", - // "DGO/LDAMPECK.DGO", - // "DGO/LJAKSIG.DGO", - "DGO/HALFPIPE.DGO", - // "DGO/DESRACE1.DGO", - // "DGO/SEN.DGO", - // "DGO/TEMP.DGO", - // "DGO/SED.DGO", - // "DGO/LFACB.DGO", - // "DGO/LCTYSNPR.DGO", - // "DGO/LBBSPID.DGO", - // "DGO/FRSTA.DGO", - // "DGO/LBBRING5.DGO", - // "DGO/LBBSPRT3.DGO", - // "DGO/HHG.DGO", - // "DGO/LBBSPRT2.DGO", - // "DGO/CGB.DGO", - // "DGO/LDMPCKGN.DGO", - // "DGO/LSEEMWCA.DGO", - // "DGO/HGB.DGO", - // "DGO/LONINSIM.DGO", - // "DGO/RUBA.DGO", - // "DGO/DESRALLY.DGO", - "DGO/WWD.DGO", - // "DGO/STB.DGO", - // "DGO/MIB.DGO", - // "DGO/LCTYBLOW.DGO", - // "DGO/LWSTDPCK.DGO", - // "DGO/MUSEUM.DGO", - // "DGO/LJAKCKLV.DGO", - // "DGO/LBBRING1.DGO", - // "DGO/MUSEUM4.DGO", - // "DGO/LFACRM1.DGO", - // "DGO/LJKCDMKL.DGO", - // "DGO/LDAMSIG.DGO", - // "DGO/DESTRACK.DGO", - // "DGO/GGA.DGO", - // "DGO/RAILC.DGO", - // "DGO/LBBTCHA2.DGO", - // "DGO/DESINTER.DGO", - // "DGO/NSB.DGO", - // "DGO/LOUTRO.DGO", - // "DGO/VIN.DGO", - // "DGO/LDESGCST.DGO", - // "DGO/WARPCAST.DGO", - // "DGO/LBBRING6.DGO", - // "DGO/FRSTB.DGO", - // "DGO/TEMC.DGO", - // "DGO/COMBC.DGO", - // "DGO/LTRTWHLS.DGO", - "DGO/PRECC.DGO", - // "DGO/DESCHASE.DGO", - // "DGO/CITYCAST.DGO", - // "DGO/CPO.DGO", - // "DGO/LFACCITY.DGO", - // "DGO/RAILCST.DGO", - // "DGO/LJNDKLEV.DGO", - // "DGO/CWI.DGO", - // "DGO/MINEE.DGO", - // "DGO/LFORRING.DGO", - // "DGO/LASHELIN.DGO", - // "DGO/LJAKKLEV.DGO", - // "DGO/LCTYPALT.DGO", - // "DGO/LNSTOBB.DGO", - // "DGO/LJKFEET.DGO", - // "DGO/DST.DGO", - // "DGO/LBBTCHA1.DGO", // "DGO/LGUNRNC.DGO", - // "DGO/COMBN.DGO", - // "DGO/DESRESCC.DGO", - // "DGO/LSIGJAKC.DGO", - // "DGO/DESLIZ.DGO", - // "DGO/WASPALA.DGO", + // "DGO/LJAK.DGO", + // "DGO/LJAKC.DGO", + // "DGO/LJAKCKLV.DGO", + // "DGO/LJAKKLEV.DGO", // "DGO/LJAKNDAX.DGO", - // "DGO/WASSEEM.DGO", - "DGO/WASALL.DGO" - // "DGO/WCASEEM.DGO", - // "DGO/LSIG.DGO", - // "DGO/LFACTORY.DGO", - // "DGO/LWLANDM.DGO", - // "DGO/LPTRL.DGO", - // "DGO/MINED.DGO", - // "DGO/LDAMPKSM.DGO", - // "DGO/RUBB.DGO", - // "DGO/LCITYSML.DGO", - // "DGO/RUBA2.DGO", + // "DGO/LJAKSIG.DGO", + // "DGO/LJINX.DGO", + // "DGO/LJKCDMKL.DGO", + // "DGO/LJKDMPK.DGO", + // "DGO/LJKDXVIN.DGO", + // "DGO/LJKFEET.DGO", + // "DGO/LJNDKLEV.DGO", + // "DGO/LKEIRA.DGO", + // "DGO/LKLEEVER.DGO", + // "DGO/LMECH.DGO", + // "DGO/LMHCA.DGO", + // "DGO/LMHCB.DGO", + // "DGO/LNSTCST.DGO", + // "DGO/LNSTOA.DGO", + // "DGO/LNSTOBB.DGO", + // "DGO/LNSTOBC.DGO", + // "DGO/LONINSIM.DGO", + // "DGO/LOUTRO.DGO", // "DGO/LOUTRO2.DGO", - // "DGO/VOCX.DGO", - // "DGO/TEMX.DGO", - // "DGO/ARENACST.DGO", - // "DGO/TEMB.DGO", - // "DGO/COMBA.DGO", - // "DGO/LBBSDRP3.DGO", + // "DGO/LOUTRO3.DGO", + // "DGO/LPATK.DGO", // "DGO/LPATKCS.DGO", - // "DGO/VOCA.DGO", - // "DGO/WASSTADB.DGO", - // "DGO/LDAX.DGO", - // "DGO/LCTYPROT.DGO", - // "DGO/DESHOVER.DGO", - // "DGO/DESBOSS2.DGO" + // "DGO/LPRECC.DGO", + // "DGO/LPRENME.DGO", + // "DGO/LPTRL.DGO", + // "DGO/LSAMOS.DGO", + // "DGO/LSEEMWCA.DGO", + // "DGO/LSIG.DGO", + // "DGO/LSIGJAKC.DGO", + // "DGO/LSIGKLV.DGO", + // "DGO/LSNKWHLS.DGO", + // "DGO/LTNFXHIP.DGO", + // "DGO/LTNJXHIP.DGO", + // "DGO/LTORN.DGO", + // "DGO/LTORNJNX.DGO", + // "DGO/LTORNSAM.DGO", + // "DGO/LTOWA.DGO", + // "DGO/LTOWB.DGO", + // "DGO/LTOWCITY.DGO", + // "DGO/LTRTWHLS.DGO", + // "DGO/LVINCST.DGO", + // "DGO/LWASBBV.DGO", + // "DGO/LWASSIG.DGO", + // "DGO/LWLANDM.DGO", + "DGO/LWSTDPCK.DGO" ], // some objects are part of STR files (streaming data). "str_file_names": [], // streaming "art" that should be added to GAME.FR3. - "str_art_file_names": [ - "STR/JAEXTERN.STR" - ], + "str_art_file_names": ["STR/JAEXTERN.STR"], // some objects are directly stored as files on the DVD. This is just text files. "object_file_names": [ @@ -326,277 +348,300 @@ ], "levels_to_extract": [ - "LJKDMPK.DGO", - "LBBSDRP1.DGO", - "LTNJXHIP.DGO", - "MIC.DGO", + // wascity + "WASALL.DGO", + "WWD.DGO", // waswide + "WSD.DGO", // wasdoors (garage) + "WASCHASE.DGO", + "WASDEFEN.DGO", + "WASLEAPR.DGO", + "WASPALA.DGO", + "WASSEEM.DGO", + "WASPGAME.DGO", + "WCA.DGO", + "WCB.DGO", + "WCASEEM.DGO", + "WASCAST.DGO", + // arena + "WASSTADA.DGO", + "WASSTADB.DGO", + "WASSTADC.DGO", + "ARENACST.DGO", + // desert + "DESA.DGO", + "DESB.DGO", + "DESBATTL.DGO", + "DESBCST.DGO", + "DESBOSS1.DGO", + "DESBOSS2.DGO", + "DESC.DGO", + "DESCHASE.DGO", + "DESD.DGO", + "DESE.DGO", + "DESERROL.DGO", + "DESF.DGO", + "DESG.DGO", + "DESH.DGO", + "DESHOVER.DGO", + "DESHUNT.DGO", + "DESINTER.DGO", + "DESJUMP.DGO", + "DESLIZ.DGO", + "DESOASIS.DGO", + "DESRACE1.DGO", + "DESRACE2.DGO", + "DESRALLY.DGO", + "DESRESC.DGO", + "DESRESCC.DGO", + "DESRESCG.DGO", + "DESTRACK.DGO", + "DESW.DGO", + "DST.DGO", "OASISCST.DGO", - "CTYPEPA.DGO", - "LPRENME.DGO", + "WARPCAST.DGO", // air train + // nest + "NSA.DGO", + "NSB.DGO", + // temple + "TEMA.DGO", + "TEMB.DGO", + "TEMC.DGO", + "TEMD.DGO", + "TEMP.DGO", + "TEMPLEE.DGO", + "TEMX.DGO", + // hang + "HGA.DGO", + "HGB.DGO", + // volcano + "VOCA.DGO", + "VOCX.DGO", + // mine + "MIA.DGO", + "MIB.DGO", + "MIC.DGO", + "MINED.DGO", + "MINEE.DGO", + // city + "CWI.DGO", // ctywide + "CFA.DGO", // ctyfarm + "CFB.DGO", + "CGB.DGO", // ctygen + "CIA.DGO", // ctyind + "CIB.DGO", + "CPO.DGO", // ctyport + "CTA.DGO", // ctyslum + "CTB.DGO", + "CTC.DGO", + "CTYPEPA.DGO", // citizens + "CTYPEPB.DGO", // predator + "CTYPEPC.DGO", // empty + "CTYPESA.DGO", // guards + "CTYPESB.DGO", // metal heads + "CTYPESC.DGO", // kg + "CTYCARA.DGO", // cars + "CTYCARB.DGO", // bikes + "CTYCARC.DGO", // hellcat + "CTYCARKG.DGO", // empty + "ONINTENT.DGO", + "VIN.DGO", + "HHG.DGO", // hiphog + "GGA.DGO", // gungame + "GUNGAME1.DGO", + "GUNGAME2.DGO", + "POWERGD.DGO", + "FREEHQ.DGO", + "FREECAST.DGO", + "CITYCAST.DGO", + "GRIDCST.DGO", // city-destroy-grid-res + "SLUMBSET.DGO", // sewer-met-hum-intro + // sewer + "SEA.DGO", + "SEB.DGO", + "SEC.DGO", + "SED.DGO", + "SEE.DGO", + "SEF.DGO", + "SEG.DGO", + "SEH.DGO", + "SEI.DGO", + "SEJ.DGO", + "SEK.DGO", + "SEL.DGO", + "SEM.DGO", + "SEN.DGO", + "SEO.DGO", + // mhcity + "MHCA.DGO", + "MHCB.DGO", + "MHCTYCST.DGO", + // forest + "FRSTA.DGO", + "FRSTB.DGO", + "FRSTX.DGO", + // factory + "FACTORYA.DGO", + "FACB.DGO", + "FACC.DGO", + "FACD.DGO", + // tower + "TOWB.DGO", + "TOWERA.DGO", + "TOWERC.DGO", + "TOWERCST.DGO", + // stadium + "STA.DGO", + "STAA.DGO", + "STB.DGO", + // rubble + "RUBA.DGO", + "RUBA2.DGO", + "RUBB.DGO", + "RUBC.DGO", + "RBCT.DGO", + // comb + "COMBA.DGO", + "COMBB.DGO", + "COMBC.DGO", + "COMBD.DGO", + "COMBE.DGO", + "COMBN.DGO", + "COMBX.DGO", + "RAILA.DGO", + "RAILB.DGO", + "RAILB2.DGO", + "RAILC.DGO", + "RAILCST.DGO", + "RAILD.DGO", + "RAILE.DGO", + "RAILF.DGO", + "RAILX.DGO", + // precursor + "PRECA.DGO", + "PRECB.DGO", + "PRECC.DGO", + "PRECD.DGO", + // title + "WIN.DGO", // wasintro + "TITLE.DGO", + "INTTITLE.DGO", + "INTPALRF.DGO", // intro-palace-roof + "IPF.DGO", // intro-palace-fall + "INTROCST.DGO", + // outro + "OUTCAST3.DGO", + "OUTROCST.DGO", + // museum + "MUSEUM.DGO", + "MUSEUM2.DGO", + "MUSEUM3.DGO", + "MUSEUM3B.DGO", + "MUSEUM4.DGO", + "MUSEUM4B.DGO", + // test + "HALFPIPE.DGO", + // borrow + "LASHELIN.DGO", + "LBBRING1.DGO", + "LBBRING2.DGO", + "LBBRING3.DGO", + "LBBRING4.DGO", + "LBBRING5.DGO", + "LBBRING6.DGO", + "LBBSDRP1.DGO", + "LBBSDRP2.DGO", + "LBBSDRP3.DGO", + "LBBSPID.DGO", + "LBBSPIRT.DGO", + "LBBSPRT2.DGO", + "LBBSPRT3.DGO", + "LBBTCHA1.DGO", + "LBBTCHA2.DGO", + "LBBTCHA3.DGO", + "LBIPED.DGO", + "LBLOWCST.DGO", + "LBLOWTKG.DGO", + "LBLOWTMH.DGO", + "LBOMBBOT.DGO", + "LCITYSML.DGO", + "LCTYASS.DGO", + "LCTYBLOW.DGO", + "LCTYDEST.DGO", + "LCTYHIJK.DGO", + "LCTYPALT.DGO", + "LCTYPATK.DGO", + "LCTYPROT.DGO", + "LCTYSNPR.DGO", + "LDAMKLEV.DGO", + "LDAMPECK.DGO", + "LDAMPKSM.DGO", + "LDAMSIG.DGO", + "LDAX.DGO", + "LDESGCST.DGO", + "LDMPCKGN.DGO", + "LERROL.DGO", + "LFACB.DGO", + "LFACCAR.DGO", + "LFACCITY.DGO", + "LFACO.DGO", + "LFACRM1.DGO", + "LFACRM2.DGO", + "LFACTORY.DGO", + "LFORM.DGO", + "LFORP.DGO", + "LFORRING.DGO", "LFREEOUT.DGO", "LGUNNORM.DGO", - // "LTOWA.DGO", - "TEMA.DGO", - "CTA.DGO", - "LPRECC.DGO", - "LJKDXVIN.DGO", - "CTYPEPC.DGO", - "SEA.DGO", - "COMBE.DGO", - "CTYPESA.DGO", - "LBLOWCST.DGO", - "WSD.DGO", - "LBBRING3.DGO", - "LCTYPATK.DGO", - "WCB.DGO", - "DESRESC.DGO", - "LBBRING4.DGO", - "GRIDCST.DGO", - // "RAILX.DGO", - "SEJ.DGO", - "LJAKC.DGO", - "CTB.DGO", - "CTYCARC.DGO", - "LMECH.DGO", - "LBBSDRP2.DGO", - "NSA.DGO", - "LBBTCHA3.DGO", - "GUNGAME2.DGO", - "CTC.DGO", - "LVINCST.DGO", - // "COMBX.DGO", - "DESH.DGO", - "DESRACE2.DGO", - "RAILD.DGO", - "FACC.DGO", - "CTYPESC.DGO", - "LWASBBV.DGO", - "TOWB.DGO", - "HGA.DGO", - "SEH.DGO", - "MHCTYCST.DGO", - "GUNGAME1.DGO", - // "INTROCST.DGO", - "DESJUMP.DGO", - "SEM.DGO", - "SEI.DGO", - "DESG.DGO", - "DESW.DGO", - "LOUTRO3.DGO", - "LDAMKLEV.DGO", - "DESERROL.DGO", - "RAILB2.DGO", - "LERROL.DGO", - "IPF.DGO", - "RAILB.DGO", - "LCTYHIJK.DGO", - "CTYPEPB.DGO", - "PRECB.DGO", - "LFORM.DGO", - "WASLEAPR.DGO", - // "LKEIRA.DGO", - "LJAK.DGO", - "SLUMBSET.DGO", - "FACD.DGO", - // "LWASSIG.DGO", - "LBIPED.DGO", - "DESD.DGO", - "CFB.DGO", - "FREECAST.DGO", - "SEG.DGO", - "FACTORYA.DGO", - "LPATK.DGO", - "FRSTX.DGO", - "SEB.DGO", - // "DESBCST.DGO", - "DESE.DGO", - "DESOASIS.DGO", - "CTYCARA.DGO", - "LSIGKLV.DGO", - "CIB.DGO", - "LBBRING2.DGO", - "LTNFXHIP.DGO", - "MIA.DGO", - "MHCB.DGO", - "LNSTOBC.DGO", - "COMBD.DGO", - // "RBCT.DGO", - "LTORNJNX.DGO", - // "DESBATTL.DGO", - "SEK.DGO", - "LSNKWHLS.DGO", - "LMHCB.DGO", - // "LBOMBBOT.DGO", - "OUTCAST3.DGO", - "LBLOWTMH.DGO", - "TEMD.DGO", - "LTOWCITY.DGO", - // "OUTROCST.DGO", - "WASCAST.DGO", - "LFACRM2.DGO", - "WASPGAME.DGO", - "RAILE.DGO", - "CTYPESB.DGO", - "DESBOSS1.DGO", - "FREEHQ.DGO", - "LTORN.DGO", - "TOWERA.DGO", - "LSAMOS.DGO", - "LFORP.DGO", - "CFA.DGO", - "LJINX.DGO", - "SEO.DGO", - "PRECA.DGO", - "TOWERC.DGO", - "WCA.DGO", - "SEC.DGO", - "DESF.DGO", - "SEL.DGO", - "LCTYDEST.DGO", - "LTORNSAM.DGO", - "MUSEUM3B.DGO", - // "SEE.DGO", - "DESHUNT.DGO", - "RAILA.DGO", - "TITLE.DGO", - "RUBC.DGO", - // "DESB.DGO", - "LFACCAR.DGO", - "LNSTOA.DGO", - "MUSEUM3.DGO", - "ONINTENT.DGO", - "STA.DGO", - "WASSTADA.DGO", - "POWERGD.DGO", - "LKLEEVER.DGO", - "FACB.DGO", - "LCTYASS.DGO", - "MHCA.DGO", - "LTOWB.DGO", - "LNSTCST.DGO", - "DESRESCG.DGO", - "INTPALRF.DGO", - "LMHCA.DGO", - "TOWERCST.DGO", - "RAILF.DGO", - "CIA.DGO", - "CTYCARKG.DGO", - "WASCHASE.DGO", - "LFACO.DGO", - "WIN.DGO", - "TEMPLEE.DGO", - "LBBSPIRT.DGO", - "MUSEUM2.DGO", - "INTTITLE.DGO", - "STAA.DGO", - "MUSEUM4B.DGO", - // "PRECD.DGO", - "SEF.DGO", - "CTYCARB.DGO", - "WASDEFEN.DGO", - "LBLOWTKG.DGO", - "DESA.DGO", - "COMBB.DGO", - // "WASSTADC.DGO", - "DESC.DGO", - // "LDAMPECK.DGO", - // "LJAKSIG.DGO", - "HALFPIPE.DGO", - "DESRACE1.DGO", - "SEN.DGO", - "TEMP.DGO", - "SED.DGO", - "LFACB.DGO", - "LCTYSNPR.DGO", - "LBBSPID.DGO", - "FRSTA.DGO", - "LBBRING5.DGO", - "LBBSPRT3.DGO", - "HHG.DGO", - "LBBSPRT2.DGO", - "CGB.DGO", - "LDMPCKGN.DGO", - "LSEEMWCA.DGO", - // "HGB.DGO", - "LONINSIM.DGO", - "RUBA.DGO", - "DESRALLY.DGO", - "WWD.DGO", - "STB.DGO", - "MIB.DGO", - "LCTYBLOW.DGO", - "LWSTDPCK.DGO", - // "MUSEUM.DGO", - "LJAKCKLV.DGO", - "LBBRING1.DGO", - "MUSEUM4.DGO", - "LFACRM1.DGO", - "LJKCDMKL.DGO", - "LDAMSIG.DGO", - "DESTRACK.DGO", - "GGA.DGO", - "RAILC.DGO", - "LBBTCHA2.DGO", - "DESINTER.DGO", - // "NSB.DGO", - "LOUTRO.DGO", - "VIN.DGO", - "LDESGCST.DGO", - "WARPCAST.DGO", - "LBBRING6.DGO", - "FRSTB.DGO", - "TEMC.DGO", - // "COMBC.DGO", - "LTRTWHLS.DGO", - "PRECC.DGO", - "DESCHASE.DGO", - "CITYCAST.DGO", - // "CPO.DGO", - "LFACCITY.DGO", - "RAILCST.DGO", - "LJNDKLEV.DGO", - "CWI.DGO", - "MINEE.DGO", - "LFORRING.DGO", - "LASHELIN.DGO", - "LJAKKLEV.DGO", - "LCTYPALT.DGO", - "LNSTOBB.DGO", - "LJKFEET.DGO", - "DST.DGO", - "LBBTCHA1.DGO", "LGUNRNC.DGO", - "COMBN.DGO", - "DESRESCC.DGO", - "LSIGJAKC.DGO", - "DESLIZ.DGO", - "WASPALA.DGO", + "LJAK.DGO", + "LJAKC.DGO", + "LJAKCKLV.DGO", + "LJAKKLEV.DGO", "LJAKNDAX.DGO", - // "WASSEEM.DGO", - "WASALL.DGO", - "WCASEEM.DGO", - // "LSIG.DGO", - "LFACTORY.DGO", - "LWLANDM.DGO", - "LPTRL.DGO", - "MINED.DGO", - "LDAMPKSM.DGO", - "RUBB.DGO", - "LCITYSML.DGO", - "RUBA2.DGO", + "LJAKSIG.DGO", + "LJINX.DGO", + "LJKCDMKL.DGO", + "LJKDMPK.DGO", + "LJKDXVIN.DGO", + "LJKFEET.DGO", + "LJNDKLEV.DGO", + "LKEIRA.DGO", + "LKLEEVER.DGO", + "LMECH.DGO", + "LMHCA.DGO", + "LMHCB.DGO", + "LNSTCST.DGO", + "LNSTOA.DGO", + "LNSTOBB.DGO", + "LNSTOBC.DGO", + "LONINSIM.DGO", + "LOUTRO.DGO", "LOUTRO2.DGO", - "VOCX.DGO", - // "TEMX.DGO", - "ARENACST.DGO", - "TEMB.DGO", - "COMBA.DGO", - "LBBSDRP3.DGO", + "LOUTRO3.DGO", + "LPATK.DGO", "LPATKCS.DGO", - "VOCA.DGO", - "WASSTADB.DGO", - "LDAX.DGO", - "LCTYPROT.DGO", - "DESHOVER.DGO", - "DESBOSS2.DGO" + "LPRECC.DGO", + "LPRENME.DGO", + "LPTRL.DGO", + "LSAMOS.DGO", + "LSEEMWCA.DGO", + "LSIG.DGO", + "LSIGJAKC.DGO", + "LSIGKLV.DGO", + "LSNKWHLS.DGO", + "LTNFXHIP.DGO", + "LTNJXHIP.DGO", + "LTORN.DGO", + "LTORNJNX.DGO", + "LTORNSAM.DGO", + "LTOWA.DGO", + "LTOWB.DGO", + "LTOWCITY.DGO", + "LTRTWHLS.DGO", + "LVINCST.DGO", + "LWASBBV.DGO", + "LWASSIG.DGO", + "LWLANDM.DGO", + "LWSTDPCK.DGO" ] } diff --git a/decompiler/config/jak3/ntsc_v1/label_types.jsonc b/decompiler/config/jak3/ntsc_v1/label_types.jsonc index f71bb1043d..f2a568cb43 100644 --- a/decompiler/config/jak3/ntsc_v1/label_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/label_types.jsonc @@ -650,5 +650,312 @@ ["L139", "attack-info"], ["L138", "attack-info"], ["L137", "attack-info"] + ], + "minimap": [ + ["L557", "uint64", true], + ["L556", "uint64", true], + ["L314", "(inline-array minimap-class-node)", 177], + ["L522", "uint64", true], + ["L521", "uint64", true], + ["L518", "uint64", true], + ["L523", "uint64", true], + ["L517", "uint64", true], + ["L524", "uint64", true], + ["L519", "uint64", true], + ["L520", "uint64", true] + ], + "task-control": [ + ["L1270", "uint64", true], + ["L1271", "uint64", true], + ["L851", "uint64", true], + ["L750", "attack-info"], + ["L850", "uint64", true], + ["L849", "uint64", true], + ["L852", "uint64", true], + ["L853", "uint64", true] + ], + "nav-mesh": [["L271", "(inline-array vector)", 2]], + "nav-enemy": [ + ["L458", "uint64", true], + ["L459", "uint64", true], + ["L464", "uint64", true], + ["L463", "uint64", true], + ["L462", "uint64", true], + ["L461", "uint64", true], + ["L460", "uint64", true] + ], + "elec-gate": [["L155", "attack-info"]], + "gekko": [ + ["L544", "uint64", true], + ["L541", "uint64", true], + ["L542", "uint64", true], + ["L543", "uint64", true], + ["L479", "uint64", true], + ["L478", "uint64", true], + ["L474", "uint64", true], + ["L477", "uint64", true], + ["L476", "uint64", true], + ["L468", "(inline-array gekko-ik-setup)", 4], + ["L473", "uint64", true], + ["L475", "uint64", true] + ], + "mine-train": [["L190", "attack-info"]], + "grunt": [ + ["L204", "vector"], + ["L203", "vector"] + ], + "merc-blend-shape": [["L71", "(pointer int16)", 40]], + "vehicle-util": [["L245", "attack-info"]], + "prebot-eco-creature": [ + ["L320", "attack-info"], + ["L319", "attack-info"], + ["L331", "attack-info"] + ], + "prebot-extras": [ + ["L290", "uint64", true], + ["L293", "uint64", true], + ["L291", "uint64", true], + ["L292", "uint64", true], + ["L205", "attack-info"], + ["L262", "uint64", true], + ["L263", "uint64", true], + ["L268", "uint64", true], + ["L264", "uint64", true], + ["L266", "uint64", true], + ["L265", "uint64", true], + ["L227", "attack-info"], + ["L242", "attack-info"], + ["L267", "uint64", true], + ["L259", "uint64", true], + ["L261", "uint64", true], + ["L269", "uint64", true], + ["L246", "attack-info"], + ["L260", "uint64", true], + ["L270", "uint64", true], + ["L254", "vector"], + ["L255", "vector"], + ["L256", "vector"] + ], + "prebot-states": [ + ["L921", "uint64", true], + ["L912", "uint64", true], + ["L907", "uint64", true], + ["L913", "uint64", true], + ["L885", "(inline-array vector)", 2], + ["L887", "vector"], + ["L904", "uint64", true], + ["L902", "uint64", true], + ["L911", "uint64", true], + ["L899", "uint64", true], + ["L910", "uint64", true], + ["L909", "uint64", true], + ["L900", "uint64", true], + ["L906", "uint64", true], + ["L901", "uint64", true], + ["L905", "uint64", true], + ["L903", "uint64", true], + ["L898", "uint64", true], + ["L908", "uint64", true] + ], + "wasall-obs": [ + ["L1352", "uint64", true], + ["L1351", "uint64", true], + ["L1324", "uint64", true], + ["L1323", "uint64", true], + ["L1279", "attack-info"] + ], + "sew-laser-guard": [ + ["L75", "attack-info"], + ["L78", "attack-info"], + ["L81", "attack-info"] + ], + "sewer-obs": [ + ["L496", "uint64", true], + ["L495", "uint64", true], + ["L493", "uint64", true], + ["L497", "uint64", true], + ["L491", "uint64", true], + ["L494", "uint64", true], + ["L498", "uint64", true], + ["L490", "uint64", true], + ["L487", "uint64", true], + ["L488", "uint64", true], + ["L492", "uint64", true], + ["L489", "uint64", true], + ["L252", "attack-info"], + ["L390", "uint64", true], + ["L391", "uint64", true], + ["L397", "uint64", true], + ["L323", "attack-info"], + ["L396", "uint64", true], + ["L395", "uint64", true], + ["L331", "vector"], + ["L392", "uint64", true], + ["L399", "uint64", true], + ["L393", "uint64", true], + ["L398", "uint64", true], + ["L265", "vector"], + ["L394", "uint64", true], + ["L289", "attack-info"] + ], + "sew-laser-turret": [["L127", "attack-info"]], + "sew-whirlpool": [["L14", "attack-info"]], + "saberfish": [ + ["L749", "uint64", true], + ["L750", "uint64", true], + ["L752", "uint64", true], + ["L751", "uint64", true], + ["L667", "uint64", true], + ["L666", "uint64", true], + ["L668", "uint64", true], + ["L665", "uint64", true] + ], + "saberfish-spawner": [ + ["L262", "(pointer int8)", 64], + ["L263", "(pointer int8)", 64] + ], + "neo-juicer": [ + ["L270", "vector"], + ["L269", "vector"], + ["L268", "vector"] + ], + "neo-grenadier": [ + ["L200", "vector"], + ["L199", "vector"], + ["L206", "(pointer uint64)", 3], + ["L205", "(pointer int32)", 4], + ["L216", "(pointer uint64)", 2], + ["L223", "(pointer uint64)", 2] + ], + "spydroid-orig": [ + ["L247", "attack-info"], + ["L246", "attack-info"], + ["L231", "vector"], + ["L230", "vector"], + ["L229", "vector"], + ["L228", "vector"], + ["L227", "vector"] + ], + "roboguard": [ + ["L305", "uint64", true], + ["L272", "uint64", true], + ["L271", "uint64", true] + ], + "vehicle": [["L204", "vector"]], + "wvehicle": [ + ["L270", "attack-info"], + ["L269", "vector"], + ["L268", "vector"] + ], + "wvehicle-util": [["L186", "attack-info"]], + "wvehicle-physics": [["L55", "(inline-array vehicle-wheel-surface)", 7]], + "wcar": [ + ["L175", "(inline-array vehicle-attach-point)", 14], + ["L111", "(inline-array vector)", 2], + ["L110", "vector"], + ["L109", "vector"], + ["L108", "vector"], + ["L107", "vector"], + ["L105", "vector"], + ["L104", "vector"], + ["L103", "vector"], + ["L106", "vector"], + ["L102", "vector"], + ["L101", "vector"], + ["L100", "vector"], + ["L99", "vector"] + ], + "wcar-turtle": [ + ["L18", "vector"], + ["L17", "vector"], + ["L16", "vector"], + ["L15", "vector"], + ["L14", "vector"], + ["L13", "vector"] + ], + "race-mesh": [["L112", "(pointer rgba)", 16]], + "wcar-snake": [ + ["L7", "vector"], + ["L6", "vector"], + ["L15", "vector"], + ["L14", "vector"], + ["L13", "vector"], + ["L12", "vector"], + ["L11", "vector"], + ["L10", "vector"], + ["L9", "vector"] + ], + "wcar-scorpion": [ + ["L37", "vector"], + ["L42", "vector"], + ["L41", "vector"], + ["L40", "vector"], + ["L39", "vector"], + ["L51", "vector"], + ["L50", "vector"], + ["L49", "vector"], + ["L48", "vector"], + ["L47", "vector"], + ["L46", "vector"], + ["L45", "vector"] + ], + "wcar-toad": [ + ["L37", "vector"], + ["L36", "vector"], + ["L46", "attack-info"], + ["L45", "vector"], + ["L44", "vector"], + ["L43", "vector"], + ["L42", "vector"], + ["L41", "vector"], + ["L40", "vector"], + ["L39", "vector"], + ["L47", "(inline-array vector)", 2], + ["L38", "vector"] + ], + "wcar-fox": [ + ["L7", "vector"], + ["L6", "vector"], + ["L15", "vector"], + ["L14", "vector"], + ["L13", "vector"], + ["L12", "vector"], + ["L11", "vector"], + ["L10", "vector"], + ["L9", "vector"] + ], + "wcar-rhino": [ + ["L30", "vector"], + ["L29", "vector"], + ["L28", "vector"], + ["L27", "vector"], + ["L26", "vector"], + ["L25", "vector"], + ["L24", "vector"], + ["L23", "vector"], + ["L21", "vector"] + ], + "wcar-mirage": [ + ["L23", "vector"], + ["L22", "vector"], + ["L21", "vector"], + ["L20", "vector"], + ["L19", "vector"], + ["L18", "vector"], + ["L17", "vector"], + ["L24", "vector"], + ["L15", "vector"], + ["L14", "vector"] + ], + "wcar-x-ride": [ + ["L9", "vector"], + ["L8", "vector"], + ["L17", "vector"], + ["L16", "vector"], + ["L15", "vector"], + ["L14", "vector"], + ["L13", "vector"], + ["L12", "vector"], + ["L11", "vector"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc b/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc index 144d443c53..7ba9e878ee 100644 --- a/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc +++ b/decompiler/config/jak3/ntsc_v1/process_stack_size_overrides.jsonc @@ -1,5 +1,7 @@ // This overrides the stack size for calls to stack-size-set! in given functions. { "(method 29 target)": 2048, - "(method 11 part-spawner)": 64 + "(method 11 part-spawner)": 64, + "(method 11 elevator)": 1024, + "scene-player-init": 1024 } diff --git a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc index 3d63fb17ee..3fab213fd1 100644 --- a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc +++ b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc @@ -764,5 +764,416 @@ "(code target-flut-get-on)": [ [16, "vector"], [32, "vector"] - ] + ], + "(method 11 minimap)": [[16, ["inline-array", "vector", 4]]], + "(method 15 minimap)": [[16, "minimap-draw-work"]], + "(method 19 minimap)": [ + [32, "vector"], + [16, "vector"] + ], + "(method 24 minimap)": [[16, "minimap-draw-work"]], + "(method 23 minimap)": [ + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "matrix"], + [144, "matrix"] + ], + "(method 26 minimap)": [ + [32, "vector"], + [48, "vector"], + [64, "matrix"] + ], + "(method 17 minimap)": [ + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "matrix"], + [144, "matrix"], + [256, "vector"], + [240, "vector"] + ], + "(method 18 minimap)": [ + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "matrix"], + [144, "matrix"], + [240, "vector"], + [256, "vector"] + ], + "(method 14 trail-graph)": [[16, ["inline-array", "vector", 2]]], + "(method 15 trail-graph)": [[16, ["inline-array", "vector", 4]]], + "(method 12 lightning-bolt)": [ + [80, "vector"], + [112, "matrix"], + [176, "vector"], + [192, "vector"], + [16, "vector"], + [32, "matrix"], + [304, "matrix"], + [272, "vector"], + [368, "vector"], + [384, "vector"] + ], + "(method 11 lightning-bolt)": [[48, "vector"]], + "(method 20 lightning-bolt)": [[16, "vector"]], + "(method 16 lightning-bolt)": [[144, ["array", "rgba", 1]]], + "(method 9 nav-mesh)": [[16, "vector"]], + "(method 10 nav-mesh)": [[32, "nav-find-poly-parms"]], + "find-nearest-nav-mesh": [[16, "nav-find-poly-parms"]], + "point-to-poly-boundary": [[16, ["inline-array", "vector", 4]]], + "(method 11 nav-mesh)": [[16, "nav-find-poly-parms"]], + "(method 31 entity-actor)": [[16, "nav-find-poly-parms"]], + "(method 32 entity-actor)": [[32, "nav-find-poly-parms"]], + "(method 15 nav-mesh)": [[16, ["array", "int8", 4]]], + "(method 17 nav-mesh)": [[16, "vector"]], + "(method 20 nav-mesh)": [[16, "nav-ray"]], + "(method 21 nav-mesh)": [ + [16, "nav-ray"], + [96, "vector"] + ], + "(method 36 nav-mesh)": [[16, "nav-poly"]], + "(method 37 nav-mesh)": [[16, ["inline-array", "nav-poly", 3]]], + "(method 39 nav-mesh)": [[16, ["inline-array", "vector", 3]]], + "(method 43 nav-mesh)": [[16, "vector"]], + "(method 25 nav-mesh)": [[32, "nav-stack-type2"]], + "(method 12 nav-mesh)": [[16, "nav-stack-type"]], + "(anon-function 9 nav-control)": [[16, ["inline-array", "vector", 1]]], + "(anon-function 4 nav-control)": [[16, ["inline-array", "vector", 1]]], + "debug-nav-validate-current-poly": [[16, "vector"]], + "(method 9 nav-control)": [[16, "vector"]], + "circle-tangent-directions": [[48, "vector"]], + "(method 18 nav-control)": [[16, "nav-control-cfs-work"]], + "(method 19 nav-control)": [[16, "nav-control-cfs-work"]], + "(method 11 nav-state)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 24 nav-state)": [[16, ["inline-array", "vector", 1]]], + "(method 28 nav-state)": [[208, "vector"]], + "(method 31 nav-state)": [ + [16, "nav-avoid-spheres-params"], + [112, "nav-ray"] + ], + "(method 32 nav-state)": [[16, "nav-control-cfs-work"]], + "(method 34 nav-state)": [[16, ["inline-array", "vector", 1]]], + "(method 37 nav-state)": [[16, ["inline-array", "vector", 1]]], + "(method 50 nav-state)": [[16, "nav-ray"]], + "(method 52 nav-state)": [ + [16, "vector"], + [32, "nav-route-portal"], + [80, ["inline-array", "vector", 2]], + [192, "matrix"] + ], + "(method 53 nav-state)": [ + [16, "nav-avoid-spheres-params"], + [112, "nav-ray"] + ], + "(method 91 nav-enemy)": [[16, "vector"]], + "(method 161 nav-enemy)": [[16, "vector"]], + "(method 160 nav-enemy)": [[16, "vector"]], + "(code hostile monster-frog)": [[16, "vector"]], + "(code notice monster-frog)": [[16, "vector"]], + "elec-gate-post": [[48, "vector"]], + "(enter active elec-gate)": [[176, ["inline-array", "vector", 2]]], + "(method 26 min-rat-engine)": [[96, "vector"]], + "(code arrived min-bomb-elevator)": [[16, ["array", "symbol", 3]]], + "(code down-idle min-crane-switch)": [[16, ["array", "symbol", 3]]], + "(method 208 manta)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 200 manta)": [[16, "vector"]], + "(method 201 manta)": [[16, ["inline-array", "matrix", 2]]], + "(method 109 rat)": [[112, "vector"]], + "(post running-in-wheel rat)": [ + [96, "vector"], + [112, "vector"], + [128, "vector"] + ], + "(post idle rat-spawner)": [ + [96, "vector"], + [112, "enemy-init-by-other-params"] + ], + "(method 37 min-bomb-train)": [[144, "vector"]], + "(method 10 game-task-node-info)": [[16, ["array", "game-task-node", 64]]], + "fail-mission": [[96, "resetter-params"]], + "restart-mission": [[96, "resetter-params"]], + "gekko-postbind": [ + [576, ["inline-array", "vector", 1]], + [656, "vector"], + [672, "vector"], + [752, "vector"], + [768, "vector"], + [848, "vector"], + [864, "vector"], + [944, "vector"], + [960, "vector"] + ], + "(method 202 gekko)": [ + [16, "vector"], + [32, "vector"] + ], + "merc-blend-shape": [[16, ["array", "int16", 128]]], + "(method 26 battle)": [[16, "vector"]], + "fruit-check-ground-bounce": [[16, "vector"]], + "wascity-cactus-callback": [[16, "vector"]], + "vehicle-draw-thruster": [[16, "vehicle-thruster-work"]], + "(method 30 vehicle)": [[16, ["array", "uint32", 1]]], + "(method 55 vehicle)": [[16, "matrix"]], + "(method 54 vehicle)": [[16, "rigid-body-move-work"]], + "(method 78 vehicle)": [ + [16, "vehicle-stack-type3"], + [144, "sprite-glow-data"], + [208, "sprite-glow-data"] + ], + "vehicle-explode-post": [[16, ["array", "uint32", 1]]], + "(method 129 vehicle)": [[16, "mystery-vehicle-type0"]], + "(event fly-to-dest prebot-large-eco-creature)": [[96, "vector"]], + "large-eco-creature-split": [ + [16, "enemy-init-by-other-params"], + [64, "vector"] + ], + "spt-func-pillar-rocks-bounce1": [[16, "vector"]], + "spt-func-pillar-rocks-bounce2": [[16, "vector"]], + "prebot-sword-init-by-other": [[16, "weapon-trail-tracker-spawn-params"]], + "(trans idle prebot-shockwave)": [[560, "bounding-box"]], + "(enter test prebot)": [ + [16, "enemy-init-by-other-params"], + [64, "vector"] + ], + "prebot-spawn-shockwave": [[16, "vector"]], + "prebot-light-flash": [[16, "vector"]], + "prebot-common": [ + [112, "vector"], + [96, "vector"] + ], + "prebot-neck-callback": [[144, "vector"]], + "prebot-launch-critter": [ + [64, "vector"], + [80, "vector"], + [16, "enemy-init-by-other-params"] + ], + "(post attacking-1 tentacle)": [[16, "vector"]], + "(method 155 sew-laser-guard)": [ + [32, "vector"], + [160, "vector"] + ], + "(trans idle sew-laser-beam)": [[32, "vector"]], + "(method 25 sew-move-turret-shot)": [[32, "vector"]], + "spawn-sew-move-turret-projectile": [ + [16, "projectile-init-by-other-params"], + [144, "vector"] + ], + "(method 162 sew-laser-turret)": [ + [32, ["array", "collide-shape", 384]], + [16, "bounding-box"] + ], + "(trans alert sew-laser-turret)": [ + [32, ["array", "collide-shape", 384]], + [16, "bounding-box"] + ], + "(method 161 sew-laser-turret)": [[64, "rgbaf"]], + "(method 159 sew-laser-turret)": [[32, "vector"]], + "(trans active sew-moving-step-a)": [[16, "vector"]], + "spawn-moving-step-b-step": [[16, "sew-moving-step-b-step-param"]], + "(method 231 saberfish)": [ + [16, "vector"], + [32, "vector"], + [48, "vector"] + ], + "(method 236 saberfish)": [[16, "saberfish-spawner-query-msg"]], + "(method 237 saberfish)": [[16, "saberfish-spawner-query-msg"]], + "(method 238 saberfish)": [ + [16, "saberfish-spawner-query-msg"], + [576, "vector"], + [144, "vector"], + [272, "vector"], + [288, "vector"], + [448, "vector"], + [464, "vector"], + [480, "vector"], + [496, "vector"] + ], + "(method 225 saberfish)": [[16, "saberfish-spawner-query-msg"]], + "(code active saberfish-mgr-room1)": [[16, "saberfish-spawner-command"]], + "(code stage-0 saberfish-mgr-room2)": [[16, "saberfish-spawner-command"]], + "(code stage-2 saberfish-mgr-room2)": [[16, "saberfish-spawner-command"]], + "(code stage-1 saberfish-mgr-room2)": [[16, "saberfish-spawner-command"]], + "(method 22 saberfish-spawner)": [[16, "nav-poly"]], + "(method 24 saberfish-spawner)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 11 saberfish-spawner)": [[32, "vector"]], + "(method 25 saberfish-spawner)": [[16, "saberfish-init-by-other-params"]], + "(method 17 saberfish-spawn-manager-base)": [[16, "saberfish-spawn-query"]], + "(method 18 saberfish-spawn-manager-base)": [[16, "saberfish-spawn-query"]], + "(code active kg-hopper)": [[16, "vector"]], + "(method 191 kg-hopper)": [ + [96, "vector"], + [176, "collide-query"] + ], + "(method 99 kg-hopper)": [[80, "vector"]], + "spt-func-birth-on-bubble-pop": [ + [16, "vector"], + [32, "vector"] + ], + "(code turned-off sew-power-switch)": [[16, ["array", "symbol", 10]]], + "(method 18 hfragment)": [ + [48, "vector"], + [16, "vector"], + [32, "vector"], + [96, "vector"], + [112, "vector"] + ], + "(trans hostile neo-grenadier)": [[48, "vector"]], + "(code flee sewer-frog)": [[16, "vector"]], + "(enter explode spydroid-orig)": [[192, "vector"]], + "(method 196 roboguard)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 195 roboguard)": [[16, "vector"]], + "(anon-function 1 roboguard)": [ + [16, "vector"], + [32, "vector"] + ], + "(anon-function 25 roboguard)": [[48, "matrix"]], + "(method 91 vehicle)": [[16, "vehicle-controls"]], + "(method 48 vehicle)": [[16, "matrix"]], + "(method 118 vehicle)": [[16, "vehicle-controls"]], + "(method 32 squad-control)": [[16, "vector"]], + "(method 17 squad-control)": [[16, "primary-target-pos-vel"]], + "(method 16 squad-control)": [ + [16, ["inline-array", "primary-target-pos-vel", 2]] + ], + "(method 24 squad-control)": [[16, "primary-target-pos-vel"]], + "(method 25 squad-control)": [ + [16, ["inline-array", "primary-target-pos-vel", 2]] + ], + "(method 50 vehicle)": [[16, ["inline-array", "rigid-body-impact", 2]]], + "(method 93 vehicle)": [[16, "mystery-vehicle-type2"]], + "(method 94 vehicle)": [ + [16, "mystery-vehicle-type1"], + [128, ["inline-array", "collide-query", 2]], + [816, ["inline-array", "matrix", 2]] + ], + "(method 135 vehicle)": [[16, ["inline-array", "matrix", 2]]], + "(method 13 was-squad-control)": [ + [16, ["inline-array", "matrix", 2]], + [192, "matrix"], + [208, ["array", "uint32", 1]] + ], + "(method 35 was-squad-control)": [ + [16, ["inline-array", "matrix", 2]], + [240, "cquery-with-5vec"] + ], + "(method 39 vehicle-wheel)": [[16, "rigid-body-move-work"]], + "(enter explode wvehicle)": [[16, "matrix"]], + "(method 77 wvehicle)": [[16, "vector"]], + "(method 30 wvehicle)": [[16, "matrix"]], + "(method 92 wvehicle)": [[16, "vector"]], + "(method 163 wvehicle)": [[16, "matrix"]], + "(method 165 wvehicle)": [ + [16, "vehicle-controls"], + [32, "matrix"] + ], + "(method 198 wvehicle)": [[16, "wvehicle-physics-work"]], + "(method 195 wvehicle)": [[16, "light-trail-tracker-spawn-params"]], + "cshape-reaction-scorp-shot": [[16, "vector"]], + "(method 26 v-scorp-shot)": [[32, "vector"]], + "(method 25 v-rhino-shot)": [[32, "vector"]], + "(method 31 v-toad-shot)": [ + [32, "light-trail-tracker-spawn-params"], + [16, "vector"] + ], + "(method 78 wvehicle)": [ + [16, "wvehicle-part-work"], + [624, "wvehicle-draw-thruster-params"] + ], + "(method 172 wvehicle)": [[16, ["inline-array", "quaternion", 2]]], + "(method 173 wvehicle)": [[16, "wvehicle-stack-type1"]], + "(method 161 wvehicle)": [[16, "vehicle-wheel-init-params"]], + "(method 31 wvehicle)": [[16, "wvehicle-physics-work"]], + "(method 162 wvehicle)": [[16, "wvehicle-physics-work"]], + "(method 164 wvehicle)": [[16, "wvehicle-stack-type6"]], + "(method 95 vehicle)": [[16, "matrix"]], + "(method 93 wvehicle)": [ + [16, ["inline-array", "matrix", 2]], + [112, "wvehicle-physics-work"], + [128, "matrix"] + ], + "(method 33 wvehicle)": [ + [16, ["inline-array", "quaternion", 2]], + [48, "wvehicle-stack-type4"] + ], + "(method 149 wvehicle)": [[16, "wvehicle-stack-type2"]], + "(method 199 wvehicle)": [[16, "wvehicle-stack-type3"]], + "(method 169 wcar-snake-base)": [[16, "wcar-proj-init-by-other-params"]], + "(method 79 wcar-snake-base)": [ + [16, ["inline-array", "quaternion", 2]], + [64, "wcar-stack-type1"] + ], + "(method 79 v-turtle)": [ + [16, ["inline-array", "quaternion", 2]], + [64, "wvehicle-physics-work"], + [128, "wvehicle-jmod-work"] + ], + "(method 31 squad-control)": [[48, "squad-control-stack-type0"]], + "target-pilot-post": [ + [48, "cquery-with-5vec"], + [640, "matrix"] + ], + "(code target-pilot-get-off)": [[96, "matrix"]], + "target-pilot-trans": [[16, "matrix"]], + "(method 34 was-squad-control)": [ + [16, "cquery-with-vec"], + [576, ["inline-array", "vector", 2]], + [592, "mystery-traffic-object-spawn-params0"] + ], + "(method 9 race-control)": [[16, "race-mesh-slice-query"]], + "(method 9 race-path)": [[16, "vector"]], + "(method 10 race-path)": [[16, ["inline-array", "vector", 4]]], + "(method 11 race-path)": [[16, ["inline-array", "race-path-sample", 6]]], + "(method 16 race-mesh)": [[16, "race-mesh-hash-search"]], + "(method 12 race-path)": [[16, "matrix"]], + "(method 18 race-mesh)": [[16, "race-mesh-slice-query"]], + "(method 17 race-mesh)": [[16, "race-mesh-slice-query"]], + "sparticle-motion-blur-dirt": [[16, "matrix"]], + "check-scorp-shell-level1": [[16, "vector"]], + "check-scorp-shell-level2": [[16, "vector"]], + "(method 22 turbo-pickup)": [[16, "cquery-with-vec"]], + "(method 17 tire-trail)": [[16, "matrix"]], + "(method 200 wvehicle)": [[16, "wvehicle-physics-work"]], + "(method 38 wvehicle)": [ + [16, "wvehicle-stack-type5"], + [112, "wvehicle-stack-type7"], + [272, "wvehicle-stack-type5"], + [304, "matrix"] + ], + "(method 24 w-parking-spot)": [[16, "cquery-with-5vec"]], + "(method 79 v-scorpion)": [ + [32, ["inline-array", "quaternion", 2]], + [16, "vector"], + [80, "wvehicle-physics-work"] + ], + "(method 169 v-scorpion)": [[16, "wcar-rhino-proj-params"]], + "(method 169 v-toad)": [[16, "wcar-toad-stack-var0"]], + "(method 79 v-toad)": [ + [16, ["inline-array", "quaternion", 2]], + [48, ["inline-array", "quaternion", 1]], + [64, "wvehicle-physics-work"] + ], + "(method 203 v-toad)": [[16, "wvehicle-physics-work"]], + "(method 169 v-rhino)": [[16, "wcar-rhino-proj-params"]], + "(method 169 v-mirage)": [[16, "wcar-toad-stack-var0"]], + "(method 79 v-rhino)": [ + [16, ["inline-array", "quaternion", 2]], + [48, ["inline-array", "quaternion", 1]], + [64, ["inline-array", "quaternion", 2]] + ], + "(method 17 turret-control)": [[16, "turret-control-stack-var0"]], + "(method 9 turret-control)": [[16, "turret-control-stack-var1"]] } diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index e531e7d407..700a023128 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -1685,7 +1685,10 @@ [439, "a0", "(pointer uint128)"], [[472, 487], "a0", "dma-packet"], [[559, 576], "a0", "dma-packet"], - [[597, 602], "a0", "dma-packet"] + [[597, 602], "a0", "dma-packet"], + [436, "a1", "(pointer uint128)"], + [437, "a0", "(pointer uint128)"], + [[470, 472], "a0", "dma-packet"] ], "lightning-trail-fractal-gen": [ [52, "v1", "float"], @@ -3758,7 +3761,8 @@ [127, "v0", "(pointer actor-group)"], [28, "v0", "(inline-array vector)"], ["_stack_", 28, "float"], - ["_stack_", 32, "float"] + ["_stack_", 32, "float"], + ["_stack_", 48, "res-tag"] ], "(method 15 level-group)": [ [262, "s0", "process-drawable"], @@ -4975,5 +4979,1645 @@ // "v1", // "art-joint-anim" // ] - ] + ], + "(method 14 minimap)": [ + [84, "v1", "process-drawable"], + [99, "v1", "entity-actor"], + [108, "v1", "process-drawable"], + [112, "s2", "entity-actor"], + [93, "s2", "basic"] + ], + "(method 12 minimap)": [[18, "v0", "connection-minimap"]], + "(method 15 minimap)": [ + [48, "s2", "(pointer uint128)"], + [[85, 90], "s1", "(pointer uint128)"], + [[282, 287], "s3", "(pointer uint128)"], + [[290, 293], "s3", "(pointer uint128)"], + [[294, 301], "v1", "(inline-array vector4w)"], + [[302, 307], "v1", "(inline-array vector4w)"], + [[313, 322], "v1", "(inline-array vector4w)"], + [[324, 329], "v1", "(inline-array vector4w)"], + [[335, 344], "v1", "(inline-array vector4w)"], + [[345, 351], "v1", "(inline-array vector4w)"], + [[357, 366], "v1", "(inline-array vector4w)"], + [[368, 374], "v1", "(inline-array vector4w)"], + [[380, 389], "v1", "(inline-array vector4w)"] + ], + "(method 19 minimap)": [ + [[114, 144], "s3", "(inline-array vector4w)"], + [[151, 155], "v1", "(inline-array vector4w)"], + [[157, 161], "a0", "(inline-array vector4w)"], + [[163, 168], "v1", "(inline-array vector4w)"], + [[170, 174], "v1", "(inline-array vector4w)"] + ], + "(method 18 level)": [[[13, 961], "s5", "level-memory-mode"]], + "(method 24 minimap)": [ + [[16, 21], "v1", "adgif-shader"], + [[90, 98], "v1", "(inline-array vector)"], + [[107, 116], "v1", "(inline-array vector)"], + [[125, 133], "v1", "(inline-array vector)"], + [[142, 151], "v1", "(inline-array vector)"], + [77, "s3", "(pointer uint128)"], + [79, "s3", "(pointer uint128)"], + [[100, 104], "a0", "(inline-array vector4w)"], + [[118, 122], "v1", "(inline-array vector4w)"], + [[135, 139], "a0", "(inline-array vector4w)"], + [[153, 157], "v1", "(inline-array vector4w)"], + [[172, 175], "s2", "adgif-shader"] + ], + "(method 23 minimap)": [ + [28, "a0", "process-drawable"], + [62, "v1", "process-drawable"], + [81, "a0", "process-drawable"], + [319, "a1", "(pointer uint128)"], + [321, "a0", "(inline-array vector4w)"], + [[336, 344], "v1", "(inline-array vector)"], + [[351, 361], "v1", "(inline-array vector4w)"], + [[365, 373], "v1", "(inline-array vector)"], + [[380, 390], "v1", "(inline-array vector4w)"], + [[393, 402], "v1", "(inline-array vector)"], + [[409, 419], "v1", "(inline-array vector4w)"], + [[423, 432], "v1", "(inline-array vector)"], + [[439, 449], "v1", "(inline-array vector4w)"] + ], + "(method 26 minimap)": [ + [34, "a0", "process-drawable"], + [49, "v1", "process-drawable"], + [64, "a0", "process-drawable"], + [305, "a1", "(pointer uint128)"], + [[310, 319], "a0", "(inline-array vector4w)"], + [[322, 330], "v1", "(inline-array vector)"], + [[337, 347], "v1", "(inline-array vector4w)"], + [[351, 359], "v1", "(inline-array vector)"], + [[366, 376], "v1", "(inline-array vector4w)"], + [[379, 388], "v1", "(inline-array vector)"], + [[395, 405], "v1", "(inline-array vector4w)"], + [[409, 418], "v1", "(inline-array vector)"], + [[425, 435], "v1", "(inline-array vector4w)"] + ], + "(method 17 minimap)": [ + [28, "a0", "process-drawable"], + [68, "v1", "process-drawable"], + [87, "a0", "process-drawable"], + [[353, 360], "a0", "(pointer uint128)"], + [364, "a0", "(pointer uint128)"], + [367, "a0", "(pointer uint128)"], + [[372, 381], "v1", "(inline-array vector4w)"], + [[384, 392], "v1", "(inline-array vector)"], + [[399, 408], "v1", "(inline-array vector4w)"], + [[412, 420], "v1", "(inline-array vector)"], + [[427, 436], "v1", "(inline-array vector4w)"], + [[439, 448], "v1", "(inline-array vector)"], + [[455, 464], "v1", "(inline-array vector4w)"], + [[468, 477], "v1", "(inline-array vector)"], + [[484, 493], "v1", "(inline-array vector4w)"] + ], + "(method 18 minimap)": [ + [28, "a0", "process-drawable"], + [68, "v1", "process-drawable"], + [87, "a0", "process-drawable"], + [360, "t1", "(pointer uint128)"], + [363, "t1", "(pointer uint128)"], + [365, "t0", "(pointer uint128)"], + [[368, 377], "t0", "(inline-array vector4w)"], + [[379, 383], "a3", "(inline-array vector4w)"], + [[390, 399], "a3", "(inline-array vector4w)"], + [[401, 405], "a3", "(inline-array vector4w)"], + [[412, 421], "a2", "(inline-array vector4w)"], + [[423, 427], "a2", "(inline-array vector4w)"], + [[434, 443], "a1", "(inline-array vector4w)"], + [[445, 449], "a1", "(inline-array vector4w)"], + [[456, 465], "v1", "(inline-array vector4w)"] + ], + "(method 21 minimap)": [ + [[14, 17], "s3", "(pointer uint128)"], + [71, "s3", "(pointer uint128)"], + [73, "s3", "(pointer uint128)"], + [[217, 224], "v1", "(inline-array vector4w)"], + [[226, 235], "v1", "(inline-array vector)"], + [[236, 241], "v1", "(inline-array vector4w)"], + [[243, 252], "v1", "(inline-array vector)"], + [[254, 259], "v1", "(inline-array vector4w)"], + [[261, 270], "v1", "(inline-array vector)"], + [[271, 277], "v1", "(inline-array vector4w)"], + [[279, 288], "v1", "(inline-array vector)"], + [[290, 296], "v1", "(inline-array vector4w)"], + [[380, 385], "s2", "(pointer uint128)"], + [[425, 430], "s3", "(pointer uint128)"], + [[498, 503], "s3", "(pointer uint128)"], + [[511, 514], "s3", "(pointer uint128)"], + [[516, 523], "v1", "(inline-array vector4w)"], + [[524, 528], "v1", "(inline-array vector4w)"], + [[529, 534], "v1", "(inline-array vector4w)"], + [[536, 541], "v1", "(inline-array vector4w)"], + [[543, 549], "v1", "(inline-array vector4w)"] + ], + "(method 16 minimap)": [ + [30, "v1", "process-drawable"], + [34, "v1", "process-drawable"], + [56, "v1", "entity-actor"], + [66, "a0", "process-drawable"], + [77, "a0", "entity-actor"], + [50, "v1", "entity-actor"], + [[542, 545], "v1", "(pointer uint128)"], + [[548, 557], "t1", "(inline-array vector4w)"], + [[558, 562], "a0", "(inline-array vector4w)"], + [[568, 578], "a0", "(inline-array vector4w)"], + [[579, 583], "a0", "(inline-array vector4w)"], + [[589, 599], "v1", "(inline-array vector4w)"] + ], + "(method 10 engine-minimap)": [[6, "s5", "connection-minimap"]], + "(method 14 engine-minimap)": [ + [159, "a0", "entity-actor"], + [152, "v1", "entity-actor"] + ], + "(method 12 lightning-bolt)": [ + ["_stack_", 56, "float"], + ["_stack_", 236, "float"] + ], + "(method 15 lightning-bolt)": [ + [47, "v1", "float"], + [64, "v1", "float"] + ], + "(method 21 lightning-bolt)": [ + [49, "v1", "float"], + [77, "v1", "float"], + ["_stack_", 32, "float"] + ], + "(method 20 lightning-bolt)": [ + [15, "v1", "float"], + [32, "v1", "float"] + ], + "(method 17 lightning-bolt)": [[36, "v1", "float"]], + "(method 11 lightning-bolt)": [ + ["_stack_", 24, "float"], + ["_stack_", 40, "float"], + ["_stack_", 68, "float"], + ["_stack_", 72, "float"] + ], + "(method 16 lightning-bolt)": [["_stack_", 176, "rgba"]], + "(method 28 nav-mesh)": [[[22, 78], "s4", "nav-engine"]], + "(method 12 nav-engine)": [ + [[22, 28], "v1", "connection"], + [[29, 31], "a0", "process-focusable"], + [[34, 86], "s2", "collide-shape"], + [90, "v1", "collide-shape-prim-group"], + [110, "s2", "collide-shape-prim-sphere"] + ], + "(method 13 nav-engine)": [ + [[53, 65], "s4", "nav-mesh"], + [[38, 50], "s3", "nav-mesh"] + ], + "nav-control-validate": [ + [29, "s5", "int"], + [29, "v1", "int"] + ], + "connection-list-validate": [[5, "gp", "connection"]], + "(method 25 nav-mesh)": [ + [16, "v0", "(inline-array sphere)"], + ["_stack_", 16, "res-tag"] + ], + "(method 46 nav-mesh)": [["_stack_", 28, "float"]], + "(method 48 nav-mesh)": [ + [15, "v1", "entity-nav-mesh"], + [[34, 43], "v1", "nav-mesh-link"] + ], + "compute-dir-parm": [ + [18, "f0", "float"], + [8, "a2", "uint"], + [10, "v1", "float"] + ], + "(method 18 nav-control)": [ + [252, "a2", "float"], + [250, "a3", "uint"], + [250, "t0", "uint"] + ], + "(code hit nav-enemy)": [[30, "v1", "art-joint-anim"]], + "(code active nav-enemy)": [ + [30, "v1", "art-joint-anim"], + [127, "v1", "art-joint-anim"], + [189, "v1", "art-joint-anim"], + [298, "v1", "art-joint-anim"] + ], + "(code notice nav-enemy)": [[31, "v1", "art-joint-anim"]], + "(enter notice nav-enemy)": [ + [21, "a0", "process-focusable"], + [24, "a0", "process-focusable"] + ], + "(code taunt nav-enemy)": [[84, "v1", "art-joint-anim"]], + "(code pacing nav-enemy)": [[34, "gp", "art-joint-anim"]], + "(trans pacing nav-enemy)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(enter circling nav-enemy)": [ + [69, "gp", "process-focusable"], + [73, "a0", "process-focusable"], + [72, "gp", "process-focusable"] + ], + "(code circling nav-enemy)": [[34, "gp", "art-joint-anim"]], + "(trans circling nav-enemy)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(enter pacing nav-enemy)": [ + [103, "gp", "process-focusable"], + [107, "a0", "process-focusable"], + [106, "gp", "process-focusable"] + ], + "(enter taunt nav-enemy)": [ + [37, "gp", "process-focusable"], + [41, "a0", "process-focusable"], + [40, "gp", "process-focusable"] + ], + "(code stare nav-enemy)": [[23, "gp", "art-joint-anim"]], + "nav-enemy-stare-post": [ + [24, "a0", "process-focusable"], + [27, "a0", "process-focusable"] + ], + "nav-enemy-face-focus-post": [ + [24, "a0", "process-focusable"], + [27, "a0", "process-focusable"] + ], + "nav-enemy-flee-post": [ + [18, "a0", "process-focusable"], + [21, "a0", "process-focusable"] + ], + "nav-enemy-chase-post": [ + [15, "a0", "process-focusable"], + [18, "a0", "process-focusable"] + ], + "(method 119 nav-enemy)": [ + [78, "s5", "nav-enemy-info"], + ["_stack_", 16, "res-tag"] + ], + "(method 118 nav-enemy)": [[3, "a1", "nav-enemy-info"]], + "(method 59 nav-enemy)": [ + [57, "a0", "process-focusable"], + [60, "a0", "process-focusable"] + ], + "(method 167 nav-enemy)": [ + [17, "v1", "process-focusable"], + [21, "a0", "process-focusable"], + [20, "v1", "process-focusable"] + ], + "(method 171 nav-enemy)": [ + [18, "s5", "process-focusable"], + [35, "s5", "process-focusable"], + [39, "a0", "process-focusable"], + [38, "s5", "process-focusable"] + ], + "(method 172 nav-enemy)": [ + [22, "v1", "process-focusable"], + [26, "a0", "process-focusable"], + [25, "v1", "process-focusable"] + ], + "(method 16 nav-mesh)": [ + [27, "v1", "int"], + [22, "v1", "int"], + [24, "a0", "int"], + [26, "a0", "int"] + ], + "(method 15 nav-mesh)": [ + [18, "v1", "int"], + [20, "a2", "int"], + [22, "a2", "int"] + ], + "(code active monster-frog)": [ + [27, "v1", "art-joint-anim"], + [80, "v1", "art-joint-anim"], + [172, "v1", "art-joint-anim"], + [234, "v1", "art-joint-anim"], + [343, "v1", "art-joint-anim"] + ], + "(code attack-recover monster-frog)": [ + [10, "v1", "art-joint-anim"], + [87, "v1", "art-joint-anim"], + [158, "v1", "art-joint-anim"] + ], + "(code attack monster-frog)": [[19, "v1", "art-joint-anim"]], + "(method 85 monster-frog)": [ + [19, "v1", "art-joint-anim"], + [54, "v1", "art-joint-anim"], + [89, "v1", "art-joint-anim"], + [121, "v1", "art-joint-anim"] + ], + "(method 86 monster-frog)": [ + [19, "v1", "art-joint-anim"], + [54, "v1", "art-joint-anim"], + [89, "v1", "art-joint-anim"], + [121, "v1", "art-joint-anim"] + ], + "(post turn monster-frog)": [ + [24, "a0", "process-focusable"], + [27, "a0", "process-focusable"] + ], + "(code turn monster-frog)": [ + [21, "v1", "art-joint-anim"], + [79, "v1", "art-joint-anim"] + ], + "(code hostile monster-frog)": [ + [16, "gp", "process-focusable"], + [117, "v1", "art-joint-anim"], + [202, "v1", "art-joint-anim"] + ], + "(code notice monster-frog)": [ + [23, "v1", "art-joint-anim"], + [71, "v1", "art-joint-anim"], + [103, "a0", "process-focusable"], + [106, "a0", "process-focusable"], + [149, "v1", "art-joint-anim"] + ], + "(code ambush monster-frog)": [ + [21, "a0", "process-focusable"], + [24, "a0", "process-focusable"], + [68, "v1", "art-joint-anim"] + ], + "monster-frog-hop-fast-code": [ + [15, "v1", "art-joint-anim"], + [72, "v1", "art-joint-anim"] + ], + "monster-frog-hop-slow-code": [ + [231, "v1", "art-joint-anim"], + [288, "v1", "art-joint-anim"], + [46, "v1", "art-joint-anim"], + [117, "v1", "art-joint-anim"] + ], + "update-mood-mineb": [ + [41, "f0", "float"], + [45, "f0", "float"] + ], + "(code extended min-bridge)": [[10, "v1", "art-joint-anim"]], + "(code extend min-bridge)": [[49, "v1", "art-joint-anim"]], + "(code extended min-folding-plat)": [[15, "v1", "art-joint-anim"]], + "(code extend min-folding-plat)": [[44, "v1", "art-joint-anim"]], + "(method 11 min-falling-step)": [["_stack_", 16, "res-tag"]], + "(method 11 rat-spawner)": [["_stack_", 16, "res-tag"]], + "(method 0 flow-control)": [["_stack_", 16, "res-tag"]], + "(code lowered min-falling-step)": [[18, "v1", "art-joint-anim"]], + "(code lowering min-falling-step)": [[65, "v1", "art-joint-anim"]], + "(code idle min-falling-step)": [[28, "v1", "art-joint-anim"]], + "(code resetting min-falling-elevator)": [[25, "v1", "art-joint-anim"]], + "(code falling min-falling-elevator)": [[10, "v1", "art-joint-anim"]], + "(code unstable min-falling-elevator)": [ + [36, "v1", "art-joint-anim"], + [88, "v1", "art-joint-anim"] + ], + "(trans active min-moving-plat-spooler)": [[12, "v0", "sound-rpc-set-param"]], + "min-ramp-callback": [[6, "v1", "min-ramp"]], + "(post arrived min-falling-elevator)": [[4, "t9", "(function none)"]], + "(post running min-falling-elevator)": [[4, "t9", "(function none)"]], + "min-falling-elevator-callback": [[[3, 31], "v1", "min-falling-elevator"]], + "(post running min-boss-elev)": [[50, "t9", "(function none)"]], + "(code open min-elev-doors)": [[25, "v1", "art-joint-anim"]], + "(post waiting min-bomb-elevator)": [[4, "t9", "(function none)"]], + "(post running min-bomb-elevator)": [ + [4, "t9", "(function none)"], + [15, "v1", "process-drawable"] + ], + "(code lowering min-target-sign)": [[15, "v1", "art-joint-anim"]], + "(code running min-rat-engine)": [ + [10, "v1", "art-joint-anim"], + [139, "v1", "art-joint-anim"], + [114, "a0", "entity-actor"], + [118, "a0", "entity-actor"] + ], + "(code shutdown min-rat-engine)": [[14, "v1", "art-joint-anim"]], + "(enter shutdown min-rat-engine)": [[2, "v1", "collide-shape-prim-group"]], + "(event idle min-target-sign)": [[[6, 42], "gp", "touching-shapes-entry"]], + "(method 11 min-target-sign)": [ + [62, "v1", "collide-shape-prim-group"], + [[65, 71], "v1", "collide-shape-prim-group"] + ], + "(method 11 min-rat-engine)": [["_stack_", 16, "res-tag"]], + "(method 21 min-target-sign)": [[[21, 25], "gp", "collide-shape-prim-group"]], + "min-bomb-elevator-callback": [[[3, 31], "v1", "min-bomb-elevator"]], + "(enter running min-rat-engine)": [[68, "v1", "collide-shape-prim-group"]], + "mineb-activate": [ + ["_stack_", 16, "res-tag"], + [17, "v0", "(pointer actor-group)"], + [41, "a0", "entity-actor"], + [45, "a0", "entity-actor"] + ], + "(event up-idle basebutton)": [ + [4, "v1", "attack-info"], + [32, "v1", "attack-info"], + [37, "v1", "attack-info"] + ], + "(method 34 basebutton)": [[35, "v1", "art-joint-anim"]], + "(method 34 min-crane-switch)": [[35, "v1", "art-joint-anim"]], + "joint-mod-rat-engine-callback": [[6, "v1", "min-rat-engine"]], + "(method 27 min-rat-engine)": [[14, "a2", "process-focusable"]], + "(method 11 rat-light-manager)": [["_stack_", 16, "res-tag"]], + "(code idle manta)": [ + [100, "v1", "art-joint-anim"], + [46, "v1", "art-joint-anim"] + ], + "manta-fly-code": [ + [168, "v1", "art-joint-anim"], + [196, "v1", "art-joint-anim"] + ], + "(code ambush manta)": [ + [30, "v1", "art-joint-anim"], + [82, "v1", "art-joint-anim"] + ], + "(code notice-to-fly manta)": [ + [14, "v1", "art-joint-anim"], + [95, "v1", "art-joint-anim"] + ], + "(code attack manta)": [ + [17, "v1", "art-joint-anim"], + [113, "v1", "art-joint-anim"], + [173, "v1", "art-joint-anim"], + [225, "v1", "art-joint-anim"] + ], + "(code knocked-recover manta)": [[16, "v1", "art-joint-anim"]], + "(exit attack-end manta)": [[2, "v1", "collide-shape-prim-group"]], + "(code attack-end manta)": [[16, "v1", "art-joint-anim"]], + "(enter attack-end manta)": [[3, "a0", "collide-shape-prim-group"]], + "(code land manta)": [ + [105, "v1", "art-joint-anim"], + [161, "v1", "art-joint-anim"], + [41, "v1", "art-joint-anim"] + ], + "(method 50 manta)": [ + [10, "v1", "collide-shape-prim-group"], + [34, "v1", "collide-shape-prim-group"] + ], + "(method 87 manta)": [[43, "v1", "art-joint-anim"]], + "(method 85 manta)": [ + [22, "v1", "art-joint-anim"], + [58, "v1", "art-joint-anim"], + [91, "v1", "art-joint-anim"] + ], + "(method 86 manta)": [[19, "v1", "art-joint-anim"]], + "(method 200 manta)": [ + [34, "a0", "connection"], + [35, "a0", "collide-shape"], + [83, "a0", "connection"], + [84, "a0", "collide-shape"] + ], + "(method 205 manta)": [ + [15, "a0", "process-focusable"], + [18, "a0", "process-focusable"] + ], + "(method 121 manta)": [["_stack_", 16, "res-tag"]], + "(code wheel-die rat)": [[14, "v1", "art-joint-anim"]], + "rat-joint-mod-roll": [[9, "gp", "rat"]], + "(code running-in-wheel rat)": [ + [14, "v1", "art-joint-anim"], + [72, "v1", "art-joint-anim"] + ], + "(enter running-in-wheel rat)": [ + [47, "v1", "collide-shape-prim-group"], + [53, "v1", "collide-shape-prim-group"] + ], + "(code knocked-recover rat)": [ + [38, "v1", "art-joint-anim"], + [59, "v1", "ragdoll-proc"], + [137, "v1", "art-joint-anim"], + [233, "v1", "art-joint-anim"] + ], + "(code stare rat)": [[91, "v1", "art-joint-anim"]], + "(code flee-stare rat)": [[91, "v1", "art-joint-anim"]], + "(code attack rat)": [[14, "v1", "art-joint-anim"]], + "(code wait-by-wheel-wait rat)": [[91, "v1", "art-joint-anim"]], + "(code notice rat)": [ + [22, "v1", "art-joint-anim"], + [80, "v1", "art-joint-anim"], + [203, "v1", "art-joint-anim"], + [140, "v1", "art-joint-anim"] + ], + "(code active-turn rat)": [ + [30, "v1", "art-joint-anim"], + [83, "v1", "art-joint-anim"] + ], + "(code active rat)": [[29, "v1", "art-joint-anim"]], + "rat-run-code": [[14, "v1", "art-joint-anim"]], + "(code ambush rat)": [ + [14, "v1", "art-joint-anim"], + [86, "v1", "art-joint-anim"], + [189, "v1", "art-joint-anim"] + ], + "(post idle rat-spawner)": [[103, "v0", "vector"]], + "(method 59 rat)": [ + [15, "a0", "process-focusable"], + [18, "a0", "process-focusable"] + ], + "(method 50 rat)": [ + [5, "v1", "collide-shape-prim-group"], + [20, "v1", "collide-shape-prim-group"] + ], + "(method 82 rat)": [[93, "v0", "vector"]], + "min-bomb-train-callback": [[[3, 31], "v1", "min-bomb-train"]], + "(code active min-bomb-train)": [ + [18, "gp", "task-manager"], + [21, "gp", "task-manager"], + [16, "s5", "task-manager"] + ], + "(event active min-bomb-train)": [ + [18, "v1", "collide-shape-prim-group"], + [[10, 29], "s4", "touching-shapes-entry"], + [37, "gp", "process-focusable"], + [49, "s3", "attack-info"], + [68, "v1", "touching-shapes-entry"], + [163, "v1", "task-manager"] + ], + "(trans wait min-bomb-train)": [ + [11, "v0", "string"], + [13, "a0", "string"] + ], + "(method 38 min-bomb-train)": [ + [105, "v1", "task-manager"], + [118, "v1", "task-manager"], + [121, "v1", "task-manager"], + [132, "v1", "task-manager"], + [211, "v1", "task-manager"], + [234, "v1", "task-manager"] + ], + "(code resolution task-manager)": [[40, "gp", "handle"]], + "(method 31 task-manager)": [[[15, 259], "v0", "resetter-spec"]], + "(anon-function 67 task-control)": [ + [3, "s4", "pair"], + [4, "s4", "pair"], + [5, "a0", "pair"], + [6, "s4", "pair"], + [7, "a0", "pair"], + [8, "a0", "pair"], + [9, "s4", "pair"], + [10, "a0", "pair"], + [11, "a0", "pair"], + [12, "a0", "pair"], + [13, "v1", "symbol"], + [20, "s4", "pair"], + [21, "a0", "pair"], + [24, "v1", "level-load-info"], + [29, "a0", "pair"], + [33, "v1", "level-load-info"], + [38, "v1", "level-load-info"], + [43, "gp", "pair"], + [42, "gp", "pair"] + ], + "play-task": [[89, "v1", "pair"]], + "fail-mission": [ + [149, "s4", "game-task-node-info"], + [152, "s4", "game-task-node-info"], + [158, "s4", "game-task-node-info"], + [198, "s4", "game-task-node-info"], + [196, "s4", "game-task-node-info"], + [197, "s4", "game-task-node-info"], + [13, "v1", "connection"], + [17, "a0", "task-manager"], + [20, "a0", "task-manager"] + ], + "restart-mission": [ + [144, "s5", "game-task-node-info"], + [150, "s5", "game-task-node-info"], + [153, "s5", "game-task-node-info"], + [159, "s5", "game-task-node-info"], + [13, "v1", "connection"], + [17, "a0", "task-manager"], + [20, "a0", "task-manager"] + ], + "(method 11 min-bomb-train)": [["_stack_", 16, "res-tag"]], + "(code hostile-wall gekko)": [ + [20, "v1", "art-joint-anim"], + [70, "v1", "art-joint-anim"] + ], + "(code active-wall gekko)": [[14, "v1", "art-joint-anim"]], + "(code attack-wall gekko)": [ + [126, "v1", "art-joint-anim"], + [191, "v1", "art-joint-anim"] + ], + "(code jump-off-wall-falling gekko)": [[14, "v1", "art-joint-anim"]], + "gekko-stare-code": [[76, "v1", "art-joint-anim"]], + "(code flee gekko)": [ + [24, "v1", "art-joint-anim"], + [72, "v1", "art-joint-anim"] + ], + "(code attack gekko)": [ + [14, "v1", "art-joint-anim"], + [106, "v1", "art-joint-anim"], + [180, "v1", "art-joint-anim"] + ], + "(exit attack gekko)": [[31, "v1", "collide-shape-prim-group"]], + "(code turn gekko)": [ + [34, "v1", "art-joint-anim"], + [83, "v1", "art-joint-anim"] + ], + "(code turn-quick gekko)": [ + [14, "v1", "art-joint-anim"], + [82, "v1", "art-joint-anim"] + ], + "(enter knocked gekko)": [[42, "v1", "ragdoll-proc"]], + "(post knocked gekko)": [[4, "t9", "(function none)"]], + "(post knocked-recover gekko)": [[4, "t9", "(function none)"]], + "gekko-postbind": [ + [[3, 476], "gp", "gekko"], + ["_stack_", 560, "float"], + ["_stack_", 980, "gekko-foot-info"] + ], + "gekko-foot-rot-handler": [[2, "v1", "gekko"]], + "(code knocked-recover gekko)": [ + [19, "v1", "art-joint-anim"], + [48, "v1", "ragdoll-proc"] + ], + "(enter attack gekko)": [[30, "v1", "collide-shape-prim-group"]], + "(code hostile gekko)": [ + [22, "v1", "art-joint-anim"], + [75, "v1", "art-joint-anim"] + ], + "(code active gekko)": [ + [328, "v1", "art-joint-anim"], + [382, "v1", "art-joint-anim"], + [77, "v1", "art-joint-anim"] + ], + "(code jump-off-wall gekko)": [[14, "v1", "art-joint-anim"]], + "(post knocked-wall gekko)": [[3, "t9", "(function none)"]], + "(code turn-wall gekko)": [[46, "v1", "art-joint-anim"]], + "(code jump-off-wall-recover gekko)": [ + [13, "v1", "art-joint-anim"], + [71, "v1", "art-joint-anim"] + ], + "(method 50 gekko)": [ + [8, "v1", "collide-shape-prim-group"], + [12, "a0", "collide-shape-prim-group"], + [24, "v1", "collide-shape-prim-group"], + [35, "v1", "collide-shape-prim-group"], + [39, "a0", "collide-shape-prim-group"] + ], + "(method 59 gekko)": [ + [15, "a0", "process-focusable"], + [18, "a0", "process-focusable"] + ], + "(method 125 gekko)": [ + [15, "a0", "ragdoll-proc"], + [17, "a0", "ragdoll-proc"], + [28, "s5", "ragdoll-proc"], + [50, "s5", "ragdoll-proc"], + [11, "s5", "ragdoll-proc"], + [14, "s5", "ragdoll-proc"] + ], + "(method 86 gekko)": [ + [23, "a2", "art-joint-anim"], + [55, "a2", "art-joint-anim"], + [84, "a2", "art-joint-anim"] + ], + "(method 85 gekko)": [ + [19, "v1", "art-joint-anim"], + [47, "v1", "art-joint-anim"] + ], + "(method 108 gekko)": [[19, "v1", "process-focusable"]], + "(method 11 basebutton)": [["_stack_", 16, "res-tag"]], + "clmf-cam-string": [["_stack_", 16, "res-tag"]], + "(code knocked-recover grunt)": [ + [15, "v1", "ragdoll-proc"], + [40, "v1", "art-joint-anim"], + [69, "v1", "art-joint-anim"], + [130, "a0", "ragdoll-proc"], + [132, "a0", "ragdoll-proc"] + ], + "(trans wait-for-focus grunt)": [ + [13, "s5", "process-focusable"], + [40, "s5", "process-focusable"] + ], + "(code stop-chase grunt)": [[77, "gp", "art-joint-anim"]], + "(code pacing grunt)": [[145, "gp", "art-joint-anim"]], + "(code circling grunt)": [ + [260, "v1", "art-joint-anim"], + [308, "v1", "art-joint-anim"], + [153, "gp", "art-joint-anim"] + ], + "(code spin-attack grunt)": [ + [45, "gp", "art-joint-anim"], + [73, "a0", "process-focusable"], + [76, "a0", "process-focusable"] + ], + "(enter spin-attack grunt)": [ + [43, "gp", "process-focusable"], + [47, "a0", "process-focusable"], + [46, "gp", "process-focusable"] + ], + "(code attack grunt)": [ + [55, "gp", "art-joint-anim"], + [155, "a0", "grunt-global-info"] + ], + "(code hostile grunt)": [[122, "gp", "art-joint-anim"]], + "(code active grunt)": [ + [143, "gp", "art-joint-anim"], + [227, "gp", "art-joint-anim"], + [271, "gp", "art-joint-anim"], + [354, "v1", "art-joint-anim"], + [414, "v1", "art-joint-anim"] + ], + "(code falling-ambush grunt)": [[53, "v1", "art-joint-anim"]], + "setup-blerc-chains": [ + [43, "v1", "int"], + [80, "s0", "int"], + [83, "a0", "int"], + [[30, 40], "s1", "merc-fragment-control"], + [41, "v1", "merc-fragment"], + [46, "v1", "(pointer uint8)"], + [59, "a0", "merc-blend-ctrl"], + [[64, 76], "s1", "merc-fragment-control"], + [77, "a1", "merc-blend-ctrl"], + [106, "v1", "(pointer uint32)"], + [108, "v1", "(pointer uint32)"] + ], + "(method 26 battle)": [ + [35, "a0", "connection"], + [36, "a0", "collide-shape"], + [84, "a0", "connection"], + [85, "a0", "collide-shape"] + ], + "(method 30 battle)": [ + [7, "s5", "nav-enemy"], + [32, "a2", "nav-enemy"] + ], + "(method 51 battle)": [ + [38, "s4", "nav-enemy"], + [53, "s4", "nav-enemy"] + ], + "(method 28 battle)": [ + [21, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(method 29 battle)": [ + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"] + ], + "part-wascityb-bird1-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "part-wascityb-bird2-path": [ + [13, "v1", "int"], + [86, "a0", "part-spawner"] + ], + "part-wascityb-bird3-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "part-wascityb-bird4-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "part-wascityb-bird5-path": [ + [13, "v1", "int"], + [86, "a0", "part-spawner"] + ], + "part-wascityb-bird6-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "part-wascityb-bird7-path": [ + [13, "v1", "int"], + [86, "a0", "part-spawner"] + ], + "part-wascityb-bird8-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "part-wascityb-bird9-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "part-wascityb-bird10-path": [ + [13, "v1", "int"], + [86, "a0", "part-spawner"] + ], + "part-wascitya-fly1-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "part-wascitya-fly2-path": [ + [13, "v1", "int"], + [86, "a0", "part-spawner"] + ], + "part-wascitya-fly3-path": [ + [13, "v1", "int"], + [90, "a0", "part-spawner"] + ], + "(event idle market-object)": [ + [[6, 10], "a1", "attack-info"], + [16, "a1", "attack-info"] + ], + "fruit-stand-event-handler": [ + [4, "gp", "attack-info"], + [32, "gp", "attack-info"] + ], + "fruit-check-ground-bounce": [ + [5, "v1", "fruit-stand"], + [[9, 40], "v1", "fruit-stand"], + [8, "a0", "fruit-stand"] + ], + "(event idle wascity-cactus)": [[[7, 17], "a1", "attack-info"]], + "wascity-cactus-callback": [ + [[9, 39], "s4", "wascity-cactus"], + [10, "s3", "int"], + [12, "s3", "int"], + [25, "s3", "int"], + [30, "s3", "int"], + [37, "s3", "int"] + ], + "(method 35 monk-npc)": [ + [23, "v1", "int"], + [23, "a0", "int"], + [27, "a0", "int"] + ], + "(method 37 monk-npc)": [ + [6, "v1", "int"], + [6, "a1", "int"], + [10, "a1", "int"] + ], + "(enter die market-object)": [ + [118, "v0", "(state symbol int market-object)"] + ], + "(method 50 dogat)": [ + [5, "v1", "collide-shape-prim-group"], + [18, "v1", "collide-shape-prim-group"] + ], + "(code active dogat)": [[14, "v1", "art-joint-anim"]], + "(code sit-idle dogat)": [ + [155, "v1", "art-joint-anim"], + [88, "v1", "art-joint-anim"], + [21, "v1", "art-joint-anim"] + ], + "(method 62 vehicle)": [[8, "v1", "collide-shape-prim-group"]], + "(method 115 vehicle)": [ + [19, "s4", "process-focusable"], + [26, "s4", "process-focusable"], + [31, "s4", "process-focusable"], + [44, "s4", "process-focusable"] + ], + "(trans fly-to-dest prebot-large-eco-creature)": [[300, "v1", "float"]], + "(event fly-to-dest prebot-large-eco-creature)": [ + [5, "v1", "attack-info"], + [10, "v1", "attack-info"], + [128, "s5", "vector"], + [129, "gp", "vector"], + [131, "gp", "vector"], + [132, "s5", "vector"], + [125, "v1", "float"], + [127, "v1", "float"], + [156, "gp", "vector"], + [157, "s5", "vector"], + [201, "s5", "vector"], + [205, "s5", "vector"], + [209, "s5", "vector"], + [214, "gp", "vector"] + ], + "(code victory prebot-large-eco-creature)": [[42, "v1", "art-joint-anim"]], + "(trans hostile prebot-large-eco-creature)": [ + [27, "a0", "process-focusable"], + [30, "a0", "process-focusable"] + ], + "(method 82 prebot-large-eco-creature)": [ + [10, "s4", "attack-info"], + [15, "s4", "attack-info"], + [63, "s4", "attack-info"], + [67, "s4", "attack-info"], + [71, "s4", "attack-info"] + ], + "large-eco-creature-split": [ + [83, "a0", "prebot-large-eco-creature"], + [86, "a0", "prebot-medium-eco-creature"], + [95, "a0", "prebot-medium-eco-creature"], + [97, "a0", "prebot-medium-eco-creature"], + [90, "a1", "prebot-medium-eco-creature"], + [93, "a0", "prebot-medium-eco-creature"], + [142, "a0", "prebot-medium-eco-creature"], + [145, "a0", "prebot-medium-eco-creature"], + [154, "a0", "prebot-medium-eco-creature"], + [156, "a0", "prebot-medium-eco-creature"], + [149, "a1", "prebot-medium-eco-creature"], + [152, "a0", "prebot-medium-eco-creature"], + [[77, 95], "v1", "(pointer prebot-medium-eco-creature)"], + [64, "v1", "(pointer prebot-medium-eco-creature)"], + [[123, 154], "v1", "(pointer prebot-medium-eco-creature)"] + ], + "prebot-eco-creature-joint-callback": [ + [1, "v1", "float"], + [[17, 27], "a2", "float"] + ], + "(code knocked-recover prebot-medium-eco-creature)": [ + [34, "gp", "art-joint-anim"], + [61, "v1", "ragdoll-proc"], + [102, "gp", "art-joint-anim"], + [166, "t9", "(function none)"] + ], + "prebot-tentacle-init-by-other": [[121, "a0", "prebot"]], + "prebot-gun-init-by-other": [[120, "a0", "prebot"]], + "prebot-sword-init-by-other": [ + [103, "a0", "prebot"], + [202, "s5", "weapon-trail-tracker"], + [205, "s5", "weapon-trail-tracker"] + ], + "prebot-eco-pillar-init-by-other": [[346, "v1", "float"]], + "(code impact prebot-gun-shot)": [[39, "a0", "process"]], + "(trans idle prebot-sword)": [[94, "a1", "prebot"]], + "(event idle prebot-sword)": [ + [67, "gp", "process-drawable"], + [76, "v1", "float"], + [88, "v1", "float"] + ], + "(method 11 cav-railblocker)": [ + [97, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(enter fall cav-railblocker)": [[74, "a0", "process"]], + "(event idle cav-railblocker)": [ + [29, "v1", "attack-info"], + [34, "v1", "attack-info"], + [43, "v1", "attack-info"], + [46, "v1", "attack-info"], + [49, "v1", "attack-info"], + [52, "v1", "attack-info"] + ], + "(method 30 cav-railblocker)": [[21, "v1", "float"]], + "prebot-spawn-shockwave": [[42, "v1", "process-drawable"]], + "prebot-handler": [[202, "a1", "vector"]], + "prebot-go-next-stage": [ + [27, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(trans play-hit-movie prebot)": [[86, "v0", "entity-actor"]], + "(trans destroy-pillars prebot)": [[241, "gp", "process-drawable"]], + "prebot-setup-shot-offsets": [ + [13, "v1", "float"], + [33, "v1", "float"], + [49, "v1", "float"] + ], + "prebot-fire-tentacle": [[21, "v1", "prebot-tentacle"]], + "(trans watch-critters prebot)": [[47, "a0", "process-drawable"]], + "prebot-launch-critter": [ + [27, "s3", "process-drawable"], + [67, "s3", "process-drawable"], + [112, "s3", "process-drawable"] + ], + "set-mined-filter!": [[12, "v1", "mined-states"]], + "update-mood-mined": [[[15, 45], "s5", "mined-states"]], + "(code attacking-0 tentacle)": [[14, "v1", "art-joint-anim"]], + "(code kill-player tentacle)": [[14, "v1", "art-joint-anim"]], + "(code stop-chase kg-grunt)": [[77, "gp", "art-joint-anim"]], + "(code pacing kg-grunt)": [[145, "gp", "art-joint-anim"]], + "(method 86 kg-grunt)": [[22, "v1", "art-joint-anim"]], + "(trans wait-for-focus kg-grunt)": [ + [13, "s5", "process-focusable"], + [40, "s5", "process-focusable"] + ], + "(method 85 kg-grunt)": [ + [87, "s4", "art-joint-anim"], + [233, "a1", "art-joint-anim"], + [323, "s4", "art-joint-anim"] + ], + "(code circling kg-grunt)": [ + [260, "v1", "art-joint-anim"], + [308, "v1", "art-joint-anim"], + [153, "gp", "art-joint-anim"] + ], + "(code spin-attack kg-grunt)": [ + [45, "gp", "art-joint-anim"], + [73, "a0", "process-focusable"], + [76, "a0", "process-focusable"] + ], + "(enter spin-attack kg-grunt)": [ + [43, "gp", "process-focusable"], + [46, "gp", "process-focusable"] + ], + "(code attack kg-grunt)": [ + [55, "gp", "art-joint-anim"], + [[150, 156], "a0", "kg-grunt-anim-info"] + ], + "(code hostile kg-grunt)": [[122, "gp", "art-joint-anim"]], + "(code active kg-grunt)": [ + [227, "gp", "art-joint-anim"], + [271, "gp", "art-joint-anim"], + [354, "v1", "art-joint-anim"], + [414, "v1", "art-joint-anim"], + [143, "gp", "art-joint-anim"] + ], + "(method 82 kg-grunt)": [[144, "v1", "rigid-body-impact"]], + "(code falling-ambush kg-grunt)": [[53, "v1", "art-joint-anim"]], + "(method 38 sew-laser-shot)": [ + [33, "a0", "process-focusable"], + [36, "a0", "process-focusable"] + ], + "(code idle sew-gas-step)": [[14, "v1", "art-joint-anim"]], + "(event idle jump-pad)": [[[18, 25], "v1", "attack-info"]], + "jump-pad-joint-fan": [[[4, 15], "gp", "jump-pad"]], + "(post fire jump-pad)": [[28, "t9", "(function none)"]], + "(code going-down sew-floor-switch)": [ + [26, "v1", "art-joint-anim"], + [83, "v0", "pair"] + ], + "(event idle-up sew-floor-switch)": [[4, "v1", "attack-info"]], + "sew-fan-joint-floor": [[[7, 12], "s1", "sew-fan"]], + "sew-fan-joint-fan": [[[3, 20], "v1", "sew-fan"]], + "(method 82 sew-fan)": [[[46, 63], "v1", "attack-info"]], + "(method 11 sew-wall-switch)": [["_stack_", 16, "res-tag"]], + "(method 11 sew-pipe)": [["_stack_", 16, "res-tag"]], + "(enter down sew-pipe)": [[13, "v1", "art-joint-anim"]], + "(code lower sew-pipe)": [[83, "v1", "art-joint-anim"]], + "(enter raised sew-m-gate)": [[13, "v1", "art-joint-anim"]], + "(code open sew-m-gate)": [[80, "v1", "art-joint-anim"]], + "(code open sew-gate)": [[15, "v1", "art-joint-anim"]], + "(event idle sew-wall-switch)": [[4, "v1", "attack-info"]], + "(code open sew-wall-switch)": [[10, "v1", "art-joint-anim"]], + "(code closing sew-fence-gate)": [[19, "v1", "art-joint-anim"]], + "(code opening sew-fence-gate)": [[18, "v1", "art-joint-anim"]], + "(code open sew-fence-gate)": [[10, "v1", "art-joint-anim"]], + "(code active sew-move-turret)": [[109, "v1", "art-joint-anim"]], + "(method 162 sew-laser-turret)": [ + [41, "v1", "process-focusable"], + [45, "v1", "process-focusable"], + [49, "v1", "process-focusable"] + ], + "(trans alert sew-laser-turret)": [ + [181, "a2", "process-focusable"], + [185, "a2", "process-focusable"], + [189, "a2", "process-focusable"] + ], + "check-enemy": [ + [19, "a0", "collide-shape-moving"], + [17, "a0", "collide-shape-moving"] + ], + "(code saberfish-sitting-on-land saberfish)": [[10, "v1", "art-joint-anim"]], + "(code saberfish-crawl-out-of-tube saberfish)": [ + [37, "v1", "art-joint-anim"] + ], + "(code stare-idle saberfish)": [[22, "v1", "art-joint-anim"]], + "(code attack saberfish)": [ + [17, "v1", "art-joint-anim"], + [190, "v1", "art-joint-anim"], + [130, "v1", "art-joint-anim"] + ], + "(code water-land saberfish)": [[16, "v1", "art-joint-anim"]], + "(code active saberfish)": [[40, "v1", "art-joint-anim"]], + "(code water-impact saberfish)": [[16, "v1", "art-joint-anim"]], + "(enter water-impact saberfish)": [[5, "t9", "(function none)"]], + "(code knocked-recover saberfish)": [ + [23, "v1", "ragdoll-proc"], + [43, "v1", "art-joint-anim"], + [83, "v1", "art-joint-anim"] + ], + "(code knocked-recover-water saberfish)": [ + [23, "v1", "ragdoll-proc"], + [49, "v1", "art-joint-anim"] + ], + "(method 50 saberfish)": [ + [5, "v1", "collide-shape-prim-group"], + [20, "v1", "collide-shape-prim-group"] + ], + "(code diving-into-water saberfish)": [ + [15, "gp", "art-joint-anim"], + [30, "gp", "art-joint-anim"] + ], + "(code transition-terrain-jump-from-water)": [[14, "v1", "art-joint-anim"]], + "(code transition-terrain-jump-from-land)": [[43, "v1", "art-joint-anim"]], + "saberfish-chase-post": [ + [13, "a0", "process-focusable"], + [16, "a0", "process-focusable"] + ], + "(trans hostile saberfish)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(enter swimming-hostile saberfish)": [ + [8, "t9", "(function none)"], + [24, "a0", "process-focusable"], + [27, "a0", "process-focusable"] + ], + "turbo-swim": [[14, "v1", "art-joint-anim"]], + "(code transition-terrain-move-towards-initial-jump saberfish)": [ + [14, "t9", "(function none)"] + ], + "(method 241 saberfish)": [[11, "v1", "ragdoll-proc"]], + "(method 240 saberfish)": [ + [13, "s5", "ragdoll-proc"], + [19, "s5", "ragdoll-proc"], + [22, "s5", "ragdoll-proc"] + ], + "(method 125 saberfish)": [ + [14, "s5", "ragdoll-proc"], + [35, "s5", "ragdoll-proc"], + [57, "s5", "ragdoll-proc"] + ], + "(method 242 saberfish)": [[43, "a2", "ragdoll-proc"]], + "(trans swimming-hostile saberfish)": [ + [20, "s5", "process-focusable"], + [118, "a0", "process-focusable"], + [144, "v1", "float"] + ], + "(method 231 saberfish)": [ + ["_stack_", 72, "float"], + ["_stack_", 76, "float"], + ["_stack_", 84, "float"] + ], + "(method 97 saberfish)": [[20, "a1", "art-joint-anim"]], + "(method 96 saberfish)": [[16, "a1", "art-joint-anim"]], + "(method 98 saberfish)": [[22, "a1", "art-joint-anim"]], + "(method 237 saberfish)": [[21, "v0", "saberfish-spawner-query-msg"]], + "(method 238 saberfish)": [ + ["_stack_", 196, "float"], + ["_stack_", 252, "float"], + ["_stack_", 256, "float"], + ["_stack_", 528, "float"], + ["_stack_", 532, "float"] + ], + "(method 82 saberfish)": [[[8, 29], "s5", "saberfish-spawner-query-msg"]], + "(method 225 saberfish)": [[6, "v1", "vector"]], + "(method 220 saberfish)": [ + [17, "s4", "process-focusable"], + [21, "s4", "process-focusable"], + [26, "s4", "process-focusable"], + [45, "s4", "process-focusable"], + [48, "s4", "process-focusable"] + ], + "(method 216 saberfish)": [[154, "v1", "process-focusable"]], + "(method 214 saberfish)": [[18, "v1", "collide-shape-prim-group"]], + "(method 215 saberfish)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(method 24 saberfish-spawner)": [["_stack_", 48, "float"]], + "(method 11 saberfish-spawner)": [ + [194, "v0", "vector"], + ["_stack_", 16, "res-tag"] + ], + "(method 11 saberfish-spawn-manager-base)": [["_stack_", 16, "res-tag"]], + "(method 26 saberfish-spawner)": [ + [[9, 49], "gp", "saberfish-spawner-query-msg"], + [[77, 85], "v1", "saberfish-spawner-command"], + [161, "v1", "saberfish-spawn-query"], + [[111, 164], "v1", "saberfish-spawn-query"], + [[105, 108], "v1", "saberfish-spawn-query"], + [[139, 149], "a2", "saberfish"] + ], + "saberfish-mgr-event-handler": [ + [[19, 28], "gp", "saberfish-spawner-query-msg"] + ], + "(method 97 kg-hopper)": [[16, "a1", "art-joint-anim"]], + "(method 96 kg-hopper)": [[16, "a1", "art-joint-anim"]], + "(method 98 kg-hopper)": [[16, "a1", "art-joint-anim"]], + "(method 85 kg-hopper)": [ + [33, "a1", "art-joint-anim"], + [86, "a1", "art-joint-anim"] + ], + "(method 86 kg-hopper)": [[27, "v1", "art-joint-anim"]], + "(trans hostile kg-hopper)": [ + [24, "gp", "process-focusable"], + [153, "gp", "process-focusable"], + [156, "gp", "process-focusable"] + ], + "set-sewg-electricity-scale!": [[[10, 14], "v1", "sewg-states"]], + "set-sewh-electricity-scale!": [[[12, 15], "v1", "sewh-states"]], + "update-mood-sewc": [[[17, 86], "gp", "sewc-states"]], + "update-mood-sewd": [[[17, 86], "gp", "sewd-states"]], + "update-mood-sewg": [[[17, 79], "gp", "sewg-states"]], + "update-mood-sewj": [[[17, 71], "gp", "sewj-states"]], + "update-mood-sewh": [[[17, 64], "gp", "sewh-states"]], + "(method 18 hfragment)": [["_stack_", 76, "float"]], + "(method 19 hfragment)": [[14, "a1", "hfrag-vertex"]], + "(code attack neo-juicer)": [ + [14, "v1", "art-joint-anim"], + [87, "v1", "art-joint-anim"], + [123, "s3", "process-focusable"], + [281, "a0", "process-focusable"], + [284, "a0", "process-focusable"] + ], + "(code victory neo-juicer)": [[31, "gp", "art-joint-anim"]], + "(code notice neo-juicer)": [ + [24, "a0", "process-focusable"], + [27, "a0", "process-focusable"], + [83, "a1", "art-joint-anim"] + ], + "(code active neo-juicer)": [ + [118, "gp", "art-joint-anim"], + [201, "a1", "art-joint-anim"] + ], + "(method 194 neo-juicer)": [ + [21, "s3", "process-focusable"], + [24, "s3", "process-focusable"] + ], + "neo-juicer-proj-move": [[15, "s5", "process-focusable"]], + "(method 38 neo-juicer-shot)": [ + [33, "a0", "process-focusable"], + [36, "a0", "process-focusable"] + ], + "(method 35 neo-juicer-shot)": [ + [7, "v1", "(inline-array vector)"], + [11, "v1", "(inline-array vector)"], + [16, "v1", "(inline-array vector)"], + [20, "v1", "(inline-array vector)"] + ], + "(post hostile neo-juicer)": [ + [13, "a0", "process-focusable"], + [16, "a0", "process-focusable"] + ], + "neo-juicer-face-player-post": [ + [29, "gp", "process-focusable"], + [66, "gp", "process-focusable"], + [69, "gp", "process-focusable"] + ], + "(code circling neo-juicer)": [ + [205, "gp", "art-joint-anim"], + [113, "gp", "art-joint-anim"] + ], + "(code hit neo-juicer)": [[30, "v1", "art-joint-anim"]], + "(code taunt neo-juicer)": [[84, "v1", "art-joint-anim"]], + "(code stare neo-juicer)": [[23, "gp", "art-joint-anim"]], + "(method 196 neo-juicer)": [[4, "v1", "collide-shape-prim-group"]], + "(method 85 neo-juicer)": [ + [37, "a1", "art-joint-anim"], + [113, "s5", "art-joint-anim"], + [153, "s4", "art-joint-anim"] + ], + "(method 86 neo-juicer)": [ + [18, "s4", "art-joint-anim"], + [66, "s4", "art-joint-anim"] + ], + "(code victory neo-grenadier)": [ + [27, "v1", "art-joint-anim"], + [76, "v1", "art-joint-anim"] + ], + "(code hit neo-grenadier)": [ + [87, "gp", "art-joint-anim"], + [208, "a0", "process-focusable"] + ], + "(post attack neo-grenadier)": [ + [22, "a0", "process-focusable"], + [25, "a0", "process-focusable"] + ], + "(method 78 neo-grenadier)": [[41, "a0", "process-focusable"]], + "(code attack neo-grenadier)": [ + [74, "v1", "art-joint-anim"], + [159, "v1", "art-joint-anim"], + [287, "a0", "process-focusable"], + [290, "a0", "process-focusable"], + [309, "v1", "art-joint-anim"], + [358, "v1", "art-joint-anim"] + ], + "(event attack neo-grenadier)": [ + [23, "s4", "process-focusable"], + [26, "s4", "process-focusable"], + [129, "v1", "metalhead-grenade-shot"] + ], + "(exit spin-kick neo-grenadier)": [[2, "v1", "collide-shape-prim-group"]], + "(post spin-kick neo-grenadier)": [ + [22, "a0", "process-focusable"], + [25, "a0", "process-focusable"] + ], + "(method 86 neo-grenadier)": [ + [18, "s4", "art-joint-anim"], + [64, "a1", "art-joint-anim"], + [94, "v1", "art-joint-anim"] + ], + "(method 85 neo-grenadier)": [ + [76, "s4", "art-joint-anim"], + [160, "s5", "art-joint-anim"] + ], + "(code spin-kick neo-grenadier)": [[14, "v1", "art-joint-anim"]], + "(enter spin-kick neo-grenadier)": [[23, "v1", "collide-shape-prim-group"]], + "(code backup neo-grenadier)": [[10, "v1", "art-joint-anim"]], + "(code hostile neo-grenadier)": [[45, "gp", "art-joint-anim"]], + "(trans hostile neo-grenadier)": [ + [19, "a0", "process-focusable"], + [22, "a0", "process-focusable"], + [156, "a0", "process-focusable"] + ], + "(code active neo-grenadier)": [ + [136, "v1", "art-joint-anim"], + [198, "v1", "art-joint-anim"], + [51, "v1", "art-joint-anim"], + [291, "v1", "art-joint-anim"] + ], + "(method 193 neo-grenadier)": [ + [20, "s5", "process-focusable"], + [78, "s5", "process-focusable"] + ], + "sewer-frog-turn-to-face": [ + [62, "v1", "art-joint-anim"], + [123, "v1", "art-joint-anim"], + [199, "v1", "art-joint-anim"], + [264, "v1", "art-joint-anim"] + ], + "sewer-frog-hop": [ + [63, "v1", "art-joint-anim"], + [153, "v1", "art-joint-anim"] + ], + "(code attack sewer-frog)": [ + [20, "v1", "art-joint-anim"], + [77, "a0", "collide-shape-prim-group"], + [101, "v1", "art-joint-anim"], + [160, "v1", "collide-shape-prim-group"], + [196, "v1", "art-joint-anim"] + ], + "(post knocked sewer-frog)": [ + [16, "v1", "ragdoll-proc"], + [19, "v1", "ragdoll-proc"], + [23, "v1", "ragdoll-proc"], + [31, "t9", "(function none)"] + ], + "(method 167 sewer-frog)": [ + [20, "a0", "process-focusable"], + [23, "a0", "process-focusable"] + ], + "(method 59 sewer-frog)": [ + [18, "a0", "process-focusable"], + [21, "a0", "process-focusable"] + ], + "(method 108 sewer-frog)": [[19, "v1", "process-focusable"]], + "(method 125 sewer-frog)": [ + [14, "a0", "ragdoll-proc"], + [16, "a0", "ragdoll-proc"] + ], + "(trans hostile spydroid-orig)": [ + [29, "a0", "process-focusable"], + [32, "a0", "process-focusable"] + ], + "(method 82 spydroid-orig)": [ + [65, "s0", "process-drawable"], + [90, "s0", "process-drawable"], + [113, "s0", "process-drawable"], + [208, "v1", "attack-info"], + [214, "v1", "attack-info"], + [239, "v1", "vector"], + [308, "v1", "rigid-body-impact"], + [34, "v0", "vector"] + ], + "(code close-attack roboguard)": [ + [30, "v1", "art-joint-anim"], + [58, "v1", "art-joint-anim"], + [144, "a0", "collide-shape-prim-group"], + [168, "v1", "art-joint-anim"], + [196, "v1", "art-joint-anim"], + [271, "v1", "art-joint-anim"], + [299, "v1", "art-joint-anim"], + [355, "v1", "collide-shape-prim-group"] + ], + "(post knocked roboguard)": [[30, "t9", "(function none)"]], + "(post knocked-recover roboguard)": [[30, "t9", "(function none)"]], + "(post die roboguard)": [[30, "t9", "(function none)"]], + "(code notice roboguard)": [ + [23, "v1", "art-joint-anim"], + [87, "v1", "art-joint-anim"] + ], + "roboguard-turret-code": [ + [75, "a1", "art-joint-anim"], + [168, "a1", "art-joint-anim"] + ], + "(method 86 roboguard)": [ + [24, "a2", "art-joint-anim"], + [53, "a2", "art-joint-anim"] + ], + "(method 82 roboguard)": [[109, "v1", "rigid-body-impact"]], + "(method 59 roboguard)": [[41, "s5", "process-focusable"]], + "(method 85 roboguard)": [ + [30, "v1", "art-joint-anim"], + [58, "v1", "art-joint-anim"] + ], + "(anon-function 1 roboguard)": [ + [[10, 16], "s3", "roboguard"], + [11, "s2", "int"], + [14, "s2", "int"] + ], + "(anon-function 2 roboguard)": [[[2, 79], "s3", "roboguard"]], + "(method 33 vehicle)": [[1, "a1", "rigid-body-vehicle-constants"]], + "(method 49 vehicle)": [ + [67, "s3", "attack-info"], + [86, "s3", "attack-info"], + [249, "v1", "float"], + [275, "v1", "float"] + ], + "(method 33 squad-control)": [[34, "s2", "process-focusable"]], + "(method 32 squad-control)": [ + [21, "a0", "process-focusable"], + [24, "a0", "process-focusable"] + ], + "(method 26 squad-control)": [ + [20, "s5", "process-focusable"], + [29, "s5", "process-focusable"], + [31, "s5", "process-focusable"] + ], + "(method 24 squad-control)": [ + [36, "s4", "process-focusable"], + [45, "s4", "process-focusable"], + [47, "s4", "process-focusable"] + ], + "(method 50 vehicle)": [ + [31, "s1", "process-focusable"], + [35, "a0", "process-focusable"], + [34, "s1", "process-focusable"] + ], + "(method 13 was-squad-control)": [ + [42, "v1", "process-focusable"], + [47, "v1", "process-focusable"], + [127, "s3", "process-focusable"], + [133, "s3", "process-focusable"], + [138, "s3", "process-focusable"], + [142, "s3", "process-focusable"], + [69, "v1", "process-focusable"], + [265, "a1", "process-focusable"], + [233, "v1", "process-focusable"] + ], + "(method 35 was-squad-control)": [ + [37, "s4", "process-focusable"], + [62, "s4", "process-focusable"], + [93, "s4", "process-focusable"], + [121, "s4", "process-drawable"], + [112, "s4", "process-drawable"] + ], + "(method 34 vehicle-wheel)": [[1, "a1", "vehicle-wheel-init-params"]], + "(method 38 wvehicle)": [ + [635, "v1", "vector"], + [637, "v1", "vector"], + [638, "v1", "vector"], + [540, "v1", "vector"], + [[542, 547], "v1", "vector"], + [452, "v1", "vector"], + [[454, 459], "v1", "vector"], + [[418, 426], "a2", "vector"], + [[394, 402], "a2", "vector"] + ], + "(method 33 wvehicle)": [[1, "a1", "rigid-body-vehicle-constants"]], + "(enter explode wvehicle)": [ + [233, "a0", "process"], + [328, "v1", "process-drawable"] + ], + "(enter explode-into-nothing wvehicle)": [[48, "a0", "process"]], + "(post sink wvehicle)": [[40, "a1", "process-drawable"]], + "(method 49 wvehicle)": [ + [34, "a1", "process-drawable"], + [173, "v1", "race-decision-point"], + [175, "v1", "race-decision-point"], + [203, "v1", "race-decision-point"], + [217, "v1", "race-decision-point"], + [493, "a0", "process"], + [513, "v1", "vector"], + [[525, 529], "v1", "wvehicle-ai-drop-off-params"], + [21, "v1", "float"], + [477, "v1", "float"] + ], + "(method 77 wvehicle)": [ + [179, "s4", "process-focusable"], + [186, "s4", "process-focusable"], + [194, "s4", "process-focusable"] + ], + "(method 165 wvehicle)": [ + [102, "s2", "process-focusable"], + [126, "s2", "process-focusable"], + [150, "s2", "process-focusable"], + [164, "s2", "process-focusable"] + ], + "(trans idle kill-player-process)": [ + [24, "gp", "process-focusable"], + [33, "gp", "process-focusable"] + ], + "cshape-reaction-scorp-shot": [[15, "v1", "v-scorp-shot"]], + "(method 78 wvehicle)": [ + [262, "s1", "process-focusable"], + [271, "s1", "process-focusable"], + [287, "s1", "process-focusable"], + [309, "s1", "process-focusable"], + [322, "s1", "process-focusable"], + [358, "v1", "collide-shape-prim-group"] + ], + "(method 97 wvehicle)": [ + [[509, 528], "s4", "wvehicle-physics-work"], + [[133, 139], "s0", "wvehicle-physics-work"], + [[157, 169], "s0", "wvehicle-physics-work"], + [18, "v1", "wvehicle-physics-work"], + [[160, 174], "s4", "wvehicle-physics-work"] + ], + "(method 162 wvehicle)": [[268, "a0", "uint"]], + "(method 96 vehicle)": [[14, "v1", "collide-shape-prim-group"]], + "(method 93 wvehicle)": [ + [297, "a0", "uint"], + [304, "a0", "uint"], + [440, "a0", "uint"], + [447, "a0", "uint"], + [479, "a0", "uint"] + ], + "(method 62 wcar-snake-base)": [ + [4, "s5", "collide-shape-prim-group"], + [10, "s5", "collide-shape-prim-group"], + [16, "s5", "collide-shape-prim-group"], + [[22, 48], "s5", "collide-shape-prim-group"] + ], + "(method 62 v-turtle)": [ + [4, "s5", "collide-shape-prim-group"], + [[10, 35], "s5", "collide-shape-prim-group"] + ], + "(method 14 squad-control)": [ + [6, "a2", "int"], + [13, "a2", "int"], + [20, "v1", "int"] + ], + "target-pilot-init": [ + [73, "s4", "vehicle"], + [80, "s4", "vehicle"], + [[84, 99], "s4", "vehicle"], + [117, "s4", "vehicle"], + [[122, 266], "s4", "vehicle"] + ], + "target-pilot-exit": [ + [85, "s5", "vehicle"], + [92, "s5", "vehicle"] + ], + "target-pilot-post": [ + [96, "s5", "vehicle"], + [106, "s5", "vehicle"], + [113, "s5", "vehicle"], + [290, "s5", "vehicle"], + [298, "s5", "vehicle"], + [303, "s5", "vehicle"] + ], + "target-pilot-handler": [ + [31, "a0", "vehicle"], + [35, "a0", "vehicle"], + [94, "a0", "process"], + [182, "a0", "process"] + ], + "(enter target-pilot-edge-grab)": [ + [42, "a0", "process-focusable"], + [45, "a0", "process-focusable"] + ], + "(code target-pilot-impact)": [ + [102, "v1", "art-joint-anim"], + [157, "v1", "art-joint-anim"], + [220, "v1", "art-joint-anim"], + [275, "v1", "art-joint-anim"], + [329, "v1", "art-joint-anim"], + [389, "v1", "art-joint-anim"], + [447, "v1", "art-joint-anim"], + [517, "v1", "art-joint-anim"], + [572, "v1", "art-joint-anim"], + [626, "v1", "art-joint-anim"], + [686, "v1", "art-joint-anim"], + [744, "v1", "art-joint-anim"] + ], + "(code target-pilot-daxter-perch)": [ + [16, "v1", "art-joint-anim"], + [130, "v1", "art-joint-anim"], + [69, "v1", "art-joint-anim"] + ], + "(code target-pilot-get-on)": [ + [79, "gp", "art-joint-anim"], + [187, "a1", "vehicle"] + ], + "(trans target-pilot-get-on)": [ + [28, "gp", "process-focusable"], + [36, "gp", "vehicle"], + [47, "gp", "vehicle"] + ], + "(event target-pilot-grab)": [[33, "a0", "process"]], + "target-pilot-signal-ready": [ + [20, "gp", "vehicle"], + [35, "gp", "vehicle"] + ], + "target-daxter-pilot-car-anim-loop": [[70, "v1", "art-joint-anim"]], + "target-pilot-trans": [[14, "a0", "vehicle"]], + "(method 14 race-mesh)": [ + [21, "v1", "race-mesh-slice"], + [26, "v1", "race-mesh-slice"] + ], + "(method 11 race-mesh)": [ + [5, "v1", "race-mesh-slice"], + [9, "v1", "race-mesh-slice"] + ], + "(method 12 race-mesh)": [[13, "v1", "race-mesh-slice"]], + "(method 15 race-mesh)": [[10, "v1", "race-mesh-slice"]], + "(method 17 race-mesh)": [[35, "s3", "race-mesh-hash-cell"]], + "(method 19 race-mesh)": [[12, "v1", "race-mesh-slice"]], + "(method 18 race-mesh)": [ + [15, "a2", "race-mesh-hash-search"], + [31, "v1", "race-mesh-hash-cell"], + [45, "a2", "int"] + ], + "(trans tracking tire-trail-tracker)": [ + [15, "v1", "process-drawable"], + [22, "v1", "process-drawable"] + ], + "(method 19 tire-trail)": [], + "vehicle-spawn": [[93, "gp", "vehicle"]], + "vehicle-spawn-hack": [[41, "gp", "vehicle"]], + "(method 11 w-parking-spot)": [[42, "v0", "vector"]], + "(method 21 w-parking-spot)": [ + [20, "s5", "vehicle"], + [22, "s5", "vehicle"] + ], + "(method 25 w-parking-spot)": [ + [13, "v1", "vehicle"], + [18, "v1", "vehicle"], + [27, "v1", "vehicle"] + ], + "(method 26 w-parking-spot)": [[15, "v1", "int"]], + "(method 62 v-snake)": [[[4, 48], "s5", "collide-shape-prim-group"]], + "(method 62 v-scorpion)": [[[4, 41], "s5", "collide-shape-prim-group"]], + "(method 62 v-toad)": [[[4, 41], "s5", "collide-shape-prim-group"]], + "(method 62 v-fox)": [[[4, 48], "s5", "collide-shape-prim-group"]], + "(method 62 v-rhino)": [[[4, 41], "s5", "collide-shape-prim-group"]], + "(method 62 v-mirage)": [[[4, 48], "s5", "collide-shape-prim-group"]], + "(method 62 v-x-ride)": [[[4, 48], "s5", "collide-shape-prim-group"]] } diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index 51a55df5d4..f77c4c219e 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -1988,5 +1988,28 @@ "vars": { "t1-2": ["name", "sound-name"] } + }, + "(method 18 level)": { + "vars": { + "s5-0": "mem-mode", + "a0-31": "lev", + "sv-32": "mask", + "sv-20": "memory-unused?" + } + }, + "(method 119 nav-enemy)": { + "vars": { + "a1-13": ["cspec", "collide-spec"] + } + }, + "(method 216 saberfish)": { + "vars": { + "s4-1": ["s4-1", "saberfish-command"] + } + }, + "find-behavior<-in-water?": { + "vars": { + "v0-0": ["v0-0", "saberfish-find-behavior"] + } } } diff --git a/decompiler/util/DecompilerTypeSystem.cpp b/decompiler/util/DecompilerTypeSystem.cpp index 990a714542..0b9a701199 100644 --- a/decompiler/util/DecompilerTypeSystem.cpp +++ b/decompiler/util/DecompilerTypeSystem.cpp @@ -7,6 +7,7 @@ #include "common/type_system/defenum.h" #include "common/type_system/deftype.h" #include "common/util/string_util.h" +#include #include "decompiler/Disasm/Register.h" @@ -70,6 +71,26 @@ void DecompilerTypeSystem::parse_type_defs(const std::vector& file_ } symbol_metadata.definition_info = m_reader.db.get_short_info_for(o); add_symbol(sym_name.as_symbol().name_ptr, parse_typespec(&ts, sym_type), symbol_metadata); + } else if (car(o).as_symbol() == "def-event-handler") { + auto symbol_metadata = DefinitionMetadata(); + auto* rest = &cdr(o); + auto sym_name = car(*rest); + rest = &cdr(*rest); + // check for docstring + if (rest->is_pair() && car(*rest).is_string()) { + symbol_metadata.docstring = str_util::trim_newline_indents(car(*rest).as_string()->data); + rest = &cdr(*rest); + } + if (!cdr(*rest).is_empty_list()) { + throw std::runtime_error("malformed def-event-handler"); + } + auto behavior_tag = std::string(car(*rest).as_symbol().name_ptr); + std::vector signature = { + "function", "process", "int", "symbol", "event-message-block", + "object", ":behavior", behavior_tag}; + auto sym_type = pretty_print::build_list(signature); + symbol_metadata.definition_info = m_reader.db.get_short_info_for(o); + add_symbol(sym_name.as_symbol().name_ptr, parse_typespec(&ts, sym_type), symbol_metadata); } else if (car(o).as_symbol() == "deftype") { auto dtr = parse_deftype(cdr(o), &ts); dtr.type_info->m_metadata.definition_info = m_reader.db.get_short_info_for(o); diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index e9089c2828..b934752949 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -994,6 +994,24 @@ const std::unordered_map< {{"data", ArrayFieldDecompMeta(TypeSpec("actor-cshape-ptr"), 16, ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}}, + {"nav-mesh", + {{"poly-array", ArrayFieldDecompMeta(TypeSpec("nav-poly"), 64)}, + {"nav-control-array", ArrayFieldDecompMeta(TypeSpec("nav-control"), 288)}}}, + {"enemy-info", + {{"idle-anim-script", + ArrayFieldDecompMeta(TypeSpec("idle-control-frame"), + 32, + ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}}, + {"nav-enemy-info", + {{"idle-anim-script", + ArrayFieldDecompMeta(TypeSpec("idle-control-frame"), + 32, + ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}}, + {"vehicle-rider-info", + {{"attach-point-array", + ArrayFieldDecompMeta(TypeSpec("vehicle-attach-point"), + 32, + ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}}, }}}; goos::Object decompile_structure(const TypeSpec& type, diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 262bf63bd6..d7a992e724 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -30,6 +30,7 @@ set(RUNTIME_SOURCE graphics/gfx_test.cpp graphics/gfx.cpp graphics/jak2_texture_remap.cpp + graphics/jak3_texture_remap.cpp graphics/opengl_renderer/background/background_common.cpp graphics/opengl_renderer/background/Shrub.cpp graphics/opengl_renderer/background/TFragment.cpp @@ -203,6 +204,10 @@ set(RUNTIME_SOURCE mips2c/jak3_functions/spatial_hash.cpp mips2c/jak3_functions/sparticle.cpp mips2c/jak3_functions/sparticle_launcher.cpp + mips2c/jak3_functions/nav_control.cpp + mips2c/jak3_functions/nav_engine.cpp + mips2c/jak3_functions/merc_blend_shape.cpp + mips2c/jak3_functions/wvehicle_part.cpp mips2c/mips2c_table.cpp overlord/common/dma.cpp overlord/common/fake_iso.cpp diff --git a/game/graphics/jak3_texture_remap.cpp b/game/graphics/jak3_texture_remap.cpp new file mode 100644 index 0000000000..61e9cc032f --- /dev/null +++ b/game/graphics/jak3_texture_remap.cpp @@ -0,0 +1,2050 @@ +#include "jak3_texture_remap.h" + +#include +#include +#include + +namespace { +const std::unordered_map>> data = { + {2, {{1, 1}}}, + {4, {{66, 1}, {18, 2}, {177, 2}, {21, 1}, {88, 1}, {89, 2}, {172, 5}, {173, 6}, + {174, 7}, {168, 7}, {169, 8}, {170, 9}, {164, 9}, {165, 10}, {166, 11}, {140, 11}, + {161, 12}, {162, 13}, {131, 13}, {181, 1}, {182, 2}, {85, 1}, {185, 2}, {22, 1}, + {59, 1}, {63, 2}, {64, 3}, {25, 1}, {24, 1}, {61, 2}, {100, 1}, {134, 2}, + {130, 1}, {150, 1}, {148, 1}, {183, 2}, {184, 3}, {113, 1}, {154, 2}}}, + {5, {{4, 1}, {24, 1}, {30, 1}, {13, 1}, {14, 2}, {17, 1}, {2, 1}, {19, 2}}}, + {7, {{55, 1}, {25, 1}, {31, 2}, {129, 1}, {130, 2}, {127, 1}, {128, 2}, {90, 1}, {115, 2}, + {106, 1}, {123, 1}, {124, 2}, {98, 1}, {103, 2}, {105, 3}, {107, 4}, {110, 5}, {112, 6}, + {117, 7}, {92, 1}, {111, 2}, {119, 3}, {104, 1}, {108, 2}, {116, 3}, {109, 1}, {125, 1}, + {126, 2}, {97, 1}, {113, 2}, {118, 3}, {121, 1}, {122, 2}}}, + {10, {{4, 1}, {5, 2}, {9, 3}}}, + {11, + {{22, 1}, + {23, 2}, + {5, 1}, + {16, 2}, + {7, 1}, + {19, 2}, + {10, 1}, + {11, 2}, + {12, 3}, + {14, 1}, + {15, 2}, + {17, 3}, + {4, 1}}}, + {13, {{21, 1}, {23, 2}, {24, 3}, {46, 1}, {47, 2}, {39, 1}, {40, 2}}}, + {125, {{17, 1}, {18, 2}, {19, 3}, {23, 1}}}, + {127, + {{36, 1}, + {51, 1}, + {53, 2}, + {44, 1}, + {72, 1}, + {73, 3}, + {74, 4}, + {79, 3}, + {139, 1}, + {140, 2}, + {132, 1}, + {133, 2}, + {92, 1}}}, + {133, {{77, 1}, {74, 1}, {75, 2}, {55, 1}, {56, 2}, {57, 3}, {51, 1}}}, + {135, {{9, 1}, {11, 2}, {19, 1}, {13, 1}, {14, 2}, {20, 1}, {10, 1}, {4, 1}}}, + {136, + {{9, 1}, + {46, 1}, + {47, 2}, + {54, 3}, + {4, 1}, + {6, 2}, + {32, 1}, + {45, 1}, + {15, 1}, + {16, 1}, + {26, 2}, + {49, 1}, + {35, 1}, + {23, 1}, + {25, 2}, + {27, 3}}}, + {162, {{6, 1}}}, + {166, {{105, 1}, {103, 1}}}, + {170, {{9, 1}}}, + {174, {{103, 1}}}, + {179, {{3, 1}}}, + {180, {{52, 1}, {31, 1}, {7, 1}, {34, 1}, {36, 1}, {59, 1}, {48, 1}, {40, 1}, + {10, 1}, {45, 1}, {30, 1}, {3, 1}, {49, 1}, {12, 1}, {37, 1}, {58, 1}, + {54, 1}, {51, 1}, {41, 1}, {25, 1}, {21, 1}, {39, 1}}}, + {187, {{5, 1}}}, + {188, {{56, 1}, {47, 1}, {37, 1}, {15, 1}, {38, 1}, {78, 1}, {49, 1}, {34, 1}, + {40, 1}, {54, 1}, {29, 1}, {36, 1}, {50, 1}, {43, 1}, {39, 1}, {58, 1}, + {23, 1}, {55, 1}, {31, 1}, {27, 1}, {30, 1}, {24, 1}}}, + {224, + {{1, 1}, + {3, 2}, + {4, 3}, + {24, 1}, + {43, 1}, + {36, 1}, + {38, 2}, + {39, 1}, + {40, 2}, + {42, 3}, + {25, 1}, + {37, 2}, + {16, 1}, + {18, 1}, + {20, 1}, + {53, 1}}}, + {226, + {{30, 1}, + {77, 1}, + {78, 2}, + {18, 1}, + {43, 1}, + {53, 1}, + {62, 2}, + {63, 3}, + {1, 1}, + {3, 2}, + {9, 1}, + {7, 1}, + {45, 1}, + {41, 1}}}, + {244, {{1, 1}, {3, 2}, {4, 3}, {8, 1}}}, + {272, {{5, 1}, {7, 2}, {8, 3}}}, + {273, {{28, 1}, {29, 2}}}, + {274, {{27, 1}, {42, 2}, {44, 1}, {12, 1}, {20, 2}, {46, 3}, {60, 1}, {65, 1}, {15, 1}, + {97, 2}, {29, 1}, {40, 2}, {55, 3}, {21, 1}, {52, 1}, {13, 1}, {50, 1}, {39, 1}, + {48, 1}, {53, 1}, {30, 1}, {16, 1}, {37, 1}, {58, 1}, {62, 1}}}, + {318, + {{29, 1}, + {48, 1}, + {41, 1}, + {43, 2}, + {44, 1}, + {45, 2}, + {47, 3}, + {30, 1}, + {42, 2}, + {19, 1}, + {23, 1}, + {25, 1}}}, + {319, {{89, 1}, {93, 2}, {96, 1}, {97, 2}, {85, 1}, {84, 1}}}, + {325, + {{60, 1}, {117, 1}, {47, 1}, {14, 1}, {21, 2}, {57, 3}, {22, 1}, {37, 2}, {45, 3}, {20, 1}, + {40, 2}, {78, 3}, {82, 1}, {87, 2}, {46, 1}, {51, 2}, {55, 3}, {42, 1}, {56, 1}, {58, 2}, + {35, 1}, {52, 1}, {53, 2}, {23, 1}, {31, 2}, {32, 3}, {48, 1}, {49, 2}, {17, 1}, {18, 2}, + {43, 3}, {113, 1}, {38, 1}, {61, 2}, {12, 1}, {30, 2}, {84, 1}, {85, 2}, {86, 3}}}, + {405, + {{130, 1}, + {120, 1}, + {126, 2}, + {107, 1}, + {68, 1}, + {121, 1}, + {124, 1}, + {73, 1}, + {114, 1}, + {85, 1}, + {90, 2}, + {93, 3}, + {94, 4}, + {66, 1}, + {82, 1}, + {104, 1}, + {71, 1}}}, + {428, {{21, 1}, {28, 1}, {14, 1}, {26, 2}, {32, 1}, {35, 1}}}, + {446, {{3, 1}, {4, 2}, {5, 3}, {6, 5}, {7, 6}}}, + {536, + {{113, 1}, {171, 1}, {174, 2}, {188, 3}, {92, 1}, {89, 1}, {90, 2}, {91, 3}, {85, 1}, + {86, 2}, {93, 3}, {156, 1}, {132, 1}, {125, 1}, {127, 2}, {128, 1}, {129, 2}, {131, 3}, + {114, 1}, {126, 2}, {186, 1}, {187, 2}, {195, 3}, {183, 1}, {184, 2}, {185, 3}, {177, 1}, + {178, 2}, {191, 3}, {181, 1}, {189, 2}, {190, 3}, {167, 1}, {173, 2}, {168, 1}, {182, 2}, + {175, 1}, {180, 2}, {193, 1}, {194, 2}, {95, 1}, {96, 2}, {151, 1}, {145, 1}, {103, 1}, + {107, 1}, {51, 1}, {62, 1}, {61, 1}, {66, 1}, {55, 1}, {109, 1}, {52, 1}, {46, 1}}}, + {540, + {{41, 1}, {219, 1}, {210, 1}, {38, 1}, {39, 2}, {40, 3}, {34, 1}, {35, 2}, {42, 3}, + {86, 1}, {87, 2}, {82, 1}, {209, 1}, {211, 2}, {213, 3}, {212, 1}, {216, 2}, {217, 3}, + {205, 1}, {206, 2}, {208, 3}, {173, 1}, {174, 2}, {170, 1}, {171, 2}, {175, 3}, {215, 1}, + {203, 1}, {201, 1}, {202, 1}, {214, 2}, {68, 1}, {69, 2}, {70, 3}, {62, 1}, {65, 2}, + {66, 3}, {73, 1}, {74, 2}, {152, 3}, {44, 1}, {45, 2}, {25, 1}, {27, 2}, {29, 3}, + {15, 1}, {18, 2}, {21, 3}, {13, 1}, {19, 2}, {23, 3}, {11, 1}, {16, 2}, {17, 3}, + {8, 1}, {9, 2}, {12, 3}, {4, 1}, {20, 2}, {26, 3}, {10, 1}, {22, 2}, {28, 3}}}, + {544, {{81, 1}, {82, 2}, {96, 1}, {106, 2}, {119, 3}, {95, 1}, {100, 2}, {110, 3}, {99, 1}, + {109, 2}, {113, 3}, {117, 1}, {118, 2}, {120, 1}, {121, 2}, {34, 1}, {38, 2}, {36, 1}, + {39, 2}, {42, 3}, {107, 1}, {108, 2}, {112, 3}, {105, 1}, {115, 2}, {94, 1}, {102, 2}, + {93, 1}, {111, 2}, {75, 1}, {76, 2}, {71, 1}, {80, 2}, {65, 1}, {73, 2}, {74, 3}, + {69, 1}, {59, 1}, {84, 1}, {85, 2}, {86, 3}, {58, 1}, {60, 2}, {63, 3}, {67, 1}, + {70, 2}, {79, 3}, {25, 1}, {27, 2}, {28, 3}, {24, 1}, {26, 2}, {13, 1}, {14, 2}, + {17, 3}, {15, 1}, {16, 2}, {20, 3}, {21, 1}, {6, 1}, {9, 2}, {11, 1}, {18, 2}, + {19, 3}, {1, 1}, {4, 2}, {5, 3}}}, + {591, {{287, 1}, {288, 2}, {289, 3}, {290, 4}, {283, 1}, {284, 2}, {285, 3}, {279, 1}, {280, 2}, + {281, 3}, {275, 1}, {276, 2}, {277, 3}, {271, 1}, {272, 2}, {273, 3}, {266, 1}, {267, 2}, + {268, 3}, {269, 4}, {262, 1}, {263, 2}, {264, 3}, {258, 1}, {259, 2}, {260, 3}, {254, 1}, + {255, 2}, {256, 3}, {250, 1}, {251, 2}, {252, 3}, {245, 1}, {246, 2}, {247, 3}, {248, 4}, + {241, 1}, {242, 2}, {243, 3}, {237, 1}, {238, 2}, {239, 3}, {233, 1}, {234, 2}, {235, 3}, + {229, 1}, {230, 2}, {231, 3}, {224, 1}, {225, 2}, {226, 3}, {227, 4}, {220, 1}, {221, 2}, + {222, 3}, {216, 1}, {217, 2}, {218, 3}, {212, 1}, {213, 2}, {214, 3}, {208, 1}, {209, 2}, + {210, 3}, {204, 1}, {205, 2}, {206, 3}, {199, 1}, {200, 2}, {201, 3}, {202, 4}, {195, 1}, + {196, 2}, {197, 3}, {191, 1}, {192, 2}, {193, 3}, {187, 1}, {188, 2}, {189, 3}, {141, 1}, + {142, 2}, {143, 3}, {137, 1}, {138, 2}, {139, 3}, {133, 1}, {134, 2}, {135, 3}, {17, 1}, + {130, 2}, {131, 3}, {182, 1}, {183, 2}, {184, 3}, {185, 4}, {177, 1}, {178, 2}, {179, 3}, + {180, 4}, {170, 1}, {171, 2}, {172, 3}, {174, 4}, {175, 5}, {176, 6}, {166, 1}, {167, 2}, + {168, 3}, {161, 1}, {162, 2}, {163, 3}, {164, 4}, {157, 1}, {158, 2}, {159, 3}, {153, 1}, + {154, 2}, {155, 3}, {149, 1}, {150, 2}, {151, 3}, {145, 1}, {146, 2}, {147, 3}}}, + {593, {{29, 1}, {14, 1}, {24, 2}, {15, 1}, {23, 2}, {21, 1}}}, + {605, {{30, 1}, {19, 1}, {28, 2}, {17, 1}, {26, 2}, {25, 1}}}, + {632, {{82, 1}, {84, 2}, {28, 1}, {44, 1}, {68, 1}, {73, 1}, {76, 2}, + {79, 3}, {35, 1}, {42, 1}, {22, 1}, {29, 1}, {24, 1}, {37, 1}, + {55, 2}, {17, 1}, {18, 2}, {20, 3}, {63, 1}, {65, 1}, {43, 1}}}, + {633, {{5, 1}, {6, 2}, {19, 1}}}, + {646, {{4, 1}, {5, 2}, {6, 3}, {7, 5}, {8, 6}}}, + {647, {{28, 1}, {17, 1}, {30, 1}, {38, 1}, {9, 1}, {37, 2}, {21, 1}, {22, 2}, {27, 3}}}, + {736, {{17, 1}, {24, 1}, {21, 1}, {22, 2}, {30, 3}}}, + {740, {{13, 1}, {14, 1}, {29, 1}, {18, 1}, {28, 1}, {24, 1}}}, + {741, + {{3, 1}, {1, 1}, {4, 2}, {5, 3}, {18, 1}, {64, 1}, {15, 1}, {16, 2}, {17, 3}, {11, 1}, + {12, 2}, {19, 3}, {118, 1}, {83, 1}, {76, 1}, {78, 2}, {79, 1}, {80, 2}, {82, 3}, {65, 1}, + {77, 2}, {21, 1}, {22, 2}, {113, 1}, {107, 1}, {56, 1}, {58, 1}, {60, 1}}}, + {742, + {{67, 1}, + {54, 1}, + {27, 1}, + {77, 1}, + {79, 1}, + {34, 1}, + {22, 1}, + {25, 2}, + {41, 1}, + {40, 1}, + {60, 2}, + {39, 1}, + {47, 1}, + {46, 1}, + {83, 2}, + {36, 1}, + {82, 1}, + {42, 1}}}, + {744, {{27, 1}, {34, 1}, {68, 1}, {31, 1}, {8, 1}, {28, 2}, {33, 1}, + {38, 2}, {71, 1}, {64, 1}, {36, 1}, {51, 2}, {10, 1}, {20, 2}, + {37, 1}, {26, 1}, {67, 2}, {24, 1}, {69, 1}, {23, 1}, {63, 2}}}, + {746, {{13, 1}, {60, 1}, {35, 1}, {43, 1}, {28, 1}, {31, 2}, {33, 1}, + {46, 2}, {42, 1}, {7, 1}, {12, 2}, {49, 1}, {11, 1}, {75, 2}, + {27, 1}, {78, 1}, {76, 1}, {68, 1}, {70, 1}, {19, 1}, {80, 2}}}, + {747, {{13, 1}}}, + {748, + {{66, 1}, + {81, 1}, + {35, 1}, + {24, 1}, + {77, 1}, + {30, 1}, + {33, 2}, + {49, 1}, + {41, 1}, + {60, 1}, + {8, 1}, + {40, 2}, + {44, 1}, + {48, 1}, + {80, 2}, + {32, 1}, + {62, 1}, + {15, 1}, + {67, 2}}}, + {752, {{99, 1}, {80, 1}, {91, 1}}}, + {753, {{53, 1}, {43, 1}, {1, 1}, {3, 2}, {4, 3}, {5, 1}, {34, 1}, {14, 1}}}, + {754, {{76, 1}, {67, 1}, {1, 1}, {3, 2}, {4, 3}, {42, 1}}}, + {756, {{2, 1}, {4, 2}, {5, 3}, {44, 1}, {32, 1}, {38, 1}}}, + {757, + {{66, 1}, {54, 1}, {29, 1}, {40, 1}, {33, 1}, {48, 1}, {44, 1}, {20, 1}, {83, 1}, {81, 1}}}, + {759, {{1, 1}, {3, 2}, {4, 3}, {6, 1}}}, + {773, {{34, 1}, {29, 1}, {30, 2}, {35, 1}, {40, 1}}}, + {774, {{1, 1}, {3, 2}, {4, 3}}}, + {798, {{42, 1}, {35, 1}, {37, 2}, {34, 1}, {36, 2}, {32, 1}, {39, 2}, + {52, 1}, {15, 1}, {16, 2}, {21, 3}, {51, 1}, {53, 2}, {38, 1}, + {54, 2}, {48, 1}, {49, 2}, {50, 3}, {55, 1}, {47, 1}, {45, 1}}}, + {820, + {{14, 1}, {18, 2}, {33, 1}, {34, 2}, {22, 1}, {17, 1}, {19, 2}, {23, 3}, {9, 1}, {11, 1}, + {12, 2}, {8, 1}, {4, 1}, {7, 2}, {10, 1}, {20, 2}, {21, 3}, {26, 1}, {27, 2}, {28, 3}}}, + {841, + {{27, 1}, + {48, 1}, + {73, 1}, + {46, 1}, + {19, 1}, + {29, 1}, + {1, 1}, + {87, 1}, + {38, 1}, + {30, 1}, + {34, 1}, + {35, 2}, + {36, 3}, + {51, 1}, + {52, 2}, + {63, 1}}}, + {843, {{2, 1}, {3, 2}}}, + {844, {{5, 1}}}, + {869, {{100, 1}, {102, 2}, {103, 3}}}, + {871, {{9, 1}, {10, 2}, {11, 3}, {12, 1}, {5, 1}, {6, 2}, {13, 3}, {15, 1}, {16, 2}}}, + {872, + {{31, 1}, {33, 2}, {25, 1}, {26, 2}, {19, 1}, {30, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, + {7, 1}, {20, 1}, {22, 2}, {32, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {29, 3}}}, + {873, {{22, 1}, {19, 1}}}, + {874, {{73, 1}, {78, 1}, {72, 1}, {47, 1}, {48, 2}, {49, 3}, {45, 1}, {50, 2}, {51, 3}, {40, 1}, + {41, 2}, {42, 3}, {59, 1}, {63, 2}, {86, 1}, {99, 2}, {92, 1}, {93, 2}, {98, 3}, {95, 1}, + {96, 2}, {97, 3}, {89, 1}, {94, 2}, {69, 1}, {74, 2}, {71, 1}, {75, 2}, {76, 3}, {61, 1}, + {65, 2}, {60, 1}, {62, 2}, {64, 3}, {54, 1}, {55, 2}, {56, 3}}}, + {895, {{89, 4}, {90, 5}, {91, 6}, {85, 6}, {86, 7}, {87, 8}, {81, 8}, {82, 9}, + {83, 11}, {77, 11}, {78, 12}, {79, 13}, {94, 5}, {95, 6}, {96, 7}, {98, 1}, + {99, 2}, {100, 3}, {75, 3}, {71, 3}, {72, 4}, {73, 5}, {9, 1}, {11, 2}}}, + {924, {{9, 1}, {10, 2}, {13, 3}, {37, 4}, {41, 1}, {44, 2}, {34, 1}, + {14, 1}, {15, 1}, {38, 2}, {24, 1}, {26, 2}, {25, 1}, {27, 2}, + {28, 3}, {30, 4}, {40, 1}, {42, 2}, {2, 1}, {45, 2}, {46, 3}}}, + {925, {{87, 1}, {89, 2}, {94, 3}, {88, 1}, {95, 2}, {96, 3}, {91, 1}, {93, 2}, {83, 1}, + {86, 2}, {92, 3}, {35, 1}, {108, 1}, {32, 1}, {33, 2}, {34, 3}, {28, 1}, {29, 2}, + {36, 3}, {140, 1}, {141, 2}, {136, 1}, {127, 1}, {120, 1}, {122, 2}, {123, 1}, {124, 2}, + {126, 3}, {109, 1}, {121, 2}, {38, 1}, {39, 2}, {100, 1}, {102, 1}, {104, 1}}}, + {926, {{21, 1}, {32, 2}, {27, 1}, {28, 2}, {29, 3}, {40, 4}, {48, 5}, {30, 1}, {42, 2}, {39, 1}, + {50, 1}, {45, 1}, {56, 2}, {35, 1}, {37, 1}, {41, 2}, {46, 3}, {6, 1}, {47, 2}, {17, 1}, + {18, 2}, {22, 3}, {4, 1}, {14, 2}, {15, 3}, {20, 4}, {44, 5}, {19, 1}, {26, 2}}}, + {928, + {{18, 1}, + {14, 1}, + {20, 2}, + {21, 3}, + {22, 4}, + {27, 5}, + {23, 1}, + {44, 2}, + {46, 1}, + {17, 1}, + {34, 2}, + {13, 1}, + {19, 2}}}, + {929, + {{68, 1}, + {70, 2}, + {75, 3}, + {69, 1}, + {76, 2}, + {77, 3}, + {72, 1}, + {74, 2}, + {64, 1}, + {67, 2}, + {73, 3}, + {46, 1}, + {47, 2}, + {48, 1}, + {54, 1}, + {23, 1}, + {49, 2}, + {45, 1}}}, + {930, {{37, 1}, {6, 1}, {8, 2}, {14, 3}, {18, 4}, {46, 5}, {19, 1}, {22, 2}, {45, 1}, + {31, 1}, {48, 2}, {53, 3}, {32, 1}, {39, 1}, {49, 1}, {83, 2}, {11, 1}, {17, 2}, + {27, 3}, {12, 1}, {13, 2}, {26, 3}, {36, 1}, {38, 2}, {77, 3}, {16, 1}, {59, 2}, + {61, 3}, {80, 4}, {23, 1}, {29, 2}, {30, 3}, {68, 1}, {65, 1}, {66, 2}, {69, 1}}}, + {931, + {{23, 1}, + {10, 1}, + {12, 2}, + {16, 3}, + {21, 4}, + {24, 5}, + {11, 1}, + {29, 1}, + {15, 1}, + {17, 2}, + {19, 1}, + {20, 2}, + {22, 3}}}, + {932, {{74, 1}, {67, 1}, {62, 1}, {14, 1}, {30, 1}, {85, 1}, {86, 2}, {81, 1}}}, + {947, + {{41, 1}, + {42, 2}, + {43, 3}, + {37, 1}, + {38, 2}, + {39, 3}, + {33, 1}, + {34, 2}, + {35, 3}, + {29, 1}, + {30, 2}, + {31, 3}}}, + {948, {{15, 1}, {16, 2}, {17, 3}, {3, 1}}}, + {949, {{7, 1}, {8, 2}, {5, 1}}}, + {950, {{7, 1}, {22, 1}, {21, 1}, {26, 1}, {11, 1}, {8, 1}, {2, 1}}}, + {956, {{25, 1}, {26, 2}, {18, 1}, {19, 2}, {21, 3}, {22, 1}, {23, 2}, {24, 3}, {30, 1}, + {36, 1}, {37, 2}, {38, 3}, {8, 1}, {42, 1}, {43, 2}, {14, 1}, {31, 2}, {11, 3}, + {29, 4}, {40, 4}, {32, 5}, {33, 6}, {34, 7}, {27, 4}, {3, 1}}}, + {957, + {{14, 1}, + {18, 2}, + {22, 1}, + {17, 1}, + {19, 2}, + {23, 3}, + {9, 1}, + {11, 1}, + {12, 2}, + {8, 1}, + {4, 1}, + {7, 2}, + {10, 1}, + {20, 2}, + {21, 3}, + {26, 1}, + {27, 2}, + {28, 3}}}, + {958, {{5, 1}}}, + {976, {{1, 1}, {2, 2}, {3, 3}, {4, 4}}}, + {989, {{4, 1}, {11, 2}, {15, 1}, {16, 1}, {7, 1}}}, + {1023, + {{33, 1}, {34, 3}, {35, 4}, {29, 3}, {30, 4}, {31, 5}, {19, 1}, {20, 2}, {21, 3}, {14, 4}, + {15, 5}, {16, 6}, {10, 6}, {11, 7}, {12, 8}, {6, 8}, {7, 9}, {8, 10}, {2, 10}, {3, 11}, + {4, 12}, {23, 1}, {24, 2}, {25, 3}, {44, 3}, {40, 3}, {41, 4}, {42, 5}, {37, 5}, {38, 6}}}, + {1026, {{43, 1}, {10, 1}, {35, 1}, {33, 1}, {23, 1}, {24, 2}, {21, 1}, {14, 1}, {12, 1}}}, + {1035, + {{34, 1}, {35, 3}, {36, 4}, {30, 3}, {31, 4}, {32, 5}, {20, 1}, {21, 2}, {22, 3}, {16, 5}, + {17, 6}, {18, 7}, {12, 7}, {13, 8}, {14, 9}, {8, 9}, {9, 10}, {10, 11}, {4, 11}, {5, 12}, + {6, 13}, {24, 1}, {25, 2}, {26, 3}, {44, 3}, {40, 3}, {41, 4}, {42, 5}, {38, 5}}}, + {1037, {{3, 1}, {4, 2}, {5, 3}, {6, 4}}}, + {1085, {{47, 1}, {48, 2}, {50, 3}, {30, 1}, {55, 2}, {33, 1}, {43, 1}, {49, 2}, {51, 3}}}, + {1086, {{7, 1}, {8, 2}, {3, 1}}}, + {1087, + {{31, 1}, {33, 2}, {25, 1}, {26, 2}, {19, 1}, {30, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, + {7, 1}, {20, 1}, {22, 2}, {32, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {29, 3}}}, + {1088, + {{60, 1}, {62, 2}, {14, 1}, {23, 1}, {24, 2}, {20, 1}, {21, 2}, {25, 3}, {15, 1}, {16, 2}, + {26, 1}, {27, 2}, {28, 3}, {7, 1}, {29, 2}, {5, 1}, {18, 2}, {10, 1}, {11, 2}, {54, 1}, + {55, 2}, {48, 1}, {59, 2}, {42, 1}, {52, 2}, {53, 3}, {46, 1}, {36, 1}, {49, 1}, {51, 2}, + {61, 3}, {35, 1}, {37, 2}, {40, 3}, {44, 1}, {47, 2}, {58, 3}}}, + {1090, {{73, 1}, {80, 2}, {76, 1}}}, + {1092, {{7, 1}, {8, 2}, {3, 1}}}, + {1093, {{45, 1}, {46, 2}, {54, 3}, {48, 1}, {31, 1}, {33, 2}, {50, 1}, {51, 2}, {53, 3}, + {55, 1}, {56, 2}, {43, 1}, {47, 1}, {37, 1}, {38, 2}, {40, 3}, {25, 1}, {26, 2}, + {19, 1}, {30, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, {7, 1}, {20, 1}, {22, 2}, + {32, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {29, 3}}}, + {1121, + {{53, 1}, + {44, 1}, + {67, 1}, + {41, 1}, + {56, 1}, + {45, 1}, + {64, 1}, + {18, 1}, + {8, 1}, + {27, 1}, + {20, 1}, + {39, 1}}}, + {1123, + {{13, 1}, {42, 1}, {67, 2}, {75, 1}, {71, 1}, {48, 1}, {50, 1}, {15, 1}, {60, 2}, {59, 1}, + {58, 1}, {68, 1}, {35, 1}, {73, 1}, {66, 1}, {2, 1}, {70, 2}, {6, 1}, {24, 2}, {72, 3}}}, + {1124, {{11, 1}}}, + {1125, {{39, 1}, {53, 1}, {48, 1}, {71, 1}, {74, 2}, {26, 1}, {59, 1}, {28, 1}, {49, 2}, + {77, 3}, {78, 4}, {44, 1}, {79, 1}, {58, 1}, {75, 1}, {25, 1}, {57, 2}, {66, 1}, + {61, 1}, {69, 1}, {33, 1}, {76, 2}, {70, 1}, {1, 1}, {11, 1}, {21, 2}, {72, 3}}}, + {1127, {{36, 1}, {42, 1}, {74, 1}, {31, 1}, {41, 1}, {18, 1}, {53, 2}, {25, 1}, {40, 2}, + {23, 1}, {61, 2}, {58, 1}, {19, 1}, {26, 2}, {67, 1}, {70, 1}, {48, 1}, {12, 1}, + {73, 1}, {71, 1}, {59, 1}, {34, 1}, {28, 1}, {39, 2}, {75, 3}}}, + {1130, {{3, 1}, {5, 2}, {6, 3}, {61, 1}, {1, 1}}}, + {1132, {{55, 1}, {46, 1}, {51, 1}}}, + {1133, {{16, 1}, {14, 1}, {17, 2}, {18, 3}, {77, 1}, {2, 1}, {36, 1}}}, + {1135, + {{53, 1}, + {45, 1}, + {47, 1}, + {41, 1}, + {27, 1}, + {59, 1}, + {65, 2}, + {64, 1}, + {74, 1}, + {34, 1}, + {54, 1}, + {50, 1}, + {52, 1}, + {70, 2}}}, + {1137, {{1, 1}, {3, 2}, {4, 3}, {5, 1}, {24, 1}, {16, 1}, {10, 1}}}, + {1138, {{21, 1}, {78, 1}, {59, 1}, {69, 1}, {50, 1}, {30, 1}, {46, 2}, {7, 1}, {23, 2}, + {76, 3}, {75, 1}, {33, 1}, {74, 1}, {5, 1}, {20, 2}, {60, 1}, {19, 1}, {77, 2}, + {44, 1}, {72, 2}, {70, 1}, {71, 1}, {51, 1}, {39, 1}, {4, 1}, {58, 2}, {79, 3}}}, + {1141, {{1, 1}, {3, 2}, {4, 3}}}, + {1143, {{53, 1}, {45, 1}, {47, 1}, {41, 1}, {37, 1}, {42, 2}, {27, 1}, {63, 2}, + {79, 3}, {78, 1}, {59, 1}, {65, 2}, {77, 1}, {64, 1}, {73, 1}, {75, 1}, + {80, 2}, {34, 1}, {81, 2}, {54, 1}, {50, 1}, {70, 1}}}, + {1145, {{1, 1}, {3, 2}, {4, 3}, {5, 1}}}, + {1153, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {1156, {{9, 1}, {10, 2}, {11, 3}, {12, 1}, {5, 1}, {6, 2}, {13, 3}, {15, 1}, {16, 2}, + {50, 1}, {70, 1}, {58, 1}, {59, 2}, {63, 3}, {67, 1}, {68, 2}, {57, 1}, {60, 2}, + {61, 1}, {64, 3}, {65, 4}, {93, 1}, {77, 1}, {78, 2}, {73, 1}, {112, 1}, {105, 1}, + {107, 2}, {108, 1}, {109, 2}, {111, 3}, {94, 1}, {106, 2}, {85, 1}, {87, 1}, {89, 1}}}, + {1158, + {{5, 1}, + {62, 1}, + {59, 1}, + {52, 1}, + {48, 1}, + {46, 1}, + {43, 1}, + {34, 1}, + {32, 1}, + {23, 1}, + {18, 1}, + {19, 2}, + {13, 1}, + {1, 1}}}, + {1163, {{4, 1}, {8, 2}, {6, 1}, {9, 2}, {12, 3}}}, + {1165, + {{50, 2}, {4, 1}, {8, 2}, {6, 1}, {9, 2}, {12, 3}, {43, 1}, {47, 2}, {51, 3}, {40, 1}, + {41, 2}, {48, 3}, {35, 1}, {33, 1}, {38, 1}, {39, 2}, {44, 3}, {29, 1}, {45, 2}, {49, 3}}}, + {1167, {{12, 1}, {85, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {104, 1}, {97, 1}, {99, 2}, {100, 1}, {101, 2}, {103, 3}, + {86, 1}, {98, 2}, {15, 1}, {16, 2}, {77, 1}, {79, 1}, {81, 1}}}, + {1211, {{131, 1}, {140, 2}, {154, 3}, {152, 1}, {158, 2}, {157, 1}, {159, 2}, {161, 3}, + {126, 1}, {127, 2}, {128, 3}, {124, 1}, {147, 2}, {150, 3}, {141, 1}, {142, 2}, + {156, 3}, {144, 1}, {145, 2}, {153, 3}, {133, 1}, {134, 2}, {162, 3}, {121, 1}, + {122, 2}, {143, 3}, {136, 1}, {148, 2}, {155, 3}, {135, 1}, {138, 2}, {151, 3}, + {132, 1}, {149, 2}, {160, 3}, {12, 1}, {84, 1}, {9, 1}, {10, 2}, {11, 3}, + {5, 1}, {6, 2}, {13, 3}, {103, 1}, {96, 1}, {98, 2}, {99, 1}, {100, 2}, + {102, 3}, {85, 1}, {97, 2}, {15, 1}, {16, 2}, {74, 1}, {78, 1}, {80, 1}}}, + {1213, {{16, 1}, {18, 1}, {20, 1}, {23, 1}, {25, 2}}}, + {1222, + {{25, 1}, {27, 2}, {28, 3}, {24, 1}, {26, 2}, {13, 1}, {14, 2}, {17, 3}, {15, 1}, {16, 2}, + {20, 3}, {21, 1}, {6, 1}, {9, 2}, {11, 1}, {18, 2}, {19, 3}, {1, 1}, {4, 2}, {5, 3}}}, + {1244, {{18, 1}, {4, 1}}}, + {1245, {{9, 1}, {10, 2}, {11, 3}, {12, 1}, {94, 1}, {5, 1}, {6, 2}, {13, 3}, {53, 1}, + {54, 2}, {49, 1}, {113, 1}, {106, 1}, {108, 2}, {109, 1}, {110, 2}, {112, 3}, {95, 1}, + {107, 2}, {39, 1}, {40, 2}, {41, 3}, {33, 1}, {36, 2}, {37, 3}, {24, 1}, {44, 2}, + {45, 3}, {58, 1}, {59, 2}, {15, 1}, {16, 2}, {86, 1}, {88, 1}, {90, 1}}}, + {1246, {{73, 1}, {74, 2}, {82, 3}, {76, 1}, {31, 1}, {33, 2}, {46, 1}, {55, 1}, {56, 2}, + {52, 1}, {53, 2}, {57, 3}, {47, 1}, {48, 2}, {58, 1}, {59, 2}, {60, 3}, {39, 1}, + {61, 2}, {37, 1}, {50, 2}, {42, 1}, {43, 2}, {78, 1}, {79, 2}, {81, 3}, {83, 1}, + {84, 2}, {71, 1}, {75, 1}, {65, 1}, {66, 2}, {68, 3}, {25, 1}, {26, 2}, {19, 1}, + {30, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, {7, 1}, {20, 1}, {22, 2}, {32, 3}, + {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {29, 3}}}, + {1247, {{69, 1}, {78, 1}, {68, 1}, {70, 2}, {72, 3}, {71, 1}, {75, 2}, {76, 3}, {64, 1}, + {65, 2}, {67, 3}, {51, 1}, {52, 2}, {48, 1}, {49, 2}, {53, 3}, {74, 1}, {62, 1}, + {60, 1}, {61, 1}, {73, 2}, {12, 1}, {92, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, + {6, 2}, {13, 3}, {111, 1}, {104, 1}, {106, 2}, {107, 1}, {108, 2}, {110, 3}, {93, 1}, + {105, 2}, {15, 1}, {16, 2}, {82, 1}, {86, 1}, {88, 1}}}, + {1251, + {{44, 2}, + {49, 1}, + {43, 1}, + {7, 1}, + {11, 2}, + {40, 1}, + {45, 2}, + {42, 1}, + {46, 2}, + {47, 3}, + {9, 1}, + {13, 2}, + {8, 1}, + {10, 2}, + {12, 3}, + {2, 1}, + {3, 2}, + {4, 3}}}, + {1300, {{21, 1}, {16, 1}, {14, 1}}}, + {1320, {{12, 1}, {13, 1}, {5, 1}, {9, 2}, {17, 3}}}, + {1322, {{12, 1}, {62, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {81, 1}, {74, 1}, {76, 2}, {77, 1}, {78, 2}, {80, 3}, + {63, 1}, {75, 2}, {15, 1}, {16, 2}, {52, 1}, {56, 1}, {58, 1}}}, + {1323, + {{31, 1}, {33, 2}, {25, 1}, {26, 2}, {19, 1}, {30, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, + {7, 1}, {20, 1}, {22, 2}, {32, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {29, 3}}}, + {1343, {{8, 1}, {18, 2}, {26, 1}, {27, 2}, {23, 1}, {24, 1}, {7, 1}}}, + {1347, {{44, 1}, {49, 1}, {37, 1}, {41, 2}}}, + {1367, + {{52, 1}, + {7, 1}, + {8, 2}, + {3, 1}, + {71, 1}, + {64, 1}, + {66, 2}, + {67, 1}, + {68, 2}, + {70, 3}, + {53, 1}, + {65, 2}, + {42, 1}, + {46, 1}, + {48, 1}}}, + {1371, {{19, 1}, {23, 1}, {20, 1}, {21, 2}, {22, 3}, {14, 1}}}, + {1372, {{9, 1}, {13, 1}, {10, 1}, {11, 2}, {12, 3}}}, + {1373, + {{12, 1}, + {7, 1}, + {9, 2}, + {42, 1}, + {44, 2}, + {41, 1}, + {45, 2}, + {20, 1}, + {5, 1}, + {10, 2}, + {13, 1}, + {38, 1}, + {32, 1}, + {33, 2}, + {37, 3}}}, + {1377, {{45, 1}, {23, 1}, {58, 1}, {46, 1}, {54, 1}, {47, 1}, {48, 2}}}, + {1378, {{14, 1}, {15, 2}, {7, 1}, {8, 2}}}, + {1380, {{10, 1}, {19, 1}, {14, 1}}}, + {1382, {{16, 1}, {19, 1}, {26, 1}, {24, 1}}}, + {1384, + {{41, 1}, + {44, 2}, + {45, 1}, + {42, 1}, + {25, 1}, + {29, 2}, + {28, 1}, + {47, 2}, + {2, 1}, + {49, 1}, + {14, 1}, + {48, 2}, + {38, 1}, + {50, 1}, + {33, 1}, + {40, 2}}}, + {1385, {{28, 1}, {5, 1}, {7, 1}, {6, 1}, {8, 2}, {10, 3}, {11, 1}}}, + {1391, {{12, 1}, {88, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {107, 1}, {100, 1}, {102, 2}, {103, 1}, {104, 2}, {106, 3}, + {89, 1}, {101, 2}, {15, 1}, {16, 2}, {80, 1}, {82, 1}, {84, 1}}}, + {1393, {{54, 1}, {61, 1}, {68, 1}, {41, 1}, {45, 1}, {44, 1}, {27, 1}, {28, 1}, {25, 1}}}, + {1394, {{24, 1}, {33, 1}, {23, 1}, {25, 2}, {27, 3}, {26, 1}, {30, 2}, + {31, 3}, {19, 1}, {20, 2}, {22, 3}, {6, 1}, {7, 2}, {3, 1}, + {4, 2}, {8, 3}, {29, 1}, {17, 1}, {15, 1}, {16, 1}, {28, 2}}}, + {1401, {{1, 1}, {3, 2}, {4, 3}}}, + {1407, {{26, 1}, {18, 1}, {25, 1}, {27, 2}, {29, 3}, {28, 1}, {32, 2}, + {33, 3}, {20, 1}, {21, 2}, {23, 3}, {6, 1}, {7, 2}, {3, 1}, + {4, 2}, {8, 3}, {31, 1}, {16, 1}, {11, 1}, {12, 1}, {30, 2}}}, + {1408, {{17, 1}, {12, 1}, {10, 1}}}, + {1438, {{30, 3}, {31, 6}, {14, 6}, {74, 8}, {89, 9}, {102, 11}, {29, 5}, {32, 6}, + {39, 4}, {40, 5}, {57, 1}, {60, 1}, {95, 1}, {85, 1}, {96, 1}, {36, 1}, + {6, 2}, {13, 4}, {81, 6}, {11, 9}, {12, 12}, {5, 11}, {7, 12}, {73, 13}, + {99, 12}, {100, 13}, {101, 14}, {91, 11}, {94, 12}, {97, 13}, {92, 11}, {98, 13}, + {34, 2}, {69, 6}, {70, 7}, {22, 7}, {23, 8}, {77, 1}, {109, 1}, {114, 1}}}, + {1439, {{2, 4}}}, + {1440, {{1, 1}, {40, 1}, {43, 1}, {54, 1}, {83, 1}, {78, 1}, {79, 1}, {74, 1}, {80, 1}, + {63, 2}, {59, 1}, {81, 1}, {51, 1}, {53, 1}, {38, 1}, {34, 1}, {47, 1}, {30, 1}, + {28, 1}, {16, 1}, {87, 1}, {86, 1}, {95, 1}, {20, 1}, {17, 1}, {10, 1}}}, + {1449, + {{14, 1}, + {33, 1}, + {26, 1}, + {28, 2}, + {29, 1}, + {30, 2}, + {32, 3}, + {15, 1}, + {27, 2}, + {6, 1}, + {8, 1}, + {10, 1}}}, + {1450, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {1463, + {{27, 1}, + {20, 1}, + {24, 2}, + {28, 3}, + {17, 1}, + {18, 2}, + {25, 3}, + {12, 1}, + {10, 1}, + {15, 1}, + {16, 2}, + {21, 3}, + {6, 1}, + {22, 2}, + {26, 3}}}, + {1464, + {{27, 1}, + {20, 1}, + {24, 2}, + {28, 3}, + {17, 1}, + {18, 2}, + {25, 3}, + {12, 1}, + {10, 1}, + {15, 1}, + {16, 2}, + {21, 3}, + {6, 1}, + {22, 2}, + {26, 3}}}, + {1466, + {{14, 1}, + {33, 1}, + {26, 1}, + {28, 2}, + {29, 1}, + {30, 2}, + {32, 3}, + {15, 1}, + {27, 2}, + {6, 1}, + {8, 1}, + {10, 1}}}, + {1468, + {{12, 1}, + {13, 2}, + {21, 3}, + {15, 1}, + {17, 1}, + {18, 2}, + {20, 3}, + {22, 1}, + {23, 2}, + {10, 1}, + {14, 1}, + {4, 1}, + {5, 2}, + {7, 3}}}, + {1479, {{40, 1}, {45, 2}, {48, 3}, {27, 1}, {37, 1}, {51, 2}, {57, 3}, {20, 1}, {24, 2}, + {28, 3}, {17, 1}, {18, 2}, {25, 3}, {12, 1}, {10, 1}, {15, 1}, {16, 2}, {21, 3}, + {6, 1}, {22, 2}, {26, 3}, {44, 1}, {50, 2}, {53, 3}, {39, 1}, {46, 2}, {35, 1}, + {36, 2}, {54, 3}, {47, 1}, {49, 2}, {55, 3}, {42, 1}, {52, 2}}}, + {1484, {{2, 1}, {3, 2}}}, + {1503, {{3, 1}, {4, 2}, {5, 3}, {6, 4}}}, + {1517, {{113, 1}, {97, 1}, {105, 2}, {102, 1}, {103, 2}, {107, 1}, {115, 2}, {100, 1}, + {104, 2}, {106, 3}, {12, 1}, {31, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, + {6, 2}, {13, 3}, {50, 1}, {43, 1}, {45, 2}, {46, 1}, {47, 2}, {49, 3}, + {32, 1}, {44, 2}, {15, 1}, {16, 2}, {23, 1}, {25, 1}, {27, 1}}}, + {1518, {{18, 1}, {16, 1}, {66, 1}, {70, 1}}}, + {1523, {{14, 1}, {15, 2}}}, + {1527, {{22, 1}, {23, 2}, {24, 3}, {16, 1}, {19, 2}, {20, 3}, {7, 1}, {27, 2}, {28, 3}}}, + {1536, {{22, 1}, {23, 2}, {24, 3}, {16, 1}, {19, 2}, {20, 3}, {7, 1}, {27, 2}, {28, 3}}}, + {1537, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {1539, + {{52, 1}, + {36, 1}, + {37, 2}, + {32, 1}, + {71, 1}, + {64, 1}, + {66, 2}, + {67, 1}, + {68, 2}, + {70, 3}, + {53, 1}, + {65, 2}, + {42, 1}, + {46, 1}, + {48, 1}}}, + {1540, + {{31, 1}, {33, 2}, {25, 1}, {26, 2}, {19, 1}, {30, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, + {7, 1}, {20, 1}, {22, 2}, {32, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {29, 3}}}, + {1541, + {{44, 1}, {53, 1}, {52, 1}, {55, 2}, {57, 3}, {56, 1}, {60, 2}, {61, 3}, {46, 1}, {47, 2}, + {49, 3}, {42, 1}, {50, 2}, {39, 1}, {40, 2}, {54, 3}, {59, 1}, {37, 1}, {32, 1}, {33, 1}, + {58, 2}, {22, 1}, {23, 2}, {24, 3}, {16, 1}, {19, 2}, {20, 3}, {7, 1}, {27, 2}, {28, 3}}}, + {1542, {{48, 1}, {57, 1}, {14, 1}, {56, 1}, {59, 2}, {61, 3}, {60, 1}, {64, 2}, {65, 3}, + {50, 1}, {51, 2}, {53, 3}, {46, 1}, {54, 2}, {43, 1}, {44, 2}, {58, 3}, {63, 1}, + {41, 1}, {36, 1}, {37, 1}, {62, 2}, {33, 1}, {26, 1}, {28, 2}, {29, 1}, {30, 2}, + {32, 3}, {15, 1}, {27, 2}, {6, 1}, {8, 1}, {10, 1}}}, + {1550, + {{21, 1}, + {26, 1}, + {20, 1}, + {7, 1}, + {11, 2}, + {17, 1}, + {22, 2}, + {19, 1}, + {23, 2}, + {24, 3}, + {9, 1}, + {13, 2}, + {8, 1}, + {10, 2}, + {12, 3}, + {2, 1}, + {3, 2}, + {4, 3}}}, + {1557, + {{23, 1}, + {27, 1}, + {13, 1}, + {22, 1}, + {7, 1}, + {4, 1}, + {18, 2}, + {21, 3}, + {6, 1}, + {11, 2}, + {40, 1}, + {46, 2}}}, + {1577, {{31, 1}, {52, 1}, {28, 1}, {29, 2}, {30, 3}, {24, 1}, {25, 2}, {32, 3}, {78, 1}, + {79, 2}, {74, 1}, {71, 1}, {64, 1}, {66, 2}, {67, 1}, {68, 2}, {70, 3}, {53, 1}, + {65, 2}, {34, 1}, {35, 2}, {42, 1}, {46, 1}, {106, 1}, {105, 1}, {99, 1}, {48, 1}}}, + {1591, + {{24, 1}, + {35, 1}, + {21, 1}, + {22, 2}, + {27, 1}, + {39, 1}, + {41, 2}, + {37, 1}, + {49, 2}, + {34, 1}, + {9, 1}}}, + {1592, {{21, 1}, {22, 2}}}, + {1598, {{12, 1}, {80, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {99, 1}, {92, 1}, {94, 2}, {95, 1}, {96, 2}, {98, 3}, + {81, 1}, {93, 2}, {15, 1}, {16, 2}, {70, 1}, {74, 1}, {76, 1}}}, + {1599, + {{68, 1}, + {73, 1}, + {67, 1}, + {54, 1}, + {58, 2}, + {64, 1}, + {69, 2}, + {66, 1}, + {70, 2}, + {71, 3}, + {56, 1}, + {60, 2}, + {55, 1}, + {57, 2}, + {59, 3}, + {49, 1}, + {50, 2}, + {51, 3}}}, + {1600, {{12, 1}, {31, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {50, 1}, {43, 1}, {45, 2}, {46, 1}, {47, 2}, {49, 3}, + {32, 1}, {44, 2}, {15, 1}, {16, 2}, {23, 1}, {25, 1}, {27, 1}}}, + {1601, + {{25, 1}, {27, 2}, {28, 3}, {24, 1}, {26, 2}, {13, 1}, {14, 2}, {17, 3}, {15, 1}, {16, 2}, + {20, 3}, {21, 1}, {6, 1}, {9, 2}, {11, 1}, {18, 2}, {19, 3}, {1, 1}, {4, 2}, {5, 3}}}, + {1603, + {{119, 1}, + {114, 1}, + {112, 1}, + {126, 1}, + {137, 1}, + {136, 1}, + {141, 1}, + {130, 1}, + {127, 1}, + {121, 1}}}, + {1605, + {{25, 1}, {27, 2}, {28, 3}, {24, 1}, {26, 2}, {13, 1}, {14, 2}, {17, 3}, {15, 1}, {16, 2}, + {20, 3}, {21, 1}, {6, 1}, {9, 2}, {11, 1}, {18, 2}, {19, 3}, {1, 1}, {4, 2}, {5, 3}}}, + {1620, + {{56, 1}, + {57, 2}, + {53, 1}, + {54, 2}, + {50, 1}, + {51, 2}, + {20, 1}, + {77, 2}, + {29, 1}, + {43, 2}, + {25, 1}, + {40, 2}, + {63, 1}, + {23, 1}, + {42, 2}, + {79, 3}, + {26, 1}, + {41, 2}, + {39, 1}}}, + {1621, {{82, 1}, {150, 2}, {152, 3}, {151, 1}, {74, 1}, {75, 2}, {79, 3}, {90, 4}, {91, 5}, + {31, 1}, {40, 2}, {89, 3}, {158, 1}, {156, 1}, {159, 2}, {160, 3}, {18, 1}, {53, 1}, + {15, 1}, {16, 2}, {17, 3}, {11, 1}, {12, 2}, {19, 3}, {72, 1}, {65, 1}, {67, 2}, + {68, 1}, {69, 2}, {71, 3}, {54, 1}, {66, 2}, {21, 1}, {22, 2}, {45, 1}, {47, 1}, + {33, 1}, {34, 2}, {36, 3}, {35, 1}, {37, 2}, {38, 3}, {26, 1}, {28, 2}, {32, 3}, + {49, 1}, {166, 1}, {170, 2}, {173, 1}, {174, 2}, {169, 1}, {171, 1}, {172, 2}, {2, 1}, + {165, 2}, {168, 3}, {125, 1}, {121, 1}, {123, 2}}}, + {1623, {{12, 1}, {24, 2}, {37, 3}, {11, 1}, {17, 2}, {28, 3}, {16, 1}, {27, 2}, + {31, 3}, {35, 1}, {36, 2}, {18, 1}, {20, 2}, {25, 1}, {26, 2}, {30, 3}, + {23, 1}, {33, 2}, {10, 1}, {19, 2}, {9, 1}, {29, 2}}}, + {1624, {{58, 1}, {78, 1}, {55, 1}, {56, 2}, {57, 3}, {51, 1}, {52, 2}, {59, 3}, {9, 1}, + {10, 2}, {11, 3}, {7, 1}, {12, 2}, {13, 3}, {2, 1}, {3, 2}, {4, 3}, {97, 1}, + {90, 1}, {92, 2}, {93, 1}, {94, 2}, {96, 3}, {79, 1}, {91, 2}, {61, 1}, {62, 2}, + {68, 1}, {72, 1}, {74, 1}, {39, 1}, {30, 1}, {38, 1}, {41, 2}, {43, 3}, {42, 1}, + {46, 2}, {47, 3}, {32, 1}, {33, 2}, {35, 3}, {28, 1}, {36, 2}, {25, 1}, {26, 2}, + {40, 3}, {45, 1}, {23, 1}, {18, 1}, {19, 1}, {44, 2}}}, + {1632, {{38, 1}, {34, 1}, {6, 1}, {43, 1}, {11, 1}, {25, 2}}}, + {1633, {{18, 1}}}, + {1635, {{11, 1}, {12, 2}, {13, 3}, {9, 1}, {14, 2}, {15, 3}, {4, 1}, {5, 2}, {6, 3}, {20, 1}}}, + {1653, {{4, 1}, {5, 2}}}, + {1663, {{9, 1}, {10, 2}, {11, 3}, {7, 1}, {12, 2}, {13, 3}, {2, 1}, {3, 2}, {4, 3}, + {30, 1}, {39, 2}, {53, 3}, {51, 1}, {57, 2}, {56, 1}, {58, 2}, {60, 3}, {25, 1}, + {26, 2}, {27, 3}, {23, 1}, {46, 2}, {49, 3}, {40, 1}, {41, 2}, {55, 3}, {43, 1}, + {44, 2}, {52, 3}, {32, 1}, {33, 2}, {61, 3}, {20, 1}, {21, 2}, {42, 3}, {35, 1}, + {47, 2}, {54, 3}, {34, 1}, {37, 2}, {50, 3}, {31, 1}, {48, 2}, {59, 3}}}, + {1707, {{1, 1}}}, + {1712, {{17, 1}, {12, 1}, {10, 1}}}, + {1714, {{12, 1}, {35, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {54, 1}, {47, 1}, {49, 2}, {50, 1}, {51, 2}, {53, 3}, + {36, 1}, {48, 2}, {15, 1}, {16, 2}, {25, 1}, {29, 1}, {31, 1}}}, + {1715, {{39, 1}, {34, 1}, {32, 1}}}, + {1717, {{12, 1}, {58, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {77, 1}, {70, 1}, {72, 2}, {73, 1}, {74, 2}, {76, 3}, + {59, 1}, {71, 2}, {15, 1}, {16, 2}, {50, 1}, {52, 1}, {54, 1}}}, + {1756, + {{47, 1}, {68, 1}, {44, 1}, {45, 2}, {46, 3}, {40, 1}, {41, 2}, {48, 3}, {87, 1}, {80, 1}, + {82, 2}, {83, 1}, {84, 2}, {86, 3}, {69, 1}, {81, 2}, {50, 1}, {51, 2}, {58, 1}, {62, 1}, + {14, 1}, {15, 2}, {34, 3}, {24, 1}, {30, 2}, {31, 3}, {20, 1}, {21, 2}, {25, 3}, {23, 1}, + {16, 1}, {17, 2}, {19, 3}, {27, 1}, {28, 2}, {29, 3}, {64, 1}}}, + {1758, {{13, 1}}}, + {1766, {{12, 1}, {31, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {50, 1}, {43, 1}, {45, 2}, {46, 1}, {47, 2}, {49, 3}, + {32, 1}, {44, 2}, {15, 1}, {16, 2}, {23, 1}, {25, 1}, {27, 1}}}, + {1767, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {1784, {{1, 1}, {3, 2}, {4, 3}, {6, 1}}}, + {1795, + {{92, 1}, {147, 2}, {71, 2}, {34, 1}, {44, 1}, {43, 1}, {68, 1}, {69, 2}, {70, 3}, + {64, 1}, {65, 2}, {72, 3}, {152, 1}, {146, 1}, {42, 1}, {45, 2}, {47, 3}, {46, 1}, + {50, 2}, {51, 3}, {36, 1}, {37, 2}, {39, 3}, {32, 1}, {40, 2}, {49, 1}, {29, 1}, + {24, 1}, {25, 1}, {48, 2}, {111, 1}, {104, 1}, {106, 2}, {107, 1}, {108, 2}, {110, 3}, + {93, 1}, {105, 2}, {74, 1}, {75, 2}, {133, 1}, {137, 2}, {82, 1}, {86, 1}, {143, 1}, + {148, 2}, {145, 1}, {149, 2}, {150, 3}, {135, 1}, {139, 2}, {134, 1}, {136, 2}, {138, 3}, + {128, 1}, {129, 2}, {130, 3}, {17, 1}, {12, 1}, {10, 1}, {88, 1}}}, + {1808, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {1810, {{50, 1}, {59, 1}, {16, 1}, {58, 1}, {61, 2}, {63, 3}, {62, 1}, {66, 2}, {67, 3}, + {52, 1}, {53, 2}, {55, 3}, {48, 1}, {56, 2}, {45, 1}, {46, 2}, {60, 3}, {65, 1}, + {43, 1}, {38, 1}, {39, 1}, {64, 2}, {35, 1}, {28, 1}, {30, 2}, {31, 1}, {32, 2}, + {34, 3}, {17, 1}, {29, 2}, {6, 1}, {10, 1}, {12, 1}}}, + {1811, + {{32, 1}, {34, 2}, {25, 1}, {26, 2}, {19, 1}, {31, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, + {7, 1}, {20, 1}, {22, 2}, {33, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {30, 3}}}, + {1812, + {{13, 1}, + {14, 2}, + {15, 3}, + {18, 1}, + {21, 1}, + {22, 2}, + {25, 3}, + {19, 1}, + {23, 2}, + {11, 1}, + {17, 1}, + {5, 1}, + {6, 2}, + {8, 3}}}, + {1826, {{30, 1}, {17, 1}}}, + {1835, {{20, 1}, {23, 2}, {21, 1}, {26, 1}, {19, 1}, {22, 2}}}, + {1838, {{2, 1}}}, + {1839, {{3, 1}, {1, 1}, {4, 2}, {5, 3}}}, + {1848, {{37, 1}, {31, 1}, {6, 1}, {17, 2}, {84, 3}, {89, 4}, {26, 1}, {30, 2}, {25, 1}, + {28, 2}, {53, 1}, {54, 2}, {59, 3}, {29, 1}, {66, 1}, {91, 2}, {68, 1}, {77, 2}, + {83, 3}, {20, 1}, {69, 2}, {81, 3}, {78, 1}, {79, 2}, {82, 3}, {61, 1}, {62, 2}, + {63, 3}, {67, 4}, {80, 1}, {88, 2}, {90, 3}, {12, 1}, {75, 2}, {76, 3}, {21, 1}, + {27, 2}, {64, 3}, {93, 1}, {94, 2}, {9, 1}, {13, 2}, {14, 3}}}, + {1849, {{12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, + {34, 1}, {46, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {1864, + {{13, 1}, + {16, 2}, + {70, 1}, + {68, 1}, + {71, 1}, + {9, 1}, + {14, 2}, + {32, 1}, + {67, 1}, + {22, 1}, + {36, 1}, + {52, 1}, + {69, 1}}}, + {1866, {{121, 1}, {142, 1}, {118, 1}, {119, 2}, {120, 3}, {114, 1}, {115, 2}, {122, 3}, + {161, 1}, {154, 1}, {156, 2}, {157, 1}, {158, 2}, {160, 3}, {143, 1}, {155, 2}, + {124, 1}, {125, 2}, {132, 1}, {136, 1}, {90, 1}, {138, 1}}}, + {1925, + {{61, 1}, + {39, 1}, + {34, 1}, + {35, 1}, + {42, 1}, + {28, 1}, + {49, 2}, + {46, 1}, + {54, 1}, + {56, 2}, + {53, 1}, + {65, 1}, + {51, 1}, + {69, 2}, + {52, 1}, + {19, 1}, + {67, 1}}}, + {1927, {{1, 1}, {3, 2}, {4, 3}, {5, 1}}}, + {1938, {{24, 1}, {26, 2}, {7, 1}}}, + {1950, {{27, 6}, {28, 7}, {9, 4}, {90, 5}, {114, 6}, {123, 7}, {26, 1}, {29, 3}, + {103, 1}, {66, 1}, {108, 1}, {34, 1}, {35, 3}, {65, 2}, {67, 3}, {68, 4}, + {105, 4}, {76, 1}, {113, 1}, {75, 1}, {6, 2}, {14, 4}, {99, 6}, {11, 9}, + {13, 12}, {5, 12}, {7, 13}, {91, 14}, {119, 13}, {120, 14}, {125, 15}, {116, 12}, + {121, 14}, {122, 15}, {117, 13}, {118, 14}, {31, 5}, {58, 6}, {59, 7}, {20, 7}}}, + {1951, {{2, 4}}}, + {1956, {{11, 1}}}, + {1967, + {{7, 3}, {13, 3}, {29, 3}, {48, 1}, {11, 1}, {19, 2}, {23, 1}, {36, 1}, {37, 2}, {41, 3}, + {45, 1}, {46, 2}, {55, 1}, {56, 2}, {51, 1}, {35, 1}, {38, 2}, {39, 1}, {42, 3}, {43, 4}, + {14, 1}, {17, 2}, {24, 3}, {12, 1}, {21, 2}, {15, 1}, {16, 2}, {62, 1}}}, + {1968, + {{35, 1}, {47, 2}, {60, 3}, {34, 1}, {40, 2}, {51, 3}, {39, 1}, {50, 2}, {54, 3}, {58, 1}, + {59, 2}, {41, 1}, {43, 2}, {5, 1}, {9, 2}, {7, 1}, {10, 2}, {13, 3}, {48, 1}, {49, 2}, + {53, 3}, {46, 1}, {56, 2}, {33, 1}, {42, 2}, {32, 1}, {52, 2}, {86, 1}, {88, 2}, {89, 3}, + {85, 1}, {87, 2}, {74, 1}, {75, 2}, {78, 3}, {76, 1}, {77, 2}, {81, 3}, {82, 1}, {67, 1}, + {70, 2}, {72, 1}, {79, 2}, {80, 3}, {62, 1}, {65, 2}, {66, 3}}}, + {1971, + {{24, 1}, + {13, 1}, + {16, 1}, + {27, 1}, + {40, 2}, + {46, 1}, + {47, 1}, + {3, 1}, + {9, 2}, + {10, 3}, + {7, 1}, + {15, 2}}}, + {1973, {{32, 1}, {3, 1}, {1, 1}, {4, 2}, {5, 3}}}, + {1974, {{18, 1}, {19, 2}}}, + {1987, {{9, 1}, {10, 2}, {11, 3}, {12, 1}, {5, 1}, {6, 2}, {13, 3}, {15, 1}, {16, 2}}}, + {2001, {{8, 1}}}, + {2048, {{13, 1}, {18, 2}, {21, 3}, {56, 1}, {10, 1}, {24, 2}, {30, 3}, {49, 1}, {53, 2}, + {57, 3}, {46, 1}, {47, 2}, {54, 3}, {41, 1}, {39, 1}, {44, 1}, {45, 2}, {50, 3}, + {35, 1}, {51, 2}, {55, 3}, {17, 1}, {23, 2}, {26, 3}, {12, 1}, {19, 2}, {8, 1}, + {9, 2}, {27, 3}, {20, 1}, {22, 2}, {28, 3}, {15, 1}, {25, 2}}}, + {2055, + {{149, 1}, + {131, 1}, + {106, 1}, + {80, 1}, + {84, 1}, + {92, 2}, + {86, 1}, + {87, 2}, + {72, 1}, + {73, 2}, + {114, 1}, + {63, 1}, + {100, 2}, + {109, 1}, + {143, 1}, + {110, 1}, + {93, 1}, + {104, 1}}}, + {2056, {{14, 1}, {15, 2}}}, + {2058, + {{170, 1}, + {112, 1}, + {104, 1}, + {110, 2}, + {111, 1}, + {114, 2}, + {97, 1}, + {98, 2}, + {133, 1}, + {96, 1}, + {157, 2}, + {155, 1}, + {125, 1}, + {143, 1}, + {127, 1}, + {119, 1}}}, + {2059, {{15, 1}, {16, 2}}}, + {2065, + {{102, 1}, + {92, 1}, + {98, 2}, + {96, 1}, + {99, 2}, + {84, 1}, + {85, 2}, + {87, 1}, + {83, 1}, + {100, 2}, + {107, 1}, + {110, 1}, + {115, 1}, + {104, 1}, + {112, 1}, + {109, 1}}}, + {2066, {{14, 1}, {15, 2}}}, + {2067, + {{57, 1}, + {58, 2}, + {59, 3}, + {60, 1}, + {53, 1}, + {54, 2}, + {61, 3}, + {46, 1}, + {47, 2}, + {42, 1}, + {63, 1}, + {64, 2}}}, + {2071, + {{12, 1}, + {13, 2}, + {14, 3}, + {17, 1}, + {20, 1}, + {21, 2}, + {26, 3}, + {18, 1}, + {24, 2}, + {10, 1}, + {16, 1}, + {4, 1}, + {5, 2}, + {7, 3}}}, + {2091, {{13, 1}}}, + {2094, {{12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, + {34, 1}, {46, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2095, + {{27, 1}, + {20, 1}, + {24, 2}, + {28, 3}, + {17, 1}, + {18, 2}, + {25, 3}, + {12, 1}, + {10, 1}, + {15, 1}, + {16, 2}, + {21, 3}, + {6, 1}, + {22, 2}, + {26, 3}}}, + {2130, {{9, 1}, {10, 2}, {11, 3}, {12, 1}, {5, 1}, {6, 2}, {13, 3}, {15, 1}, {16, 2}}}, + {2131, + {{6, 3}, + {12, 3}, + {10, 3}, + {18, 4}, + {22, 1}, + {13, 1}, + {16, 2}, + {23, 3}, + {11, 1}, + {20, 2}, + {14, 1}, + {15, 2}}}, + {2133, {{4, 1}, {8, 2}, {6, 1}, {9, 2}, {12, 3}}}, + {2140, {{23, 1}, {17, 1}, {29, 1}, {19, 1}, {28, 1}, {1, 1}}}, + {2142, {{3, 1}, {1, 1}, {4, 2}, {5, 3}, {18, 1}, {39, 1}, {15, 1}, {16, 2}, {17, 3}, + {11, 1}, {12, 2}, {19, 3}, {58, 1}, {51, 1}, {53, 2}, {54, 1}, {55, 2}, {57, 3}, + {40, 1}, {52, 2}, {21, 1}, {22, 2}, {29, 1}, {33, 1}, {35, 1}}}, + {2167, {{17, 1}, {24, 1}, {23, 1}, {10, 1}, {15, 2}}}, + {2189, {{14, 1}, {25, 1}, {13, 1}, {18, 1}, {12, 1}, {16, 2}}}, + {2191, + {{19, 1}, {25, 2}, {5, 1}, {15, 1}, {14, 1}, {20, 2}, {18, 1}, {23, 2}, {13, 1}, {16, 2}}}, + {2199, + {{13, 1}, {26, 2}, {15, 1}, {14, 1}, {19, 2}, {18, 1}, {22, 2}, {10, 1}, {16, 2}, {25, 3}}}, + {2210, + {{21, 1}, {28, 1}, {29, 1}, {31, 2}, {50, 1}, {53, 1}, {48, 1}, {51, 2}, {5, 1}, {6, 2}, + {1, 1}, {2, 2}, {3, 3}, {33, 1}, {34, 2}, {26, 1}, {20, 1}, {23, 2}, {30, 3}, {36, 1}}}, + {2220, {{11, 1}, {4, 1}, {5, 2}, {6, 1}, {7, 2}, {8, 3}, {3, 1}}}, + {2233, {{24, 1}, {98, 1}, {48, 1}, {38, 1}, {27, 1}, {43, 2}, {100, 1}, + {44, 1}, {103, 1}, {3, 1}, {50, 1}, {17, 1}, {22, 2}, {102, 1}, + {66, 1}, {106, 1}, {96, 1}, {104, 1}, {105, 1}, {54, 1}}}, + {2235, {{2, 1}, {5, 2}, {21, 1}, {30, 1}, {29, 1}, {22, 1}}}, + {2237, {{24, 1}, {45, 1}, {21, 1}, {22, 2}, {23, 3}, {17, 1}, {18, 2}, + {25, 3}, {63, 1}, {57, 1}, {59, 2}, {53, 1}, {60, 2}, {62, 3}, + {46, 1}, {58, 2}, {27, 1}, {28, 2}, {35, 1}, {39, 1}, {41, 1}}}, + {2249, {{22, 1}, {7, 1}, {2, 1}, {14, 1}}}, + {2270, {{46, 1}, {16, 1}, {43, 1}, {44, 2}, {45, 3}, {39, 1}, {40, 2}, + {47, 3}, {35, 1}, {28, 1}, {30, 2}, {31, 1}, {32, 2}, {34, 3}, + {17, 1}, {29, 2}, {49, 1}, {50, 2}, {6, 1}, {10, 1}, {12, 1}}}, + {2274, {{2, 1}, {3, 2}}}, + {2292, {{25, 1}, {16, 1}, {24, 1}, {27, 2}, {29, 3}, {28, 1}, {32, 2}, + {33, 3}, {18, 1}, {19, 2}, {21, 3}, {14, 1}, {22, 2}, {11, 1}, + {12, 2}, {26, 3}, {31, 1}, {9, 1}, {4, 1}, {5, 1}, {30, 2}}}, + {2293, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {2302, {{9, 1}, {10, 2}, {11, 3}, {12, 1}, {5, 1}, {6, 2}, {13, 3}, {15, 1}, {16, 2}}}, + {2306, {{12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, {13, 3}, + {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, {34, 1}, {46, 2}, + {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}, {62, 1}, {63, 2}, {58, 1}}}, + {2311, + {{27, 1}, + {20, 1}, + {24, 2}, + {28, 3}, + {17, 1}, + {18, 2}, + {25, 3}, + {12, 1}, + {10, 1}, + {15, 1}, + {16, 2}, + {21, 3}, + {6, 1}, + {22, 2}, + {26, 3}}}, + {2323, {{12, 1}, {13, 2}, {14, 3}, {17, 1}, {57, 1}, {59, 2}, {20, 1}, {21, 2}, {26, 3}, + {18, 1}, {24, 2}, {10, 1}, {16, 1}, {4, 1}, {5, 2}, {7, 3}, {50, 1}, {51, 2}, + {44, 1}, {56, 2}, {38, 1}, {48, 2}, {49, 3}, {42, 1}, {32, 1}, {45, 1}, {47, 2}, + {58, 3}, {31, 1}, {33, 2}, {36, 3}, {40, 1}, {43, 2}, {55, 3}}}, + {2327, + {{14, 1}, + {9, 1}, + {10, 2}, + {15, 3}, + {20, 1}, + {17, 1}, + {5, 1}, + {7, 2}, + {11, 3}, + {12, 4}, + {13, 1}}}, + {2328, {{1, 1}}}, + {2333, {{8, 1}, {10, 2}}}, + {2336, + {{24, 1}, {27, 2}, {38, 3}, {23, 1}, {16, 1}, {14, 1}, {15, 2}, {26, 3}, {33, 1}, {35, 2}, + {31, 1}, {32, 2}, {34, 3}, {17, 1}, {25, 2}, {36, 3}, {22, 1}, {9, 1}, {11, 2}, {28, 3}}}, + {2340, {{1, 1}, {24, 1}, {3, 1}, {6, 2}, {29, 1}, {26, 1}, {22, 1}, {27, 1}}}, + {2342, + {{14, 1}, {12, 1}, {15, 2}, {29, 1}, {31, 1}, {13, 1}, {4, 1}, {32, 1}, {33, 2}, {25, 1}}}, + {2343, {{11, 1}}}, + {2345, {{7, 1}, {6, 1}, {9, 2}, {25, 1}, {11, 1}, {4, 1}, {40, 1}, {26, 1}}}, + {2346, {{8, 1}}}, + {2347, + {{1, 1}, {4, 2}, {10, 1}, {23, 1}, {22, 1}, {20, 1}, {21, 2}, {17, 1}, {11, 1}, {13, 1}}}, + {2348, {{10, 1}, {11, 2}, {6, 1}}}, + {2349, + {{32, 1}, {34, 2}, {25, 1}, {26, 2}, {19, 1}, {31, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, + {7, 1}, {20, 1}, {22, 2}, {33, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {30, 3}}}, + {2362, {{12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, + {34, 1}, {46, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2367, {{12, 1}, {33, 1}, {71, 1}, {72, 2}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, {69, 1}, {70, 2}, + {67, 1}, {68, 2}, {65, 1}, {66, 2}, {63, 1}, {64, 2}, {61, 1}, {62, 2}, {34, 1}, + {46, 2}, {59, 1}, {60, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2428, {{10, 1}}}, + {2431, + {{6, 1}, + {21, 1}, + {15, 1}, + {26, 2}, + {28, 1}, + {33, 2}, + {29, 1}, + {14, 1}, + {17, 2}, + {23, 3}, + {25, 1}, + {5, 1}, + {8, 2}, + {22, 3}, + {20, 1}, + {24, 2}}}, + {2432, {{12, 2}, {63, 3}, {57, 2}, {61, 1}, {69, 2}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, + {5, 1}, {6, 2}, {13, 3}, {73, 1}, {64, 1}, {67, 2}, {74, 3}, {62, 1}, {71, 2}, + {65, 1}, {66, 2}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, {34, 1}, + {46, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2483, + {{18, 1}, + {23, 2}, + {17, 1}, + {24, 1}, + {6, 1}, + {10, 1}, + {19, 2}, + {5, 1}, + {7, 2}, + {22, 3}, + {25, 1}}}, + {2484, + {{20, 1}, + {22, 2}, + {28, 1}, + {14, 1}, + {18, 1}, + {24, 2}, + {17, 1}, + {27, 2}, + {11, 1}, + {15, 2}, + {29, 3}}}, + {2485, + {{15, 1}, + {23, 2}, + {25, 1}, + {4, 1}, + {17, 1}, + {26, 2}, + {7, 1}, + {22, 2}, + {5, 1}, + {10, 2}, + {20, 3}}}, + {2486, + {{24, 1}, + {30, 2}, + {27, 1}, + {12, 1}, + {16, 1}, + {21, 2}, + {15, 1}, + {25, 2}, + {9, 1}, + {13, 2}, + {26, 3}}}, + {2487, + {{18, 1}, + {27, 2}, + {24, 1}, + {12, 1}, + {19, 1}, + {20, 2}, + {15, 1}, + {23, 2}, + {9, 1}, + {13, 2}, + {26, 1}}}, + {2501, {{34, 1}, {33, 1}, {31, 1}}}, + {2508, + {{60, 1}, + {47, 1}, + {40, 1}, + {11, 1}, + {12, 2}, + {42, 1}, + {17, 1}, + {29, 2}, + {10, 1}, + {20, 2}, + {39, 1}, + {19, 1}, + {26, 2}, + {25, 1}, + {44, 1}}}, + {2509, {{5, 1}, {6, 2}}}, + {2512, + {{9, 1}, {10, 2}, {11, 3}, {12, 1}, {34, 1}, {131, 1}, {132, 2}, {133, 3}, {5, 1}, {6, 2}, + {13, 3}, {71, 1}, {72, 2}, {84, 3}, {85, 1}, {93, 2}, {108, 1}, {82, 1}, {83, 2}, {76, 1}, + {77, 2}, {78, 1}, {79, 2}, {81, 3}, {92, 1}, {89, 1}, {91, 2}, {94, 3}, {87, 1}, {88, 2}, + {56, 1}, {57, 2}, {58, 3}, {53, 1}, {46, 1}, {48, 2}, {49, 1}, {50, 2}, {52, 3}, {35, 1}, + {47, 2}, {15, 1}, {16, 2}, {24, 1}, {28, 1}, {30, 1}}}, + {2513, {{12, 1}, {24, 2}, {37, 3}, {11, 1}, {17, 2}, {28, 3}, {16, 1}, {27, 2}, + {31, 3}, {35, 1}, {36, 2}, {18, 1}, {20, 2}, {50, 1}, {25, 1}, {26, 2}, + {30, 3}, {23, 1}, {33, 2}, {10, 1}, {19, 2}, {9, 1}, {29, 2}, {51, 1}, + {54, 2}, {55, 1}, {44, 1}, {45, 2}, {53, 3}, {46, 1}, {49, 2}, {52, 3}}}, + {2530, {{26, 5}, {27, 6}, {9, 4}, {87, 5}, {109, 6}, {120, 7}, {25, 1}, {28, 3}, + {101, 1}, {63, 1}, {102, 1}, {33, 1}, {34, 3}, {62, 2}, {64, 3}, {65, 4}, + {104, 4}, {73, 1}, {107, 1}, {72, 1}, {6, 2}, {14, 4}, {99, 6}, {11, 9}, + {13, 12}, {5, 12}, {7, 13}, {88, 14}, {119, 13}, {124, 14}, {125, 15}, {111, 12}, + {112, 14}, {114, 15}, {121, 13}, {122, 14}, {30, 5}, {55, 6}, {56, 7}, {20, 7}}}, + {2531, {{2, 4}}}, + {2553, {{16, 1}, {17, 2}, {18, 3}, {19, 1}, {12, 1}, {13, 2}, {20, 3}, {22, 1}, {23, 2}}}, + {2596, {{72, 1}, {81, 1}, {38, 1}, {118, 1}, {119, 2}, {114, 1}, {80, 1}, {83, 2}, {85, 3}, + {84, 1}, {88, 2}, {89, 3}, {74, 1}, {75, 2}, {77, 3}, {70, 1}, {78, 2}, {67, 1}, + {68, 2}, {82, 3}, {87, 1}, {65, 1}, {60, 1}, {61, 1}, {86, 2}, {57, 1}, {50, 1}, + {52, 2}, {53, 1}, {54, 2}, {56, 3}, {39, 1}, {51, 2}, {28, 1}, {32, 1}, {34, 1}}}, + {2597, + {{101, 1}, {65, 1}, {66, 2}, {67, 3}, {70, 2}, {105, 1}, {91, 1}, {34, 1}, {38, 2}, {36, 1}, + {39, 2}, {42, 3}, {100, 1}, {85, 1}, {82, 1}, {96, 2}, {99, 3}, {84, 1}, {89, 2}, {73, 1}, + {74, 2}, {79, 3}, {71, 1}, {77, 2}, {63, 1}, {69, 1}, {57, 1}, {58, 2}, {60, 3}, {25, 1}, + {27, 2}, {28, 3}, {24, 1}, {26, 2}, {13, 1}, {14, 2}, {17, 3}, {15, 1}, {16, 2}, {20, 3}, + {21, 1}, {6, 1}, {9, 2}, {11, 1}, {18, 2}, {19, 3}, {1, 1}, {4, 2}, {5, 3}}}, + {2599, + {{23, 1}, + {30, 2}, + {8, 1}, + {20, 1}, + {19, 1}, + {24, 2}, + {22, 1}, + {27, 2}, + {4, 1}, + {17, 2}, + {29, 3}, + {13, 1}}}, + {2601, {{12, 1}, {37, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {56, 1}, {49, 1}, {51, 2}, {52, 1}, {53, 2}, {55, 3}, + {38, 1}, {50, 2}, {15, 1}, {16, 2}, {27, 1}, {31, 1}, {33, 1}}}, + {2605, {{29, 6}, {86, 3}, {113, 4}, {24, 1}, {30, 2}, {63, 1}, {104, 1}, {33, 1}, + {34, 3}, {62, 2}, {64, 3}, {65, 4}, {98, 4}, {73, 1}, {110, 1}, {72, 1}, + {5, 2}, {4, 1}, {6, 3}, {87, 8}, {115, 9}, {116, 11}, {121, 12}, {56, 10}, + {106, 9}, {120, 10}, {122, 11}, {118, 9}, {119, 11}, {20, 4}}}, + {2606, {{2, 4}}}, + {2615, {{5, 1}}}, + {2616, {{29, 1}, {31, 2}, {32, 3}, {45, 1}, {48, 1}, {56, 1}, {21, 1}, + {22, 2}, {26, 3}, {16, 1}, {46, 1}, {53, 2}, {54, 3}, {11, 1}, + {14, 2}, {15, 3}, {25, 4}, {42, 1}, {41, 1}, {47, 2}, {24, 1}}}, + {2617, + {{55, 1}, + {57, 2}, + {58, 3}, + {49, 1}, + {47, 1}, + {50, 2}, + {37, 1}, + {38, 2}, + {39, 3}, + {42, 1}, + {53, 2}, + {59, 3}, + {8, 1}, + {12, 2}, + {19, 3}, + {51, 4}, + {43, 1}, + {44, 2}, + {40, 1}}}, + {2619, {{55, 1}, {57, 2}, {58, 3}, {37, 1}, {53, 1}, {64, 1}, {44, 1}, + {45, 2}, {46, 3}, {29, 1}, {51, 1}, {59, 2}, {63, 1}, {25, 1}, + {26, 2}, {48, 3}, {68, 4}, {50, 1}, {65, 1}, {1, 1}, {3, 2}}}, + {2620, + {{44, 1}, + {46, 2}, + {47, 3}, + {34, 1}, + {38, 1}, + {15, 1}, + {23, 2}, + {24, 3}, + {4, 1}, + {28, 1}, + {33, 2}, + {41, 1}, + {10, 1}, + {11, 2}, + {16, 3}, + {39, 4}, + {26, 1}, + {27, 2}, + {36, 1}}}, + {2621, + {{22, 1}, {43, 1}, {19, 1}, {20, 2}, {21, 3}, {15, 1}, {16, 2}, {23, 3}, {62, 1}, {55, 1}, + {57, 2}, {58, 1}, {59, 2}, {61, 3}, {44, 1}, {56, 2}, {25, 1}, {26, 2}, {33, 1}, {108, 1}, + {37, 1}, {71, 1}, {39, 1}, {113, 1}, {76, 1}, {80, 1}, {81, 2}, {82, 3}}}, + {2624, {{69, 1}}}, + {2627, {{4, 1}, {5, 2}, {6, 3}}}, + {2628, {{29, 1}, {38, 1}, {24, 1}, {42, 1}}}, + {2632, {{50, 1}, {62, 1}, {22, 1}, {24, 1}, {38, 1}, {49, 1}, {34, 1}, + {20, 1}, {17, 1}, {19, 2}, {32, 1}, {13, 1}, {5, 1}, {23, 1}, + {54, 1}, {67, 1}, {31, 1}, {27, 1}, {59, 2}, {61, 1}, {56, 1}}}, + {2633, + {{39, 1}, + {16, 1}, + {35, 1}, + {53, 1}, + {49, 1}, + {23, 1}, + {12, 1}, + {4, 1}, + {37, 2}, + {24, 1}, + {15, 1}, + {33, 1}, + {17, 1}, + {48, 1}, + {61, 1}, + {31, 1}, + {28, 1}, + {52, 2}, + {56, 1}}}, + {2637, + {{33, 1}, + {14, 1}, + {50, 1}, + {26, 1}, + {18, 1}, + {6, 1}, + {25, 2}, + {23, 1}, + {13, 1}, + {17, 1}, + {28, 1}, + {62, 1}, + {51, 1}, + {36, 1}}}, + {2638, {{32, 1}, {37, 1}}}, + {2639, + {{12, 1}, {72, 1}, {99, 1}, {102, 2}, {109, 3}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, + {6, 2}, {13, 3}, {91, 1}, {84, 1}, {86, 2}, {87, 1}, {88, 2}, {90, 3}, {73, 1}, + {85, 2}, {107, 1}, {108, 2}, {128, 3}, {35, 1}, {36, 2}, {100, 3}, {32, 1}, {98, 2}, + {112, 3}, {105, 1}, {110, 2}, {111, 3}, {96, 1}, {101, 2}, {97, 1}, {106, 2}, {103, 1}, + {104, 2}, {126, 1}, {127, 2}, {15, 1}, {16, 2}, {62, 1}, {66, 1}, {56, 1}, {57, 2}, + {58, 3}, {50, 1}, {51, 2}, {52, 3}, {55, 1}, {45, 1}, {47, 2}, {48, 3}, {39, 1}, + {40, 2}, {41, 3}, {68, 1}}}, + {2640, + {{54, 1}, + {23, 1}, + {26, 1}, + {57, 1}, + {55, 1}, + {39, 1}, + {11, 1}, + {12, 1}, + {35, 2}, + {16, 1}, + {31, 1}, + {6, 1}, + {37, 1}, + {24, 1}, + {64, 1}, + {33, 1}, + {36, 1}, + {56, 2}}}, + {2644, {{27, 1}, {18, 1}}}, + {2647, {{22, 1}, {14, 1}}}, + {2650, {{21, 1}, {15, 1}}}, + {2653, {{75, 1}, {78, 2}, {85, 3}, {36, 1}, {55, 1}, {48, 1}, {50, 2}, {51, 1}, {52, 2}, + {54, 3}, {37, 1}, {49, 2}, {83, 1}, {84, 2}, {91, 3}, {13, 1}, {14, 2}, {76, 3}, + {10, 1}, {74, 2}, {88, 3}, {81, 1}, {86, 2}, {87, 3}, {72, 1}, {77, 2}, {73, 1}, + {82, 2}, {79, 1}, {80, 2}, {89, 1}, {90, 2}, {26, 1}, {30, 1}, {20, 1}, {64, 1}, + {63, 1}, {68, 1}, {57, 1}, {32, 1}, {21, 1}, {3, 1}}}, + {2654, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {2657, + {{70, 1}, {71, 1}, {74, 2}, {75, 1}, {64, 1}, {65, 2}, {73, 3}, {66, 1}, {69, 2}, {72, 3}}}, + {2658, {{18, 1}, {19, 1}, {30, 1}, {31, 2}, {32, 1}, {6, 1}, {10, 1}, {12, 1}, {14, 1}}}, + {2660, {{12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, + {34, 1}, {46, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2661, + {{14, 1}, + {23, 1}, + {24, 2}, + {20, 1}, + {21, 2}, + {25, 3}, + {15, 1}, + {16, 2}, + {26, 1}, + {27, 2}, + {28, 3}, + {7, 1}, + {29, 2}, + {5, 1}, + {18, 2}, + {10, 1}, + {11, 2}}}, + {2677, + {{32, 1}, {34, 2}, {25, 1}, {26, 2}, {19, 1}, {31, 2}, {13, 1}, {23, 2}, {24, 3}, {17, 1}, + {7, 1}, {20, 1}, {22, 2}, {33, 3}, {6, 1}, {8, 2}, {11, 3}, {15, 1}, {18, 2}, {30, 3}}}, + {2682, + {{6, 1}, {7, 2}, {8, 3}, {61, 1}, {3, 1}, {4, 2}, {9, 3}, {17, 1}, {64, 2}, {67, 3}, + {66, 1}, {76, 2}, {27, 1}, {28, 2}, {21, 1}, {22, 2}, {23, 1}, {24, 2}, {26, 3}, {75, 1}, + {74, 1}, {77, 2}, {78, 3}, {70, 1}, {71, 2}, {14, 1}, {65, 2}, {69, 3}, {60, 1}, {62, 2}}}, + {2698, {{27, 1}, {23, 1}, {25, 2}, {13, 1}, {18, 1}}}, + {2708, + {{16, 1}, {25, 2}, {20, 1}, {10, 1}, {15, 1}, {21, 2}, {13, 1}, {17, 2}, {7, 1}, {11, 2}}}, + {2712, {{4, 1}}}, + {2746, + {{41, 1}, + {50, 1}, + {51, 2}, + {47, 1}, + {48, 2}, + {52, 3}, + {42, 1}, + {43, 2}, + {53, 1}, + {54, 2}, + {55, 3}, + {34, 1}, + {56, 2}, + {32, 1}, + {45, 2}, + {37, 1}, + {38, 2}}}, + {2762, {{69, 1}, {72, 2}, {87, 3}, {12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, + {6, 2}, {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, {34, 1}, + {46, 2}, {80, 1}, {85, 2}, {86, 3}, {82, 1}, {83, 2}, {84, 3}, {75, 1}, {76, 2}, + {91, 3}, {79, 1}, {89, 2}, {90, 3}, {65, 1}, {71, 2}, {66, 1}, {81, 2}, {73, 1}, + {78, 2}, {59, 1}, {77, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2763, + {{44, 1}, {53, 1}, {54, 2}, {50, 1}, {51, 2}, {55, 3}, {45, 1}, {46, 2}, {56, 1}, {57, 2}, + {58, 3}, {37, 1}, {59, 2}, {35, 1}, {48, 2}, {40, 1}, {41, 2}, {25, 1}, {27, 2}, {28, 3}, + {24, 1}, {26, 2}, {13, 1}, {14, 2}, {17, 3}, {15, 1}, {16, 2}, {20, 3}, {21, 1}, {6, 1}, + {9, 2}, {11, 1}, {18, 2}, {19, 3}, {1, 1}, {4, 2}, {5, 3}}}, + {2768, {{39, 1}, {17, 1}, {12, 1}, {10, 1}, {38, 1}}}, + {2814, + {{5, 1}, + {7, 1}, + {58, 1}, + {69, 1}, + {59, 1}, + {61, 1}, + {24, 1}, + {42, 2}, + {56, 1}, + {68, 2}, + {60, 1}, + {47, 1}, + {48, 2}, + {27, 1}, + {34, 1}}}, + {2844, {{10, 1}}}, + {2846, + {{17, 1}, + {20, 2}, + {18, 1}, + {23, 1}, + {16, 1}, + {19, 2}, + {6, 1}, + {29, 1}, + {28, 1}, + {33, 1}, + {10, 1}, + {7, 1}, + {1, 1}}}, + {2855, {{17, 1}, {14, 1}}}, + {2856, + {{47, 1}, + {43, 1}, + {45, 2}, + {37, 1}, + {48, 1}, + {49, 2}, + {31, 1}, + {32, 2}, + {36, 1}, + {25, 1}, + {27, 2}, + {28, 3}, + {13, 1}, + {14, 2}}}, + {2867, {{2, 1}}}, + {2869, {{12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, + {34, 1}, {46, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2881, + {{13, 1}, + {9, 1}, + {5, 1}, + {58, 1}, + {29, 1}, + {38, 1}, + {59, 1}, + {60, 1}, + {2, 1}, + {14, 2}, + {34, 1}, + {61, 1}, + {43, 1}}}, + {2884, + {{12, 1}, {15, 2}, {29, 3}, {81, 1}, {27, 1}, {28, 2}, {143, 3}, {24, 1}, {25, 2}, {26, 3}, + {18, 1}, {19, 2}, {32, 3}, {22, 1}, {30, 2}, {31, 3}, {8, 1}, {14, 2}, {9, 1}, {23, 2}, + {16, 1}, {21, 2}, {141, 1}, {142, 2}, {69, 1}, {54, 1}, {124, 1}, {129, 1}}}, + {2889, {{13, 1}, {18, 2}, {26, 1}, {23, 1}, {27, 1}, {17, 1}, {19, 1}, {15, 1}}}, + {2892, {{44, 1}, {49, 1}, {43, 1}, {30, 1}, {34, 2}, {40, 1}, {45, 2}, + {42, 1}, {46, 2}, {47, 3}, {32, 1}, {36, 2}, {31, 1}, {33, 2}, + {35, 3}, {25, 1}, {26, 2}, {27, 3}, {17, 1}, {12, 1}, {10, 1}}}, + {2901, {{13, 1}, {18, 1}}}, + {2905, {{13, 1}, {18, 2}, {26, 1}, {23, 1}, {27, 1}, {17, 1}, {19, 1}, {15, 1}}}, + {2909, {{48, 1}, {49, 2}, {50, 3}, {16, 1}, {27, 2}, {31, 3}, {11, 1}, {17, 2}, {28, 3}, + {12, 1}, {24, 2}, {37, 3}, {53, 1}, {35, 1}, {36, 2}, {18, 1}, {20, 2}, {25, 1}, + {26, 2}, {30, 3}, {23, 1}, {33, 2}, {10, 1}, {19, 2}, {9, 1}, {29, 2}, {56, 1}, + {57, 2}, {62, 3}, {54, 1}, {60, 2}, {46, 1}, {52, 1}, {40, 1}, {41, 2}, {43, 3}}}, + {2912, {{14, 1}}}, + {2944, {{40, 1}}}, + {2953, {{71, 1}, {74, 2}, {89, 3}, {12, 1}, {33, 1}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, + {6, 2}, {13, 3}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, {49, 2}, {51, 3}, {34, 1}, + {46, 2}, {82, 1}, {87, 2}, {88, 3}, {84, 1}, {85, 2}, {86, 3}, {77, 1}, {78, 2}, + {93, 3}, {81, 1}, {91, 2}, {92, 3}, {67, 1}, {73, 2}, {68, 1}, {83, 2}, {75, 1}, + {80, 2}, {61, 1}, {79, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {29, 1}}}, + {2960, + {{12, 1}, + {13, 2}, + {14, 3}, + {17, 1}, + {20, 1}, + {21, 2}, + {26, 3}, + {18, 1}, + {24, 2}, + {10, 1}, + {16, 1}, + {4, 1}, + {5, 2}, + {7, 3}}}, + {2961, {{59, 1}, {41, 1}, {36, 1}, {34, 1}, {58, 1}}}, + {2967, {{46, 1}, {16, 1}, {43, 1}, {44, 2}, {45, 3}, {39, 1}, {40, 2}, {47, 3}, + {35, 1}, {28, 1}, {30, 2}, {31, 1}, {32, 2}, {34, 3}, {17, 1}, {29, 2}, + {49, 1}, {50, 2}, {6, 1}, {10, 1}, {12, 1}, {62, 1}}}, + {2968, + {{13, 1}, + {18, 2}, + {21, 3}, + {10, 1}, + {24, 2}, + {30, 3}, + {17, 1}, + {23, 2}, + {26, 3}, + {12, 1}, + {19, 2}, + {8, 1}, + {9, 2}, + {27, 3}, + {20, 1}, + {22, 2}, + {28, 3}, + {15, 1}, + {25, 2}}}, + {2977, {{55, 1}, {56, 1}, {48, 1}, {52, 2}, {60, 3}}}, + {2978, {{28, 1}, {19, 1}, {12, 1}}}, + {2983, {{33, 1}, {12, 1}, {71, 1}, {74, 2}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {72, 1}, {77, 1}, {70, 1}, {73, 2}, {52, 1}, {45, 1}, {47, 2}, {48, 1}, + {49, 2}, {51, 3}, {34, 1}, {46, 2}, {15, 1}, {16, 2}, {23, 1}, {27, 1}, {60, 1}, + {89, 1}, {88, 1}, {93, 1}, {64, 1}, {29, 1}, {61, 1}, {55, 1}}}, + {2984, {{14, 1}, {19, 2}, {22, 3}, {83, 1}, {11, 1}, {25, 2}, {31, 3}, {43, 1}, {76, 1}, + {80, 2}, {84, 3}, {73, 1}, {74, 2}, {81, 3}, {68, 1}, {66, 1}, {71, 1}, {72, 2}, + {77, 3}, {62, 1}, {78, 2}, {82, 3}, {52, 1}, {53, 2}, {49, 1}, {50, 2}, {54, 3}, + {44, 1}, {45, 2}, {55, 1}, {56, 2}, {57, 3}, {36, 1}, {58, 2}, {34, 1}, {47, 2}, + {39, 1}, {40, 2}, {18, 1}, {24, 2}, {27, 3}, {13, 1}, {20, 2}, {9, 1}, {10, 2}, + {28, 3}, {21, 1}, {23, 2}, {29, 3}, {16, 1}, {26, 2}}}, + {3017, {{20, 1}, {10, 1}, {4, 1}}}, + {3028, {{2, 1}}}, + {3030, {{1, 1}, {39, 1}, {38, 1}}}, + {3032, + {{22, 2}, + {32, 3}, + {59, 1}, + {62, 2}, + {65, 3}, + {55, 1}, + {60, 2}, + {56, 1}, + {57, 2}, + {63, 3}, + {51, 1}, + {47, 1}, + {64, 2}, + {40, 1}, + {41, 2}, + {37, 1}, + {38, 1}, + {21, 1}, + {9, 1}}}, + {3036, {{2, 1}}}, + {3053, {{7, 1}}}, + {3069, {{9, 1}, {15, 2}, {19, 3}, {13, 1}, {42, 1}, {22, 1}, {23, 2}, {24, 3}, + {5, 1}, {6, 2}, {7, 3}, {3, 1}, {31, 2}, {35, 3}, {12, 1}, {18, 2}, + {20, 3}, {16, 1}, {17, 2}, {46, 3}, {28, 1}, {26, 1}, {37, 1}, {38, 2}}}, + {3091, {{4, 1}, {8, 2}, {5, 1}}}, + {3099, + {{12, 1}, {13, 1}, {5, 1}, {9, 2}, {17, 3}, {33, 1}, {34, 2}, {35, 3}, {39, 1}, {31, 1}}}, + {3139, {{15, 1}, {16, 1}, {3, 1}, {1, 1}}}, + {3158, {{6, 1}}}, + {3172, {{1, 1}}}, + {3175, + {{15, 1}, + {16, 2}, + {17, 1}, + {18, 2}, + {8, 1}, + {9, 2}, + {10, 3}, + {14, 1}, + {3, 1}, + {5, 2}, + {6, 3}, + {1, 1}}}, + {3176, + {{15, 1}, + {16, 2}, + {17, 1}, + {18, 2}, + {8, 1}, + {9, 2}, + {10, 3}, + {14, 1}, + {3, 1}, + {5, 2}, + {6, 3}, + {1, 1}}}, + {3179, {{14, 1}, {17, 2}, {32, 3}, {25, 1}, {30, 2}, {31, 3}, {27, 1}, {28, 2}, + {29, 3}, {20, 1}, {21, 2}, {36, 3}, {24, 1}, {34, 2}, {35, 3}, {10, 1}, + {16, 2}, {11, 1}, {26, 2}, {18, 1}, {23, 2}, {4, 1}, {22, 2}}}, + {3188, + {{15, 1}, + {16, 2}, + {17, 1}, + {18, 2}, + {8, 1}, + {9, 2}, + {10, 3}, + {14, 1}, + {3, 1}, + {5, 2}, + {6, 3}, + {1, 1}}}, + {3235, {{2, 1}}}, + {3263, + {{15, 1}, {65, 1}, {68, 2}, {54, 1}, {59, 2}, {67, 1}, {56, 1}, {57, 2}, {58, 3}, {20, 1}}}, + {3271, + {{5, 1}, + {24, 1}, + {12, 1}, + {13, 2}, + {17, 3}, + {21, 1}, + {22, 2}, + {11, 1}, + {14, 2}, + {15, 1}, + {18, 3}, + {19, 4}}}, + {3273, + {{5, 1}, + {24, 1}, + {12, 1}, + {13, 2}, + {17, 3}, + {21, 1}, + {22, 2}, + {11, 1}, + {14, 2}, + {15, 1}, + {18, 3}, + {19, 4}}}, + {3279, {{12, 1}}}, + {3287, {{13, 1}, {30, 2}, {21, 1}}}, + {3296, + {{43, 1}, {98, 1}, {106, 2}, {137, 1}, {128, 1}, {94, 2}, {170, 2}, {100, 2}, {151, 1}, + {110, 1}, {158, 1}, {159, 2}, {163, 3}, {167, 1}, {168, 2}, {69, 1}, {70, 2}, {65, 1}, + {157, 1}, {160, 2}, {161, 1}, {164, 3}, {165, 4}, {136, 3}, {139, 4}, {141, 5}, {140, 1}, + {144, 2}, {145, 3}, {130, 1}, {131, 2}, {133, 3}, {126, 1}, {134, 2}, {123, 1}, {124, 2}, + {138, 3}, {143, 1}, {121, 1}, {116, 1}, {117, 1}, {142, 2}, {101, 1}, {104, 2}, {111, 3}, + {99, 1}, {108, 2}, {102, 1}, {103, 2}, {62, 1}, {55, 1}, {57, 2}, {58, 1}, {59, 2}, + {61, 3}, {44, 1}, {56, 2}, {33, 1}, {37, 1}, {39, 1}}}, + {3297, {{80, 1}, {118, 1}, {119, 2}, {120, 3}, {123, 1}, {57, 1}, {84, 1}, {70, 1}, + {87, 1}, {91, 2}, {89, 1}, {92, 2}, {95, 3}, {79, 1}, {50, 1}, {54, 2}, + {58, 3}, {47, 1}, {48, 2}, {55, 3}, {42, 1}, {40, 1}, {45, 1}, {46, 2}, + {51, 3}, {36, 1}, {52, 2}, {56, 3}, {64, 1}, {61, 1}, {75, 2}, {78, 3}, + {63, 1}, {68, 2}, {126, 1}, {127, 2}, {132, 3}, {124, 1}, {130, 2}, {116, 1}, + {122, 1}, {110, 1}, {111, 2}, {113, 3}, {25, 1}, {27, 2}, {28, 3}, {24, 1}, + {26, 2}, {13, 1}, {14, 2}, {17, 3}, {15, 1}, {16, 2}, {20, 3}, {21, 1}, + {6, 1}, {9, 2}, {11, 1}, {18, 2}, {19, 3}, {1, 1}, {4, 2}, {5, 3}}}, + {3306, {{51, 1}, {13, 2}, {7, 2}, {11, 1}, {19, 2}, {23, 1}, {44, 1}, {48, 2}, {52, 3}, + {41, 1}, {42, 2}, {49, 3}, {36, 1}, {34, 1}, {39, 1}, {40, 2}, {45, 3}, {30, 1}, + {46, 2}, {50, 3}, {14, 1}, {17, 2}, {24, 3}, {12, 1}, {21, 2}, {15, 1}, {16, 2}}}, + {3311, + {{93, 1}, {106, 1}, {86, 1}, {96, 2}, {100, 3}, {25, 1}, {28, 2}, {43, 3}, {50, 1}, {51, 2}, + {52, 3}, {7, 1}, {8, 2}, {9, 3}, {4, 1}, {5, 2}, {10, 3}, {54, 1}, {56, 2}, {60, 3}, + {59, 1}, {73, 2}, {92, 1}, {99, 2}, {101, 3}, {95, 1}, {97, 2}, {98, 3}, {82, 1}, {83, 2}, + {76, 1}, {77, 2}, {78, 1}, {79, 2}, {81, 3}, {72, 1}, {71, 1}, {74, 2}, {84, 3}, {65, 1}, + {67, 2}, {61, 1}, {63, 2}, {64, 3}, {36, 1}, {41, 2}, {42, 3}, {38, 1}, {39, 2}, {40, 3}, + {31, 1}, {32, 2}, {47, 3}, {35, 1}, {45, 2}, {46, 3}, {21, 1}, {27, 2}, {22, 1}, {37, 2}, + {29, 1}, {34, 2}, {15, 1}, {33, 2}, {105, 1}, {108, 2}}}, + {3312, + {{13, 1}, {27, 2}, {33, 3}, {64, 1}, {66, 2}, {16, 1}, {21, 2}, {24, 3}, {126, 1}, + {135, 2}, {139, 3}, {117, 1}, {127, 2}, {136, 3}, {122, 1}, {133, 2}, {145, 3}, {143, 1}, + {144, 2}, {123, 1}, {129, 2}, {76, 1}, {97, 1}, {131, 1}, {134, 2}, {138, 3}, {132, 1}, + {141, 2}, {121, 1}, {128, 2}, {120, 1}, {137, 2}, {106, 1}, {107, 2}, {103, 1}, {104, 2}, + {108, 3}, {98, 1}, {99, 2}, {109, 1}, {110, 2}, {111, 3}, {90, 1}, {112, 2}, {88, 1}, + {101, 2}, {93, 1}, {94, 2}, {77, 1}, {80, 2}, {81, 1}, {70, 1}, {71, 2}, {79, 3}, + {72, 1}, {75, 2}, {78, 3}, {57, 1}, {58, 2}, {51, 1}, {63, 2}, {45, 1}, {55, 2}, + {56, 3}, {49, 1}, {39, 1}, {52, 1}, {54, 2}, {65, 3}, {38, 1}, {40, 2}, {43, 3}, + {47, 1}, {50, 2}, {62, 3}, {20, 1}, {26, 2}, {29, 3}, {15, 1}, {22, 2}, {11, 1}, + {12, 2}, {30, 3}, {23, 1}, {25, 2}, {31, 3}, {18, 1}, {28, 2}}}, + {3360, + {{153, 1}, {161, 2}, {230, 1}, {110, 2}, {155, 4}, {149, 3}, {233, 1}, {234, 2}, {107, 1}, + {108, 2}, {109, 3}, {241, 1}, {242, 2}, {264, 1}, {103, 1}, {104, 2}, {111, 3}, {165, 1}, + {227, 1}, {170, 1}, {171, 2}, {189, 1}, {187, 1}, {235, 1}, {236, 2}, {220, 1}, {218, 1}, + {207, 1}, {208, 2}, {156, 1}, {159, 2}, {166, 3}, {154, 1}, {163, 2}, {157, 1}, {158, 2}, + {137, 1}, {138, 2}, {139, 3}, {131, 1}, {134, 2}, {135, 3}, {122, 1}, {142, 2}, {143, 3}, + {113, 1}, {114, 2}, {253, 1}, {263, 2}}}, + {3361, {{45, 1}, {49, 2}, {47, 1}, {50, 2}, {53, 3}}}, + {3365, {{196, 1}, {298, 2}, {319, 1}, {251, 1}, {225, 1}, {226, 2}, {290, 1}, {296, 2}, + {338, 1}, {341, 2}, {277, 1}, {202, 1}, {203, 2}, {192, 1}, {204, 2}, {269, 3}, + {327, 1}, {329, 2}, {322, 2}, {318, 1}, {187, 6}, {300, 7}, {145, 2}, {138, 1}, + {141, 3}, {104, 3}, {78, 1}, {40, 2}, {355, 1}, {360, 1}}}, + {3386, {{51, 1}}}, + {3390, {{9, 1}, {29, 1}, {30, 3}, {35, 1}, {37, 2}, {2, 1}, {6, 2}, {4, 1}, {36, 1}}}, + {3401, {{26, 6}, {27, 7}, {9, 4}, {87, 5}, {109, 6}, {120, 7}, {25, 1}, {28, 3}, + {101, 1}, {63, 1}, {102, 1}, {33, 1}, {34, 3}, {62, 2}, {64, 3}, {65, 4}, + {104, 4}, {73, 1}, {107, 1}, {72, 1}, {6, 2}, {14, 4}, {99, 6}, {11, 9}, + {13, 12}, {5, 12}, {7, 13}, {88, 14}, {119, 13}, {124, 14}, {125, 15}, {111, 12}, + {112, 14}, {114, 15}, {121, 13}, {122, 14}, {30, 5}, {55, 6}, {56, 7}, {20, 7}}}, + {3402, {{2, 4}}}, + {3403, + {{32, 1}, + {42, 2}, + {30, 1}, + {31, 1}, + {33, 1}, + {13, 1}, + {29, 1}, + {3, 1}, + {9, 1}, + {35, 1}, + {36, 2}, + {23, 1}, + {34, 2}}}, + {3404, {{1, 1}, {4, 2}}}, + {3405, {{12, 1}, {36, 1}, {56, 1}, {57, 2}, {9, 1}, {10, 2}, {11, 3}, {5, 1}, {6, 2}, + {13, 3}, {80, 1}, {79, 1}, {81, 2}, {71, 1}, {76, 2}, {78, 3}, {74, 1}, {75, 2}, + {67, 1}, {60, 1}, {62, 2}, {63, 1}, {64, 2}, {66, 3}, {52, 1}, {53, 2}, {49, 1}, + {50, 2}, {46, 1}, {47, 2}, {43, 1}, {44, 2}, {40, 1}, {41, 2}, {37, 1}, {61, 2}, + {32, 1}, {33, 2}, {15, 1}, {16, 2}, {24, 1}, {28, 1}, {30, 1}}}, + {3406, {{33, 1}, {35, 2}, {45, 1}, {57, 2}, {70, 3}, {44, 1}, {50, 2}, {61, 3}, {49, 1}, + {60, 2}, {64, 3}, {68, 1}, {69, 2}, {51, 1}, {53, 2}, {58, 1}, {59, 2}, {63, 3}, + {56, 1}, {66, 2}, {43, 1}, {52, 2}, {42, 1}, {62, 2}, {26, 1}, {27, 2}, {20, 1}, + {32, 2}, {14, 1}, {24, 2}, {25, 3}, {18, 1}, {8, 1}, {21, 1}, {23, 2}, {34, 3}, + {7, 1}, {9, 2}, {12, 3}, {16, 1}, {19, 2}, {31, 3}}}, + {3415, + {{111, 1}, {116, 2}, {128, 3}, {32, 1}, {71, 1}, {39, 1}, {40, 2}, {87, 1}, {124, 1}, + {118, 1}, {120, 1}, {126, 2}, {129, 3}, {122, 1}, {109, 1}, {119, 2}, {127, 3}, {105, 1}, + {106, 2}, {125, 3}, {114, 1}, {115, 2}, {121, 3}, {61, 1}, {50, 1}, {58, 1}, {86, 1}, + {88, 2}, {78, 1}, {83, 2}, {85, 3}, {81, 1}, {82, 2}, {35, 1}, {23, 1}, {102, 1}, + {98, 1}, {99, 2}, {101, 3}, {94, 1}, {96, 2}}}, + {3416, {{44, 1}, {46, 2}, {48, 1}, {28, 1}}}, + {3417, {{3, 1}, {4, 2}, {5, 3}, {6, 4}}}, +}; + +}; + +int lookup_jak3_texture_dest_offset(int tpage, int texture_idx) { + auto it = data.find(tpage); + if (it == data.end()) { + return 0; + } + for (auto& p : it->second) { + if (p.first == texture_idx) { + return p.second; + } + } + return 0; +} \ No newline at end of file diff --git a/game/graphics/jak3_texture_remap.h b/game/graphics/jak3_texture_remap.h new file mode 100644 index 0000000000..2d7f2c8bdf --- /dev/null +++ b/game/graphics/jak3_texture_remap.h @@ -0,0 +1,3 @@ +#pragma once + +int lookup_jak3_texture_dest_offset(int tpage, int texture_idx); \ No newline at end of file diff --git a/game/graphics/opengl_renderer/DirectRenderer.cpp b/game/graphics/opengl_renderer/DirectRenderer.cpp index bcf7585150..e8e4ae290f 100644 --- a/game/graphics/opengl_renderer/DirectRenderer.cpp +++ b/game/graphics/opengl_renderer/DirectRenderer.cpp @@ -818,7 +818,7 @@ void DirectRenderer::handle_ad(const u8* data, handle_scissor(value); break; case GsRegisterAddress::XYOFFSET_1: - ASSERT(render_state->version == GameVersion::Jak2); // hardcoded jak 2 scissor vals in handle + ASSERT(render_state->version >= GameVersion::Jak2); // hardcoded jak 2 scissor vals in handle handle_xyoffset(value); break; case GsRegisterAddress::COLCLAMP: diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 95cc7a2f70..be9c0502c6 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -277,6 +277,9 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer("tex-sprite", BucketCategory::TEX, BucketId::TEX_SPRITE, texture_animator); init_bucket_renderer("particles", BucketCategory::SPRITE, BucketId::PARTICLES); + init_bucket_renderer("generic-sprite-3", BucketCategory::OTHER, + BucketId::GENERIC_SPRITE_3, m_generic2, + Generic2::Mode::LIGHTNING); // 575 init_bucket_renderer("tex-warp", BucketCategory::TEX, BucketId::TEX_WARP, texture_animator); @@ -289,10 +292,14 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer("tex-hud-hud-alpha", BucketCategory::TEX, BucketId::TEX_HUD_HUD_ALPHA, texture_animator); + init_bucket_renderer("hud-draw-hud-alpha", BucketCategory::OTHER, + BucketId::HUD_DRAW_HUD_ALPHA, 0x8000); init_bucket_renderer("tex-hud-pris2", BucketCategory::TEX, BucketId::TEX_HUD_PRIS2, texture_animator); - init_bucket_renderer("hud-draw-hud-alpha", BucketCategory::OTHER, - BucketId::HUD_DRAW_HUD_ALPHA, 0x1000); + init_bucket_renderer("hud-draw-pris2", BucketCategory::TEX, + BucketId::HUD_DRAW_PRIS2, texture_animator); + init_bucket_renderer("progress", BucketCategory::OTHER, BucketId::BUCKET582, + 0x8000); // 583 init_bucket_renderer("debug", BucketCategory::OTHER, BucketId::DEBUG, 0x8000); diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index 00bf6b9d3b..804f629cd1 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -417,6 +417,7 @@ enum class BucketId { BUCKET_2 = 2, BLIT_START = 3, TEX_LCOM_SKY_PRE = 4, + OCEAN_MID_FAR = 6, TEX_L0_TFRAG = 10, TFRAG_L0_TFRAG = 11, diff --git a/game/kernel/common/kmemcard.cpp b/game/kernel/common/kmemcard.cpp index e39b48193a..99a7d04e23 100644 --- a/game/kernel/common/kmemcard.cpp +++ b/game/kernel/common/kmemcard.cpp @@ -173,6 +173,10 @@ bool file_is_present(int id, int bank = 0) { */ void pc_update_card() { // int highest_save_count = 0; + // TODO handle jak 3 + if (g_game_version == GameVersion::Jak3) { + return; + } mc_last_file = -1; for (s32 file = 0; file < 4; file++) { auto bankname = mc_get_filename(g_game_version, 4 + file * 2); diff --git a/game/kernel/jak3/kmachine.cpp b/game/kernel/jak3/kmachine.cpp index 0cb301f2d8..d535a5e886 100644 --- a/game/kernel/jak3/kmachine.cpp +++ b/game/kernel/jak3/kmachine.cpp @@ -5,6 +5,7 @@ #include "common/symbols.h" #include "game/graphics/gfx.h" +#include "game/graphics/jak3_texture_remap.h" #include "game/graphics/sceGraphicsInterface.h" #include "game/kernel/common/fileio.h" #include "game/kernel/common/kdgo.h" @@ -397,7 +398,7 @@ void InitMachine_PCPort() { make_function_symbol_from_c("__pc-set-levels", (void*)pc_set_levels); make_function_symbol_from_c("__pc-set-active-levels", (void*)pc_set_active_levels); - // make_function_symbol_from_c("__pc-get-tex-remap", (void*)lookup_jak2_texture_dest_offset); + make_function_symbol_from_c("__pc-get-tex-remap", (void*)lookup_jak3_texture_dest_offset); // make_function_symbol_from_c("pc-init-autosplitter-struct", (void*)init_autosplit_struct); // make_function_symbol_from_c("pc-encode-utf8-string", (void*)encode_utf8_string); diff --git a/game/mips2c/jak3_functions/merc_blend_shape.cpp b/game/mips2c/jak3_functions/merc_blend_shape.cpp new file mode 100644 index 0000000000..2e1f8cf8de --- /dev/null +++ b/game/mips2c/jak3_functions/merc_blend_shape.cpp @@ -0,0 +1,598 @@ +//--------------------------MIPS2C--------------------- + +#include + +#include "common/global_profiler/GlobalProfiler.h" + +#include "game/kernel/jak3/kscheme.h" +#include "game/mips2c/mips2c_private.h" + +// clang-format off + +extern std::mutex g_merc_data_mutex; + +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace blerc_execute { +struct Cache { + void* blerc_globals; // *blerc-globals* + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* gsf_buffer; // *gsf-buffer* + void* stats_blerc; // *stats-blerc* + void* flush_cache; // flush-cache +} cache; + +u64 execute(void* ctxt) { + [[maybe_unused]] bool hit18 = false; + [[maybe_unused]] bool hit19 = false; + auto pp = scoped_prof("blerc-exec"); + std::unique_lock lk(g_merc_data_mutex); + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + u32 madr, sadr, qwc, tadr; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s2, 16, sp); // sq s2, 16(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->load_symbol2(v1, cache.blerc_globals); // lw v1, *blerc-globals*(s7) + c->lwu(s5, 0, v1); // lwu s5, 0(v1) + bc = c->sgpr64(s5) == 0; // beq s5, r0, L55 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_33;} // branch non-likely + + c->addiu(v1, r0, 0); // addiu v1, r0, 0 + c->addiu(gp, r0, 0); // addiu gp, r0, 0 + c->addiu(v1, r0, 0); // addiu v1, r0, 0 + c->load_symbol2(v1, cache.gsf_buffer); // lw v1, *gsf-buffer*(s7) + c->load_symbol2(t9, cache.flush_cache); // lw t9, flush-cache(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->addiu(v1, r0, 848); // addiu v1, r0, 848 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->daddu(a1, v1, a0); // daddu a1, v1, a0 + c->load_symbol2(v1, cache.blerc_globals); // lw v1, *blerc-globals*(s7) + c->daddu(v1, r0, v1); // daddu v1, r0, v1 + // nop // sll r0, r0, 0 + c->lui(a0, 4096); // lui a0, 4096 + // nop // sll r0, r0, 0 + c->ori(a0, a0, 54272); // ori a0, a0, 54272 + c->andi(a1, a1, 16383); // andi a1, a1, 16383 + +// block_2: +// c->lw(a2, 0, a0); // lw a2, 0(a0) +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// c->andi(a2, a2, 256); // andi a2, a2, 256 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(a2) != 0; // bne a2, r0, L37 +// c->lw(a2, 0, v1); // lw a2, 0(v1) +// if (bc) {goto block_2;} // branch non-likely + c->lw(a2, 0, v1); + + bc = c->sgpr64(a2) == 0; // beq a2, r0, L38 + // c->sw(a1, 128, a0); // sw a1, 128(a0) + sadr = c->sgpr64(a1); + if (bc) {goto block_5;} // branch non-likely + + c->addiu(v1, r0, 324); // addiu v1, r0, 324 + // c->sw(a2, 48, a0); // sw a2, 48(a0) + tadr = c->sgpr64(a2); + // c->sw(r0, 32, a0); // sw r0, 32(a0) + // Unknown instr: sync.l + // c->sw(v1, 0, a0); // sw v1, 0(a0) + spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr, tadr); + // Unknown instr: sync.l + +block_5: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + //beq r0, r0, L54 // beq r0, r0, L54 + // nop // sll r0, r0, 0 + goto block_31; // branch always + + +block_6: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L40 + // nop // sll r0, r0, 0 + if (bc) {goto block_8;} // branch non-likely + + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->daddu(a0, r0, v1); // daddu a0, r0, v1 + //beq r0, r0, L41 // beq r0, r0, L41 + // nop // sll r0, r0, 0 + goto block_9; // branch always + + +block_8: + c->addiu(v1, r0, 8192); // addiu v1, r0, 8192 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->daddu(a0, v1, a0); // daddu a0, v1, a0 + +block_9: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L42 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->addiu(v1, r0, 8192); // addiu v1, r0, 8192 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a1, v1, a1); // daddu a1, v1, a1 + //beq r0, r0, L43 // beq r0, r0, L43 + // nop // sll r0, r0, 0 + goto block_12; // branch always + + +block_11: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->daddu(a1, r0, v1); // daddu a1, r0, v1 + +block_12: + c->daddiu(v1, a0, 848); // daddiu v1, a0, 848 + c->daddu(a2, r0, a0); // daddu a2, r0, a0 + c->daddiu(a3, a1, 848); // daddiu a3, a1, 848 + c->daddiu(a1, v1, 12); // daddiu a1, v1, 12 + // nop // sll r0, r0, 0 + c->lui(a2, 4096); // lui a2, 4096 + // nop // sll r0, r0, 0 + c->ori(a2, a2, 54272); // ori a2, a2, 54272 + c->andi(a3, a3, 16383); // andi a3, a3, 16383 + +// block_13: +// c->lw(t0, 0, a2); // lw t0, 0(a2) +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// c->andi(t0, t0, 256); // andi t0, t0, 256 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(t0) != 0; // bne t0, r0, L44 +// c->lw(t0, 0, a1); // lw t0, 0(a1) +// if (bc) {goto block_13;} // branch non-likely + + c->lw(t0, 0, a1); + + bc = c->sgpr64(t0) == 0; // beq t0, r0, L45 + // c->sw(a3, 128, a2); // sw a3, 128(a2) + sadr = c->sgpr64(a3); + if (bc) {goto block_16;} // branch non-likely + + c->addiu(a1, r0, 324); // addiu a1, r0, 324 + // c->sw(t0, 48, a2); // sw t0, 48(a2) + tadr = c->sgpr64(t0); + // c->sw(r0, 32, a2); // sw r0, 32(a2) + // Unknown instr: sync.l + // c->sw(a1, 0, a2); // sw a1, 0(a2) + // Unknown instr: sync.l + // tadr here is bogus, it's reading something uploaded by the other transfer. + spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr, tadr); + +block_16: + c->gprs[a1].du64[0] = 0; // or a1, r0, r0 + c->mov64(a2, a0); // or a2, a0, r0 + c->load_symbol2(a3, cache.gsf_buffer); // lw a3, *gsf-buffer*(s7) + + // blerc_c(g_ee_main_mem + c->sgpr64(a2), g_ee_main_mem + c->sgpr64(a3)); + + + c->daddiu(t2, a2, 880); // daddiu t2, a2, 880 + c->lb(t1, 0, t2); // lb t1, 0(t2) + // nop // sll r0, r0, 0 + c->mov64(t0, a2); // or t0, a2, r0 + c->lw(a1, 868, a2); // lw a1, 868(a2) + c->daddiu(t3, t1, 1); // daddiu t3, t1, 1 + c->mov64(t1, a3); // or t1, a3, r0 + c->sll(t8, t3, 4); // sll t8, t3, 4 + c->sll(t3, a1, 4); // sll t3, a1, 4 + c->daddu(t9, t3, a3); // daddu t9, t3, a3 + c->daddu(t3, t2, t8); // daddu t3, t2, t8 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L48 + c->daddiu(ra, t2, 16); // daddiu ra, t2, 16 + if (bc) {goto block_21;} // branch non-likely + + c->lh(t5, 12, t3); // lh t5, 12(t3) + c->daddu(t2, t3, t8); // daddu t2, t3, t8 + //beq r0, r0, L47 // beq r0, r0, L47 + // nop // sll r0, r0, 0 + goto block_19; // branch always + + +block_18: +hit18 = true; + c->lh(t5, 12, t2); // lh t5, 12(t2) + c->daddu(t2, t2, t8); // daddu t2, t2, t8 + c->sq(t6, 0, t1); // sq t6, 0(t1) + c->daddiu(t1, t1, 16); // daddiu t1, t1, 16 + +block_19: +hit19 = true; + c->pcpyh(t5, t5); // pcpyh t5, t5 + c->mfc1(r0, f31); // mfc1 r0, f31 + bc = c->sgpr64(t1) != c->sgpr64(t9); // bne t1, t9, L46 + c->pcpyld(t6, t5, t5); // pcpyld t6, t5, t5 + if (bc) {goto block_18;} // branch non-likely + + c->dsubu(t3, t2, t8); // dsubu t3, t2, t8 + // nop // sll r0, r0, 0 + +block_21: + c->addiu(t1, r0, 255); // addiu t1, r0, 255 + c->addiu(t2, r0, 8192); // addiu t2, r0, 8192 + c->lb(s5, 0, t3); // lb s5, 0(t3) + c->daddiu(s4, t3, 16); // daddiu s4, t3, 16 + c->pcpyh(t1, t1); // pcpyh t1, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(t1, t1, t1); // pcpyld t1, t1, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyh(t2, t2); // pcpyh t2, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(t2, t2, t2); // pcpyld t2, t2, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->mov128_gpr_gpr(t3, t1); // por t3, t1, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->mov128_gpr_gpr(t4, r0); // por t4, r0, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + +block_22: + c->ld(t6, 0, ra); // ld t6, 0(ra) + c->daddu(s2, ra, t8); // daddu s2, ra, t8 + c->daddiu(ra, ra, 8); // daddiu ra, ra, 8 + c->mov64(s3, a3); // or s3, a3, r0 + c->pextlb(t6, r0, t6); // pextlb t6, r0, t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmulth(t7, t6, t2); // pmulth t7, t6, t2 + c->ld(t5, 0, s2); // ld t5, 0(s2) + c->daddiu(s5, s5, -1); // daddiu s5, s5, -1 + // nop // sll r0, r0, 0 + //beq r0, r0, L51 // beq r0, r0, L51 + c->daddu(s2, s2, t8); // daddu s2, s2, t8 + goto block_24; // branch always + + +block_23: + c->pmaddh(t7, t5, t6); // pmaddh t7, t5, t6 + c->ld(t5, 0, s2); // ld t5, 0(s2) + c->daddu(s2, s2, t8); // daddu s2, s2, t8 + c->daddiu(s3, s3, 16); // daddiu s3, s3, 16 + +block_24: + c->lq(t6, 0, s3); // lq t6, 0(s3) + c->pextlb(t5, t5, r0); // pextlb t5, t5, r0 + bc = c->sgpr64(s3) != c->sgpr64(t9); // bne s3, t9, L50 + c->psrah(t5, t5, 8); // psrah t5, t5, 8 + if (bc) {goto block_23;} // branch non-likely + + // Unknown instr: pmfhl.uw t5 + c->gprs[t5].du32[0] = c->lo.du32[1]; + c->gprs[t5].du32[1] = c->hi.du32[1]; + c->gprs[t5].du32[2] = c->lo.du32[3]; + c->gprs[t5].du32[3] = c->hi.du32[3]; + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psraw(t7, t7, 13); // psraw t7, t7, 13 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->psraw(t5, t5, 13); // psraw t5, t5, 13 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pinteh(t5, t5, t7); // pinteh t5, t5, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminh(t3, t3, t5); // pminh t3, t3, t5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxh(t4, t4, t5); // pmaxh t4, t4, t5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminh(t5, t5, t1); // pminh t5, t5, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxh(t5, t5, r0); // pmaxh t5, t5, r0 + c->lq(t7, 0, s4); // lq t7, 0(s4) + c->ppacb(t5, r0, t5); // ppacb t5, r0, t5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(t7, r0, t7); // ppach t7, r0, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t5, t5, t7); // pextlh t5, t5, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + // store modified vertex + c->sq(t5, 0, t0); // sq t5, 0(t0) + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + bc = c->sgpr64(s5) != 0; // bne s5, r0, L49 + c->daddiu(s4, s4, 16); // daddiu s4, s4, 16 + if (bc) {goto block_22;} // branch non-likely + // end of blerc_c stuff + + c->load_symbol2(a3, cache.stats_blerc); // lw a3, *stats-blerc*(s7) + bc = c->sgpr64(a3) == c->sgpr64(s7); // beq a3, s7, L52 + c->load_symbol2(a3, cache.blerc_globals); // lw a3, *blerc-globals*(s7) + if (bc) {goto block_28;} // branch non-likely + + c->lw(t2, 12, a3); // lw t2, 12(a3) + c->lw(t1, 16, a3); // lw t1, 16(a3) + c->lw(t0, 20, a3); // lw t0, 20(a3) + c->lw(a2, 864, a2); // lw a2, 864(a2) + c->multu3(a1, a1, a2); // multu3 a1, a1, a2 + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + c->daddu(a2, t1, a2); // daddu a2, t1, a2 + c->daddu(a1, t0, a1); // daddu a1, t0, a1 + c->sw(t2, 12, a3); // sw t2, 12(a3) + c->sw(a2, 16, a3); // sw a2, 16(a3) + c->sw(a1, 20, a3); // sw a1, 20(a3) + c->pcpyud(a1, t3, r0); // pcpyud a1, t3, r0 + c->pminh(t3, t3, a1); // pminh t3, t3, a1 + c->dsrl32(a1, t3, 0); // dsrl32 a1, t3, 0 + c->pminh(t3, t3, a1); // pminh t3, t3, a1 + c->dsrl(t3, t3, 16); // dsrl t3, t3, 16 + c->lh(a1, 8, a3); // lh a1, 8(a3) + c->pminh(t3, t3, a1); // pminh t3, t3, a1 + c->sh(t3, 8, a3); // sh t3, 8(a3) + c->pcpyud(a1, t4, r0); // pcpyud a1, t4, r0 + c->pmaxh(t4, t4, a1); // pmaxh t4, t4, a1 + c->dsrl32(a1, t4, 0); // dsrl32 a1, t4, 0 + c->pmaxh(t4, t4, a1); // pmaxh t4, t4, a1 + c->dsrl(t4, t4, 16); // dsrl t4, t4, 16 + c->lh(a1, 10, a3); // lh a1, 10(a3) + c->pmaxh(t4, t4, a1); // pmaxh t4, t4, a1 + c->sh(t4, 10, a3); // sh t4, 10(a3) + +block_28: + c->gprs[a1].du64[0] = 0; // or a1, r0, r0 + c->lwu(a1, 872, a0); // lwu a1, 872(a0) + c->mov64(a3, a0); // or a3, a0, r0 + c->lwu(a0, 876, a0); // lwu a0, 876(a0) + c->lui(a2, 4096); // lui a2, 4096 + // nop // sll r0, r0, 0 + c->ori(a2, a2, 53248); // ori a2, a2, 53248 + c->andi(a3, a3, 16383); // andi a3, a3, 16383 + +// block_29: +// c->lw(t0, 0, a2); // lw t0, 0(a2) +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// c->andi(t0, t0, 256); // andi t0, t0, 256 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(t0) != 0; // bne t0, r0, L53 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_29;} // branch non-likely + + // c->sw(a3, 128, a2); // sw a3, 128(a2) + sadr = c->sgpr64(a3); + c->addiu(a3, r0, 256); // addiu a3, r0, 256 + // c->sw(a1, 16, a2); // sw a1, 16(a2) + madr = c->sgpr64(a1); + // nop // sll r0, r0, 0 + // c->sw(a0, 32, a2); // sw a0, 32(a2) + qwc = c->sgpr64(a0); + // Unknown instr: sync.l + // c->sw(a3, 0, a2); // sw a3, 0(a2) + // fmt::print("blerc download 0x{:x} <- 0x{:x} ({} qwc)\n", madr, sadr, qwc); + { + spad_from_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc); + } + // Unknown instr: sync.l + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + c->addiu(a0, r0, 1); // addiu a0, r0, 1 + c->dsubu(gp, a0, gp); // dsubu gp, a0, gp + c->lwu(s5, 12, v1); // lwu s5, 12(v1) + c->mov64(v1, s5); // or v1, s5, r0 + +block_31: + bc = c->sgpr64(s5) != 0; // bne s5, r0, L39 + // nop // sll r0, r0, 0 + if (bc) {goto block_6;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_33: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + c->lq(s2, 16, sp); // lq s2, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.blerc_globals = intern_from_c(-1, 0, "*blerc-globals*").c(); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.gsf_buffer = intern_from_c(-1, 0, "*gsf-buffer*").c(); + cache.stats_blerc = intern_from_c(-1, 0, "*stats-blerc*").c(); + cache.flush_cache = intern_from_c(-1, 0, "flush-cache").c(); + gLinkedFunctionTable.reg("blerc-execute", execute, 256); +} + +} // namespace blerc_execute +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace setup_blerc_chains_for_one_fragment { +struct Cache { + void* blerc_globals; // *blerc-globals* + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 16, sp); // sq s0, 16(sp) + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + c->lb(v1, 0, t0); // lb v1, 0(t0) + c->addiu(t2, r0, 0); // addiu t2, r0, 0 + c->mov128_gpr_gpr(t7, r0); // por t7, r0, r0 + c->load_symbol2(t3, cache.blerc_globals); // lw t3, *blerc-globals*(s7) + c->lw(t3, 4, t3); // lw t3, 4(t3) + c->mov64(t4, v1); // or t4, v1, r0 + +block_1: + c->lui(t7, 4096); // lui t7, 4096 + // nop // sll r0, r0, 0 + c->daddiu(t7, t7, 1); // daddiu t7, t7, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t3) == 0; // beq t3, r0, L11 + c->sq(t7, 0, a2); // sq t7, 0(a2) + if (bc) {goto block_3;} // branch non-likely + + c->sw(a2, 12, t3); // sw a2, 12(t3) + // nop // sll r0, r0, 0 + +block_3: + c->mov64(t3, a2); // or t3, a2, r0 + c->daddu(t6, t4, t4); // daddu t6, t4, t4 + c->daddu(t5, v1, v1); // daddu t5, v1, v1 + c->daddu(t6, t6, t4); // daddu t6, t6, t4 + c->daddu(t7, t5, v1); // daddu t7, t5, v1 + c->daddu(t5, t6, t6); // daddu t5, t6, t6 + c->daddu(t6, t7, t7); // daddu t6, t7, t7 + c->daddu(t7, t5, t5); // daddu t7, t5, t5 + c->daddiu(t6, t6, 15); // daddiu t6, t6, 15 + c->daddiu(t5, t5, 15); // daddiu t5, t5, 15 + c->andi(t6, t6, 65520); // andi t6, t6, 65520 + c->dsrl(t5, t5, 4); // dsrl t5, t5, 4 + c->daddu(t8, t2, t2); // daddu t8, t2, t2 + c->daddiu(t7, t7, 15); // daddiu t7, t7, 15 + c->daddu(t9, t8, t2); // daddu t9, t8, t2 + c->dsrl(t8, t7, 4); // dsrl t8, t7, 4 + c->daddu(ra, t9, t9); // daddu ra, t9, t9 + c->addiu(t9, r0, 0); // addiu t9, r0, 0 + c->daddu(t7, ra, ra); // daddu t7, ra, ra + c->daddiu(s3, a2, 32); // daddiu s3, a2, 32 + c->daddu(s2, ra, a3); // daddu s2, ra, a3 + c->daddu(ra, t7, t1); // daddu ra, t7, t1 + c->lui(t7, 12288); // lui t7, 12288 + c->daddiu(gp, a0, -1); // daddiu gp, a0, -1 + c->daddu(t7, t7, t5); // daddu t7, t7, t5 + c->mov64(s5, a1); // or s5, a1, r0 + c->sq(t7, 0, s3); // sq t7, 0(s3) + c->daddiu(s4, t0, 2); // daddiu s4, t0, 2 + c->sw(s2, 4, s3); // sw s2, 4(s3) + c->daddu(s2, s2, t6); // daddu s2, s2, t6 + c->daddiu(s3, s3, 16); // daddiu s3, s3, 16 + // nop // sll r0, r0, 0 + +block_4: + c->lb(s1, 0, s4); // lb s1, 0(s4) + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->lh(s0, 0, s5); // lh s0, 0(s5) + c->daddiu(s5, s5, 2); // daddiu s5, s5, 2 + bc = c->sgpr64(s1) == 0; // beq s1, r0, L13 + c->sq(t7, 0, s3); // sq t7, 0(s3) + if (bc) {goto block_7;} // branch non-likely + + c->sw(s2, 4, s3); // sw s2, 4(s3) + c->daddu(s2, s2, t6); // daddu s2, s2, t6 + bc = c->sgpr64(s0) == 0; // beq s0, r0, L13 + c->sw(s0, 12, s3); // sw s0, 12(s3) + if (bc) {goto block_7;} // branch non-likely + + c->daddiu(s3, s3, 16); // daddiu s3, s3, 16 + c->daddiu(t9, t9, 1); // daddiu t9, t9, 1 + +block_7: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L12 + c->daddiu(gp, gp, -1); // daddiu gp, gp, -1 + if (bc) {goto block_4;} // branch non-likely + + c->sq(t7, 0, s3); // sq t7, 0(s3) + c->mov128_gpr_gpr(t6, r0); // por t6, r0, r0 + c->sw(ra, 4, s3); // sw ra, 4(s3) + get_fake_spad_addr2(t6, cache.fake_scratchpad_data, 0, c);// lui t6, 28672 + c->sb(t8, 0, s3); // sb t8, 0(s3) + // nop // sll r0, r0, 0 + c->sq(t6, 16, s3); // sq t6, 16(s3) + c->daddiu(t6, s3, 32); // daddiu t6, s3, 32 + c->sw(t9, 20, a2); // sw t9, 20(a2) + // nop // sll r0, r0, 0 + c->sw(t4, 16, a2); // sw t4, 16(a2) + // nop // sll r0, r0, 0 + c->sw(ra, 24, a2); // sw ra, 24(a2) + // nop // sll r0, r0, 0 + c->sw(t8, 28, a2); // sw t8, 28(a2) + // nop // sll r0, r0, 0 + bc = c->sgpr64(t4) != c->sgpr64(v1); // bne t4, v1, L14 + c->daddiu(t5, t5, 1); // daddiu t5, t5, 1 + if (bc) {goto block_11;} // branch non-likely + + c->daddiu(t7, t9, 3); // daddiu t7, t9, 3 + c->multu3(t5, t5, t7); // multu3 t5, t5, t7 + c->daddiu(t5, t5, -457); // daddiu t5, t5, -457 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(t5)) <= 0; // blez t5, L14 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + //beq r0, r0, L10 // beq r0, r0, L10 + c->addiu(t4, r0, 24); // addiu t4, r0, 24 + goto block_1; // branch always + + +block_11: + c->mov64(a2, t6); // or a2, t6, r0 + c->daddu(t2, t2, t4); // daddu t2, t2, t4 + bc = c->sgpr64(t2) == c->sgpr64(v1); // beq t2, v1, L15 + c->daddu(t5, t2, t4); // daddu t5, t2, t4 + if (bc) {goto block_14;} // branch non-likely + + c->dsubu(t5, t5, v1); // dsubu t5, t5, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(t5)) <= 0; // blez t5, L10 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + //beq r0, r0, L10 // beq r0, r0, L10 + c->dsubu(t4, v1, t2); // dsubu t4, v1, t2 + goto block_1; // branch always + + +block_14: + c->load_symbol2(v1, cache.blerc_globals); // lw v1, *blerc-globals*(s7) + c->sw(t3, 4, v1); // sw t3, 4(v1) + c->mov64(v0, a2); // or v0, a2, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + c->lq(s0, 16, sp); // lq s0, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.blerc_globals = intern_from_c(-1, 0, "*blerc-globals*").c(); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("setup-blerc-chains-for-one-fragment", execute, 256); +} + +} // namespace setup_blerc_chains_for_one_fragment +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/nav_control.cpp b/game/mips2c/jak3_functions/nav_control.cpp new file mode 100644 index 0000000000..e2a8e300f5 --- /dev/null +++ b/game/mips2c/jak3_functions/nav_control.cpp @@ -0,0 +1,274 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_39_nav_state { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + bool cop1_bc = false; + float acc; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->swc1(f20, 80, sp); // swc1 f20, 80(sp) + c->swc1(f22, 84, sp); // swc1 f22, 84(sp) + c->lwc1(f0, 32, a0); // lwc1 f0, 32(a0) + c->lwu(v1, 4, a0); // lwu v1, 4(a0) + c->lwc1(f1, 28, v1); // lwc1 f1, 28(v1) + c->muls(f1, f0, f1); // mul.s f1, f0, f1 + c->daddiu(v1, a0, 48); // daddiu v1, a0, 48 + c->lwc1(f0, 0, v1); // lwc1 f0, 0(v1) + c->lwc1(f2, 0, v1); // lwc1 f2, 0(v1) + c->muls(f0, f0, f2); // mul.s f0, f0, f2 + c->lwc1(f2, 8, v1); // lwc1 f2, 8(v1) + c->lwc1(f3, 8, v1); // lwc1 f3, 8(v1) + c->muls(f2, f2, f3); // mul.s f2, f2, f3 + c->adds(f0, f0, f2); // add.s f0, f0, f2 + c->sqrts(f0, f0); // sqrt.s f0, f0 + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->daddiu(v1, sp, 16); // daddiu v1, sp, 16 + c->daddiu(a1, sp, 32); // daddiu a1, sp, 32 + c->lwu(a2, 12, a0); // lwu a2, 12(a0) + c->lwu(a3, 0, a2); // lwu a3, 0(a2) + c->lwu(a2, 12, a0); // lwu a2, 12(a0) + c->lwu(a2, 0, a2); // lwu a2, 0(a2) + c->lwc1(f2, 28, a2); // lwc1 f2, 28(a2) + cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0 + bc = !cop1_bc; // bc1f L192 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_6;} // branch non-likely + + c->mov64(a2, v1); // or a2, v1, r0 + c->daddiu(t0, a0, 48); // daddiu t0, a0, 48 + c->lui(t1, 16256); // lui t1, 16256 + c->mtc1(f2, t1); // mtc1 f2, t1 + c->divs(f2, f2, f0); // div.s f2, f2, f0 + c->lqc2(vf1, 0, t0); // lqc2 vf1, 0(t0) + c->mfc1(t0, f2); // mfc1 t0, f2 + c->mov128_vf_gpr(vf2, t0); // qmtc2.i vf2, t0 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, a2); // sqc2 vf1, 0(a2) + c->mtc1(f2, r0); // mtc1 f2, r0 + c->swc1(f2, 4, v1); // swc1 f2, 4(v1) + c->mov64(a2, a1); // or a2, a1, r0 + c->lwc1(f2, 16, a3); // lwc1 f2, 16(a3) + c->cvtws(f1, f1); // cvt.w.s f1, f1 + c->mfc1(a3, f1); // mfc1 a3, f1 + c->dsll32(a3, a3, 16); // dsll32 a3, a3, 16 + c->dsra32(a3, a3, 16); // dsra32 a3, a3, 16 + c->mtc1(f1, a3); // mtc1 f1, a3 + c->cvtsw(f1, f1); // cvt.s.w f1, f1 + c->muls(f1, f2, f1); // mul.s f1, f2, f1 + c->lui(a3, 16255); // lui a3, 16255 + c->lui(t0, -16854); // lui t0, -16854 + c->ori(a3, a3, 65502); // ori a3, a3, 65502 + c->ori(t0, t0, 43253); // ori t0, t0, 43253 + c->subs(f22, f22, f22); // sub.s f22, f22, f22 + c->lui(t1, 15368); // lui t1, 15368 + c->mtc1(f10, a3); // mtc1 f10, a3 + c->ori(a3, t1, 27638); // ori a3, t1, 27638 + c->mtc1(f11, t0); // mtc1 f11, t0 + c->lui(t0, -18099); // lui t0, -18099 + c->muls(f2, f1, f1); // mul.s f2, f1, f1 + c->ori(t0, t0, 8306); // ori t0, t0, 8306 + c->mtc1(f12, a3); // mtc1 f12, a3 + c->lui(a3, 13850); // lui a3, 13850 + c->mtc1(f14, t0); // mtc1 f14, t0 + c->ori(t0, a3, 41599); // ori t0, a3, 41599 + // Unknown instr: mula.s f1, f10 + acc = c->fprs[f1] * c->fprs[f10]; + c->lui(a3, 16256); // lui a3, 16256 + c->muls(f3, f2, f1); // mul.s f3, f2, f1 + c->mov64(a3, a3); // or a3, a3, r0 + c->muls(f4, f2, f2); // mul.s f4, f2, f2 + c->lui(t1, -16641); // lui t1, -16641 + c->mtc1(f15, t0); // mtc1 f15, t0 + c->lui(t0, -16641); // lui t0, -16641 + c->or_(t0, t1, t0); // or t0, t1, t0 + c->mtc1(f16, a3); // mtc1 f16, a3 + // nop // sll r0, r0, 0 + c->mtc1(f17, t0); // mtc1 f17, t0 + // nop // sll r0, r0, 0 + c->muls(f5, f3, f2); // mul.s f5, f3, f2 + // nop // sll r0, r0, 0 + c->muls(f6, f3, f3); // mul.s f6, f3, f3 + // nop // sll r0, r0, 0 + c->muls(f7, f4, f3); // mul.s f7, f4, f3 + // nop // sll r0, r0, 0 + c->muls(f8, f4, f4); // mul.s f8, f4, f4 + // nop // sll r0, r0, 0 + c->muls(f9, f5, f4); // mul.s f9, f5, f4 + c->lui(a3, 15658); // lui a3, 15658 + // Unknown instr: madda.s f3, f11 + acc += c->fprs[f3] * c->fprs[f11]; + c->ori(a3, a3, 31272); // ori a3, a3, 31272 + // Unknown instr: madda.s f5, f12 + acc += c->fprs[f5] * c->fprs[f12]; + c->lui(t0, -17742); // lui t0, -17742 + // Unknown instr: madda.s f7, f14 + acc += c->fprs[f7] * c->fprs[f14]; + c->ori(t0, t0, 48177); // ori t0, t0, 48177 + // Unknown instr: madd.s f21, f9, f15 + c->fprs[f21] = acc + (c->fprs[f9] * c->fprs[f15]); + c->lui(t1, 14249); // lui t1, 14249 + c->mtc1(f18, a3); // mtc1 f18, a3 + c->ori(a3, t1, 13291); // ori a3, t1, 13291 + c->mtc1(f19, t0); // mtc1 f19, t0 + // nop // sll r0, r0, 0 + c->mtc1(f20, a3); // mtc1 f20, a3 + // nop // sll r0, r0, 0 + // Unknown instr: mula.s f16, f16 + acc = c->fprs[f16] * c->fprs[f16]; + // nop // sll r0, r0, 0 + // Unknown instr: madda.s f2, f17 + acc += c->fprs[f2] * c->fprs[f17]; + // nop // sll r0, r0, 0 + // Unknown instr: madda.s f4, f18 + acc += c->fprs[f4] * c->fprs[f18]; + // nop // sll r0, r0, 0 + // Unknown instr: madda.s f6, f19 + acc += c->fprs[f6] * c->fprs[f19]; + // nop // sll r0, r0, 0 + // Unknown instr: madd.s f22, f8, f20 + c->fprs[f22] = acc + (c->fprs[f8] * c->fprs[f20]); + // nop // sll r0, r0, 0 + c->swc1(f21, 0, a2); // swc1 f21, 0(a2) + // nop // sll r0, r0, 0 + c->swc1(f22, 4, a2); // swc1 f22, 4(a2) + c->gprs[a2].du64[0] = 0; // or a2, r0, r0 + c->mov64(a3, v1); // or a3, v1, r0 + c->daddiu(a2, a0, 144); // daddiu a2, a0, 144 + c->lwc1(f1, 0, a3); // lwc1 f1, 0(a3) + c->lwc1(f2, 4, a3); // lwc1 f2, 4(a3) + c->lwc1(f3, 8, a3); // lwc1 f3, 8(a3) + c->lwc1(f4, 0, a2); // lwc1 f4, 0(a2) + c->lwc1(f5, 4, a2); // lwc1 f5, 4(a2) + c->lwc1(f6, 8, a2); // lwc1 f6, 8(a2) + // Unknown instr: mula.s f1, f4 + // Unknown instr: madda.s f2, f5 + // Unknown instr: madd.s f1, f3, f6 + c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]); + c->mfc1(a2, f1); // mfc1 a2, f1 + c->mtc1(f1, a2); // mtc1 f1, a2 + c->lwc1(f2, 4, a1); // lwc1 f2, 4(a1) + cop1_bc = c->fprs[f1] < c->fprs[f2]; // c.lt.s f1, f2 + bc = !cop1_bc; // bc1f L192 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(a2, sp, 48); // daddiu a2, sp, 48 + c->daddiu(a3, sp, 64); // daddiu a3, sp, 64 + c->mov64(t0, a2); // or t0, a2, r0 + c->daddiu(t1, a0, 144); // daddiu t1, a0, 144 + c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1) + c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1) + c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1) + c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1) + c->muls(f5, f3, f2); // mul.s f5, f3, f2 + c->muls(f6, f1, f4); // mul.s f6, f1, f4 + c->adds(f5, f5, f6); // add.s f5, f5, f6 + c->swc1(f5, 0, t0); // swc1 f5, 0(t0) + c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1) + c->swc1(f5, 4, t0); // swc1 f5, 4(t0) + c->muls(f3, f3, f4); // mul.s f3, f3, f4 + c->muls(f1, f1, f2); // mul.s f1, f1, f2 + c->subs(f1, f3, f1); // sub.s f1, f3, f1 + c->swc1(f1, 8, t0); // swc1 f1, 8(t0) + c->mfc1(t0, f1); // mfc1 t0, f1 + c->mov64(t0, a3); // or t0, a3, r0 + c->daddiu(t1, a0, 144); // daddiu t1, a0, 144 + c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1) + c->negs(f1, f1); // neg.s f1, f1 + c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1) + c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1) + c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1) + c->muls(f5, f3, f2); // mul.s f5, f3, f2 + c->muls(f6, f1, f4); // mul.s f6, f1, f4 + c->adds(f5, f5, f6); // add.s f5, f5, f6 + c->swc1(f5, 0, t0); // swc1 f5, 0(t0) + c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1) + c->swc1(f5, 4, t0); // swc1 f5, 4(t0) + c->muls(f3, f3, f4); // mul.s f3, f3, f4 + c->muls(f1, f1, f2); // mul.s f1, f1, f2 + c->subs(f1, f3, f1); // sub.s f1, f3, f1 + c->swc1(f1, 8, t0); // swc1 f1, 8(t0) + c->mfc1(a1, f1); // mfc1 a1, f1 + c->mov64(t0, a2); // or t0, a2, r0 + c->mov64(a1, v1); // or a1, v1, r0 + c->lwc1(f1, 0, t0); // lwc1 f1, 0(t0) + c->lwc1(f2, 4, t0); // lwc1 f2, 4(t0) + c->lwc1(f3, 8, t0); // lwc1 f3, 8(t0) + c->lwc1(f4, 0, a1); // lwc1 f4, 0(a1) + c->lwc1(f5, 4, a1); // lwc1 f5, 4(a1) + c->lwc1(f6, 8, a1); // lwc1 f6, 8(a1) + // Unknown instr: mula.s f1, f4 + // Unknown instr: madda.s f2, f5 + // Unknown instr: madd.s f1, f3, f6 + c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]); + c->mfc1(a1, f1); // mfc1 a1, f1 + c->mtc1(f1, a1); // mtc1 f1, a1 + c->mov64(t0, a3); // or t0, a3, r0 + c->mov64(a1, v1); // or a1, v1, r0 + c->lwc1(f2, 0, t0); // lwc1 f2, 0(t0) + c->lwc1(f3, 4, t0); // lwc1 f3, 4(t0) + c->lwc1(f4, 8, t0); // lwc1 f4, 8(t0) + c->lwc1(f5, 0, a1); // lwc1 f5, 0(a1) + c->lwc1(f6, 4, a1); // lwc1 f6, 4(a1) + c->lwc1(f7, 8, a1); // lwc1 f7, 8(a1) + // Unknown instr: mula.s f2, f5 + // Unknown instr: madda.s f3, f6 + // Unknown instr: madd.s f2, f4, f7 + c->fprs[f2] = (c->fprs[f4] * c->fprs[f7]) + (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]); + c->mfc1(a1, f2); // mfc1 a1, f2 + c->mtc1(f2, a1); // mtc1 f2, a1 + cop1_bc = c->fprs[f2] < c->fprs[f1]; // c.lt.s f2, f1 + bc = !cop1_bc; // bc1f L190 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + c->mov64(a1, v1); // or a1, v1, r0 + c->lq(a2, 0, a2); // lq a2, 0(a2) + c->sq(a2, 0, a1); // sq a2, 0(a1) + //beq r0, r0, L191 // beq r0, r0, L191 + // nop // sll r0, r0, 0 + goto block_5; // branch always + + +block_4: + c->mov64(a1, v1); // or a1, v1, r0 + c->lq(a2, 0, a3); // lq a2, 0(a3) + c->sq(a2, 0, a1); // sq a2, 0(a1) + +block_5: + c->daddiu(a0, a0, 48); // daddiu a0, a0, 48 + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mov128_vf_gpr(vf2, v1); // qmtc2.i vf2, v1 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, a0); // sqc2 vf1, 0(a0) + c->daddiu(v0, s7, 4); // daddiu v0, s7, #t + +block_6: + c->lwc1(f22, 84, sp); // lwc1 f22, 84(sp) + c->lwc1(f20, 80, sp); // lwc1 f20, 80(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 39 nav-state)", execute, 96); +} + +} // namespace method_39_nav_state +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/nav_engine.cpp b/game/mips2c/jak3_functions/nav_engine.cpp new file mode 100644 index 0000000000..6c085e8c30 --- /dev/null +++ b/game/mips2c/jak3_functions/nav_engine.cpp @@ -0,0 +1,539 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_21_nav_engine { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + c->lwu(v1, 80, a0); // lwu v1, 80(a0) + c->lwu(v1, 4, v1); // lwu v1, 4(v1) + c->lwu(a2, 8, a0); // lwu a2, 8(a0) + c->lwu(a2, 4, a2); // lwu a2, 4(a2) + c->dsubu(v1, v1, a2); // dsubu v1, v1, a2 + c->addiu(a2, r0, 0); // addiu a2, r0, 0 + //beq r0, r0, L30 // beq r0, r0, L30 + // nop // sll r0, r0, 0 + goto block_4; // branch always + + +block_1: + c->lwu(a3, 4, a1); // lwu a3, 4(a1) + c->addiu(t0, r0, 288); // addiu t0, r0, 288 + c->mult3(t0, t0, a2); // mult3 t0, t0, a2 + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->daddiu(t0, a3, 112); // daddiu t0, a3, 112 + c->lwu(t1, 8, a3); // lwu t1, 8(a3) + bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L29 + c->mov64(t1, s7); // or t1, s7, r0 + if (bc) {goto block_3;} // branch non-likely + + c->lwu(t1, 76, a0); // lwu t1, 76(a0) + c->daddiu(t1, t1, 32); // daddiu t1, t1, 32 + c->sw(t1, 56, a3); // sw t1, 56(a3) + c->lwu(t1, 80, a0); // lwu t1, 80(a0) + c->sw(t1, 124, a3); // sw t1, 124(a3) + c->lwu(t1, 0, a1); // lwu t1, 0(a1) + c->addiu(t2, r0, 288); // addiu t2, r0, 288 + c->mult3(t2, t2, a2); // mult3 t2, t2, a2 + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->sw(t1, 4, t0); // sw t1, 4(t0) + c->mov64(t1, v1); // or t1, v1, r0 + c->lw(t2, 16, t0); // lw t2, 16(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->sltiu(t4, t4, 1); // sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 16, t0); // sw t2, 16(t0) + c->lw(t2, 28, t0); // lw t2, 28(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->sltiu(t4, t4, 1); // sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 28, t0); // sw t2, 28(t0) + c->lw(t2, 24, t0); // lw t2, 24(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->sltiu(t4, t4, 1); // sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 24, t0); // sw t2, 24(t0) + c->lw(t2, 20, t0); // lw t2, 20(t0) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->xor_(t3, t2, s7); // xor t3, t2, s7 + c->sltiu(t3, t3, 1); // sltiu t3, t3, 1 + c->movz(t2, t1, t3); // movz t2, t1, t3 + c->sw(t2, 20, t0); // sw t2, 20(t0) + c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + c->lwu(t0, 0, a1); // lwu t0, 0(a1) + c->addiu(t1, r0, 288); // addiu t1, r0, 288 + c->mult3(t1, t1, a2); // mult3 t1, t1, a2 + c->daddu(t1, t0, t1); // daddu t1, t0, t1 + c->lwu(a3, 8, a3); // lwu a3, 8(a3) + c->sw(t1, 140, a3); // sw t1, 140(a3) + +block_3: + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + +block_4: + c->lb(a3, 14, a1); // lb a3, 14(a1) + c->slt(a3, a2, a3); // slt a3, a2, a3 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L28 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 21 nav-engine)", execute, 0); +} + +} // namespace method_21_nav_engine +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_20_nav_engine { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + c->lwu(v1, 8, a0); // lwu v1, 8(a0) + c->lwu(v1, 4, v1); // lwu v1, 4(v1) + c->lwu(a2, 80, a0); // lwu a2, 80(a0) + c->lwu(a2, 4, a2); // lwu a2, 4(a2) + c->dsubu(v1, v1, a2); // dsubu v1, v1, a2 + c->addiu(a2, r0, 0); // addiu a2, r0, 0 + //beq r0, r0, L35 // beq r0, r0, L35 + // nop // sll r0, r0, 0 + goto block_6; // branch always + + +block_1: + c->lwu(a3, 4, a1); // lwu a3, 4(a1) + c->addiu(t0, r0, 288); // addiu t0, r0, 288 + c->mult3(t0, t0, a2); // mult3 t0, t0, a2 + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->daddiu(t0, a3, 112); // daddiu t0, a3, 112 + c->lwu(t1, 8, a3); // lwu t1, 8(a3) + bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L34 + c->mov64(t1, s7); // or t1, s7, r0 + if (bc) {goto block_5;} // branch non-likely + + c->addiu(t1, r0, -257); // addiu t1, r0, -257 + c->lwu(t2, 0, a3); // lwu t2, 0(a3) + c->and_(t1, t1, t2); // and t1, t1, t2 + c->sw(t1, 0, a3); // sw t1, 0(a3) + c->lwu(t1, 8, a3); // lwu t1, 8(a3) + c->lwu(t1, 4, t1); // lwu t1, 4(t1) + c->andi(t1, t1, 2048); // andi t1, t1, 2048 + bc = c->sgpr64(t1) == 0; // beq t1, r0, L33 + c->mov64(t1, s7); // or t1, s7, r0 + if (bc) {goto block_4;} // branch non-likely + + c->lwu(t1, 0, a3); // lwu t1, 0(a3) + c->ori(t1, t1, 256); // ori t1, t1, 256 + c->sw(t1, 0, a3); // sw t1, 0(a3) + +block_4: + c->lwu(t1, 4, a0); // lwu t1, 4(a0) + c->daddiu(t1, t1, 32); // daddiu t1, t1, 32 + c->sw(t1, 56, a3); // sw t1, 56(a3) + c->lwu(t1, 8, a0); // lwu t1, 8(a0) + c->sw(t1, 124, a3); // sw t1, 124(a3) + c->mov64(t1, v1); // or t1, v1, r0 + c->lw(t2, 16, t0); // lw t2, 16(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->slti(t4, t4, 1); // sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 16, t0); // sw t2, 16(t0) + c->lw(t2, 28, t0); // lw t2, 28(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->slti(t4, t4, 1); // sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 28, t0); // sw t2, 28(t0) + c->lw(t2, 24, t0); // lw t2, 24(t0) + c->daddu(t3, t2, t1); // daddu t3, t2, t1 + c->xor_(t4, t2, s7); // xor t4, t2, s7 + c->slti(t4, t4, 1); // sltiu t4, t4, 1 + c->movz(t2, t3, t4); // movz t2, t3, t4 + c->sw(t2, 24, t0); // sw t2, 24(t0) + c->lw(t2, 20, t0); // lw t2, 20(t0) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->xor_(t3, t2, s7); // xor t3, t2, s7 + c->slti(t3, t3, 1); // sltiu t3, t3, 1 + c->movz(t2, t1, t3); // movz t2, t1, t3 + c->sw(t2, 20, t0); // sw t2, 20(t0) + c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + c->lwu(a3, 8, a3); // lwu a3, 8(a3) + c->sw(s7, 140, a3); // sw s7, 140(a3) + c->mov64(t1, s7); // or t1, s7, r0 + +block_5: + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + +block_6: + c->lb(a3, 14, a1); // lb a3, 14(a1) + c->slt(a3, a2, a3); // slt a3, a2, a3 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L32 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 20 nav-engine)", execute, 0); +} + +} // namespace method_20_nav_engine +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_18_nav_engine { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + c->lwu(a2, 0, a1); // lwu a2, 0(a1) + c->lwu(v1, 4, a1); // lwu v1, 4(a1) + c->lwu(a0, 8, a1); // lwu a0, 8(a1) + c->lui(a1, 4096); // lui a1, 4096 + c->ori(a1, a1, 53248); // ori a1, a1, 53248 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + +// block_1: +// c->lw(a3, 0, a1); // lw a3, 0(a1) +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(a3) != 0; // bne a3, r0, L43 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_1;} // branch non-likely + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a2, a3, a2); // and a2, a3, a2 + // c->sw(a2, 16, a1); // sw a2, 16(a1) + u32 madr = c->sgpr64(a2); + c->lui(a2, 4095); // lui a2, 4095 + c->ori(a2, a2, 65535); // ori a2, a2, 65535 + c->and_(v1, a2, v1); // and v1, a2, v1 + // c->sw(v1, 128, a1); // sw v1, 128(a1) + u32 sadr = c->sgpr64(v1); + // c->sw(a0, 32, a1); // sw a0, 32(a1) + u32 qwc = c->sgpr64(a0); + // Unknown instr: sync.l + c->addiu(v1, r0, 256); // addiu v1, r0, 256 + // c->sw(v1, 0, a1); // sw v1, 0(a1) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 18 nav-engine)", execute, 0); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); +} + +} // namespace method_18_nav_engine +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_17_nav_engine { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lwu(v1, 4, a1); // lwu v1, 4(a1) + c->lwu(a2, 0, a1); // lwu a2, 0(a1) + c->lwu(a0, 8, a1); // lwu a0, 8(a1) + c->lui(a1, 4096); // lui a1, 4096 + c->ori(a1, a1, 54272); // ori a1, a1, 54272 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + +// block_1: +// c->lw(a3, 0, a1); // lw a3, 0(a1) +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(a3) != 0; // bne a3, r0, L45 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_1;} // branch non-likely + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a2, a3, a2); // and a2, a3, a2 + // c->sw(a2, 16, a1); // sw a2, 16(a1) + u32 madr = c->sgpr64(a2); + c->lui(a2, 4095); // lui a2, 4095 + c->ori(a2, a2, 65535); // ori a2, a2, 65535 + c->and_(v1, a2, v1); // and v1, a2, v1 + // c->sw(v1, 128, a1); // sw v1, 128(a1) + u32 sadr = c->sgpr64(v1); + // c->sw(a0, 32, a1); // sw a0, 32(a1) + u32 qwc = c->sgpr64(a0); + // Unknown instr: sync.l + c->addiu(v1, r0, 256); // addiu v1, r0, 256 + // c->sw(v1, 0, a1); // sw v1, 0(a1) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 17 nav-engine)", execute, 0); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); +} + +} // namespace method_17_nav_engine +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace nav_state_patch_pointers { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lw(v1, 16, a0); // lw v1, 16(a0) + c->daddu(a2, v1, a1); // daddu a2, v1, a1 + c->xor_(a3, v1, s7); // xor a3, v1, s7 + c->sltiu(a3, a3, 1); // sltiu a3, a3, 1 + c->movz(v1, a2, a3); // movz v1, a2, a3 + c->sw(v1, 16, a0); // sw v1, 16(a0) + c->lw(v1, 28, a0); // lw v1, 28(a0) + c->daddu(a2, v1, a1); // daddu a2, v1, a1 + c->xor_(a3, v1, s7); // xor a3, v1, s7 + c->sltiu(a3, a3, 1); // sltiu a3, a3, 1 + c->movz(v1, a2, a3); // movz v1, a2, a3 + c->sw(v1, 28, a0); // sw v1, 28(a0) + c->lw(v1, 24, a0); // lw v1, 24(a0) + c->daddu(a2, v1, a1); // daddu a2, v1, a1 + c->xor_(a3, v1, s7); // xor a3, v1, s7 + c->sltiu(a3, a3, 1); // sltiu a3, a3, 1 + c->movz(v1, a2, a3); // movz v1, a2, a3 + c->sw(v1, 24, a0); // sw v1, 24(a0) + c->lw(v1, 20, a0); // lw v1, 20(a0) + c->daddu(a1, v1, a1); // daddu a1, v1, a1 + c->xor_(a2, v1, s7); // xor a2, v1, s7 + c->sltiu(a2, a2, 1); // sltiu a2, a2, 1 + c->movz(v1, a1, a2); // movz v1, a1, a2 + c->sw(v1, 20, a0); // sw v1, 20(a0) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("nav-state-patch-pointers", execute, 0); +} + +} // namespace nav_state_patch_pointers +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace nav_dma_send_from_spr_no_flush { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lui(v1, 4096); // lui v1, 4096 + c->ori(v1, v1, 53248); // ori v1, v1, 53248 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + +// block_1: +// c->lw(a3, 0, v1); // lw a3, 0(v1) +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(a3) != 0; // bne a3, r0, L49 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_1;} // branch non-likely + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a0, a3, a0); // and a0, a3, a0 + // c->sw(a0, 16, v1); // sw a0, 16(v1) + u32 madr = c->sgpr64(a0); + c->lui(a0, 4095); // lui a0, 4095 + c->ori(a0, a0, 65535); // ori a0, a0, 65535 + c->and_(a0, a0, a1); // and a0, a0, a1 + // c->sw(a0, 128, v1); // sw a0, 128(v1) + u32 sadr = c->sgpr64(a0); + // c->sw(a2, 32, v1); // sw a2, 32(v1) + u32 qwc = c->sgpr64(a2); + // Unknown instr: sync.l + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, v1); // sw a0, 0(v1) + spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("nav-dma-send-from-spr-no-flush", execute, 0); +} + +} // namespace nav_dma_send_from_spr_no_flush +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace nav_dma_send_to_spr_no_flush { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->lui(v1, 4096); // lui v1, 4096 + c->ori(v1, v1, 54272); // ori v1, v1, 54272 + c->addiu(a3, r0, 0); // addiu a3, r0, 0 + +// block_1: +// c->lw(a3, 0, v1); // lw a3, 0(v1) +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// // nop // sll r0, r0, 0 +// bc = c->sgpr64(a3) != 0; // bne a3, r0, L51 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_1;} // branch non-likely + + // Unknown instr: sync.l + c->lui(a3, 4095); // lui a3, 4095 + c->ori(a3, a3, 65535); // ori a3, a3, 65535 + c->and_(a1, a3, a1); // and a1, a3, a1 + // c->sw(a1, 16, v1); // sw a1, 16(v1) + u32 madr = c->sgpr64(a1); + c->lui(a1, 4095); // lui a1, 4095 + c->ori(a1, a1, 65535); // ori a1, a1, 65535 + c->and_(a0, a1, a0); // and a0, a1, a0 + // c->sw(a0, 128, v1); // sw a0, 128(v1) + u32 sadr = c->sgpr64(a0); + // c->sw(a2, 32, v1); // sw a2, 32(v1) + u32 qwc = c->sgpr64(a2); + // Unknown instr: sync.l + c->addiu(a0, r0, 256); // addiu a0, r0, 256 + // c->sw(a0, 0, v1); // sw a0, 0(v1) + spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc); + // Unknown instr: sync.l + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("nav-dma-send-to-spr-no-flush", execute, 0); +} + +} // namespace nav_dma_send_to_spr_no_flush +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/wvehicle_part.cpp b/game/mips2c/jak3_functions/wvehicle_part.cpp new file mode 100644 index 0000000000..a1fe589ef0 --- /dev/null +++ b/game/mips2c/jak3_functions/wvehicle_part.cpp @@ -0,0 +1,252 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace sparticle_motion_blur_dirt { +struct Cache { + void* target; // *target* + void* atan; // atan + void* transform_point_qword; // transform-point-qword! +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -144); // daddiu sp, sp, -144 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + c->swc1(f26, 128, sp); // swc1 f26, 128(sp) + c->swc1(f28, 132, sp); // swc1 f28, 132(sp) + c->swc1(f30, 136, sp); // swc1 f30, 136(sp) + c->mov64(s4, a1); // or s4, a1, r0 + c->mov64(gp, a2); // or gp, a2, r0 + c->daddiu(s5, sp, 16); // daddiu s5, sp, 16 + c->lwc1(f0, 0, gp); // lwc1 f0, 0(gp) + c->swc1(f0, 0, s5); // swc1 f0, 0(s5) + c->lwc1(f0, 4, gp); // lwc1 f0, 4(gp) + c->swc1(f0, 4, s5); // swc1 f0, 4(s5) + c->lwc1(f0, 8, gp); // lwc1 f0, 8(gp) + c->swc1(f0, 8, s5); // swc1 f0, 8(s5) + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 12, s5); // swc1 f0, 12(s5) + c->lwc1(f0, 16, s4); // lwc1 f0, 16(s4) + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1 + bc = !cop1_bc; // bc1f L13 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_2;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_2: + if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(v1))) {// bnel s7, v1, L15 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_10; + } + +block_4: + c->lwc1(f0, 20, s4); // lwc1 f0, 20(s4) + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1 + bc = !cop1_bc; // bc1f L14 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_6;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_6: + if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(v1))) {// bnel s7, v1, L15 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_10; + } + +block_8: + c->lwc1(f0, 24, s4); // lwc1 f0, 24(s4) + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1 + bc = !cop1_bc; // bc1f L15 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_10;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_10: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(v1))) {// beql s7, v1, L16 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_13; + } + +block_12: + c->load_symbol2(t9, cache.transform_point_qword); // lw t9, transform-point-qword!(s7) + c->daddiu(a0, s5, 32); // daddiu a0, s5, 32 + c->daddu(a1, r0, s5); // daddu a1, r0, s5 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_13: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L19 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_21;} // branch non-likely + + c->daddiu(v1, s5, 16); // daddiu v1, s5, 16 + c->daddiu(a0, s4, 16); // daddiu a0, s4, 16 + c->lq(a0, 0, a0); // lq a0, 0(a0) + c->sq(a0, 0, v1); // sq a0, 0(v1) + c->load_symbol2(v1, cache.target); // lw v1, *target*(s7) + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L17 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_16;} // branch non-likely + + c->daddiu(v1, s5, 16); // daddiu v1, s5, 16 + c->daddiu(a0, s5, 16); // daddiu a0, s5, 16 + c->load_symbol2(a1, cache.target); // lw a1, *target*(s7) + c->lwu(a1, 124, a1); // lwu a1, 124(a1) + c->daddiu(a1, a1, 60); // daddiu a1, a1, 60 + c->lui(a2, 15194); // lui a2, 15194 + c->ori(a2, a2, 29710); // ori a2, a2, 29710 + c->mtc1(f0, a2); // mtc1 f0, a2 + c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1) + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mov128_vf_gpr(vf3, a0); // qmtc2.i vf3, a0 + c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0 + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3 + c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0 + c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1) + +block_16: + c->daddu(v1, r0, s5); // daddu v1, r0, s5 + c->daddu(a0, r0, s5); // daddu a0, r0, s5 + c->daddiu(a1, s5, 16); // daddiu a1, s5, 16 + c->lui(a2, 16896); // lui a2, 16896 + c->mtc1(f0, a2); // mtc1 f0, a2 + c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1) + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mov128_vf_gpr(vf3, a0); // qmtc2.i vf3, a0 + c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0 + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3 + c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0 + c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1) + c->load_symbol2(t9, cache.transform_point_qword); // lw t9, transform-point-qword!(s7) + c->daddiu(a0, s5, 48); // daddiu a0, s5, 48 + c->daddu(a1, r0, s5); // daddu a1, r0, s5 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + bc = c->sgpr64(s7) == c->sgpr64(v0); // beq s7, v0, L19 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_21;} // branch non-likely + + c->lw(v1, 32, s5); // lw v1, 32(s5) + c->daddiu(v1, v1, -28672); // daddiu v1, v1, -28672 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->cvtsw(f0, f0); // cvt.s.w f0, f0 + c->lw(v1, 36, s5); // lw v1, 36(s5) + c->daddiu(v1, v1, -29440); // daddiu v1, v1, -29440 + c->mtc1(f1, v1); // mtc1 f1, v1 + c->cvtsw(f1, f1); // cvt.s.w f1, f1 + c->lw(v1, 48, s5); // lw v1, 48(s5) + c->daddiu(v1, v1, -28672); // daddiu v1, v1, -28672 + c->mtc1(f2, v1); // mtc1 f2, v1 + c->cvtsw(f2, f2); // cvt.s.w f2, f2 + c->lw(v1, 52, s5); // lw v1, 52(s5) + c->daddiu(v1, v1, -29440); // daddiu v1, v1, -29440 + c->mtc1(f3, v1); // mtc1 f3, v1 + c->cvtsw(f3, f3); // cvt.s.w f3, f3 + c->subs(f30, f2, f0); // sub.s f30, f2, f0 + c->subs(f28, f3, f1); // sub.s f28, f3, f1 + c->lui(v1, -14720); // lui v1, -14720 + c->mtc1(f26, v1); // mtc1 f26, v1 + c->load_symbol2(t9, cache.atan); // lw t9, atan(s7) + c->mfc1(a0, f30); // mfc1 a0, f30 + c->mfc1(a1, f28); // mfc1 a1, f28 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->adds(f0, f26, f0); // add.s f0, f26, f0 + c->swc1(f0, 24, gp); // swc1 f0, 24(gp) + c->lwc1(f0, 12, s4); // lwc1 f0, 12(s4) + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1 + bc = cop1_bc; // bc1t L18 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_19;} // branch non-likely + + c->lui(v1, 16580); // lui v1, 16580 + c->ori(v1, v1, 39846); // ori v1, v1, 39846 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lui(v1, 18804); // lui v1, 18804 + c->ori(v1, v1, 9216); // ori v1, v1, 9216 + c->mtc1(f1, v1); // mtc1 f1, v1 + c->lw(v1, 40, s5); // lw v1, 40(s5) + c->mtc1(f2, v1); // mtc1 f2, v1 + c->cvtsw(f2, f2); // cvt.s.w f2, f2 + c->divs(f1, f1, f2); // div.s f1, f1, f2 + c->muls(f0, f0, f1); // mul.s f0, f0, f1 + c->muls(f1, f30, f30); // mul.s f1, f30, f30 + c->muls(f2, f28, f28); // mul.s f2, f28, f28 + c->adds(f1, f1, f2); // add.s f1, f1, f2 + c->sqrts(f1, f1); // sqrt.s f1, f1 + c->muls(f0, f0, f1); // mul.s f0, f0, f1 + c->swc1(f0, 12, gp); // swc1 f0, 12(gp) + c->mfc1(v1, f0); // mfc1 v1, f0 + +block_19: + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L21 // beq r0, r0, L21 + // nop // sll r0, r0, 0 + goto block_24; // branch always + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_21: + c->lwc1(f0, 12, s4); // lwc1 f0, 12(s4) + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1 + bc = cop1_bc; // bc1t L20 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_23;} // branch non-likely + + c->mtc1(f0, r0); // mtc1 f0, r0 + c->swc1(f0, 12, gp); // swc1 f0, 12(gp) + c->mfc1(v1, f0); // mfc1 v1, f0 + +block_23: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + +block_24: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lwc1(f30, 136, sp); // lwc1 f30, 136(sp) + c->lwc1(f28, 132, sp); // lwc1 f28, 132(sp) + c->lwc1(f26, 128, sp); // lwc1 f26, 128(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 144); // daddiu sp, sp, 144 + goto end_of_function; // return + +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.target = intern_from_c(-1, 0, "*target*").c(); + cache.atan = intern_from_c(-1, 0, "atan").c(); + cache.transform_point_qword = intern_from_c(-1, 0, "transform-point-qword!").c(); + gLinkedFunctionTable.reg("sparticle-motion-blur-dirt", execute, 256); +} + +} // namespace sparticle_motion_blur_dirt +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index dd6da855d9..9db3a79448 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -335,6 +335,17 @@ namespace particle_adgif { extern void link(); } namespace sp_init_fields { extern void link(); } namespace sp_process_block_2d { extern void link(); } namespace sp_process_block_3d { extern void link(); } +namespace method_39_nav_state { extern void link(); } +namespace method_21_nav_engine { extern void link(); } +namespace method_20_nav_engine { extern void link(); } +namespace method_18_nav_engine { extern void link(); } +namespace method_17_nav_engine { extern void link(); } +namespace nav_state_patch_pointers { extern void link(); } +namespace nav_dma_send_from_spr_no_flush { extern void link(); } +namespace nav_dma_send_to_spr_no_flush { extern void link(); } +namespace blerc_execute { extern void link(); } +namespace setup_blerc_chains_for_one_fragment { extern void link(); } +namespace sparticle_motion_blur_dirt { extern void link(); } } // clang-format on @@ -562,6 +573,15 @@ PerGameVersion>> gMips2C {jak3::sparticle_motion_blur::link, jak3::sp_launch_particles_var::link, jak3::particle_adgif::link, jak3::sp_init_fields::link}}, {"sparticle", {jak3::sp_process_block_2d::link, jak3::sp_process_block_3d::link}}, + {"nav-engine", + {jak3::method_21_nav_engine::link, jak3::method_20_nav_engine::link, + jak3::method_18_nav_engine::link, jak3::method_17_nav_engine::link, + jak3::nav_state_patch_pointers::link, jak3::nav_dma_send_from_spr_no_flush::link, + jak3::nav_dma_send_to_spr_no_flush::link}}, + {"nav-control", {jak3::method_39_nav_state::link}}, + {"merc-blend-shape", + {jak3::blerc_execute::link, jak3::setup_blerc_chains_for_one_fragment::link}}, + {"wvehicle-part", {jak3::sparticle_motion_blur_dirt::link}}, }}; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index 034ffd36bd..4bf9e8e74a 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -273,6 +273,10 @@ `(define-extern ,function-name (function ,@type-info)) ) +(defmacro def-event-handler (name type) + `(define-extern ,name (function process int symbol event-message-block object :behavior ,type)) + ) + (defmacro defun-debug (name bindings &rest body) "Define a function which is only present in debug mode. Otherwise the function becomes nothing" `(if *debug-segment* diff --git a/goal_src/jak3/engine/ai/enemy-h.gc b/goal_src/jak3/engine/ai/enemy-h.gc index 6432813b1c..50dd06e08c 100644 --- a/goal_src/jak3/engine/ai/enemy-h.gc +++ b/goal_src/jak3/engine/ai/enemy-h.gc @@ -58,6 +58,14 @@ (death-start 34) (auto-death-phase-out 35) (has-gem 36) + (ef37 37) + (ef38 38) + (ef39 39) + (ef40 40) + (ef41 41) + (ef42 42) + (ef43 43) + (ef44 44) ) ;; ---enemy-flag @@ -181,7 +189,7 @@ (gem-seg uint32) (gem-no-seg uint32) (gem-offset sphere :inline) - (knocked-off basic) + (knocked-off symbol) ) (:methods (copy-enemy-info! (_type_ _type_) none) @@ -349,7 +357,7 @@ (enemy-method-88 (_type_ enemy-knocked-info) symbol) (within-gspot-range? (_type_) symbol) (enemy-method-90 (_type_ ragdoll-proc) none) - (enemy-method-91 (_type_) symbol) + (enemy-method-91 (_type_ enemy-jump-info) object) (init-jump-info! (_type_ enemy-jump-info) none) (setup-jump! (_type_ enemy-jump-info) none) (move-to-gspot! (_type_) float) @@ -359,14 +367,14 @@ (jump-wind-up-anim (_type_ enemy-jump-info) symbol) (jump-anim-handler (_type_ int enemy-jump-info) symbol) (in-jump-handler (_type_ int enemy-jump-info) none) - (enemy-method-101 (_type_) none) + (enemy-method-101 (_type_ int enemy-jump-info) none) (go-directed2 (_type_) object) (enemy-method-103 (_type_ vector float) symbol) (enemy-method-104 (_type_ vector float) symbol) (enemy-method-105 (_type_ float symbol) symbol) (find-best-focus (_type_) process) - (enemy-method-107 (_type_) symbol) - (enemy-method-108 (_type_) symbol) + (is-pfoc-in-mesh? (_type_ process-focusable vector) symbol) + (enemy-method-108 (_type_ process-focusable) symbol) (enemy-method-109 (_type_) symbol) (send-attack (_type_ process touching-shapes-entry uint) symbol) (on-attack (_type_ process-focusable) none) diff --git a/goal_src/jak3/engine/ai/enemy.gc b/goal_src/jak3/engine/ai/enemy.gc index 01e2e53f5f..4da44653be 100644 --- a/goal_src/jak3/engine/ai/enemy.gc +++ b/goal_src/jak3/engine/ai/enemy.gc @@ -1259,11 +1259,11 @@ ) ) -(defmethod enemy-method-107 ((this enemy)) +(defmethod is-pfoc-in-mesh? ((this enemy) (arg0 process-focusable) (arg1 vector)) #t ) -(defmethod enemy-method-108 ((this enemy)) +(defmethod enemy-method-108 ((this enemy) (arg0 process-focusable)) #f ) @@ -1432,11 +1432,7 @@ (cond ((< f30-0 (-> this enemy-info proximity-notice-distance)) (set! s3-1 #t) - (let* ((a0-3 this) - (t9-2 (method-of-object a0-3 enemy-method-107)) - ) - (set! s2-0 (t9-2 a0-3)) - ) + (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) ) (else (let ((f0-1 (the-as float (-> this enemy-info notice-distance)))) @@ -1444,11 +1440,7 @@ (set! f0-1 (+ (the-as meters f0-1) (-> this enemy-info notice-distance-delta))) ) (when (or (< f30-0 f0-1) (not (logtest? (-> this enemy-flags) (enemy-flag use-notice-distance)))) - (let* ((a0-7 this) - (t9-3 (method-of-object a0-7 enemy-method-107)) - ) - (set! s2-0 (t9-3 a0-7)) - ) + (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) ) @@ -1459,7 +1451,7 @@ (let ((aware (cond (s3-1 (cond - ((enemy-method-108 this) + ((enemy-method-108 this arg0) (the-as enemy-aware (enemy-aware ea4)) ) (s2-0 @@ -2316,7 +2308,8 @@ (none) ) -(defmethod enemy-method-91 ((this enemy)) +;; WARN: Return type mismatch symbol vs object. +(defmethod enemy-method-91 ((this enemy) (arg0 enemy-jump-info)) #f ) @@ -2366,7 +2359,7 @@ (set! (-> this root transv y) 0.0) ) -(defmethod enemy-method-101 ((this enemy)) +(defmethod enemy-method-101 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) 0 (none) ) diff --git a/goal_src/jak3/engine/ai/traffic-h.gc b/goal_src/jak3/engine/ai/traffic-h.gc index 52c5e72524..3874d09f90 100644 --- a/goal_src/jak3/engine/ai/traffic-h.gc +++ b/goal_src/jak3/engine/ai/traffic-h.gc @@ -55,6 +55,40 @@ (define-extern traffic-kill (function none)) (define-extern ctywide-entity-hack (function none)) +;; +++vehicle-type +(defenum vehicle-type + :type int32 + (h-bike-a 0) + (h-bike-b 1) + (h-bike-c 2) + (h-car-a 3) + (h-car-b 4) + (h-car-c 5) + (h-bike-d 6) + (h-hellcat 7) + (h-warf 8) + (h-glider 9) + (h-sled 10) + (h-kg-pickup 11) + (v-turtle 12) + (v-snake 13) + (v-scorpion 14) + (v-toad 15) + (v-fox 16) + (v-rhino 17) + (v-mirage 18) + (v-x-ride 19) + (v-marauder 20) + (v-faccar 21) + (v-catapult 22) + (v-marauder-b 23) + (test-car 25) + (wbike-test 26) + (evan-test-bike 29) + ) +;; ---vehicle-type + + ;; DECOMP BEGINS (define *traffic-manager* (the-as traffic-manager #f)) @@ -117,7 +151,7 @@ (vehicle-level basic) (race-vehicle-level basic) (traffic-object-levels level 29) - (vehicle-levels level 44) + (vehicle-levels symbol 44) (traffic-object-type-from-vehicle-type traffic-type 44) (restore-speech-callback basic) ) diff --git a/goal_src/jak3/engine/anim/fma-sphere.gc b/goal_src/jak3/engine/anim/fma-sphere.gc index 2032d5a1a1..833f55e2ae 100644 --- a/goal_src/jak3/engine/anim/fma-sphere.gc +++ b/goal_src/jak3/engine/anim/fma-sphere.gc @@ -253,10 +253,7 @@ ) (cond (a0-33 - (let ((t9-10 (method-of-object a0-33 nav-mesh-method-31))) - self - (t9-10) - ) + (add-process-drawable-to-nav-mesh a0-33 self #f) ) (else (format 0 "ERROR: fma-sphere-init-by-other: failed to find nearest nav-mesh!~%") diff --git a/goal_src/jak3/engine/camera/cam-layout.gc b/goal_src/jak3/engine/camera/cam-layout.gc index 512df3ae85..ea3c6235ae 100644 --- a/goal_src/jak3/engine/camera/cam-layout.gc +++ b/goal_src/jak3/engine/camera/cam-layout.gc @@ -2279,21 +2279,13 @@ ) (defbehavior clmf-cam-string cam-layout ((arg0 string) (arg1 symbol)) - (local-vars (r0-0 uint128) (v1-5 uint128) (sv-16 int)) + (local-vars (sv-16 res-tag)) (format arg0 ":") - (set! sv-16 0) - (let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (set! sv-16 (new 'static 'res-tag)) + (let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (& sv-16)))) (when s5-1 - (let ((s4-0 0)) - (while (begin - (let ((v1-4 (the-as uint128 sv-16))) - (.pcpyud v1-5 v1-4 r0-0) - ) - (< s4-0 (shr (* (the-as int v1-5) 2) 49)) - ) - (format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4))))) - (+! s4-0 1) - ) + (dotimes (s4-0 (the-as int (-> sv-16 elt-count))) + (format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4))))) ) ) ) diff --git a/goal_src/jak3/engine/collide/collide-shape-h.gc b/goal_src/jak3/engine/collide/collide-shape-h.gc index b48d52a485..80f512e442 100644 --- a/goal_src/jak3/engine/collide/collide-shape-h.gc +++ b/goal_src/jak3/engine/collide/collide-shape-h.gc @@ -78,6 +78,24 @@ ;; ---collide-status +(defmacro normalized-heading-to-quaternion! (quat heading) + "Modified for PC. This does a clever trick, but it doesn't work if the heading is exactly + [0, 0, -1] because this tries to normalize a quaternion that's all 0's. + I think that, on PS2, something prevents the heading from being exactly 0, 0, -1, + but this doesn't happen on PC. A similar thing happened with Jak 1's punch glitch, + where some trig functions were slightly off from returning exactly 0.0 and 1.0 on PS2 + rounding only." + `(begin + (if (and (= (-> ,heading x) 0.0) + (= (+ 1.0 (-> ,heading z)) 0.0) + ) + (quaternion-set! ,quat 0.0 1.0 0.0 0.0) + (quaternion-set! ,quat 0.0 (-> ,heading x) 0.0 (+ 1.0 (-> ,heading z))) + ) + (quaternion-normalize! ,quat) + ) + ) + (declare-type collide-shape trsqv) (declare-type collide-shape-moving collide-shape) (declare-type control-info collide-shape-moving) @@ -134,6 +152,17 @@ ;; ---cshape-reaction-flags +;; +++nav-flags +(defenum nav-flags + :type uint8 + :bitfield #t + (has-root-sphere 0) + (has-extra-sphere 1) + (has-child-spheres 2) + ) +;; ---nav-flags + + ;; DECOMP BEGINS (deftype collide-rider (structure) @@ -299,7 +328,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ((actor-hash-index int16 :offset 12) (process process-drawable) (max-iteration-count uint8) - (nav-flags uint8) + (nav-flags nav-flags) (total-prims uint8) (num-riders uint8) (pat-ignore-mask pat-surface) @@ -455,7 +484,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (set! (-> s5-0 actor-hash-index) -1) (set! (-> s5-0 process) arg0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> s5-0 nav-flags) (the-as uint 1)) + (set! (-> s5-0 nav-flags) (nav-flags has-root-sphere)) (set! (-> s5-0 event-self) #f) (set! (-> s5-0 event-other) #f) (set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f)) diff --git a/goal_src/jak3/engine/common-obs/basebutton.gc b/goal_src/jak3/engine/common-obs/basebutton.gc index 09502edc7a..4306b57045 100644 --- a/goal_src/jak3/engine/common-obs/basebutton.gc +++ b/goal_src/jak3/engine/common-obs/basebutton.gc @@ -5,5 +5,447 @@ ;; name in dgo: basebutton ;; dgos: MIA +;; +++button-status +(defenum button-status + :type uint16 + :bitfield #t + (pressed) + (button-status-1) + (button-status-2) + (button-status-3) + (button-status-4) + ) +;; ---button-status + + ;; DECOMP BEGINS +(deftype basebutton (process-focusable) + ((button-status button-status) + (notify-actor entity) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (timeout float) + (button-id int32) + (event-going-down symbol) + (event-down symbol) + (event-going-up symbol) + (event-up symbol) + (anim-speed float) + (move-to-pos vector :inline) + (move-to-quat quaternion :inline) + ) + (:state-methods + down-idle + going-down + going-up + up-idle + ) + (:methods + (init! (_type_) none) + (idle-state-transition (_type_) object) + (init-skel-and-ja! (_type_) none) + (init-collision! (_type_) none) + (prepare-trigger-event! (_type_) none) + (send-event! (_type_ symbol) none) + (move-to! (_type_ vector quaternion) none) + (press! (_type_ symbol) entity-perm-status) + ) + ) + + +(defskelgroup skel-generic-button mtn-dice-button 0 3 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 3)) + +(defmethod move-to! ((this basebutton) (arg0 vector) (arg1 quaternion)) + (logclear! (-> this button-status) (button-status button-status-2)) + (if arg0 + (set! (-> this move-to-pos quad) (-> arg0 quad)) + (set! (-> this move-to-pos quad) (-> this root trans quad)) + ) + (if arg1 + (quaternion-copy! (-> this move-to-quat) arg1) + (quaternion-copy! (-> this move-to-quat) (-> this root quat)) + ) + 0 + (none) + ) + +(defmethod idle-state-transition ((this basebutton)) + (if (logtest? (-> this button-status) (button-status pressed)) + (go (method-of-object this down-idle)) + (go (method-of-object this up-idle)) + ) + ) + +(defstate up-idle (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (the-as attack-info (-> block param 1)))) + (case (-> v1-1 mode) + (('flop 'spin 'punch 'eco-yellow 'eco-red 'eco-blue 'eco-dark) + (when (or (not (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'punch))) + (logtest? (-> self button-status) (button-status button-status-3)) + ) + (send-event! self (-> self event-going-down)) + (go-virtual going-down) + ) + ) + ) + ) + ) + (('trigger) + (sound-play "silo-button") + (go-virtual going-down) + ) + (('touch) + (when (logtest? (-> self button-status) (button-status button-status-4)) + (send-event! self (-> self event-going-down)) + (go-virtual going-down) + ) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + ) + ) + :enter (behavior () + (press! self #f) + ) + :trans (behavior () + (if (logtest? (-> self button-status) (button-status button-status-2)) + (rider-trans) + ) + ) + :code sleep-code + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + (rider-post) + ) + ) + ) + +(defstate going-down (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + ) + ) + :enter (behavior () + (press! self #t) + ) + :trans rider-trans + :code (behavior () + (ja-no-eval :num! (seek! max (-> self anim-speed))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))) + ) + (send-event! self (-> self event-down)) + (let ((gp-0 (res-lump-struct (-> self entity) 'on-activate structure))) + (if gp-0 + (script-eval (the-as pair gp-0)) + ) + ) + (go-virtual down-idle) + ) + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + ) + (rider-post) + ) + ) + +(defstate down-idle (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + ) + ) + :enter (behavior () + (press! self #t) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (logtest? (-> self button-status) (button-status button-status-2)) + (rider-trans) + ) + ) + :code (behavior () + (cond + ((= (-> self timeout) 0.0) + (sleep-code) + ) + (else + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) + (suspend) + ) + (send-event! self (-> self event-going-up)) + (sound-play "silo-button") + (go-virtual going-up) + ) + ) + ) + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + (rider-post) + ) + ) + ) + +(defstate going-up (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + (('trigger) + (go-virtual going-down) + ) + ) + ) + :enter (behavior () + (press! self #f) + ) + :trans rider-trans + :code (behavior () + (ja-no-eval :num! (seek! 0.0 (-> self anim-speed))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0 (-> self anim-speed))) + ) + (send-event! self (-> self event-up)) + (go-virtual up-idle) + ) + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + ) + (rider-post) + ) + ) + +(defmethod press! ((this basebutton) (arg0 symbol)) + (if arg0 + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) + ) + (when (not (logtest? (-> this button-status) (button-status button-status-1))) + (if arg0 + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #f) + ) + ) + ) + +(defmethod send-event! ((this basebutton) (arg0 symbol)) + (with-pp + (when 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) arg0) + (let ((t9-0 send-event-function) + (v1-2 (-> this notify-actor)) + ) + (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-1 + ) + ) + ) + (dotimes (s4-0 (-> this actor-group-count)) + (let ((s3-0 (-> this actor-group s4-0))) + (dotimes (s2-0 (-> s3-0 length)) + (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) arg0) + (let ((t9-1 send-event-function) + (v1-10 (-> s3-0 data s2-0 actor)) + ) + (t9-1 + (if v1-10 + (-> v1-10 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod init! ((this basebutton)) + (set! (-> this button-status) (button-status)) + (set! (-> this notify-actor) #f) + (set! (-> this timeout) 0.0) + (set! (-> this event-going-down) #f) + (set! (-> this event-down) #f) + (set! (-> this event-going-up) #f) + (set! (-> this event-up) #f) + (set! (-> this anim-speed) 1.0) + 0 + (none) + ) + +(defmethod prepare-trigger-event! ((this basebutton)) + (set! (-> this event-going-down) 'trigger) + 0 + (none) + ) + +(defmethod init-skel-and-ja! ((this basebutton)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-button" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (set! (-> this anim-speed) 2.0) + (transform-post) + (none) + ) + +(defmethod init-collision! ((this basebutton)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (init! this) + (set! (-> this button-id) -1) + (let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (if (>= (the-as int v1-4) 0) + (set! (-> this button-id) (the-as int v1-4)) + ) + ) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-15 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-15 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-15)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (if (not (logtest? (-> this button-status) (button-status button-status-1))) + (nav-mesh-connect-from-ent this) + ) + (prepare-trigger-event! this) + (init-skel-and-ja! this) + (idle-state-transition this) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior basebutton-init-by-other basebutton ((arg0 entity-actor) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float)) + (init! self) + (logior! (-> self button-status) (button-status button-status-1)) + (set! (-> self button-id) -1) + (if arg4 + (logior! (-> self button-status) (button-status pressed)) + ) + (set! (-> self notify-actor) arg3) + (set! (-> self timeout) arg5) + (if arg0 + (process-entity-set! self arg0) + ) + (set! (-> self actor-group) (the-as (pointer actor-group) #f)) + (set! (-> self actor-group-count) 0) + (init-collision! self) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-copy! (-> self root quat) arg2) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (prepare-trigger-event! self) + (init-skel-and-ja! self) + (idle-state-transition self) + (none) + ) diff --git a/goal_src/jak3/engine/common-obs/elevator.gc b/goal_src/jak3/engine/common-obs/elevator.gc index f972bfc989..b459f49d83 100644 --- a/goal_src/jak3/engine/common-obs/elevator.gc +++ b/goal_src/jak3/engine/common-obs/elevator.gc @@ -642,7 +642,9 @@ (process-grab? *target* #f) ) (if (and (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) *target*) - (process-drawable-cloth-command *target* '(set-flags local-space-y)) + ;; og:preserve-this not-yet-implemented + ;; (process-drawable-cloth-command *target* '(set-flags local-space-y)) + 0 ) (if (>= (+ (current-time) (seconds -1)) (-> self sticky-player-last-ride-time)) (remove-setting! 'board) @@ -856,7 +858,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this elevator) (arg0 entity-actor)) (local-vars (sv-32 float) (sv-36 path-control) (sv-40 target)) - (stack-size-set! (-> this main-thread) 512) + (stack-size-set! (-> this main-thread) 1024) (set! (-> this sound-running-loop) #f) (set! (-> this sound-arrived) #f) (set! (-> this sound-start) #f) diff --git a/goal_src/jak3/engine/common-obs/enemy-part.gc b/goal_src/jak3/engine/common-obs/enemy-part.gc index 03584f162f..0640d49ea9 100644 --- a/goal_src/jak3/engine/common-obs/enemy-part.gc +++ b/goal_src/jak3/engine/common-obs/enemy-part.gc @@ -7,3 +7,381 @@ ;; DECOMP BEGINS +(defpartgroup group-kg-huge-explosion + :id 217 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (4.0 4.0 4.0) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpartgroup group-kg-big-explosion + :id 218 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpartgroup group-kg-explosion + :id 219 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.75 0.75 0.75) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpartgroup group-kg-mid-explosion + :id 220 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.5 0.5 0.5) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpartgroup group-kg-small-explosion + :id 221 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.3 0.3 0.3) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 884 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 890) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 890 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 889 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.085)) + (:next-launcher 891) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 888 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 891) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 891 + :init-specs ((:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 892) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 892 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 893) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 893 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 894) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 894 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125) (:rotate-y (degrees 0))) + ) + +(defpart 883 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:next-time (seconds 0.1)) + (:next-launcher 895) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 895 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 887 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 896) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 896 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 897) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 897 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043) (:rotate-y (degrees 0))) + ) + +(defpart 885 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 898) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 898 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 899) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 899 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 886 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/enemy-states.gc b/goal_src/jak3/engine/common-obs/enemy-states.gc index 661615130a..99aac73eeb 100644 --- a/goal_src/jak3/engine/common-obs/enemy-states.gc +++ b/goal_src/jak3/engine/common-obs/enemy-states.gc @@ -65,7 +65,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type enemy idle) enter)) - (set! (-> self root nav-flags) (the-as uint 0)) + (set! (-> self root nav-flags) (nav-flags)) (let ((v1-4 (-> self root root-prim))) (set! (-> v1-4 prim-core collide-as) (collide-spec)) (set! (-> v1-4 prim-core collide-with) (collide-spec)) @@ -86,7 +86,7 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self enemy-flags) (enemy-flag directed-ready)) - (logior! (-> self root nav-flags) 1) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) ) :code sleep-code ) @@ -127,7 +127,7 @@ 0 (logior! (-> self draw status) (draw-control-status no-draw)) (logior! (-> self enemy-flags) (enemy-flag directed-ready)) - (logand! (-> self root nav-flags) -2) + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) ) :exit (behavior () ((-> (method-of-type enemy dormant) exit)) @@ -427,7 +427,7 @@ (init-jump-info! self gp-0) (if (and (-> self enemy-info use-jump-blocked) (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) - (enemy-method-91 self) + (enemy-method-91 self gp-0) ) (go-virtual jump-blocked) ) @@ -437,7 +437,7 @@ (goto cfg-12) ) (in-jump-handler self s5-0 gp-0) - (enemy-method-101 self) + (enemy-method-101 self s5-0 gp-0) (suspend) (set! s5-0 1) ) @@ -452,7 +452,7 @@ (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) (jump-anim-handler self s5-1 gp-0) (in-jump-handler self s5-1 gp-0) - (enemy-method-101 self) + (enemy-method-101 self s5-1 gp-0) (suspend) (set! s5-1 3) ) @@ -465,7 +465,7 @@ (goto cfg-19) ) (in-jump-handler self s5-2 gp-0) - (enemy-method-101 self) + (enemy-method-101 self s5-2 gp-0) (suspend) (set! s5-2 5) ) @@ -760,7 +760,7 @@ ) (else (when (and (-> self skel effect) (logtest? (enemy-flag auto-death-phase-out) (-> self enemy-flags))) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) (suspend) 0 ) @@ -842,7 +842,7 @@ ((handle->process (-> self ragdoll-proc)) (ja-channel-push! 1 0) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek!) :frame-num 0.0) - (ragdoll-method-25 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -985,7 +985,7 @@ ) ) (if (-> self skel effect) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) ) (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 0.8)) @@ -1079,7 +1079,7 @@ ) ) (if (-> self skel effect) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) ) (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 1)) diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index bda70a166b..1088735bfa 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -170,9 +170,9 @@ ;; (effect-control-method-9 a0-22) ;; ) ;; ) - ;; (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) - ;; (merc-blend-shape self) - ;; ) + (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape self) + ) (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) (merc-eye-anim self) ) @@ -864,7 +864,7 @@ ) (('do-effect) (if (and (nonzero? (-> self skel)) (-> self skel effect)) - (do-effect (-> self skel effect) (the-as symbol (-> block param 0)) (the-as float (-> block param 1)) -1) + (do-effect (-> self skel effect) (the-as string (-> block param 0)) (the-as float (-> block param 1)) -1) ) ) (('no-actor-pause) diff --git a/goal_src/jak3/engine/common-obs/projectile.gc b/goal_src/jak3/engine/common-obs/projectile.gc index 79ca2692f3..0eea689ffd 100644 --- a/goal_src/jak3/engine/common-obs/projectile.gc +++ b/goal_src/jak3/engine/common-obs/projectile.gc @@ -477,7 +477,8 @@ ) (logior! (-> self options) (projectile-options po4)) (setup-collision! self) - (let ((s5-0 (-> self root))) + (let ((s5-0 (-> self root)) + (parent (-> self parent 0))) (when (type? s5-0 collide-shape-moving) (set! (-> self root dynam gravity y) 1228800.0) (set! (-> self root dynam gravity-length) 1228800.0) @@ -487,7 +488,16 @@ (logclear! (-> self mask) (process-mask enemy)) (set! (-> s5-0 trans quad) (-> arg0 pos quad)) (set! (-> self starting-pos quad) (-> arg0 pos quad)) - (quaternion-copy! (-> s5-0 quat) (-> self parent 0 root quat)) + ;; og:preserve-this + ;; some projectiles have their parent set as *rigid-body-queue-manager*, + ;; which is not a process-drawable, so we use its own parent + ;; (usually the vehicle firing the projectile) to set the quat instead. + ;; on original hardware, this would not crash because misaligned qw loads silently mask the lower bits + ;; of the address, loading a junk value instead. + (if (= parent *rigid-body-queue-manager*) + (quaternion-copy! (-> s5-0 quat) (-> (the process-drawable (-> parent parent 0)) root quat)) + (quaternion-copy! (-> s5-0 quat) (-> self parent 0 root quat)) + ) (vector-identity! (-> s5-0 scale)) (set! (-> s5-0 transv quad) (-> arg0 vel quad)) (set! (-> self pre-move-transv quad) (-> arg0 vel quad)) diff --git a/goal_src/jak3/engine/common-obs/water-flow.gc b/goal_src/jak3/engine/common-obs/water-flow.gc index f4bdadb588..f4a813745b 100644 --- a/goal_src/jak3/engine/common-obs/water-flow.gc +++ b/goal_src/jak3/engine/common-obs/water-flow.gc @@ -513,7 +513,7 @@ ) (defmethod new flow-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 res-lump)) - (local-vars (r0-0 uint128) (v1-16 uint128) (sv-16 int)) + (local-vars (sv-16 res-tag)) (if (not arg1) (set! arg1 (-> arg0 entity)) ) @@ -529,15 +529,9 @@ ) (set! (-> gp-0 speed) (res-lump-float arg1 'speed :default 12288.0)) (set! (-> gp-0 belt-radius) (res-lump-float arg1 'extra-radius :default 16384.0)) - (set! sv-16 0) - (let* ((a1-6 (res-lump-data arg1 'scale-factor pointer :tag-ptr (the-as (pointer res-tag) (& sv-16)))) - (a0-8 gp-0) - (t9-6 (method-of-object a0-8 setup)) - ) - (let ((v1-15 (the-as uint128 sv-16))) - (.pcpyud v1-16 v1-15 r0-0) - ) - (t9-6 a0-8 (the-as (pointer float) a1-6) (shr (* (the-as int v1-16) 2) 49)) + (set! sv-16 (new 'static 'res-tag)) + (let ((a1-6 (res-lump-data arg1 'scale-factor pointer :tag-ptr (& sv-16)))) + (setup gp-0 (the-as (pointer float) a1-6) (the-as int (-> sv-16 elt-count))) ) ) (else diff --git a/goal_src/jak3/engine/data/art-h.gc b/goal_src/jak3/engine/data/art-h.gc index 01c933fa79..43dc70a879 100644 --- a/goal_src/jak3/engine/data/art-h.gc +++ b/goal_src/jak3/engine/data/art-h.gc @@ -322,6 +322,7 @@ This stores settings like the name of the art-group, shadow/level-of-detail sett ((lod lod-group 6 :inline) (max-lod int8) ) + :allow-misaligned (:methods (setup-lods! (_type_ skeleton-group art-group entity) _type_) ) diff --git a/goal_src/jak3/engine/debug/default-menu.gc b/goal_src/jak3/engine/debug/default-menu.gc index 2b1b38164a..4633e0a486 100644 --- a/goal_src/jak3/engine/debug/default-menu.gc +++ b/goal_src/jak3/engine/debug/default-menu.gc @@ -2814,19 +2814,10 @@ (defun dm-task-menu-pick-func ((arg0 game-task) (arg1 debug-menu-msg)) (let ((gp-0 (/ (the-as int arg0) 8))) (when (= arg1 (debug-menu-msg press)) - (cond - ((cpad-hold? 0 l1) - (task-node-open! (the-as game-task-node gp-0) 'menu) - ) - (else - (let ((t9-1 task-node-close!) - (a0-2 gp-0) - ) - 'menu - (t9-1 (the-as game-task-node a0-2)) - ) + (if (cpad-hold? 0 l1) + (task-node-open! (the-as game-task-node gp-0) 'menu) + (task-node-close! (the-as game-task-node gp-0) 'menu) ) - ) ) (if (and (not (task-node-closed? (the-as game-task-node gp-0))) (not (task-node-open? (the-as game-task-node gp-0))) diff --git a/goal_src/jak3/engine/dma/dma-buffer.gc b/goal_src/jak3/engine/dma/dma-buffer.gc index 8786f2a2f6..c428cf4983 100644 --- a/goal_src/jak3/engine/dma/dma-buffer.gc +++ b/goal_src/jak3/engine/dma/dma-buffer.gc @@ -374,7 +374,8 @@ (base pointer) (end pointer) (real-buffer-end int32) - (data uint64 1 :offset 32) + (data-buffer uint8 :dynamic :overlay-at real-buffer-end) + (data uint64 1 :offset 32) ) (:methods (new (symbol type int) _type_) diff --git a/goal_src/jak3/engine/draw/drawable.gc b/goal_src/jak3/engine/draw/drawable.gc index 7c9fd47828..864aaa9e28 100644 --- a/goal_src/jak3/engine/draw/drawable.gc +++ b/goal_src/jak3/engine/draw/drawable.gc @@ -1434,7 +1434,7 @@ ;; (generic-merc-execute-all gp-0) ;; (shadow-execute-all gp-0) ) - ;; (lightning-draw-all) + (lightning-draw-all) (prim-engine-execute) (none) ) @@ -1589,10 +1589,10 @@ (actors-update *level*) ) - ; ;; do navigation math - ; (with-profiler 'nav *profile-nav-color* - ; (update-nav-meshes-method *level*) - ; ) + ;; do navigation math + (with-profiler 'nav *profile-nav-color* + (update-nav-meshes-method *level*) + ) ;; draw the background (with-profiler 'background *profile-background-color* diff --git a/goal_src/jak3/engine/entity/entity-table.gc b/goal_src/jak3/engine/entity/entity-table.gc index dae5720082..4d1561b692 100644 --- a/goal_src/jak3/engine/entity/entity-table.gc +++ b/goal_src/jak3/engine/entity/entity-table.gc @@ -40,12 +40,12 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref w-parking-spot :method-count 0) + :ptype (type-ref w-parking-spot :method-count 27) :pool '*16k-dead-pool* :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref min-elevator :method-count 0) + :ptype (type-ref min-elevator :method-count 52) :pool '*16k-dead-pool* :heap-size #x4000 ) @@ -270,7 +270,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref fruit-stand :method-count 0) + :ptype (type-ref fruit-stand :method-count 31) :pool '*16k-dead-pool* :heap-size #x4000 ) diff --git a/goal_src/jak3/engine/entity/entity.gc b/goal_src/jak3/engine/entity/entity.gc index b8e475b471..b47196b0ba 100644 --- a/goal_src/jak3/engine/entity/entity.gc +++ b/goal_src/jak3/engine/entity/entity.gc @@ -245,7 +245,7 @@ (let ((s4-0 (-> v1-4 bsp nav-meshes))) (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) - ((method-of-object (-> s4-0 s3-0 nav-mesh) nav-mesh-method-28)) + (update-navigation (-> s4-0 s3-0 nav-mesh)) ) ) ) @@ -837,9 +837,6 @@ (defmethod level-group-method-24 ((this level-group)) (local-vars - (r0-0 uint128) - (a0-23 object) - (a1-10 uint128) (sv-16 (inline-array vector)) (sv-20 vector) (sv-24 vector) @@ -847,7 +844,7 @@ (sv-32 float) (sv-36 vector) (sv-40 entity) - (sv-48 int) + (sv-48 res-tag) ) (dotimes (s5-0 (-> this length)) (let ((v1-3 (-> this level s5-0))) @@ -881,23 +878,9 @@ ((string-prefix= "battle" (res-lump-struct sv-40 'name string)) (set! (-> sv-20 quad) (-> sv-36 quad)) (set! (-> sv-24 quad) (-> sv-36 quad)) - (set! sv-48 0) - (let ((v1-29 - (res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (the-as (pointer res-tag) (& sv-48))) - ) - ) - (when (and v1-29 (begin - (let ((a0-24 #t)) - (let ((a1-9 (the-as uint128 sv-48))) - (.pcpyud a1-10 a1-9 r0-0) - ) - (let ((a1-12 (the-as int (shr (* (the-as int a1-10) 2) 49)))) - (cmove-#f-zero a0-23 a1-12 a0-24) - ) - ) - a0-23 - ) - ) + (set! sv-48 (new 'static 'res-tag)) + (let ((v1-29 (res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (& sv-48)))) + (when (and v1-29 (nonzero? (-> sv-48 elt-count))) (let* ((s2-2 (-> v1-29 0)) (s1-1 (-> s2-2 length)) ) diff --git a/goal_src/jak3/engine/game/effect-control-h.gc b/goal_src/jak3/engine/game/effect-control-h.gc index 3662653794..5bb94bfb00 100644 --- a/goal_src/jak3/engine/game/effect-control-h.gc +++ b/goal_src/jak3/engine/game/effect-control-h.gc @@ -47,7 +47,7 @@ (:methods (new (symbol type process-drawable) _type_) (effect-control-method-9 (_type_) none) - (do-effect (_type_ symbol float int) none) + (do-effect (_type_ string float int) none) (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) (play-effect-sound (_type_ symbol float int basic sound-name) int) (set-channel-offset! (_type_ int) none) diff --git a/goal_src/jak3/engine/game/effect-control.gc b/goal_src/jak3/engine/game/effect-control.gc index b1c22be43f..39e4b07177 100644 --- a/goal_src/jak3/engine/game/effect-control.gc +++ b/goal_src/jak3/engine/game/effect-control.gc @@ -266,7 +266,7 @@ ) (t9-0 a0-1 - (the-as symbol (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset))))) + (the-as string (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset))))) f0-0 -1 ) @@ -281,21 +281,20 @@ ) ;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement. -(defmethod do-effect ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod do-effect ((this effect-control) (arg0 string) (arg1 float) (arg2 int)) (local-vars (sv-288 res-lump)) (let* ((v1-2 (rtype-of arg0)) - (s3-0 (the-as string (cond - ((= v1-2 symbol) - (symbol->string arg0) - ) - ((= v1-2 string) - arg0 - ) - (else - #f - ) - ) - ) + (s3-0 (cond + ((= v1-2 symbol) + (symbol->string (the-as symbol arg0)) + ) + ((= v1-2 string) + arg0 + ) + (else + (the-as string #f) + ) + ) ) ) (cond @@ -470,8 +469,8 @@ (s0-0 (-> (the-as death-info s3-1) sound)) ) (set! sv-288 (-> this res)) - (let ((t1-5 (string->sound-name (the-as string (-> (the-as death-info s3-1) sound))))) - (s1-0 s2-3 s0-0 arg1 arg2 sv-288 t1-5) + (let ((t1-5 (string->sound-name (-> (the-as death-info s3-1) sound)))) + (s1-0 s2-3 (the-as symbol s0-0) arg1 arg2 sv-288 t1-5) ) ) ) @@ -553,45 +552,44 @@ ((string= (the-as string sv-192) "effect-land-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-land-poof-unk" - "group-land-poof-ice" - "group-land-poof-qsd" - "group-land-poof-wtr" - "group-land-poof-tar" - "group-land-poof-san" - "group-land-poof-wod" - "group-land-poof-grs" - "group-land-poof-pmt" - "group-land-poof-snw" - "group-land-poof-dsn" - "group-land-poof-unk" - "group-land-poof-lav" - "group-land-poof-cwd" - "group-land-poof-grv" - "group-land-poof-drt" - "group-land-poof-mtl" - "group-land-poof-str" - "group-land-poof-pmt" - "group-land-poof-swm" - "group-land-poof-unk" - "group-land-poof-mtl" - "group-land-poof-neu" - "group-land-poof-stn" - "group-land-poof-cmt" - "group-land-poof-car" - "group-land-poof-gmt" - "group-land-poof-smt" - "group-land-poof-hwd" - "group-land-poof-sqi" - "group-land-poof-mhm" - "group-land-poof-for" - "group-land-poof-mhs" - "group-land-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-land-poof-unk" + "group-land-poof-ice" + "group-land-poof-qsd" + "group-land-poof-wtr" + "group-land-poof-tar" + "group-land-poof-san" + "group-land-poof-wod" + "group-land-poof-grs" + "group-land-poof-pmt" + "group-land-poof-snw" + "group-land-poof-dsn" + "group-land-poof-unk" + "group-land-poof-lav" + "group-land-poof-cwd" + "group-land-poof-grv" + "group-land-poof-drt" + "group-land-poof-mtl" + "group-land-poof-str" + "group-land-poof-pmt" + "group-land-poof-swm" + "group-land-poof-unk" + "group-land-poof-mtl" + "group-land-poof-neu" + "group-land-poof-stn" + "group-land-poof-cmt" + "group-land-poof-car" + "group-land-poof-gmt" + "group-land-poof-smt" + "group-land-poof-hwd" + "group-land-poof-sqi" + "group-land-poof-mhm" + "group-land-poof-for" + "group-land-poof-mhs" + "group-land-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -599,45 +597,44 @@ ((string= (the-as string sv-192) "effect-run-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-run-poof-unk" - "group-run-poof-ice" - "group-run-poof-qsd" - "group-run-poof-wtr" - "group-run-poof-tar" - "group-run-poof-san" - "group-run-poof-wod" - "group-run-poof-grs" - "group-run-poof-pmt" - "group-run-poof-snw" - "group-run-poof-dsn" - "group-run-poof-unk" - "group-run-poof-lav" - "group-run-poof-cwd" - "group-run-poof-grv" - "group-run-poof-drt" - "group-run-poof-mtl" - "group-run-poof-str" - "group-run-poof-pmt" - "group-run-poof-swm" - "group-run-poof-unk" - "group-run-poof-mtl" - "group-run-poof-neu" - "group-run-poof-stn" - "group-run-poof-cmt" - "group-run-poof-car" - "group-run-poof-gmt" - "group-run-poof-smt" - "group-run-poof-hwd" - "group-run-poof-sqi" - "group-run-poof-mhm" - "group-run-poof-for" - "group-run-poof-mhs" - "group-run-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-run-poof-unk" + "group-run-poof-ice" + "group-run-poof-qsd" + "group-run-poof-wtr" + "group-run-poof-tar" + "group-run-poof-san" + "group-run-poof-wod" + "group-run-poof-grs" + "group-run-poof-pmt" + "group-run-poof-snw" + "group-run-poof-dsn" + "group-run-poof-unk" + "group-run-poof-lav" + "group-run-poof-cwd" + "group-run-poof-grv" + "group-run-poof-drt" + "group-run-poof-mtl" + "group-run-poof-str" + "group-run-poof-pmt" + "group-run-poof-swm" + "group-run-poof-unk" + "group-run-poof-mtl" + "group-run-poof-neu" + "group-run-poof-stn" + "group-run-poof-cmt" + "group-run-poof-car" + "group-run-poof-gmt" + "group-run-poof-smt" + "group-run-poof-hwd" + "group-run-poof-sqi" + "group-run-poof-mhm" + "group-run-poof-for" + "group-run-poof-mhs" + "group-run-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -645,45 +642,44 @@ ((string= (the-as string sv-192) "effect-just-footprint") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-just-footprint-unk" - "group-just-footprint-ice" - "group-just-footprint-qsd" - "group-just-footprint-wtr" - "group-just-footprint-tar" - "group-just-footprint-san" - "group-just-footprint-wod" - "group-just-footprint-grs" - "group-just-footprint-pmt" - "group-just-footprint-snw" - "group-just-footprint-dsn" - "group-just-footprint-unk" - "group-just-footprint-lav" - "group-just-footprint-cwd" - "group-just-footprint-grv" - "group-just-footprint-drt" - "group-just-footprint-mtl" - "group-just-footprint-str" - "group-just-footprint-pmt" - "group-just-footprint-swm" - "group-just-footprint-unk" - "group-just-footprint-mtl" - "group-just-footprint-neu" - "group-just-footprint-stn" - "group-just-footprint-cmt" - "group-just-footprint-car" - "group-just-footprint-gmt" - "group-just-footprint-smt" - "group-just-footprint-hwd" - "group-just-footprint-sqi" - "group-just-footprint-mhm" - "group-just-footprint-for" - "group-just-footprint-mhs" - "group-just-footprint-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-just-footprint-unk" + "group-just-footprint-ice" + "group-just-footprint-qsd" + "group-just-footprint-wtr" + "group-just-footprint-tar" + "group-just-footprint-san" + "group-just-footprint-wod" + "group-just-footprint-grs" + "group-just-footprint-pmt" + "group-just-footprint-snw" + "group-just-footprint-dsn" + "group-just-footprint-unk" + "group-just-footprint-lav" + "group-just-footprint-cwd" + "group-just-footprint-grv" + "group-just-footprint-drt" + "group-just-footprint-mtl" + "group-just-footprint-str" + "group-just-footprint-pmt" + "group-just-footprint-swm" + "group-just-footprint-unk" + "group-just-footprint-mtl" + "group-just-footprint-neu" + "group-just-footprint-stn" + "group-just-footprint-cmt" + "group-just-footprint-car" + "group-just-footprint-gmt" + "group-just-footprint-smt" + "group-just-footprint-hwd" + "group-just-footprint-sqi" + "group-just-footprint-mhm" + "group-just-footprint-for" + "group-just-footprint-mhs" + "group-just-footprint-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -691,45 +687,44 @@ ((string= (the-as string sv-192) "effect-just-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-just-poof-unk" - "group-just-poof-ice" - "group-just-poof-qsd" - "group-just-poof-wtr" - "group-just-poof-tar" - "group-just-poof-san" - "group-just-poof-wod" - "group-just-poof-grs" - "group-just-poof-pmt" - "group-just-poof-snw" - "group-just-poof-dsn" - "group-just-poof-unk" - "group-just-poof-lav" - "group-just-poof-cwd" - "group-just-poof-grv" - "group-just-poof-drt" - "group-just-poof-mtl" - "group-just-poof-str" - "group-just-poof-pmt" - "group-just-poof-swm" - "group-just-poof-unk" - "group-just-poof-mtl" - "group-just-poof-neu" - "group-just-poof-stn" - "group-just-poof-cmt" - "group-just-poof-car" - "group-just-poof-gmt" - "group-just-poof-smt" - "group-just-poof-hwd" - "group-just-poof-sqi" - "group-just-poof-mhm" - "group-just-poof-for" - "group-just-poof-mhs" - "group-just-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-just-poof-unk" + "group-just-poof-ice" + "group-just-poof-qsd" + "group-just-poof-wtr" + "group-just-poof-tar" + "group-just-poof-san" + "group-just-poof-wod" + "group-just-poof-grs" + "group-just-poof-pmt" + "group-just-poof-snw" + "group-just-poof-dsn" + "group-just-poof-unk" + "group-just-poof-lav" + "group-just-poof-cwd" + "group-just-poof-grv" + "group-just-poof-drt" + "group-just-poof-mtl" + "group-just-poof-str" + "group-just-poof-pmt" + "group-just-poof-swm" + "group-just-poof-unk" + "group-just-poof-mtl" + "group-just-poof-neu" + "group-just-poof-stn" + "group-just-poof-cmt" + "group-just-poof-car" + "group-just-poof-gmt" + "group-just-poof-smt" + "group-just-poof-hwd" + "group-just-poof-sqi" + "group-just-poof-mhm" + "group-just-poof-for" + "group-just-poof-mhs" + "group-just-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -737,45 +732,44 @@ ((string= (the-as string sv-192) "effect-slide-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-slide-poof-unk" - "group-slide-poof-ice" - "group-slide-poof-qsd" - "group-slide-poof-wtr" - "group-slide-poof-tar" - "group-slide-poof-san" - "group-slide-poof-wod" - "group-slide-poof-grs" - "group-slide-poof-pmt" - "group-slide-poof-snw" - "group-slide-poof-dsn" - "group-slide-poof-unk" - "group-slide-poof-lav" - "group-slide-poof-cwd" - "group-slide-poof-grv" - "group-slide-poof-drt" - "group-slide-poof-mtl" - "group-slide-poof-str" - "group-slide-poof-pmt" - "group-slide-poof-swm" - "group-slide-poof-unk" - "group-slide-poof-mtl" - "group-slide-poof-neu" - "group-slide-poof-stn" - "group-slide-poof-cmt" - "group-slide-poof-car" - "group-slide-poof-gmt" - "group-slide-poof-smt" - "group-slide-poof-hwd" - "group-slide-poof-sqi" - "group-slide-poof-mhm" - "group-slide-poof-for" - "group-slide-poof-mhs" - "group-slide-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-slide-poof-unk" + "group-slide-poof-ice" + "group-slide-poof-qsd" + "group-slide-poof-wtr" + "group-slide-poof-tar" + "group-slide-poof-san" + "group-slide-poof-wod" + "group-slide-poof-grs" + "group-slide-poof-pmt" + "group-slide-poof-snw" + "group-slide-poof-dsn" + "group-slide-poof-unk" + "group-slide-poof-lav" + "group-slide-poof-cwd" + "group-slide-poof-grv" + "group-slide-poof-drt" + "group-slide-poof-mtl" + "group-slide-poof-str" + "group-slide-poof-pmt" + "group-slide-poof-swm" + "group-slide-poof-unk" + "group-slide-poof-mtl" + "group-slide-poof-neu" + "group-slide-poof-stn" + "group-slide-poof-cmt" + "group-slide-poof-car" + "group-slide-poof-gmt" + "group-slide-poof-smt" + "group-slide-poof-hwd" + "group-slide-poof-sqi" + "group-slide-poof-mhm" + "group-slide-poof-for" + "group-slide-poof-mhs" + "group-slide-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -1059,8 +1053,8 @@ (defbehavior target-land-effect target () (cond ((focus-test? self flut) - (do-effect (-> self skel effect) (the-as symbol "effect-land-poof") -1.0 -1) - (do-effect (-> self skel effect) (the-as symbol "effect-flut-land") -1.0 -1) + (do-effect (-> self skel effect) "effect-land-poof" -1.0 -1) + (do-effect (-> self skel effect) "effect-flut-land" -1.0 -1) ) ((focus-test? self pilot) (sound-play-by-name @@ -1074,11 +1068,11 @@ ) ) ((logtest? (water-flag touch-water) (-> self water flags)) - (do-effect (-> self skel effect) (the-as symbol "effect-land-water") -1.0 -1) + (do-effect (-> self skel effect) "effect-land-water" -1.0 -1) ) (else - (do-effect (-> self skel effect) (the-as symbol "effect-land-poof") -1.0 -1) - (do-effect (-> self skel effect) (the-as symbol "effect-land") -1.0 -1) + (do-effect (-> self skel effect) "effect-land-poof" -1.0 -1) + (do-effect (-> self skel effect) "effect-land" -1.0 -1) ) ) 0 diff --git a/goal_src/jak3/engine/game/game-info-h.gc b/goal_src/jak3/engine/game/game-info-h.gc index 78cfeeab33..a4dc47f0ca 100644 --- a/goal_src/jak3/engine/game/game-info-h.gc +++ b/goal_src/jak3/engine/game/game-info-h.gc @@ -13,14 +13,14 @@ (amulet0 0) (amulet1 1) (amulet2 2) - (pass-wascity 3) + (pass-front-gate 3) (seal-of-mar 4) - (pass-factory 5) + (cypher-gliph 5) (artifact-holocube 6) - (artifact-quantum-reflector 7) - (artifact-prism 8) - (artifact-beam-generator 9) - (artifact-time-map 10) + (artifact-av-reflector 7) + (artifact-av-prism 8) + (artifact-av-generator 9) + (artifact-av-map 10) (light-eco-crystal0 11) (light-eco-crystal1 12) (light-eco-crystal2 13) @@ -352,7 +352,7 @@ (play-list (array game-task-info)) (sub-task-list (array game-task-node-info)) (mission-list (array game-task-node-info)) - (task-node-commands (array uint8)) + (task-node-commands (array game-task-node-command)) (task-node-exclusive (array uint16)) (task-counter uint32) (unknown-arr4 (array uint16)) diff --git a/goal_src/jak3/engine/game/game-info.gc b/goal_src/jak3/engine/game/game-info.gc index 4084f20c23..631831f98c 100644 --- a/goal_src/jak3/engine/game/game-info.gc +++ b/goal_src/jak3/engine/game/game-info.gc @@ -2150,7 +2150,7 @@ board sidekick board-launch - feature39 + board-zap darkjak darkjak-smack darkjak-bomb0 @@ -2163,7 +2163,7 @@ lightjak-freeze lightjak-shield artifact-invis - feature56 + jakc lighteco darkeco ) diff --git a/goal_src/jak3/engine/game/penetrate-h.gc b/goal_src/jak3/engine/game/penetrate-h.gc index 459e14cc50..9d05497f7d 100644 --- a/goal_src/jak3/engine/game/penetrate-h.gc +++ b/goal_src/jak3/engine/game/penetrate-h.gc @@ -62,6 +62,32 @@ (jak-dark-nuke 35) (jak-dark-blackhole 36) (emp-blast 37) + (penetrate38 38) + (penetrate39 39) + (penetrate40 40) + (penetrate41 41) + (penetrate42 42) + (penetrate43 43) + (penetrate44 44) + (penetrate45 45) + (penetrate46 46) + (penetrate47 47) + (penetrate48 48) + (penetrate49 49) + (penetrate50 50) + (penetrate51 51) + (penetrate52 52) + (penetrate53 53) + (penetrate54 54) + (penetrate55 55) + (penetrate56 56) + (penetrate57 57) + (penetrate58 58) + (penetrate59 59) + (penetrate60 60) + (penetrate61 61) + (penetrate64 62) + (penetrate63 63) ) ;; ---penetrate diff --git a/goal_src/jak3/engine/game/settings-h.gc b/goal_src/jak3/engine/game/settings-h.gc index 54dc162d69..1e500bc5e4 100644 --- a/goal_src/jak3/engine/game/settings-h.gc +++ b/goal_src/jak3/engine/game/settings-h.gc @@ -103,7 +103,7 @@ (feature36 36) (board-launch 37) (board-trail 38) - (feature39 39) + (board-zap 39) (darkjak 40) (darkjak-smack 41) (darkjak-bomb0 42) @@ -120,7 +120,7 @@ (armor1 53) (armor2 54) (armor3 55) - (feature56 56) + (jakc 56) (lighteco 57) (darkeco 58) (feature59 59) diff --git a/goal_src/jak3/engine/game/task/game-task.gc b/goal_src/jak3/engine/game/task/game-task.gc index cebc0b93f6..fc6d7784af 100644 --- a/goal_src/jak3/engine/game/task/game-task.gc +++ b/goal_src/jak3/engine/game/task/game-task.gc @@ -4208,10 +4208,11 @@ :user-count 3 ) :borrow '() - :open? (lambda () (or (not (task-node-closed? (game-task-node wascity-defend-get-to))) - (task-node-closed? (game-task-node wascity-defend-resolution)) - ) - ) + :open? (lambda () + (or (not (task-node-closed? (game-task-node wascity-defend-get-to))) + (task-node-closed? (game-task-node wascity-defend-resolution)) + ) + ) :on-close #f :reset (new 'static 'task-reset-info :restart-info #f @@ -23355,83 +23356,85 @@ ) ) (set! (-> game-info mission-list) (new 'global 'boxed-array game-task-node-info 410)) - (set! (-> game-info task-node-commands) (new 'static 'boxed-array :type uint8 - #x48 - #x20 - #x1f - #x1 - #x5 - #x23 - #x22 - #x19 - #x36 - #xa - #x3a - #x41 - #x48 - #x32 - #x39 - #x3f - #x3a - #x8 - #x6 - #x37 - #xd - #xb - #x3e - #x3a - #x39 - #xf - #x40 - #x31 - #x28 - #x27 - #x26 - #x2f - #x2d - #x3 - #x3b - #x29 - #x2a - #x33 - #x12 - #x10 - #x1b - #xe - #xc - #x21 - #x1a - #x2e - #x34 - #x30 - #x13 - #x11 - #x1c - #x9 - #x7 - #x14 - #x1d - #x3c - #x43 - #x39 - #x44 - #x46 - #x45 - #x39 - #x17 - #x15 - #x2b - #x47 - #x38 - #x35 - #x18 - #x16 - #x3a - #x1e - #x42 - #x4 - #x3 - ) + (set! (-> game-info task-node-commands) + (the-as (array game-task-node-command) (new 'static 'boxed-array :type uint8 + #x48 + #x20 + #x1f + #x1 + #x5 + #x23 + #x22 + #x19 + #x36 + #xa + #x3a + #x41 + #x48 + #x32 + #x39 + #x3f + #x3a + #x8 + #x6 + #x37 + #xd + #xb + #x3e + #x3a + #x39 + #xf + #x40 + #x31 + #x28 + #x27 + #x26 + #x2f + #x2d + #x3 + #x3b + #x29 + #x2a + #x33 + #x12 + #x10 + #x1b + #xe + #xc + #x21 + #x1a + #x2e + #x34 + #x30 + #x13 + #x11 + #x1c + #x9 + #x7 + #x14 + #x1d + #x3c + #x43 + #x39 + #x44 + #x46 + #x45 + #x39 + #x17 + #x15 + #x2b + #x47 + #x38 + #x35 + #x18 + #x16 + #x3a + #x1e + #x42 + #x4 + #x3 + ) + ) ) (dotimes (v1-4 (-> game-info sub-task-list length)) (if (-> game-info sub-task-list v1-4 manager) diff --git a/goal_src/jak3/engine/game/task/task-control-h.gc b/goal_src/jak3/engine/game/task/task-control-h.gc index a55b646db3..e76ef2824e 100644 --- a/goal_src/jak3/engine/game/task/task-control-h.gc +++ b/goal_src/jak3/engine/game/task/task-control-h.gc @@ -43,6 +43,19 @@ ) ;; ---task-manager-mask +(declare-type editable-player process) +(define-extern *editable* (pointer editable-player)) + +;; temporarily forward declared as symbols +(define-extern *cty-faction-manager* symbol) +(define-extern *cty-attack-controller* symbol) +(set! *cty-faction-manager* #f) +(set! *cty-attack-controller* #f) + +(define-extern cty-attack-reset (function symbol symbol symbol none)) +(define-extern setup-city-task-faction (function object)) +(define-extern cty-faction-evaluate-commands (function pair object)) + (define-extern update-task-masks (function symbol int)) (define-extern task-resolution-close! (function game-task symbol)) (define-extern task-node-closed? (function game-task-node symbol)) @@ -51,7 +64,7 @@ (define-extern game-task-node->string (function game-task-node string)) (define-extern task-close! (function string symbol)) (define-extern task-node-index-by-name (function string int)) -(define-extern task-node-close! (function game-task-node int)) +(define-extern task-node-close! (function game-task-node symbol int)) (define-extern task-node-open? (function game-task-node symbol)) (define-extern restart-mission (function int)) @@ -1430,11 +1443,11 @@ (faction-commands pair) ) (:methods - (game-task-node-info-method-9 () none) + (get-idx-in-task-list (_type_) int) (open! (_type_ symbol) int) (game-task-node-info-method-11 (_type_ symbol) none) (game-task-node-info-method-12 (_type_) symbol) - (game-task-node-info-method-13 () none) + (eval-game-task-cmd! (_type_) none) ) ) @@ -1486,25 +1499,27 @@ (hud-counter handle :overlay-at (-> hud 1)) (intro-time time-frame) ) + (:state-methods + wait + active + complete + resolution + (fail resetter-params) + (restart symbol) + ) (:methods - (task-manager-method-14 () none) - (task-manager-method-15 () none) - (task-manager-method-16 () none) - (task-manager-method-17 () none) - (task-manager-method-18 () none) - (task-manager-method-19 () none) - (task-manager-method-20 () none) - (task-manager-method-21 () none) - (task-manager-method-22 () none) - (task-manager-method-23 () none) - (task-manager-method-24 () none) - (task-manager-method-25 () none) - (task-manager-method-26 () none) - (task-manager-method-27 () none) - (task-manager-method-28 () none) - (task-manager-method-29 () none) - (task-manager-method-30 () none) - (task-manager-method-31 (_type_ symbol) resetter-spec) + (init! (_type_) none) + (set-time-limit (_type_) none) + (kill-all-children (_type_) none) + (hud-timer-handler (_type_) none) + (ready? (_type_) object) + (task-manager-method-25 (_type_) none) + (task-manager-method-26 (_type_) none) + (task-manager-method-27 (_type_) none) + (task-manager-method-28 (_type_) none) + (go-fail (_type_) object) + (taskman-event-handler (_type_ process int symbol event-message-block) object) + (on-fail (_type_ symbol) resetter-params) ) ) diff --git a/goal_src/jak3/engine/game/task/task-control.gc b/goal_src/jak3/engine/game/task/task-control.gc index 593d3743fb..4774d2e968 100644 --- a/goal_src/jak3/engine/game/task/task-control.gc +++ b/goal_src/jak3/engine/game/task/task-control.gc @@ -5,6 +5,1149 @@ ;; name in dgo: task-control ;; dgos: GAME +(define-extern task-node-close-upwards (function (array game-task-node-info) int none)) + +;; DECOMP BEGINS + +(deftype resetter-control (basic) + ((process handle) + (handle-init-hack symbol :overlay-at process) + ) + (:methods + (check-reset (_type_) object) + (get-resetter (_type_) process) + (spawn-resetter! (_type_ resetter-params game-task-node-info) symbol) + (do-reset (_type_) object) + ) + ) + + +(define *resetter-control* (new 'static 'resetter-control :handle-init-hack #f)) + +(defmethod print ((this resetter-spec)) + (format + #t + "#" + (-> this continue) + (-> this reset-mode) + (game-task-node->string (-> this node)) + (-> this execute) + this + ) + this + ) + +(defun game-task-node->string ((arg0 game-task-node)) + (-> *game-info* sub-task-list arg0 name) + ) + +(defmethod get-play-list-idx ((this game-task-info)) + (let ((v1-1 (-> *game-info* play-list))) + (countdown (a1-0 (-> v1-1 length)) + (if (= this (-> v1-1 a1-0)) + (return a1-0) + ) + ) + ) + 0 + ) + +(defmethod get-idx-in-task-list ((this game-task-node-info)) + (let ((v1-1 (-> *game-info* sub-task-list))) + (countdown (a1-0 (-> v1-1 length)) + (if (= this (-> v1-1 a1-0)) + (return a1-0) + ) + ) + ) + 0 + ) + +(defun reset-city-squad-control ((arg0 symbol)) + (if (and (nonzero? *cty-attack-controller*) *cty-attack-controller*) + (cty-attack-reset arg0 #f #f) + ) + (none) + ) + +(defun city-task-faction-commands () + (if (or (zero? *cty-faction-manager*) (not *cty-faction-manager*)) + (return 0) + ) + (setup-city-task-faction) + ) + +(defun evaluate-faction-commands ((arg0 pair)) + (if (or (zero? *cty-faction-manager*) (not *cty-faction-manager*) (zero? arg0)) + (return 0) + ) + (cty-faction-evaluate-commands arg0) + ) + +(defun update-task-masks ((arg0 symbol)) + (local-vars (a3-2 symbol) (sv-176 game-task-event)) + (if (= arg0 'none) + (return 0) + ) + (do-nothing *level*) + (cond + ((or (= arg0 'debug) (= arg0 'level)) + ) + ((logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! (-> *game-info* features) (game-feature + gun + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + board + gun-upgrade-yellow-ammo-1 + gun-upgrade-yellow-ammo-2 + gun-upgrade-red-ammo-1 + gun-upgrade-red-ammo-2 + gun-upgrade-blue-ammo-1 + gun-upgrade-blue-ammo-2 + gun-upgrade-dark-ammo-1 + gun-upgrade-dark-ammo-2 + board-launch + board-zap + darkjak + darkjak-bomb0 + darkjak-bomb1 + lightjak + lightjak-regen + lightjak-freeze + lightjak-shield + armor0 + armor1 + armor2 + armor3 + lighteco + darkeco + ) + ) + (set! (-> *game-info* items) (game-items)) + (set! (-> *game-info* vehicles) (game-vehicles v-turtle v-snake v-scorpion v-toad v-rhino)) + (set! (-> *game-info* light-crystal) 0.0) + (set! (-> *game-info* dark-crystal) 0.0) + ) + (else + (set! (-> *game-info* features) (game-feature)) + (set! (-> *game-info* items) (game-items)) + (set! (-> *game-info* vehicles) (game-vehicles)) + (set! (-> *game-info* light-crystal) 0.0) + (set! (-> *game-info* dark-crystal) 0.0) + ) + ) + ;; og:preserve-this not-yet-implemented check + (if (nonzero? *minimap*) + (let ((s5-0 (-> *minimap* engine alive-list))) + (while s5-0 + (let ((s4-0 s5-0)) + (if (and (logtest? (-> s4-0 flags) (minimap-flag task-graph)) + (or (not (game-task-node-info-method-12 (-> *game-info* sub-task-list (-> s4-0 node)))) + (not (minimap-class-node-method-9 (-> s4-0 class))) + ) + ) + (logior! (-> s4-0 flags) (minimap-flag fade-out)) + ) + ) + (set! s5-0 (-> s5-0 next)) + ) + ) + ) + (let ((v1-43 (-> *game-info* task-node-exclusive))) + (set! (-> v1-43 length) 0) + (let ((a0-10 (-> *game-info* sub-task-list))) + (dotimes (a1-0 (-> a0-10 length)) + (when (nonzero? a1-0) + (let ((a2-3 (-> a0-10 a1-0))) + (set! a3-2 + (and (logtest? (-> a2-3 flags) (game-task-node-flag exclusive)) + (not (logtest? (-> a2-3 flags) (game-task-node-flag closed))) + (begin + (dotimes (a3-5 4) + (let ((t1-0 (-> a2-3 parent-node a3-5))) + (when (and (nonzero? t1-0) (not (logtest? (-> a0-10 t1-0 flags) (game-task-node-flag closed)))) + (set! a3-2 #f) + (goto cfg-38) + ) + ) + ) + #t + ) + ) + ) + (label cfg-38) + (when a3-2 + (when (< (-> v1-43 length) (-> v1-43 allocated-length)) + (set! (-> v1-43 (-> v1-43 length)) (the-as uint (-> a2-3 task))) + (+! (-> v1-43 length) 1) + ) + ) + ) + ) + ) + ) + ) + (let ((s5-1 + (lambda ((arg0 pair)) + (let ((s4-0 (-> arg0 car))) + (while (not (null? (the-as object arg0))) + (let ((v1-0 (-> (the-as pair s4-0) car)) + (s5-0 (-> (the-as pair (-> (the-as pair s4-0) cdr)) car)) + ) + (-> (the-as pair (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) car) + (-> (the-as pair (-> (the-as pair (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) cdr)) car) + (let* ((s3-0 (-> (the-as symbol v1-0) value)) + (v1-1 (if (type? s3-0 level-load-info) + s3-0 + ) + ) + (a0-11 (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) + ) + (when (and v1-1 (-> (the-as level-load-info v1-1) borrow)) + (case s5-0 + (('alias) + (set! a0-11 (cond + ((-> (the-as pair a0-11) car) + (empty) + a0-11 + ) + (else + #f + ) + ) + ) + (set! (-> (the-as level-load-info v1-1) borrow alias) a0-11) + ) + (else + (set! (-> (the-as level-load-info v1-1) borrow borrow-info (/ (the-as int s5-0) 8)) a0-11) + ) + ) + ) + ) + ) + (set! arg0 (the-as pair (-> arg0 cdr))) + (set! s4-0 (-> arg0 car)) + ) + ) + #f + ) + ) + ) + (let ((s4-1 #f)) + (s5-1 (-> *game-info* sub-task-list (game-task-node city-start-start) borrow)) + (evaluate-faction-commands (-> *game-info* sub-task-list (game-task-node city-start-start) faction-commands)) + (let ((s3-0 (-> *game-info* sub-task-list))) + (dotimes (s2-0 (-> s3-0 length)) + (when (nonzero? s2-0) + (let ((s1-0 (-> s3-0 s2-0))) + (case arg0 + (('debug 'level) + ) + (else + (if (logtest? (-> s1-0 flags) (game-task-node-flag closed)) + (eval-game-task-cmd! s1-0) + ) + ) + ) + (when (game-task-node-info-method-12 s1-0) + (if (-> s1-0 on-open) + (script-eval (-> s1-0 on-open) :key s1-0) + ) + (when (-> s1-0 when-open) + (let ((s0-0 (-> s1-0 when-open length))) + (while (begin (label cfg-75) (nonzero? s0-0)) + (+! s0-0 -1) + (set! sv-176 (-> s1-0 when-open s0-0)) + (case (-> sv-176 actor) + (((game-task-actor minimap)) + ;; og:preserve-this not-yet-implemented check + (when (and (nonzero? *minimap*) (nonzero? *minimap-class-list*)) + (if (not (minimap-class-node-method-9 (-> *minimap-class-list* (-> sv-176 icon)))) + (goto cfg-75) + ) + (let ((v1-89 (add-icon! *minimap* *dproc* (-> sv-176 icon) (the-as int (-> sv-176 icon)) (the-as vector #f) s2-0))) + (when v1-89 + (logior! (-> v1-89 flags) (minimap-flag task-graph)) + (cond + ((and (logtest? (minimap-flag ctywide) (-> v1-89 class flags)) + (logtest? (minimap-flag transport) (-> v1-89 class flags)) + ) + (let ((v1-91 (add-icon! *minimap* *dproc* (the-as uint 21) 21 (the-as vector #f) s2-0))) + (if v1-91 + (logior! (-> v1-91 flags) (minimap-flag task-graph)) + ) + ) + ) + ((and (logtest? (minimap-flag wasall waswide desert) (-> v1-89 class flags)) + (logtest? (minimap-flag transport) (-> v1-89 class flags)) + ) + (let ((v1-96 (add-icon! *minimap* *dproc* (the-as uint 18) 18 (the-as vector #f) s2-0))) + (if v1-96 + (logior! (-> v1-96 flags) (minimap-flag task-graph)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (s5-1 (-> s1-0 borrow)) + (when (not (null? (-> s1-0 faction-commands))) + (set! s4-1 #t) + (evaluate-faction-commands (-> s1-0 faction-commands)) + ) + ) + ) + ) + ) + ) + (if (not s4-1) + (city-task-faction-commands) + ) + ) + (dotimes (s4-2 (the-as int (-> *setting-control* user-current faction-command-count))) + (evaluate-faction-commands (-> *setting-control* user-current faction-command s4-2)) + ) + (if (logtest? (game-secrets darkjak-tracking) (-> *game-info* secrets)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature44) (-> *game-info* features))) + ) + ) + (logior! (-> *game-info* features) (-> *game-info* debug-features)) + (logior! (-> *game-info* items) (-> *game-info* debug-items)) + (logior! (-> *game-info* vehicles) (-> *game-info* debug-vehicles)) + (dotimes (s4-3 (the-as int (-> *setting-control* user-current borrow-count))) + (s5-1 (-> *setting-control* user-current borrow s4-3)) + ) + ) + (case arg0 + (('load) + ) + (else + (let ((s5-2 (-> *game-info* sub-task-list))) + (dotimes (s4-4 (-> s5-2 length)) + (when (nonzero? s4-4) + (let ((s3-1 (-> s5-2 s4-4))) + (if (and (-> s3-1 manager) (or (and (logtest? (-> s3-1 flags) (game-task-node-flag closed)) + (not (task-node-closed? (-> s3-1 manager final-node))) + ) + (game-task-node-info-method-12 s3-1) + ) + ) + (script-eval '(task-manager) :key s3-1) + ) + ) + ) + ) + ) + ) + ) + (add-borrow-levels *load-state*) + (dotimes (s5-3 (-> *level* length)) + (let ((a0-75 (-> *level* level s5-3))) + (if (= (-> a0-75 status) 'active) + (set-proto-vis! a0-75 arg0) + ) + ) + ) + (if (logtest? (game-secrets vehicle-fox) (-> *game-info* secrets)) + (logior! (-> *game-info* vehicles) (game-vehicles v-fox)) + ) + (if (logtest? (game-secrets vehicle-mirage) (-> *game-info* secrets)) + (logior! (-> *game-info* vehicles) (game-vehicles v-mirage)) + ) + (if (logtest? (game-secrets vehicle-x-ride) (-> *game-info* secrets)) + (logior! (-> *game-info* vehicles) (game-vehicles v-x-ride)) + ) + (set! (-> *game-info* percent-complete) (calculate-percentage *game-info*)) + 0 + ) + +(defmethod set-proto-vis! ((this level) (arg0 symbol)) + (if (= arg0 'none) + (return 0) + ) + (set! (-> this task-mask) + (logior (logand (-> this info base-task-mask) (task-mask task0 task1 task2 task3 task4 task5 task6 task7 done)) + (logand (-> this task-mask) (task-mask primary0)) + ) + ) + (let ((v1-8 (-> this info taskname)) + (a0-4 (-> *game-info* sub-task-list)) + ) + (dotimes (a1-1 (-> a0-4 length)) + (when (nonzero? a1-1) + (let ((a2-3 (-> a0-4 a1-1))) + (when (and (logtest? (-> a2-3 flags) (game-task-node-flag closed)) (= (-> a2-3 level) v1-8)) + (cond + ((logtest? (-> a2-3 flags) (game-task-node-flag abs-task-mask)) + (set! (-> this task-mask) (-> a2-3 task-mask)) + ) + ((logtest? (-> a2-3 flags) (game-task-node-flag set-task-mask)) + (logior! (-> this task-mask) (-> a2-3 task-mask)) + ) + ((logtest? (-> a2-3 flags) (game-task-node-flag clear-task-mask)) + (logclear! (-> this task-mask) (-> a2-3 task-mask)) + ) + ) + ) + ) + ) + ) + ) + (case (-> this name) + (('foresta 'forestb) + (prototypes-game-visible-set! '("gun-base-cylinder.mb" "gun-base-tubes.mb") #f this) + (prototypes-game-visible-set! + '("destroyed-statue-base.mb" + "destroyed-statue-chunk-a.mb" + "destroyed-statue-chunk-b.mb" + "destroyed-statue-eyelid.mb" + "destroyed-statue-rubble-terrain.mb" + "fora-grounder-destroyed-statue-lil-rocks.mb" + "fora-shrub-destroyed-statue-pebbles.mb" + "neo-spawner-root-a.mb" + "neo-spawner-root-b.mb" + ) + (and (task-node-closed? (game-task-node wascity-defend-resolution)) + (not (task-node-closed? (game-task-node precursor-tour-resolution))) + ) + this + ) + (prototypes-game-visible-set! + '("green-eco-vent-a.mb") + (not (task-node-closed? (game-task-node forest-ring-chase-introduction))) + this + ) + ) + (('mhcityb 'mhcitya) + (prototypes-game-visible-set! + '("mhcity-de-tower-grind-strand-long-nocol01.mb" + "mhcity-ground-lower-wall-gapfiller-strand-nub-01.mb" + "mhcity-ground-lower-wall-veins-small-02.mb" + "mhcity-wall-vine-thin-c-destrand-01.mb" + "mhcity-wall-vine-thin-s-destrand-01.mb" + ) + (not (task-node-closed? (game-task-node city-destroy-darkeco-resolution))) + this + ) + ) + (('factoryb) + (prototypes-game-visible-set! + '("facb-gun-tower-base-01.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower1))) + this + ) + (prototypes-game-visible-set! + '("facb-gun-tower-base-02.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower2))) + this + ) + (prototypes-game-visible-set! + '("facb-gun-tower-base-03.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower3))) + this + ) + (prototypes-game-visible-set! + '("facb-gun-tower-base-04.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower4))) + this + ) + ) + (('precurd) + (prototypes-game-visible-set! + '("precur-road-bridge01.mb" + "precur-road-bridge02.mb" + "precur-road-bridge03.mb" + "precur-road-bridge04.mb" + "precur-road-bridge05.mb" + ) + (not (task-node-closed? (game-task-node precursor-destroy-ship-escape-continue))) + this + ) + ) + (('desertg) + (prototypes-game-visible-set! '("des-egg.mb") (not (task-node-closed? (game-task-node nest-eggs-wall))) this) + ) + (('wasstada) + (prototypes-game-visible-set! + '("wstd-table.mb") + (task-node-closed? (game-task-node arena-fight-1-introduction)) + this + ) + ) + (('desertg) + (prototypes-game-visible-set! '("des-egg.mb") (not (task-node-closed? (game-task-node nest-eggs-wall))) this) + ) + (('templea 'templed) + (prototypes-game-visible-set! + '("tpl-hide-debris-blocka.mb" + "tpl-hide-debris-blockb.mb" + "tpl-hide-debris-plank-8m.mb" + "tpl-hide-debris-rock1.mb" + "tpl-hide-sunken-brick-01.mb" + "tpl-hide-collision-01.mb" + ) + (task-node-closed? (game-task-node temple-defend-introduction)) + this + ) + (prototypes-game-visible-set! + '("tpl-hall-alter-tunnel-section-jnt-hide.mb" "tpl-hall-alter-tunnel-section-hide.mb") + (not (task-node-closed? (game-task-node temple-tests-resolution))) + this + ) + ) + (('ctywide) + (prototypes-game-visible-set! + '("palcab-lowres-mhcity-tower-shell.mb" + "palcab-lowres-mhcity-tower-shelleye-01.mb" + "palcab-lowres-mhcity-tower-cap.mb" + "palcab-lowres-mhcity-tower-capdoor-01.mb" + ) + (not (task-node-closed? (game-task-node tower-destroy-resolution))) + this + ) + (prototypes-game-visible-set! + '("palcab-lowres-mhcity-tower-shell-blasted-01.mb" "palcab-lowres-mhcity-tower-shell-blasted-02.mb") + (task-node-closed? (game-task-node tower-destroy-resolution)) + this + ) + ) + (('ctygenb) + (prototypes-game-visible-set! + '("city-cable-grindable-turnoff-01.mb" + "city-cable-grindable-collision-01.mb" + "city-cable-grindable-collision.mb" + ) + (task-node-closed? (game-task-node tower-destroy-resolution)) + this + ) + ) + (('atoll) + ) + (('ctymarkb) + ) + (('ctypal) + ) + (('ctyasha) + ) + (('stadiumb) + ) + (('hiphog) + ) + ) + (logior! (-> this task-mask) (-> *setting-control* user-current task-mask)) + 0 + ) + +(defun play-clean ((arg0 symbol)) + (set! *display-entity-errors* #f) + (set! *display-profile* #f) + (set! *display-actor-marks* #f) + (set! (-> *level* play?) #t) + (time-of-day-setup #t) + (set! *time-of-day-fast* #f) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (let ((t9-2 reset-city-squad-control) + (a0-5 #f) + ) + (t9-2 a0-5) + ) + (when arg0 + (let ((s5-0 (-> *game-info* mode))) + (set! (-> *game-info* mode) arg0) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + (set! (-> *game-info* mode) s5-0) + ) + ) + 0 + ) + +;; WARN: Return type mismatch object vs string. +(defun play-task ((arg0 game-task) (arg1 symbol) (arg2 symbol)) + (persist-with-delay *setting-control* 'fail-music-volume (seconds 5) 'music-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-sfx-volume (seconds 5) 'sfx-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-dialog-volume (seconds 5) 'dialog-volume 'abs 0.0 0) + (play-clean arg1) + (let ((gp-1 (-> *game-info* play-list arg0))) + (the-as string (cond + ((and (= arg2 'pre-play) (-> gp-1 pre-play-continue)) + (task-node-open! (-> gp-1 pre-play-node) 'menu) + (-> gp-1 pre-play-continue) + ) + ((and (= arg2 'kiosk) (-> gp-1 kiosk-play-continue)) + (send-event (ppointer->process *time-of-day*) 'change 'hour 7) + (task-node-open! (-> gp-1 kiosk-play-node) 'event) + (if (pair? (-> gp-1 kiosk-play-continue)) + (-> (the-as pair (-> gp-1 kiosk-play-continue)) car) + (-> gp-1 kiosk-play-continue) + ) + ) + (else + (if (-> gp-1 play-continue) + (task-node-open! (-> gp-1 play-node) 'menu) + ) + (-> gp-1 play-continue) + ) + ) + ) + ) + ) + +(defun restart-mission () + (let ((gp-0 #t)) + (let ((s5-0 #f)) + (let ((t9-0 reset-city-squad-control) + (a0-0 #f) + ) + (t9-0 a0-0) + ) + (let ((v1-1 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (let ((s4-0 (-> v1-1 next0))) + (while (!= v1-1 (-> *task-manager-engine* alive-list-end)) + (let ((a0-3 (-> (the-as connection v1-1) param1))) + (if (not s5-0) + (set! s5-0 #t) + ) + (if (and (-> (the-as task-manager a0-3) next-state) + (let ((v1-7 (-> (the-as task-manager a0-3) next-state name))) + (or (= v1-7 'complete) (= v1-7 'resolution) (= v1-7 'fail) (= v1-7 'restart)) + ) + ) + (set! s5-0 'busy) + ) + (if (send-event (the-as process-tree a0-3) 'restart) + (set! gp-0 #f) + ) + ) + (set! v1-1 s4-0) + *task-manager-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (if (or (and *target* (focus-test? *target* dead) s5-0) (= s5-0 'busy)) + (return (the-as int #f)) + ) + ) + (cond + ((-> *setting-control* user-current restart-info) + (spawn-resetter! + *resetter-control* + (the-as resetter-params (-> *setting-control* user-current restart-info)) + (the-as game-task-node-info #f) + ) + ) + (gp-0 + (let ((s5-1 (the-as game-task-node-info #f)) + (s4-1 (level-get-target-inside *level*)) + (gp-1 (the-as string #f)) + ) + (when (and s4-1 (not (logtest? (-> s4-1 info level-flags) (level-flags lf0)))) + (let ((s3-0 (-> *game-info* sub-task-list))) + (dotimes (s2-0 (-> s3-0 length)) + (when (nonzero? s2-0) + (let ((s1-0 (-> s3-0 s2-0))) + (if (and (= (-> s1-0 level) (-> s4-1 info taskname)) + (!= (-> s1-0 level) 'city) + (not (logtest? (-> s1-0 flags) (game-task-node-flag no-restart))) + (game-task-node-info-method-12 s1-0) + ) + (set! s5-1 s1-0) + ) + ) + ) + ) + ) + ) + (when s5-1 + (let ((v1-56 (-> *game-info* play-list (-> s5-1 task)))) + (cond + ((and (-> s5-1 reset) (-> s5-1 reset restart-info)) + (spawn-resetter! *resetter-control* (-> s5-1 reset restart-info) (the-as game-task-node-info #f)) + (return 0) + ) + ((-> v1-56 play-continue) + (set! gp-1 (-> v1-56 play-continue)) + ) + ) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'resetter-params))) + (set! (-> a1-8 flags) (resetter-flag auto-reset text-message no-audio)) + (set! (-> a1-8 message) (resetter-message mission-retry)) + (set! (-> a1-8 retry continue) gp-1) + (set! (-> a1-8 retry node) (game-task-node none)) + (set! (-> a1-8 retry reset-mode) 'try) + (set! (-> a1-8 retry execute) #f) + (set! (-> a1-8 fail node) (game-task-node none)) + (set! (-> a1-8 fail continue) #f) + (set! (-> a1-8 fail reset-mode) 'life) + (set! (-> a1-8 fail execute) #f) + (set! (-> a1-8 reset-delay) (the-as uint 0)) + (set! (-> a1-8 task) (game-task none)) + (set! (-> a1-8 text-message) (text-id null)) + (spawn-resetter! *resetter-control* a1-8 (the-as game-task-node-info #f)) + ) + ) + ) + ) + ) + 0 + ) + +;; WARN: Function fail-mission has a return type of none, but the expression builder found a return statement. +(defun fail-mission () + (let ((gp-0 #t)) + (let ((s5-0 #f)) + (let ((t9-0 reset-city-squad-control) + (a0-0 #f) + ) + (t9-0 a0-0) + ) + (let ((v1-1 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (let ((s4-0 (-> v1-1 next0))) + (while (!= v1-1 (-> *task-manager-engine* alive-list-end)) + (let ((a0-3 (-> (the-as connection v1-1) param1))) + (if (not s5-0) + (set! s5-0 #t) + ) + (if (and (-> (the-as task-manager a0-3) next-state) + (let ((v1-7 (-> (the-as task-manager a0-3) next-state name))) + (or (= v1-7 'complete) (= v1-7 'resolution) (= v1-7 'fail) (= v1-7 'restart)) + ) + ) + (set! s5-0 'busy) + ) + (if (send-event (the-as process-tree a0-3) 'fail #t) + (set! gp-0 #f) + ) + ) + (set! v1-1 s4-0) + *task-manager-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (if (or (and *target* (focus-test? *target* dead) s5-0) (= s5-0 'busy)) + (return #f) + ) + ) + (cond + ((-> *setting-control* user-current fail-info) + (spawn-resetter! + *resetter-control* + (the-as resetter-params (-> *setting-control* user-current fail-info)) + (the-as game-task-node-info #f) + ) + ) + (gp-0 + (let ((s4-1 (the-as game-task-node-info #f)) + (s3-0 (level-get-target-inside *level*)) + (gp-1 (the-as string #f)) + (s5-1 138) + ) + (when (and s3-0 (not (logtest? (-> s3-0 info level-flags) (level-flags lf0)))) + (let ((s2-0 (-> *game-info* sub-task-list))) + (dotimes (s1-0 (-> s2-0 length)) + (when (nonzero? s1-0) + (let ((s0-0 (-> s2-0 s1-0))) + (if (and (= (-> s0-0 level) (-> s3-0 info taskname)) + (!= (-> s0-0 level) 'city) + (not (logtest? (-> s0-0 flags) (game-task-node-flag no-restart))) + (game-task-node-info-method-12 s0-0) + ) + (set! s4-1 s0-0) + ) + ) + ) + ) + ) + ) + (cond + ((and s4-1 (-> s4-1 reset) (-> s4-1 reset fail-info)) + (spawn-resetter! *resetter-control* (-> s4-1 reset fail-info) (the-as game-task-node-info #f)) + (return 0) + ) + ((= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (set! gp-1 "wasdoors-desert") + (if (and (-> *game-info* current-continue) + (logtest? (continue-flags record-path) (-> *game-info* current-continue flags)) + ) + (set! gp-1 (-> *game-info* current-continue name)) + ) + (set! s5-1 1973) + ) + ((and s4-1 (let ((a0-25 (-> *game-info* play-list (-> s4-1 task) play-continue))) + (when a0-25 + (set! gp-1 a0-25) + gp-1 + ) + ) + ) + ) + ) + (let ((a1-12 (new 'stack-no-clear 'resetter-params))) + (set! (-> a1-12 flags) (resetter-flag auto-reset text-message)) + (set! (-> a1-12 message) (resetter-message mission-fail)) + (set! (-> a1-12 retry continue) #f) + (set! (-> a1-12 retry node) (game-task-node none)) + (set! (-> a1-12 retry reset-mode) 'try) + (set! (-> a1-12 retry execute) #f) + (set! (-> a1-12 fail node) (game-task-node none)) + (set! (-> a1-12 fail continue) gp-1) + (set! (-> a1-12 fail reset-mode) 'life) + (set! (-> a1-12 fail execute) #f) + (set! (-> a1-12 reset-delay) (the-as uint 1500)) + (set! (-> a1-12 task) (game-task none)) + (set! (-> a1-12 text-message) (the-as text-id s5-1)) + (spawn-resetter! *resetter-control* a1-12 (the-as game-task-node-info #f)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun task-node-by-name ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= arg0 (-> s3-0 name)) + (return s3-0) + ) + ) + ) + ) + ) + (the-as game-task-node-info #f) + ) + +(defun task-node-index-by-name ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((v1-4 (-> s5-0 s4-0))) + (if (string= arg0 (-> v1-4 name)) + (return s4-0) + ) + ) + ) + ) + ) + 0 + ) + +(defun task-resolution-close! ((arg0 game-task)) + (let ((v1-1 (-> *game-info* sub-task-list))) + (dotimes (a1-0 (-> v1-1 length)) + (when (nonzero? a1-0) + (let ((a2-3 (-> v1-1 a1-0))) + (when (and (= (-> a2-3 task) arg0) (logtest? (-> a2-3 flags) (game-task-node-flag close-task))) + (open! a2-3 'event) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +(defun task-close! ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (when (string= arg0 (-> s3-0 name)) + (let ((gp-2 (not (logtest? (-> s3-0 flags) (game-task-node-flag closed))))) + (open! s3-0 'event) + (return gp-2) + ) + ) + ) + ) + ) + ) + (format 0 "ERROR: attempting to close unknown task node ~A.~%" arg0) + #f + ) + +(defun task-closed? ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= arg0 (-> s3-0 name)) + (return (logtest? (-> s3-0 flags) (game-task-node-flag closed))) + ) + ) + ) + ) + ) + (format 0 "ERROR: attempting to query closed? of unknown task node ~A.~%" arg0) + #f + ) + +(defun open-task-nodes ((arg0 (array game-task-node-info))) + (local-vars (a3-4 symbol)) + (set! (-> arg0 length) 0) + (let ((v1-1 (-> *game-info* sub-task-list))) + (dotimes (a1-0 (-> v1-1 length)) + (when (nonzero? a1-0) + (let ((a2-3 (-> v1-1 a1-0))) + (when (and (not (logtest? (-> a2-3 flags) (game-task-node-flag closed))) + (begin + (dotimes (a3-3 4) + (when (and (nonzero? (-> a2-3 parent-node a3-3)) + (not (logtest? (-> v1-1 (-> a2-3 parent-node a3-3) flags) (game-task-node-flag closed))) + ) + (set! a3-4 #f) + (goto cfg-14) + ) + ) + (set! a3-4 #t) + (label cfg-14) + (and a3-4 (< (-> arg0 length) (-> arg0 allocated-length))) + ) + ) + (set! (-> arg0 (-> arg0 length)) a2-3) + (+! (-> arg0 length) 1) + ) + ) + ) + ) + ) + arg0 + ) + +(defmethod print ((this game-task-node-info)) + (format + #t + "#" + (-> this name) + (cond + ((logtest? (-> this flags) (game-task-node-flag closed)) + "closed" + ) + ((game-task-node-info-method-12 this) + "open" + ) + (else + "inactive" + ) + ) + this + ) + this + ) + +(defmethod open! ((this game-task-node-info) (arg0 symbol)) + (when (not (logtest? (-> this flags) (game-task-node-flag closed))) + (let ((s4-0 (lambda ((arg0 game-task-node-info) (arg1 symbol)) + (logior! (-> arg0 flags) (game-task-node-flag closed)) + (+! (-> *game-info* task-counter) 1) + (when (zero? (-> arg0 close-time)) + (set! (-> arg0 gem-count) (the-as uint (the int (-> *game-info* gem)))) + (set! (-> arg0 skill-count) (the-as uint (the int (-> *game-info* skill)))) + (set! (-> arg0 close-time) (the-as uint (-> *display* game-clock frame-counter))) + ) + (if (-> arg0 on-close) + (script-eval (-> arg0 on-close) :key arg0) + ) + (when (logtest? (-> arg0 flags) (game-task-node-flag close-task)) + (let ((t9-2 reset-city-squad-control) + (a0-4 #f) + ) + (t9-2 a0-4) + ) + (target-reset-on-task-finish) + (if (= arg1 'event) + (menu-secrets-notify-task-node-close (the-as game-task-node arg0)) + ) + ) + (if (logtest? (-> arg0 flags) (game-task-node-flag close-task)) + ((lambda ((arg0 game-task-node-info)) + (if *target* + (send-event *target* 'get-pickup (pickup-type fuel-cell) (the float (-> arg0 task))) + (give *game-info* 'fuel-cell (the float (-> arg0 task)) (the-as handle #f)) + ) + ) + arg0 + ) + ) + ) + ) + ) + (let ((s2-0 0) + (s3-0 (new 'stack-no-clear 'array 'game-task-node 64)) + ) + (let ((s1-0 this)) + (loop + (cond + ((= (-> s1-0 parent-node 0) (game-task-node none)) + (goto cfg-21) + ) + ((= (-> s1-0 parent-node 1) (game-task-node none)) + (let ((v1-10 (-> *game-info* sub-task-list (-> s1-0 parent-node 0)))) + (cond + ((logtest? (-> v1-10 flags) (game-task-node-flag closed)) + (goto cfg-21) + ) + (else + (set! (-> s3-0 s2-0) (-> s1-0 parent-node 0)) + (+! s2-0 1) + (when (< 64 s2-0) + (break!) + 0 + ) + ) + ) + (set! s1-0 v1-10) + ) + ) + (else + (dotimes (s0-0 4) + (let ((v1-15 (-> s1-0 parent-node s0-0))) + (if (nonzero? v1-15) + (open! (-> *game-info* sub-task-list v1-15) 'none) + ) + ) + ) + (goto cfg-21) + ) + ) + ) + ) + (label cfg-21) + (while (nonzero? s2-0) + (+! s2-0 -1) + (s4-0 (-> *game-info* sub-task-list (-> s3-0 s2-0)) arg0) + ) + ) + (s4-0 this arg0) + ) + (let ((s4-1 (-> *game-info* sub-task-list))) + (dotimes (s3-1 (-> s4-1 length)) + (when (nonzero? s3-1) + (let ((s2-1 (-> s4-1 s3-1))) + (if (and (or (logtest? (-> s2-1 flags) (game-task-node-flag auto-close disk-close)) + (and (kiosk?) + (logtest? (-> this flags) (game-task-node-flag close-task)) + (!= arg0 'menu) + (logtest? (-> s2-1 flags) (game-task-node-flag kiosk-close)) + ) + ) + (game-task-node-info-method-12 s2-1) + ) + (open! s2-1 'none) + ) + ) + ) + ) + ) + (update-task-masks arg0) + ) + 0 + ) + +(defun task-node-closed? ((arg0 game-task-node)) + (let ((v1-2 (-> *game-info* sub-task-list arg0))) + (logtest? (-> v1-2 flags) (game-task-node-flag closed)) + ) + ) + +(defun task-node-close! ((arg0 game-task-node) (arg1 symbol)) + (open! (-> *game-info* sub-task-list arg0) arg1) + 0 + ) + +(defun task-open? ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list)) + (s4-0 0) + ) + (while (< s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((v1-4 (-> s5-0 s4-0))) + (if (string= arg0 (-> v1-4 name)) + (return (task-node-open? (the-as game-task-node s4-0))) + ) + ) + ) + (set! s4-0 (+ s4-0 1)) + ) + ) + (format 0 "ERROR: attempting to query open? of unknown task node ~A.~%" arg0) + #f + ) + +(defmethod game-task-node-info-method-11 ((this game-task-node-info) (arg0 symbol)) + (local-vars (v1-19 symbol)) + (when (logtest? (-> this flags) (game-task-node-flag closed)) + (logclear! (-> this flags) (game-task-node-flag closed)) + (+! (-> *game-info* task-counter) 1) + (if (logtest? (-> this flags) (game-task-node-flag close-task)) + (logclear! (-> *game-info* task-perm-list data (-> this task) status) (entity-perm-status complete)) + ) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((a0-4 (-> s5-0 s4-0))) + (set! v1-19 + (and (logtest? (-> a0-4 flags) (game-task-node-flag closed)) + (begin + (dotimes (v1-20 4) + (when (and (nonzero? (-> a0-4 parent-node v1-20)) + (not (logtest? (-> s5-0 (-> a0-4 parent-node v1-20) flags) (game-task-node-flag closed))) + ) + (set! v1-19 #t) + (goto cfg-17) + ) + ) + #f + ) + ) + ) + (label cfg-17) + (if v1-19 + (game-task-node-info-method-11 a0-4 'none) + ) + ) + ) + ) + ) + (update-task-masks arg0) + ) + 0 + (none) + ) + +(defun task-node-open? ((arg0 game-task-node)) + (let ((v1-1 (-> *game-info* sub-task-list))) + (game-task-node-info-method-12 (-> v1-1 arg0)) + ) + ) (defmethod game-task-node-info-method-12 ((this game-task-node-info)) (local-vars (a0-3 symbol) (a1-1 symbol)) @@ -51,20 +1194,2179 @@ ) ) -(defmethod open! ((this game-task-node-info) (arg symbol)) - (format #t "skipping (open! ~A ~A)~%" this arg) +(defun task-node-open! ((arg0 game-task-node) (arg1 symbol)) + (let ((s5-0 (-> *game-info* sub-task-list arg0))) + (dotimes (s4-0 4) + (if (nonzero? (-> s5-0 parent-node s4-0)) + (open! (-> *game-info* sub-task-list (-> s5-0 parent-node s4-0)) arg1) + ) + ) + (game-task-node-info-method-11 s5-0 arg1) + ) 0 ) -(defun update-task-masks ((arg0 symbol)) - (format #t "skipping (update-task-masks ~A)~%" arg0) +(defmethod eval-game-task-cmd! ((this game-task-node-info)) + (dotimes (v1-0 (the-as int (-> this command-count))) + (case (-> *game-info* task-node-commands (+ (-> this command-index) v1-0)) + (((game-task-node-command none)) + ) + (((game-task-node-command add-jakc)) + (set! (-> *game-info* features) (the-as game-feature (logior (game-feature jakc) (-> *game-info* features)))) + ) + (((game-task-node-command add-sidekick)) + (logior! (-> *game-info* features) (game-feature sidekick)) + ) + (((game-task-node-command sub-sidekick)) + (logclear! (-> *game-info* features) (game-feature sidekick)) + ) + (((game-task-node-command add-board)) + (logior! (-> *game-info* features) (game-feature board)) + ) + (((game-task-node-command add-board-training)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature36) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-board-launch)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature board-launch) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-board-zap)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature board-zap) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-board-trail)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature board-trail) (-> *game-info* features))) + ) + ) + (((game-task-node-command sub-board-trail)) + (set! (-> *game-info* features) + (the-as game-feature (logclear (-> *game-info* features) (game-feature board-trail))) + ) + ) + (((game-task-node-command sub-board)) + (logclear! (-> *game-info* features) (game-feature board)) + ) + (((game-task-node-command add-gun-red-1)) + (logior! (-> *game-info* features) (game-feature gun gun-red-1)) + ) + (((game-task-node-command add-gun-red-2)) + (logior! (-> *game-info* features) (game-feature gun gun-red-2)) + ) + (((game-task-node-command add-gun-red-3)) + (logior! (-> *game-info* features) (game-feature gun gun-red-3)) + ) + (((game-task-node-command add-gun-red-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-red-ammo-1)) + ) + (((game-task-node-command add-gun-red-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-red-ammo-2)) + ) + (((game-task-node-command add-gun-yellow-1)) + (logior! (-> *game-info* features) (game-feature gun gun-yellow-1)) + ) + (((game-task-node-command add-gun-yellow-2)) + (logior! (-> *game-info* features) (game-feature gun gun-yellow-2)) + ) + (((game-task-node-command add-gun-yellow-3)) + (logior! (-> *game-info* features) (game-feature gun gun-yellow-3)) + ) + (((game-task-node-command add-gun-yellow-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-yellow-ammo-1)) + ) + (((game-task-node-command add-gun-yellow-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-yellow-ammo-2)) + ) + (((game-task-node-command add-gun-blue-1)) + (logior! (-> *game-info* features) (game-feature gun gun-blue-1)) + ) + (((game-task-node-command add-gun-blue-2)) + (logior! (-> *game-info* features) (game-feature gun gun-blue-2)) + ) + (((game-task-node-command add-gun-blue-3)) + (logior! (-> *game-info* features) (game-feature gun gun-blue-3)) + ) + (((game-task-node-command add-gun-blue-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-blue-ammo-1)) + ) + (((game-task-node-command add-gun-blue-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-blue-ammo-2)) + ) + (((game-task-node-command add-gun-dark-1)) + (logior! (-> *game-info* features) (game-feature gun gun-dark-1)) + ) + (((game-task-node-command add-gun-dark-2)) + (logior! (-> *game-info* features) (game-feature gun gun-dark-2)) + ) + (((game-task-node-command add-gun-dark-3)) + (logior! (-> *game-info* features) (game-feature gun gun-dark-3)) + ) + (((game-task-node-command add-gun-dark-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-dark-ammo-1)) + ) + (((game-task-node-command add-gun-dark-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-dark-ammo-2)) + ) + (((game-task-node-command add-pass-port-mh)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature31) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-port-inda)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature32) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-inda-indb)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature33) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-indb-sluma)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature34) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-slumb-genb)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature35) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkeco)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkeco) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-smack)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak-smack) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-bomb0)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak-bomb0) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-bomb1)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak-bomb1) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-tracking)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature44) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-invinc)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature45) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lighteco)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lighteco) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-regen)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-regen) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-swoop)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-swoop) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-freeze)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-freeze) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-shield)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-shield) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-0)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor0) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-1)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor1) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-2)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor2) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-3)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor3) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-artifact-invis)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-light-eco-crystal)) + (+! (-> *game-info* light-crystal) 1.0) + (case (-> *game-info* light-crystal) + ((1.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal0)) + ) + ((2.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal1)) + ) + ((3.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal2)) + ) + ((4.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal3)) + ) + ) + ) + (((game-task-node-command add-dark-eco-crystal)) + (+! (-> *game-info* dark-crystal) 1.0) + (case (-> *game-info* dark-crystal) + ((1.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal0)) + ) + ((2.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal1)) + ) + ((3.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal2)) + ) + ((4.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal3)) + ) + ) + ) + (((game-task-node-command add-vehicle-turtle)) + (logior! (-> *game-info* vehicles) (game-vehicles v-turtle)) + ) + (((game-task-node-command add-vehicle-snake)) + (logior! (-> *game-info* vehicles) (game-vehicles v-snake)) + ) + (((game-task-node-command add-vehicle-scorpion)) + (logior! (-> *game-info* vehicles) (game-vehicles v-scorpion)) + ) + (((game-task-node-command add-vehicle-toad)) + (logior! (-> *game-info* vehicles) (game-vehicles v-toad)) + ) + (((game-task-node-command add-vehicle-rhino)) + (logior! (-> *game-info* vehicles) (game-vehicles v-rhino)) + ) + (((game-task-node-command add-amulet-1)) + (logior! (-> *game-info* items) (game-items amulet0)) + ) + (((game-task-node-command add-amulet-2)) + (logior! (-> *game-info* items) (game-items amulet1)) + ) + (((game-task-node-command add-amulet-3)) + (logior! (-> *game-info* items) (game-items amulet2)) + ) + (((game-task-node-command add-pass-front-gate)) + (logior! (-> *game-info* items) (game-items pass-front-gate)) + ) + (((game-task-node-command add-seal)) + (logior! (-> *game-info* items) (game-items seal-of-mar)) + ) + (((game-task-node-command add-cypher-gliph)) + (logior! (-> *game-info* items) (game-items cypher-gliph)) + ) + (((game-task-node-command add-av-cube)) + (logior! (-> *game-info* items) (game-items artifact-holocube)) + ) + (((game-task-node-command add-av-reflector)) + (logior! (-> *game-info* items) (game-items artifact-av-reflector)) + ) + (((game-task-node-command add-av-prism)) + (logior! (-> *game-info* items) (game-items artifact-av-prism)) + ) + (((game-task-node-command add-av-generator)) + (logior! (-> *game-info* items) (game-items artifact-av-generator)) + ) + (((game-task-node-command add-av-map)) + (logior! (-> *game-info* items) (game-items artifact-av-map)) + ) + ) + ) 0 + (none) + ) + +(defun task-node-close-upwards ((arg0 (array game-task-node-info)) (arg1 int)) + (let ((s5-0 (-> arg0 arg1))) + (dotimes (s4-0 4) + (when (nonzero? (-> s5-0 parent-node s4-0)) + (let ((v1-11 (-> arg0 (-> s5-0 parent-node s4-0)))) + (when (not (logtest? (-> v1-11 flags) (game-task-node-flag closed))) + (logior! (-> v1-11 flags) (game-task-node-flag closed)) + (task-node-close-upwards arg0 (the-as int (-> s5-0 parent-node s4-0))) + ) + ) + ) + ) + ) + 0 + (none) ) (defun task-node-reset ((arg0 symbol)) - (format #t "skipping (task-node-reset ~A)~%" arg0) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (when (logtest? (-> s3-0 flags) (game-task-node-flag closed)) + (case arg0 + (('game) + (if (nonzero? s4-0) + (logclear! (-> s3-0 flags) (game-task-node-flag closed)) + ) + ) + (('life) + (if (and (not (task-complete? *game-info* (-> s3-0 task))) + (not (logtest? (-> s3-0 flags) (game-task-node-flag save-on-life))) + ) + (logclear! (-> s3-0 flags) (game-task-node-flag closed)) + ) + ) + (('try) + (if (and (not (task-complete? *game-info* (-> s3-0 task))) + (or (not (logtest? (-> s3-0 flags) (game-task-node-flag save-on-life save-on-try))) + (logtest? (-> s3-0 flags) (game-task-node-flag reset-on-try)) + ) + ) + (logclear! (-> s3-0 flags) (game-task-node-flag closed)) + ) + ) + ) + (if (logtest? (-> s3-0 flags) (game-task-node-flag closed)) + (task-node-close-upwards s5-0 s4-0) + ) + ) + ) + ) + ) + ) + (+! (-> *game-info* task-counter) 1) 0 ) -;; DECOMP BEGINS +(defun-debug task-node-dump ((arg0 symbol)) + (let ((gp-0 (-> *game-info* sub-task-list))) + (dotimes (s5-0 (-> gp-0 length)) + (when (nonzero? s5-0) + (let* ((s0-0 (-> gp-0 s5-0)) + (s4-0 format) + (s3-0 #t) + (s2-0 " ~-40S ~-8S ~S~%") + (s1-0 (game-task-node->string (the-as game-task-node s5-0))) + (a3-0 (if (task-node-closed? (the-as game-task-node s5-0)) + "closed" + "open" + ) + ) + (t0-0 (and (-> s0-0 manager) (handle->process (-> s0-0 manager manager)))) + ) + (set! t0-0 (cond + (t0-0 + (empty) + t0-0 + ) + (else + "" + ) + ) + ) + (s4-0 s3-0 s2-0 s1-0 a3-0 t0-0) + ) + ) + ) + ) + #f + ) +(defmethod print ((this game-task-event)) + (let* ((t9-0 format) + (a0-1 #t) + (a1-0 "#") + (v1-0 (-> this actor)) + (a2-1 (cond + ((= v1-0 (game-task-actor wascity-turret)) + "wascity-turret" + ) + ((= v1-0 (game-task-actor none)) + "none" + ) + ((= v1-0 (game-task-actor burning-bush-genb-2)) + "burning-bush-genb-2" + ) + ((= v1-0 (game-task-actor unused-slot-18)) + "unused-slot-18" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-3)) + "burning-bush-wasb-3" + ) + ((= v1-0 (game-task-actor burning-bush-desd-3)) + "burning-bush-desd-3" + ) + ((= v1-0 (game-task-actor unused-slot-17)) + "unused-slot-17" + ) + ((= v1-0 (game-task-actor unused-slot-15)) + "unused-slot-15" + ) + ((= v1-0 (game-task-actor burning-bush-inda-1)) + "burning-bush-inda-1" + ) + ((= v1-0 (game-task-actor veger-ruins)) + "veger-ruins" + ) + ((= v1-0 (game-task-actor burning-bush-desb-2)) + "burning-bush-desb-2" + ) + ((= v1-0 (game-task-actor unused-slot-16)) + "unused-slot-16" + ) + ((= v1-0 (game-task-actor burning-bush-desf)) + "burning-bush-desf" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-3)) + "burning-bush-slumb-3" + ) + ((= v1-0 (game-task-actor wascity-leaper)) + "wascity-leaper" + ) + ((= v1-0 (game-task-actor unused-slot-8)) + "unused-slot-8" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-2)) + "burning-bush-slumb-2" + ) + ((= v1-0 (game-task-actor burning-bush-desb)) + "burning-bush-desb" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-2)) + "burning-bush-wasa-2" + ) + ((= v1-0 (game-task-actor seem-wascitya)) + "seem-wascitya" + ) + ((= v1-0 (game-task-actor ashelin-oasis)) + "ashelin-oasis" + ) + ((= v1-0 (game-task-actor was-pre-game-deserte)) + "was-pre-game-deserte" + ) + ((= v1-0 (game-task-actor burning-bush-indb)) + "burning-bush-indb" + ) + ((= v1-0 (game-task-actor burning-bush-port-4)) + "burning-bush-port-4" + ) + ((= v1-0 (game-task-actor burning-bush-port-5)) + "burning-bush-port-5" + ) + ((= v1-0 (game-task-actor seem-wascity)) + "seem-wascity" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-1)) + "burning-bush-wasa-1" + ) + ((= v1-0 (game-task-actor unused-slot-20)) + "unused-slot-20" + ) + ((= v1-0 (game-task-actor vin-vinroom)) + "vin-vinroom" + ) + ((= v1-0 (game-task-actor burning-bush-marka)) + "burning-bush-marka" + ) + ((= v1-0 (game-task-actor burning-bush-slumc-2)) + "burning-bush-slumc-2" + ) + ((= v1-0 (game-task-actor burning-bush-desc-5)) + "burning-bush-desc-5" + ) + ((= v1-0 (game-task-actor unused-slot-19)) + "unused-slot-19" + ) + ((= v1-0 (game-task-actor monk-mummy)) + "monk-mummy" + ) + ((= v1-0 (game-task-actor torn-freehq)) + "torn-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-indb-3)) + "burning-bush-indb-3" + ) + ((= v1-0 (game-task-actor burning-bush-desb-4)) + "burning-bush-desb-4" + ) + ((= v1-0 (game-task-actor seem-temple)) + "seem-temple" + ) + ((= v1-0 (game-task-actor kleever-arena)) + "kleever-arena" + ) + ((= v1-0 (game-task-actor unused-slot-21)) + "unused-slot-21" + ) + ((= v1-0 (game-task-actor burning-bush-indb-2)) + "burning-bush-indb-2" + ) + ((= v1-0 (game-task-actor oracle-oracle)) + "oracle-oracle" + ) + ((= v1-0 (game-task-actor jinx-hiphog)) + "jinx-hiphog" + ) + ((= v1-0 (game-task-actor minimap)) + "minimap" + ) + ((= v1-0 (game-task-actor burning-bush-arena)) + "burning-bush-arena" + ) + ((= v1-0 (game-task-actor damus-wasdoors)) + "damus-wasdoors" + ) + ((= v1-0 (game-task-actor kleever-pen)) + "kleever-pen" + ) + ((= v1-0 (game-task-actor burning-bush-markb)) + "burning-bush-markb" + ) + ((= v1-0 (game-task-actor burning-bush-genb-4)) + "burning-bush-genb-4" + ) + ((= v1-0 (game-task-actor daxter)) + "daxter" + ) + ((= v1-0 (game-task-actor burning-bush-genb-5)) + "burning-bush-genb-5" + ) + ((= v1-0 (game-task-actor torn-hipbar)) + "torn-hipbar" + ) + ((= v1-0 (game-task-actor burning-bush-genb-1)) + "burning-bush-genb-1" + ) + ((= v1-0 (game-task-actor burning-bush-inda-4)) + "burning-bush-inda-4" + ) + ((= v1-0 (game-task-actor burning-bush-desb-3)) + "burning-bush-desb-3" + ) + ((= v1-0 (game-task-actor sig-nest)) + "sig-nest" + ) + ((= v1-0 (game-task-actor unused-slot-22)) + "unused-slot-22" + ) + ((= v1-0 (game-task-actor burning-bush-slumb)) + "burning-bush-slumb" + ) + ((= v1-0 (game-task-actor ashelin-freehq)) + "ashelin-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-desc-2)) + "burning-bush-desc-2" + ) + ((= v1-0 (game-task-actor samos-onintent)) + "samos-onintent" + ) + ((= v1-0 (game-task-actor burning-bush-desd)) + "burning-bush-desd" + ) + ((= v1-0 (game-task-actor burning-bush-desg-2)) + "burning-bush-desg-2" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-6)) + "burning-bush-wasa-6" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-7)) + "burning-bush-wasb-7" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-2)) + "burning-bush-wasb-2" + ) + ((= v1-0 (game-task-actor burning-bush-inda-5)) + "burning-bush-inda-5" + ) + ((= v1-0 (game-task-actor sig-talkbox)) + "sig-talkbox" + ) + ((= v1-0 (game-task-actor pecker-onintent)) + "pecker-onintent" + ) + ((= v1-0 (game-task-actor damus-arena)) + "damus-arena" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-5)) + "burning-bush-wasa-5" + ) + ((= v1-0 (game-task-actor unused-slot-23)) + "unused-slot-23" + ) + ((= v1-0 (game-task-actor damus-wascity)) + "damus-wascity" + ) + ((= v1-0 (game-task-actor monk-wascity)) + "monk-wascity" + ) + ((= v1-0 (game-task-actor damus-desert)) + "damus-desert" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-1)) + "burning-bush-wasb-1" + ) + ((= v1-0 (game-task-actor burning-bush-desc-4)) + "burning-bush-desc-4" + ) + ((= v1-0 (game-task-actor burning-bush-dese-5)) + "burning-bush-dese-5" + ) + ((= v1-0 (game-task-actor was-pre-game-wascityb)) + "was-pre-game-wascityb" + ) + ((= v1-0 (game-task-actor burning-bush-slumc)) + "burning-bush-slumc" + ) + ((= v1-0 (game-task-actor power-game-vinroom)) + "power-game-vinroom" + ) + ((= v1-0 (game-task-actor tess-gungame)) + "tess-gungame" + ) + ((= v1-0 (game-task-actor pecker)) + "pecker" + ) + ((= v1-0 (game-task-actor torn-hipbooth)) + "torn-hipbooth" + ) + ((= v1-0 (game-task-actor burning-bush-desg-4)) + "burning-bush-desg-4" + ) + ((= v1-0 (game-task-actor burning-bush-genc-2)) + "burning-bush-genc-2" + ) + ((= v1-0 (game-task-actor damus-ruins)) + "damus-ruins" + ) + ((= v1-0 (game-task-actor unused-slot-24)) + "unused-slot-24" + ) + ((= v1-0 (game-task-actor ashelin-talkbox)) + "ashelin-talkbox" + ) + ((= v1-0 (game-task-actor burning-bush-port-8)) + "burning-bush-port-8" + ) + ((= v1-0 (game-task-actor burning-bush-port-2)) + "burning-bush-port-2" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-6)) + "burning-bush-wasb-6" + ) + ((= v1-0 (game-task-actor burning-bush-port-3)) + "burning-bush-port-3" + ) + ((= v1-0 (game-task-actor unused-slot-27)) + "unused-slot-27" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-4)) + "burning-bush-slumb-4" + ) + ((= v1-0 (game-task-actor burning-bush-desg-3)) + "burning-bush-desg-3" + ) + ((= v1-0 (game-task-actor sig-wasdoors)) + "sig-wasdoors" + ) + ((= v1-0 (game-task-actor samos-freehq)) + "samos-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-sluma-1)) + "burning-bush-sluma-1" + ) + ((= v1-0 (game-task-actor onin-talkbox)) + "onin-talkbox" + ) + ((= v1-0 (game-task-actor unused-slot-25)) + "unused-slot-25" + ) + ((= v1-0 (game-task-actor burning-bush-desc-3)) + "burning-bush-desc-3" + ) + ((= v1-0 (game-task-actor burning-bush-genb)) + "burning-bush-genb" + ) + ((= v1-0 (game-task-actor burning-bush-markb-2)) + "burning-bush-markb-2" + ) + ((= v1-0 (game-task-actor burning-bush-dese-2)) + "burning-bush-dese-2" + ) + ((= v1-0 (game-task-actor burning-bush-indb-1)) + "burning-bush-indb-1" + ) + ((= v1-0 (game-task-actor unused-slot-9)) + "unused-slot-9" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-1)) + "burning-bush-slumb-1" + ) + ((= v1-0 (game-task-actor unused-slot-28)) + "unused-slot-28" + ) + ((= v1-0 (game-task-actor burning-bush-pal-2)) + "burning-bush-pal-2" + ) + ((= v1-0 (game-task-actor burning-bush-desa-2)) + "burning-bush-desa-2" + ) + ((= v1-0 (game-task-actor burning-bush-farma)) + "burning-bush-farma" + ) + ((= v1-0 (game-task-actor burning-bush-desg)) + "burning-bush-desg" + ) + ((= v1-0 (game-task-actor keira-freehq)) + "keira-freehq" + ) + ((= v1-0 (game-task-actor unused-slot-26)) + "unused-slot-26" + ) + ((= v1-0 (game-task-actor burning-bush-desd-5)) + "burning-bush-desd-5" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-5)) + "burning-bush-wasb-5" + ) + ((= v1-0 (game-task-actor burning-bush-desc)) + "burning-bush-desc" + ) + ((= v1-0 (game-task-actor burning-bush-genb-3)) + "burning-bush-genb-3" + ) + ((= v1-0 (game-task-actor onin-onintent)) + "onin-onintent" + ) + ((= v1-0 (game-task-actor unused-slot-29)) + "unused-slot-29" + ) + ((= v1-0 (game-task-actor unused-slot-10)) + "unused-slot-10" + ) + ((= v1-0 (game-task-actor burning-bush-inda-2)) + "burning-bush-inda-2" + ) + ((= v1-0 (game-task-actor unused-slot-30)) + "unused-slot-30" + ) + ((= v1-0 (game-task-actor burning-bush-inda-3)) + "burning-bush-inda-3" + ) + ((= v1-0 (game-task-actor burning-bush-slumc-1)) + "burning-bush-slumc-1" + ) + ((= v1-0 (game-task-actor samos-genb)) + "samos-genb" + ) + ((= v1-0 (game-task-actor burning-bush-dese-4)) + "burning-bush-dese-4" + ) + ((= v1-0 (game-task-actor burning-bush-desh)) + "burning-bush-desh" + ) + ((= v1-0 (game-task-actor samos-talkbox)) + "samos-talkbox" + ) + ((= v1-0 (game-task-actor burning-bush-farmb)) + "burning-bush-farmb" + ) + ((= v1-0 (game-task-actor gun-gungame)) + "gun-gungame" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-4)) + "burning-bush-wasa-4" + ) + ((= v1-0 (game-task-actor unused-slot-12)) + "unused-slot-12" + ) + ((= v1-0 (game-task-actor onin-freehq)) + "onin-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-desa-3)) + "burning-bush-desa-3" + ) + ((= v1-0 (game-task-actor burning-bush-port-6)) + "burning-bush-port-6" + ) + ((= v1-0 (game-task-actor unused-slot-11)) + "unused-slot-11" + ) + ((= v1-0 (game-task-actor unused-slot-31)) + "unused-slot-31" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-3)) + "burning-bush-wasa-3" + ) + ((= v1-0 (game-task-actor veger-cave)) + "veger-cave" + ) + ((= v1-0 (game-task-actor burning-bush-port-1)) + "burning-bush-port-1" + ) + ((= v1-0 (game-task-actor keira-genb)) + "keira-genb" + ) + ((= v1-0 (game-task-actor burning-bush-dese-3)) + "burning-bush-dese-3" + ) + ((= v1-0 (game-task-actor burning-bush-gena-2)) + "burning-bush-gena-2" + ) + ((= v1-0 (game-task-actor burning-bush-genc)) + "burning-bush-genc" + ) + ((= v1-0 (game-task-actor burning-bush-desd-2)) + "burning-bush-desd-2" + ) + ((= v1-0 (game-task-actor burning-bush-desa)) + "burning-bush-desa" + ) + ((= v1-0 (game-task-actor burning-bush-port)) + "burning-bush-port" + ) + ((= v1-0 (game-task-actor burning-bush-inda)) + "burning-bush-inda" + ) + ((= v1-0 (game-task-actor burning-bush-stadium)) + "burning-bush-stadium" + ) + ((= v1-0 (game-task-actor damus-waspal)) + "damus-waspal" + ) + ((= v1-0 (game-task-actor burning-bush-port-7)) + "burning-bush-port-7" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-4)) + "burning-bush-wasb-4" + ) + ((= v1-0 (game-task-actor keira-garage)) + "keira-garage" + ) + ((= v1-0 (game-task-actor torn-hiptable)) + "torn-hiptable" + ) + ((= v1-0 (game-task-actor torn-hiphog)) + "torn-hiphog" + ) + ((= v1-0 (game-task-actor kleever-wasdoors)) + "kleever-wasdoors" + ) + ((= v1-0 (game-task-actor unused-slot-14)) + "unused-slot-14" + ) + ((= v1-0 (game-task-actor unused-slot-13)) + "unused-slot-13" + ) + ((= v1-0 (game-task-actor burning-bush-dese)) + "burning-bush-dese" + ) + ((= v1-0 (game-task-actor seem-leaper)) + "seem-leaper" + ) + ((= v1-0 (game-task-actor burning-bush-pal)) + "burning-bush-pal" + ) + ((= v1-0 (game-task-actor kleever-wascityb)) + "kleever-wascityb" + ) + ((= v1-0 (game-task-actor burning-bush-desd-4)) + "burning-bush-desd-4" + ) + ((= v1-0 (game-task-actor burning-bush-sluma-3)) + "burning-bush-sluma-3" + ) + ((= v1-0 (game-task-actor burning-bush-sluma-2)) + "burning-bush-sluma-2" + ) + ((= v1-0 (game-task-actor burning-bush-gena)) + "burning-bush-gena" + ) + ((= v1-0 (game-task-actor burning-bush-sluma)) + "burning-bush-sluma" + ) + (else + "*unknown*" + ) + ) + ) + (v1-1 (-> this action)) + ) + (t9-0 + a0-1 + a1-0 + a2-1 + (cond + ((= v1-1 (game-task-action idle)) + "idle" + ) + ((= v1-1 (game-task-action play)) + "play" + ) + ((= v1-1 (game-task-action show)) + "show" + ) + ((= v1-1 (game-task-action talk)) + "talk" + ) + ((= v1-1 (game-task-action hide)) + "hide" + ) + ((= v1-1 (game-task-action say)) + "say" + ) + ((= v1-1 (game-task-action trade)) + "trade" + ) + ((= v1-1 (game-task-action menu)) + "menu" + ) + (else + "*unknown*" + ) + ) + (-> this scene) + this + ) + ) + this + ) + +(defmethod new game-task-control ((allocation symbol) (type-to-make type) (arg0 game-task-actor)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 actor) arg0) + v0-0 + ) + ) + +(defmethod get-current-task-event ((this game-task-control)) + (let ((gp-0 (new 'static 'game-task-event :scene #f))) + (let ((s4-0 #f)) + (when (!= (-> this counter) (-> *game-info* task-counter)) + (set! (-> this counter) (-> *game-info* task-counter)) + (set! (-> this current-node) (game-task-node none)) + (set! (-> this current-event) #f) + (set! s4-0 #t) + (let ((s2-0 (-> *game-info* sub-task-list))) + (dotimes (s3-0 (-> s2-0 length)) + (when (nonzero? s3-0) + (let ((s1-0 (-> s2-0 s3-0))) + (when (and (task-node-open? (the-as game-task-node s3-0)) + (-> s1-0 when-open) + (begin + (countdown (v1-12 (-> s1-0 when-open length)) + (when (= (-> this actor) (-> s1-0 when-open v1-12 actor)) + (set! (-> this current-event) (-> s1-0 when-open v1-12)) + (set! (-> this current-node) (the-as game-task-node s3-0)) + #t + (goto cfg-18) + ) + ) + #f + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + (cond + ((= (-> this current-node) (game-task-node none)) + (set! (-> gp-0 actor) (-> this actor)) + ) + ((begin (set! gp-0 (-> this current-event)) (not (logtest? (-> gp-0 flags) (game-task-flags gatflag-00)))) + ) + (else + (set! (-> gp-0 action) (the-as game-task-action (-> gp-0 tex))) + ) + ) + (if s4-0 + (logior! (-> gp-0 flags) (game-task-flags gatflag-01)) + (logclear! (-> gp-0 flags) (game-task-flags gatflag-01)) + ) + ) + gp-0 + ) + ) + +(deftype resetter (process) + ((params resetter-params :inline) + (message resetter-message :overlay-at (-> params message)) + (flags resetter-flag :overlay-at (-> params flags)) + (reset-delay uint32 :overlay-at (-> params reset-delay)) + (task game-task :overlay-at (-> params task)) + (text-message text-id :overlay-at (-> params text-message)) + (retry resetter-spec :inline :overlay-at (-> params retry)) + (retry-continue continue-point :overlay-at (-> params retry continue)) + (retry-node game-task-node :overlay-at (-> params retry node)) + (retry-reset-mode symbol :overlay-at (-> params retry reset-mode)) + (fail resetter-spec :inline :overlay-at (-> params fail)) + (fail-continue continue-point :overlay-at (-> params fail continue)) + (fail-node game-task-node :overlay-at (-> params fail node)) + (fail-reset-mode symbol :overlay-at (-> params fail reset-mode)) + (resetter-id text-id :offset 176) + (grabbed-player? symbol :offset 180) + (grabbed-time time-frame) + (dead-player? symbol) + (retry? symbol) + (message-id text-id) + (stinger uint32) + (start-time time-frame) + ) + (:state-methods + idle + resetting + ) + (:methods + (resetter-method-16 (_type_) none) + ) + ) + + +(defmethod run-logic? ((this resetter)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; WARN: Return type mismatch float vs none. +(defmethod resetter-method-16 ((this resetter)) + (when (and (not (logtest? (-> this params flags) (resetter-flag no-message))) + (= (get-status *gui-control* (the-as sound-id (-> this message-id))) (gui-status active)) + ) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) + ) + ) + (set! (-> gp-0 origin x) 120.0) + (let ((v1-7 gp-0)) + (set! (-> v1-7 scale) 0.7) + ) + (let ((v1-8 gp-0)) + (set! (-> v1-8 width) (the float 300)) + ) + (let ((v1-9 gp-0)) + (set! (-> v1-9 height) (the float 35)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((s4-0 (if (logtest? (-> this params flags) (resetter-flag text-message)) + (the-as int (-> this params text-message)) + 138 + ) + ) + ) + (when (nonzero? s4-0) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as text-id s4-0) #f) 1) + (s3-0 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (when (= (-> this params message) (resetter-message mission-fail-or-retry)) + (let ((v1-17 gp-0)) + (set! (-> v1-17 height) (the float 95)) + ) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-008b) #f) 1) + (s5-1 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-19 gp-0)) + (set! (-> v1-19 height) (the float 155)) + ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0081) #f) 1) + (s5-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + (none) + ) + +(defstate idle (resetter) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + (cond + ((-> self grabbed-player?) + (persist-with-delay *setting-control* 'fail (seconds 10) 'bg-a 'abs 1.0 0) + (go-virtual resetting) + ) + (else + (logior! (-> self params flags) (resetter-flag auto-reset)) + (set! (-> self params reset-delay) (the-as uint 0)) + #t + ) + ) + ) + (('query) + (case (-> block param 0) + (('reset) + (-> self grabbed-player?) + ) + ) + ) + ) + ) + :exit (behavior () + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (update-rates! (-> *display* camera-clock) 1.0) + ) + :code (behavior () + (if (and *target* (focus-test? *target* dead)) + (set! (-> self dead-player?) #t) + ) + (cond + ((or (= (-> self params message) (resetter-message mission-fail)) + (= (-> self params message) (resetter-message mission-retry)) + (logtest? (-> self params flags) (resetter-flag no-grab)) + ) + (while (begin + (if (and *target* (focus-test? *target* grabbed)) + (process-release? *target*) + ) + (if (logtest? (-> self params flags) (resetter-flag no-draw-target)) + (send-event *target* 'draw #f) + ) + (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) 'attack-invinc) + (set! (-> a1-1 param 0) (the-as uint #f)) + (set! (-> a1-1 param 1) + (the-as + uint + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'bot)) + ) + ) + ) + (not (or (send-event-function *target* a1-1) (and *target* (focus-test? *target* dead)))) + ) + ) + (suspend) + ) + (hide-hud 'hud-health) + ) + ((= (-> self params message) (resetter-message mission-fail-or-retry)) + (while (not (process-grab? *target* 'dead)) + (suspend) + ) + ) + ) + (set! (-> self grabbed-player?) #t) + (set! (-> self grabbed-time) (-> *display* real-clock frame-counter)) + (kill-current-talker '() '() 'exit) + (when (and (not (-> self dead-player?)) (not (logtest? (-> self params flags) (resetter-flag no-slow-down)))) + (while (< (- (-> *display* real-clock frame-counter) (-> self grabbed-time)) (seconds 1.5)) + (let ((f30-0 + (lerp-scale 0.0 1.0 (the float (- (-> *display* real-clock frame-counter) (-> self grabbed-time))) 0.0 450.0) + ) + ) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-0 0.0 1.0) + (lerp-scale 1.0 0.875 f30-0 0.0 1.0) + (lerp-scale 1.0 0.25 f30-0 0.0 1.0) + ) + (update-rates! (-> *display* bg-clock) (- 1.0 f30-0)) + (update-rates! (-> *display* entity-clock) (- 1.0 f30-0)) + (update-rates! (-> *display* target-clock) (- 1.0 f30-0)) + (update-rates! (-> *display* camera-clock) (- 1.0 f30-0)) + ) + (resetter-method-16 self) + (suspend) + ) + (+! (-> self clock ref-count) -1) + (+! (-> *display* real-clock ref-count) 1) + (set! (-> self clock) (-> *display* real-clock)) + (logclear! (-> self mask) (process-mask freeze)) + (set-master-mode 'freeze) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + ) + (case (-> self params message) + (((resetter-message mission-fail) (resetter-message mission-retry)) + (until #f + (when (or (and (logtest? (-> self params flags) (resetter-flag auto-reset)) + (>= (- (-> *display* real-clock frame-counter) (-> self grabbed-time)) + (the-as time-frame (-> self params reset-delay)) + ) + ) + (or (cpad-pressed? 0 confirm) + (and (kiosk?) + (>= (- (-> *display* real-clock frame-counter) (-> self start-time)) (seconds 60)) + (>= (- (-> *display* real-clock frame-counter) (-> *cpad-list* cpads 0 real-change-time)) (seconds 60)) + ) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (if (= (-> self params message) (resetter-message mission-retry)) + (set! (-> self retry?) #t) + ) + (persist-with-delay *setting-control* 'fail (seconds 10) 'bg-a 'abs 1.0 0) + (go-virtual resetting) + ) + (resetter-method-16 self) + (suspend) + ) + #f + ) + (((resetter-message mission-fail-or-retry)) + (until #f + (when (cpad-pressed? 0 confirm) + (sound-play "mission-retry") + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> self retry?) #t) + (cond + ((not *target*) + ) + ((focus-test? *target* grabbed) + (while (not (process-release? *target*)) + (suspend) + ) + ) + ) + (suspend) + (persist-with-delay *setting-control* 'fail (seconds 10) 'bg-a 'abs 1.0 0) + (go-virtual resetting) + ) + (let ((v1-147 (when (cpad-pressed? 0 triangle) + (sound-play "mission-quit") + #t + ) + ) + ) + (when (or v1-147 + (and (kiosk?) + (>= (- (-> *display* real-clock frame-counter) (-> self start-time)) (seconds 60)) + (>= (- (-> *display* real-clock frame-counter) (-> *cpad-list* cpads 0 real-change-time)) (seconds 60)) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> self retry?) #f) + (cond + ((not *target*) + ) + ((focus-test? *target* grabbed) + (while (not (process-release? *target*)) + (suspend) + ) + ) + ) + (suspend) + (go-virtual resetting) + ) + ) + (resetter-method-16 self) + (suspend) + ) + #f + ) + ) + ) + ) + +(defmethod deactivate ((this resetter)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set-filter-color! 1.0 1.0 1.0) + (sound-group-continue (the-as sound-group #xffffffff)) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (update-rates! (-> *display* camera-clock) 1.0) + (call-parent-method this) + (none) + ) + +(defstate resetting (resetter) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + #t + ) + (('query) + (case (-> block param 0) + (('reset) + #t + ) + ) + ) + ) + ) + :exit (behavior () + (if (= *master-mode* 'freeze) + (set-master-mode 'game) + ) + (process-release? *target*) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 300.0))) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-0 0.0 1.0) + (lerp-scale 1.0 0.875 f30-0 0.0 1.0) + (lerp-scale 1.0 0.25 f30-0 0.0 1.0) + ) + ) + (suspend) + ) + ) + (let ((gp-1 (if (-> self retry?) + (-> self params retry) + (-> self params fail) + ) + ) + ) + (format 0 "---------> resetting with ~`resetter-spec`P~%" gp-1) + (let ((s5-1 (-> gp-1 execute))) + (if s5-1 + (script-eval (the-as pair s5-1)) + ) + ) + (cond + ((and *target* + (or (and (focus-test? *target* dead) #t) (and (not (-> gp-1 continue)) (focus-test? *target* grabbed))) + ) + (inc-death-count! *game-info*) + (if (-> gp-1 continue) + (set-continue! *game-info* (-> gp-1 continue) #t) + ) + (when (-> gp-1 reset-mode) + (task-node-reset (-> gp-1 reset-mode)) + (update-task-masks (-> gp-1 reset-mode)) + ) + (if (nonzero? (-> gp-1 node)) + (task-node-open! (-> gp-1 node) 'event) + ) + (if (and *target* (focus-test? *target* dead grabbed)) + (send-event *target* 'end-mode 'bot (if (-> self retry?) + (-> self params retry) + (-> self params fail) + ) + ) + ) + ) + (else + (initialize! *game-info* #f (the-as game-save #f) (the-as string #f) gp-1) + ) + ) + (cond + ((or (and *target* (focus-test? *target* dead)) (-> gp-1 continue)) + (persist-with-delay *setting-control* 'fail-sfx-volume (seconds 3) 'sfx-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-dialog-volume (seconds 3) 'dialog-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-music-volume (seconds 3) 'music-volume 'abs 0.0 0) + ) + (else + (set-action! + *gui-control* + (gui-action fade) + (the-as sound-id (-> self stinger)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + ) + (persist-with-delay *setting-control* 'allow-continue (seconds 3) 'allow-continue #f 0.0 0) + (persist-with-delay *setting-control* 'speech-control (seconds 3) 'speech-control #f 0.0 0) + ) + ) + +(defbehavior resetter-init-by-other resetter ((arg0 resetter-params) (arg1 game-task-node-info)) + (stack-size-set! (-> self main-thread) 512) + (mem-copy! (the-as pointer (-> self params)) (the-as pointer arg0) 48) + (set! (-> self grabbed-player?) #f) + (set! (-> self dead-player?) #f) + (set! (-> self retry?) #f) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'gun-eject #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self start-time) (-> *display* real-clock frame-counter)) + (set! (-> *game-info* mode) 'play) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel guard) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel citizen) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel jak-mode) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (when (not (or (logtest? (-> arg0 flags) (resetter-flag no-audio)) + (and arg1 (logtest? (-> arg0 flags) (resetter-flag no-audio-first)) (zero? (-> arg1 death-count))) + ) + ) + (if (and arg1 (logtest? (-> arg0 flags) (resetter-flag no-audio-first))) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel alert) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (set! (-> self stinger) + (the-as uint (add-process *gui-control* *target* (gui-channel task) (gui-action play) "lose1" -99.0 0)) + ) + (sound-params-set! *gui-control* (the-as sound-id (-> self stinger)) #f -1 -1 -1 0.75) + ) + (set-setting! 'music-volume 'abs 0.0 0) + (if (logtest? (-> arg0 flags) (resetter-flag stop-sfx)) + (set-setting! 'sfx-volume 'abs 0.0 0) + ) + (set-setting! 'speech-control #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (+! (-> self clock ref-count) -1) + (+! (-> *display* base-clock ref-count) 1) + (set! (-> self clock) (-> *display* base-clock)) + (apply-settings *setting-control*) + (if (or (not (logtest? (-> self params flags) (resetter-flag text-message))) + (nonzero? (-> self params text-message)) + (= (-> self params message) (resetter-message mission-fail-or-retry)) + ) + (set! (-> self message-id) + (the-as text-id (add-process *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0)) + ) + ) + (set! (-> self resetter-id) + (the-as text-id (add-process *gui-control* self (gui-channel resetter) (gui-action play) "fail" -99.0 0)) + ) + (go-virtual idle) + ) + +(defmethod spawn-resetter! ((this resetter-control) (arg0 resetter-params) (arg1 game-task-node-info)) + (when (not (handle->process (-> this process))) + (let ((v1-4 (process-spawn resetter arg0 arg1 :name "resetter" :to *entity-pool*))) + (when v1-4 + (set! (-> this process) (process->handle (-> v1-4 0))) + #t + ) + ) + ) + ) + +(defmethod do-reset ((this resetter-control)) + (send-event (handle->process (-> this process)) 'reset) + ) + +(defmethod check-reset ((this resetter-control)) + (send-event (handle->process (-> this process)) 'query 'reset) + ) + +(defmethod get-resetter ((this resetter-control)) + (handle->process (-> this process)) + ) + +(defmethod task-manager-method-25 ((this task-manager)) + 0 + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager)) + 0 + (none) + ) + +(defmethod task-manager-method-27 ((this task-manager)) + 0 + (none) + ) + +(defmethod task-manager-method-28 ((this task-manager)) + 0 + (none) + ) + +;; WARN: Return type mismatch structure vs resetter-params. +;; WARN: disable def twice: 65. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 127. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 189. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 251. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod on-fail ((this task-manager) (arg0 symbol)) + (local-vars (v0-0 structure)) + (let ((gp-0 (-> *game-info* sub-task-list (-> this node-info manager final-node))) + (s5-0 (-> this node-info)) + (v1-5 arg0) + ) + (the-as + resetter-params + (cond + ((= v1-5 'death) + (let ((v1-7 (-> *setting-control* user-current death-info))) + (if v1-7 + (return (the-as resetter-params v1-7)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset death-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset death-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset death-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset death-info))) + v0-0 + ) + ) + ((= v1-5 'fail) + (let ((v1-35 (-> *setting-control* user-current fail-info))) + (if v1-35 + (return (the-as resetter-params v1-35)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset fail-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset fail-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset fail-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset fail-info))) + v0-0 + ) + ) + ((= v1-5 'restart) + (let ((v1-63 (-> *setting-control* user-current restart-info))) + (if v1-63 + (return (the-as resetter-params v1-63)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset restart-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset restart-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset restart-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset restart-info))) + v0-0 + ) + ) + ((= v1-5 'quit) + (let ((v1-91 (-> *setting-control* user-current quit-info))) + (if v1-91 + (return (the-as resetter-params v1-91)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset quit-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset quit-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset quit-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset quit-info))) + v0-0 + ) + ) + (else + (the-as structure #f) + ) + ) + ) + ) + ) + +(defbehavior task-manager-init-by-other task-manager ((arg0 game-task-node-info) (arg1 symbol)) + (stack-size-set! (-> self main-thread) 1024) + (add-connection *task-manager-engine* self nothing self arg0 #f) + (set! (-> self node-info) arg0) + (set! (-> self lev-name) arg1) + (add-setting! 'task arg0 0.0 0) + (add-setting! 'task-manager (process->ppointer self) 0.0 0) + (set-time! (-> self intro-time)) + (set! (-> self fail-on-death?) (if (and (-> self node-info reset) (-> self node-info reset death-info)) + #t + #f + ) + ) + (when arg1 + (let* ((v1-19 (level-get *level* arg1)) + (a1-6 (if (and (nonzero? (-> v1-19 entity)) (> (-> v1-19 entity length) 0)) + (-> v1-19 entity data 0 entity) + ) + ) + ) + (if a1-6 + (process-entity-set! self a1-6) + ) + ) + ) + (init! self) + (go-virtual wait) + ) + +(defmethod kill-all-children ((this task-manager)) + (while (-> this child) + (deactivate (ppointer->process (-> this child))) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-fail ((this task-manager)) + (if *debug-segment* + (format #t "task failed: ran out of time~%") + ) + (go (method-of-object this fail) (on-fail this 'fail)) + 0 + ) + +(defmethod hud-timer-handler ((this task-manager)) + (when (nonzero? (-> this start-time)) + (let ((v1-3 (handle->process (-> this hud-timer)))) + (if (and *target* (not v1-3)) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to *target*)) + ) + ) + ) + (let ((v1-13 (- (-> this time-limit) (- (current-time) (-> this start-time))))) + (let ((a0-15 *game-info*)) + (set! (-> a0-15 timer) v1-13) + (set! (-> a0-15 timer-flash) (< v1-13 (seconds 10))) + ) + (when (< v1-13 0) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (go-fail this) + ) + ) + ) + 0 + (none) + ) + +(defmethod init! ((this task-manager)) + (set! (-> this info) (-> this node-info manager)) + (countdown (v1-2 4) + (set! (-> this hud v1-2) (the-as handle #f)) + ) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this player-vehicle) (the-as handle #f)) + (set! (-> this fail-now) #f) + (set! (-> this restart-now) #f) + (set! (-> this allow-fail) #t) + 0 + (none) + ) + +(defmethod set-time-limit ((this task-manager)) + (when (logtest? (-> this info mask) (task-manager-mask time-limit)) + (set-time! (-> this start-time)) + (set! (-> this time-limit) (the-as time-frame (-> this info time-limit))) + ) + 0 + (none) + ) + +(defmethod deactivate ((this task-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (with-pp + (let ((s5-0 pp)) + (set! pp this) + (task-manager-method-25 this) + (set! pp s5-0) + ) + (countdown (s5-1 4) + (send-event (handle->process (-> this hud s5-1)) 'hide-and-die) + ) + ((method-of-type process deactivate) this) + (none) + ) + ) + +(defbehavior task-manager-event-handler task-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (taskman-event-handler self arg0 arg1 arg2 arg3) + ) + +(defmethod taskman-event-handler ((this task-manager) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-2 object)) + (case arg2 + (('fail) + (let ((s4-0 (on-fail this 'fail)) + (v1-2 (if (>= arg1 1) + (-> arg3 param 0) + ) + ) + ) + (if (and (not (and (-> this next-state) (let ((a0-7 (-> this next-state name))) + (or (= a0-7 'complete) (= a0-7 'resolution) (= a0-7 'fail) (= a0-7 'retry)) + ) + ) + ) + (or (not v1-2) s4-0) + (not (scene-select?)) + ) + (go (method-of-object this fail) s4-0) + ) + ) + ) + (('restart) + (let ((a0-12 (on-fail this 'restart))) + (if (and (not (and (-> this next-state) (let ((v1-11 (-> this next-state name))) + (or (= v1-11 'complete) (= v1-11 'fail) (= v1-11 'restart)) + ) + ) + ) + a0-12 + ) + (go (method-of-object this restart) (the-as symbol a0-12)) + ) + ) + ) + (('restart-immediately) + (let ((a0-16 (on-fail this 'restart))) + (when (and (or (not (and (-> this next-state) (let ((v1-19 (-> this next-state name))) + (or (= v1-19 'complete) (= v1-19 'resolution) (= v1-19 'fail) (= v1-19 'restart)) + ) + ) + ) + (not (-> this allow-fail)) + ) + a0-16 + ) + (set! (-> this restart-now) #t) + (go (method-of-object this restart) (the-as symbol a0-16)) + ) + ) + ) + (('quit) + (let ((a0-20 (on-fail this 'quit))) + (if (and (not (and (-> this next-state) (let ((v1-30 (-> this next-state name))) + (or (= v1-30 'complete) (= v1-30 'resolution) (= v1-30 'fail) (= v1-30 'restart)) + ) + ) + ) + a0-20 + ) + (go (method-of-object this restart) (the-as symbol a0-20)) + ) + ) + ) + (('complete) + (if (or (not (and (-> this next-state) (let ((v1-37 (-> this next-state name))) + (or (= v1-37 'complete) (= v1-37 'resolution) (= v1-37 'fail) (= v1-37 'restart)) + ) + ) + ) + (not (-> this allow-fail)) + ) + (go (method-of-object this complete)) + ) + ) + (('wait) + (go (method-of-object this wait)) + ) + (('active) + (go (method-of-object this active)) + ) + (('fail-on-death) + (set! v0-2 (-> arg3 param 0)) + (set! (-> this fail-on-death?) (the-as symbol v0-2)) + v0-2 + ) + (('target) + (case (-> arg3 param 0) + (('die) + (let ((a0-37 (on-fail this 'death))) + (when a0-37 + (if (not (and (-> this next-state) + (let ((v1-51 (-> this next-state name))) + (or (= v1-51 'wait) (= v1-51 'complete) (= v1-51 'resolution) (= v1-51 'fail) (= v1-51 'restart)) + ) + ) + ) + (go (method-of-object this fail) a0-37) + ) + (if (not (and (-> this next-state) (let ((v1-59 (-> this next-state name))) + (or (= v1-59 'wait) (= v1-59 'complete) (= v1-59 'resolution)) + ) + ) + ) + 'wait + ) + ) + ) + ) + ) + ) + (('fail-continue) + (let ((v1-61 (on-fail this 'fail))) + (when v1-61 + (case (-> v1-61 message) + (((resetter-message mission-retry)) + (-> v1-61 retry) + ) + (else + (-> v1-61 fail) + ) + ) + ) + ) + ) + (('fail-immediately) + (when (or (not (and (-> this next-state) (let ((v1-65 (-> this next-state name))) + (or (= v1-65 'complete) (= v1-65 'resolution) (= v1-65 'fail) (= v1-65 'restart)) + ) + ) + ) + (not (-> this allow-fail)) + ) + (set! (-> this allow-fail) #t) + (set! (-> this fail-now) #t) + (go (method-of-object this fail) (on-fail this 'fail)) + ) + ) + (('allow-fail) + (set! v0-2 (-> arg3 param 0)) + (set! (-> this allow-fail) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + +(defmethod ready? ((this task-manager)) + (and (or (not (logtest? (game-task-node-flag city-wait) (-> this node-info flags))) + (let ((a0-4 (level-get-target-inside *level*))) + (cond + ((not (and a0-4 (logtest? (-> a0-4 info level-flags) (level-flags lf0)))) + (set-time! (-> this intro-time)) + #f + ) + (else + #t + ) + ) + ) + ) + (or (zero? (-> this info intro-delay)) + (time-elapsed? (-> this intro-time) (the-as time-frame (-> this info intro-delay))) + ) + (and *target* (not (logtest? (focus-status dead teleporting) (-> *target* focus-status)))) + (not (-> *setting-control* user-current talking)) + ) + ) + +(defstate wait (task-manager) + :virtual #t + :event task-manager-event-handler + :trans (behavior () + (if (or (and (nonzero? (-> self info final-node)) (task-node-closed? (-> self info final-node))) + (and (not (logtest? (-> self node-info flags) (game-task-node-flag closed))) + (not (game-task-node-info-method-12 (-> self node-info))) + ) + ) + (deactivate self) + ) + ) + :code (behavior () + (local-vars (v1-18 symbol)) + (while (or (not *target*) (not *spawn-actors*)) + (suspend) + ) + (when (or (logtest? (game-task-node-flag intro-wait city-wait) (-> self node-info flags)) + (nonzero? (-> self info intro-delay)) + ) + (while (not (ready? self)) + (suspend) + ) + (let ((a0-5 (-> self info intro-scene))) + (when a0-5 + (let ((gp-1 (talker-spawn-func + (string->talker-speech (the-as string a0-5)) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + ) + ) + (get-status *gui-control* gp-1) + (until v1-18 + (suspend) + (let ((v1-17 (get-status *gui-control* gp-1))) + (set! v1-18 (or (= v1-17 (gui-status stop)) (= v1-17 (gui-status unknown)))) + ) + ) + ) + ) + ) + (if (logtest? (-> self node-info flags) (game-task-node-flag intro-wait)) + (open! (-> self node-info) 'event) + ) + ) + (set-time-limit self) + (if (logtest? (-> self info mask) (task-manager-mask auto-complete)) + (go-virtual complete) + ) + (go-virtual active) + ) + ) + +(defstate active (task-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + ((-> (method-of-object self wait) trans)) + (if (logtest? (-> self info mask) (task-manager-mask time-limit)) + (hud-timer-handler self) + ) + (if (and *debug-segment* (not *editable*)) + (format *stdebug* "task-manager ~A alive~%" (-> self node-info name)) + ) + (task-manager-method-26 self) + ) + :code sleep-code + ) + +(defstate complete (task-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-setting! 'allow-progress #f 0.0 0) + ) + :code (behavior () + (if (get-resetter *resetter-control*) + (sleep-code) + ) + (send-event (handle->process (-> self arrow)) 'die) + (countdown (gp-0 4) + (send-event (handle->process (-> self hud gp-0)) 'hide-and-die) + ) + (let ((gp-1 (-> self child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'notify 'die) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (when (not (logtest? (game-task-node-flag no-hud-wait) (-> self node-info flags))) + (let ((gp-2 (current-time))) + (label cfg-28) + (when (not (time-elapsed? gp-2 (seconds 5))) + (when (handle->process (-> self arrow)) + (suspend) + (goto cfg-28) + ) + (countdown (v1-42 4) + (when (handle->process (-> self hud v1-42)) + (suspend) + (goto cfg-28) + ) + ) + ) + ) + ) + (go-virtual resolution) + ) + ) + +(defstate resolution (task-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-27 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-27 (or (handle->process (-> self arrow)) (begin + (countdown (v1-28 4) + (when (handle->process (-> self hud v1-28)) + (set! v1-27 #t) + (goto cfg-39) + ) + ) + #f + ) + ) + ) + (label cfg-39) + v1-27 + ) + (suspend) + ) + ) + ) + +(defstate fail (task-manager) + :virtual #t + :event task-manager-event-handler + :exit (behavior () + (disable *screen-filter*) + ) + :code (behavior ((arg0 resetter-params)) + (while (not (-> self allow-fail)) + (suspend) + ) + (send-event (handle->process (-> self arrow)) 'die) + (countdown (s5-0 4) + (send-event (handle->process (-> self hud s5-0)) 'hide-and-die) + ) + (task-manager-method-28 self) + (let ((s5-1 (-> self info on-fail))) + (if s5-1 + (script-eval s5-1) + ) + ) + (when arg0 + (spawn-resetter! *resetter-control* arg0 (-> self node-info)) + (while (get-resetter *resetter-control*) + (suspend) + ) + ) + ) + ) + +(defstate restart (task-manager) + :virtual #t + :event task-manager-event-handler + :exit (-> (method-of-type task-manager fail) exit) + :code (behavior ((arg0 symbol)) + (send-event (handle->process (-> self arrow)) 'die) + (countdown (s5-0 4) + (send-event (handle->process (-> self hud s5-0)) 'hide-and-die) + ) + (task-manager-method-28 self) + (let ((s5-1 (-> self info on-fail))) + (if s5-1 + (script-eval s5-1) + ) + ) + (cond + (arg0 + (spawn-resetter! *resetter-control* (the-as resetter-params arg0) (-> self node-info)) + (while (get-resetter *resetter-control*) + (suspend) + ) + ) + (else + (initialize! *game-info* 'try (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + ) + ) diff --git a/goal_src/jak3/engine/geometry/path-h.gc b/goal_src/jak3/engine/geometry/path-h.gc index dc26946d37..e1f8705c17 100644 --- a/goal_src/jak3/engine/geometry/path-h.gc +++ b/goal_src/jak3/engine/geometry/path-h.gc @@ -51,7 +51,7 @@ These path-controls are typically allocated on a process heap." (path-control-method-25 (_type_ vector) float) (path-control-method-26 (_type_ float float) float) (path-control-method-27 (_type_ vector) vector) - (path-control-method-28 (_type_ vector float float) float) + (path-control-method-28 (_type_ vector vector symbol) float) (path-control-method-29 (_type_ vector int float) float) (should-display-marks? (_type_) symbol) (displacement-between-two-points! (_type_ vector float float) vector) diff --git a/goal_src/jak3/engine/geometry/path.gc b/goal_src/jak3/engine/geometry/path.gc index fcc8077279..a62afb8a15 100644 --- a/goal_src/jak3/engine/geometry/path.gc +++ b/goal_src/jak3/engine/geometry/path.gc @@ -336,7 +336,7 @@ ) ) -(defmethod path-control-method-28 ((this path-control) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod path-control-method-28 ((this path-control) (arg0 vector) (arg1 vector) (arg2 symbol)) (local-vars (sv-96 vector) (sv-100 vector) @@ -364,7 +364,7 @@ (set! sv-112 (vector-vector-distance-squared sv-108 arg0)) ) (let ((s3-1 (new 'stack-no-clear 'vector))) - (vector+! s3-1 arg0 (the-as vector arg1)) + (vector+! s3-1 arg0 arg1) (dotimes (s2-0 (+ (-> this curve num-cverts) -1)) (get-point-in-path! this sv-100 (the float (+ s2-0 1)) 'interp) (vector-! sv-104 sv-100 sv-96) @@ -373,12 +373,12 @@ (let ((s1-0 (new 'stack-no-clear 'vector))) (set! (-> s1-0 x) -1.0) (set! (-> s1-0 y) -1.0) - (line-line-find-intersection-xz arg0 (the-as vector arg1) sv-96 sv-104 s1-0) + (line-line-find-intersection-xz arg0 arg1 sv-96 sv-104 s1-0) (when (>= (-> s1-0 x) 0.0) (if (and (< 0.0 (-> s1-0 y)) (>= 1.0 (-> s1-0 y))) (set! s0-0 #t) ) - (vector+float*! sv-116 arg0 (the-as vector arg1) (-> s1-0 x)) + (vector+float*! sv-116 arg0 arg1 (-> s1-0 x)) (cond ((and s0-0 (not sv-120)) (set! (-> sv-108 quad) (-> sv-116 quad)) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc index 0c8008fb58..ff78260ab9 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc @@ -33,7 +33,8 @@ (deftype hfrag-packed-index (uint16) - () + ((bit11 uint8 :offset 11 :size 5) + ) ) (deftype hfrag-vertex (structure) @@ -243,8 +244,8 @@ (buckets-far uint32) (buckets-mid uint32) (buckets-near uint32) - (verts uint32) - (pat-array uint32) + (verts (inline-array hfrag-vertex)) + (pat-array (pointer pat-surface)) (pat-length uint16) (num-buckets-far uint16) (num-buckets-mid uint16) @@ -254,9 +255,9 @@ (:methods (hfragment-method-17 (_type_ collide-cache collide-query) none) (hfragment-method-18 (_type_ collide-cache collide-query) none) - (hfragment-method-19 () none) - (hfragment-method-20 () none) - (hfragment-method-21 () none) + (hfragment-method-19 (_type_ collide-cache collide-query int int int int) none) + (hfragment-method-20 (_type_ collide-cache int int uint uint uint pat-surface) none) + (hfragment-method-21 (_type_ collide-cache int int uint uint uint pat-surface) none) ) ) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc index 76632c541e..9b18f00f5c 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc @@ -7,3 +7,342 @@ ;; DECOMP BEGINS +(defmethod hfragment-method-20 ((this hfragment) + (arg0 collide-cache) + (arg1 int) + (arg2 int) + (arg3 uint) + (arg4 uint) + (arg5 uint) + (arg6 pat-surface) + ) + (let ((v1-0 (-> arg0 num-tris))) + (cond + ((>= v1-0 460) + (if (= *cheat-mode* 'debug) + (print-exceeded-max-cache-tris) + ) + ) + (else + (let ((v1-6 (-> arg0 tris v1-0))) + (let ((f0-2 (+ (* 32768.0 (the float arg1)) (-> this start-corner x))) + (f1-5 (+ (* 32768.0 (the float arg2)) (-> this start-corner z))) + ) + (set-vector! (-> v1-6 vertex 2) f0-2 (the float (* arg3 8)) f1-5 1.0) + (set-vector! (-> v1-6 vertex 1) (+ 32768.0 f0-2) (the float (* arg4 8)) f1-5 1.0) + (set-vector! (-> v1-6 vertex 0) f0-2 (the float (* arg5 8)) (+ 32768.0 f1-5) 1.0) + ) + (set! (-> v1-6 clear-flags) (the-as uint128 0)) + (set! (-> v1-6 pat) arg6) + (set! (-> v1-6 collide-ptr) #f) + ) + (+! (-> arg0 num-tris) 1) + ) + ) + ) + 0 + (none) + ) + +(defmethod hfragment-method-21 ((this hfragment) + (arg0 collide-cache) + (arg1 int) + (arg2 int) + (arg3 uint) + (arg4 uint) + (arg5 uint) + (arg6 pat-surface) + ) + (let ((v1-0 (-> arg0 num-tris))) + (cond + ((>= v1-0 460) + (if (= *cheat-mode* 'debug) + (print-exceeded-max-cache-tris) + ) + ) + (else + (let ((v1-6 (-> arg0 tris v1-0))) + (let ((f0-2 (+ (* 32768.0 (the float arg1)) (-> this start-corner x))) + (f1-5 (+ (* 32768.0 (the float arg2)) (-> this start-corner z))) + ) + (set-vector! (-> v1-6 vertex 2) f0-2 (the float (* arg4 8)) (+ 32768.0 f1-5) 1.0) + (set-vector! (-> v1-6 vertex 1) (+ 32768.0 f0-2) (the float (* arg3 8)) f1-5 1.0) + (set-vector! (-> v1-6 vertex 0) (+ 32768.0 f0-2) (the float (* arg5 8)) (+ 32768.0 f1-5) 1.0) + ) + (set! (-> v1-6 clear-flags) (the-as uint128 0)) + (set! (-> v1-6 pat) arg6) + (set! (-> v1-6 collide-ptr) #f) + ) + (+! (-> arg0 num-tris) 1) + ) + ) + ) + 0 + (none) + ) + +(defmethod hfragment-method-19 ((this hfragment) (arg0 collide-cache) (arg1 collide-query) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) + (local-vars + (sv-16 uint) + (sv-24 uint) + (sv-32 uint) + (sv-40 uint) + (sv-48 int) + (sv-56 int) + (sv-64 int) + (sv-72 int) + ) + (let ((v1-0 (-> this verts)) + (a0-2 (+ (* arg3 512) arg2)) + (s2-0 (-> this pat-array 0)) + ) + (when (not (logtest? (-> arg1 ignore-pat) s2-0)) + (when (nonzero? (-> (the-as hfrag-vertex (+ (* a0-2 4) (the-as int v1-0))) packed-index bit11)) + (set! sv-16 (-> (the-as (pointer uint16) (+ (* a0-2 4) (the-as int v1-0))))) + (set! sv-24 (-> (the-as (pointer uint16) (+ (* (+ a0-2 1) 4) (the-as int v1-0))))) + (set! sv-32 (-> (the-as (pointer uint16) (+ (* (+ a0-2 512) 4) (the-as int v1-0))))) + (set! sv-40 (-> (the-as (pointer uint16) (+ (* (+ a0-2 513) 4) (the-as int v1-0))))) + (set! sv-48 0) + (set! sv-56 0) + (set! sv-64 0) + (set! sv-72 0) + (if (< (the-as int sv-16) arg4) + (set! sv-48 1) + ) + (if (< arg5 (the-as int sv-16)) + (set! sv-48 (logior sv-48 2)) + ) + (if (< (the-as int sv-24) arg4) + (set! sv-56 1) + ) + (if (< arg5 (the-as int sv-24)) + (set! sv-56 (logior sv-56 2)) + ) + (if (< (the-as int sv-32) arg4) + (set! sv-64 1) + ) + (if (< arg5 (the-as int sv-32)) + (set! sv-64 (logior sv-64 2)) + ) + (if (< (the-as int sv-40) arg4) + (set! sv-72 1) + ) + (if (< arg5 (the-as int sv-40)) + (set! sv-72 (logior sv-72 2)) + ) + (if (not (logtest? (logand sv-48 sv-56) sv-64)) + (hfragment-method-20 this arg0 arg2 arg3 sv-16 sv-24 sv-32 s2-0) + ) + (if (not (logtest? (logand sv-56 sv-64) sv-72)) + (hfragment-method-21 this arg0 arg2 arg3 sv-24 sv-32 sv-40 s2-0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod hfragment-method-17 ((this hfragment) (arg0 collide-cache) (arg1 collide-query)) + (local-vars (sv-16 int) (sv-24 int) (sv-32 int) (sv-40 int) (sv-48 int) (sv-56 int)) + (set! sv-16 (the int (* 0.000030517578 (- (-> arg1 bbox min x) (-> this start-corner x))))) + (set! sv-24 (the int (* 0.000030517578 (- (-> arg1 bbox min z) (-> this start-corner z))))) + (set! sv-32 (the int (* 0.000030517578 (- (-> arg1 bbox max x) (-> this start-corner x))))) + (set! sv-40 (the int (* 0.000030517578 (- (-> arg1 bbox max z) (-> this start-corner z))))) + (set! sv-48 (the int (* 0.125 (-> arg1 bbox min y)))) + (set! sv-56 (the int (* 0.125 (-> arg1 bbox max y)))) + (set! sv-16 (max 0 (min 511 sv-16))) + (set! sv-32 (max 0 (min 511 sv-32))) + (set! sv-24 (max 0 (min 511 sv-24))) + (set! sv-40 (max 0 (min 511 sv-40))) + (let ((s3-0 sv-24) + (s2-0 sv-40) + ) + (while (>= s2-0 s3-0) + (let ((s1-0 sv-16) + (s0-0 sv-32) + ) + (while (>= s0-0 s1-0) + (hfragment-method-19 this arg0 arg1 s1-0 s3-0 sv-48 sv-56) + (+! s1-0 1) + ) + ) + (+! s3-0 1) + ) + ) + 0 + (none) + ) + +(defmethod hfragment-method-18 ((this hfragment) (arg0 collide-cache) (arg1 collide-query)) + (local-vars + (v1-30 int) + (v1-31 int) + (v1-57 int) + (v1-58 int) + (a0-16 int) + (a0-17 int) + (a0-35 int) + (a0-36 int) + (s3-0 int) + (s3-2 int) + (sv-64 vector) + (sv-68 vector) + (sv-72 vector) + (sv-76 float) + (sv-80 float) + (sv-128 int) + (sv-144 int) + (sv-160 int) + (sv-176 int) + (sv-192 int) + (sv-208 int) + ) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! sv-68 (new 'stack-no-clear 'vector)) + (set! sv-72 (new 'stack-no-clear 'vector)) + (set! sv-76 (the-as float 0.000030517578)) + (set! sv-80 (* 0.000030517578 (-> arg1 radius))) + (vector-! sv-64 (-> arg1 start-pos) (-> this start-corner)) + (vector-float*! sv-64 sv-64 sv-76) + (vector-float*! sv-72 (-> arg1 move-dist) sv-76) + (vector+! sv-68 sv-64 sv-72) + (cond + ((< (fabs (-> sv-72 z)) (fabs (-> sv-72 x))) + (when (< (-> sv-72 x) 0.0) + (let ((v1-15 (new 'stack-no-clear 'vector))) + (set! (-> v1-15 quad) (-> sv-64 quad)) + (set! (-> sv-64 quad) (-> sv-68 quad)) + (set! (-> sv-68 quad) (-> v1-15 quad)) + ) + (vector-negate! sv-72 sv-72) + ) + (let* ((a0-9 (the int (- (-> sv-64 x) sv-80))) + (v1-20 (the int (+ (-> sv-68 x) sv-80))) + (f0-15 (fmax 1.0 (the float (- v1-20 a0-9)))) + (f30-0 (/ (-> sv-72 y) f0-15)) + (f28-0 (/ (-> sv-72 z) f0-15)) + (f26-0 (+ sv-80 (* 0.5 (fabs f30-0)))) + (f24-0 (+ sv-80 (* 0.5 (fabs f28-0)))) + ) + (cond + ((< a0-9 0) + (+! (-> sv-64 y) (* f30-0 (- (the float a0-9)))) + (+! (-> sv-64 z) (* f28-0 (- (the float a0-9)))) + (set! s3-0 0) + ) + (else + (set! s3-0 (min 511 a0-9)) + ) + ) + (let ((s2-1 (max 0 (min 511 v1-20))) + (s1-0 s3-0) + ) + (while (>= s2-1 s1-0) + (let* ((f0-23 (the float (- s1-0 s3-0))) + (f1-23 (+ (-> sv-64 y) (* f30-0 f0-23))) + (f0-25 (+ (-> sv-64 z) (* f28-0 f0-23))) + (s0-0 (the int (* 4096.0 (+ (- -0.5 f26-0) f1-23)))) + ) + (set! sv-128 (the int (* 4096.0 (+ 0.5 f26-0 f1-23)))) + (let ((a0-15 (the int (- f0-25 f24-0))) + (v1-29 (the int (+ f0-25 f24-0))) + ) + (set! sv-144 0) + (let ((a2-1 sv-144) + (a1-21 (min 511 a0-15)) + ) + (set-on-less-than a0-16 a2-1 a1-21) + (move-if-not-zero a0-17 a1-21 a0-16 a0-16) + ) + (set! sv-144 a0-17) + (set! sv-160 0) + (let ((a1-22 sv-160) + (a0-20 (min 511 v1-29)) + ) + (set-on-less-than v1-30 a1-22 a0-20) + (move-if-not-zero v1-31 a0-20 v1-30 v1-30) + ) + ) + (set! sv-160 v1-31) + (while (>= sv-160 sv-144) + (hfragment-method-19 this arg0 arg1 s1-0 sv-144 s0-0 sv-128) + (set! sv-144 (+ sv-144 1)) + ) + ) + (+! s1-0 1) + ) + ) + ) + ) + (else + (when (< (-> sv-72 z) 0.0) + (let ((v1-42 (new 'stack-no-clear 'vector))) + (set! (-> v1-42 quad) (-> sv-64 quad)) + (set! (-> sv-64 quad) (-> sv-68 quad)) + (set! (-> sv-68 quad) (-> v1-42 quad)) + ) + (vector-negate! sv-72 sv-72) + ) + (let* ((a0-27 (the int (- (-> sv-64 z) sv-80))) + (v1-47 (the int (+ (-> sv-68 z) sv-80))) + (f0-36 (fmax 1.0 (the float (- v1-47 a0-27)))) + (f30-1 (/ (-> sv-72 y) f0-36)) + (f28-1 (/ (-> sv-72 x) f0-36)) + (f26-1 (+ sv-80 (* 0.5 (fabs f30-1)))) + (f24-1 (+ sv-80 (* 0.5 (fabs f28-1)))) + ) + (cond + ((< a0-27 0) + (+! (-> sv-64 y) (* f30-1 (the float (- a0-27)))) + (+! (-> sv-64 x) (* f28-1 (the float (- a0-27)))) + (set! s3-2 0) + ) + (else + (set! s3-2 (min 511 a0-27)) + ) + ) + (let ((s2-3 (max 0 (min 511 v1-47))) + (s1-1 s3-2) + ) + (while (>= s2-3 s1-1) + (let* ((f0-44 (the float (- s1-1 s3-2))) + (f1-47 (+ (-> sv-64 y) (* f30-1 f0-44))) + (f0-46 (+ (-> sv-64 x) (* f28-1 f0-44))) + (s0-1 (the int (* 4096.0 (+ (- -0.5 f26-1) f1-47)))) + ) + (set! sv-176 (the int (* 4096.0 (+ 0.5 f26-1 f1-47)))) + (let ((a0-34 (the int (- f0-46 f24-1))) + (v1-56 (the int (+ f0-46 f24-1))) + ) + (set! sv-192 0) + (let ((a2-3 sv-192) + (a1-41 (min 511 a0-34)) + ) + (set-on-less-than a0-35 a2-3 a1-41) + (move-if-not-zero a0-36 a1-41 a0-35 a0-35) + ) + (set! sv-192 a0-36) + (set! sv-208 0) + (let ((a1-42 sv-208) + (a0-39 (min 511 v1-56)) + ) + (set-on-less-than v1-57 a1-42 a0-39) + (move-if-not-zero v1-58 a0-39 v1-57 v1-57) + ) + ) + (set! sv-208 v1-58) + (while (>= sv-208 sv-192) + (hfragment-method-19 this arg0 arg1 sv-192 s1-1 s0-1 sv-176) + (set! sv-192 (+ sv-192 1)) + ) + ) + (+! s1-1 1) + ) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/gfx/blit-displays.gc b/goal_src/jak3/engine/gfx/blit-displays.gc index 630bf633f9..6919cc8ce0 100644 --- a/goal_src/jak3/engine/gfx/blit-displays.gc +++ b/goal_src/jak3/engine/gfx/blit-displays.gc @@ -90,5 +90,9 @@ (none) ) +(defmethod blit-displays-work-method-17 ((this blit-displays-work) (arg0 vector) (arg1 int) (arg2 float) (arg3 symbol)) + (none) + ) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/gfx/foreground/foreground.gc b/goal_src/jak3/engine/gfx/foreground/foreground.gc index f2d64d5a70..f113277e71 100644 --- a/goal_src/jak3/engine/gfx/foreground/foreground.gc +++ b/goal_src/jak3/engine/gfx/foreground/foreground.gc @@ -1541,11 +1541,14 @@ " (when (or (not (-> pd skel)) (zero? (-> pd skel)) + ;; types such as debris-group are not actually proper process-drawables and + ;; don't have a joint-control. + (symbol-member? (-> pd type symbol) '(debris-group)) ) (return #f) ) - ;; grab the currently playing animatoin + ;; grab the currently playing animation (let* ((jc-channel (-> pd skel root-channel 0)) (anim (-> jc-channel frame-group)) (got-weights #f) @@ -1637,8 +1640,6 @@ ) ) -(define *use-fp-blerc* #f) - (defun pc-merc-draw-request ((dc draw-control) (dma-buf pointer) (matrix-buf pointer) (tex-idx int) (update-verts symbol) (blercs (pointer float))) "Send a request to PC Merc2 to draw the given object. Only draws the effects which match this texture index. diff --git a/goal_src/jak3/engine/gfx/foreground/merc/merc-blend-shape.gc b/goal_src/jak3/engine/gfx/foreground/merc/merc-blend-shape.gc index 8040b5aba9..9059272778 100644 --- a/goal_src/jak3/engine/gfx/foreground/merc/merc-blend-shape.gc +++ b/goal_src/jak3/engine/gfx/foreground/merc/merc-blend-shape.gc @@ -5,8 +5,314 @@ ;; name in dgo: merc-blend-shape ;; dgos: GAME -(define-extern blerc-init (function none)) -(define-extern blerc-execute (function none)) +(define-extern setup-blerc-chains (function merc-ctrl (pointer int16) dma-buffer none)) + +;; when true, uses the PC float blerc implementation. +(define *use-fp-blerc* #t) + +(defun process-drawable-might-need-blerc? ((pd process-drawable)) + "Annoyingly, some warp object have blend shape anims, like the hiphog mirror. + These are never drawn with PC-merc (it doesn't support warp), so we still + need to the PS2-style blerc for generic. This function sees if this process-drawable + might be warp." + (let ((draw (-> pd draw))) + (if (or (zero? draw) (not draw)) + (return #f) + ) + (let ((geo (-> draw mgeo))) + (if (or (zero? geo) (not geo)) + (return #f) + ) + + (dotimes (effect-idx (-> geo header effect-count)) + (when (= (-> geo effect effect-idx texture-index) (tpage-category warp)) + (return #t) + ) + ) + ) + ) + + #f + ) ;; DECOMP BEGINS +(define *stats-blerc* #f) + +(deftype blerc-block-header (structure) + ((tag generic-merc-tag :inline) + (vtx-count uint32) + (overlap uint32) + (lump-dest uint32) + (lump-qwc uint32) + ) + ) + + +(deftype blerc-block (structure) + ((output uint8 848) + (header blerc-block-header :inline) + ) + ) + + +(deftype blerc-dcache (structure) + ((repl-mult vector 40 :inline) + ) + ) + + +(deftype blerc-globals (structure) + ((first uint32) + (next uint32) + (min-val int16) + (max-val int16) + (fragment-count int32) + (vtx-count int32) + (target-vtx-count int32) + ) + ) + + +(define *blerc-globals* (new 'global 'blerc-globals)) + +(deftype blerc-context (structure) + ((block-a blerc-block :inline) + (dummy uint8 7312) + (block-b blerc-block :inline) + ) + ) + + +(defun-debug blerc-stats-init () + (when *stats-blerc* + (when (nonzero? (-> *blerc-globals* fragment-count)) + (format *stdcon* "~%BLERC (merc blend target) STATS~%") + (format + *stdcon* + " ~D fragments, ~D vertices~%" + (-> *blerc-globals* fragment-count) + (-> *blerc-globals* vtx-count) + ) + (format + *stdcon* + " ~D blend target computations (~F average)~%" + (-> *blerc-globals* target-vtx-count) + (/ (the float (-> *blerc-globals* target-vtx-count)) (the float (-> *blerc-globals* vtx-count))) + ) + (if (< (-> *blerc-globals* min-val) 0) + (format *stdcon* "MINIMUM OUT OF RANGE: ~D~%" (-> *blerc-globals* min-val)) + ) + (if (< 255 (-> *blerc-globals* max-val)) + (format *stdcon* "MAXIMUM OUT OF RANGE: ~D~%" (-> *blerc-globals* max-val)) + ) + ) + (let ((a0-7 *blerc-globals*)) + (set! (-> a0-7 min-val) 255) + (set! (-> a0-7 max-val) 0) + (set! (-> a0-7 fragment-count) 0) + (set! (-> a0-7 vtx-count) 0) + (set! (-> a0-7 target-vtx-count) 0) + ) + ) + 0 + (none) + ) + +(defun blerc-init () + (blerc-stats-init) + (let ((v1-0 *blerc-globals*)) + (set! (-> v1-0 first) (the-as uint 0)) + (set! (-> v1-0 next) (the-as uint 0)) + ) + 0 + (none) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; ERROR: function has no type analysis. Cannot decompile. + +;; ERROR: function has no type analysis. Cannot decompile. + +(def-mips2c blerc-execute (function none)) + +;; WARN: Return type mismatch int vs object. +(defun merc-blend-shape ((arg0 process-drawable)) + (with-profiler 'merc *profile-merc-color* + (let* ((v1-1 (-> arg0 skel float-channels)) + (a2-0 (cond + ((> v1-1 0) + (-> arg0 skel channel (+ v1-1 -1 (-> arg0 skel active-channels))) + ) + (else + (let ((v1-7 (-> arg0 skel root-channel)) + (a0-5 (-> arg0 skel effect)) + ) + (-> v1-7 (if a0-5 + (-> a0-5 channel-offset) + 0 + ) + ) + ) + ) + ) + ) + (a3-0 (-> a2-0 frame-group)) + (a1-0 (new 'stack-no-clear 'array 'int16 128)) + (disable-blerc? (and *use-fp-blerc* (not (process-drawable-might-need-blerc? arg0)))) + ) + (when (and a3-0 (and (> (-> arg0 skel active-channels) 0) + (zero? (-> arg0 draw cur-lod)) + (logtest? (-> arg0 skel status) (joint-control-status blend-shape)) + ) + ) + (cond + ((and (-> arg0 skel override) (!= (-> arg0 skel override 0) 0.0)) + (let* ((a0-12 (-> arg0 draw mgeo)) + (v1-20 (-> a0-12 header blend-target-count)) + (a2-2 (-> arg0 skel override)) + ) + (when (nonzero? v1-20) + (dotimes (a3-1 (the-as int v1-20)) + (set! (-> a1-0 a3-1) (the int (* 8192.0 (-> a2-2 (+ a3-1 1))))) + ) + (when (not disable-blerc?) + (setup-blerc-chains a0-12 a1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + ) + (logior! (-> arg0 skel status) (joint-control-status blend-shape-valid)) + ;; og:preserve-this changed so we don't skip the profiler bar end + ; (return (the-as object #f)) + (goto end) + ) + ) + ) + (else + (let ((t2-0 (-> a3-0 blend-shape-anim))) + (when t2-0 + (let ((a0-14 (-> arg0 draw mgeo))) + (let* ((v1-33 (-> a0-14 header blend-target-count)) + (t0-8 (-> a2-0 frame-num)) + (t1-2 (the int t0-8)) + (a2-6 (&+ t2-0 (* (the-as uint t1-2) v1-33))) + ) + (cond + ((< t1-2 (the-as int (+ (-> a3-0 frames num-frames) -1))) + (let* ((a3-6 (&+ a2-6 v1-33)) + (t0-9 (* 64.0 (- t0-8 (the float t1-2)))) + (t1-4 (- 64.0 t0-9)) + ) + (dotimes (t2-2 (the-as int v1-33)) + (set! (-> a1-0 t2-2) (the int (+ 0.5 + (* (the float (+ (-> (the-as (pointer uint8) (&+ a3-6 t2-2))) -64)) t0-9) + (* (the float (+ (-> (the-as (pointer uint8) (&+ a2-6 t2-2))) -64)) t1-4) + ) + ) + ) + ) + ) + ) + (else + (dotimes (a3-7 (the-as int v1-33)) + (set! (-> a1-0 a3-7) (the-as int (* (+ (-> (the-as (pointer uint8) (&+ a2-6 a3-7))) -64) 64))) + ) + ) + ) + ) + (when (not disable-blerc?) + (setup-blerc-chains a0-14 a1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + ) + ) + (logior! (-> arg0 skel status) (joint-control-status blend-shape-valid)) + ;; og:preserve-this changed so we don't skip the profiler bar end + ;; (return (the-as object #f)) + (goto end) + ) + ) + ) + ) + ) + (when (logtest? (-> arg0 skel status) (joint-control-status blend-shape-valid)) + (logclear! (-> arg0 skel status) (joint-control-status blend-shape-valid)) + (when (not disable-blerc?) + (setup-blerc-chains + (-> arg0 draw lod-set lod 0 geo) + (new 'static 'array int16 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + (-> *display* frames (-> *display* on-screen) global-buf) + ) + ) + ) + ) + (label end) + ) + 0 + ) + +(def-mips2c setup-blerc-chains-for-one-fragment (function object object object object object object object)) + +(defun setup-blerc-chains ((arg0 merc-ctrl) (arg1 (pointer int16)) (arg2 dma-buffer)) + (local-vars + (sv-16 uint) + (sv-20 pointer) + (sv-24 merc-effect) + (sv-28 uint) + (sv-32 object) + (sv-48 int) + (sv-64 int) + ) + (set! sv-16 (-> arg0 header effect-count)) + (let ((s3-0 (-> arg0 header blend-target-count)) + (v1-1 (-> arg2 base)) + ) + (set! sv-20 (&+ v1-1 0)) + (let ((a2-1 (the-as object (&+ v1-1 16)))) + (if (zero? (-> *blerc-globals* first)) + (set! (-> *blerc-globals* first) (the-as uint a2-1)) + ) + (dotimes (s2-0 (the-as int sv-16)) + (set! sv-24 (-> arg0 effect s2-0)) + (set! sv-28 (-> sv-24 blend-frag-count)) + (when (nonzero? sv-28) + (let ((v1-15 (the-as object (-> sv-24 frag-geo))) + (s1-0 (the-as structure (-> sv-24 frag-ctrl))) + (s0-0 (the-as object (-> sv-24 blend-data))) + ) + (set! sv-32 (-> sv-24 blend-ctrl)) + (set! sv-48 0) + (while (< sv-48 (the-as int sv-28)) + (set! sv-64 (+ (the-as int v1-15) + (logand (* (+ (-> (the-as merc-fragment-control s1-0) unsigned-four-count) 3) 4) #xfff0) + ) + ) + (if (nonzero? (-> (the-as (pointer uint8) sv-32) 0)) + (set! a2-1 (setup-blerc-chains-for-one-fragment s3-0 arg1 a2-1 s0-0 sv-32 sv-64)) + ) + (let ((a0-14 (logand (+ (* (the-as uint 6) (-> (the-as merc-blend-ctrl sv-32) blend-vtx-count)) 15) #xfff0))) + (set! v1-15 + (+ sv-64 + (logand (* (+ (-> (the-as merc-fragment-control s1-0) lump-four-count) 3) 4) #xfff0) + (* (-> (the-as merc-fragment-control s1-0) fp-qwc) 16) + ) + ) + ;; og:preserve-this + (set! s1-0 (&+ s1-0 (* (-> (the-as merc-fragment-control s1-0) mat-xfer-count) 2) 4)) + (set! s0-0 + (+ (the-as int s0-0) (* (the-as uint a0-14) (+ (-> (the-as merc-blend-ctrl sv-32) nonzero-index-count) 1))) + ) + ) + (set! sv-32 (+ (the-as int sv-32) s3-0 2)) + (the-as int sv-32) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + (set! (-> (the-as (pointer int64) sv-20)) (logior #x20000000 (shr (shl (the-as int a2-1) 33) 1))) + (set! (-> (the-as (pointer uint32) sv-20) 2) (the-as uint 0)) + (set! (-> (the-as (pointer uint32) sv-20) 3) (the-as uint 0)) + (set! (-> arg2 base) (the-as pointer a2-1)) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/gfx/foreground/merc/merc-death.gc b/goal_src/jak3/engine/gfx/foreground/merc/merc-death.gc index 242dee627c..d78d10abbd 100644 --- a/goal_src/jak3/engine/gfx/foreground/merc/merc-death.gc +++ b/goal_src/jak3/engine/gfx/foreground/merc/merc-death.gc @@ -7,3 +7,145 @@ ;; DECOMP BEGINS +(define *merc-death-globals* (new 'global 'vector)) + +(defun birth-func-death-sparks () + 0 + (none) + ) + +(define death-seed + (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x34 :sound "temp-enemy-die") + ) + +(defun start-seed-effect ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (let ((v1-0 (-> arg0 draw)) + (a1-1 death-seed) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-1 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-1 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-1 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-1 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior process-drawable () (let ((v0-0 200)) + (set! (-> self draw death-timer) (the-as uint v0-0)) + (the-as time-frame v0-0) + ) + ) + ) + 0 + (none) + ) + +(defpart 52 + :init-specs ((:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 64.0 196.0) + (:g 196.0 64.0) + (:b 0.0) + (:a 4.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-texture-glow-soft) + ) + ) + +(define death-default + (new 'static 'death-info :vertex-skip #xa :timer #x4b :overlap #x4 :effect #x35 :sound "enemy-fizz") + ) + +(define death-warp-in + (new 'static 'death-info :vertex-skip #x96 :timer #x4b :effect #x36 :sound "warpgate-tele") + ) + +(define death-warp-out + (new 'static 'death-info :vertex-skip #x96 :timer #x96 :effect #x36 :sound "warpgate-tele") + ) + +(defun sparticle-texture-glow-soft ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (particle-adgif-callback (-> arg1 adgif) (new 'static 'texture-id :index #xf :page #x4)) + (set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0)) + 0 + (none) + ) + +(defpart 54 + :init-specs ((:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 64.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0 -1.28) + (:friction 0.92 0.02) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.1) (seconds 0.065)) + (:next-launcher 55) + ) + ) + +(defpart 55 + :init-specs ((:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:a 64.0 32.0) + (:omega (degrees 0.045) (degrees 0.03375)) + (:vel-x (meters -0.053333335) (meters 0.10666667)) + (:vel-y (meters -0.026666667) (meters 0.093333334)) + (:vel-z (meters -0.053333335) (meters 0.10666667)) + (:scalevel-x (meters -0.001) (meters -0.008)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:func 'sparticle-motion-blur) + ) + ) + +(defpart 53 + :init-specs ((:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 96.0 150.0) + (:g 32.0 64.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0 -1.28) + (:friction 0.92 0.02) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.1) (seconds 0.065)) + (:next-launcher 56) + ) + ) + +(defpart 56 + :init-specs ((:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:a 64.0 32.0) + (:omega (degrees 0.045) (degrees 0.03375)) + (:vel-x (meters -0.053333335) (meters 0.10666667)) + (:vel-y (meters -0.026666667) (meters 0.093333334)) + (:vel-z (meters -0.053333335) (meters 0.10666667)) + (:scalevel-x (meters -0.001) (meters -0.008)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:func 'sparticle-motion-blur) + ) + ) + +(defun merc-death-spawn ((arg0 int) (arg1 vector) (arg2 vector)) + (let ((v1-2 (-> *part-id-table* arg0))) + (if (and (nonzero? v1-2) (= (-> v1-2 type) sparticle-launcher)) + (sp-launch-particles-death *sp-particle-system-2d* v1-2 arg1) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/gfx/foreground/merc/merc-h.gc b/goal_src/jak3/engine/gfx/foreground/merc/merc-h.gc index e8b54c0f42..7d3325e051 100644 --- a/goal_src/jak3/engine/gfx/foreground/merc/merc-h.gc +++ b/goal_src/jak3/engine/gfx/foreground/merc/merc-h.gc @@ -408,6 +408,6 @@ Consists of a header and a list of [[merc-effect]]s." (timer uint8) (overlap uint8) (effect uint32) - (sound symbol) + (sound string) ) ) diff --git a/goal_src/jak3/engine/gfx/foreground/shadow-cpu.gc b/goal_src/jak3/engine/gfx/foreground/shadow-cpu.gc index 0e4f5408ab..a833defbe1 100644 --- a/goal_src/jak3/engine/gfx/foreground/shadow-cpu.gc +++ b/goal_src/jak3/engine/gfx/foreground/shadow-cpu.gc @@ -7,3 +7,8 @@ ;; DECOMP BEGINS +;; stub +(format 0 "shadow-cpu: stubbed shadow-control::14~%") +(defmethod shadow-control-method-14 ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) + (none) + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc index 40f024446e..696b5122e0 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc @@ -43,6 +43,10 @@ (declare-type lightning-spec basic) (define-extern *lightning-spec-id-table* (array lightning-spec)) +(define-extern lightning-fractal-gen (function (inline-array vector) int int float lightning-spec none)) +(define-extern lightning-uniform-gen (function (inline-array vector) int int float lightning-spec none)) +(define-extern lightning-trail-uniform-gen (function (inline-array vector) (inline-array vector) float int symbol)) +(define-extern lightning-trail-fractal-gen (function (inline-array vector) (inline-array vector) int int float lightning-spec none)) (define-extern process-drawable-art-error (state string process-drawable)) (define-extern unlink-lightning-spec-by-heap (function kheap none)) (define-extern lightning-draw-all (function none)) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc index ea38e67e7c..ee4001795f 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc @@ -100,20 +100,20 @@ (base-color rgba) ) (:methods - (lightning-bolt-method-9 (_type_ int int lightning-appearance) none) - (lightning-bolt-method-10 () none) + (init! (_type_ int int lightning-appearance) none) + (reset-spans! (_type_) none) (lightning-bolt-method-11 (_type_) none) (lightning-bolt-method-12 (_type_) none) (lightning-bolt-method-13 (_type_ int) none) (lightning-bolt-method-14 (_type_) int) - (lightning-bolt-method-15 () none) - (lightning-bolt-method-16 () none) - (lightning-bolt-method-17 () none) - (lightning-bolt-method-18 () none) - (lightning-bolt-method-19 () none) - (lightning-bolt-method-20 () none) - (lightning-bolt-method-21 () none) - (lightning-bolt-method-22 () none) + (lightning-bolt-method-15 (_type_ object int lightning-span-internal) none) + (lightning-bolt-method-16 (_type_ vector float float vector matrix) none) + (lightning-bolt-method-17 (_type_ uint float float curve2d-fast float) float) + (lightning-bolt-method-18 (_type_ prim-strip vector rgba float float) none) + (lightning-bolt-method-19 (_type_ vector int int matrix float float) none) + (lightning-bolt-method-20 (_type_ int lightning-span-internal) vector) + (lightning-bolt-method-21 (_type_ int int float) none) + (lightning-bolt-method-22 (_type_) none) ) ) @@ -123,9 +123,9 @@ (lifetime time-frame) (state-time time-frame) ) - (:methods - (lightning-new-tracker-method-14 () none) - (lightning-new-tracker-method-15 () none) + (:state-methods + active + die ) ) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc index c0d5fb79c4..3cf75556a4 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc @@ -7,3 +7,840 @@ ;; DECOMP BEGINS +(define *lightning-alpha-additive* (new 'static 'gs-alpha :b #x2 :d #x1)) + +(define *lightning-alpha-blend* (new 'static 'gs-alpha :b #x1 :d #x1)) + +(define *lightning-alpha-subtractive* (new 'static 'gs-alpha :a #x2 :d #x1)) + +(defmethod init! ((this lightning-bolt) (arg0 int) (arg1 int) (arg2 lightning-appearance)) + (set! (-> this num-spans) arg0) + (set! (-> this spans) (new 'process 'lightning-spans-array arg0)) + (set! (-> this num-active-spans) 0) + (set! (-> this span-pts-start) (new 'process 'vector-array arg0)) + (let ((s3-0 (* arg1 arg0))) + (let ((s2-1 (+ (* arg1 (+ arg0 -1)) 1))) + (set! (-> this current-points) (new 'process 'vector-array s2-1)) + (set! (-> this desired-points) (new 'process 'vector-array s2-1)) + ) + (let ((f30-0 (* 2.0 (the float s3-0)))) + (set! (-> this strip1) + (new 'process 'prim-strip (the int f30-0) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + (set! (-> this strip2) + (new 'process 'prim-strip (the int f30-0) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + ) + ) + (set! (-> this appearance) arg2) + (set! (-> this spans-internal) (new 'process 'lightning-spans-internal-array arg0)) + (set! (-> this current-uv-shift) 0.0) + (set! (-> this strip1 clamp) (new 'static 'gs-clamp)) + (set! (-> this strip2 clamp) (new 'static 'gs-clamp)) + (when (-> this appearance use-sprite-bucket?) + (set! (-> this strip1 bucket) (bucket-id generic-sprite-1)) + (set! (-> this strip1 sink) (the-as uint 65)) + (set! (-> this strip1 texture-index) (the-as uint 7)) + (set! (-> this strip2 bucket) (bucket-id generic-sprite-1)) + (set! (-> this strip2 sink) (the-as uint 65)) + (set! (-> this strip2 texture-index) (the-as uint 7)) + ) + (set! (-> this new-inner-point-generate-time) + (rand-vu-int-range + (the-as int (-> this appearance regenerate-time-start)) + (the-as int (-> this appearance regenerate-time-end)) + ) + ) + (set! (-> this base-width) + (rand-vu-float-range (-> this appearance width-range-start) (-> this appearance width-range-end)) + ) + (set! (-> this fade-mode) (the-as uint 0)) + (set! (-> this current-fade-scalar) 1.0) + (when (-> this appearance uv-shift?) + (let* ((v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-32 (the-as number (logior #x3f800000 v1-31))) + ) + (set! (-> this current-uv-shift) (+ -1.0 (the-as float v1-32))) + ) + ) + (dotimes (v1-35 (-> this num-spans)) + (logand! (-> this spans-internal data v1-35 span-flags) -2) + (set! (-> this spans-internal data v1-35 index) v1-35) + ) + (set! (-> this base-color) *color-gray*) + 0 + (none) + ) + +(defmethod reset-spans! ((this lightning-bolt)) + (set! (-> this num-active-spans) 0) + 0 + (none) + ) + +(defmethod lightning-bolt-method-20 ((this lightning-bolt) (arg0 int) (arg1 lightning-span-internal)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let* ((f30-0 -0.5) + (v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + ) + (set! (-> s3-0 x) (+ f30-0 (+ -1.0 (the-as float v1-3)))) + ) + (let* ((f30-1 -0.5) + (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + ) + (set! (-> s3-0 y) (+ f30-1 (+ -1.0 (the-as float v1-8)))) + ) + (set! (-> s3-0 z) (the float (-> arg1 index))) + (set! (-> s3-0 w) 1.0) + (set! (-> this desired-points data arg0 quad) (-> s3-0 quad)) + ) + (set! (-> this current-points data arg0 z) (the float (-> arg1 index))) + (-> this desired-points data arg0) + ) + +(defmethod lightning-bolt-method-21 ((this lightning-bolt) (arg0 int) (arg1 int) (arg2 float)) + (local-vars (sv-16 int) (sv-24 vector) (sv-28 vector) (sv-32 float)) + (let ((v1-0 (-> this desired-points))) + (when (< 1 (- arg1 arg0)) + (set! sv-16 (/ (+ arg0 arg1) 2)) + (set! sv-24 (-> v1-0 data arg0)) + (set! sv-28 (-> v1-0 data arg1)) + (set! sv-32 (the-as float 1.0)) + (set! sv-32 (-> sv-28 z)) + (let ((s2-0 (-> v1-0 data sv-16))) + (let* ((f30-0 (* 0.5 (+ (-> sv-24 x) (-> sv-28 x)))) + (f28-0 arg2) + (f26-0 -0.5) + (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (set! (-> s2-0 x) (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-7)))))) + ) + (let* ((f30-1 (* 0.5 (+ (-> sv-24 y) (-> sv-28 y)))) + (f28-1 arg2) + (f26-1 -0.5) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> s2-0 y) (+ f30-1 (* f28-1 (+ f26-1 (+ -1.0 (the-as float v1-15)))))) + ) + (set! (-> s2-0 z) (lerp (-> sv-24 z) sv-32 0.5)) + ) + (lightning-bolt-method-21 this arg0 sv-16 (* arg2 (-> this fractal-reduction))) + (lightning-bolt-method-21 this sv-16 arg1 (* arg2 (-> this fractal-reduction))) + ) + ) + 0 + (none) + ) + +(defmethod lightning-bolt-method-15 ((this lightning-bolt) (arg0 object) (arg1 int) (arg2 lightning-span-internal)) + (let ((v1-0 (-> this generate-mode))) + (cond + ((zero? v1-0) + (let ((f30-0 (the float (-> arg2 index))) + (f28-0 (the float (+ (-> arg2 index) 1))) + (f26-0 (/ 1.0 (the float (+ (-> arg2 num-inner-points) 1)))) + ) + 0.0 + (let ((f24-0 (+ 0.0 f26-0))) + (dotimes (s3-0 (-> arg2 num-inner-points)) + (let ((f22-0 (lerp f30-0 f28-0 f24-0))) + (let ((s2-0 (-> this desired-points data (+ s3-0 1 arg1)))) + (let* ((f20-0 -0.5) + (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (set! (-> s2-0 x) (+ f20-0 (+ -1.0 (the-as float v1-14)))) + ) + (let* ((f20-1 -0.5) + (v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-19 (the-as number (logior #x3f800000 v1-18))) + ) + (set! (-> s2-0 y) (+ f20-1 (+ -1.0 (the-as float v1-19)))) + ) + (set! (-> s2-0 z) f22-0) + (set! (-> s2-0 w) 1.0) + ) + (set! (-> this current-points data (+ s3-0 1 arg1) z) f22-0) + ) + (+! f24-0 f26-0) + ) + ) + ) + ) + ((= v1-0 1) + (lightning-bolt-method-21 this arg1 (+ (-> arg2 num-inner-points) 1 arg1) 1.0) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch uint vs int. +(defmethod lightning-bolt-method-14 ((this lightning-bolt)) + (the-as int (-> this fade-mode)) + ) + +(defmethod lightning-bolt-method-13 ((this lightning-bolt) (arg0 int)) + (when (!= (-> this fade-mode) arg0) + (let ((v1-1 arg0)) + (cond + ((zero? v1-1) + (set! (-> this current-fade-scalar) 1.0) + (set-time! (-> this start-fade-time)) + ) + ((= v1-1 2) + (set-time! (-> this start-fade-time)) + (set! (-> this current-fade-scalar) 1.0) + ) + ((= v1-1 1) + (set! (-> this current-fade-scalar) 0.0) + (set-time! (-> this start-fade-time)) + ) + ((= v1-1 3) + (dotimes (v1-12 (-> this num-spans)) + (logand! (-> this spans-internal data v1-12 span-flags) -2) + ) + ) + ) + ) + (set! (-> this fade-mode) (the-as uint arg0)) + ) + (none) + ) + +;; WARN: Function (method 11 lightning-bolt) has a return type of none, but the expression builder found a return statement. +(defmethod lightning-bolt-method-11 ((this lightning-bolt)) + (local-vars + (sv-16 time-frame) + (sv-24 float) + (sv-32 time-frame) + (sv-40 float) + (sv-64 vector) + (sv-68 float) + (sv-72 float) + ) + (with-pp + (case (-> this fade-mode) + ((2) + (let* ((f1-2 (/ (the float (- (current-time) (-> this start-fade-time))) (the float (-> this appearance fade-time)))) + (f0-3 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (set! (-> this current-fade-scalar) (lerp 1.0 0.0 f0-3)) + ) + (if (>= 0.0 (-> this current-fade-scalar)) + (lightning-bolt-method-13 this 3) + ) + ) + ((1) + (let* ((f1-7 (/ (the float (- (current-time) (-> this start-fade-time))) (the float (-> this appearance fade-time)))) + (f0-9 (fmax 0.0 (fmin 1.0 f1-7))) + ) + (set! (-> this current-fade-scalar) (lerp 0.0 1.0 f0-9)) + ) + (if (>= (-> this current-fade-scalar) 1.0) + (lightning-bolt-method-13 this 0) + ) + ) + ) + (if (= (-> this fade-mode) 3) + (return 0) + ) + (if (zero? (-> this fade-mode)) + (set! (-> this current-fade-scalar) 1.0) + ) + (set! (-> this num-active-spans) (min (-> this num-active-spans) (+ (-> this num-spans) -1))) + (let ((v1-31 (-> this num-active-spans)) + (a0-14 (+ (-> this num-spans) -1)) + ) + (while (>= a0-14 v1-31) + (let ((a1-6 (-> this spans-internal data v1-31))) + (logand! (-> a1-6 span-flags) -2) + ) + (+! v1-31 1) + ) + ) + (let ((v1-37 (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time)))) + (dotimes (a0-17 (-> this num-active-spans)) + (-> this spans data a0-17) + (let ((a1-12 (-> this spans-internal data a0-17))) + (if (or v1-37 (not (logtest? (-> a1-12 span-flags) 1))) + (logior! (-> a1-12 span-flags) 2) + (logand! (-> a1-12 span-flags) -3) + ) + ) + ) + ) + (let ((s5-0 0)) + (dotimes (s4-0 (-> this num-active-spans)) + (-> this spans data s4-0) + (let* ((a2-13 (-> this spans-internal data s4-0)) + (s3-0 (+ (-> a2-13 num-inner-points) 1)) + ) + (when (logtest? (-> a2-13 span-flags) 2) + (when (or (-> this snap-inner-points?) + (and (logtest? (-> a2-13 span-flags) 2) (not (logtest? (-> a2-13 span-flags) 1))) + ) + (dotimes (v1-55 s3-0) + (set! (-> this current-points data (+ v1-55 s5-0) quad) (-> this desired-points data (+ v1-55 s5-0) quad)) + ) + ) + (lightning-bolt-method-20 this s5-0 a2-13) + ) + (+! s5-0 s3-0) + ) + ) + (when (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time)) + (lightning-bolt-method-20 this s5-0 (-> this spans-internal data (-> this num-active-spans))) + (if (-> this snap-inner-points?) + (set! (-> this current-points data s5-0 quad) (-> this desired-points data s5-0 quad)) + ) + (set-time! (-> this last-generate-time)) + (set! (-> this new-inner-point-generate-time) (rand-vu-int-range + (the-as int (-> this appearance regenerate-time-start)) + (the-as int (-> this appearance regenerate-time-end)) + ) + ) + ) + ) + (let ((s5-1 0)) + (dotimes (s4-1 (-> this num-active-spans)) + (let* ((a1-24 (-> this spans data s4-1)) + (a3-5 (-> this spans-internal data s4-1)) + (s3-1 (+ (-> a3-5 num-inner-points) 1)) + ) + (if (logtest? (-> a3-5 span-flags) 2) + (lightning-bolt-method-15 this a1-24 s5-1 a3-5) + ) + (+! s5-1 s3-1) + ) + ) + ) + (let ((s5-2 0)) + (dotimes (s4-2 (+ (-> this num-active-spans) 1)) + (-> this spans data s4-2) + (let* ((v1-102 (-> this spans-internal data s4-2)) + (s3-2 (+ (-> v1-102 num-inner-points) 1)) + ) + (if (= s4-2 (-> this num-active-spans)) + (set! s3-2 1) + ) + (cond + ((not (-> this appearance use-accurate-interp?)) + (let ((a0-49 (the-as int (- (current-time) (-> pp clock old-frame-counter))))) + 0.0 + (if (logtest? (-> v1-102 span-flags) 2) + (set! a0-49 0) + ) + (let* ((f1-12 (/ (the float a0-49) (the float (-> this inner-point-travel-time)))) + (f30-0 (fmax 0.0 (fmin 1.0 f1-12))) + ) + (dotimes (s2-0 s3-2) + (vector-lerp! + (-> this current-points data (+ s2-0 s5-2)) + (-> this current-points data (+ s2-0 s5-2)) + (-> this desired-points data (+ s2-0 s5-2)) + f30-0 + ) + ) + ) + ) + ) + (else + (set! sv-16 (- (current-time) (- (current-time) (-> pp clock old-frame-counter)))) + (set! sv-24 (the-as float 0.0)) + (set! sv-32 (current-time)) + (set! sv-40 (the-as float 0.0)) + (set! sv-24 + (/ (the float (- sv-16 (-> this last-generate-time))) (the float (-> this inner-point-travel-time))) + ) + (set! sv-40 + (/ (the float (- sv-32 (-> this last-generate-time))) (the float (-> this inner-point-travel-time))) + ) + (set! sv-24 (fmax 0.0 (fmin 1.0 sv-24))) + (set! sv-40 (fmax 0.0 (fmin 1.0 sv-40))) + (let ((f30-1 (- 1.0 sv-24))) + (dotimes (s2-1 s3-2) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! sv-68 (the-as float 0.0)) + (set! sv-72 (the-as float 0.0)) + (set-vector! + sv-64 + (- (-> this desired-points data (+ s2-1 s5-2) x) (-> this current-points data (+ s2-1 s5-2) x)) + (- (-> this desired-points data (+ s2-1 s5-2) y) (-> this current-points data (+ s2-1 s5-2) y)) + 0.0 + 1.0 + ) + (set! sv-68 (vector-normalize-ret-len! sv-64 1.0)) + (when (< 0.0 f30-1) + (set! sv-72 (/ sv-68 f30-1)) + (vector-float*! sv-64 sv-64 (* sv-72 (- sv-40 sv-24))) + (vector+! (-> this current-points data (+ s2-1 s5-2)) (-> this current-points data (+ s2-1 s5-2)) sv-64) + (set! (-> this current-points data (+ s2-1 s5-2) z) (-> this desired-points data (+ s2-1 s5-2) z)) + ) + ) + ) + ) + ) + (+! s5-2 s3-2) + ) + ) + ) + (dotimes (v1-156 (-> this num-active-spans)) + (-> this spans data v1-156) + (let ((a0-82 (-> this spans-internal data v1-156))) + (logior! (-> a0-82 span-flags) 1) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod lightning-bolt-method-19 ((this lightning-bolt) (arg0 vector) (arg1 int) (arg2 int) (arg3 matrix) (arg4 float) (arg5 float)) + (let ((a1-2 + (vector-! (new 'stack-no-clear 'vector) (-> this current-points data arg2) (-> this current-points data arg1)) + ) + ) + (set! (-> a1-2 x) (* (-> a1-2 x) arg4)) + (set! (-> a1-2 y) (* (-> a1-2 y) arg4)) + (set! (-> a1-2 z) (* (-> a1-2 z) arg5)) + (vector-rotate*! arg0 a1-2 arg3) + ) + (none) + ) + +(defun matrix<-vector-yz2! ((arg0 matrix) (arg1 vector) (arg2 vector)) + (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-cross! (-> arg0 rvec) arg2 arg1) + (vector-normalize! (-> arg0 rvec) 1.0) + (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) + (vector-normalize! (-> arg0 uvec) 1.0) + (set! (-> arg0 rvec w) 1.0) + (set! (-> arg0 uvec w) 1.0) + (set! (-> arg0 fvec w) 1.0) + arg0 + ) + +;; WARN: Return type mismatch number vs none. +;; WARN: Function (method 22 lightning-bolt) has a return type of none, but the expression builder found a return statement. +(defmethod lightning-bolt-method-22 ((this lightning-bolt)) + (with-pp + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (set! (-> this strip1 adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip1 data0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> this strip2 adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip2 data0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> this strip1 adnops 1 cmds) (gs-reg64 alpha-1)) + (set! (-> this strip2 adnops 1 cmds) (gs-reg64 alpha-1)) + (let ((v1-9 (-> this appearance blend-mode))) + (cond + ((= v1-9 1) + (set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-additive*)) + (set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-additive*)) + ) + ((zero? v1-9) + (set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-blend*)) + (set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-blend*)) + ) + ((= v1-9 2) + (set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-subtractive*)) + (set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-subtractive*)) + ) + ) + ) + (set! (-> this strip1 tex-id) (the-as texture-id (-> this appearance tex-id))) + (set! (-> this strip2 tex-id) (the-as texture-id (-> this appearance tex-id))) + (if (= (-> this fade-mode) 3) + (return 0) + ) + (when (-> this appearance uv-shift?) + (let ((f0-2 (/ (the float (- (current-time) (-> pp clock old-frame-counter))) + (the float (-> this appearance uv-shift-speed)) + ) + ) + ) + (+! (-> this current-uv-shift) f0-2) + ) + (let ((f0-4 (-> this current-uv-shift))) + (set! (-> this current-uv-shift) (- f0-4 (the float (the int f0-4)))) + ) + (if (< (-> this current-uv-shift) 1.0) + (+! (-> this current-uv-shift) 1.0) + ) + ) + (none) + ) + ) + +(defun choose-nice-perp ((arg0 vector)) + (let* ((f0-0 (-> arg0 x)) + (f0-2 (* f0-0 f0-0)) + (f1-0 (-> arg0 z)) + ) + (if (< (+ f0-2 (* f1-0 f1-0)) 0.01) + *x-vector* + *up-vector* + ) + ) + ) + +;; WARN: Function (method 12 lightning-bolt) has a return type of none, but the expression builder found a return statement. +(defmethod lightning-bolt-method-12 ((this lightning-bolt)) + (local-vars + (sv-48 int) + (sv-56 float) + (sv-60 vector) + (sv-64 matrix) + (sv-96 lightning-span) + (sv-100 lightning-span-internal) + (sv-104 vector) + (sv-224 matrix) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 vector) + (sv-244 float) + (sv-248 float) + (sv-256 int) + (sv-288 lightning-span) + (sv-292 lightning-span-internal) + (sv-296 vector) + (sv-416 matrix) + (sv-420 vector) + (sv-424 vector) + (sv-428 vector) + (sv-432 float) + ) + (when (= (-> this fade-mode) 3) + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (return 0) + ) + (set! sv-48 0) + (set! sv-56 (the-as float 0.0)) + (set! sv-60 (new 'stack-no-clear 'vector)) + (set! sv-64 (new 'stack-no-clear 'matrix)) + (lightning-bolt-method-22 this) + (set! (-> sv-60 x) 0.0) + (set! (-> sv-60 y) 0.0) + (dotimes (s5-0 (-> this num-active-spans)) + (set! sv-96 (-> this spans data s5-0)) + (set! sv-100 (-> this spans-internal data s5-0)) + (set! sv-104 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'matrix)) + (set! sv-228 (new 'stack-no-clear 'vector)) + (set! sv-232 (new 'stack-no-clear 'vector)) + (set! sv-236 (the-as float 0.0)) + (set! sv-240 + (vector-! + (new 'stack-no-clear 'vector) + (-> this span-pts-start data (+ s5-0 1)) + (-> this span-pts-start data s5-0) + ) + ) + (set! sv-244 (the float (-> sv-100 index))) + (vector-normalize! sv-240 1.0) + (set! sv-236 + (vector-vector-distance (-> this span-pts-start data s5-0) (-> this span-pts-start data (+ s5-0 1))) + ) + (matrix<-vector-yz2! sv-224 sv-240 (choose-nice-perp sv-240)) + (let ((f30-0 (-> sv-96 random-offset-size-start))) + (lightning-bolt-method-19 this sv-104 sv-48 (+ sv-48 1) sv-224 f30-0 sv-236) + (set! (-> sv-232 quad) (-> this current-points data sv-48 quad)) + (set! (-> sv-232 x) (* (-> sv-232 x) f30-0)) + (set! (-> sv-232 y) (* (-> sv-232 y) f30-0)) + ) + (set! (-> sv-232 z) (- (-> sv-232 z) sv-244)) + (set! (-> sv-232 z) (* (-> sv-232 z) sv-236)) + (vector-rotate*! sv-228 sv-232 sv-224) + (vector+! sv-228 sv-228 (-> this span-pts-start data s5-0)) + (lightning-bolt-method-16 this sv-228 (vector-length sv-232) sv-56 sv-60 (the-as matrix sv-104)) + (set! sv-248 (-> sv-96 inner-random-offset-size)) + (dotimes (s4-1 (-> sv-100 num-inner-points)) + (set! sv-256 (+ sv-48 1 s4-1)) + (lightning-bolt-method-19 this sv-104 (+ sv-256 -1) sv-256 sv-224 sv-248 sv-236) + (set! (-> sv-232 quad) (-> this current-points data sv-256 quad)) + (set! (-> sv-232 x) (* (-> sv-232 x) sv-248)) + (set! (-> sv-232 y) (* (-> sv-232 y) sv-248)) + (set! (-> sv-232 z) (- (-> sv-232 z) sv-244)) + (set! (-> sv-232 z) (* (-> sv-232 z) sv-236)) + (vector-rotate*! sv-228 sv-232 sv-224) + (vector+! sv-228 sv-228 (-> this span-pts-start data s5-0)) + (lightning-bolt-method-16 this sv-228 (vector-length sv-232) sv-56 sv-60 (the-as matrix sv-104)) + ) + (set! sv-56 (+ sv-56 sv-236)) + (set! sv-48 (+ (-> sv-100 num-inner-points) 1 sv-48)) + (set! (-> sv-64 rvec quad) (-> sv-104 quad)) + ) + (let ((s5-1 (-> this num-active-spans))) + (set! sv-288 (-> this spans data s5-1)) + (set! sv-292 (-> this spans-internal data s5-1)) + (set! sv-296 (new 'stack-no-clear 'vector)) + (set! sv-416 (new 'stack-no-clear 'matrix)) + (set! sv-420 (new 'stack-no-clear 'vector)) + (set! sv-424 (new 'stack-no-clear 'vector)) + (set! sv-428 (vector-! + (new 'stack-no-clear 'vector) + (-> this span-pts-start data s5-1) + (-> this span-pts-start data (+ s5-1 -1)) + ) + ) + (set! sv-432 (the float (-> sv-292 index))) + (vector-normalize! sv-428 1.0) + (matrix<-vector-yz2! sv-416 sv-428 (choose-nice-perp sv-428)) + (let ((f0-33 (-> sv-288 random-offset-size-start))) + (set! (-> sv-424 quad) (-> this current-points data sv-48 quad)) + (set! (-> sv-424 x) (* (-> sv-424 x) f0-33)) + (set! (-> sv-424 y) (* (-> sv-424 y) f0-33)) + ) + (set! (-> sv-424 z) (- (-> sv-424 z) sv-432)) + (vector-rotate*! sv-420 sv-424 sv-416) + (vector+! sv-420 sv-420 (-> this span-pts-start data s5-1)) + ) + (lightning-bolt-method-16 this sv-420 0.0 sv-56 sv-60 sv-64) + 0 + (none) + ) + +(defmethod relocate ((this lightning-bolt) (offset int)) + (if (nonzero? (-> this spans)) + (&+! (-> this spans) offset) + ) + (if (nonzero? (-> this strip1)) + (&+! (-> this strip1) offset) + ) + (if (nonzero? (-> this strip2)) + (&+! (-> this strip2) offset) + ) + (dotimes (v1-12 (+ (-> this num-spans) -1)) + ) + (if (nonzero? (-> this spans-internal)) + (&+! (-> this spans-internal) offset) + ) + (if (nonzero? (-> this current-points)) + (&+! (-> this current-points) offset) + ) + (if (nonzero? (-> this desired-points)) + (&+! (-> this desired-points) offset) + ) + (if (nonzero? (-> this span-pts-start)) + (&+! (-> this span-pts-start) offset) + ) + (call-parent-method this offset) + ) + +(defmethod lightning-bolt-method-17 ((this lightning-bolt) (arg0 uint) (arg1 float) (arg2 float) (arg3 curve2d-fast) (arg4 float)) + (if (not arg3) + (return 1.0) + ) + (let ((v1-2 arg0)) + (cond + ((zero? v1-2) + (curve2d-method-9 arg3 (/ arg2 arg4) 3) + ) + ((= v1-2 1) + (curve2d-method-9 arg3 arg1 3) + ) + ((= v1-2 2) + (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (+ -1.0 (the-as float v1-7)) + ) + ) + (else + 1.0 + ) + ) + ) + ) + +(defmethod lightning-bolt-method-16 ((this lightning-bolt) (arg0 vector) (arg1 float) (arg2 float) (arg3 vector) (arg4 matrix)) + (local-vars (sv-160 vector) (sv-164 vector) (sv-168 vector) (sv-172 vector) (sv-176 rgba)) + 0.0 + 0.0 + 0.0 + (let ((f28-0 + (/ (the float (- (current-time) (-> this last-generate-time))) (the float (-> this inner-point-travel-time))) + ) + (f30-0 (+ arg2 arg1)) + ) + (math-camera-pos) + (let* ((s2-0 (-> this appearance)) + (f24-0 (* (lightning-bolt-method-17 + this + (-> s2-0 alpha-1-mode) + f28-0 + f30-0 + (-> s2-0 alpha-1-curve) + (-> s2-0 alpha-1-repeat-dist) + ) + (lightning-bolt-method-17 + this + (-> s2-0 alpha-2-mode) + f28-0 + f30-0 + (-> s2-0 alpha-2-curve) + (-> s2-0 alpha-2-repeat-dist) + ) + (-> s2-0 base-alpha) + (-> this current-fade-scalar) + ) + ) + (f22-0 (* (lightning-bolt-method-17 + this + (-> s2-0 width-mode) + f28-0 + f30-0 + (-> s2-0 width-curve) + (-> s2-0 width-repeat-dist) + ) + (-> this base-width) + ) + ) + (f0-14 (/ f30-0 (-> s2-0 uv-repeat-dist))) + (f28-1 (+ (- f0-14 (* (the float (the int (/ f0-14 6.0))) 6.0)) (-> this current-uv-shift))) + ) + (vector-normalize! (the-as vector arg4) 1.0) + (let* ((a2-4 (-> (camera-matrix) uvec)) + (v1-13 (matrix-f-u-compose (new 'stack-no-clear 'matrix) (the-as vector arg4) a2-4)) + (f26-1 6.0) + ) + (set! sv-160 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* 0.5 f22-0))) + (set! sv-164 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* -0.5 f22-0))) + (set! sv-168 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* 0.5 f22-0))) + (set! sv-172 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* -0.5 f22-0))) + (set! sv-176 (the-as rgba (new 'stack-no-clear 'array 'rgba 1))) + (set! sv-176 (-> this base-color)) + (set! sv-176 (copy-and-set-field sv-176 a (the int (* 128.0 f24-0)))) + (when (< f28-1 (-> arg3 x)) + (let ((s3-1 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (let ((f24-1 (/ (- (+ f26-1 f28-1) (-> arg3 x)) f26-1))) + (let ((a1-10 (+ (the-as uint (-> this strip1 data 0 pos)) (* (+ (-> this strip1 num-verts) -2) 32))) + (s2-1 (+ (the-as uint (-> this strip1 data 0 pos)) (* (+ (-> this strip1 num-verts) -1) 32))) + ) + (vector-lerp! s3-1 (the-as vector a1-10) sv-160 f24-1) + (vector-lerp! s4-1 (the-as vector s2-1) sv-164 f24-1) + ) + (lightning-bolt-method-18 this (-> this strip1) s3-1 sv-176 0.0 f26-1) + (lightning-bolt-method-18 this (-> this strip1) s4-1 sv-176 1.0 f26-1) + (lightning-bolt-method-18 this (-> this strip1) s3-1 sv-176 0.0 0.0) + (lightning-bolt-method-18 this (-> this strip1) s4-1 sv-176 1.0 0.0) + (let ((a1-16 (+ (the-as uint (-> this strip2 data 0 pos)) (* (+ (-> this strip2 num-verts) -2) 32))) + (s2-2 (+ (the-as uint (-> this strip2 data 0 pos)) (* (+ (-> this strip2 num-verts) -1) 32))) + ) + (vector-lerp! s3-1 (the-as vector a1-16) sv-168 f24-1) + (vector-lerp! s4-1 (the-as vector s2-2) sv-172 f24-1) + ) + ) + (lightning-bolt-method-18 this (-> this strip2) s3-1 sv-176 1.0 f26-1) + (lightning-bolt-method-18 this (-> this strip2) s4-1 sv-176 0.0 f26-1) + (lightning-bolt-method-18 this (-> this strip2) s3-1 sv-176 1.0 0.0) + (lightning-bolt-method-18 this (-> this strip2) s4-1 sv-176 0.0 0.0) + ) + ) + ) + (lightning-bolt-method-18 this (-> this strip1) sv-160 sv-176 0.0 f28-1) + (lightning-bolt-method-18 this (-> this strip1) sv-164 sv-176 1.0 f28-1) + (lightning-bolt-method-18 this (-> this strip2) sv-168 sv-176 1.0 f28-1) + (lightning-bolt-method-18 this (-> this strip2) sv-172 sv-176 0.0 f28-1) + (set! (-> arg3 y) f30-0) + (set! (-> arg3 x) f28-1) + ) + ) + 0 + (none) + ) + +(defmethod lightning-bolt-method-18 ((this lightning-bolt) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) + (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) + (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) + (set! (-> v1-5 pos quad) (-> arg1 quad)) + (set! (-> v1-5 col) arg2) + (set! (-> v1-5 stq x) arg3) + (set! (-> v1-5 stq y) arg4) + ) + (+! (-> arg0 num-verts) 1) + ) + 0 + (none) + ) + +(defbehavior lightning-new-tracker-init-by-other lightning-new-tracker ((arg0 lightning-tracker-init-params)) + (set! (-> self bolt) (new 'process 'lightning-bolt)) + (init! (-> self bolt) 2 (+ (-> arg0 num-inner-points) 2) (-> arg0 appearance)) + (set! (-> self lifetime) (-> arg0 lifetime)) + (set! (-> self bolt span-pts-start data 0 quad) (-> arg0 start-pt quad)) + (set! (-> self bolt span-pts-start data 1 quad) (-> arg0 end-pt quad)) + (set! (-> self bolt spans-internal data 0 num-inner-points) (-> arg0 num-inner-points)) + (set! (-> self bolt spans data 0 inner-random-offset-size) (-> arg0 inner-random-offset-size)) + (set! (-> self bolt spans data 0 random-offset-size-start) (-> arg0 random-offset-size-start)) + (set! (-> self bolt inner-point-travel-time) (seconds 0.017)) + (set! (-> self bolt snap-inner-points?) #t) + (set! (-> self bolt appearance) (-> arg0 appearance)) + (set! (-> self bolt fractal-reduction) 0.4) + (set! (-> self bolt generate-mode) (the-as uint 1)) + (go-virtual active) + ) + +;; WARN: Return type mismatch process vs lightning-new-tracker. +(defun create-lightning-tracker-new ((arg0 lightning-tracker-init-params)) + (let ((v1-1 (process-spawn lightning-new-tracker arg0 :name "lightning-new-tracker" :stack-size #x8000))) + (if v1-1 + (return (the-as lightning-new-tracker (-> v1-1 0))) + ) + ) + (the-as lightning-new-tracker #f) + ) + +(defmethod relocate ((this lightning-new-tracker) (offset int)) + (if (nonzero? (-> this bolt)) + (&+! (-> this bolt) offset) + ) + (call-parent-method this offset) + ) + +(defstate active (lightning-new-tracker) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self bolt num-active-spans) 1) + (lightning-bolt-method-13 (-> self bolt) 0) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (-> self lifetime)) + (go-virtual die) + ) + (lightning-bolt-method-11 (-> self bolt)) + (lightning-bolt-method-12 (-> self bolt)) + ) + :code sleep-code + ) + +(defstate die (lightning-new-tracker) + :virtual #t + :enter (behavior () + (lightning-bolt-method-13 (-> self bolt) 2) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (lightning-bolt-method-11 (-> self bolt)) + (lightning-bolt-method-12 (-> self bolt)) + ) + :code (behavior () + (until (= (lightning-bolt-method-14 (-> self bolt)) 3) + (suspend) + ) + ) + ) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc index b0cd910a6e..c75c7b4557 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc @@ -7,3 +7,830 @@ ;; DECOMP BEGINS +(kmemopen global "part-tables") + +(define *lightning-spec-id-table* (new 'global 'boxed-array lightning-spec 128)) + +(kmemclose) + +(define *lightning-gcf* + (new 'static 'gcf-control + :giftag (new 'static 'generic-gif-tag + :fan-prim (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + :str-prim (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + :regs (new 'static 'gif-tag-regs-32 :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + :adnops (new 'static 'inline-array gs-adcmd 2 + (new 'static 'gs-adcmd :cmds (gs-reg64 hack)) + (new 'static 'gs-adcmd :cmds (gs-reg64 hack)) + ) + ) + ) + +(defun lightning-fractal-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec)) + (local-vars (sv-16 vector) (sv-32 vector)) + (when (< 1 (- arg2 arg1)) + (let ((s1-0 (/ (+ arg1 arg2) 2))) + (set! sv-16 (-> arg0 arg1)) + (set! sv-32 (-> arg0 arg2)) + (let ((s0-0 (-> arg0 s1-0))) + (let* ((f30-0 (* 0.5 (+ (-> sv-16 x) (-> sv-32 x)))) + (f28-0 arg3) + (f26-0 -0.5) + (v1-12 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-13 (the-as number (logior #x3f800000 v1-12))) + ) + (set! (-> s0-0 x) (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-13)))))) + ) + (let* ((f30-1 (* 0.5 (+ (-> sv-16 y) (-> sv-32 y)))) + (f28-1 arg3) + (f26-1 -0.5) + (v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-20 (the-as number (logior #x3f800000 v1-19))) + ) + (set! (-> s0-0 y) (+ f30-1 (* f28-1 (+ f26-1 (+ -1.0 (the-as float v1-20)))))) + ) + (let* ((f30-2 (* 0.5 (+ (-> sv-16 z) (-> sv-32 z)))) + (f28-2 arg3) + (f26-2 -0.5) + (v1-26 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-27 (the-as number (logior #x3f800000 v1-26))) + ) + (set! (-> s0-0 z) (+ f30-2 (* f28-2 (+ f26-2 (+ -1.0 (the-as float v1-27)))))) + ) + ) + (lightning-fractal-gen arg0 arg1 s1-0 (* arg3 (-> arg4 reduction)) arg4) + (lightning-fractal-gen arg0 s1-0 arg2 (* arg3 (-> arg4 reduction)) arg4) + ) + ) + 0 + (none) + ) + +(defun lightning-uniform-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec)) + (local-vars (sv-32 vector)) + (let ((s4-0 (-> arg0 arg1)) + (s3-0 (-> arg0 arg2)) + (f30-0 (/ 1.0 (the float (- arg2 arg1)))) + (f28-0 0.0) + (s2-0 (new-stack-vector0)) + (s1-0 arg1) + (s0-0 arg2) + ) + (while (>= s0-0 s1-0) + (vector-lerp! (-> arg0 s1-0) s4-0 s3-0 f28-0) + (set! sv-32 s2-0) + (let* ((f26-0 0.4) + (f24-0 -0.5) + (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + ) + (set! (-> sv-32 x) (* f26-0 (+ f24-0 (+ -1.0 (the-as float v1-8))) arg3)) + ) + (let* ((f26-1 0.4) + (f24-1 -0.5) + (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (set! (-> sv-32 y) (* f26-1 (+ f24-1 (+ -1.0 (the-as float v1-14))) arg3)) + ) + (let* ((f26-2 0.4) + (f24-2 -0.5) + (v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-20 (the-as number (logior #x3f800000 v1-19))) + ) + (set! (-> sv-32 z) (* f26-2 (+ f24-2 (+ -1.0 (the-as float v1-20))) arg3)) + ) + (set! (-> sv-32 w) 1.0) + (vector+! (-> arg0 s1-0) (-> arg0 s1-0) s2-0) + (+! f28-0 f30-0) + (+! s1-0 1) + ) + ) + 0 + (none) + ) + +(defun lightning-trail-uniform-gen ((arg0 (inline-array vector)) (arg1 (inline-array vector)) (arg2 float) (arg3 int)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (dotimes (s1-0 arg3) + (let ((s0-0 s2-0)) + (let* ((f30-0 0.4) + (f28-0 -0.5) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> s0-0 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-4))) arg2)) + ) + (let* ((f30-1 0.4) + (f28-1 -0.5) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (set! (-> s0-0 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-10))) arg2)) + ) + (let* ((f30-2 0.4) + (f28-2 -0.5) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> s0-0 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-16))) arg2)) + ) + (set! (-> s0-0 w) 1.0) + ) + (vector+! (-> arg0 s1-0) (-> arg1 s1-0) s2-0) + ) + ) + #f + ) + +(defun lightning-trail-fractal-gen ((arg0 (inline-array vector)) + (arg1 (inline-array vector)) + (arg2 int) + (arg3 int) + (arg4 float) + (arg5 lightning-spec) + ) + (local-vars (sv-80 vector) (sv-96 vector) (sv-112 vector) (sv-128 vector) (sv-144 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (when (< 1 (- arg3 arg2)) + (let ((s0-0 (/ (+ arg2 arg3) 2))) + (set! sv-96 (new 'stack-no-clear 'vector)) + (let ((v1-5 (-> arg0 arg2)) + (a0-3 (-> arg1 arg2)) + ) + (.lvf vf4 (&-> v1-5 quad)) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-96 quad) vf6) + (set! sv-112 (new 'stack-no-clear 'vector)) + (let ((v1-9 (-> arg0 arg3)) + (a0-5 (-> arg1 arg3)) + ) + (.lvf vf4 (&-> v1-9 quad)) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-112 quad) vf6) + (set! sv-144 (new 'stack-no-clear 'vector)) + (set! sv-128 (new 'stack-no-clear 'vector)) + (set! sv-80 sv-144) + (let* ((f30-0 arg4) + (f28-0 -0.5) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> sv-80 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-16))))) + ) + (let* ((f30-1 arg4) + (f28-1 -0.5) + (v1-20 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-21 (the-as number (logior #x3f800000 v1-20))) + ) + (set! (-> sv-80 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-21))))) + ) + (let* ((f30-2 arg4) + (f28-2 -0.5) + (v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-26 (the-as number (logior #x3f800000 v1-25))) + ) + (set! (-> sv-80 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-26))))) + ) + (set! (-> sv-80 w) 1.0) + (let ((v1-31 sv-128) + (a0-15 sv-128) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-96 quad)) + (.lvf vf5 (&-> sv-112 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a0-15 quad) vf6) + (vector-float*! v1-31 a0-15 0.5) + ) + (let ((v1-33 sv-144)) + (let ((a0-16 sv-144)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-16 quad)) + ) + (.lvf vf5 (&-> sv-128 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-33 quad) vf6) + ) + (let ((v1-35 (-> arg0 s0-0))) + (let ((a0-19 (-> arg1 s0-0))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-19 quad)) + ) + (.lvf vf5 (&-> sv-144 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-35 quad) vf6) + ) + (lightning-trail-fractal-gen arg0 arg1 arg2 s0-0 (* arg4 (-> arg5 reduction)) arg5) + (lightning-trail-fractal-gen arg0 arg1 s0-0 arg3 (* arg4 (-> arg5 reduction)) arg5) + ) + ) + 0 + (none) + ) + ) + +(deftype lightning-globals (structure) + ((gcf-buf uint16) + (vtx-buf uint16) + ) + ) + + +(defun gs-packed-rgba-lerp! ((arg0 gs-packed-rgba) (arg1 rgba) (arg2 rgba) (arg3 float)) + (local-vars (v1-0 uint128) (v1-1 uint128) (a1-1 uint128) (a1-2 uint128)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.pextlb v1-0 0 arg1) + (.pextlb a1-1 0 arg2) + (.pextlh v1-1 0 v1-0) + (.pextlh a1-2 0 a1-1) + (.mov vf1 v1-1) + (.mov vf2 a1-2) + (.mov vf3 arg3) + (.itof.vf vf1 vf1) + (.itof.vf vf2 vf2) + (.mul.w.vf acc vf1 vf0) + (.add.mul.x.vf acc vf2 vf3 acc) + (.sub.mul.x.vf vf1 vf1 vf3 acc) + (.ftoi.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defbehavior lightning-fade process ((arg0 lightning-control)) + (local-vars (v0-1 int) (sv-16 rgba)) + (let ((f0-0 (-> arg0 spec fade-time))) + (-> arg0 process 0 clock) + (cond + ((< (-> arg0 state counter) f0-0) + (+! (-> arg0 state counter) (* 300.0 (seconds-per-frame))) + (let ((gp-0 (-> arg0 state))) + (let* ((s5-0 (-> arg0 spec)) + (f30-0 (fmax 0.0 (fmin 1.0 (* (- 1.0 (/ (-> gp-0 counter) f0-0)) (-> s5-0 fade-start-factor))))) + ) + (set! sv-16 (-> s5-0 fade-to-color)) + (set! (-> gp-0 start-color) (rgba-lerp sv-16 (-> s5-0 start-color) (the-as rgba f30-0))) + (set! v0-1 (the-as int (rgba-lerp sv-16 (-> s5-0 end-color) (the-as rgba f30-0)))) + ) + (set! (-> gp-0 end-color) (the-as rgba v0-1)) + ) + ) + (else + (let ((v1-9 arg0)) + (set! v0-1 0) + (let ((a0-4 (!= v0-1 (-> v1-9 state mode)))) + (case v0-1 + ((3) + (if a0-4 + (set! (-> v1-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-9 state start-color) (-> v1-9 spec start-color)) + (set! (-> v1-9 state end-color) (-> v1-9 spec end-color)) + ) + ) + ) + (set! (-> v1-9 state mode) (the-as uint v0-1)) + ) + ) + ) + ) + v0-1 + ) + +(defun lightning-update ((arg0 lightning-control)) + (local-vars + (sv-16 lightning-spec) + (sv-20 vector-array) + (sv-24 vector-array) + (sv-28 vector-array) + (sv-32 symbol) + (sv-36 clock) + ) + (let* ((gp-0 (-> arg0 state points-to-draw)) + (s4-0 (+ gp-0 -1)) + (s5-0 (-> arg0 state)) + ) + (set! sv-16 (-> arg0 spec)) + (set! sv-20 (-> s5-0 line)) + (set! sv-24 (-> s5-0 meet)) + (set! sv-28 (-> s5-0 path)) + (set! sv-32 (= (-> s5-0 mode) 1)) + (set! sv-36 (-> arg0 process 0 clock)) + (when (not (or (= (-> sv-36 time-adjust-ratio) 0.0) (< gp-0 2))) + (when (logtest? (-> sv-16 flags) (lightning-spec-flags lsf4)) + (let ((f1-1 (vector-vector-distance (the-as vector (-> sv-24 data)) (-> sv-24 data s4-0)))) + (set! (-> s5-0 box-size) + (* (-> sv-16 box-size) (fmax 1.0 (fmin 5.0 (/ f1-1 (* 4096.0 (the float (-> sv-16 adjust-distance))))))) + ) + ) + ) + (set! (-> s5-0 counter) (fmax 0.0 (- (-> s5-0 counter) (-> sv-36 time-adjust-ratio)))) + (when sv-32 + (set! (-> s5-0 mode) (the-as uint 2)) + (set! (-> s5-0 counter) 0.0) + ) + (when (>= 0.0 (-> s5-0 counter)) + (let ((v1-33 (-> sv-16 rand-func))) + (cond + ((or (zero? v1-33) (= v1-33 1)) + (let ((v1-35 (-> sv-16 rand-func))) + (cond + ((zero? v1-35) + (lightning-fractal-gen (-> sv-24 data) 0 s4-0 (-> s5-0 box-size) sv-16) + ) + ((= v1-35 1) + (lightning-uniform-gen (-> sv-24 data) 0 s4-0 (-> s5-0 box-size) sv-16) + ) + ) + ) + (when sv-32 + (dotimes (v1-43 gp-0) + (set! (-> sv-20 data v1-43 quad) (-> sv-24 data v1-43 quad)) + ) + ) + ) + ((or (= v1-33 2) (= v1-33 3)) + (case (-> sv-16 rand-func) + ((2) + (set! (-> sv-24 data 0 quad) (-> sv-28 data 0 quad)) + (set! (-> sv-24 data s4-0 quad) (-> sv-28 data s4-0 quad)) + (lightning-trail-fractal-gen (-> sv-24 data) (-> sv-28 data) 0 s4-0 (-> s5-0 box-size) sv-16) + ) + (else + (lightning-trail-uniform-gen (-> sv-24 data) (-> sv-28 data) (-> s5-0 box-size) gp-0) + ) + ) + (when sv-32 + (dotimes (v1-63 gp-0) + (set! (-> sv-20 data v1-63 quad) (-> sv-28 data v1-63 quad)) + ) + ) + ) + ) + ) + (set! (-> s5-0 counter) (the float (-> sv-16 merge-count))) + ) + (let ((f0-14 (fmax 0.0 (fmin 1.0 (* (-> sv-16 merge-factor) (-> sv-36 time-adjust-ratio)))))) + (dotimes (v1-72 gp-0) + (let* ((a1-21 (-> sv-20 data v1-72)) + (a2-7 (-> sv-24 data v1-72)) + (a0-31 a1-21) + ) + (set! (-> a0-31 x) (+ (-> a1-21 x) (* f0-14 (- (-> a2-7 x) (-> a1-21 x))))) + (set! (-> a0-31 y) (+ (-> a1-21 y) (* f0-14 (- (-> a2-7 y) (-> a1-21 y))))) + (set! (-> a0-31 z) (+ (-> a1-21 z) (* f0-14 (- (-> a2-7 z) (-> a1-21 z))))) + ) + ) + ) + #f + ) + ) + ) + +(defun lightning-draw ((arg0 dma-buffer) (arg1 lightning-control) (arg2 lightning-globals)) + (local-vars + (sv-16 math-camera) + (sv-20 (inline-array gcf-vertex)) + (sv-24 lightning-spec) + (sv-28 float) + (sv-32 texture) + (sv-48 vector-array) + (sv-64 int) + (sv-80 int) + (sv-96 int) + (sv-112 int) + (sv-128 int) + (sv-144 int) + (sv-160 int) + (sv-176 gcf-control) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf17 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (set! sv-16 *math-camera*) + (set! sv-20 (the-as (inline-array gcf-vertex) *gsf-buffer*)) + (let* ((s3-0 (-> arg1 state points-to-draw)) + (s2-0 (+ s3-0 -1)) + (s1-0 *lightning-gcf*) + (s0-0 (-> sv-16 camera-rot)) + ) + (set! sv-32 (lookup-texture-by-id (-> arg1 spec texture))) + (set! sv-48 (-> arg1 state line)) + (set! sv-24 (-> arg1 spec)) + (when (< 1 s3-0) + (set! sv-64 0) + (while (< sv-64 2) + (set! sv-28 (/ 1.0 (the float s2-0))) + (cond + ((logtest? (-> sv-24 flags) (lightning-spec-flags lsf0)) + (set! sv-80 0) + (while (< sv-80 (* s3-0 2)) + (cond + ((not (logtest? sv-80 1)) + (gs-packed-rgba-lerp! + (-> sv-20 sv-80 clr) + (-> arg1 state start-color) + (-> arg1 state end-color) + (* (the float (/ sv-80 2)) sv-28) + ) + (let ((v1-24 (-> sv-20 sv-80))) + (set! (-> v1-24 tex x) 0) + (set! (-> v1-24 tex y) (* (/ 4096 s3-0) (/ sv-80 2))) + (set! (-> v1-24 tex z) 4096) + (set! (-> v1-24 tex w) 0) + ) + ) + (else + (gs-packed-rgba-lerp! + (-> sv-20 sv-80 clr) + (-> arg1 state start-color) + (-> arg1 state end-color) + (* (the float (/ sv-80 2)) sv-28) + ) + (let ((v1-33 (-> sv-20 sv-80))) + (set! (-> v1-33 tex x) 4096) + (set! (-> v1-33 tex y) (* (/ 4096 s3-0) (/ sv-80 2))) + (set! (-> v1-33 tex z) 4096) + (set! (-> v1-33 tex w) 0) + ) + ) + ) + (set! sv-80 (+ sv-80 1)) + ) + ) + ((logtest? (-> sv-24 flags) (lightning-spec-flags lsf1)) + (dotimes (v1-43 (* s3-0 2)) + (cond + ((not (logtest? v1-43 1)) + (let ((a0-26 (-> sv-20 v1-43))) + (set! (-> a0-26 tex x) 0) + (set! (-> a0-26 tex y) (* (/ 4096 s3-0) (/ v1-43 2))) + (set! (-> a0-26 tex z) 4096) + (set! (-> a0-26 tex w) 0) + ) + ) + (else + (let ((a0-30 (-> sv-20 v1-43))) + (set! (-> a0-30 tex x) 4096) + (set! (-> a0-30 tex y) (* (/ 4096 s3-0) (/ v1-43 2))) + (set! (-> a0-30 tex z) 4096) + (set! (-> a0-30 tex w) 0) + ) + ) + ) + ) + (dotimes (v1-46 (* s2-0 2)) + (set! (-> sv-20 v1-46 clr x) (the-as int (-> arg1 state start-color r))) + (set! (-> sv-20 v1-46 clr y) (the-as int (-> arg1 state start-color g))) + (set! (-> sv-20 v1-46 clr z) (the-as int (-> arg1 state start-color b))) + (set! (-> sv-20 v1-46 clr w) (the-as int (-> arg1 state start-color a))) + ) + (dotimes (v1-49 2) + (let ((a0-45 (+ v1-49 (* s2-0 2)))) + (set! (-> sv-20 a0-45 clr x) (the-as int (-> arg1 state end-color r))) + (set! (-> sv-20 a0-45 clr y) (the-as int (-> arg1 state end-color g))) + (set! (-> sv-20 a0-45 clr z) (the-as int (-> arg1 state end-color b))) + (set! (-> sv-20 a0-45 clr w) (the-as int (-> arg1 state end-color a))) + ) + ) + ) + ((logtest? (-> sv-24 flags) (lightning-spec-flags lsf2)) + (dotimes (v1-56 (* s3-0 2)) + (cond + ((not (logtest? v1-56 1)) + (let ((a0-52 (-> sv-20 v1-56))) + (set! (-> a0-52 tex x) 0) + (set! (-> a0-52 tex y) (* (/ 4096 s3-0) (/ v1-56 2))) + (set! (-> a0-52 tex z) 4096) + (set! (-> a0-52 tex w) 0) + ) + ) + (else + (let ((a0-56 (-> sv-20 v1-56))) + (set! (-> a0-56 tex x) 4096) + (set! (-> a0-56 tex y) (* (/ 4096 s3-0) (/ v1-56 2))) + (set! (-> a0-56 tex z) 4096) + (set! (-> a0-56 tex w) 0) + ) + ) + ) + ) + (dotimes (v1-59 (* (+ s3-0 -2) 2)) + (let ((a0-58 (+ v1-59 2))) + (set! (-> sv-20 a0-58 clr x) (the-as int (-> arg1 state start-color r))) + (set! (-> sv-20 a0-58 clr y) (the-as int (-> arg1 state start-color g))) + (set! (-> sv-20 a0-58 clr z) (the-as int (-> arg1 state start-color b))) + (set! (-> sv-20 a0-58 clr w) (the-as int (-> arg1 state start-color a))) + ) + ) + (dotimes (v1-62 2) + (let ((a0-63 v1-62)) + (set! (-> sv-20 a0-63 clr x) (the-as int (-> arg1 state end-color r))) + (set! (-> sv-20 a0-63 clr y) (the-as int (-> arg1 state end-color g))) + (set! (-> sv-20 a0-63 clr z) (the-as int (-> arg1 state end-color b))) + (set! (-> sv-20 a0-63 clr w) (the-as int (-> arg1 state end-color a))) + ) + ) + (dotimes (v1-65 2) + (let ((a0-67 (+ v1-65 (* s2-0 2)))) + (set! (-> sv-20 a0-67 clr x) (the-as int (-> arg1 state end-color r))) + (set! (-> sv-20 a0-67 clr y) (the-as int (-> arg1 state end-color g))) + (set! (-> sv-20 a0-67 clr z) (the-as int (-> arg1 state end-color b))) + (set! (-> sv-20 a0-67 clr w) (the-as int (-> arg1 state end-color a))) + ) + ) + ) + ) + (let ((f0-8 (-> sv-24 radius)) + (f1-4 0.5) + (v1-71 (-> sv-48 data)) + (a0-71 (the-as object (-> sv-20 0))) + (a1-82 (the-as object (-> sv-20 1))) + ) + 1 + (.lvf vf1 (&-> s0-0 rvec quad)) + (.lvf vf2 (&-> s0-0 uvec quad)) + (.lvf vf3 (&-> s0-0 fvec quad)) + (.lvf vf4 (&-> s0-0 trans quad)) + (let ((a2-44 f0-8)) + (.mov vf8 a2-44) + ) + (let ((a2-45 f1-4)) + (.mov vf17 a2-45) + ) + (.add.x.vf vf17 vf0 vf8 :mask #b10) + (.add.w.vf vf17 vf0 vf0 :mask #b100) + (.add.w.vf vf17 vf17 vf0 :mask #b100) + (dotimes (a2-46 s3-0) + (.lvf vf8 (&-> v1-71 0 quad)) + (.mul.w.vf acc vf4 vf0 :mask #b111) + (.add.mul.x.vf acc vf1 vf8 acc :mask #b111) + (.add.mul.y.vf acc vf2 vf8 acc :mask #b111) + (.add.mul.z.vf vf8 vf3 vf8 acc :mask #b111) + (.add.x.vf vf6 vf8 vf0) + (b! (zero? sv-64) cfg-44 :delay (.add.x.vf vf7 vf8 vf0)) + (.add.y.vf vf6 vf6 vf17 :mask #b10) + (b! #t cfg-45 :delay (.sub.y.vf vf7 vf7 vf17 :mask #b10)) + (label cfg-44) + (.add.y.vf vf6 vf6 vf17 :mask #b1) + (.sub.y.vf vf7 vf7 vf17 :mask #b1) + (label cfg-45) + (.svf (&-> (the-as (pointer uint128) a1-82) 2) vf6) + (.svf (&-> (the-as (pointer uint128) a0-71) 2) vf7) + (set! a1-82 (&-> (the-as (pointer uint128) a1-82) 6)) + (set! a0-71 (&-> (the-as (pointer uint128) a0-71) 6)) + (.add.x.vf vf9 vf8 vf0) + (set! v1-71 (the-as (inline-array vector) (-> v1-71 1))) + ) + ) + (set! sv-96 s2-0) + (set! sv-112 0) + (while (> sv-96 0) + (if (< 40 sv-96) + (set! sv-128 40) + (set! sv-128 sv-96) + ) + (set! sv-144 (+ sv-128 1)) + (set! sv-160 12) + (let* ((v1-81 arg0) + (a0-73 (the-as object (-> v1-81 base))) + ) + (set! (-> (the-as dma-packet a0-73) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc sv-160)) + (set! (-> (the-as dma-packet a0-73) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-73) vif1) + (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 gcf-buf) 54) 54) :num sv-160) + ) + (set! (-> v1-81 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-73) 16)))) + ) + (set! sv-176 (the-as gcf-control (-> arg0 base))) + (let* ((v1-84 (-> sv-176 matrix)) + (a3-31 (-> sv-16 perspective)) + (a0-76 (-> a3-31 rvec quad)) + (a1-88 (-> a3-31 uvec quad)) + (a2-58 (-> a3-31 fvec quad)) + (a3-32 (-> a3-31 trans quad)) + ) + (set! (-> v1-84 rvec quad) a0-76) + (set! (-> v1-84 uvec quad) a1-88) + (set! (-> v1-84 fvec quad) a2-58) + (set! (-> v1-84 trans quad) a3-32) + ) + (quad-copy! (the-as pointer (-> sv-176 giftag)) (the-as pointer (-> s1-0 giftag)) 3) + (set! (-> sv-176 giftag num-strips) (the-as uint 1)) + (set! (-> sv-176 num-dps) (the-as uint (* sv-144 2))) + (set! (-> sv-176 kick-offset) (the-as uint 0)) + (when sv-32 + (adgif-shader<-texture-simple! (the-as adgif-shader (-> sv-176 shader)) sv-32) + (adgif-shader-update! (the-as adgif-shader (-> sv-176 shader)) sv-32) + ) + (set! (-> sv-176 shader 0 shader alpha) (new 'static 'gs-miptbp :tbp1 #x48 :tbw2 #x20)) + (set! (-> sv-176 shader 0 shader tex0 tfx) 0) + (set! (-> sv-176 shader 0 pos) (the-as uint 0)) + (set! (-> sv-176 shader 0 num) (the-as uint (+ #x8000 (* sv-144 2)))) + (&+! (-> arg0 base) (* sv-160 16)) + (let* ((v1-104 arg0) + (a0-90 (the-as object (-> v1-104 base))) + ) + (set! (-> (the-as dma-packet a0-90) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc (* 6 sv-144))) + (set! (-> (the-as dma-packet a0-90) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-90) vif1) + (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 vtx-buf) 54) 54) :num (* 6 sv-144)) + ) + (set! (-> v1-104 base) (the-as pointer (&+ (the-as dma-packet a0-90) 16))) + ) + (quad-copy! (-> arg0 base) (the-as pointer (-> sv-20 sv-112)) (* 6 sv-144)) + (&+! (-> arg0 base) (* 96 sv-144)) + (let* ((v1-109 arg0) + (a0-95 (the-as object (-> v1-109 base))) + ) + (set! (-> (the-as dma-packet a0-95) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-95) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-95) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1)) + (set! (-> v1-109 base) (the-as pointer (&+ (the-as dma-packet a0-95) 16))) + ) + (set! (-> arg2 gcf-buf) (- 1704 (the-as int (-> arg2 gcf-buf)))) + (+! (-> arg2 vtx-buf) 279) + (if (< (the-as uint 567) (-> arg2 vtx-buf)) + (set! (-> arg2 vtx-buf) (the-as uint 9)) + ) + (set! sv-96 (- sv-96 sv-128)) + (set! sv-112 (+ sv-112 (* sv-128 2))) + sv-112 + ) + (set! sv-64 (+ sv-64 1)) + ) + #f + ) + ) + ) + ) + +(defun-debug lightning-start ((arg0 float) (arg1 float)) + (let ((gp-0 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when gp-0 + (let ((t9-1 (method-of-type lightning-tracker activate))) + (t9-1 (the-as lightning-tracker gp-0) *entity-pool* "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-3 gp-0) + (a1-3 lightning-tracker-init) + (a2-2 (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 32768.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 18000.0 + :sound #f + ) + ) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> t2-0 x) arg0) + (set! (-> t2-0 y) 0.0) + (set! (-> t2-0 z) arg1) + (set! (-> t2-0 w) 1.0) + (let ((t3-0 (new 'stack-no-clear 'vector))) + (set! (-> t3-0 x) arg0) + (set! (-> t3-0 y) 262144.0) + (set! (-> t3-0 z) arg1) + (set! (-> t3-0 w) 1.0) + ((the-as (function object object object object object object object object none) t9-2) + a0-3 + a1-3 + a2-2 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + +(define *lightning-globals* (new 'global 'lightning-globals)) + +(define *lightning* #t) + +(defun lightning-draw-all () + (when (and *lightning* (not (get-menu-mode *blit-displays-work*))) + (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic)) + (let ((s5-0 *lightning-engine*)) + (when (> (length s5-0) 0) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id generic-sprite-3) + ) + (let ((s3-0 *lightning-globals*)) + (let ((v1-17 s3-0)) + (set! (-> v1-17 gcf-buf) (the-as uint 837)) + (set! (-> v1-17 vtx-buf) (the-as uint 9)) + ) + (let* ((v1-19 (-> s5-0 alive-list next0)) + (s2-0 (-> v1-19 next0)) + ) + (while (!= v1-19 (-> s5-0 alive-list-end)) + (let* ((s1-0 (-> (the-as connection v1-19) param1)) + (s0-0 (-> (the-as dma-buffer s1-0) data-buffer 0)) + ) + (when (not (paused?)) + (case s0-0 + ((1 2) + (lightning-update (the-as lightning-control s1-0)) + ) + ((3) + (lightning-fade (the-as lightning-control s1-0)) + ) + ) + ) + (if (or (= s0-0 2) (= s0-0 3)) + (lightning-draw s4-0 (the-as lightning-control s1-0) s3-0) + ) + ) + (set! v1-19 s2-0) + (set! s2-0 (-> s2-0 next0)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun unlink-lightning-spec-by-heap ((arg0 kheap)) + (let* ((v1-0 *lightning-spec-id-table*) + (a2-0 (-> v1-0 length)) + (a1-0 (-> arg0 base)) + (a0-1 (-> arg0 top-base)) + ) + (while (nonzero? a2-0) + (+! a2-0 -1) + (let ((a3-2 (-> v1-0 a2-0))) + (when (and (>= (the-as int a3-2) (the-as int a1-0)) (< (the-as int a3-2) (the-as int a0-1))) + (set! (-> v1-0 a2-0) (the-as lightning-spec 0)) + 0 + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/gfx/mood/mood-h.gc b/goal_src/jak3/engine/gfx/mood/mood-h.gc index dc82cf2ced..e85fb724bd 100644 --- a/goal_src/jak3/engine/gfx/mood/mood-h.gc +++ b/goal_src/jak3/engine/gfx/mood/mood-h.gc @@ -154,6 +154,7 @@ ((value float) (scale float) ) + :pack-me ) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean.gc b/goal_src/jak3/engine/gfx/ocean/ocean.gc index 05d60b6230..dd25399b27 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean.gc @@ -7,3 +7,11 @@ ;; DECOMP BEGINS +;; stub +(defmethod get-height ((this ocean) (arg0 vector) (arg1 symbol)) + 0.0 + ) + +(defmethod get-base-height ((this ocean-map)) + 0.0 + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc index 1cdc86651c..1e566f9e31 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -437,6 +437,7 @@ (sym symbol :overlay-at initial-valuef) (sound sound-spec :overlay-at initial-valuef) ) + :allow-misaligned ) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc index 0c77e5063a..3cc536876a 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -2480,7 +2480,7 @@ (none) ) -(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) +(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) (birth-func-texture-group (the-as int arg0) arg1 arg2) 0 (none) diff --git a/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc b/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc index 5a0813144e..23ea7cefa7 100644 --- a/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc +++ b/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc @@ -235,7 +235,8 @@ ) ) -(define sprite-glow-vu1-block (new 'static 'vu-function :length #x86 :qlength 67)) +;; og:preserve-this +(define sprite-glow-vu1-block (new 'static 'vu-function #|:length #x86 :qlength 67|#)) ;; WARN: Return type mismatch vector vs none. (defun sprite-glow-init-consts ((arg0 sprite-glow-consts)) diff --git a/goal_src/jak3/engine/gfx/texture/texture.gc b/goal_src/jak3/engine/gfx/texture/texture.gc index 7662dc4c32..1658b7f37e 100644 --- a/goal_src/jak3/engine/gfx/texture/texture.gc +++ b/goal_src/jak3/engine/gfx/texture/texture.gc @@ -1903,7 +1903,18 @@ (set! (-> this segment 1 dest) (-> this segment 0 size)) (set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size))) - ;; todo, if needed, pc texture remaps (__pc-get-tex-remap) + ;; og:preserve-this added texture remap + (dotimes (texture-idx (-> this length)) + (let ((tex (-> this data texture-idx))) + (when (and tex (nonzero? tex)) + (let ((offset (__pc-get-tex-remap (the int (-> this id)) texture-idx))) + (when (nonzero? offset) + ) + (+! (-> tex dest 0) offset) + ) + ) + ) + ) (set! (-> this vram-size) (-> this size)) (let* ((a3-0 (-> this id)) diff --git a/goal_src/jak3/engine/level/level-h.gc b/goal_src/jak3/engine/level/level-h.gc index d21f1ea594..b90c306a36 100644 --- a/goal_src/jak3/engine/level/level-h.gc +++ b/goal_src/jak3/engine/level/level-h.gc @@ -431,7 +431,7 @@ (login-begin (_type_) _type_) (debug-print-region-splitbox (_type_ vector object) none) (get-art-group-by-name (_type_ string) art-group) - (level-method-22 () none) + (set-proto-vis! (_type_ symbol) int) (lookup-text (_type_ text-id symbol) string) (level-method-24 () none) (birth (_type_) _type_) diff --git a/goal_src/jak3/engine/level/level.gc b/goal_src/jak3/engine/level/level.gc index f9f76e2004..9100b5d559 100644 --- a/goal_src/jak3/engine/level/level.gc +++ b/goal_src/jak3/engine/level/level.gc @@ -22,11 +22,12 @@ (send-event *target* 'get-pickup (pickup-type ammo-red) 1000.0) (send-event *target* 'get-pickup (pickup-type ammo-blue) 1000.0) (send-event *target* 'get-pickup (pickup-type ammo-dark) 1000.0) - ;; (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) (logior! (-> *game-info* features) (game-feature - board board-launch feature39 + jakc + board board-launch board-zap darkeco darkjak darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 lighteco @@ -35,6 +36,16 @@ gun-red-1 gun-yellow-1 gun-blue-1 gun-dark-1 gun-red-2 gun-yellow-2 gun-blue-2 gun-dark-2 gun-red-3 gun-yellow-3 gun-blue-3 gun-dark-3)) + (logior! (-> *game-info* vehicles) + (game-vehicles + v-turtle + v-snake + v-scorpion + v-toad + v-fox + v-rhino + v-mirage + v-x-ride)) ) (defmacro test-play () @@ -55,9 +66,9 @@ (suspend) ) (true! *display-profile*) - (true! *stats-profile-bars*) - (true! *display-actor-marks*) - (true! *display-bones*) + ;; (true! *stats-profile-bars*) + ;; (true! *display-actor-marks*) + ;; (true! *display-bones*) (give-all-stuff) ) ) @@ -968,9 +979,9 @@ "Start loading data of a level." (local-vars (sv-16 level) - (sv-20 (function level-group int symbol)) + (memory-unused? (function level-group int symbol)) (sv-24 int) - (sv-32 int) + (mask int) (sv-40 int) (sv-48 int) (sv-56 int) @@ -980,7 +991,7 @@ ) (set! (-> this borrow-from-level) #f) (set! (-> this memory-mask) (the-as uint 0)) - (let ((s5-0 (the-as int (-> this info memory-mode)))) + (let ((mem-mode (-> this info memory-mode))) (dotimes (v1-4 10) (set! sv-16 (-> *level* level v1-4)) (when (and (or (= (-> sv-16 status) 'active) (= (-> sv-16 status) 'loaded)) (-> sv-16 info borrow)) @@ -989,9 +1000,9 @@ (= (car (-> sv-16 info borrow borrow-info a0-16)) (-> this name)) (nonzero? (-> sv-16 info borrow borrow-size a0-16)) ) - (when (!= (the-as level-memory-mode s5-0) (level-memory-mode borrow)) + (when (!= mem-mode (level-memory-mode borrow)) (format 0 "WARNING: level ~A upgraded to borrow~%" (-> this name)) - (set! s5-0 10) + (set! mem-mode (level-memory-mode borrow)) ) (goto cfg-28) ) @@ -999,39 +1010,46 @@ ) ) (label cfg-28) - (case s5-0 - ((10 11 12 13 14 15 16) - (level-find-borrow-slot this (the-as level-memory-mode s5-0)) + (case mem-mode + (((level-memory-mode borrow) + (level-memory-mode borrow0) + (level-memory-mode borrow1) + (level-memory-mode borrow2) + (level-memory-mode borrow3) + (level-memory-mode borrow4) + (level-memory-mode borrow-city-small) + ) + (level-find-borrow-slot this mem-mode) ) (else - (set! sv-20 (lambda ((arg0 level-group) (arg1 int)) - (dotimes (v1-0 11) - (if (logtest? (-> arg0 level v1-0 memory-mask) arg1) - (return #f) - ) - ) - #t - ) + (set! memory-unused? (lambda ((arg0 level-group) (arg1 int)) + (dotimes (v1-0 11) + (if (logtest? (-> arg0 level v1-0 memory-mask) arg1) + (return #f) + ) + ) + #t + ) ) (set! sv-24 0) - (set! sv-32 0) + (set! mask 0) (set! sv-40 0) (dotimes (v1-15 10) - (let ((a0-31 (-> *level* level v1-15))) - (when (and (or (= (-> a0-31 status) 'active) (= (-> a0-31 status) 'loaded)) - (or (= (-> a0-31 info memory-mode) (level-memory-mode micro)) - (= (-> a0-31 info memory-mode) (level-memory-mode city-tiny-edge)) + (let ((lev (-> *level* level v1-15))) + (when (and (or (= (-> lev status) 'active) (= (-> lev status) 'loaded)) + (or (= (-> lev info memory-mode) (level-memory-mode micro)) + (= (-> lev info memory-mode) (level-memory-mode city-tiny-edge)) ) ) - (case (-> a0-31 info memory-mode) + (case (-> lev info memory-mode) (((level-memory-mode city-tiny-edge)) - (set! sv-32 (if (or (= (-> a0-31 memory-mask) 60) (= (-> a0-31 memory-mask) #x3c000)) - 3 - #x30000 - ) + (set! mask (if (or (= (-> lev memory-mask) 60) (= (-> lev memory-mask) #x3c000)) + 3 + #x30000 + ) ) (if (zero? sv-40) - (set! sv-40 (if (or (= (-> a0-31 memory-mask) 15) (= (-> a0-31 memory-mask) #x3c000)) + (set! sv-40 (if (or (= (-> lev memory-mask) 15) (= (-> lev memory-mask) #x3c000)) #x3c000 60 ) @@ -1039,33 +1057,37 @@ ) ) (((level-memory-mode micro)) - (set! sv-32 (the-as int (-> a0-31 memory-mask))) + (set! mask (the-as int (-> lev memory-mask))) ) ) ) ) ) - (let ((v1-18 s5-0)) + (let ((v1-18 mem-mode)) (set! sv-48 (cond - ((= v1-18 8) + ((= v1-18 (level-memory-mode large)) #xbd0000 ) - ((= v1-18 7) + ((= v1-18 (level-memory-mode medium)) #x8fb800 ) - ((or (= v1-18 5) (= v1-18 6)) + ((or (= v1-18 (level-memory-mode small-center)) (= v1-18 (level-memory-mode city-center))) #x627000 ) - ((or (= v1-18 19) (= v1-18 3) (= v1-18 2) (= v1-18 1)) + ((or (= v1-18 (level-memory-mode city-tiny-edge)) + (= v1-18 (level-memory-mode tiny-center)) + (= v1-18 (level-memory-mode tiny-edge)) + (= v1-18 (level-memory-mode tiny)) + ) #x3f0000 ) - ((zero? v1-18) + ((= v1-18 (level-memory-mode micro)) #x1f8000 ) - ((= v1-18 18) + ((= v1-18 (level-memory-mode tiny-center-micro)) #x2f4000 ) - ((= v1-18 17) + ((= v1-18 (level-memory-mode tiny-center-small)) #x4ec000 ) (else @@ -1075,469 +1097,467 @@ ) ) (set! sv-56 0) - (let ((v1-20 s5-0)) - (cond - ((= v1-20 8) - (case sv-32 - ((3) - (let ((s4-0 #x3ffc0)) - (when (sv-20 *level* s4-0) - (set! sv-24 48) - (set! sv-56 s4-0) - (goto cfg-322) + (case mem-mode + (((level-memory-mode large)) + (case mask + ((3) + (let ((s4-0 #x3ffc0)) + (when (memory-unused? *level* s4-0) + (set! sv-24 48) + (set! sv-56 s4-0) + (goto cfg-322) + ) + ) + (let ((s4-1 #x3ffc)) + (when (memory-unused? *level* s4-1) + (set! sv-24 16) + (set! sv-56 s4-1) + (goto cfg-322) + ) + ) + ) + ((#x30000) + (let ((s4-2 4095)) + (when (memory-unused? *level* s4-2) + (set! sv-24 0) + (set! sv-56 s4-2) + (goto cfg-322) + ) + ) + (let ((s4-3 #xfff0)) + (when (memory-unused? *level* s4-3) + (set! sv-24 32) + (set! sv-56 s4-3) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-4 4095)) + (when (memory-unused? *level* s4-4) + (set! sv-24 0) + (set! sv-56 s4-4) + (goto cfg-322) + ) + ) + (let ((s4-5 #x3ffc0)) + (when (memory-unused? *level* s4-5) + (set! sv-24 48) + (set! sv-56 s4-5) + (goto cfg-322) + ) + ) + ) + ) + ) + (((level-memory-mode medium)) + (let ((s4-6 511)) + (when (memory-unused? *level* s4-6) + (set! sv-24 0) + (set! sv-56 s4-6) + (goto cfg-322) + ) + ) + (let ((s4-7 #x3fe00)) + (when (memory-unused? *level* s4-7) + (set! sv-24 73) + (set! sv-56 s4-7) + (goto cfg-322) + ) + ) + ) + (((level-memory-mode small-center)) + (case mask + ((3) + (case sv-40 + ((#x3c000) + (let ((s4-8 #x3f00)) + (when (memory-unused? *level* s4-8) + (set! sv-24 64) + (set! sv-56 s4-8) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-9 4032)) + (when (memory-unused? *level* s4-9) + (set! sv-24 48) + (set! sv-56 s4-9) + (goto cfg-322) + ) ) ) - (let ((s4-1 #x3ffc)) - (when (sv-20 *level* s4-1) + ) + ) + ((#x30000) + (case sv-40 + ((#x3c000) + (let ((s4-10 1008)) + (when (memory-unused? *level* s4-10) + (set! sv-24 32) + (set! sv-56 s4-10) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-11 4032)) + (when (memory-unused? *level* s4-11) + (set! sv-24 48) + (set! sv-56 s4-11) + (goto cfg-322) + ) + ) + ) + ) + ) + (else + (let ((s4-12 4032)) + (when (memory-unused? *level* s4-12) + (set! sv-24 48) + (set! sv-56 s4-12) + (goto cfg-322) + ) + ) + ) + ) + ) + (((level-memory-mode city-center)) + (let ((s4-13 4032)) + (when (memory-unused? *level* s4-13) + (set! sv-24 48) + (set! sv-56 s4-13) + (goto cfg-322) + ) + ) + ) + (((level-memory-mode small-edge)) + (case mask + ((3) + (case sv-40 + ((#x3c000) + (let ((s4-14 252)) + (when (memory-unused? *level* s4-14) + (set! sv-24 16) + (set! sv-56 s4-14) + (goto cfg-322) + ) + ) + (let ((s4-15 #x3f00)) + (when (memory-unused? *level* s4-15) + (set! sv-24 64) + (set! sv-56 s4-15) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-16 #x3f000)) + (when (memory-unused? *level* s4-16) + (set! sv-24 98) + (set! sv-56 s4-16) + (goto cfg-322) + ) + ) + (let ((s4-17 4032)) + (when (memory-unused? *level* s4-17) + (set! sv-24 48) + (set! sv-56 s4-17) + (goto cfg-322) + ) + ) + ) + ) + ) + ((#x30000) + (case sv-40 + ((#x3c000) + (let ((s4-18 #xfc00)) + (when (memory-unused? *level* s4-18) + (set! sv-24 82) + (set! sv-56 s4-18) + (goto cfg-322) + ) + ) + (let ((s4-19 1008)) + (when (memory-unused? *level* s4-19) + (set! sv-24 32) + (set! sv-56 s4-19) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-20 63)) + (when (memory-unused? *level* s4-20) + (set! sv-24 0) + (set! sv-56 s4-20) + (goto cfg-322) + ) + ) + (let ((s4-21 4032)) + (when (memory-unused? *level* s4-21) + (set! sv-24 48) + (set! sv-56 s4-21) + (goto cfg-322) + ) + ) + ) + ) + ) + (else + (let ((s4-22 63)) + (when (memory-unused? *level* s4-22) + (set! sv-24 0) + (set! sv-56 s4-22) + (goto cfg-322) + ) + ) + (let ((s4-23 #x3f000)) + (when (memory-unused? *level* s4-23) + (set! sv-24 98) + (set! sv-56 s4-23) + (goto cfg-322) + ) + ) + ) + ) + ) + (((level-memory-mode micro)) + (let ((s4-24 3)) + (when (memory-unused? *level* s4-24) + (set! sv-24 0) + (set! sv-56 s4-24) + (goto cfg-322) + ) + ) + (let ((s4-25 #x30000)) + (when (memory-unused? *level* s4-25) + (set! sv-24 130) + (set! sv-56 s4-25) + (goto cfg-322) + ) + ) + ) + (((level-memory-mode tiny-edge) (level-memory-mode city-tiny-edge)) + (let ((v1-126 mask)) + (cond + ((or (zero? v1-126) (= v1-126 3)) + (let ((s4-26 60)) + (when (memory-unused? *level* s4-26) (set! sv-24 16) - (set! sv-56 s4-1) + (set! sv-56 s4-26) + (goto cfg-322) + ) + ) + (let ((s4-27 #x3c000)) + (when (memory-unused? *level* s4-27) + (set! sv-24 114) + (set! sv-56 s4-27) (goto cfg-322) ) ) ) - ((#x30000) - (let ((s4-2 4095)) - (when (sv-20 *level* s4-2) + ((= v1-126 #x30000) + (let ((s4-28 #xf000)) + (when (memory-unused? *level* s4-28) + (set! sv-24 98) + (set! sv-56 s4-28) + (goto cfg-322) + ) + ) + (let ((s4-29 15)) + (when (memory-unused? *level* s4-29) (set! sv-24 0) - (set! sv-56 s4-2) + (set! sv-56 s4-29) (goto cfg-322) ) ) - (let ((s4-3 #xfff0)) - (when (sv-20 *level* s4-3) + ) + ) + ) + ) + (((level-memory-mode tiny)) + (let ((v1-143 mask)) + (cond + ((or (zero? v1-143) (= v1-143 3)) + (let ((s4-30 60)) + (when (memory-unused? *level* s4-30) + (set! sv-24 16) + (set! sv-56 s4-30) + (goto cfg-322) + ) + ) + (let ((s4-31 #x3c000)) + (when (memory-unused? *level* s4-31) + (set! sv-24 114) + (set! sv-56 s4-31) + (goto cfg-322) + ) + ) + (let ((s4-32 #x3c00)) + (when (memory-unused? *level* s4-32) + (set! sv-24 82) + (set! sv-56 s4-32) + (goto cfg-322) + ) + ) + (let ((s4-33 960)) + (when (memory-unused? *level* s4-33) + (set! sv-24 48) + (set! sv-56 s4-33) + (goto cfg-322) + ) + ) + ) + ((= v1-143 #x30000) + (let ((s4-34 #xf000)) + (when (memory-unused? *level* s4-34) + (set! sv-24 98) + (set! sv-56 s4-34) + (goto cfg-322) + ) + ) + (let ((s4-35 15)) + (when (memory-unused? *level* s4-35) + (set! sv-24 0) + (set! sv-56 s4-35) + (goto cfg-322) + ) + ) + (let ((s4-36 240)) + (when (memory-unused? *level* s4-36) (set! sv-24 32) - (set! sv-56 s4-3) + (set! sv-56 s4-36) + (goto cfg-322) + ) + ) + (let ((s4-37 3840)) + (when (memory-unused? *level* s4-37) + (set! sv-24 64) + (set! sv-56 s4-37) (goto cfg-322) ) ) ) - (else - (let ((s4-4 4095)) - (when (sv-20 *level* s4-4) - (set! sv-24 0) - (set! sv-56 s4-4) - (goto cfg-322) - ) - ) - (let ((s4-5 #x3ffc0)) - (when (sv-20 *level* s4-5) - (set! sv-24 48) - (set! sv-56 s4-5) - (goto cfg-322) - ) - ) - ) ) ) - ((= v1-20 7) - (let ((s4-6 511)) - (when (sv-20 *level* s4-6) - (set! sv-24 0) - (set! sv-56 s4-6) - (goto cfg-322) - ) - ) - (let ((s4-7 #x3fe00)) - (when (sv-20 *level* s4-7) - (set! sv-24 73) - (set! sv-56 s4-7) - (goto cfg-322) - ) - ) - ) - ((= v1-20 5) - (case sv-32 - ((3) - (case sv-40 - ((#x3c000) - (let ((s4-8 #x3f00)) - (when (sv-20 *level* s4-8) - (set! sv-24 64) - (set! sv-56 s4-8) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-9 4032)) - (when (sv-20 *level* s4-9) - (set! sv-24 48) - (set! sv-56 s4-9) - (goto cfg-322) - ) - ) + ) + (((level-memory-mode tiny-center)) + (let ((v1-176 mask)) + (cond + ((or (zero? v1-176) (= v1-176 3)) + (let ((s4-38 #x3c00)) + (when (memory-unused? *level* s4-38) + (set! sv-24 82) + (set! sv-56 s4-38) + (goto cfg-322) + ) + ) + (let ((s4-39 960)) + (when (memory-unused? *level* s4-39) + (set! sv-24 48) + (set! sv-56 s4-39) + (goto cfg-322) ) ) ) - ((#x30000) - (case sv-40 - ((#x3c000) - (let ((s4-10 1008)) - (when (sv-20 *level* s4-10) - (set! sv-24 32) - (set! sv-56 s4-10) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-11 4032)) - (when (sv-20 *level* s4-11) - (set! sv-24 48) - (set! sv-56 s4-11) - (goto cfg-322) - ) - ) + ((= v1-176 #x30000) + (let ((s4-40 240)) + (when (memory-unused? *level* s4-40) + (set! sv-24 32) + (set! sv-56 s4-40) + (goto cfg-322) + ) + ) + (let ((s4-41 3840)) + (when (memory-unused? *level* s4-41) + (set! sv-24 64) + (set! sv-56 s4-41) + (goto cfg-322) ) ) ) - (else - (let ((s4-12 4032)) - (when (sv-20 *level* s4-12) - (set! sv-24 48) - (set! sv-56 s4-12) - (goto cfg-322) - ) - ) - ) ) ) - ((= v1-20 6) - (let ((s4-13 4032)) - (when (sv-20 *level* s4-13) - (set! sv-24 48) - (set! sv-56 s4-13) - (goto cfg-322) - ) - ) - ) - ((= v1-20 4) - (case sv-32 - ((3) - (case sv-40 - ((#x3c000) - (let ((s4-14 252)) - (when (sv-20 *level* s4-14) - (set! sv-24 16) - (set! sv-56 s4-14) - (goto cfg-322) - ) - ) - (let ((s4-15 #x3f00)) - (when (sv-20 *level* s4-15) - (set! sv-24 64) - (set! sv-56 s4-15) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-16 #x3f000)) - (when (sv-20 *level* s4-16) - (set! sv-24 98) - (set! sv-56 s4-16) - (goto cfg-322) - ) - ) - (let ((s4-17 4032)) - (when (sv-20 *level* s4-17) - (set! sv-24 48) - (set! sv-56 s4-17) - (goto cfg-322) - ) - ) + ) + (((level-memory-mode tiny-center-small)) + (let ((v1-194 mask)) + (cond + ((or (zero? v1-194) (= v1-194 3)) + (let ((s4-42 #x3e00)) + (when (memory-unused? *level* s4-42) + (set! sv-24 72) + (set! sv-56 s4-42) + (goto cfg-322) + ) + ) + (let ((s4-43 1984)) + (when (memory-unused? *level* s4-43) + (set! sv-24 48) + (set! sv-56 s4-43) + (goto cfg-322) ) ) ) - ((#x30000) - (case sv-40 - ((#x3c000) - (let ((s4-18 #xfc00)) - (when (sv-20 *level* s4-18) - (set! sv-24 82) - (set! sv-56 s4-18) - (goto cfg-322) - ) - ) - (let ((s4-19 1008)) - (when (sv-20 *level* s4-19) - (set! sv-24 32) - (set! sv-56 s4-19) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-20 63)) - (when (sv-20 *level* s4-20) - (set! sv-24 0) - (set! sv-56 s4-20) - (goto cfg-322) - ) - ) - (let ((s4-21 4032)) - (when (sv-20 *level* s4-21) - (set! sv-24 48) - (set! sv-56 s4-21) - (goto cfg-322) - ) - ) + ((= v1-194 #x30000) + (let ((s4-44 496)) + (when (memory-unused? *level* s4-44) + (set! sv-24 32) + (set! sv-56 s4-44) + (goto cfg-322) + ) + ) + (let ((s4-45 3968)) + (when (memory-unused? *level* s4-45) + (set! sv-24 56) + (set! sv-56 s4-45) + (goto cfg-322) ) ) ) - (else - (let ((s4-22 63)) - (when (sv-20 *level* s4-22) - (set! sv-24 0) - (set! sv-56 s4-22) - (goto cfg-322) - ) - ) - (let ((s4-23 #x3f000)) - (when (sv-20 *level* s4-23) - (set! sv-24 98) - (set! sv-56 s4-23) - (goto cfg-322) - ) - ) - ) ) ) - ((zero? v1-20) - (let ((s4-24 3)) - (when (sv-20 *level* s4-24) - (set! sv-24 0) - (set! sv-56 s4-24) - (goto cfg-322) - ) - ) - (let ((s4-25 #x30000)) - (when (sv-20 *level* s4-25) - (set! sv-24 130) - (set! sv-56 s4-25) - (goto cfg-322) - ) + ) + (((level-memory-mode tiny-center-micro)) + (let ((v1-213 mask)) + (cond + ((or (zero? v1-213) (= v1-213 3)) + (let ((s4-46 448)) + (when (memory-unused? *level* s4-46) + (set! sv-24 48) + (set! sv-56 s4-46) + (goto cfg-322) + ) + ) + (let ((s4-47 #x3800)) + (when (memory-unused? *level* s4-47) + (set! sv-24 90) + (set! sv-56 s4-47) + (goto cfg-322) + ) + ) + ) + ((= v1-213 #x30000) + (let ((s4-48 3584)) + (when (memory-unused? *level* s4-48) + (set! sv-24 72) + (set! sv-56 s4-48) + (goto cfg-322) + ) + ) + (let ((s4-49 112)) + (when (memory-unused? *level* s4-49) + (set! sv-24 32) + (set! sv-56 s4-49) + (goto cfg-322) + ) + ) + ) ) ) - ((or (= v1-20 2) (= v1-20 19)) - (let ((v1-126 sv-32)) - (cond - ((or (zero? v1-126) (= v1-126 3)) - (let ((s4-26 60)) - (when (sv-20 *level* s4-26) - (set! sv-24 16) - (set! sv-56 s4-26) - (goto cfg-322) - ) - ) - (let ((s4-27 #x3c000)) - (when (sv-20 *level* s4-27) - (set! sv-24 114) - (set! sv-56 s4-27) - (goto cfg-322) - ) - ) - ) - ((= v1-126 #x30000) - (let ((s4-28 #xf000)) - (when (sv-20 *level* s4-28) - (set! sv-24 98) - (set! sv-56 s4-28) - (goto cfg-322) - ) - ) - (let ((s4-29 15)) - (when (sv-20 *level* s4-29) - (set! sv-24 0) - (set! sv-56 s4-29) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 1) - (let ((v1-143 sv-32)) - (cond - ((or (zero? v1-143) (= v1-143 3)) - (let ((s4-30 60)) - (when (sv-20 *level* s4-30) - (set! sv-24 16) - (set! sv-56 s4-30) - (goto cfg-322) - ) - ) - (let ((s4-31 #x3c000)) - (when (sv-20 *level* s4-31) - (set! sv-24 114) - (set! sv-56 s4-31) - (goto cfg-322) - ) - ) - (let ((s4-32 #x3c00)) - (when (sv-20 *level* s4-32) - (set! sv-24 82) - (set! sv-56 s4-32) - (goto cfg-322) - ) - ) - (let ((s4-33 960)) - (when (sv-20 *level* s4-33) - (set! sv-24 48) - (set! sv-56 s4-33) - (goto cfg-322) - ) - ) - ) - ((= v1-143 #x30000) - (let ((s4-34 #xf000)) - (when (sv-20 *level* s4-34) - (set! sv-24 98) - (set! sv-56 s4-34) - (goto cfg-322) - ) - ) - (let ((s4-35 15)) - (when (sv-20 *level* s4-35) - (set! sv-24 0) - (set! sv-56 s4-35) - (goto cfg-322) - ) - ) - (let ((s4-36 240)) - (when (sv-20 *level* s4-36) - (set! sv-24 32) - (set! sv-56 s4-36) - (goto cfg-322) - ) - ) - (let ((s4-37 3840)) - (when (sv-20 *level* s4-37) - (set! sv-24 64) - (set! sv-56 s4-37) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 3) - (let ((v1-176 sv-32)) - (cond - ((or (zero? v1-176) (= v1-176 3)) - (let ((s4-38 #x3c00)) - (when (sv-20 *level* s4-38) - (set! sv-24 82) - (set! sv-56 s4-38) - (goto cfg-322) - ) - ) - (let ((s4-39 960)) - (when (sv-20 *level* s4-39) - (set! sv-24 48) - (set! sv-56 s4-39) - (goto cfg-322) - ) - ) - ) - ((= v1-176 #x30000) - (let ((s4-40 240)) - (when (sv-20 *level* s4-40) - (set! sv-24 32) - (set! sv-56 s4-40) - (goto cfg-322) - ) - ) - (let ((s4-41 3840)) - (when (sv-20 *level* s4-41) - (set! sv-24 64) - (set! sv-56 s4-41) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 17) - (let ((v1-194 sv-32)) - (cond - ((or (zero? v1-194) (= v1-194 3)) - (let ((s4-42 #x3e00)) - (when (sv-20 *level* s4-42) - (set! sv-24 72) - (set! sv-56 s4-42) - (goto cfg-322) - ) - ) - (let ((s4-43 1984)) - (when (sv-20 *level* s4-43) - (set! sv-24 48) - (set! sv-56 s4-43) - (goto cfg-322) - ) - ) - ) - ((= v1-194 #x30000) - (let ((s4-44 496)) - (when (sv-20 *level* s4-44) - (set! sv-24 32) - (set! sv-56 s4-44) - (goto cfg-322) - ) - ) - (let ((s4-45 3968)) - (when (sv-20 *level* s4-45) - (set! sv-24 56) - (set! sv-56 s4-45) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 18) - (let ((v1-213 sv-32)) - (cond - ((or (zero? v1-213) (= v1-213 3)) - (let ((s4-46 448)) - (when (sv-20 *level* s4-46) - (set! sv-24 48) - (set! sv-56 s4-46) - (goto cfg-322) - ) - ) - (let ((s4-47 #x3800)) - (when (sv-20 *level* s4-47) - (set! sv-24 90) - (set! sv-56 s4-47) - (goto cfg-322) - ) - ) - ) - ((= v1-213 #x30000) - (let ((s4-48 3584)) - (when (sv-20 *level* s4-48) - (set! sv-24 72) - (set! sv-56 s4-48) - (goto cfg-322) - ) - ) - (let ((s4-49 112)) - (when (sv-20 *level* s4-49) - (set! sv-24 32) - (set! sv-56 s4-49) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ) + ) ) (label cfg-322) (cond @@ -1546,8 +1566,8 @@ 0 "ERROR: level ~A could not find free ~S bank in the level-group heap (micro ~X tiny ~X)~%" (-> this name) - (level-memory-mode->string (the-as level-memory-mode s5-0)) - sv-32 + (level-memory-mode->string mem-mode) + mask sv-40 ) (dotimes (s5-1 11) @@ -1571,7 +1591,7 @@ ) (else (set! (-> this memory-mask) (the-as uint sv-56)) - (format 0 "lev ~A ~X micro ~X tiny ~X~%" (-> this name) (-> this memory-mask) sv-32 sv-40) + (format 0 "lev ~A ~X micro ~X tiny ~X~%" (-> this name) (-> this memory-mask) mask sv-40) (cond ((= (&- (-> *level* heap top) (the-as uint (-> *level* heap base))) #x1af2800) (let ((v1-245 (-> this heap))) @@ -2089,10 +2109,7 @@ (let ((s1-2 (-> this status))) (set! (-> this status) 'active) (do-nothing *level*) - (when (nonzero? update-task-masks) ;; added check - (format 0 "skipping update-task-masks~%") - (update-task-masks 'level) - ) + (update-task-masks 'level) (assign-draw-indices *level*) (let ((s0-0 (-> this bsp nav-meshes))) (when (nonzero? s0-0) @@ -2308,7 +2325,7 @@ (set! (-> this loaded-texture-page-count) 0) (unlink-shaders-in-heap *texture-page-dir* (-> this heap)) (unlink-part-group-by-heap (-> this heap)) - ;; (unlink-lightning-spec-by-heap (-> this heap)) + (unlink-lightning-spec-by-heap (-> this heap)) (particle-adgif-cache-flush) (set! (-> this loaded-text-info-count) 0) (dotimes (s5-6 2) diff --git a/goal_src/jak3/engine/nav/nav-control-h.gc b/goal_src/jak3/engine/nav/nav-control-h.gc index c680a25d5d..e4a6f742f6 100644 --- a/goal_src/jak3/engine/nav/nav-control-h.gc +++ b/goal_src/jak3/engine/nav/nav-control-h.gc @@ -100,53 +100,53 @@ (user-position vector :inline :overlay-at virtual-current-pos-local) ) (:methods - (nav-state-method-9 () none) - (nav-state-method-10 () none) - (nav-state-method-11 () none) - (nav-state-method-12 () none) - (nav-state-method-13 () none) - (nav-state-method-14 () none) - (nav-state-method-15 () none) - (nav-state-method-16 () none) - (nav-state-method-17 () none) - (nav-state-method-18 () none) - (nav-state-method-19 () none) - (nav-state-method-20 () none) + (debug-draw (_type_) none) + (nav-state-method-10 (_type_) none) + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol) + (get-velocity (_type_ vector) vector) + (get-travel (_type_ vector) vector) + (get-heading (_type_ vector) vector) + (get-target-pos (_type_ vector) vector) + (get-speed (_type_) meters) + (get-rotation-rate (_type_) float) + (try-projecting-to-current-poly (_type_ vector vector vector) symbol) + (get-current-poly (_type_) nav-poly) + (copy-nav-state! (_type_ (pointer nav-state)) none) (nav-state-method-21 () none) (nav-state-method-22 () none) (nav-state-method-23 () none) - (nav-state-method-24 () none) - (nav-state-method-25 () none) - (nav-state-method-26 () none) - (nav-state-method-27 () none) - (nav-state-method-28 () none) - (nav-state-method-29 () none) - (nav-state-method-30 () none) - (nav-state-method-31 () none) - (nav-state-method-32 () none) - (nav-state-method-33 () none) + (turn-and-navigate-to-destination (_type_) none) + (navigate-using-route-portals-wrapper (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none) + (navigate-within-poly-wrapper (_type_) none) + (compute-travel-speed (_type_) none) + (nav-state-method-29 (_type_) none) + (nav-state-method-30 (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none) + (update-travel-dir-from-spheres (_type_) none) + (compute-speed-simple (_type_) none) (navigate-v1! (_type_) none) - (nav-state-method-35 () none) - (nav-state-method-36 () none) - (nav-state-method-37 () none) - (nav-state-method-38 () none) - (nav-state-method-39 () none) + (reset-target! (_type_) none) + (add-offset-to-target! (_type_ vector) none) + (navigate-v2! (_type_) none) + (set-current-poly! (_type_ nav-poly) none) + (nav-state-method-39 (_type_) symbol) (do-navigation-to-destination (_type_ vector) none) - (nav-state-method-41 () none) - (nav-state-method-42 () none) - (nav-state-method-43 () none) - (nav-state-method-44 () none) - (nav-state-method-45 () none) - (nav-state-method-46 () none) - (nav-state-method-47 () none) - (nav-state-method-48 () none) + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol) + (set-target-pos! (_type_ vector) none) + (set-virtual-cur-pos! (_type_ vector) none) + (set-travel! (_type_ vector) none) + (set-velocity! (_type_ vector) none) + (set-heading! (_type_ vector) none) + (set-speed! (_type_ meters) none) + (reset! (_type_ nav-control) none) (nav-state-method-49 () none) - (nav-state-method-50 () none) - (nav-state-method-51 () none) - (nav-state-method-52 () none) - (nav-state-method-53 () none) - (nav-state-method-54 () none) - (nav-state-method-55 () none) + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none) + (nav-state-method-51 (_type_) none) + (navigate-using-route-portals (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none) + (navigate-within-poly (_type_) none) + (clamp-travel-vector (_type_) none) ) ) @@ -178,42 +178,42 @@ ) (:methods (debug-draw (_type_) none) - (nav-control-method-10 () none) + (point-in-bsphere? (_type_ vector) symbol) (find-poly-containing-point-1 (_type_ vector) nav-poly) - (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) - (nav-control-method-13 () none) - (nav-control-method-14 () none) - (nav-control-method-15 () none) - (nav-control-method-16 () none) - (nav-control-method-17 () none) - (nav-control-method-18 () none) - (nav-control-method-19 () none) - (nav-control-method-20 () none) - (nav-control-method-21 () none) - (nav-control-method-22 () none) - (nav-control-method-23 () none) - (nav-control-method-24 () none) - (nav-control-method-25 () none) - (nav-control-method-26 () none) - (nav-control-method-27 () none) - (nav-control-method-28 () none) - (nav-control-method-29 () none) - (nav-control-method-30 () none) - (nav-control-method-31 () none) - (nav-control-method-32 () none) - (nav-control-method-33 () none) - (nav-control-method-34 () none) - (nav-control-method-35 () none) - (nav-control-method-36 () none) - (nav-control-method-37 () none) - (nav-control-method-38 () none) - (nav-control-method-39 () none) - (nav-control-method-40 () none) - (nav-control-method-41 () none) - (nav-control-method-42 () none) - (nav-control-method-43 () none) + (closest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) + (find-nearest-poly-to-point (_type_ vector) nav-poly) + (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none) + (find-poly-containing-point-2 (_type_ vector) nav-poly) + (is-above-poly-max-height? (_type_ vector float) symbol) + (is-in-mesh? (_type_ vector float) symbol) + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol) + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) + (set-spheres-from-nav-ids (_type_) none) + (add-root-sphere-to-hash! (_type_ vector int) symbol) + (get-max-rotation-rate (_type_) float) + (get-sphere-mask (_type_) uint) + (get-target-speed (_type_) meters) + (enable-extra-sphere! (_type_) none) + (disable-extra-sphere! (_type_) none) + (copy-extra-nav-sphere! (_type_ sphere) none) + (set-extra-nav-sphere-xyz! (_type_ sphere) none) + (set-extra-nav-sphere-radius! (_type_ float) none) + (set-nearest-y-thres! (_type_ float) none) + (set-nav-cull-radius! (_type_ meters) none) + (set-speed-scale! (_type_ float) none) + (set-target-speed! (_type_ meters) none) + (set-acceleration! (_type_ meters) none) + (set-turning-acceleration! (_type_ meters) none) + (set-max-rotation-rate! (_type_ float) none) + (set-sphere-mask! (_type_ uint) none) + (remove! (_type_) none) + (init! (_type_ collide-shape) none) + (display-marks? (_type_) symbol) (nav-control-method-44 () none) - (nav-control-method-45 () none) - (nav-control-method-46 () none) + (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere) + (find-sphere-ids-from-sphere-hash (_type_ symbol) none) ) ) diff --git a/goal_src/jak3/engine/nav/nav-control.gc b/goal_src/jak3/engine/nav/nav-control.gc index fd26046819..c88d1c1e2f 100644 --- a/goal_src/jak3/engine/nav/nav-control.gc +++ b/goal_src/jak3/engine/nav/nav-control.gc @@ -7,3 +7,3758 @@ ;; DECOMP BEGINS +(define *nav-triangle-test-count* 0) + +(define *nav-last-triangle-test-count* 0) + +(defun debug-nav-validate-current-poly ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector)) + (local-vars (sv-32 vector) (sv-36 float)) + (when (not (point-in-poly? arg0 arg1 arg2)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (project-point-into-poly-2d arg0 arg1 sv-32 arg2) + (set! sv-36 (vector-vector-xz-distance arg2 sv-32)) + #f + ) + ) + +(defun debug-report-nav-stats () + 0 + (none) + ) + +(defmethod relocate ((this nav-control) (offset int)) + (&+! (-> this process) offset) + (&+! (-> this shape) offset) + this + ) + +(defmethod remove! ((this nav-control)) + (remove-nav-control (-> this state mesh) this) + 0 + (none) + ) + +(defmethod enable-extra-sphere! ((this nav-control)) + (logior! (-> this shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +(defmethod disable-extra-sphere! ((this nav-control)) + (logclear! (-> this shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +(defmethod copy-extra-nav-sphere! ((this nav-control) (arg0 sphere)) + (mem-copy! (the-as pointer (-> this extra-nav-sphere)) (the-as pointer arg0) 16) + 0 + (none) + ) + +(defmethod set-extra-nav-sphere-xyz! ((this nav-control) (arg0 sphere)) + (let ((f0-0 (-> this extra-nav-sphere w))) + (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) + (set! (-> this extra-nav-sphere w) f0-0) + ) + 0 + (none) + ) + +(defmethod set-extra-nav-sphere-radius! ((this nav-control) (arg0 float)) + (set! (-> this extra-nav-sphere w) arg0) + 0 + (none) + ) + +(defmethod set-nearest-y-thres! ((this nav-control) (arg0 float)) + (set! (-> this nearest-y-threshold) arg0) + 0 + (none) + ) + +(defmethod set-nav-cull-radius! ((this nav-control) (arg0 meters)) + (set! (-> this nav-cull-radius) arg0) + 0 + (none) + ) + +(defmethod set-speed-scale! ((this nav-control) (arg0 float)) + (set! (-> this speed-scale) arg0) + 0 + (none) + ) + +(defmethod set-target-speed! ((this nav-control) (arg0 meters)) + (set! (-> this target-speed) arg0) + 0 + (none) + ) + +(defmethod get-target-speed ((this nav-control)) + (-> this target-speed) + ) + +(defmethod set-acceleration! ((this nav-control) (arg0 meters)) + (set! (-> this acceleration) arg0) + 0 + (none) + ) + +(defmethod set-turning-acceleration! ((this nav-control) (arg0 meters)) + (set! (-> this turning-acceleration) arg0) + 0 + (none) + ) + +(defmethod set-max-rotation-rate! ((this nav-control) (arg0 float)) + (set! (-> this max-rotation-rate) arg0) + 0 + (none) + ) + +(defmethod get-max-rotation-rate ((this nav-control)) + (-> this max-rotation-rate) + ) + +(defmethod set-sphere-mask! ((this nav-control) (arg0 uint)) + (set! (-> this sphere-mask) arg0) + 0 + (none) + ) + +(defmethod get-sphere-mask ((this nav-control)) + (-> this sphere-mask) + ) + +(defmethod point-in-bsphere? ((this nav-control) (arg0 vector)) + (let ((v1-1 (-> this state mesh bounds))) + (>= (-> v1-1 r) (vector-vector-distance arg0 v1-1)) + ) + ) + +(defmethod display-marks? ((this nav-control)) + (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flag display-marks))) + ) + +(defmethod init! ((this nav-control) (arg0 collide-shape)) + (set! (-> this callback-info) #f) + (logior! (-> this flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) + (let ((v1-2 this)) + (set! (-> v1-2 sphere-mask) (the-as uint #x1000f8)) + ) + 0 + (set! (-> this sphere-count) 0) + (set! (-> this sphere-array) (the-as (inline-array sphere) #f)) + (set! (-> this shape) arg0) + (set! (-> this process) (-> arg0 process)) + (set! (-> this speed-scale) 1.0) + (set! (-> this acceleration) 4096.0) + (set! (-> this turning-acceleration) 4096.0) + (set! (-> this max-rotation-rate) 131072.0) + (set! (-> this target-speed) 0.0) + (set! (-> this nav-cull-radius) 40960.0) + (reset! (-> this state) this) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement. +(defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh)) + (if (not arg1) + (set! arg1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0)) + ) + (when (not arg1) + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status error)) + ) + (go process-drawable-art-error "no nav-mesh") + (return 0) + ) + (add-process-drawable-to-nav-mesh arg1 arg0 #t) + (none) + ) + +(defmethod find-nearest-poly-to-point ((this nav-control) (arg0 vector)) + (let ((gp-0 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> gp-0 point) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 2)) + (nav-mesh-method-46 (-> this state mesh) (the-as nav-poly gp-0)) + (-> gp-0 poly) + ) + ) + +(defmethod project-point-onto-plane-of-poly ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + (project-point-onto-plane-of-poly-local + (-> this state mesh) + arg0 + arg1 + arg2 + (vector-! (new 'stack-no-clear 'vector) arg3 (the-as vector (-> this state mesh bounds))) + ) + (vector+! arg1 arg1 (the-as vector (-> this state mesh bounds))) + 0 + (none) + ) + +(defmethod is-in-mesh? ((this nav-control) (arg0 vector) (arg1 float)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (the-as vector (-> this state mesh bounds))) + (let ((a1-1 (-> this state mesh))) + (is-in-mesh-local? a1-1 v1-0 arg1 (-> this nearest-y-threshold)) + ) + ) + ) + +(defmethod debug-draw ((this nav-control)) + (local-vars (sv-32 nav-mesh) (sv-36 vector)) + (when #t + (debug-draw (-> this state mesh)) + (set! sv-32 (-> this state mesh)) + (set! sv-36 (new 'stack-no-clear 'vector)) + (if (logtest? (-> this shape nav-flags) (nav-flags has-root-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this root-nav-sphere) + (-> this root-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (if (logtest? (-> this shape nav-flags) (nav-flags has-extra-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this extra-nav-sphere) + (-> this extra-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (when (logtest? (-> this shape nav-flags) (nav-flags has-child-spheres)) + ) + (dotimes (s5-0 (-> this sphere-count)) + (let ((v1-23 (-> this state mesh work debug sphere-array s5-0))) + (vector+! sv-36 (the-as vector (-> sv-32 bounds)) (the-as vector v1-23)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + sv-36 + (- (-> v1-23 r) (-> this shape nav-radius)) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> sv-32 static-sphere-count))) + (let ((s4-0 (-> sv-32 static-sphere s5-1))) + (add-debug-sphere #t (bucket-id debug) s4-0 (-> s4-0 r) *color-blue*) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 577) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color cyan) (the-as vector2h #f)) + ) + ) + ) + (debug-draw (-> this state)) + ) + 0 + (none) + ) + +(defmethod find-poly-containing-point-1 ((this nav-control) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> v1-0 vertex)) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> v1-0 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> v1-0 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> this state mesh) v1-0) + ) + ) + +(defmethod find-poly-containing-point-2 ((this nav-control) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> v1-0 vertex)) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> v1-0 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> v1-0 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> this state mesh) v1-0) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod is-above-poly-max-height? ((this nav-control) (arg0 vector) (arg1 float)) + (let ((a1-1 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> a1-1 vertex)) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> a1-1 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> a1-1 data 20) (the-as uint 2)) + (the-as + symbol + (and (nav-mesh-method-45 (-> this state mesh) a1-1) (< (-> arg0 y) (+ (-> this state mesh bounds y) arg1))) + ) + ) + ) + +(defmethod find-first-sphere-intersecting-ray ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s5-0 (the-as sphere #f))) + (let ((f30-0 -0.000001)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) + (f0-1 (ray-circle-intersect arg0 arg1 s0-0 (-> s0-0 r))) + ) + (when (< f30-0 f0-1) + (set! s5-0 s0-0) + (set! f30-0 f0-1) + ) + ) + ) + (set! (-> arg2 x) f30-0) + ) + s5-0 + ) + ) + +(defun add-nav-sphere ((arg0 nav-control) (arg1 sphere) (arg2 int)) + (local-vars (a2-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (< (-> arg0 sphere-count) arg2) + (let ((v1-3 (-> arg0 sphere-array (-> arg0 sphere-count)))) + (let ((a2-3 arg1) + (a3-0 (-> arg0 root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-3 quad)) + (.lvf vf3 (&-> a3-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-4 vf1) + (let ((f1-0 a2-4) + (f0-1 (+ (-> arg1 r) (-> arg0 shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-1 (-> arg0 nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector v1-3) (the-as vector arg1) (the-as vector (-> arg0 state mesh bounds))) + (set! (-> v1-3 r) f0-1) + (+! (-> arg0 sphere-count) 1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 sphere)) + (local-vars (a2-6 float) (t0-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-root-sphere)) + (set! (-> arg2 quad) (-> arg1 trans quad)) + (set! (-> arg2 r) (-> arg1 nav-radius)) + (let ((v1-4 arg0) + (a3-2 16) + ) + (when (< (-> v1-4 sphere-count) a3-2) + (let ((a3-5 (-> v1-4 sphere-array (-> v1-4 sphere-count)))) + (let ((t0-3 arg2) + (t1-0 (-> v1-4 root-nav-sphere)) + ) + (.lvf vf2 (&-> t0-3 quad)) + (.lvf vf3 (&-> t1-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-4 vf1) + (let ((f1-0 t0-4) + (f0-2 (+ (-> arg2 r) (-> v1-4 shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-2 (-> v1-4 nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector a3-5) (the-as vector arg2) (the-as vector (-> v1-4 state mesh bounds))) + (set! (-> a3-5 r) f0-2) + (+! (-> v1-4 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-9 arg0) + (a0-1 (-> arg1 process nav extra-nav-sphere)) + (a1-2 16) + ) + (when (< (-> v1-9 sphere-count) a1-2) + (let ((a1-5 (-> v1-9 sphere-array (-> v1-9 sphere-count)))) + (let ((a2-5 a0-1) + (a3-6 (-> v1-9 root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-5 quad)) + (.lvf vf3 (&-> a3-6 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-6 vf1) + (let ((f1-1 a2-6) + (f0-4 (+ (-> a0-1 w) (-> v1-9 shape nav-radius))) + ) + (when (and (< 0.0 f1-1) (let ((f2-9 (+ f0-4 (-> v1-9 nav-cull-radius)))) + (< f1-1 (* f2-9 f2-9)) + ) + ) + (vector-! (the-as vector a1-5) a0-1 (the-as vector (-> v1-9 state mesh bounds))) + (set! (-> a1-5 r) f0-4) + (+! (-> v1-9 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +(defmethod find-sphere-ids-from-sphere-hash ((this nav-control) (arg0 symbol)) + (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) + (set! (-> s5-0 bsphere quad) (-> this root-nav-sphere quad)) + (+! (-> s5-0 bsphere r) (-> this nav-cull-radius)) + (set! (-> s5-0 max-len) 16) + (set! (-> s5-0 mask) (-> this sphere-mask)) + (set! (-> s5-0 array) (-> this sphere-id-array)) + (set! (-> s5-0 y-threshold) (-> this nearest-y-threshold)) + (sphere-hash-method-29 (-> this state mesh sphere-hash) s5-0) + (set! (-> this sphere-count) (-> s5-0 len)) + ) + 0 + (none) + ) + +(defmethod set-spheres-from-nav-ids ((this nav-control)) + (let ((v1-2 (-> this state mesh sphere-hash sphere-array)) + (a1-0 (-> this sphere-id-array)) + (a2-1 (-> this state mesh bounds)) + (a3-0 (-> this root-nav-sphere)) + (t0-0 (-> this sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> v1-2 (-> a1-0 t1-0))) + (t2-4 (-> this sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-1)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (none) + ) + +(deftype nav-control-cfs-work (structure) + ((in-dir vector :inline) + (right-dir vector :inline) + (best-dir vector 2 :inline) + (temp-dir vector 2 :inline) + (away-dir vector :inline) + (best-dir-angle degrees 2) + (ignore-mask uint64) + (initial-ignore-mask uint64) + (i-sphere int32) + (i-first-sphere int32) + (i-inside-sphere int32) + (inside-sphere-dist float) + (sign float) + (travel-len float) + (dist2 float) + (inside-dist float) + (rand-angle float) + (dir-update basic) + (debug-offset vector :inline) + ) + ) + + +(defun circle-tangent-directions ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t1-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (vector-! t1-0 arg1 arg0) + (set! (-> t1-0 y) 0.0) + (let ((a0-1 t0-0)) + (let ((t3-2 t1-0)) + (set! (-> a0-1 quad) (-> t3-2 quad)) + ) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t2-3 f0-1)) + (.mov vf3 t2-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-1 quad) vf1) + ) + (set! (-> v1-0 quad) (-> t0-0 quad)) + (set! (-> v1-0 x) (-> t0-0 z)) + (set! (-> v1-0 z) (- (-> t0-0 x))) + (let* ((f0-5 (-> arg1 w)) + (f1-1 (vector-dot t0-0 t1-0)) + (f0-6 (fmin f0-5 f1-1)) + (f2-0 f1-1) + (f2-2 (* f2-0 f2-0)) + (f3-0 f0-6) + (f2-4 (sqrtf (- f2-2 (* f3-0 f3-0)))) + (f3-4 (/ 1.0 f1-1)) + (f1-3 (* f2-4 f3-4)) + (f0-7 (* f0-6 f3-4)) + (a0-9 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-9 t0-0 f1-3) + (let ((t0-1 arg2)) + (let ((a1-3 a0-9)) + (let ((a2-1 v1-0)) + (let ((t1-1 f0-7)) + (.mov vf7 t1-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> a1-3 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 (&-> t0-1 quad) vf6) + ) + (let ((v0-0 arg3)) + (let ((a1-4 (- f0-7))) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> v1-0 quad)) + (.lvf vf4 (&-> a0-9 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + ) + +(defun circle-ray-intersection? ((arg0 vector) (arg1 vector) (arg2 float) (arg3 vector)) + (let ((f1-1 (- (-> arg3 x) (-> arg0 x))) + (f0-2 (- (-> arg3 z) (-> arg0 z))) + ) + (when (< (fabs (- (* (-> arg1 z) f1-1) (* (-> arg1 x) f0-2))) (-> arg3 w)) + (let ((f2-7 (+ (* (-> arg1 x) f1-1) (* (-> arg1 z) f0-2)))) + (cond + ((< f2-7 0.0) + (let ((f0-5 (+ (* f1-1 f1-1) (* f0-2 f0-2))) + (f1-4 (-> arg3 w)) + ) + (< f0-5 (* f1-4 f1-4)) + ) + ) + ((< arg2 f2-7) + (let* ((f0-8 (- (-> arg3 x) (+ (-> arg0 x) (* (-> arg1 x) arg2)))) + (f1-10 (- (-> arg3 z) (+ (-> arg0 z) (* (-> arg1 z) arg2)))) + (f0-11 (+ (* f0-8 f0-8) (* f1-10 f1-10))) + (f1-13 (-> arg3 w)) + ) + (< f0-11 (* f1-13 f1-13)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + ) + +(defun find-closest-circle-ray-intersection ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int) (arg4 (inline-array vector)) (arg5 int)) + 1.0 + (let ((v0-0 -1)) + (vector-float*! (new 'stack-no-clear 'vector) arg1 arg2) + (let ((v1-3 0)) + (b! #t cfg-18 :delay (nop!)) + (label cfg-1) + (b! (logtest? arg5 (ash 1 v1-3)) cfg-17 :delay (empty-form)) + (let* ((t4-0 arg0) + (t3-1 arg1) + (f0-2 arg2) + (t2-6 (-> arg4 v1-3)) + (f2-1 (- (-> t2-6 x) (-> t4-0 x))) + (f1-2 (- (-> t2-6 z) (-> t4-0 z))) + ) + (b! + (not (when (< (fabs (- (* (-> t3-1 z) f2-1) (* (-> t3-1 x) f1-2))) (-> t2-6 w)) + (let ((f3-7 (+ (* (-> t3-1 x) f2-1) (* (-> t3-1 z) f1-2)))) + (cond + ((< f3-7 0.0) + (let ((f0-5 (+ (* f2-1 f2-1) (* f1-2 f1-2))) + (f1-5 (-> t2-6 w)) + ) + (< f0-5 (* f1-5 f1-5)) + ) + ) + ((< f0-2 f3-7) + (let* ((f1-9 (- (-> t2-6 x) (+ (-> t4-0 x) (* (-> t3-1 x) f0-2)))) + (f2-5 (- (-> t2-6 z) (+ (-> t4-0 z) (* (-> t3-1 z) f0-2)))) + (f0-10 (+ (* f1-9 f1-9) (* f2-5 f2-5))) + (f1-12 (-> t2-6 w)) + ) + (< f0-10 (* f1-12 f1-12)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + cfg-17 + :delay (empty-form) + ) + ) + (set! v0-0 v1-3) + (b! #t cfg-20 :delay (nop!)) + (label cfg-17) + (+! v1-3 1) + (label cfg-18) + (b! (< v1-3 arg3) cfg-1) + ) + (label cfg-20) + v0-0 + ) + ) + +(defun compute-dir-parm ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((a2-1 (the-as number (vector-dot arg0 arg2))) + (a3-1 #xffffffff80000000) + (v1-2 #x3f800000) + ) + (* (the-as float (logior (logand (the-as uint a2-1) a3-1) v1-2)) (- 1.0 (vector-dot arg0 arg1))) + ) + ) + +(defmethod avoid-spheres-1! ((this nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (set! (-> s5-0 i-inside-sphere) -1) + (set! (-> s5-0 inside-sphere-dist) 0.0) + (let ((f0-10 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-10 f0-10)) + ) + (dotimes (v1-10 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-10))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-14 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-14 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-10)) + ) + (set! (-> s5-0 inside-dist) (- (-> a0-13 r) (sqrtf (-> s5-0 dist2)))) + (when (< (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + (set! (-> s5-0 i-inside-sphere) v1-10) + (set! (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> this sphere-count) + (-> this sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-13 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-13) cfg-13 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-43 :delay (nop!)) + (label cfg-13) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-17 (-> this sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-17 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-20 2) + (let ((a0-28 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-20)))) + (shift-arith-right-32 a0-29 a0-28 31) + ) + (let ((a0-30 (logand a0-29 1)) + (f0-27 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-20)))) + ) + (set! (-> s5-0 best-dir a0-30 quad) (-> s5-0 temp-dir v1-20 quad)) + (set! (-> s5-0 best-dir-angle a0-30) f0-27) + ) + ) + 0 + (set! (-> s5-0 sign) 1.0) + (let ((s3-0 0)) + (b! #t cfg-34 :delay (nop!)) + (label cfg-20) + (-> s5-0 i-first-sphere) + (set! (-> s5-0 dir-update) (the-as basic #t)) + (set! (-> s5-0 ignore-mask) (-> s5-0 initial-ignore-mask)) + (b! #t cfg-30 :delay (nop!)) + (label cfg-21) + (+! (-> s5-0 ignore-mask) (ash 1 v1-28)) + (circle-tangent-directions + (-> arg0 current-pos) + (-> this sphere-array v1-28) + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + (set! (-> s5-0 dir-update) #f) + (dotimes (v1-30 2) + (let* ((f0-29 (-> s5-0 sign)) + (a1-31 (-> s5-0 temp-dir v1-30)) + (a0-39 (-> s5-0 in-dir)) + (a2-14 (-> s5-0 right-dir)) + (a3-7 (the-as number (vector-dot a1-31 a2-14))) + (t0-1 #xffffffff80000000) + (a2-16 #x3f800000) + (f0-30 (* f0-29 (* (the-as float (logior (logand (the-as uint a3-7) (the-as uint t0-1)) a2-16)) + (- 1.0 (vector-dot a1-31 a0-39)) + ) + ) + ) + ) + (when (< (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 best-dir s3-0 quad) (-> s5-0 temp-dir v1-30 quad)) + (set! (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 dir-update) (the-as basic #t)) + ) + ) + ) + (label cfg-30) + (when (-> s5-0 dir-update) + (set! v1-28 (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 best-dir s3-0) + (-> s5-0 travel-len) + (-> this sphere-count) + (-> this sphere-array) + (the-as int (-> s5-0 ignore-mask)) + ) + ) + (b! (!= v1-28 -1) cfg-21 :delay (nop!)) + ) + (set! (-> s5-0 sign) (* -1.0 (-> s5-0 sign))) + (+! s3-0 1) + (label cfg-34) + (b! (< s3-0 2) cfg-20) + ) + (when (!= (-> s5-0 i-inside-sphere) -1) + (let ((s4-1 (-> this sphere-array (-> s5-0 i-inside-sphere)))) + (vector-! (-> s5-0 away-dir) (-> arg0 current-pos) (the-as vector s4-1)) + (set! (-> s5-0 away-dir y) 0.0) + (when (>= 40.96 (vector-length (-> s5-0 away-dir))) + (set! (-> s5-0 rand-angle) (* 65536.0 (rand-vu))) + (set! (-> s5-0 away-dir x) (cos (-> s5-0 rand-angle))) + (set! (-> s5-0 away-dir z) (sin (-> s5-0 rand-angle))) + ) + (let ((v1-51 (-> s5-0 away-dir))) + (let ((f0-42 1.0)) + (.lvf vf1 (&-> v1-51 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-60 f0-42)) + (.mov vf3 a0-60) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-51 quad) vf1) + ) + (let ((f0-44 (/ (-> s5-0 inside-sphere-dist) (-> s4-1 r)))) + (let ((v1-52 (-> s5-0 best-dir))) + (let ((a0-61 (-> s5-0 best-dir)) + (a1-39 (-> s5-0 away-dir)) + (f1-19 f0-44) + ) + (.lvf vf1 (&-> a0-61 0 quad)) + (.lvf vf2 (&-> a1-39 quad)) + (let ((a0-62 f1-19)) + (.mov vf4 a0-62) + ) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-52 0 quad) vf3) + ) + (let ((v1-53 (-> s5-0 best-dir 1))) + (let ((a0-63 (-> s5-0 best-dir 1)) + (a1-40 (-> s5-0 away-dir)) + ) + (.lvf vf1 (&-> a0-63 quad)) + (.lvf vf2 (&-> a1-40 quad)) + ) + (let ((a0-64 f0-44)) + (.mov vf4 a0-64) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-53 quad) vf3) + ) + ) + ) + (let ((v1-54 (-> s5-0 best-dir))) + (let ((f0-45 1.0)) + (.lvf vf1 (&-> v1-54 0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-66 f0-45)) + (.mov vf3 a0-66) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-54 0 quad) vf1) + ) + (let ((v1-55 (-> s5-0 best-dir 1))) + (let ((f0-46 1.0)) + (.lvf vf1 (&-> v1-55 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-68 f0-46)) + (.mov vf3 a0-68) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-55 quad) vf1) + ) + ) + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-52 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-41 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-52) + 0 + 1 + ) + ) + (v1-65 (- 1 a1-41)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-41) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-65) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-43) + (-> arg0 avoiding-sphere?) + ) + ) + +(defmethod avoid-spheres-2! ((this nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (a0-32 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (let ((f0-9 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-9 f0-9)) + ) + (dotimes (v1-9 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-9))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-13 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-13 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-9)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> this sphere-count) + (-> this sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-12 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-12) cfg-11 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-21 :delay (nop!)) + (label cfg-11) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-15 (-> this sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-15 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-19 2) + (let ((a0-31 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-19)))) + (shift-arith-right-32 a0-32 a0-31 31) + ) + (let ((a0-33 (logand a0-32 1)) + (f0-22 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-19)))) + ) + (set! (-> s5-0 best-dir a0-33 quad) (-> s5-0 temp-dir v1-19 quad)) + (set! (-> s5-0 best-dir-angle a0-33) f0-22) + ) + ) + 0 + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-28 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-25 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-28) + 0 + 1 + ) + ) + (v1-32 (- 1 a1-25)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-25) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-32) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-21) + (-> arg0 avoiding-sphere?) + ) + ) + +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 clamp-travel-vector-to-mesh-return-info) + ) + (clamp-vector-to-mesh-no-gaps (-> this state mesh) arg0 arg1 arg2 arg3) + 0 + (none) + ) + +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) + (local-vars + (v1-12 symbol) + (sv-112 nav-ray) + (sv-116 vector) + (sv-120 symbol) + (sv-124 nav-mesh-work) + (sv-128 int) + (sv-136 int) + (sv-144 nav-mesh-work) + (sv-148 nav-poly) + (sv-152 uint) + (sv-156 (pointer int8)) + (sv-160 (pointer int8)) + (sv-164 float) + (sv-168 float) + (sv-172 vector) + (sv-176 vector) + (sv-180 float) + (sv-184 float) + (sv-188 uint) + (sv-192 vector) + (sv-196 vector) + (sv-200 float) + (sv-204 float) + (sv-208 float) + (sv-212 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg3 found-boundary) #f) + (set! (-> arg3 gap-poly) #f) + (set! sv-112 (new 'stack-no-clear 'nav-ray)) + (set! sv-116 (new 'stack-no-clear 'vector)) + (set! sv-120 (the-as symbol #f)) + (set! sv-124 (-> this work)) + (vector-! sv-116 arg0 (the-as vector (-> this bounds))) + (set! (-> sv-112 current-poly) arg1) + (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) + (vector+! (-> sv-112 dest-pos) sv-116 arg2) + (let* ((t2-0 this) + (v1-11 (-> sv-112 dest-pos)) + (a1-4 (-> arg1 vertex-count)) + (a2-1 (-> arg1 vertex)) + (t1-4 (-> t2-0 work vert0-table)) + (t2-2 (-> t2-0 work vert1-table)) + ) + (dotimes (t3-0 (the-as int a1-4)) + (let* ((t4-3 (-> a2-1 (-> t1-4 t3-0))) + (t5-3 (-> a2-1 (-> t2-2 t3-0))) + (f0-1 (- (-> t4-3 z) (-> t5-3 z))) + (f1-2 (- (-> t5-3 x) (-> t4-3 x))) + (f2-2 (- (-> v1-11 x) (-> t4-3 x))) + (f3-2 (- (-> v1-11 z) (-> t4-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-12 #f) + (goto cfg-7) + ) + ) + ) + ) + (set! v1-12 #t) + (label cfg-7) + (b! v1-12 cfg-41 :delay (nop!)) + (set! sv-128 0) + (let ((v1-16 sv-112)) + (vector-! (-> v1-16 dir) (-> v1-16 dest-pos) (-> v1-16 current-pos)) + (set! (-> v1-16 dir y) 0.0) + (let ((a1-6 (-> v1-16 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> a1-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a2-4 f0-5)) + (.mov vf3 a2-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-6 quad) vf1) + ) + (set! (-> v1-16 next-poly) #f) + (set! (-> v1-16 len) 0.0) + (set! (-> v1-16 last-edge) -1) + (set! (-> v1-16 terminated) #f) + (set! (-> v1-16 reached-dest) #f) + (set! (-> v1-16 hit-boundary) #f) + (set! (-> v1-16 hit-gap) #f) + (set! (-> v1-16 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= sv-128 15) (-> sv-112 terminated)) + (set! sv-128 (+ sv-128 1)) + (let ((a1-9 this) + (v1-20 sv-112) + ) + (set! sv-136 -1) + (set! sv-144 (-> a1-9 work)) + (set! sv-148 (-> v1-20 current-poly)) + (set! sv-152 (-> v1-20 current-poly vertex-count)) + (set! sv-156 (-> a1-9 work vert0-table)) + (set! sv-160 (-> a1-9 work vert1-table)) + (set! sv-164 (- (-> v1-20 dest-pos x) (-> v1-20 current-pos x))) + (set! sv-168 (- (-> v1-20 dest-pos z) (-> v1-20 current-pos z))) + (dotimes (a2-14 (the-as int sv-152)) + (set! sv-172 (-> sv-148 vertex (-> sv-156 a2-14))) + (set! sv-176 (-> sv-148 vertex (-> sv-160 a2-14))) + (set! sv-180 (- (-> sv-172 z) (-> sv-176 z))) + (set! sv-184 (- (-> sv-176 x) (-> sv-172 x))) + (let ((f0-17 (+ (* sv-164 sv-180) (* sv-168 sv-184)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-180 (- (-> sv-172 x) (-> v1-20 current-pos x))) + (* sv-184 (- (-> sv-172 z) (-> v1-20 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-136 a2-14) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-164 (* sv-164 f0-19)) + (set! sv-168 (* sv-168 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-164 (-> v1-20 dir x)) (* sv-168 (-> v1-20 dir z))))) + (+! (-> v1-20 len) f0-23) + ) + 0 + (set! (-> v1-20 next-poly) #f) + (cond + ((= sv-136 -1) + (set! (-> v1-20 current-pos quad) (-> v1-20 dest-pos quad)) + (set! (-> v1-20 reached-dest) #t) + (set! (-> v1-20 terminated) #t) + ) + (else + (+! (-> v1-20 current-pos x) sv-164) + (+! (-> v1-20 current-pos z) sv-168) + (set! sv-188 (-> sv-148 adj-poly sv-136)) + (if (!= sv-188 255) + (set! (-> v1-20 next-poly) (-> a1-9 poly-array sv-188)) + ) + (cond + ((and (-> v1-20 next-poly) (not (logtest? (-> v1-20 next-poly pat) (-> v1-20 ignore)))) + (set! (-> v1-20 current-poly) (-> v1-20 next-poly)) + ) + (else + (set! (-> v1-20 last-edge) sv-136) + (if (-> v1-20 next-poly) + (set! (-> v1-20 hit-gap) #t) + (set! (-> v1-20 hit-boundary) #t) + ) + (set! (-> v1-20 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + (cond + ((or (-> sv-112 hit-boundary) (-> sv-112 hit-gap)) + (set! sv-192 (-> sv-112 current-poly vertex (-> sv-124 vert0-table (-> sv-112 last-edge)))) + (set! sv-196 (-> sv-112 current-poly vertex (-> sv-124 vert1-table (-> sv-112 last-edge)))) + (set! sv-200 (- (-> sv-192 z) (-> sv-196 z))) + (set! sv-204 (- (-> sv-196 x) (-> sv-192 x))) + (set! sv-208 (-> arg2 x)) + (set! sv-212 (-> arg2 z)) + (let* ((f0-35 sv-200) + (f0-37 (* f0-35 f0-35)) + (f1-27 sv-204) + (f0-39 (sqrtf (+ f0-37 (* f1-27 f1-27)))) + (f0-41 (/ 1.0 f0-39)) + ) + (set! sv-200 (* sv-200 f0-41)) + (set! sv-204 (* sv-204 f0-41)) + ) + (set! (-> arg3 found-boundary) #t) + (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (the-as vector (-> this bounds))) + (set! (-> arg3 boundary-normal x) sv-200) + (set! (-> arg3 boundary-normal y) 0.0) + (set! (-> arg3 boundary-normal z) sv-204) + (set! (-> arg3 poly) (-> sv-112 current-poly)) + (set! (-> arg3 edge) (-> sv-112 last-edge)) + (vector+! (-> arg3 vert-0) sv-192 (the-as vector (-> this bounds))) + (vector+! (-> arg3 vert-1) sv-196 (the-as vector (-> this bounds))) + (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) + (if (-> sv-112 hit-gap) + (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) + ) + ) + (else + ) + ) + (vector-! arg2 (-> sv-112 current-pos) sv-116) + 0 + (label cfg-41) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 23 nav-mesh) has a return type of none, but the expression builder found a return statement. +(defmethod find-adjacent-bounds-one ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) + (local-vars (sv-16 nav-poly)) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) + ) + (set! sv-16 arg1) + (let ((s2-0 (-> sv-16 vertex arg2)) + (s3-0 sv-16) + (s1-0 100) + ) + (while (begin (label cfg-21) (nonzero? s1-0)) + (+! s1-0 -1) + (if (nonzero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 arg3 (-> s3-0 vertex-count))) (-> s3-0 vertex-count)))) + ) + (let ((v1-12 (-> s3-0 adj-poly arg2))) + (cond + ((= v1-12 255) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> s3-0 vertex-count)))) + ) + (vector+! arg0 (-> s3-0 vertex arg2) (the-as vector (-> this bounds))) + (return #f) + ) + (else + (set! s3-0 (-> this poly-array v1-12)) + (when (= s3-0 sv-16) + (format 0 "ERROR: find-adjacent-bounds-one cur-poly = start-poly after step~%") + (return #f) + ) + (dotimes (s0-0 (the-as int (-> s3-0 vertex-count))) + (when (vector= (-> s3-0 vertex s0-0) s2-0) + (set! arg2 s0-0) + (goto cfg-21) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one couldn't match vertex~%") + (return #f) + ) + ) + ) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one took too many steps~%") + (none) + ) + +(defmethod set-normals-from-adjacent-bounds ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) + (find-adjacent-bounds-one this (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) + (find-adjacent-bounds-one this (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) + (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) + (vector-! (-> arg0 next-normal) (-> arg0 vert-next) (-> arg0 vert-1)) + (vector-normalize! (-> arg0 prev-normal) 1.0) + (vector-normalize! (-> arg0 next-normal) 1.0) + (let ((f0-0 (-> arg0 prev-normal x))) + (set! (-> arg0 prev-normal x) (-> arg0 prev-normal z)) + (set! (-> arg0 prev-normal z) f0-0) + ) + (let ((f0-1 (-> arg0 next-normal x))) + (set! (-> arg0 next-normal x) (-> arg0 next-normal z)) + (set! (-> arg0 next-normal z) f0-1) + ) + (set! (-> arg0 prev-normal x) (- (-> arg0 prev-normal x))) + (set! (-> arg0 next-normal x) (- (-> arg0 next-normal x))) + 0 + (none) + ) + +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (local-vars + (v1-11 symbol) + (v1-22 symbol) + (sv-96 nav-ray) + (sv-100 symbol) + (sv-104 int) + (sv-112 nav-mesh-work) + (sv-120 int) + (sv-128 int) + (sv-136 nav-mesh-work) + (sv-140 nav-poly) + (sv-144 uint) + (sv-148 (pointer int8)) + (sv-152 (pointer int8)) + (sv-156 float) + (sv-160 float) + (sv-164 vector) + (sv-168 vector) + (sv-172 float) + (sv-176 float) + (sv-180 uint) + (sv-184 vector) + (sv-188 vector) + (sv-192 float) + (sv-196 float) + (sv-200 float) + (sv-204 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when arg5 + (set! (-> arg5 found-boundary) #f) + (set! (-> arg5 gap-poly) #f) + ) + (set! sv-96 (new 'stack-no-clear 'nav-ray)) + (set! sv-100 (the-as symbol #f)) + (set! sv-104 0) + (set! sv-112 (-> this work)) + (set! (-> sv-96 current-poly) arg1) + (set! (-> sv-96 current-pos quad) (-> arg0 quad)) + (vector+! (-> sv-96 dest-pos) arg0 arg2) + (let* ((t6-0 this) + (t4-2 arg1) + (v1-10 (-> sv-96 dest-pos)) + (t3-3 (-> t4-2 vertex-count)) + (t4-3 (-> t4-2 vertex)) + (t5-1 (-> t6-0 work vert0-table)) + (t6-2 (-> t6-0 work vert1-table)) + ) + (dotimes (t7-0 (the-as int t3-3)) + (let* ((t8-3 (-> t4-3 (-> t5-1 t7-0))) + (t9-3 (-> t4-3 (-> t6-2 t7-0))) + (f0-1 (- (-> t8-3 z) (-> t9-3 z))) + (f1-2 (- (-> t9-3 x) (-> t8-3 x))) + (f2-2 (- (-> v1-10 x) (-> t8-3 x))) + (f3-2 (- (-> v1-10 z) (-> t8-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-11 #f) + (goto cfg-9) + ) + ) + ) + ) + (set! v1-11 #t) + (label cfg-9) + (b! v1-11 cfg-62 :delay (nop!)) + (until sv-100 + (set! sv-120 0) + (let ((v1-15 sv-96)) + (vector-! (-> v1-15 dir) (-> v1-15 dest-pos) (-> v1-15 current-pos)) + (set! (-> v1-15 dir y) 0.0) + (let ((t3-5 (-> v1-15 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> t3-5 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t4-6 f0-5)) + (.mov vf3 t4-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t3-5 quad) vf1) + ) + (set! (-> v1-15 next-poly) #f) + (set! (-> v1-15 len) 0.0) + (set! (-> v1-15 last-edge) -1) + (set! (-> v1-15 terminated) #f) + (set! (-> v1-15 reached-dest) #f) + (set! (-> v1-15 hit-boundary) #f) + (set! (-> v1-15 hit-gap) #f) + (set! (-> v1-15 ignore) (the-as uint 3)) + ) + 0 + (until v1-22 + (set! sv-120 (+ sv-120 1)) + (let ((t3-8 this) + (v1-19 sv-96) + ) + (set! sv-128 -1) + (set! sv-136 (-> t3-8 work)) + (set! sv-140 (-> v1-19 current-poly)) + (set! sv-144 (-> v1-19 current-poly vertex-count)) + (set! sv-148 (-> t3-8 work vert0-table)) + (set! sv-152 (-> t3-8 work vert1-table)) + (set! sv-156 (- (-> v1-19 dest-pos x) (-> v1-19 current-pos x))) + (set! sv-160 (- (-> v1-19 dest-pos z) (-> v1-19 current-pos z))) + (dotimes (t4-16 (the-as int sv-144)) + (set! sv-164 (-> sv-140 vertex (-> sv-148 t4-16))) + (set! sv-168 (-> sv-140 vertex (-> sv-152 t4-16))) + (set! sv-172 (- (-> sv-164 z) (-> sv-168 z))) + (set! sv-176 (- (-> sv-168 x) (-> sv-164 x))) + (let ((f0-17 (+ (* sv-156 sv-172) (* sv-160 sv-176)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-172 (- (-> sv-164 x) (-> v1-19 current-pos x))) + (* sv-176 (- (-> sv-164 z) (-> v1-19 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-128 t4-16) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-156 (* sv-156 f0-19)) + (set! sv-160 (* sv-160 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-156 (-> v1-19 dir x)) (* sv-160 (-> v1-19 dir z))))) + (+! (-> v1-19 len) f0-23) + ) + 0 + (set! (-> v1-19 next-poly) #f) + (cond + ((= sv-128 -1) + (set! (-> v1-19 current-pos quad) (-> v1-19 dest-pos quad)) + (set! (-> v1-19 reached-dest) #t) + (set! (-> v1-19 terminated) #t) + ) + (else + (+! (-> v1-19 current-pos x) sv-156) + (+! (-> v1-19 current-pos z) sv-160) + (set! sv-180 (-> sv-140 adj-poly sv-128)) + (if (!= sv-180 255) + (set! (-> v1-19 next-poly) (-> t3-8 poly-array sv-180)) + ) + (cond + ((and (-> v1-19 next-poly) (not (logtest? (-> v1-19 next-poly pat) (-> v1-19 ignore)))) + (set! (-> v1-19 current-poly) (-> v1-19 next-poly)) + ) + (else + (set! (-> v1-19 last-edge) sv-128) + (if (-> v1-19 next-poly) + (set! (-> v1-19 hit-gap) #t) + (set! (-> v1-19 hit-boundary) #t) + ) + (set! (-> v1-19 terminated) #t) + ) + ) + ) + ) + ) + 0 + (set! v1-22 (or (>= sv-120 15) (or (>= (-> sv-96 len) (fmax 20480.0 arg3)) (-> sv-96 terminated)))) + ) + (cond + ((and (-> sv-96 hit-boundary) (and (< (-> sv-96 len) arg3) (!= (-> sv-96 last-edge) -1) (< sv-104 1))) + (set! sv-104 (+ sv-104 1)) + (set! sv-184 (-> arg1 vertex (-> sv-112 vert0-table (-> sv-96 last-edge)))) + (set! sv-188 (-> arg1 vertex (-> sv-112 vert1-table (-> sv-96 last-edge)))) + (set! sv-192 (- (-> sv-184 z) (-> sv-188 z))) + (set! sv-196 (- (-> sv-188 x) (-> sv-184 x))) + (set! sv-200 (-> arg2 x)) + (set! sv-204 (-> arg2 z)) + (let* ((f0-37 sv-192) + (f0-39 (* f0-37 f0-37)) + (f1-30 sv-196) + (f0-41 (sqrtf (+ f0-39 (* f1-30 f1-30)))) + (f0-43 (/ 1.0 f0-41)) + ) + (set! sv-192 (* sv-192 f0-43)) + (set! sv-196 (* sv-196 f0-43)) + ) + (when arg5 + (set! (-> arg5 found-boundary) #t) + (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (the-as vector (-> this bounds))) + (set! (-> arg5 boundary-normal x) sv-192) + (set! (-> arg5 boundary-normal y) 0.0) + (set! (-> arg5 boundary-normal z) sv-196) + (set! (-> arg5 poly) (-> sv-96 current-poly)) + (set! (-> arg5 edge) (-> sv-96 last-edge)) + (vector+! (-> arg5 vert-0) sv-184 (the-as vector (-> this bounds))) + (vector+! (-> arg5 vert-1) sv-188 (the-as vector (-> this bounds))) + ) + (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) + (cond + (arg4 + (let ((f0-49 (* 1.01 (+ (* sv-192 sv-200) (* sv-196 sv-204))))) + (set! sv-200 (- sv-200 (* sv-192 f0-49))) + (set! sv-204 (- sv-204 (* sv-196 f0-49))) + ) + (+! (-> sv-96 dest-pos x) sv-200) + (+! (-> sv-96 dest-pos z) sv-204) + ) + (else + (set! sv-100 #t) + ) + ) + ) + ((-> sv-96 hit-gap) + (if arg5 + (set! (-> arg5 gap-poly) (-> sv-96 next-poly)) + ) + (set! sv-100 #t) + ) + (else + (set! sv-100 #t) + ) + ) + ) + (vector-! arg2 (-> sv-96 current-pos) arg0) + 0 + (label cfg-62) + 0 + (none) + ) + ) + +(defmethod find-first-sphere-and-update-avoid-params ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s2-1 + (vector-! (new 'stack-no-clear 'vector) (-> this root-nav-sphere) (the-as vector (-> this state mesh bounds))) + ) + (f30-0 -1.0) + ) + (let ((s3-0 -1)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) + (f0-2 (ray-circle-intersect s2-1 arg0 s0-0 (+ -409.6 (-> s0-0 r)))) + ) + (when (>= f0-2 0.0) + (let ((v1-5 (new 'stack-no-clear 'vector))) + (vector-! v1-5 (the-as vector s0-0) s2-1) + (when (>= (vector-dot v1-5 arg0) 0.0) + (when (or (< f30-0 0.0) (< f0-2 f30-0)) + (set! f30-0 f0-2) + (set! s3-0 s1-0) + ) + ) + ) + ) + ) + ) + (when arg1 + (set! (-> arg1 current-pos x) f30-0) + (when (>= f30-0 0.0) + (vector+float*! (-> arg1 travel) (-> this root-nav-sphere) arg0 f30-0) + (let ((a0-9 (-> this sphere-array s3-0)) + (v1-19 (new 'stack-no-clear 'vector)) + ) + (vector+! v1-19 (the-as vector a0-9) (the-as vector (-> this state mesh bounds))) + (vector-! (-> arg1 pref-dir) (-> arg1 travel) v1-19) + ) + (set! (-> arg1 pref-dir w) 1.0) + (let ((v1-21 (-> arg1 pref-dir))) + (let ((f0-6 1.0)) + (.lvf vf1 (&-> v1-21 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-12 f0-6)) + (.mov vf3 a0-12) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-21 quad) vf1) + ) + ) + ) + ) + f30-0 + ) + ) + ) + +;; WARN: Return type mismatch none vs symbol. +(defmethod add-root-sphere-to-hash! ((this nav-control) (arg0 vector) (arg1 int)) + (the-as symbol (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) + (find-nav-sphere-ids + (-> this state mesh sphere-hash) + (the-as find-nav-sphere-ids-params arg0) + (logand arg1 255) + (the-as int (-> this root-sphere-id)) + ) + ) + ) + ) + +(defmethod reset! ((this nav-state) (arg0 nav-control)) + (set! (-> this nav) arg0) + (set! (-> this flags) (nav-state-flag)) + (set! (-> this current-poly) #f) + (set! (-> this next-poly) #f) + (set! (-> this target-poly) #f) + (set! (-> this user-poly) #f) + 0 + (none) + ) + +(defmethod relocate ((this nav-state) (offset int)) + (break!) + (&+! (-> this nav) offset) + this + ) + +(defmethod get-velocity ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this velocity quad)) + arg0 + ) + +(defmethod get-heading ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this heading quad)) + arg0 + ) + +(defmethod get-target-pos ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this target-pos quad)) + arg0 + ) + +(defmethod get-current-poly ((this nav-state)) + (-> this current-poly) + ) + +(defmethod get-speed ((this nav-state)) + (-> this speed) + ) + +(defmethod get-rotation-rate ((this nav-state)) + (-> this rotation-rate) + ) + +(defmethod get-travel ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this travel quad)) + arg0 + ) + +(defmethod set-velocity! ((this nav-state) (arg0 vector)) + (set! (-> this velocity quad) (-> arg0 quad)) + 0 + (none) + ) + +(defmethod set-heading! ((this nav-state) (arg0 vector)) + (set! (-> this heading quad) (-> arg0 quad)) + 0 + (none) + ) + +(defmethod set-speed! ((this nav-state) (arg0 meters)) + (set! (-> this speed) arg0) + 0 + (none) + ) + +(defmethod set-target-pos! ((this nav-state) (arg0 vector)) + (logclear! (-> this flags) (nav-state-flag directional-mode)) + (logior! (-> this flags) (nav-state-flag target-poly-dirty)) + (set! (-> this target-pos quad) (-> arg0 quad)) + 0 + (none) + ) + +(defmethod set-virtual-cur-pos! ((this nav-state) (arg0 vector)) + (logior! (-> this flags) (nav-state-flag use-position)) + (set! (-> this virtual-current-pos-local quad) (-> arg0 quad)) + 0 + (none) + ) + +(defmethod set-travel! ((this nav-state) (arg0 vector)) + (logior! (-> this flags) (nav-state-flag directional-mode)) + (set! (-> this travel quad) (-> arg0 quad)) + 0 + (none) + ) + +(defmethod copy-nav-state! ((this nav-state) (arg0 (pointer nav-state))) + (mem-copy! (the-as pointer this) arg0 176) + 0 + (none) + ) + +(defmethod nav-state-method-10 ((this nav-state)) + 0 + (none) + ) + +(defmethod debug-draw ((this nav-state)) + (let ((s5-0 (-> this mesh))) + (if (-> this next-poly) + (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) + ) + (if (-> this target-poly) + (debug-draw-poly s5-0 (-> this target-poly) *color-yellow*) + ) + (if (-> this current-poly) + (debug-draw-poly s5-0 (-> this current-poly) *color-red*) + ) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-pos) *color-yellow*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> this current-pos) + (-> this travel) + (meters 0.00024414062) + *color-white* + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + (-> this mesh work debug) + (set! (-> s5-1 quad) (-> this current-pos quad)) + (let ((f30-0 (-> s5-1 y))) + (set! (-> s5-1 y) (+ 2048.0 f30-0)) + (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> this heading) (meters 1) *color-yellow*) + (set! (-> s5-1 y) (+ 4096.0 f30-0)) + ) + ) + 0 + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (vector+! (new 'stack-no-clear 'vector) (-> this current-pos) (-> this travel)) + *color-white* + ) + 0 + (none) + ) + +(defmethod set-current-poly! ((this nav-state) (arg0 nav-poly)) + (set! (-> this current-poly) arg0) + 0 + (none) + ) + +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-state) (arg0 vector)) + (when (-> this current-poly) + (clamp-vector-to-mesh-cross-gaps + (-> this nav) + (-> this current-pos) + (-> this current-poly) + arg0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + #t + ) + ) + +(defmethod do-navigation-to-destination ((this nav-state) (arg0 vector)) + (local-vars (v1-15 symbol)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (cond + ((-> this current-poly) + (let ((s3-0 (-> this mesh)) + (s4-0 (new 'stack-no-clear 'nav-ray)) + ) + (let ((s2-0 0)) + (set! (-> s4-0 current-poly) (-> this current-poly)) + (vector-! (-> s4-0 current-pos) (-> this current-pos) (the-as vector (-> s3-0 bounds))) + (vector-! (-> s4-0 dest-pos) arg0 (the-as vector (-> s3-0 bounds))) + (b! (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) + (b! #t cfg-17 :delay (nop!)) + (label cfg-3) + (let ((v1-10 s4-0)) + (vector-! (-> v1-10 dir) (-> v1-10 dest-pos) (-> v1-10 current-pos)) + (set! (-> v1-10 dir y) 0.0) + (let ((a0-6 (-> v1-10 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-8 f0-1)) + (.mov vf3 a1-8) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-6 quad) vf1) + ) + (set! (-> v1-10 next-poly) #f) + (set! (-> v1-10 len) 0.0) + (set! (-> v1-10 last-edge) -1) + (set! (-> v1-10 terminated) #f) + (set! (-> v1-10 reached-dest) #f) + (set! (-> v1-10 hit-boundary) #f) + (set! (-> v1-10 hit-gap) #f) + (set! (-> v1-10 ignore) (the-as uint 3)) + ) + 0 + (set! (-> s4-0 ignore) (the-as uint 1)) + (until v1-15 + (+! s2-0 1) + (advance-ray-to-nearest-poly-edge-or-dest! s3-0 s4-0) + (set! v1-15 (or (>= s2-0 15) (-> s4-0 terminated))) + ) + ) + (set! (-> this current-poly) (-> s4-0 current-poly)) + (when (-> s4-0 reached-dest) + (if (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) + (set! (-> s4-0 reached-dest) #f) + ) + ) + (cond + ((-> s4-0 reached-dest) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) + ) + (else + (logclear! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) + (let ((s4-1 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-1 point) arg0 (the-as vector (-> this mesh bounds))) + (set! (-> s4-1 y-threshold) (-> this nav nearest-y-threshold)) + (set! (-> s4-1 ignore) (the-as uint 1)) + (nav-mesh-method-46 (-> this mesh) (the-as nav-poly s4-1)) + (set! (-> this current-poly) (-> s4-1 poly)) + ) + 0 + ) + ) + ) + ) + (else + (set! (-> this current-pos quad) (-> arg0 quad)) + (let ((s4-2 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-2 point) arg0 (the-as vector (-> this mesh bounds))) + (set! (-> s4-2 y-threshold) (-> this nav nearest-y-threshold)) + (set! (-> s4-2 ignore) (the-as uint 1)) + (nav-mesh-method-46 (-> this mesh) (the-as nav-poly s4-2)) + (set! (-> this current-poly) (-> s4-2 poly)) + (logclear! (-> this flags) (nav-state-flag in-mesh)) + (if (-> s4-2 point-inside?) + (logior! (-> this flags) (nav-state-flag in-mesh)) + ) + ) + ) + ) + (label cfg-17) + 0 + (none) + ) + ) + +(defmethod try-projecting-to-current-poly ((this nav-state) (arg0 vector) (arg1 vector) (arg2 vector)) + (cond + ((-> this current-poly) + (let ((s5-0 (-> this nav)) + (v1-1 (-> this current-poly)) + (gp-0 arg0) + ) + (let ((t1-0 arg1) + (a1-1 arg2) + ) + (project-point-onto-plane-of-poly-local + (-> s5-0 state mesh) + v1-1 + gp-0 + t1-0 + (vector-! (new 'stack-no-clear 'vector) a1-1 (the-as vector (-> s5-0 state mesh bounds))) + ) + ) + (vector+! gp-0 gp-0 (the-as vector (-> s5-0 state mesh bounds))) + ) + 0 + #t + ) + (else + #f + ) + ) + ) + +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (the-as vector (-> this state mesh bounds))) + (clamp-vector-to-mesh-cross-gaps (-> this state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs nav-poly. +(defmethod closest-point-on-mesh ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-poly))) + (set! (-> gp-0 vertex1 z) (the-as float arg2)) + (vector-! (the-as vector (-> gp-0 vertex)) arg1 (the-as vector (-> this state mesh bounds))) + (when (or (not (-> gp-0 vertex1 z)) + (not (point-in-poly? (-> this state mesh) (the-as nav-poly (-> gp-0 vertex1 z)) (the-as vector (-> gp-0 vertex))) + ) + ) + (set! (-> gp-0 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> gp-0 data 20) (the-as uint 3)) + (nav-mesh-method-46 (-> this state mesh) gp-0) + ) + (when (-> gp-0 vertex1 z) + (project-point-into-poly-2d + (-> this state mesh) + (the-as nav-poly (-> gp-0 vertex1 z)) + sv-16 + (the-as vector (-> gp-0 vertex)) + ) + (vector+! sv-16 sv-16 (the-as vector (-> this state mesh bounds))) + ) + (the-as nav-poly (-> gp-0 vertex1 z)) + ) + ) + +(defun vector-rotate-y-sincos! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (let ((f0-0 (-> arg1 x)) + (f1-0 (-> arg1 z)) + ) + (set! (-> arg0 x) (+ (* arg3 f0-0) (* arg2 f1-0))) + (set! (-> arg0 y) (-> arg1 y)) + (set! (-> arg0 z) (- (* arg3 f1-0) (* arg2 f0-0))) + ) + ) + +(defmethod-mips2c "(method 39 nav-state)" 39 nav-state) + +(defmethod nav-state-method-51 ((this nav-state)) + 0 + (none) + ) + +(defun test-xz-point-on-line-segment? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 float) (v1-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let* ((f0-0 arg3) + (f0-2 (* f0-0 f0-0)) + ) + (let ((v1-1 arg0) + (t0-0 arg1) + ) + (.lvf vf2 (&-> v1-1 quad)) + (.lvf vf3 (&-> t0-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-2 vf1) + (let ((f1-0 v1-2)) + (let ((v1-3 arg0) + (t0-1 arg2) + ) + (.lvf vf2 (&-> v1-3 quad)) + (.lvf vf3 (&-> t0-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-4 vf1) + (let ((v0-0 (>= f0-2 (fmin f1-0 v1-4)))) + (when (not v0-0) + (let* ((f0-4 (- (-> arg2 x) (-> arg1 x))) + (f1-4 (- (-> arg2 z) (-> arg1 z))) + (f2-2 f0-4) + (f2-4 (* f2-2 f2-2)) + (f3-0 f1-4) + (f2-6 (sqrtf (+ f2-4 (* f3-0 f3-0)))) + (f3-3 f2-6) + (f3-5 (/ 1.0 f3-3)) + (f5-0 (* f3-5 (- f1-4))) + (f6-0 (* f3-5 f0-4)) + (f3-7 (- (-> arg0 x) (-> arg1 x))) + (f4-4 (- (-> arg0 z) (-> arg1 z))) + ) + (when (>= arg3 (fabs (+ (* f3-7 f5-0) (* f4-4 f6-0)))) + (let ((f0-6 (+ (* f3-7 f0-4) (* f4-4 f1-4)))) + (set! v0-0 (and (>= f0-6 0.0) (>= (* f2-6 f2-6) f0-6))) + ) + ) + ) + ) + v0-0 + ) + ) + ) + ) + ) + +(defmethod navigate-using-route-portals ((this nav-state)) + (local-vars + (v1-117 float) + (sv-112 vector) + (sv-116 nav-route-portal) + (sv-120 (inline-array vector)) + (sv-124 symbol) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> this virtual-current-poly) (-> this current-poly)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! sv-116 (new 'stack-no-clear 'nav-route-portal)) + (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) + (set! sv-124 (the-as symbol #f)) + (vector-! (-> this current-pos-local) (-> this current-pos) (the-as vector (-> this mesh bounds))) + (set! (-> this virtual-current-pos-local quad) (-> this current-pos-local quad)) + (set! (-> sv-116 next-poly) #f) + (when (not (logtest? (-> this flags) (nav-state-flag directional-mode))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'nav-poly))) + (vector-! s5-0 (-> this target-pos) (the-as vector (-> this mesh bounds))) + (when (or (logtest? (-> this flags) (nav-state-flag target-poly-dirty)) (not (-> this target-poly))) + (set! (-> s4-0 vertex 0 quad) (-> s5-0 quad)) + (set! (-> s4-0 vertex1 x) (-> this nav nearest-y-threshold)) + (set! (-> s4-0 data 20) (the-as uint 3)) + (nav-mesh-method-46 (-> this mesh) s4-0) + (set! (-> this target-poly) (the-as nav-poly (-> s4-0 vertex1 z))) + (if (not (-> this target-poly)) + (set! (-> this target-poly) (-> this current-poly)) + ) + (logclear! (-> this flags) (nav-state-flag target-poly-dirty)) + ) + ) + (project-point-into-poly-2d (-> this mesh) (-> this target-poly) sv-112 s5-0) + ) + (set! (-> sv-112 y) (-> this current-pos-local y)) + (vector-! (-> this travel) sv-112 (-> this current-pos-local)) + (set! (-> this travel y) 0.0) + (let* ((v1-32 (-> this travel)) + (f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z)))) + (f1-3 4096.0) + ) + (if (< f0-6 (* f1-3 f1-3)) + (logior! (-> this flags) (nav-state-flag at-target)) + ) + ) + (get-route-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-116) + ) + (cond + ((not (-> sv-116 next-poly)) + (set! (-> this next-poly) #f) + ) + (else + (set! (-> this next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (set! sv-124 #t) + (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? + (-> this current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + 409.59998 + ) + ) + (when #t + #t + (vector-segment-distance-point! + (-> this current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + (-> this virtual-current-pos-local) + ) + (vector-! (-> this travel) sv-112 (-> this virtual-current-pos-local)) + (set! (-> this travel y) 0.0) + 0 + ) + (set! (-> this virtual-current-poly) (-> sv-116 next-poly)) + (cond + ((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116) + (set! (-> this next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + 0 + ) + (else + (set! (-> this next-poly) #f) + (set! sv-124 (the-as symbol #f)) + ) + ) + ) + ) + ) + (when sv-124 + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (vector-! (-> s5-1 rvec) (-> sv-120 1) (-> sv-120 0)) + (vector-normalize! (-> s5-1 rvec) 409.6) + (vector+! (-> sv-120 0) (-> sv-120 0) (-> s5-1 rvec)) + (vector-! (-> sv-120 1) (-> sv-120 1) (-> s5-1 rvec)) + ) + (when (not (ray-ccw-line-segment-intersection? + (-> this virtual-current-pos-local) + (-> this travel) + (-> sv-120 0) + (-> sv-120 1) + ) + ) + (let ((s5-2 -1)) + (let* ((f0-8 (cos 8192.0)) + (f0-10 (* f0-8 f0-8)) + (v1-93 (new 'stack-no-clear 'vector)) + (a0-39 (-> this travel)) + (f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z)))) + ) + (countdown (a0-41 2) + (vector-! v1-93 (-> sv-120 a0-41) (-> this virtual-current-pos-local)) + (let ((f2-5 (vector-dot (-> this travel) v1-93))) + (when (< 0.0 f2-5) + (let* ((f2-7 (* f2-5 f2-5)) + (a1-26 v1-93) + (f2-8 (/ f2-7 (* f1-9 (+ (* (-> a1-26 x) (-> a1-26 x)) (* (-> a1-26 z) (-> a1-26 z)))))) + ) + (when (< f0-10 f2-8) + (set! f0-10 f2-8) + (set! s5-2 a0-41) + ) + ) + ) + ) + ) + ) + (when (= s5-2 -1) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'nav-route-portal)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) s3-0) + (cond + ((-> s3-0 next-poly) + (vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1))) + (vector-float*! s4-1 s4-1 0.5) + ) + (else + (set! (-> s4-1 quad) (-> sv-112 quad)) + ) + ) + (countdown (s3-1 2) + (let* ((s2-0 (-> sv-120 s3-1)) + (f0-13 (+ (vector-vector-xz-distance-squared (-> this virtual-current-pos-local) s2-0) + (vector-vector-xz-distance-squared s4-1 s2-0) + ) + ) + ) + (when (< f0-13 f30-0) + (set! f30-0 f0-13) + (set! s5-2 s3-1) + ) + ) + ) + ) + ) + (vector-! (-> this travel) (-> sv-120 s5-2) (-> this virtual-current-pos-local)) + ) + (set! (-> this travel y) 0.0) + ) + ) + (.lvf vf1 (&-> (-> this travel) 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-117 vf1) + (let ((f0-15 v1-117) + (f1-10 (-> this nav nav-cull-radius)) + ) + (if (< (* f1-10 f1-10) f0-15) + (vector-float*! (-> this travel) (-> this travel) (/ (-> this nav nav-cull-radius) (sqrtf f0-15))) + ) + ) + 0 + (none) + ) + ) + +(defmethod navigate-using-best-dir-use-existing-avoid-spheres ((this nav-state) (arg0 nav-avoid-spheres-params)) + (local-vars + (sv-96 int) + (sv-104 nav-mesh-work) + (sv-108 nav-poly) + (sv-112 uint) + (sv-116 (pointer int8)) + (sv-120 (pointer int8)) + (sv-124 float) + (sv-128 float) + (sv-132 vector) + (sv-136 vector) + (sv-140 float) + (sv-144 float) + (sv-148 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when (-> arg0 avoiding-sphere?) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> arg0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + (let ((v1-10 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-10 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-10 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-10 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) + (let ((a2-5 0)) + (let ((a3-3 v1-10)) + (vector-! (-> a3-3 dir) (-> a3-3 dest-pos) (-> a3-3 current-pos)) + (set! (-> a3-3 dir y) 0.0) + (let ((t0-3 (-> a3-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> t0-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t1-2 f0-2)) + (.mov vf3 t1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t0-3 quad) vf1) + ) + (set! (-> a3-3 next-poly) #f) + (set! (-> a3-3 len) 0.0) + (set! (-> a3-3 last-edge) -1) + (set! (-> a3-3 terminated) #f) + (set! (-> a3-3 reached-dest) #f) + (set! (-> a3-3 hit-boundary) #f) + (set! (-> a3-3 hit-gap) #f) + (set! (-> a3-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a2-5 15) (-> v1-10 terminated)) + (+! a2-5 1) + (let ((t0-6 (-> this mesh)) + (a3-5 v1-10) + ) + (set! sv-96 -1) + (set! sv-104 (-> t0-6 work)) + (set! sv-108 (-> a3-5 current-poly)) + (set! sv-112 (-> a3-5 current-poly vertex-count)) + (set! sv-116 (-> t0-6 work vert0-table)) + (set! sv-120 (-> t0-6 work vert1-table)) + (set! sv-124 (- (-> a3-5 dest-pos x) (-> a3-5 current-pos x))) + (set! sv-128 (- (-> a3-5 dest-pos z) (-> a3-5 current-pos z))) + (dotimes (t1-12 (the-as int sv-112)) + (set! sv-132 (-> sv-108 vertex (-> sv-116 t1-12))) + (set! sv-136 (-> sv-108 vertex (-> sv-120 t1-12))) + (set! sv-140 (- (-> sv-132 z) (-> sv-136 z))) + (set! sv-144 (- (-> sv-136 x) (-> sv-132 x))) + (let ((f0-14 (+ (* sv-124 sv-140) (* sv-128 sv-144)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-140 (- (-> sv-132 x) (-> a3-5 current-pos x))) (* sv-144 (- (-> sv-132 z) (-> a3-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-96 t1-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-124 (* sv-124 f0-16)) + (set! sv-128 (* sv-128 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-124 (-> a3-5 dir x)) (* sv-128 (-> a3-5 dir z))))) + (+! (-> a3-5 len) f0-20) + ) + 0 + (set! (-> a3-5 next-poly) #f) + (cond + ((= sv-96 -1) + (set! (-> a3-5 current-pos quad) (-> a3-5 dest-pos quad)) + (set! (-> a3-5 reached-dest) #t) + (set! (-> a3-5 terminated) #t) + ) + (else + (+! (-> a3-5 current-pos x) sv-124) + (+! (-> a3-5 current-pos z) sv-128) + (set! sv-148 (-> sv-108 adj-poly sv-96)) + (if (!= sv-148 255) + (set! (-> a3-5 next-poly) (-> t0-6 poly-array sv-148)) + ) + (cond + ((and (-> a3-5 next-poly) (not (logtest? (-> a3-5 next-poly pat) (-> a3-5 ignore)))) + (set! (-> a3-5 current-poly) (-> a3-5 next-poly)) + ) + (else + (set! (-> a3-5 last-edge) sv-96) + (if (-> a3-5 next-poly) + (set! (-> a3-5 hit-gap) #t) + (set! (-> a3-5 hit-boundary) #t) + ) + (set! (-> a3-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + ) + (else + (set! (-> this travel quad) (-> arg0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 ((this nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + quad + ) + ) + (avoid-spheres-1! (-> this nav) s5-0) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + (let ((v1-15 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-15 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-15 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-15 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) + (let ((a0-15 0)) + (let ((a1-4 v1-15)) + (vector-! (-> a1-4 dir) (-> a1-4 dest-pos) (-> a1-4 current-pos)) + (set! (-> a1-4 dir y) 0.0) + (let ((a2-3 (-> a1-4 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a2-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a3-2 f0-2)) + (.mov vf3 a3-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a2-3 quad) vf1) + ) + (set! (-> a1-4 next-poly) #f) + (set! (-> a1-4 len) 0.0) + (set! (-> a1-4 last-edge) -1) + (set! (-> a1-4 terminated) #f) + (set! (-> a1-4 reached-dest) #f) + (set! (-> a1-4 hit-boundary) #f) + (set! (-> a1-4 hit-gap) #f) + (set! (-> a1-4 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a0-15 15) (-> v1-15 terminated)) + (+! a0-15 1) + (let ((a2-6 (-> this mesh)) + (a1-6 v1-15) + ) + (set! sv-192 -1) + (set! sv-200 (-> a2-6 work)) + (set! sv-204 (-> a1-6 current-poly)) + (set! sv-208 (-> a1-6 current-poly vertex-count)) + (set! sv-212 (-> a2-6 work vert0-table)) + (set! sv-216 (-> a2-6 work vert1-table)) + (set! sv-220 (- (-> a1-6 dest-pos x) (-> a1-6 current-pos x))) + (set! sv-224 (- (-> a1-6 dest-pos z) (-> a1-6 current-pos z))) + (dotimes (a3-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 a3-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 a3-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a1-6 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a1-6 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 a3-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a1-6 dir x)) (* sv-224 (-> a1-6 dir z))))) + (+! (-> a1-6 len) f0-20) + ) + 0 + (set! (-> a1-6 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a1-6 current-pos quad) (-> a1-6 dest-pos quad)) + (set! (-> a1-6 reached-dest) #t) + (set! (-> a1-6 terminated) #t) + ) + (else + (+! (-> a1-6 current-pos x) sv-220) + (+! (-> a1-6 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a1-6 next-poly) (-> a2-6 poly-array sv-244)) + ) + (cond + ((and (-> a1-6 next-poly) (not (logtest? (-> a1-6 next-poly pat) (-> a1-6 ignore)))) + (set! (-> a1-6 current-poly) (-> a1-6 next-poly)) + ) + (else + (set! (-> a1-6 last-edge) sv-192) + (if (-> a1-6 next-poly) + (set! (-> a1-6 hit-gap) #t) + (set! (-> a1-6 hit-boundary) #t) + ) + (set! (-> a1-6 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> this travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + 0 + 0 + (none) + ) + ) + +(defmethod navigate-within-poly ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> this target-dir quad) (-> this travel quad)) + (let ((v1-1 (-> this target-dir))) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-0)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (cond + ((logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (let ((s5-0 (nav-state-method-39 this))) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-8 (-> this travel)) + ) + (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-9 f0-5)) + (.mov vf3 a0-9) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + ) + (let ((f0-6 (find-first-sphere-and-update-avoid-params + (-> this nav) + (-> this travel) + (the-as nav-avoid-spheres-params #f) + ) + ) + ) + (when (>= f0-6 0.0) + (vector-float*! (-> this travel) (-> this travel) f0-6) + (let ((f0-7 (* f0-6 (-> this nav nav-cull-radius)))) + (if (and (not s5-0) (>= 40.96 f0-7)) + (logior! (-> this flags) (nav-state-flag blocked)) + ) + ) + ) + ) + ) + ) + (else + (let* ((f0-8 40.96) + (f0-10 (* f0-8 f0-8)) + (v1-26 (-> this travel)) + ) + (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-30 (-> this heading))) + (let ((f0-12 1.0)) + (.lvf vf1 (&-> v1-30 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-15 f0-12)) + (.mov vf3 a0-15) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-30 quad) vf1) + ) + ) + ) + ) + ) + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +(defmethod clamp-travel-vector ((this nav-state)) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) + (not (or (logtest? (-> this nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s5-0 + ) + (when (-> s5-0 gap-poly) + (set! (-> this next-poly) (-> s5-0 gap-poly)) + (let* ((v1-12 (-> this travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> this flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> this virtual-current-pos-local) (-> this current-pos-local)) + (vector+! (-> this travel) (-> this travel) v1-19) + ) + (set! (-> this travel y) 0.0) + 0 + (none) + ) + +(defmethod plan-over-pat1-polys-using-route ((this nav-state) (arg0 nav-gap-info)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 number)) + (let ((a1-1 (-> this next-poly))) + (when (logtest? (-> a1-1 pat) 1) + (while (and a1-1 (logtest? (-> a1-1 pat) 1)) + (set! a1-1 (lookup-poly-on-route-to-target (-> this mesh) a1-1 (-> this target-poly))) + ) + (when (and a1-1 (!= a1-1 (-> this current-poly))) + (set! (-> arg0 poly) a1-1) + (-> this mesh) + (let ((s3-0 (-> arg0 poly)) + (s4-0 (-> arg0 dest)) + ) + (let ((s2-0 (-> this current-pos-local))) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 10000000000000000000000000000000000000.0) + (let* ((s1-0 (-> s3-0 vertex-count)) + (v1-13 (the-as int (+ s1-0 -1))) + ) + (dotimes (s0-0 (the-as int s1-0)) + (let ((f0-1 (vector-segment-distance-point! s2-0 (-> s3-0 vertex v1-13) (-> s3-0 vertex s0-0) sv-48))) + (when (< f0-1 (the-as float sv-56)) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-13 s0-0) + ) + ) + ) + (set! (-> s4-0 quad) (-> sv-52 quad)) + ) + (vector+! (-> arg0 dest) (-> arg0 dest) (the-as vector (-> this mesh bounds))) + #t + ) + ) + ) + ) + +(defmethod turn-and-navigate-to-destination ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> this rotation-rate) (-> this nav max-rotation-rate)) + (if (< 0.0 (-> this speed)) + (set! (-> this rotation-rate) + (fmin + (-> this rotation-rate) + (* (/ (-> this nav turning-acceleration) (-> this speed)) (-> this mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> this heading) (-> this nav shape quat)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> this flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> this nav shape trans quad)) + ) + (if (or (not (-> this current-poly)) + (!= (-> this current-pos x) (-> v1-13 0 x)) + (!= (-> this current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination this (-> v1-13 0)) + ) + ) + (logclear! + (-> this flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + 0 + (none) + ) + ) + +(defmethod navigate-using-route-portals-wrapper ((this nav-state)) + (navigate-using-route-portals this) + 0 + (none) + ) + +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper ((this nav-state)) + (navigate-using-best-dir-recompute-avoid-spheres-1 this) + 0 + (none) + ) + +(defmethod navigate-within-poly-wrapper ((this nav-state)) + (navigate-within-poly this) + 0 + (none) + ) + +(defmethod compute-travel-speed ((this nav-state)) + (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) + (let ((s5-0 this)) + (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> s5-0 mesh) + (-> s5-0 virtual-current-pos-local) + (-> s5-0 virtual-current-poly) + (-> s5-0 travel) + (-> s5-0 mesh work nav-poly-min-dist) + (not (or (logtest? (-> s5-0 nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> s5-0 nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s4-0 + ) + (when (-> s4-0 gap-poly) + (set! (-> s5-0 next-poly) (-> s4-0 gap-poly)) + (let* ((v1-12 (-> s5-0 travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> s5-0 flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> s5-0 virtual-current-pos-local) (-> s5-0 current-pos-local)) + (vector+! (-> s5-0 travel) (-> s5-0 travel) v1-19) + ) + (set! (-> s5-0 travel y) 0.0) + ) + 0 + (cond + ((logtest? (-> this nav flags) (nav-control-flag use-momentum)) + (set! sv-192 (-> this nav target-speed)) + (if (not (logtest? (-> this nav flags) (nav-control-flag momentum-ignore-heading))) + (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> this heading) (-> this target-dir))))) + ) + (set! sv-196 (- sv-192 (-> this speed))) + (set! sv-200 (* (-> this nav sec-per-frame) (-> this nav acceleration))) + (set! sv-204 (fmin sv-200 (fabs sv-196))) + (if (< sv-196 0.0) + (set! (-> this speed) (- (-> this speed) sv-204)) + (+! (-> this speed) sv-204) + ) + ) + (else + (set! (-> this speed) (-> this nav target-speed)) + ) + ) + (let* ((f0-22 (/ (vector-length (-> this travel)) (-> this nav sec-per-frame))) + (f1-18 (fmin (* (-> this nav speed-scale) (-> this speed)) f0-22)) + ) + (set! sv-224 (new 'stack-no-clear 'vector)) + (when (< f0-22 (-> this speed)) + (set! (-> this prev-speed) (-> this speed)) + (set! (-> this speed) (/ f0-22 (-> this nav speed-scale))) + ) + (vector-normalize-copy! sv-224 (-> this travel) f1-18) + ) + (set! (-> this velocity x) (-> sv-224 x)) + (set! (-> this velocity z) (-> sv-224 z)) + 0 + (none) + ) + +(defmethod navigate-v1! ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 this)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + ) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) + (!= (-> s5-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination s5-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + (navigate-using-route-portals this) + 0 + (let* ((v1-20 (-> this nav)) + (a0-18 (-> v1-20 state mesh sphere-hash sphere-array)) + (a1-9 (-> v1-20 sphere-id-array)) + (a2-1 (-> v1-20 state mesh bounds)) + (a3-0 (-> v1-20 root-nav-sphere)) + (t0-0 (-> v1-20 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-18 (-> a1-9 t1-0))) + (t2-4 (-> v1-20 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-1)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-1 this) + 0 + (navigate-within-poly this) + 0 + (compute-travel-speed this) + 0 + (none) + ) + ) + +(defmethod reset-target! ((this nav-state)) + (vector-reset! (-> this target-dir)) + 0 + (none) + ) + +(defmethod add-offset-to-target! ((this nav-state) (arg0 vector)) + (vector+! (-> this target-dir) (-> this target-dir) arg0) + 0 + (none) + ) + +(defmethod nav-state-method-29 ((this nav-state)) + 0 + (none) + ) + +(defmethod nav-state-method-30 ((this nav-state)) + 0 + (none) + ) + +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 ((this nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + quad + ) + ) + (avoid-spheres-2! (-> this nav) s5-0) + (let ((v1-5 this)) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> v1-5 flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> v1-5 flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (let ((a0-20 (new 'stack-no-clear 'nav-ray))) + (set! (-> a0-20 current-pos quad) (-> v1-5 virtual-current-pos-local quad)) + (set! (-> a0-20 current-poly) (-> v1-5 virtual-current-poly)) + (vector+! (-> a0-20 dest-pos) (-> v1-5 virtual-current-pos-local) (-> v1-5 travel)) + (let ((a1-6 0)) + (let ((a2-3 a0-20)) + (vector-! (-> a2-3 dir) (-> a2-3 dest-pos) (-> a2-3 current-pos)) + (set! (-> a2-3 dir y) 0.0) + (let ((a3-3 (-> a2-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a3-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t0-2 f0-2)) + (.mov vf3 t0-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a3-3 quad) vf1) + ) + (set! (-> a2-3 next-poly) #f) + (set! (-> a2-3 len) 0.0) + (set! (-> a2-3 last-edge) -1) + (set! (-> a2-3 terminated) #f) + (set! (-> a2-3 reached-dest) #f) + (set! (-> a2-3 hit-boundary) #f) + (set! (-> a2-3 hit-gap) #f) + (set! (-> a2-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a1-6 15) (-> a0-20 terminated)) + (+! a1-6 1) + (let ((a3-6 (-> v1-5 mesh)) + (a2-5 a0-20) + ) + (set! sv-192 -1) + (set! sv-200 (-> a3-6 work)) + (set! sv-204 (-> a2-5 current-poly)) + (set! sv-208 (-> a2-5 current-poly vertex-count)) + (set! sv-212 (-> a3-6 work vert0-table)) + (set! sv-216 (-> a3-6 work vert1-table)) + (set! sv-220 (- (-> a2-5 dest-pos x) (-> a2-5 current-pos x))) + (set! sv-224 (- (-> a2-5 dest-pos z) (-> a2-5 current-pos z))) + (dotimes (t0-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 t0-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 t0-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a2-5 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a2-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 t0-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a2-5 dir x)) (* sv-224 (-> a2-5 dir z))))) + (+! (-> a2-5 len) f0-20) + ) + 0 + (set! (-> a2-5 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a2-5 current-pos quad) (-> a2-5 dest-pos quad)) + (set! (-> a2-5 reached-dest) #t) + (set! (-> a2-5 terminated) #t) + ) + (else + (+! (-> a2-5 current-pos x) sv-220) + (+! (-> a2-5 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a2-5 next-poly) (-> a3-6 poly-array sv-244)) + ) + (cond + ((and (-> a2-5 next-poly) (not (logtest? (-> a2-5 next-poly pat) (-> a2-5 ignore)))) + (set! (-> a2-5 current-poly) (-> a2-5 next-poly)) + ) + (else + (set! (-> a2-5 last-edge) sv-192) + (if (-> a2-5 next-poly) + (set! (-> a2-5 hit-gap) #t) + (set! (-> a2-5 hit-boundary) #t) + ) + (set! (-> a2-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> a0-20 reached-dest) (-> a0-20 hit-gap) (>= (-> a0-20 len) 4096.0)) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> v1-5 flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + ) + 0 + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +(defmethod update-travel-dir-from-spheres ((this nav-state)) + (local-vars (v1-11 float) (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (vector-reset! (-> s5-0 in-dir)) + (set! (-> s5-0 best-dir 0 quad) (-> this travel quad)) + (set! (-> s5-0 best-dir 0 y) 0.0) + (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> this nav target-speed)) + (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> this velocity)) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + (dotimes (s4-0 (-> this nav sphere-count)) + (let ((s3-0 (-> this nav sphere-array s4-0))) + (vector-! (-> s5-0 right-dir) (-> this current-pos-local) (the-as vector s3-0)) + (.lvf vf1 (&-> (-> s5-0 right-dir) 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-11 vf1) + (let ((f30-0 v1-11)) + (vector-normalize! (-> s5-0 right-dir) 2.0) + (let* ((f0-4 (+ (-> this nav root-nav-sphere w) (-> s3-0 r))) + (f1-1 (* f0-4 f0-4)) + (f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1))) + ) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) (* 81920.0 f0-7)) + ) + ) + ) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + ) + (vector+! (-> this target-dir) (-> this target-dir) (-> s5-0 in-dir)) + ) + (set! (-> this target-dir y) 0.0) + (vector+float*! (-> this velocity) (-> this velocity) (-> this target-dir) (-> this nav sec-per-frame)) + (.lvf vf1 (&-> (-> this velocity) 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-25 vf1) + (let ((f0-11 v1-25) + (f1-4 (-> this nav target-speed)) + ) + (if (< (* f1-4 f1-4) f0-11) + (vector-float*! (-> this velocity) (-> this velocity) (/ (-> this nav target-speed) (sqrtf f0-11))) + ) + ) + (vector-float*! (-> this travel) (-> this velocity) (-> this nav sec-per-frame)) + 0 + (none) + ) + ) + +(defmethod compute-speed-simple ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) + #t + s5-0 + ) + (if (-> s5-0 gap-poly) + (set! (-> this next-poly) (-> s5-0 gap-poly)) + ) + ) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-9 (-> this travel)) + ) + (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-13 (-> this heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-13 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-5 f0-5)) + (.mov vf3 a0-5) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-13 quad) vf1) + ) + ) + ) + (vector-float*! (-> this velocity) (-> this travel) (/ 1.0 (-> this nav sec-per-frame))) + (set! (-> this speed) (vector-length (-> this velocity))) + (vector-reset! (-> this target-dir)) + 0 + (none) + ) + ) + +(defmethod navigate-v2! ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 this)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + ) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) + (!= (-> s5-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination s5-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + (navigate-using-route-portals this) + 0 + (let* ((v1-20 (-> this nav)) + (a0-18 (-> v1-20 state mesh sphere-hash sphere-array)) + (a1-9 (-> v1-20 sphere-id-array)) + (a2-1 (-> v1-20 state mesh bounds)) + (a3-0 (-> v1-20 root-nav-sphere)) + (t0-0 (-> v1-20 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-18 (-> a1-9 t1-0))) + (t2-4 (-> v1-20 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-1)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 this) + (update-travel-dir-from-spheres this) + (compute-speed-simple this) + 0 + (none) + ) + ) + +(define *null-nav-callback-info* (new 'static 'nav-callback-info)) + +(define *default-nav-callback-info* + (new 'static 'nav-callback-info + :callback-count 5 + :callback-array (new 'static 'array (function object nav-control none) 10 + (lambda ((arg0 object) (arg1 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg1 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-12 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + ) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) + (!= (-> gp-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination gp-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + 0 + (none) + ) + ) + (lambda ((arg0 object) (arg1 nav-control)) (navigate-using-route-portals (-> arg1 state)) 0 0 (none)) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-1 (-> arg1 state)) + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (navigate-within-poly (-> arg1 state)) + 0 + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) (compute-travel-speed (-> arg1 state)) 0 (none)) + ) + ) + ) + +(define *physics-nav-callback-info* + (new 'static 'nav-callback-info + :callback-count 5 + :callback-array (new 'static 'array (function object nav-control none) 10 + (lambda ((arg0 object) (arg1 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg1 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-12 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + ) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) + (!= (-> gp-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination gp-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + 0 + (none) + ) + ) + (lambda ((arg0 object) (arg1 nav-control)) (navigate-using-route-portals (-> arg1 state)) 0 0 (none)) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg1 state)) + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (update-travel-dir-from-spheres (-> arg1 state)) + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) (compute-speed-simple (-> arg1 state)) 0 (none)) + ) + ) + ) diff --git a/goal_src/jak3/engine/nav/nav-enemy-h.gc b/goal_src/jak3/engine/nav/nav-enemy-h.gc index 41790d195d..b33cb8aad9 100644 --- a/goal_src/jak3/engine/nav/nav-enemy-h.gc +++ b/goal_src/jak3/engine/nav/nav-enemy-h.gc @@ -57,36 +57,36 @@ debug-control ) (:methods - (nav-enemy-method-160 (_type_) none) - (nav-enemy-method-161 (_type_) none) + (normalize-heading! (_type_ nav-control) none) + (nav-enemy-method-161 (_type_ nav-control) none) (nav-enemy-method-162 (_type_) none) (nav-enemy-method-163 (_type_) none) (nav-enemy-method-164 (_type_) none) - (nav-enemy-method-165 (_type_) none) - (nav-enemy-method-166 (_type_) none) - (nav-enemy-method-167 (_type_) none) - (nav-enemy-method-168 (_type_) none) - (nav-enemy-method-169 (_type_) none) - (nav-enemy-method-170 (_type_) none) + (nav-enemy-method-165 (_type_ vector vector) none) + (nav-enemy-method-166 (_type_ vector vector) vector) + (nav-enemy-method-167 (_type_) vector) + (nav-enemy-method-168 (_type_ vector) nav-poly) + (nav-enemy-method-169 (_type_ vector) object) + (is-notice-point-in-mesh? (_type_ vector) symbol) (nav-enemy-method-171 (_type_) none) (nav-enemy-method-172 (_type_) none) (nav-enemy-method-173 (_type_) none) - (nav-enemy-method-174 (_type_) none) + (nav-enemy-method-174 (_type_) symbol) (nav-enemy-method-175 (_type_) none) (nav-enemy-method-176 (_type_) none) (nav-enemy-method-177 (_type_) none) (nav-enemy-method-178 (_type_) none) (nav-enemy-method-179 (_type_) none) - (nav-enemy-method-180 (_type_) none) + (nav-enemy-method-180 (_type_ float float) none) (nav-enemy-method-181 (_type_) none) (nav-enemy-method-182 (_type_) none) (nav-enemy-method-183 (_type_) none) (nav-enemy-method-184 (_type_) none) - (nav-enemy-method-185 (_type_) none) - (nav-enemy-method-186 (_type_) none) + (nav-enemy-method-185 (_type_) symbol) + (nav-enemy-method-186 (_type_) symbol) (nav-enemy-method-187 (_type_) none) (nav-enemy-method-188 (_type_) none) - (nav-enemy-method-189 (_type_) none) + (copy-nav-state-vel! (_type_ vector) none) ) ) diff --git a/goal_src/jak3/engine/nav/nav-enemy.gc b/goal_src/jak3/engine/nav/nav-enemy.gc index 56ca6077d9..58645d2a85 100644 --- a/goal_src/jak3/engine/nav/nav-enemy.gc +++ b/goal_src/jak3/engine/nav/nav-enemy.gc @@ -7,3 +7,2412 @@ ;; DECOMP BEGINS +(defmethod copy! ((this nav-enemy-info) (arg0 nav-enemy-info)) + (mem-copy! (&-> this type) (&-> arg0 type) 524) + 0 + (none) + ) + +(defmethod get-enemy-aware ((this nav-enemy) (arg0 enemy-aware)) + (let* ((t9-0 (method-of-type enemy get-enemy-aware)) + (s5-0 (t9-0 this arg0)) + ) + (if (and (>= 1 (the-as int (-> this focus aware))) (< 1 (the-as int s5-0))) + (nav-enemy-method-172 this) + ) + s5-0 + ) + ) + +(defmethod event-handler ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('nav-mesh-kill) + (deactivate this) + #t + ) + (('nav-mesh-new) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) + #t + ) + (('change-nav-mesh) + (let ((a0-6 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor (the-as int (-> arg3 param 0))))) + (if a0-6 + (change-to a0-6 this) + ) + ) + ) + (('debug-control-on) + (go (method-of-object this debug-control)) + ) + (('debug-control-off) + (go-best-state this) + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(define *nav-enemy-dummy-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x28)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 4096.0) + :top-plane (new 'static 'plane :y 1.0 :w -4096.0) + ) + ) + ) + +(defmethod nav-enemy-method-164 ((this nav-enemy)) + (cond + ((zero? (-> this path)) + (go process-drawable-art-error "no path") + ) + (else + (let ((s4-0 (-> this path curve num-cverts))) + (if (<= s4-0 0) + (go process-drawable-art-error "no path") + ) + (let ((s2-0 (rnd-int this s4-0)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s3-0 s4-0) + (get-point-in-path! (-> this path) s5-0 (the float s2-0) 'interp) + (if (< 4096.0 (vector-vector-xz-distance s5-0 (-> this root trans))) + (goto cfg-11) + ) + (set! s2-0 (mod (+ s2-0 1) s4-0)) + ) + (label cfg-11) + (let ((v1-19 (-> this nav state))) + (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-19 target-pos quad) (-> s5-0 quad)) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + +(defmethod nav-enemy-method-165 ((this nav-enemy) (arg0 vector) (arg1 vector)) + (closest-point-on-mesh (-> this nav) arg0 arg1 (the-as nav-poly #f)) + 0 + (none) + ) + +(defmethod nav-enemy-method-166 ((this nav-enemy) (arg0 vector) (arg1 vector)) + (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> this root transv))) + (s2-1 (vector-! (new 'stack-no-clear 'vector) v1-1 arg1)) + (s1-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + (f26-0 7281.778) + (f24-0 f26-0) + ) + (set! (-> s2-1 y) 0.0) + (vector-normalize-copy! s1-0 s2-1 1.0) + (let ((f28-0 0.0) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (s0-0 7) + (vector-rotate-y! s2-1 s1-0 f30-0) + (vector-normalize! s2-1 (-> this enemy-info run-travel-speed)) + (vector+! s2-1 s2-1 (-> this root trans)) + (nav-enemy-method-165 this arg0 s2-1) + (let ((f0-2 (vector-vector-xz-distance arg1 arg0))) + (when (< f28-0 f0-2) + (set! f28-0 f0-2) + (set! (-> s3-0 quad) (-> arg0 quad)) + ) + ) + (set! f30-0 (cond + ((= (logand s0-0 1) 1) + (+! f30-0 f24-0) + f30-0 + ) + (else + (- f30-0 f24-0) + ) + ) + ) + (+! f24-0 f26-0) + ) + (when (and (!= f28-0 0.0) (< 4096.0 (vector-vector-xz-distance (-> this root trans) s3-0))) + (set! (-> arg0 quad) (-> s3-0 quad)) + arg0 + ) + ) + ) + ) + +(defmethod nav-enemy-method-167 ((this nav-enemy)) + (let ((v1-2 (handle->process (-> this focus handle)))) + (if v1-2 + (nav-enemy-method-166 this (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable v1-2) 0)) + ) + ) + ) + +(defmethod enemy-method-109 ((this nav-enemy)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) + ) + (do-navigation-to-destination s3-0 (-> gp-0 trans)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ) + (else + (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) + (let ((f0-0 32768.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (-> gp-0 trans))) + ) + (< (- (-> gp-0 trans y) (-> s5-0 y)) -8192.0) + ) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +(defmethod enemy-common-post ((this nav-enemy)) + (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-draw-time)) + ) + (update-focus this) + (when *target* + (if *target* + (look-at! + (-> *target* neck) + (the-as vector (-> this root root-prim prim-core)) + (if (logtest? (-> this enemy-flags) (enemy-flag cam-attack-mode)) + 'attacking + ) + this + ) + ) + ) + (when (nonzero? (-> this neck)) + (cond + ((logtest? (-> this enemy-flags) (enemy-flag look-at-focus)) + (let ((a0-7 (handle->process (-> this focus handle)))) + (if a0-7 + (target-set! (-> this neck) (get-trans (the-as process-focusable a0-7) 2)) + ) + ) + ) + ((logtest? (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (let ((s5-1 (-> this move-dest)) + (v1-39 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info neck-joint))) + ) + (a1-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-6 x) (-> s5-1 x)) + (set! (-> a1-6 y) (-> v1-39 y)) + (set! (-> a1-6 z) (-> s5-1 z)) + (set! (-> a1-6 w) 1.0) + (target-set! (-> this neck) a1-6) + ) + ) + ) + ) + (when (and (logtest? (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) + (time-elapsed? (-> this auto-reset-penetrate-time) (seconds 0.1)) + ) + (logclear! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (let ((v1-54 0)) + (if (logtest? (penetrate knocked) (-> this root penetrate-using)) + (set! v1-54 (logior (shl 2 32) v1-54)) + ) + (set! (-> this root penetrate-using) (the-as penetrate v1-54)) + ) + ) + (if (logtest? (-> this enemy-flags) (enemy-flag victory)) + (check-victory this) + ) + (if (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) + (check-water this) + ) + (let ((v1-65 (-> this restore-nav-radius-time))) + (when (nonzero? v1-65) + (when (>= (current-time) v1-65) + (set! (-> this restore-nav-radius-time) 0) + (set! (-> this root nav-radius) (-> this nav-radius-backup)) + ) + ) + ) + (if (and *debug-segment* (-> this enemy-info debug-draw-neck) (nonzero? (-> this neck))) + (joint-mod-debug-draw (-> this neck)) + ) + (ja-post) + 0 + (none) + ) + +(defmethod move-above-ground! ((this nav-enemy) (arg0 vector) (arg1 move-above-ground-params)) + (let ((t9-0 (method-of-type enemy move-above-ground!))) + (t9-0 this arg0 arg1) + ) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + 0 + (none) + ) + +(defmethod nav-enemy-method-188 ((this nav-enemy)) + (let ((v1-2 (-> this nav state current-poly))) + (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) + (let ((v1-6 (-> this nav state mesh link-array (-> v1-2 link) dest-mesh))) + (if v1-6 + (change-to v1-6 this) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod nav-enemy-method-187 ((this nav-enemy)) + (nav-enemy-method-188 this) + (cond + ((nav-enemy-method-185 this) + (let ((s5-0 (-> this nav))) + (when (logtest? (-> s5-0 state flags) (nav-state-flag at-gap)) + (let ((s4-0 (new 'stack-no-clear 'nav-gap-info))) + (when (plan-over-pat1-polys-using-route (-> s5-0 state) s4-0) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag jump-check-blocked) (-> this enemy-flags))) + ) + (send-event this 'jump 1 (-> s4-0 dest)) + ) + ) + ) + (cond + ((logtest? (enemy-flag ef39) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) + ) + (else + (when (not (logtest? (enemy-flag ef43) (-> this enemy-flags))) + (normalize-heading! this s5-0) + (nav-enemy-method-161 this s5-0) + ) + ) + ) + (cond + ((logtest? (-> s5-0 state flags) (nav-state-flag blocked)) + (if (zero? (-> this blocked-start-time)) + (set-time! (-> this blocked-start-time)) + ) + ) + (else + (set! (-> this blocked-start-time) 0) + 0 + ) + ) + ) + ) + (else + (set! (-> this blocked-start-time) 0) + 0 + ) + ) + (enemy-common-post this) + (update-transforms (-> this root)) + 0 + (none) + ) + +(defmethod nav-enemy-method-163 ((this nav-enemy)) + (navigate-v1! (-> this nav state)) + 0 + (none) + ) + +(defmethod normalize-heading! ((this nav-enemy) (arg0 nav-control)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> arg0 state))) + (set! (-> s5-0 quad) (-> a1-1 heading quad)) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + ;; og:preserve-this modified for PC, see comment near definition in collide-shape-h.gc + (normalized-heading-to-quaternion! (-> this root quat) s5-0) + ) + (quaternion-normalize! (-> this root quat)) + 0 + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod copy-nav-state-vel! ((this nav-enemy) (arg0 vector)) + (set! (-> arg0 quad) (-> this nav state velocity quad)) + (none) + ) + +(defmethod nav-enemy-method-161 ((this nav-enemy) (arg0 nav-control)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (copy-nav-state-vel! this s5-0) + (let ((v1-3 (-> this root transv))) + (set! (-> v1-3 x) (-> s5-0 x)) + (set! (-> v1-3 z) (-> s5-0 z)) + ) + ) + (cond + ((should-move-to-ground? this) + (if (focus-test? this under-water) + (accelerate-fall! this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) + ) + (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) + (let ((v1-17 (-> this enemy-info))) + (set! (-> a2-0 gnd-collide-with) (-> this gnd-collide-with)) + (set! (-> a2-0 popup) 8192.0) + (set! (-> a2-0 dont-move-if-overlaps?) #t) + (set! (-> a2-0 hover-if-no-ground?) (-> v1-17 hover-if-no-ground)) + (set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2)) + (set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-17 overlaps-others-collide-with-filter)) + ) + (set! (-> a2-0 overlaps-params tlist) *touching-list*) + (-> a2-0 overlaps-params) + (move-above-ground! this (-> this root transv) a2-0) + ) + ) + (else + (let ((a2-1 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a2-1 options) (overlaps-others-options oo0)) + (set! (-> a2-1 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a2-1 tlist) *touching-list*) + (integrate-for-enemy-no-mtg (-> this root) (-> this root transv) a2-1) + ) + ) + ) + 0 + (none) + ) + +(defmethod nav-enemy-method-181 ((this nav-enemy)) + (if (not (logtest? (enemy-flag ef37) (-> this enemy-flags))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> this enemy-flags)))) + ) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> this enemy-flags)))) + (set! (-> this nav callback-info) (-> this enemy-info callback-info)) + 0 + (none) + ) + +(defmethod nav-enemy-method-182 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef37)))) + (set! (-> this nav callback-info) *null-nav-callback-info*) + 0 + (none) + ) + +(defmethod nav-enemy-method-183 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> this enemy-flags)))) + 0 + (none) + ) + +(defmethod nav-enemy-method-184 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef38)))) + 0 + (none) + ) + +(defmethod nav-enemy-method-185 ((this nav-enemy)) + (logtest? (enemy-flag ef37) (-> this enemy-flags)) + ) + +(defmethod nav-enemy-method-186 ((this nav-enemy)) + (logtest? (enemy-flag ef38) (-> this enemy-flags)) + ) + +(defmethod nav-enemy-method-168 ((this nav-enemy) (arg0 vector)) + (let ((v1-0 (-> this nav)) + (a0-1 arg0) + (a1-1 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-1 vertex)) a0-1 (the-as vector (-> v1-0 state mesh bounds))) + (set! (-> a1-1 vertex1 x) (-> v1-0 nearest-y-threshold)) + (set! (-> a1-1 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> v1-0 state mesh) a1-1) + ) + ) + +(defmethod nav-enemy-method-169 ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) + (f0-0 (-> arg0 y)) + (v1-1 (-> this fact)) + ) + (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) + (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) + (let ((v1-3 (-> this nav)) + (a0-1 arg0) + (a1-1 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-1 vertex)) a0-1 (the-as vector (-> v1-3 state mesh bounds))) + (set! (-> a1-1 vertex1 x) (-> v1-3 nearest-y-threshold)) + (set! (-> a1-1 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> v1-3 state mesh) a1-1) + ) + ) + ) + ) + ) + +(defmethod is-notice-point-in-mesh? ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) + (f0-0 (-> arg0 y)) + (v1-1 (-> this fact)) + ) + (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) + (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) + (is-in-mesh? (-> this nav) arg0 (-> this enemy-info notice-nav-radius)) + ) + ) + ) + ) + +(defmethod is-pfoc-in-mesh? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) + (if (and arg0 (not arg1)) + (set! arg1 (get-trans arg0 1)) + ) + (when arg1 + (let* ((f0-0 (-> arg1 y)) + (v1-4 (-> this root)) + (f1-0 (-> v1-4 trans y)) + (a0-2 (-> this fact)) + ) + (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) + (let* ((f30-0 (-> this enemy-info notice-nav-radius)) + (f0-1 f30-0) + ) + (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) + (is-in-mesh? (-> this nav) arg1 f30-0) + ) + ) + ) + ) + ) + ) + +(defmethod nav-enemy-method-172 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef40)))) + (set-time! (-> this frustration-time)) + (let ((v1-7 (handle->process (-> this focus handle)))) + (if v1-7 + (set! (-> this frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod nav-enemy-method-171 ((this nav-enemy)) + (let ((s5-0 (handle->process (-> this focus handle)))) + (cond + ((or (not s5-0) + (< 6144.0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 1) (-> this frustration-point))) + (< (-> this enemy-info frustration-distance) + (vector-vector-xz-distance (get-trans (the-as process-focusable s5-0) 0) (-> this root trans)) + ) + ) + (nav-enemy-method-172 this) + ) + (else + (when (time-elapsed? (-> this frustration-time) (+ (-> this reaction-time) (-> this enemy-info frustration-time))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef40) (-> this enemy-flags)))) + 0 + ) + ) + ) + ) + (none) + ) + +(defmethod nav-enemy-method-173 ((this nav-enemy)) + (set! (-> this blocked-start-time) 0) + 0 + (none) + ) + +(defmethod nav-enemy-method-174 ((this nav-enemy)) + (let ((v1-0 (-> this blocked-start-time))) + (and (nonzero? v1-0) (time-elapsed? v1-0 (-> this enemy-info blocked-time))) + ) + ) + +(defmethod nav-enemy-method-175 ((this nav-enemy)) + (if (-> this enemy-info use-momentum) + (logior! (-> this nav flags) (nav-control-flag use-momentum)) + (logclear! (-> this nav flags) (nav-control-flag use-momentum)) + ) + 0 + (none) + ) + +(defmethod nav-enemy-method-178 ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) 0.0) + ) + 0 + (let ((v1-3 (-> this nav state))) + (set! (-> v1-3 speed) 0.0) + ) + 0 + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 acceleration) (-> this enemy-info walk-acceleration)) + ) + 0 + 0 + (none) + ) + +(defmethod nav-enemy-method-176 ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info walk-travel-speed)) + ) + 0 + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info walk-acceleration)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) + ) + 0 + 0 + (none) + ) + +(defmethod nav-enemy-method-177 ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info run-travel-speed)) + ) + 0 + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info run-acceleration)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info run-turning-acceleration)) + ) + 0 + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod init-enemy-info! ((this nav-enemy) (arg0 enemy-info)) + (set! (-> this enemy-info) (the-as nav-enemy-info arg0)) + (set! (-> (the-as nav-enemy-info arg0) callback-info) *default-nav-callback-info*) + (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) + ) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) + ) + (none) + ) + +(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 enemy-info)) + (local-vars (sv-16 res-tag)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (coin-flip? this) + (let ((a0-2 (-> this node-list data 2))) + (set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!)) + (set! (-> a0-2 param1) #f) + (set! (-> a0-2 param2) #f) + ) + (logior! (-> this enemy-flags) (enemy-flag drawn-mirrored)) + ) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this nav-radius-backup) (-> this root nav-radius)) + (init-enemy-info! this arg0) + (set! (-> this enemy-info callback-info) *default-nav-callback-info*) + (set! (-> this ragdoll-proc) (the-as handle #f)) + (let ((a1-2 (-> this enemy-info idle-anim-script))) + (if a1-2 + (init! (-> this idle-anim-player) a1-2) + ) + ) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + (-> this enemy-info shadow-min-y) + (-> this enemy-info shadow-max-y) + (-> this enemy-info shadow-locus-dist) + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) + ) + (get-nav-control this (-> (the-as nav-enemy-info arg0) nav-mesh)) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) + (let ((v1-32 this)) + (set! (-> v1-32 enemy-flags) (the-as enemy-flag (logclear (-> v1-32 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-32 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-35 this)) + (set! (-> v1-35 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-35 enemy-flags)))) + ) + 0 + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate)) + (logior! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef44) (-> this enemy-flags)))) + (let ((v1-46 (-> this nav))) + (set! (-> v1-46 target-speed) 0.0) + ) + 0 + (let ((v1-48 (-> this nav))) + (set! (-> v1-48 acceleration) (-> this enemy-info walk-acceleration)) + ) + 0 + (let ((v1-50 (-> this nav))) + (set! (-> v1-50 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) + ) + 0 + (let ((v1-52 (-> this nav))) + (set! (-> v1-52 max-rotation-rate) (-> this enemy-info maximum-rotation-rate)) + ) + 0 + (nav-enemy-method-175 this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (when (and (zero? (-> this path curve num-cverts)) (-> this entity)) + (set! (-> this path curve num-cverts) 3) + (set! (-> this path curve cverts) (-> (new 'process 'vector-array 3) data)) + (logclear! (-> this path flags) (path-control-flag not-found)) + (let ((v1-69 (-> this path curve cverts 0))) + (let ((a0-33 (-> this entity trans))) + (let ((a1-9 *x-vector*)) + (let ((a2-4 6144.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a1-9 quad)) + ) + (.lvf vf4 (&-> a0-33 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-69 quad) vf6) + ) + (let ((v1-72 (-> this path curve cverts 1))) + (let ((a0-35 (-> this entity trans))) + (let ((a1-10 *x-vector*)) + (let ((a2-6 -6144.0)) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a1-10 quad)) + ) + (.lvf vf4 (&-> a0-35 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-72 quad) vf6) + ) + (let ((v1-75 (-> this path curve cverts 2))) + (let ((a0-37 (-> this entity trans))) + (let ((a1-11 *z-vector*)) + (let ((a2-8 6144.0)) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-37 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-75 quad) vf6) + ) + ) + (if (and (nonzero? (-> this path)) (nonzero? (-> this path curve num-cverts))) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! (-> this hit-points) (* 2.0 (-> this enemy-info default-hit-points))) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + ) + (let* ((v1-91 *game-info*) + (a0-42 (+ (-> v1-91 attack-id) 1)) + ) + (set! (-> v1-91 attack-id) a0-42) + (set! (-> this attack-id) a0-42) + ) + (let* ((v1-92 *game-info*) + (a0-44 (+ (-> v1-92 attack-id) 1)) + ) + (set! (-> v1-92 attack-id) a0-44) + (set! (-> this persistent-attack-id) a0-44) + ) + (set! (-> this gnd-collide-with) (-> this enemy-info gnd-collide-with)) + (set! (-> this fact) (new 'process 'fact-info-enemy this (the-as (pointer float) (-> arg0 fact-defaults)))) + (let ((cspec (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options)) + (the-as collide-spec (collide-spec jak bot player-list jak-vehicle)) + (the-as collide-spec (collide-spec jak player-list jak-vehicle)) + ) + ) + ) + (reset-to-collide-spec (-> this focus) (the-as collide-spec cspec)) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-101 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-101 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-101)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair)) + (set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile pair)) + (set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death pair)) + (if (-> this on-notice) + (logior! (-> this enemy-flags) (enemy-flag enable-on-notice)) + ) + (if (-> this on-active) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active)) + ) + (if (-> this on-hostile) + (logior! (-> this enemy-flags) (enemy-flag enable-on-hostile)) + ) + (set! (-> this incoming attacker-handle) (the-as handle #f)) + (let ((s4-0 (-> this root))) + (set! (-> this penetrated-by-all) (-> this root penetrated-by)) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (set! (-> s4-0 event-self) 'touched) + ) + (set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch)) + (set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked)) + (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.8))) + (let* ((v1-132 (-> this enemy-flags)) + (a0-61 (-> this fact enemy-options)) + (v1-133 + (logior (enemy-flag vulnerable vulnerable-backup use-notice-distance attackable-backup trackable trackable-backup) + v1-132 + ) + ) + ) + (if (logtest? (enemy-option multi-focus) a0-61) + (set! v1-133 (logior (enemy-flag multi-focus) v1-133)) + ) + (if (logtest? (enemy-option has-trigger) a0-61) + (set! v1-133 (logior (enemy-flag use-trigger) v1-133)) + ) + (set! (-> this enemy-flags) v1-133) + ) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (if (and (should-move-to-ground? this) + (not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) + ) + (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + ) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) + (let ((a1-2 (res-lump-struct arg0 'art-level structure))) + (when a1-2 + (let ((a0-3 (level-get *level* (the-as symbol a1-2)))) + (if a0-3 + (set! (-> this level) a0-3) + ) + ) + ) + ) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (init-enemy! this) + (enemy-setup-gem) + (let ((v1-10 (-> this fact enemy-options))) + (cond + ((logtest? (enemy-option spawner) v1-10) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die-fast)) + ) + (*debug-view-anims* + (go (method-of-object this view-anims)) + ) + ((logtest? (enemy-option dormant) v1-10) + (let ((v1-18 (-> this root root-prim))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant)) + ) + ((logtest? (enemy-option dormant-aware) v1-10) + (let ((v1-28 (-> this root root-prim))) + (set! (-> v1-28 prim-core collide-as) (collide-spec)) + (set! (-> v1-28 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant-aware)) + ) + (else + (go-idle2 this) + ) + ) + ) + 0 + ) + +(defbehavior nav-enemy-simple-post nav-enemy () + (enemy-common-post self) + (update-transforms (-> self root)) + 0 + (none) + ) + +(defbehavior nav-enemy-die-falling-post nav-enemy () + (enemy-die-falling-post) + (none) + ) + +(defbehavior nav-enemy-travel-post nav-enemy () + (nav-enemy-method-187 self) + (none) + ) + +(defbehavior nav-enemy-patrol-post nav-enemy () + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) (nav-enemy-method-174 self)) + (nav-enemy-method-164 self) + (nav-enemy-method-173 self) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + +(defbehavior nav-enemy-chase-post nav-enemy () + (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) 1)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + ) + 0 + ) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + +(defbehavior nav-enemy-flee-post nav-enemy () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (-> self move-dest))) + (if (or (not (nav-enemy-method-166 self gp-0 (get-trans (the-as process-focusable a0-1) 0))) + (nav-enemy-method-174 self) + ) + (go-stare2 self) + ) + (let ((a0-7 (-> self nav state)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 quad) (-> a0-7 target-pos quad)) + (when (< 2048.0 (vector-vector-xz-distance gp-0 a1-3)) + (let ((v1-18 (-> self nav state))) + (logclear! (-> v1-18 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-18 target-pos quad) (-> gp-0 quad)) + ) + 0 + ) + ) + ) + ) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + +(defbehavior nav-enemy-face-focus-post nav-enemy () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (let ((a0-4 (handle->process (-> self focus handle)))) + (if a0-4 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-4) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + ) + (nav-enemy-simple-post) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod nav-enemy-method-180 ((this nav-enemy) (arg0 float) (arg1 float)) + (if arg1 + (set! (-> this nav-radius-backup) arg0) + ) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) arg0) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod nav-enemy-method-179 ((this nav-enemy)) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) (-> this nav-radius-backup)) + ) + (none) + ) + +(defmethod nav-enemy-method-162 ((this nav-enemy)) + (set! (-> this root nav-radius) 4.096) + (set! (-> this restore-nav-radius-time) + (the-as + time-frame + (max (-> this restore-nav-radius-time) (+ (current-time) (set-reaction-time! this (seconds 5) (seconds 8)))) + ) + ) + (none) + ) + +(defbehavior nav-enemy-stare-post nav-enemy () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (let ((a0-4 (handle->process (-> self focus handle)))) + (if a0-4 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-4) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + ) + (nav-enemy-method-187 self) + (if (and (nav-enemy-method-174 self) + (zero? (-> self restore-nav-radius-time)) + (time-elapsed? (-> self blocked-start-time) (seconds 4)) + ) + (nav-enemy-method-162 self) + ) + 0 + (none) + ) + +(defbehavior nav-enemy-falling-post nav-enemy () + (enemy-falling-post) + (none) + ) + +(defbehavior nav-enemy-turn-to-face-dir nav-enemy ((arg0 vector) (arg1 float)) + (local-vars (v1-18 symbol)) + (let ((s4-0 (current-time))) + (ja :group! (-> self draw art-group data (-> self enemy-info turn-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (until v1-18 + (seek-toward-heading-vec! (-> self root) arg0 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (loop! 0.75)) + (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (enemy-method-103 self arg0 arg1))) + ) + ) + (forward-up->quaternion (-> self root quat) arg0 *y-vector*) + 0 + (none) + ) + +(defbehavior nav-enemy-turn-to-face-point nav-enemy ((arg0 vector) (arg1 float)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root trans)))) + (set! (-> gp-1 y) 0.0) + (when (< 0.0 (vector-length gp-1)) + (vector-normalize! gp-1 1.0) + (nav-enemy-turn-to-face-dir gp-1 arg1) + ) + ) + 0 + (none) + ) + +(defmethod go-stare2 ((this nav-enemy)) + (if (!= (-> this enemy-info taunt-anim) -1) + (go (method-of-object this taunt)) + ) + (go (method-of-object this stare)) + ) + +(defmethod go-stare ((this nav-enemy)) + (let ((s5-0 (-> this focus aware))) + (cond + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) + (nav-enemy-method-174 this) + ) + (go-stare2 this) + ) + ((and (= s5-0 (enemy-aware ea3)) (-> this enemy-info use-circling)) + (go (method-of-object this circling)) + ) + ((= s5-0 (enemy-aware ea4)) + (go-flee this) + ) + (else + (go-stare2 this) + ) + ) + ) + ) + +(defmethod go-hostile ((this nav-enemy)) + (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) + (nav-enemy-method-174 this) + ) + (go-stare2 this) + (go (method-of-object this hostile)) + ) + ) + +(defmethod go-flee ((this nav-enemy)) + (if (nav-enemy-method-167 this) + (go (method-of-object this flee)) + (go (method-of-object this stare)) + ) + ) + +(define *nav-enemy-debug-control-info* (new 'static 'nav-enemy-debug-control-info)) + +(defbehavior nav-enemy-debug-control-post nav-enemy () + (let ((gp-0 *nav-enemy-debug-control-info*)) + (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0))) + (seek! (-> gp-0 steering) (fmax -1.0 (fmin 1.0 f30-0)) (seconds-per-frame)) + (if (cpad-hold? 0 x) + (set! (-> gp-0 throttle) 1.0) + (set! (-> gp-0 throttle) 0.0) + ) + (format *stdcon* "input-x ~f steering ~f throttle ~f~%" f30-0 (-> gp-0 steering) (-> gp-0 throttle)) + ) + (format *stdcon* "target-speed ~M, speed ~M~%" (-> self nav target-speed) (-> self nav state speed)) + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) (* 24576.0 (-> gp-0 throttle))) + ) + 0 + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((a1-4 (-> self nav state))) + (set! (-> s4-0 quad) (-> a1-4 heading quad)) + ) + (vector-rotate-y! s4-0 s4-0 (* 1820.4445 (-> gp-0 steering))) + (vector-float*! s4-0 s4-0 20480.0) + (vector+! s5-0 (-> self root trans) s4-0) + (let ((v1-26 (-> self nav state))) + (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-26 target-pos quad) (-> s5-0 quad)) + ) + ) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +(defstate idle (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy idle) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self state-timeout) (seconds 1)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + ) + +(defstate dormant (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy dormant) 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 ef38)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + ) + +(defstate dormant-aware (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy dormant) enter) + ) + +(defstate active (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self state-timeout) (seconds 1)) + (logior! (-> self nav state flags) (nav-state-flag at-target)) + (let ((v1-8 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-8 enemy-flags))) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-8 enemy-flags)))) + ) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-8 enemy-flags)))) + (set! (-> v1-8 nav callback-info) (-> v1-8 enemy-info callback-info)) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-11 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (when (enemy-method-134 self 0.2) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (let ((v1-37 self)) + (set! (-> v1-37 enemy-flags) (the-as enemy-flag (logclear (-> v1-37 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-37 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-101 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-101 enemy-flags))) + (set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-101 enemy-flags)))) + ) + (set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-101 enemy-flags)))) + (set! (-> v1-101 nav callback-info) (-> v1-101 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-176 self) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + :post nav-enemy-patrol-post + ) + +(defstate notice (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (-> self nav state)) + (v1-11 (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-pos quad) (-> v1-11 quad)) + ) + 0 + ) + ) + (let ((v1-14 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-14 enemy-flags))) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-14 enemy-flags)))) + ) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-14 enemy-flags)))) + (set! (-> v1-14 nav callback-info) (-> v1-14 enemy-info callback-info)) + ) + 0 + (let ((v1-17 self)) + (set! (-> v1-17 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-17 enemy-flags)))) + ) + 0 + (let ((v1-19 (-> self nav))) + (set! (-> v1-19 target-speed) 0.0) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-9 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-9 travel quad)) + ) + (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +(defstate hostile (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) + (go-stare self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + (when (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags))) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-stare self) + ) + ) + ) + ) + :post nav-enemy-chase-post + ) + +(defstate stop-chase (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (let ((a2-0 (-> self nav state))) + (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + ) + (let ((f0-0 (vector-vector-distance (-> self root trans) a1-0))) + (set! (-> self state-timeout) + (the-as + time-frame + (the int (+ (lerp-scale 300.0 1200.0 f0-0 32768.0 122880.0) (rnd-float-range self 0.0 30.0))) + ) + ) + ) + ) + (nav-enemy-method-176 self) + (let ((v1-10 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-10 enemy-flags))) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-10 enemy-flags)))) + ) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-10 enemy-flags)))) + (set! (-> v1-10 nav callback-info) (-> v1-10 enemy-info callback-info)) + ) + 0 + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-13 enemy-flags)))) + ) + 0 + (logclear! (-> self mask) (process-mask actor-pause)) + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) + (go-virtual active) + ) + ) + ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + (go-hostile self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + (else + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) + (go-stare self) + ) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +(defstate stare (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef43) (-> self enemy-flags)))) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (let ((v1-9 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-9 enemy-flags))) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-9 enemy-flags)))) + ) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-9 enemy-flags)))) + (set! (-> v1-9 nav callback-info) (-> v1-9 enemy-info callback-info)) + ) + 0 + (let ((v1-12 self)) + (set! (-> v1-12 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-12 enemy-flags)))) + ) + 0 + (nav-enemy-method-178 self) + (vector-reset! (-> self root transv)) + (set-time! (-> self starting-time)) + ) + :exit (behavior () + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (let ((v1-4 (-> self nav state))) + (set! (-> v1-4 speed) 0.0) + ) + 0 + (vector-reset! (-> self root transv)) + (if (logtest? (enemy-flag ef44) (-> 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)) + ) + (when (and (logtest? (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (not (nav-enemy-method-174 self)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! gp-0 (-> self root quat)) + (set! (-> gp-0 y) 0.0) + (let ((v1-23 gp-0)) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> v1-23 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-9 f0-2)) + (.mov vf3 a0-9) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-23 quad) vf1) + ) + (set! (-> self nav state heading quad) (-> gp-0 quad)) + ) + 0 + ) + ) + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (let ((gp-0 (-> self focus aware))) + (if (< (the-as int gp-0) 2) + (set-time! (-> self starting-time)) + ) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-174 self))) + (cond + ((>= 1 (the-as int gp-0)) + (go-virtual active) + ) + ((= gp-0 (enemy-aware ea3)) + (if (and (get-focus! self) + (not (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags)))) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) + ) + (go-hostile self) + ) + (if (-> self enemy-info use-circling) + (go-virtual circling) + ) + ) + ((and (= gp-0 (enemy-aware ea4)) (nav-enemy-method-167 self)) + (go-flee self) + ) + ((and (= gp-0 (enemy-aware ea2)) + (-> self enemy-info use-pacing) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) + ) + (go-virtual pacing) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-stare-post + ) + +(defstate taunt (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy stare) enter)) + (let ((gp-0 (handle->process (-> self focus handle)))) + (when (not gp-0) + (if (nav-enemy-method-174 self) + (go-virtual stare) + (go-virtual active) + ) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + ) + :exit (-> (method-of-type nav-enemy stare) exit) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-174 self))) + (let ((v1-6 (-> self focus aware))) + (cond + ((>= 1 (the-as int v1-6)) + (go-virtual active) + ) + ((and (= v1-6 (enemy-aware ea3)) (get-focus! self)) + (go-virtual hostile) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (s5-0 (current-time)) + (f28-0 f30-0) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (loop! f28-0) + :frame-num 0.0 + ) + (until (time-elapsed? s5-0 gp-0) + (suspend) + (ja :num! (loop! f28-0)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info taunt-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual stare) + ) + :post nav-enemy-stare-post + ) + +(defstate pacing (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-look-at-mode! self 1) + (logior! (-> self enemy-flags) (enemy-flag cam-attack-mode)) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self move-dest quad) (-> self root trans quad)) + (set! (-> self state-timeout) (set-reaction-time! self (seconds 7) (seconds 11))) + (set-time! (-> self starting-time)) + (if (zero? (rnd-int self 2)) + (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef41) (-> self enemy-flags)))) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef41)))) + ) + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-virtual active) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (if a0-1 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + ) + ) + (let ((gp-1 (-> self focus aware))) + (if (or (!= gp-1 3) (not (get-focus! self))) + (set-time! (-> self starting-time)) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (>= 1 (the-as int gp-1)) + (go-virtual active) + ) + (when (= gp-1 (enemy-aware ea3)) + (when (and (get-focus! self) (time-elapsed? (-> self starting-time) (-> self reaction-time))) + (nav-enemy-method-172 self) + (go-virtual hostile) + ) + (if (-> self enemy-info use-circling) + (go-virtual circling) + ) + ) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) + (nav-enemy-method-172 self) + (go-stare2 self) + ) + ) + ) + (when (>= 1024.0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (zero? (rnd-int self 3))) + (nav-enemy-method-172 self) + (go-stare2 self) + ) + (countdown (gp-4 2) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (f30-1 16384.0) + (v1-70 (-> self enemy-flags)) + (s5-0 (-> self move-dest)) + ) + (let ((v1-71 (logxor (shl 512 32) (the-as int v1-70)))) + (set! (-> self enemy-flags) (the-as enemy-flag v1-71)) + (if (logtest? (shl 512 32) v1-71) + (set! f30-1 (- f30-1)) + ) + ) + (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-! s4-0 (-> self root trans) s5-0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 (rnd-float-range self 16384.0 49152.0)) + (vector-rotate-around-y! s4-0 s4-0 f30-1) + (vector+! s5-0 s5-0 s4-0) + (if (and (closest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f)) + (< 4096.0 (vector-vector-xz-distance s5-0 (-> self root trans))) + ) + (return #f) + ) + ) + ) + (go-stare2 self) + ) + ) + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info walk-anim))) + ) + (let ((v1-8 (ja-group))) + (if (not (and v1-8 (= v1-8 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :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-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate circling (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-look-at-mode! self 1) + (logior! (-> self enemy-flags) (enemy-flag cam-attack-mode)) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-11 enemy-flags)))) + ) + 0 + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-virtual active) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (let ((f30-0 (-> self enemy-info circle-dist-lo)) + (f28-0 (-> self enemy-info circle-dist-hi)) + ) + (if (zero? (rnd-int self 4)) + (set! (-> self desired-angle) (rnd-float-range self f30-0 f28-0)) + (set! (-> self desired-angle) + (fmax (fmin (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)) f28-0) f30-0) + ) + ) + ) + (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 512 32) (the-as int (-> self enemy-flags))))) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef42)))) + (set-time! (-> self starting-time)) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (if a0-1 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + ) + ) + (let ((gp-1 (-> self focus aware))) + (if (or (!= gp-1 3) (not (get-focus! self))) + (set-time! (-> self starting-time)) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (cond + ((>= 1 (the-as int gp-1)) + (nav-enemy-method-172 self) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((and (= gp-1 (enemy-aware ea3)) + (get-focus! self) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) + ) + (nav-enemy-method-172 self) + (go-hostile self) + ) + ((= gp-1 (enemy-aware ea2)) + (go-stare self) + ) + ((= gp-1 (enemy-aware ea4)) + (go-flee self) + ) + ((or (nav-enemy-method-174 self) (logtest? (enemy-flag ef42) (-> self enemy-flags))) + (go-stare2 self) + ) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info walk-anim))) + ) + (let ((v1-8 (ja-group))) + (if (not (and v1-8 (= v1-8 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef37) (-> a0-0 enemy-flags)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 16384.0)) + (if (logtest? (enemy-flag ef41) (-> self enemy-flags)) + (set! f30-0 (- f30-0)) + ) + (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-! gp-0 (-> self root trans) s5-0) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 (-> self desired-angle)) + (vector+! s5-0 s5-0 gp-0) + (vector-rotate-around-y! gp-0 gp-0 f30-0) + ) + (vector-normalize! gp-0 16384.0) + (vector+! s5-0 s5-0 gp-0) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (closest-point-on-mesh (-> self nav) gp-1 s5-0 (the-as nav-poly #f)) + (if (< (vector-vector-xz-distance gp-1 (-> self root trans)) 409.6) + (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef42) (-> self enemy-flags)))) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef42)))) + ) + (let ((v1-28 (-> self nav state))) + (logclear! (-> v1-28 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-28 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-28 target-pos quad) (-> gp-1 quad)) + ) + ) + ) + 0 + ) + ) + (nav-enemy-travel-post) + ) + ) + +(defstate flee (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy flee) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + (nav-enemy-method-173 self) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (let ((v1-3 (-> self focus aware))) + (if (!= v1-3 (enemy-aware ea4)) + (go-stare self) + ) + ) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post nav-enemy-flee-post + ) + +(defstate victory (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy victory) 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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + (vector-reset! (-> self root transv)) + ) + :post nav-enemy-simple-post + ) + +(defstate hit (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy hit) 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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + ) + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-39 enemy-flag) (v1-41 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (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 vulnerable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag vulnerable))) + (set! v1-37 (logclear v1-36 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? v1-38 (enemy-flag attackable-backup)) + (set! v1-39 (logior v1-38 (enemy-flag attackable))) + (set! v1-39 (logclear v1-38 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (let ((v1-40 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-40) + (set! v1-41 (logior (enemy-flag trackable) v1-40)) + (set! v1-41 (logclear v1-40 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-41) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-hostile self) + ) + :post nav-enemy-simple-post + ) + +(defstate knocked (nav-enemy) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy knocked) 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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + ) + :post nav-enemy-falling-post + ) + +(defstate die (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy die) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + :post nav-enemy-simple-post + ) + +(defstate die-falling (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + :post nav-enemy-die-falling-post + ) + +;; WARN: Return type mismatch symbol vs object. +(defmethod enemy-method-91 ((this nav-enemy) (arg0 enemy-jump-info)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x100068) + ) + ) + +;; WARN: Return type mismatch quaternion vs none. +(defmethod enemy-method-101 ((this nav-enemy) (arg0 int) (arg1 enemy-jump-info)) + (let ((v1-0 arg0)) + (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) + (let ((a1-4 this)) + (if (logtest? (enemy-flag ef38) (-> a1-4 enemy-flags)) + (seek-to-point-toward-point! (-> this root) (-> arg1 dest-pos) (-> this nav max-rotation-rate) (seconds 0.02)) + ) + ) + ) + ) + (none) + ) + +(defstate jump (nav-enemy) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy jump) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self nav state flags) (nav-state-flag at-gap)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 (-> self nav))) + (logclear! (-> v1-4 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'enemy-jump-info))) + (let ((s5-0 0)) + (init-jump-info! self gp-0) + (if (and (-> self enemy-info use-jump-blocked) + (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) + (enemy-method-91 self gp-0) + ) + (go-virtual jump-blocked) + ) + (let* ((v1-13 (-> self nav)) + (a1-2 (-> gp-0 dest-pos)) + (f0-0 (-> v1-13 extra-nav-sphere w)) + ) + (set! (-> v1-13 extra-nav-sphere quad) (-> a1-2 quad)) + (set! (-> v1-13 extra-nav-sphere w) f0-0) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-18 (-> self nav))) + (logior! (-> v1-18 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (when (logtest? (-> gp-0 flags) (enemy-jump-flags ejf0)) + (until #f + (if (jump-anim-handler self s5-0 gp-0) + (goto cfg-12) + ) + (in-jump-handler self s5-0 gp-0) + (enemy-method-101 self s5-0 gp-0) + (suspend) + (set! s5-0 1) + ) + #f + ) + ) + (label cfg-12) + (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) + (let ((s5-1 2)) + (logior! (-> self focus-status) (focus-status in-air)) + (until (on-ground? self) + (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) + (jump-anim-handler self s5-1 gp-0) + (in-jump-handler self s5-1 gp-0) + (enemy-method-101 self s5-1 gp-0) + (suspend) + (set! s5-1 3) + ) + ) + (logclear! (-> self focus-status) (focus-status in-air)) + (let ((v1-51 (-> self nav))) + (logclear! (-> v1-51 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (let ((v1-55 (-> self nav state))) + (set! (-> v1-55 current-poly) (the-as nav-poly #f)) + ) + 0 + (logclear! (-> self nav state flags) (nav-state-flag at-target)) + (move-to-gspot! self) + (let ((s5-2 4)) + (until #f + (if (jump-anim-handler self s5-2 gp-0) + (goto cfg-19) + ) + (in-jump-handler self s5-2 gp-0) + (enemy-method-101 self s5-2 gp-0) + (suspend) + (set! s5-2 5) + ) + ) + #f + (label cfg-19) + (if (logtest? (enemy-flag directed) (-> self enemy-flags)) + ((lambda :behavior nav-enemy + ((arg0 enemy-jump-info)) + (send-event (ppointer->process (-> self parent)) 'child-jumped) + (none) + ) + gp-0 + ) + ) + ) + (go-directed2 self) + ) + :post (behavior () + (let ((a0-0 self)) + (cond + ((logtest? (enemy-flag ef37) (-> a0-0 enemy-flags)) + (nav-enemy-method-187 self) + ) + (else + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options)) + (set! (-> a1-2 collide-with-filter) (-> self enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-2) + ) + (nav-enemy-simple-post) + ) + ) + ) + ) + ) + +(defstate jump-blocked (nav-enemy) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy jump-blocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + :post nav-enemy-simple-post + ) + +(defstate directed (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag directed-ready)) + ((-> (method-of-type nav-enemy idle) enter)) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +(defstate view-anims (nav-enemy) + :virtual #t + :enter (behavior () + (when (-> self nav) + (let ((v1-1 self)) + (set! (-> v1-1 enemy-flags) (the-as enemy-flag (logclear (-> v1-1 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-3 nav callback-info) *null-nav-callback-info*) + ) + 0 + ) + ) + ) + +(defstate debug-control (nav-enemy) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((v1-0 *nav-enemy-debug-control-info*)) + (set! (-> v1-0 steering) 0.0) + (set! (-> v1-0 throttle) 0.0) + ) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-debug-control-post + ) diff --git a/goal_src/jak3/engine/nav/nav-engine.gc b/goal_src/jak3/engine/nav/nav-engine.gc index 358dc5dded..2bfd99957b 100644 --- a/goal_src/jak3/engine/nav/nav-engine.gc +++ b/goal_src/jak3/engine/nav/nav-engine.gc @@ -7,3 +7,532 @@ ;; DECOMP BEGINS +(deftype nav-engine-spr-buffer (structure) + ((mem-addr (pointer nav-mesh)) + (mem-nav uint32 :overlay-at mem-addr) + (spr-addr (inline-array nav-control)) + (spr-nav uint32 :overlay-at spr-addr) + (q-size uint32) + (i-nav uint8) + (done int8) + (nav-count int8) + (i-pass int8) + ) + :pack-me + ) + + +(deftype nav-engine (structure) + ((spr-addr uint32) + (nav-work-addr uint32) + (nav-mesh-addr nav-mesh) + (poly-array-addr uint32) + (hash-sphere-addr uint32) + (hash-buckets-addr uint32) + (buf-nav-control-count int8) + (max-pass-count int8) + (output-sphere-hash uint8) + (work-buf-array nav-engine-spr-buffer 3 :inline) + (spr-work nav-mesh-work :overlay-at nav-work-addr) + (mem-work nav-mesh-work) + (spr-mesh nav-mesh :overlay-at nav-mesh-addr) + (mem-mesh nav-mesh) + (spr-poly-array uint32 :overlay-at poly-array-addr) + (mem-poly-array (inline-array nav-poly)) + (hash-sphere-list uint32 :overlay-at hash-sphere-addr) + (hash-buckets uint32 :overlay-at hash-buckets-addr) + (to-spr-wait uint32) + (from-spr-wait uint32) + ) + (:methods + (inc-spr-addr! (_type_ uint) uint) + (lay-out-spad-memory (_type_ nav-mesh) none) + (set-up-mem-work (_type_) none) + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none) + (add-all-spheres (_type_) none) + (do-sphere-lookups (_type_) none) + (update-nav-controls-pipelined-in-spr (_type_) none) + (update-nav-controls-in-spr (_type_) none) + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none) + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none) + (do-callbacks (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none) + ) + ) + + +(defmethod inc-spr-addr! ((this nav-engine) (arg0 uint)) + (let ((v0-0 (-> this spr-addr))) + (+! (-> this spr-addr) arg0) + v0-0 + ) + ) + +(defmethod lay-out-spad-memory ((this nav-engine) (arg0 nav-mesh)) + (let ((s5-0 0)) + ;; og:preserve-this + (set! (-> this spr-addr) (scratchpad-object uint :offset #x60)) + (let* ((v1-1 this) + (a1-1 320) + (a0-1 (-> v1-1 spr-addr)) + ) + (+! (-> v1-1 spr-addr) a1-1) + (set! (-> this nav-work-addr) a0-1) + ) + (let* ((v1-2 this) + (a1-3 112) + (a0-2 (-> v1-2 spr-addr)) + ) + (+! (-> v1-2 spr-addr) a1-3) + (set! (-> this nav-mesh-addr) (the-as nav-mesh a0-2)) + ) + (if (and (= (-> arg0 work polys-in-scratch) 1) (< (-> arg0 poly-count) (the-as uint 64))) + (set! s5-0 (the-as int (-> arg0 poly-count))) + ) + (let* ((v1-10 this) + (a1-5 (* s5-0 64)) + (a0-4 (-> v1-10 spr-addr)) + ) + (+! (-> v1-10 spr-addr) a1-5) + (set! (-> this poly-array-addr) a0-4) + ) + (let* ((v1-11 this) + (a1-7 (* (-> arg0 sphere-hash max-object-count) 16)) + (a0-7 (-> v1-11 spr-addr)) + ) + (+! (-> v1-11 spr-addr) a1-7) + (set! (-> this hash-sphere-addr) a0-7) + ) + (let* ((v1-12 this) + (a1-9 0) + (a0-8 (-> v1-12 spr-addr)) + ) + (+! (-> v1-12 spr-addr) a1-9) + (set! (-> this hash-buckets-addr) a0-8) + ) + (set! (-> this buf-nav-control-count) 7) + (dotimes (v1-14 3) + (let ((a0-11 (-> this work-buf-array v1-14))) + (let* ((a1-11 this) + (a3-0 2048) + (a2-5 (-> a1-11 spr-addr)) + ) + (+! (-> a1-11 spr-addr) a3-0) + (set! (-> a0-11 spr-addr) (the-as (inline-array nav-control) a2-5)) + ) + (set! (-> a0-11 mem-addr) (the-as (pointer nav-mesh) 0)) + (set! (-> a0-11 q-size) (the-as uint 0)) + (set! (-> a0-11 nav-count) 0) + (set! (-> a0-11 i-pass) -1) + ) + ) + (set! (-> this output-sphere-hash) (the-as uint 0)) + (set! (-> this mem-mesh) arg0) + (cond + ((= (-> arg0 work mesh-struct-in-scratch) 1) + (set! (-> this nav-mesh-addr) (the-as nav-mesh (&-> (-> this nav-mesh-addr) poly-array))) + (mem-copy! (&-> (-> this nav-mesh-addr) type) (&-> arg0 type) 112) + ) + (else + (set! (-> this nav-mesh-addr) arg0) + ) + ) + (set! (-> this mem-work) (-> arg0 work)) + (if (= (-> arg0 work work-struct-in-scratch) 1) + (quad-copy! (the-as pointer (-> this nav-work-addr)) (the-as pointer (-> this mem-work)) 20) + (set! (-> this nav-work-addr) (the-as uint (-> arg0 work))) + ) + (set! (-> this nav-mesh-addr work) (the-as nav-mesh-work (-> this nav-work-addr))) + (set! (-> this mem-poly-array) (-> arg0 poly-array)) + (when (> s5-0 0) + (quad-copy! (the-as pointer (-> this poly-array-addr)) (the-as pointer (-> this mem-poly-array)) (* s5-0 4)) + (set! (-> this nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> this poly-array-addr))) + ) + ) + 0 + (none) + ) + +(defmethod set-up-mem-work ((this nav-engine)) + (let ((v1-0 (-> this mem-mesh))) + (set! (-> v1-0 poly-array) (-> this mem-poly-array)) + (set! (-> v1-0 work) (-> this mem-work)) + ) + 0 + (none) + ) + +(defmethod add-spheres-from-mesh-user-list ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) + (countdown (s3-0 (-> arg1 static-sphere-count)) + (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) + ) + (let* ((s4-1 (-> arg1 user-list)) + (v1-6 (-> s4-1 alive-list next0)) + (s3-1 (-> (the-as connection v1-6) next0)) + ) + (while (!= v1-6 (-> s4-1 alive-list-end)) + (let ((a0-4 (-> (the-as connection v1-6) param1)) + (s2-0 (the-as object (-> (the-as connection v1-6) param3))) + ) + (cond + ((-> (the-as connection v1-6) param2) + (let ((s1-0 (-> (the-as process-focusable a0-4) nav))) + (set! (-> s1-0 sec-per-frame) (-> (the-as process-focusable a0-4) clock seconds-per-frame)) + (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) + (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) + (set! (-> this output-sphere-hash) (the-as uint 1)) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (set! (-> s1-0 root-sphere-id) + (the-as uint (add-a-sphere-with-flag + arg0 + (-> s1-0 root-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-extra-sphere)) + (add-a-sphere-with-flag + arg0 + (-> s1-0 extra-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (else + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (set! (-> a1-5 quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> a1-5 w) (-> (the-as collide-shape s2-0) nav-radius)) + (add-a-sphere-with-flag arg0 a1-5 (the-as int (-> (the-as collide-shape s2-0) backup-collide-as))) + ) + ) + ) + ) + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-child-spheres)) + (let ((s2-1 (-> (the-as collide-shape s2-0) root-prim)) + (s1-1 1) + ) + (when (zero? (-> s2-1 prim-core prim-type)) + (let ((v1-35 s2-1)) + (set! s2-1 (-> (the-as collide-shape-prim-group v1-35) child 0)) + (set! s1-1 (the-as int (-> v1-35 specific 0))) + ) + ) + (while (nonzero? s1-1) + (+! s1-1 -1) + (when (and (logtest? (collide-action nav-sphere) (-> s2-1 prim-core action)) (= (-> s2-1 prim-core prim-type) -1)) + (let ((a1-6 (new 'stack-no-clear 'vector))) + (set! (-> a1-6 quad) (-> s2-1 prim-core world-sphere quad)) + (set! (-> a1-6 w) (-> (the-as collide-shape-prim-sphere s2-1) nav-radius)) + (add-a-sphere-with-flag arg0 a1-6 (the-as int (-> s2-1 prim-core collide-as))) + ) + ) + (&+! s2-1 80) + ) + ) + ) + ) + (set! v1-6 s3-1) + (set! s3-1 (-> s3-1 next0)) + ) + ) + 0 + (none) + ) + +(defmethod add-all-spheres ((this nav-engine)) + (let ((s4-0 (-> this nav-mesh-addr)) + (gp-0 (-> this nav-mesh-addr sphere-hash)) + ) + (clear-objects! gp-0) + (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> this hash-buckets-addr))) + (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> this hash-sphere-addr))) + (when *target* + (let ((a1-0 (new 'stack-no-clear 'vector))) + (let ((v1-8 (-> *target* control))) + (set! (-> a1-0 quad) (-> v1-8 trans quad)) + (set! (-> a1-0 w) (-> v1-8 nav-radius)) + ) + (add-a-sphere-with-flag gp-0 a1-0 2) + ) + ) + (add-spheres-from-mesh-user-list this gp-0 s4-0) + (let ((s3-0 (the-as nav-mesh (-> s4-0 next-nav-mesh)))) + (while (and s3-0 (nonzero? s3-0)) + (add-spheres-from-mesh-user-list this gp-0 s3-0) + (set! s3-0 (the-as nav-mesh (-> s3-0 next-nav-mesh))) + ) + ) + (let ((s4-1 (the-as nav-mesh (-> s4-0 prev-nav-mesh)))) + (while (and s4-1 (nonzero? s4-1)) + (add-spheres-from-mesh-user-list this gp-0 s4-1) + (set! s4-1 (the-as nav-mesh (-> s4-1 prev-nav-mesh))) + ) + ) + (update-from-spheres gp-0) + ) + 0 + (none) + ) + +(defmethod do-sphere-lookups ((this nav-engine)) + (let ((s5-0 (-> this nav-mesh-addr))) + (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) + (let ((a0-3 (-> s5-0 nav-control-array s4-0))) + (when (-> a0-3 process) + (set! (-> a0-3 sphere-count) 0) + (set! (-> a0-3 state mesh) (-> this nav-mesh-addr)) + (set! (-> this mem-work nav) (the-as basic a0-3)) + (find-sphere-ids-from-sphere-hash a0-3 #f) + (set! (-> this mem-work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + +(def-mips2c nav-dma-send-to-spr-no-flush (function pointer pointer int none)) + +(def-mips2c nav-dma-send-from-spr-no-flush (function pointer pointer int none)) + +(defun inc-mod3 ((arg0 int)) + (local-vars (v0-1 int) (v1-1 int)) + (let ((v0-0 (+ arg0 1))) + (let ((v1-0 2)) + (set-on-less-than v1-1 v1-0 v0-0) + ) + (move-if-not-zero v0-1 0 v1-1 v0-0) + ) + v0-1 + ) + +(def-mips2c nav-state-patch-pointers (function nav-state int none)) + +(defmethod-mips2c "(method 17 nav-engine)" 17 nav-engine) + +(defmethod-mips2c "(method 18 nav-engine)" 18 nav-engine) + +(defmethod do-callbacks ((this nav-engine) (arg0 nav-engine-spr-buffer)) + (local-vars (sv-16 nav-callback-info)) + (with-pp + (dotimes (s4-0 (-> arg0 nav-count)) + (let* ((a1-1 (-> arg0 spr-addr s4-0)) + (a0-3 (-> a1-1 process)) + ) + (set! sv-16 (-> a1-1 callback-info)) + (when a0-3 + (set! (-> a1-1 state nav) a1-1) + (when (and (logtest? (-> a1-1 flags) (nav-control-flag kernel-run)) sv-16) + (let ((s3-0 pp)) + (set! pp a0-3) + (set! (-> this mem-mesh work nav) (the-as basic a1-1)) + (let ((v1-10 (-> sv-16 callback-count))) + (set! (-> this max-pass-count) (max (-> this max-pass-count) v1-10)) + (if (< (-> arg0 i-pass) v1-10) + ((-> sv-16 callback-array (-> arg0 i-pass)) a0-3 a1-1) + ) + ) + (set! pp s3-0) + ) + (set! (-> this mem-mesh work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod-mips2c "(method 20 nav-engine)" 20 nav-engine) + +(defmethod-mips2c "(method 21 nav-engine)" 21 nav-engine) + +(defmethod update-nav-controls-pipelined-in-spr ((this nav-engine)) + (local-vars + (v1-33 int) + (v1-45 int) + (v1-66 int) + (a0-14 int) + (a0-19 int) + (a0-26 int) + (sv-16 symbol) + (sv-24 int) + (sv-32 int) + (sv-40 uint) + (sv-44 (inline-array nav-control)) + (sv-48 nav-engine-spr-buffer) + ) + (flush-cache 0) + (set! (-> this max-pass-count) 3) + (set! sv-16 (the-as symbol #f)) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 (-> this nav-mesh-addr nav-control-count)) + (set! sv-44 (-> this nav-mesh-addr nav-control-array)) + (let ((s5-0 2) + (s3-0 1) + (s4-0 0) + ) + (while (not sv-16) + (let ((s2-0 (-> this work-buf-array s5-0))) + (set! (-> s2-0 i-nav) (the-as uint sv-32)) + (set! (-> s2-0 nav-count) (min (-> this buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) + (set! (-> s2-0 i-pass) sv-24) + (set! (-> s2-0 mem-addr) (the-as (pointer nav-mesh) (-> sv-44 sv-32))) + (set! (-> s2-0 q-size) (the-as uint (* 18 (-> s2-0 nav-count)))) + (set! (-> s2-0 done) 0) + (when (>= sv-24 (-> this max-pass-count)) + (set! (-> s2-0 nav-count) 0) + 0 + ) + (if (> (-> s2-0 nav-count) 0) + (upload-nav-to-spr this s2-0) + (dma-sync (the-as pointer #x1000d400) 0 0) + ) + (set! sv-32 (+ sv-32 (-> s2-0 nav-count))) + (when (>= sv-32 (the-as int sv-40)) + (set! sv-32 0) + (set! sv-24 (+ sv-24 1)) + (if (= sv-24 (-> this max-pass-count)) + (set! (-> s2-0 done) 1) + ) + ) + ) + (let ((v1-32 (+ s5-0 1))) + (let ((a0-13 2)) + (set-on-less-than a0-14 a0-13 v1-32) + ) + (move-if-not-zero v1-33 0 a0-14 v1-32) + ) + (set! s5-0 v1-33) + (let ((s2-1 (-> this work-buf-array s4-0))) + (when (> (-> s2-1 nav-count) 0) + (download-nav-from-spr this s2-1) + (when (= (-> s2-1 done) 1) + (dma-sync (the-as pointer #x1000d000) 0 0) + (set! sv-16 #t) + ) + ) + ) + (let ((v1-44 (+ s4-0 1))) + (let ((a0-18 2)) + (set-on-less-than a0-19 a0-18 v1-44) + ) + (move-if-not-zero v1-45 0 a0-19 v1-44) + ) + (set! s4-0 v1-45) + (set! sv-48 (-> this work-buf-array s3-0)) + (when (> (-> sv-48 nav-count) 0) + (if (zero? (-> sv-48 i-pass)) + (reloc-ptrs-to-spad this sv-48) + ) + (do-callbacks this sv-48) + (if (= (-> sv-48 i-pass) (+ (-> this max-pass-count) -1)) + (reloc-ptrs-to-mem this sv-48) + ) + ) + (let ((v1-65 (+ s3-0 1))) + (let ((a0-25 2)) + (set-on-less-than a0-26 a0-25 v1-65) + ) + (move-if-not-zero v1-66 0 a0-26 v1-65) + ) + (set! s3-0 v1-66) + ) + ) + 0 + (none) + ) + +(defmethod update-nav-controls-in-spr ((this nav-engine)) + (flush-cache 0) + (set! (-> this max-pass-count) 1) + (let ((gp-0 (-> this work-buf-array))) + (set! (-> gp-0 0 i-nav) (the-as uint 0)) + (set! (-> gp-0 0 nav-count) (the-as int (-> this nav-mesh-addr nav-control-count))) + (set! (-> gp-0 0 i-pass) 0) + (set! (-> gp-0 0 mem-addr) (the-as (pointer nav-mesh) (-> this nav-mesh-addr nav-control-array))) + (set! (-> gp-0 0 q-size) (the-as uint (* 18 (-> gp-0 0 nav-count)))) + (set! (-> gp-0 0 done) 0) + (when (> (-> gp-0 0 nav-count) 0) + (upload-nav-to-spr this (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d400) 0 0) + (reloc-ptrs-to-spad this (the-as nav-engine-spr-buffer gp-0)) + (while (< (-> gp-0 0 i-pass) (-> this max-pass-count)) + (do-callbacks this (the-as nav-engine-spr-buffer gp-0)) + (+! (-> gp-0 0 i-pass) 1) + ) + (reloc-ptrs-to-mem this (the-as nav-engine-spr-buffer gp-0)) + (dotimes (s4-0 (-> gp-0 0 nav-count)) + (let ((a2-1 (-> gp-0 0 spr-addr s4-0 state mesh))) + ;; og:preserve-this + (when (in-scratchpad? a2-1) + (format 0 "nav-engine::update-nav-controls-in-spr: (pre-dma) bad mesh pointer found (#x0~x)~%" a2-1) + (break!) + 0 + ) + ) + ) + (download-nav-from-spr this (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d000) 0 0) + (dotimes (s5-1 (-> gp-0 0 nav-count)) + (let ((a2-3 (-> (&+ (-> gp-0 0 mem-addr) (* 288 s5-1)) 31))) + ;; og:preserve-this + (when (in-scratchpad? a2-3) + (format 0 "nav-engine::update-nav-controls-in-spr: (post-dma) bad mesh pointer found (#x0~x)~%" a2-3) + (break!) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod update-navigation ((this nav-mesh)) + (local-vars (sp-0 int)) + (when (zero? (-> this next-nav-mesh)) + (set! (-> this next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'next-actor 0))) + (set! (-> this prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'prev-actor 0))) + ) + (when (> (-> this nav-control-count) 0) + (the-as none sp-0) + (set! sp-0 #x70003fc0) + (set! (-> this work mesh) this) + ;; og:preserve-this + (let ((s4-0 (scratchpad-object nav-engine))) + (lay-out-spad-memory s4-0 this) + (add-all-spheres s4-0) + (do-sphere-lookups s4-0) + (when (nonzero? (-> s4-0 output-sphere-hash)) + (let ((s3-0 (-> s4-0 nav-mesh-addr sphere-hash))) + (quad-copy! (-> s3-0 mem-bucket-array) (-> s3-0 bucket-array) (/ (-> s3-0 bucket-memory-size) 16)) + (quad-copy! + (the-as pointer (-> s3-0 mem-sphere-array)) + (the-as pointer (-> s3-0 sphere-array)) + (-> s3-0 object-count) + ) + (set! (-> s3-0 bucket-array) (-> s3-0 mem-bucket-array)) + (set! (-> s3-0 sphere-array) (the-as (inline-array sphere) (-> s3-0 mem-sphere-array))) + ) + ) + (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> this nav-control-count)) + (update-nav-controls-pipelined-in-spr s4-0) + (update-nav-controls-in-spr s4-0) + ) + (set-up-mem-work s4-0) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/nav/nav-mesh-h.gc b/goal_src/jak3/engine/nav/nav-mesh-h.gc index a1ed7d7529..8b2e4c6463 100644 --- a/goal_src/jak3/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak3/engine/nav/nav-mesh-h.gc @@ -20,6 +20,17 @@ (define-extern find-nearest-nav-mesh (function vector float nav-mesh)) (define-extern get-nav-mesh (function actor-id nav-mesh)) +(deftype nav-stack-type2 (structure) + "nav-mesh::25" + ((float00 float :offset 0) + (float01 float :offset 8) + (word00 int32 :offset 16) + (word01 int32 :offset 20) + (word02 int32 :offset 24) + (word03 int32 :offset 28) + ) + ) + ;; DECOMP BEGINS (deftype nav-mesh-work-debug (structure) @@ -195,47 +206,47 @@ Based on the implementation of point-poly-intersection?, these should likely be (pad2 uint32 7) ) (:methods - (nav-mesh-method-9 () none) - (nav-mesh-method-10 () none) - (nav-mesh-method-11 () none) - (nav-mesh-method-12 () none) - (nav-mesh-method-13 () none) - (nav-mesh-method-14 () none) - (nav-mesh-method-15 () none) - (nav-mesh-method-16 () none) - (nav-mesh-method-17 () none) + (debug-draw (_type_) none) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly) + (nav-mesh-method-11 (_type_ vector) none) + (nav-mesh-method-12 (_type_ vector float nav-poly) symbol) + (poly-centroid (_type_ nav-poly vector) vector) + (poly-centroid-local (_type_ nav-poly vector) vector) + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly) + (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex)) + (initialize-mesh! (_type_) none) (advance-ray-to-nearest-poly-edge-or-dest! (_type_ nav-ray) none) - (nav-mesh-method-19 () none) - (nav-mesh-method-20 () none) - (nav-mesh-method-21 () none) - (nav-mesh-method-22 () none) - (nav-mesh-method-23 () none) + (try-move-along-ray (_type_ nav-poly vector vector float) meters) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none) + (find-adjacent-bounds-one (_type_ vector nav-poly int int) none) (compute-bounding-box-from-vertices (_type_ vector vector) none) - (nav-mesh-method-25 () none) - (nav-mesh-method-26 () none) - (nav-mesh-method-27 () none) - (nav-mesh-method-28 () none) - (nav-mesh-method-29 () none) - (nav-mesh-method-30 () none) - (nav-mesh-method-31 () none) - (nav-mesh-method-32 () none) - (nav-mesh-method-33 () none) - (nav-mesh-method-34 () none) - (nav-mesh-method-35 () none) - (nav-mesh-method-36 () none) - (nav-mesh-method-37 () none) - (nav-mesh-method-38 () none) - (nav-mesh-method-39 () none) + (init-from-entity (_type_ entity-nav-mesh) none) + (handle-birth (_type_) none) + (handle-kill (_type_) none) + (update-navigation (_type_) none) + (new-nav-control (_type_) nav-control) + (remove-nav-control (_type_ nav-control) none) + (add-process-drawable-to-nav-mesh (_type_ process-drawable symbol) none) + (remove-process-drawable (_type_ process-drawable) none) + (change-to (_type_ process-drawable) none) + (link-by-id (_type_ uint) symbol) + (unlink-by-id (_type_ uint) symbol) + (nav-mesh-method-36 (_type_ vector vector float) float) + (nav-mesh-method-37 (_type_ vector vector float) float) + (nav-mesh-method-38 (_type_ nav-poly) none) + (debug-draw-poly (_type_ nav-poly rgba) none) (point-in-poly? (_type_ nav-poly vector) symbol) - (nav-mesh-method-41 () none) + (nav-mesh-method-41 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector) (closest-point-on-boundary (_type_ nav-poly vector vector) vector) - (nav-mesh-method-43 () none) + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none) (project-point-into-poly-2d (_type_ nav-poly vector vector) vector) - (nav-mesh-method-45 () none) - (nav-mesh-method-46 () none) - (nav-mesh-method-47 () none) - (nav-mesh-method-48 () none) - (nav-mesh-method-49 () none) + (nav-mesh-method-45 (_type_ nav-poly) nav-poly) + (nav-mesh-method-46 (_type_ nav-poly) nav-poly) + (is-in-mesh-local? (_type_ vector float float) symbol) + (link-to-other-mesh (_type_ nav-mesh-link) symbol) + (unlink-mesh (_type_ nav-mesh-link) none) ) ) diff --git a/goal_src/jak3/engine/nav/nav-mesh.gc b/goal_src/jak3/engine/nav/nav-mesh.gc index 5f90dcac16..15b453f0c9 100644 --- a/goal_src/jak3/engine/nav/nav-mesh.gc +++ b/goal_src/jak3/engine/nav/nav-mesh.gc @@ -5,19 +5,2149 @@ ;; name in dgo: nav-mesh ;; dgos: GAME -(defmethod initialize-nav-mesh! ((this entity-nav-mesh)) - (format #t "skipping initialize-nav-mesh~%") - (none)) +;; DECOMP BEGINS -(defmethod birth! ((this entity-nav-mesh)) - (format #t "skipping birth! for entity-nav-mesh~%") - this +(rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf)) +(init-vf0-vector) + +(define *debug-nav-control-output* #f) + +(define *debug-nav-control* #f) + +(define *debug-nav-mesh-output* #f) + +(define *debug-nav-ray* (the-as nav-ray #f)) + +(define *debug-ray-offset* (new 'static 'vector)) + +(define *debug-offset* (new 'static 'vector :y 4096.0 :w 1.0)) + +(define *nav-mesh-work* (new 'static 'nav-mesh-work + :vert0-table (new 'static 'array int8 4 0 1 2 3) + :vert1-table (new 'static 'array int8 4 1 2 3 0) + :edge-mask-table (new 'static 'array uint8 3 #x1 #x2 #x4) + :deg-to-rad 0.000095873795 + :rad-to-deg 10430.379 + :nav-poly-min-dist 204.8 + :nav-poly-epsilon 40.96 + :debug (new 'static 'nav-mesh-work-debug) + :work-struct-in-scratch 1 + :mesh-struct-in-scratch 1 + :polys-in-scratch 1 + ) + ) + +(define *default-nav-mesh* (new 'static 'nav-mesh + :poly-array (new 'static 'inline-array nav-poly 1 + (new 'static 'nav-poly + :vertex (new 'static 'inline-array vector 4 + (new 'static 'vector :w -175458100000000000000000000000000000000.0) + (new 'static 'vector :w (the-as float #xffffffff)) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + ) + :poly-count #x1 + :max-nav-control-count #x80 + :nav-control-array (new 'static 'inline-array nav-control 128 + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + ) + ) + ) + +(kmemopen global "nav-mesh") + +(let ((gp-0 *default-nav-mesh*)) + (set! (-> gp-0 work) *nav-mesh-work*) + (if (zero? (-> gp-0 user-list)) + (set! (-> gp-0 user-list) (new 'global 'engine 'nav-engine 128 connection)) + ) + (when (zero? (-> gp-0 poly-hash)) + (set! (-> gp-0 poly-hash) (new 'global 'grid-hash 16)) + (let ((v1-12 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (vector-reset! (-> v1-12 0)) + (vector-reset! (-> v1-12 1)) + (let ((a1-3 (-> v1-12 0))) + (let ((a0-5 (-> v1-12 0))) + (let ((a2-3 -4096.0)) + (.mov vf6 a2-3) + ) + (.lvf vf4 (&-> a0-5 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-3 quad) vf5) + ) + (let ((a1-4 (-> v1-12 1))) + (let ((a0-6 (-> v1-12 1))) + (let ((a2-5 4096.0)) + (.mov vf6 a2-5) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-4 quad) vf5) + ) + (update-grid-for-objects-in-box + (-> gp-0 poly-hash) + (the-as int (-> gp-0 poly-count)) + (-> v1-12 0) + (-> v1-12 1) + ) + ) + ) ) +(kmemclose) + (defun nav-mesh-connect-from-ent ((arg0 process-drawable)) + (let ((s5-0 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0))) + (cond + (s5-0 + (if (zero? (-> s5-0 user-list)) + (format 0 "nav-mesh-connect-from-ent: nav mesh not initialized!~%") + ) + (if (add-connection (-> s5-0 user-list) arg0 nothing arg0 #f (-> arg0 root)) + #t + ) + ) + (else + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status error)) + ) + #f + ) + ) + ) + ) + +(defun-debug connection-validate ((arg0 connection)) + (when (zero? arg0) + (break!) + 0 + ) + (when (zero? (-> arg0 next1)) + (break!) + 0 + ) + (when (zero? (-> arg0 prev1)) + (break!) + 0 + ) + (when (-> arg0 next1) + (when (!= arg0 (-> arg0 next1 prev1)) + (break!) + 0 + ) + ) + (when (-> arg0 prev1) + (when (!= arg0 (-> arg0 prev1 next1)) + (break!) + 0 + ) + ) + 0 + (none) + ) + +(defun-debug connection-list-validate ((arg0 (inline-array connection))) + (let ((gp-0 (the-as object (&-> arg0 3 prev1)))) + (while gp-0 + (connection-validate (the-as connection gp-0)) + (set! gp-0 (-> (the-as connection gp-0) next1)) + ) + ) #f ) +(defun-debug nav-control-validate ((arg0 process-drawable)) + (let ((s5-0 (the-as object (-> arg0 nav)))) + (when (and (-> arg0 nav) (!= arg0 (-> arg0 nav process))) + (format 0 "process pointing to wrong nav-control!~%") + (break!) + 0 + ) + (let ((s4-0 (-> arg0 nav state mesh))) + (when (or (not s4-0) (zero? s4-0)) + (format 0 "nav control has invalid mesh~%") + (break!) + 0 + ) + (let ((v1-12 (- (the-as int s5-0) (the-as uint (the-as int (-> s4-0 nav-control-array 0)))))) + (when (or (< (the-as uint v1-12) 0) + (< (the-as uint (* (the-as uint 288) (-> s4-0 nav-control-count))) (the-as uint v1-12)) + ) + (format 0 "nav control (~,,8x) is not in the mesh's nav-control-array!~%" (the-as nav-control s5-0)) + (inspect s4-0) + (break!) + 0 + ) + ) + ) + ) + (connection-list-validate (the-as (inline-array connection) arg0)) + 0 + (none) + ) -;; DECOMP BEGINS +(defun-debug debug-validate-nav-poly ((arg0 nav-mesh-link) (arg1 nav-poly)) + (set! (-> *nav-mesh-work* poly1) (-> *nav-mesh-work* poly0)) + (set! (-> *nav-mesh-work* poly0) arg1) + (when arg1 + (let ((a2-1 arg1) + (a3-0 (+ (-> arg0 dest-mesh-id) 0)) + (t0-0 (+ (-> arg0 dest-mesh-id) (* (+ (-> arg0 src-switch-poly-id) -1) 64))) + ) + (when (or (< (the-as uint a2-1) a3-0) (< t0-0 (the-as uint a2-1))) + (format 0 "validate-nav-poly: bad poly pointer ~x range ~x ~x~%" a2-1 a3-0 t0-0) + (break!) + 0 + ) + ) + ) + 0 + (none) + ) +(defmethod initialize-nav-mesh! ((this entity-nav-mesh)) + "Initialize the nav-mesh in this entity." + (let ((v1-0 (-> this nav-mesh))) + (if (nonzero? v1-0) + (init-from-entity v1-0 this) + ) + ) + 0 + (none) + ) + +(defmethod birth! ((this entity-nav-mesh)) + (let ((a0-1 (-> this nav-mesh))) + (if (nonzero? a0-1) + (handle-birth a0-1) + ) + ) + this + ) + +(defmethod kill! ((this entity-nav-mesh)) + (if (-> this nav-mesh) + (handle-kill (-> this nav-mesh)) + ) + this + ) + +(defmethod debug-draw ((this entity-nav-mesh)) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> this nav-mesh bounds) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this nav-mesh bounds quad)) + (let ((a0-6 (new 'stack 'random-generator))) + (set! (-> a0-6 seed) (-> this aid)) + (let* ((v1-4 (rand-uint31-gen a0-6)) + (f30-0 (* 182.04445 (the float (logand v1-4 #xffff)))) + ) + (+! (-> s5-0 x) (* 4096.0 (cos f30-0))) + (+! (-> s5-0 z) (* 4096.0 (sin f30-0))) + ) + ) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + (res-lump-struct this 'name string) + s5-0 + (font-color white) + (new 'static 'vector2h :y 8) + ) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 577) + ) + (format (clear *temp-string*) "aid ~D" (-> this aid)) + (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* s5-0 (font-color white) (new 'static 'vector2h :y 16)) + ) + ) + (debug-draw (-> this nav-mesh)) + 0 + (none) + ) + +(defmethod get-simple-travel-vector ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) + (local-vars (at-0 int) (at-1 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) + (cond + (gp-0 + (let ((v1-0 arg0)) + (.lvf vf1 (&-> arg2 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-0 quad) vf1) + ) + (let ((s3-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> s3-1 point) arg1 (the-as vector (-> gp-0 bounds))) + (set! (-> s3-1 y-threshold) 40960.0) + (set! (-> s3-1 ignore) (the-as uint 3)) + (let ((a2-2 (nav-mesh-method-45 gp-0 (the-as nav-poly s3-1)))) + (cond + (a2-2 + (clamp-vector-to-mesh-cross-gaps + gp-0 + (-> s3-1 point) + a2-2 + arg0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (let ((v1-7 arg0)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-1 f0-2) + ) + (.mov vf2 at-1) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-7 quad) vf1) + ) + ) + (else + (set! (-> arg0 x) (* (-> arg0 x) (- arg4))) + (set! (-> arg0 y) (* (-> arg0 y) (-> pp clock frames-per-second))) + (set! (-> arg0 z) (* (-> arg0 z) (- arg4))) + ) + ) + ) + ) + gp-0 + ) + (else + (set! (-> arg0 quad) (-> arg2 quad)) + (the-as nav-mesh #f) + ) + ) + ) + ) + ) + ) + +(defmethod project-point-to-nav-mesh ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) + (local-vars (sv-16 vector)) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) + (cond + (gp-0 + (set! sv-16 arg0) + (let ((s5-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> s5-1 poly) arg2) + (vector-! (-> s5-1 point) arg1 (the-as vector (-> gp-0 bounds))) + (when (or (not (-> s5-1 poly)) (not (point-in-poly? gp-0 (-> s5-1 poly) (-> s5-1 point)))) + (set! (-> s5-1 y-threshold) arg3) + (set! (-> s5-1 ignore) (the-as uint 3)) + (nav-mesh-method-46 gp-0 (the-as nav-poly s5-1)) + (when (-> s5-1 poly) + (project-point-into-poly-2d gp-0 (-> s5-1 poly) sv-16 (-> s5-1 point)) + (vector+! sv-16 sv-16 (the-as vector (-> gp-0 bounds))) + ) + ) + (-> s5-1 poly) + ) + ) + (else + (set! (-> arg0 quad) (-> arg1 quad)) + (the-as nav-poly #f) + ) + ) + ) + ) + +;; WARN: Return type mismatch uint vs int. +(defmethod length ((this nav-mesh)) + (the-as int (-> this poly-count)) + ) + +(defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) + (set! (-> gp-0 0 quad) (-> this bounds quad)) + (if (logtest? (-> arg0 pat) 15) + (+! (-> gp-0 0 y) 409.6) + ) + (let ((v1-7 (the-as int (+ (-> arg0 vertex-count) -1)))) + (dotimes (s2-0 (the-as int (-> arg0 vertex-count))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (vector+! (-> gp-0 1) (-> gp-0 0) (-> arg0 vertex s2-0)) + (vector+! (-> gp-0 2) (-> gp-0 0) (-> arg0 vertex v1-7)) + arg1 + #f + (the-as rgba -1) + ) + (set! v1-7 s2-0) + ) + ) + (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> this link-count))) + (poly-centroid this arg0 (-> gp-0 1)) + (let ((s5-1 (-> this link-array (-> arg0 link)))) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 577) + ) + (format (clear *temp-string*) "link ~D" (-> s5-1 id)) + (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* (-> gp-0 1) (font-color pink) (new 'static 'vector2h :y 8)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod new-nav-control ((this nav-mesh)) + (let ((gp-0 (the-as nav-control #f))) + (let ((v1-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a1-1 (-> this nav-control-array v1-0))) + (b! (-> a1-1 process) cfg-3 :delay (empty-form)) + (set! gp-0 a1-1) + ) + (set! (-> gp-0 process) (the-as process 0)) + (set! (-> gp-0 state mesh) this) + (b! #t cfg-8 :delay (nop!)) + (label cfg-3) + (+! v1-0 1) + (label cfg-4) + (b! (< v1-0 (the-as int (-> this nav-control-count))) cfg-1) + ) + (let ((v1-3 (-> this nav-control-count))) + (cond + ((< v1-3 (-> this max-nav-control-count)) + (+! (-> this nav-control-count) 1) + (set! gp-0 (-> this nav-control-array v1-3)) + (set! (-> gp-0 state mesh) this) + ) + (else + (format + 0 + "nav-mesh::new-nav-control: too many users for nav-mesh ~s~%" + (res-lump-struct (-> this entity) 'name structure) + ) + ) + ) + ) + (label cfg-8) + gp-0 + ) + ) + +(defmethod remove-nav-control ((this nav-mesh) (arg0 nav-control)) + (set! (-> arg0 process) #f) + (let ((v1-1 (+ (-> this nav-control-count) -1))) + (while (and (>= v1-1 0) (not (-> this nav-control-array v1-1 process))) + (+! v1-1 -1) + ) + (set! (-> this nav-control-count) (+ v1-1 1)) + ) + 0 + (none) + ) + +(defmethod add-process-drawable-to-nav-mesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) + (if arg1 + (change-to this arg0) + (add-connection (-> this user-list) arg0 nothing arg0 #f (-> arg0 root)) + ) + 0 + (none) + ) + +(defmethod remove-process-drawable ((this nav-mesh) (arg0 process-drawable)) + (remove-from-process (-> this user-list) arg0) + (let ((a1-2 (-> arg0 nav))) + (when (nonzero? a1-2) + (remove-nav-control this a1-2) + (set! (-> arg0 nav) #f) + ) + ) + 0 + (none) + ) + +(defmethod change-to ((this nav-mesh) (arg0 process-drawable)) + (local-vars (s3-0 nav-control)) + (cond + ((zero? (-> this user-list)) + (go process-drawable-art-error "nav mesh not initialized") + ) + ((not arg0) + (go process-drawable-art-error "nav mesh proc pointer is #f") + ) + ((begin + (set! s3-0 (-> arg0 nav)) + (if (zero? s3-0) + (set! s3-0 (the-as nav-control #f)) + ) + (or (not s3-0) (!= this (-> s3-0 state mesh))) + ) + (let ((s4-0 (new-nav-control this))) + (b! s4-0 cfg-14 :delay (empty-form)) + (b! (not *debug-segment*) cfg-13 :delay (empty-form)) + (format 0 "ERROR: nav-mesh::change-to: unable to allocate nav-mesh for ~s~%" arg0) + (label cfg-13) + (b! #t cfg-20 :delay (nop!)) + (label cfg-14) + (cond + (s3-0 + (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 18) + (set! (-> s4-0 state mesh) this) + (set! (-> s4-0 state nav) s4-0) + (set! (-> s4-0 state current-poly) #f) + (set! (-> s4-0 state virtual-current-poly) #f) + (set! (-> s4-0 state next-poly) #f) + (set! (-> s4-0 state user-poly) #f) + (set! (-> s4-0 state target-poly) #f) + (let ((s2-0 (-> s3-0 state mesh))) + (remove-nav-control s2-0 s3-0) + (remove-from-process (-> s2-0 user-list) arg0) + ) + ) + (else + (init! s4-0 (the-as collide-shape (-> arg0 root))) + ) + ) + (set-nearest-y-thres! s4-0 (-> this nearest-y-threshold)) + (set! (-> arg0 nav) s4-0) + ) + (add-connection (-> this user-list) arg0 nothing arg0 #t (-> arg0 root)) + (send-event arg0 'nav-mesh-new :from arg0) + ) + ) + (label cfg-20) + 0 + (none) + ) + +(defmethod link-to-other-mesh ((this nav-mesh) (arg0 nav-mesh-link)) + (when (not (-> arg0 dest-mesh)) + (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) + (v1-1 (if (type? s4-0 entity-nav-mesh) + s4-0 + ) + ) + ) + (when v1-1 + (let ((a0-3 (-> v1-1 nav-mesh)) + (v1-2 (the-as nav-mesh-link #f)) + ) + (let ((a1-2 0)) + (b! #t cfg-8 :delay (nop!)) + (label cfg-5) + (let ((a2-1 (-> a0-3 link-array a1-2))) + (let ((a3-1 (-> arg0 id))) + (b! (!= (-> a2-1 id) a3-1) cfg-7 :delay (empty-form)) + ) + (set! v1-2 a2-1) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-7) + (+! a1-2 1) + (label cfg-8) + (b! (< a1-2 (the-as int (-> a0-3 link-count))) cfg-5) + ) + (label cfg-10) + (when v1-2 + (set! (-> arg0 dest-mesh) a0-3) + (set! (-> v1-2 dest-mesh) this) + (set! (-> arg0 dest-link-poly-id) (-> v1-2 src-switch-poly-id)) + (set! (-> arg0 dest-switch-poly-id) (-> v1-2 src-link-poly-id)) + (set! (-> v1-2 dest-link-poly-id) (-> arg0 src-switch-poly-id)) + (set! (-> v1-2 dest-switch-poly-id) (-> arg0 src-link-poly-id)) + #t + ) + ) + ) + ) + ) + ) + +(defmethod unlink-mesh ((this nav-mesh) (arg0 nav-mesh-link)) + (let ((a0-1 (-> arg0 dest-mesh))) + (b! (not a0-1) cfg-9 :delay (empty-form)) + (let ((v1-0 (the-as nav-mesh-link #f))) + (let ((a2-1 0)) + (b! #t cfg-5 :delay (nop!)) + (label cfg-2) + (let ((a3-1 (-> a0-1 link-array a2-1))) + (let ((t0-1 (-> arg0 id))) + (b! (!= (-> a3-1 id) t0-1) cfg-4 :delay (empty-form)) + ) + (set! v1-0 a3-1) + ) + (b! #t cfg-7 :delay (nop!)) + (label cfg-4) + (+! a2-1 1) + (label cfg-5) + (b! (< a2-1 (the-as int (-> a0-1 link-count))) cfg-2) + ) + (label cfg-7) + (when v1-0 + (set! (-> arg0 dest-mesh) #f) + (set! (-> v1-0 dest-mesh) #f) + ) + ) + ) + (label cfg-9) + 0 + (none) + ) + +(defmethod link-by-id ((this nav-mesh) (arg0 uint)) + (let ((v1-0 (the-as nav-mesh-link #f))) + (let ((a2-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a3-1 (-> this link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! a2-0 1) + (label cfg-4) + (b! (< a2-0 (the-as int (-> this link-count))) cfg-1) + ) + (label cfg-6) + (if v1-0 + (link-to-other-mesh this v1-0) + ) + ) + ) + +(defmethod unlink-by-id ((this nav-mesh) (arg0 uint)) + (let ((v1-0 (the-as nav-mesh-link #f))) + (let ((a2-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a3-1 (-> this link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! a2-0 1) + (label cfg-4) + (b! (< a2-0 (the-as int (-> this link-count))) cfg-1) + ) + (label cfg-6) + (when v1-0 + (unlink-mesh this v1-0) + #t + ) + ) + ) + +(defmethod init-from-entity ((this nav-mesh) (arg0 entity-nav-mesh)) + (local-vars (sv-16 res-tag)) + (set! (-> this entity) arg0) + (set! (-> this work) *nav-mesh-work*) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data arg0 'nav-mesh-sphere (inline-array sphere) :tag-ptr (& sv-16)))) + (when v1-2 + (set! (-> this static-sphere-count) (-> sv-16 elt-count)) + (set! (-> this static-sphere) v1-2) + ) + ) + (set! (-> this nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) + (set! (-> this flags) (res-lump-value arg0 'nav-mesh-flags nav-mesh-flag :time -1000000000.0)) + (set! (-> this water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) + (if (nonzero? (-> this poly-hash)) + (set! (-> this poly-hash work) *grid-hash-work*) + ) + (let ((s5-0 (new 'stack-no-clear 'nav-stack-type2))) + (set! (-> s5-0 word00) + (res-lump-value arg0 'nav-max-users int :default (the-as uint128 64) :time -1000000000.0) + ) + (set! (-> this user-list) (new 'loading-level 'engine 'nav-engine (-> s5-0 word00) connection)) + (set! (-> this nav-control-array) + (the-as (inline-array nav-control) (malloc 'loading-level (* 288 (-> s5-0 word00)))) + ) + (set! (-> this nav-control-count) (the-as uint 0)) + (set! (-> this max-nav-control-count) (the-as uint (-> s5-0 word00))) + (set! (-> s5-0 word01) (/ (+ (-> s5-0 word00) 7) 8)) + (dotimes (v1-16 3) + (set! (-> (the-as (pointer float) (+ (* v1-16 4) (the-as int s5-0)))) + (- (-> this poly-hash box-max v1-16) (-> this poly-hash box-min v1-16)) + ) + ) + (set! (-> s5-0 word02) + (the int + (+ 1.0 (* (fmax 1.0 (* 0.000015258789 (-> s5-0 float00))) (fmax 1.0 (* 0.000015258789 (-> s5-0 float01))))) + ) + ) + (set! (-> s5-0 word03) (min 4096 (* (-> s5-0 word01) (-> s5-0 word02)))) + (set! (-> this sphere-hash) + (new 'loading-level 'sphere-hash (-> s5-0 word03) (+ (-> s5-0 word00) (-> this static-sphere-count))) + ) + ) + (initialize-mesh! this) + 0 + (none) + ) + +(defmethod handle-birth ((this nav-mesh)) + (dotimes (s5-0 (the-as int (-> this link-count))) + (let ((a1-0 (-> this link-array s5-0))) + (if (not (-> a1-0 dest-mesh)) + (link-to-other-mesh this a1-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod handle-kill ((this nav-mesh)) + (when (nonzero? (-> this user-list)) + (countdown (s5-0 (-> this nav-control-count)) + (let* ((v1-3 (-> this nav-control-array s5-0)) + (s4-0 (-> v1-3 process)) + ) + (when s4-0 + (when (not (send-event (-> v1-3 process) 'nav-mesh-kill)) + (format 0 "ERROR: object ~A did not accept nav-mesh kill~%" s4-0) + (deactivate s4-0) + ) + ) + ) + ) + (remove-all (-> this user-list)) + (dotimes (s5-1 (the-as int (-> this link-count))) + (let ((a1-2 (-> this link-array s5-1))) + (if (-> a1-2 dest-mesh) + (unlink-mesh this a1-2) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this nav-mesh)) + (local-vars (sv-32 vector) (sv-36 int)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 16) + (add-debug-sphere + (logtest? sv-36 4) + (bucket-id debug) + (-> this bounds) + (-> this bounds r) + (new 'static 'rgba :r #xff :g #xff :a #x20) + ) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *x-vector* (meters 1) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *z-vector* (meters 1) *color-blue*) + (when (logtest? sv-36 16) + (dotimes (s5-0 (the-as int (-> this static-sphere-count))) + (add-debug-sphere + #t + (bucket-id debug) + (-> this static-sphere s5-0) + (-> this static-sphere s5-0 r) + *color-light-blue* + ) + (let ((s4-0 add-debug-text-3d) + (s3-0 #t) + (s2-0 577) + ) + (format (clear *temp-string*) "~D" s5-0) + (s4-0 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + (-> this static-sphere s5-0) + (font-color cyan) + (the-as vector2h #f) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> this poly-count))) + (let ((s4-1 (-> this poly-array s5-1))) + (debug-draw-poly this s4-1 (cond + ((logtest? (-> s4-1 pat) 1) + *color-black* + ) + ((logtest? (-> s4-1 pat) 2) + *color-gray* + ) + ((logtest? (-> s4-1 pat) 4) + (if (-> this link-array (-> s4-1 link) dest-mesh) + *color-green* + *color-light-red* + ) + ) + ((logtest? (-> s4-1 pat) 8) + *color-magenta* + ) + (else + *color-cyan* + ) + ) + ) + (when (logtest? sv-36 32) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 577) + ) + (format (clear *temp-string*) "~D" (-> s4-1 id)) + (s3-1 + s2-1 + (the-as bucket-id s1-1) + *temp-string* + (poly-centroid this s4-1 sv-32) + (font-color cyan) + (the-as vector2h #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod poly-centroid-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-reset! v1-0) + (dotimes (a0-2 (the-as int (-> arg0 vertex-count))) + (vector+! v1-0 v1-0 (-> arg0 vertex a0-2)) + ) + (vector-float*! arg1 v1-0 (/ 1.0 (the float (-> arg0 vertex-count)))) + ) + ) + +(defmethod poly-centroid ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (poly-centroid-local this arg0 arg1) + (vector+! arg1 arg1 (the-as vector (-> this bounds))) + ) + +(defun vu-point-triangle-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (v1-0 float) (v1-1 int) (v1-3 int) (a0-1 float) (a0-2 int) (a0-4 int) (a1-1 float) (a1-2 int)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.sub.vf vf1 vf1 vf1 :mask #b1010) + (.lvf vf3 (&-> arg3 quad)) + (.sub.vf vf2 vf2 vf2 :mask #b1010) + (.lvf vf12 (&-> arg0 quad)) + (.sub.vf vf3 vf3 vf3 :mask #b1010) + (.sub.vf vf4 vf2 vf1) + (.sub.vf vf9 vf1 vf12) + (.sub.vf vf5 vf3 vf2) + (.sub.vf vf10 vf2 vf12) + (.sub.vf vf6 vf1 vf3) + (.sub.vf vf11 vf3 vf12) + (.outer.product.a.vf acc vf9 vf4) + (.outer.product.b.vf vf13 vf4 vf9 acc) + (.outer.product.a.vf acc vf10 vf5) + (.outer.product.b.vf vf14 vf5 vf10 acc) + (.outer.product.a.vf acc vf11 vf6) + (.outer.product.b.vf vf15 vf6 vf11 acc) + (.mov v1-0 vf13) + (.mov a1-1 vf14) + (.mov a0-1 vf15) + (set-on-less-than v1-1 v1-0 0) + (set-on-less-than a1-2 a1-1 0) + (set-on-less-than a0-2 a0-1 0) + (let ((a0-3 (logxor a1-2 a0-2)) + (v1-2 (logxor v1-1 a1-2)) + ) + (set-on-less-than a0-4 a0-3 1) + (set-on-less-than v1-3 v1-2 1) + ) + (logtest? v1-3 a0-4) + ) + ) + +(defun poly-in-height-range? ((arg0 nav-poly) (arg1 float) (arg2 float)) + (and (>= (+ (-> arg0 vertex3 w) arg2) arg1) (>= arg1 (- (-> arg0 vertex2 w) arg2))) + ) + +(defmethod nav-mesh-method-45 ((this nav-mesh) (arg0 nav-poly)) + (local-vars (v1-15 int) (sv-16 nav-poly)) + (let ((s4-0 (search-for-point (-> this poly-hash) (the-as vector (-> arg0 vertex)))) + (s3-0 (-> this poly-hash bucket-size)) + (s2-0 0) + ) + (until (zero? v1-15) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s4-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + ;; og:preserve-this + (label cfg-2) + (let ((v1-2 (logand s0-0 1))) + (nop!) + (b! (zero? v1-2) cfg-16 :delay (nop!)) + ) + (set! sv-16 (-> this poly-array s1-0)) + (let ((v1-5 sv-16) + (f0-0 (-> arg0 vertex0 y)) + (f1-0 (-> arg0 vertex1 x)) + ) + (when (and (and (>= (+ (-> v1-5 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-5 vertex2 w) f1-0))) + (not (logtest? (-> sv-16 pat) (-> arg0 data 20))) + ) + (if (point-in-poly? this sv-16 (the-as vector (-> arg0 vertex))) + (return sv-16) + ) + ) + ) + (label cfg-16) + ;; og:preserve-this cast + (set! s0-0 (the-as uint (/ (the-as int s0-0) 2))) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s4-0 (&-> s4-0 1)) + (set-on-less-than v1-15 s2-0 s3-0) + (nop!) + ) + ) + 0 + (the-as nav-poly #f) + ) + +(defmethod is-in-mesh-local? ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) + (local-vars (sv-16 float) (sv-20 vector) (sv-24 float)) + (set! sv-16 arg2) + (set! sv-20 arg0) + (set! sv-24 arg1) + (let* ((f0-3 (+ sv-24 (-> this bounds r))) + (f0-5 (* f0-3 f0-3)) + (v1-1 sv-20) + ) + (when (>= f0-5 (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) + (let ((s5-0 (new 'stack-no-clear 'nav-poly))) + (set! (-> s5-0 vertex 0 quad) (-> sv-20 quad)) + (set! (-> s5-0 vertex1 x) sv-16) + (set! (-> s5-0 data 20) (the-as uint 2)) + (nav-mesh-method-46 this s5-0) + (cond + ((-> s5-0 vertex2 x) + #t + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + (project-point-into-poly-2d this (the-as nav-poly (-> s5-0 vertex1 z)) s4-0 sv-20) + (let ((f0-7 (vector-vector-xz-distance-squared s4-0 sv-20)) + (f1-5 sv-24) + ) + (< f0-7 (* f1-5 f1-5)) + ) + ) + ) + ) + ) + ) + ) + ) + +(defun init-ray-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (set! (-> arg0 dest-pos quad) (-> arg3 quad)) + (set! (-> arg0 current-poly) arg1) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-3 f0-1)) + (.mov vf3 a1-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +(defun init-ray-dir-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector) (arg4 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-poly) arg1) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (let ((a1-3 (-> arg0 dest-pos))) + (let ((v1-1 (-> arg0 current-pos))) + (let ((a2-1 arg3)) + (let ((a3-1 arg4)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> v1-1 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-3 quad) vf6) + ) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-6 f0-2)) + (.mov vf3 a1-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +(defmethod try-move-along-ray ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 symbol)) + (let ((gp-0 (new 'stack-no-clear 'nav-ray))) + (let ((s4-0 0)) + (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) + (until v1-2 + (+! s4-0 1) + (advance-ray-to-nearest-poly-edge-or-dest! this gp-0) + (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) + ) + ) + (-> gp-0 len) + ) + ) + +(defun nav-ray-test ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> arg0 bounds)))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg2)) + ) + 0.0 + (set! (-> s3-1 y) 0.0) + (let ((f30-0 (vector-vector-xz-distance arg2 arg3))) + (vector-xz-normalize! s3-1 1.0) + (try-move-along-ray arg0 arg1 s4-1 s3-1 f30-0) + ) + ) + ) + +(defun point-poly-distance-min ((arg0 nav-mesh-work) (arg1 nav-poly) (arg2 float) (arg3 nav-poly)) + (let ((t0-0 (-> arg3 vertex-count)) + (a3-1 (-> arg3 vertex)) + (f0-0 arg2) + ) + (let ((v1-0 0)) + (let ((f1-0 (-> arg1 vertex0 x)) + (f2-0 (-> arg1 vertex0 z)) + (a1-1 0) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-1) + (let* ((t2-0 (-> a3-1 (-> arg0 vert0-table a1-1))) + (t1-6 (-> a3-1 (-> arg0 vert1-table a1-1))) + (f5-0 (- (-> t1-6 x) (-> t2-0 x))) + (f6-0 (- (-> t1-6 z) (-> t2-0 z))) + (f4-2 (- f1-0 (-> t2-0 x))) + (f3-4 (- f2-0 (-> t2-0 z))) + (f7-1 (- (* f5-0 f3-4) (* f6-0 f4-2))) + ) + (b! (>= 0.0 f7-1) cfg-9 :delay #f) + (+! v1-0 1) + (let* ((f8-2 f5-0) + (f8-4 (* f8-2 f8-2)) + (f9-0 f6-0) + (f8-5 (+ f8-4 (* f9-0 f9-0))) + ) + (let* ((f9-3 arg2) + (f9-6 (* f8-5 (* f9-3 f9-3))) + (f10-0 f7-1) + ) + (b! (< f9-6 (* f10-0 f10-0)) cfg-13) + ) + (let ((f5-2 (+ (* f5-0 f4-2) (* f6-0 f3-4)))) + arg2 + (b! (>= f5-2 0.0) cfg-5) + (let ((f3-8 (sqrtf (+ (* f4-2 f4-2) (* f3-4 f3-4))))) + (b! #t cfg-8 :delay (nop!)) + (label cfg-5) + (b! (>= f8-5 f5-2) cfg-7) + (let* ((f3-10 (- f1-0 (-> t1-6 x))) + (f3-12 (* f3-10 f3-10)) + (f4-6 (- f2-0 (-> t1-6 z))) + ) + (set! f3-8 (sqrtf (+ f3-12 (* f4-6 f4-6)))) + ) + (b! #t cfg-8 :delay (nop!)) + (label cfg-7) + (set! f0-0 (/ f7-1 (sqrtf f8-5))) + (b! #t cfg-13 :delay (nop!)) + (label cfg-8) + (set! f0-0 (fmin f0-0 f3-8)) + ) + ) + ) + ) + (label cfg-9) + (+! a1-1 1) + (label cfg-10) + (b! (< a1-1 (the-as int t0-0)) cfg-1) + ) + (if (zero? v1-0) + (set! f0-0 0.0) + ) + ) + (label cfg-13) + f0-0 + ) + ) + +(defmethod nav-mesh-method-46 ((this nav-mesh) (arg0 nav-poly)) + (local-vars + (v1-16 int) + (v1-31 int) + (sv-16 nav-poly) + (sv-20 (pointer uint8)) + (sv-24 nav-poly) + (sv-28 float) + (sv-32 int) + (sv-40 int) + (sv-48 nav-poly) + (sv-52 float) + ) + (set! sv-16 (the-as nav-poly #f)) + (set! sv-20 (search-for-sphere (-> this poly-hash) (the-as vector (-> arg0 vertex)) 12288.0)) + (set! (-> arg0 vertex2 x) (the-as float #f)) + (let ((s4-0 (-> this poly-hash bucket-size)) + (s3-0 sv-20) + (s2-0 0) + ) + (nop!) + (until (zero? v1-16) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + ;; og:preserve-this + (label cfg-2) + (let ((v1-3 (logand s0-0 1))) + (nop!) + (b! (zero? v1-3) cfg-16 :delay (nop!)) + ) + (set! sv-24 (-> this poly-array s1-0)) + (let ((v1-6 sv-24) + (f0-0 (-> arg0 vertex0 y)) + (f1-0 (-> arg0 vertex1 x)) + ) + (when (and (and (>= (+ (-> v1-6 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-6 vertex2 w) f1-0))) + (not (logtest? (-> sv-24 pat) (-> arg0 data 20))) + ) + (when (point-in-poly? this sv-24 (the-as vector (-> arg0 vertex))) + (set! (-> arg0 vertex2 x) (the-as float #t)) + (set! (-> arg0 vertex1 w) 0.0) + (set! sv-16 sv-24) + (goto cfg-38) + ) + ) + ) + (label cfg-16) + ;; og:preserve-this cast + (set! s0-0 (the-as uint (/ (the-as int s0-0) 2))) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-16 s2-0 s4-0) + (nop!) + ) + ) + (set! sv-28 (the-as float 10000000000000000000000000000000000000.0)) + (set! sv-32 0) + (set! sv-40 0) + (let ((s4-1 (-> this poly-hash bucket-size)) + (s3-1 sv-20) + (s2-1 0) + ) + (until (zero? v1-31) + (let ((s1-1 (* s2-1 8)) + (s0-1 (-> s3-1 0)) + ) + (b! (zero? s0-1) cfg-34 :delay (nop!)) + ;; og:preserve-this + (label cfg-20) + (let ((v1-19 (logand s0-1 1))) + (nop!) + (b! (zero? v1-19) cfg-33 :delay (nop!)) + ) + (set! sv-48 (-> this poly-array s1-1)) + (let ((v1-22 sv-48) + (f0-3 (-> arg0 vertex0 y)) + (f1-2 (-> arg0 vertex1 x)) + ) + (when (and (and (>= (+ (-> v1-22 vertex3 w) f1-2) f0-3) (>= f0-3 (- (-> v1-22 vertex2 w) f1-2))) + (not (logtest? (-> sv-48 pat) (-> arg0 data 20))) + ) + (set! sv-40 (+ sv-40 1)) + (set! sv-52 (point-poly-distance-min (-> this work) (the-as nav-poly (-> arg0 vertex)) sv-28 sv-48)) + (when (< sv-52 sv-28) + (set! sv-28 sv-52) + (set! sv-16 sv-48) + (nop!) + ) + ) + ) + (label cfg-33) + ;; og:preserve-this cast + (set! s0-1 (the-as uint (/ (the-as int s0-1) 2))) + (nop!) + (b! (nonzero? s0-1) cfg-20 :delay (set! s1-1 (+ s1-1 1))) + ) + (label cfg-34) + (+! s2-1 1) + (set! s3-1 (&-> s3-1 1)) + (set-on-less-than v1-31 s2-1 s4-1) + (nop!) + ) + ) + (if (not sv-16) + (set! sv-16 (-> this poly-array 0)) + ) + (set! (-> arg0 vertex1 w) sv-28) + (label cfg-38) + (set! (-> arg0 vertex1 z) (the-as float sv-16)) + arg0 + ) + +(defun nav-mesh-route-table-bit-index ((arg0 nav-mesh) (arg1 uint) (arg2 int)) + (* (+ arg2 (* arg1 (-> arg0 poly-count))) 2) + ) + +(defmethod get-route-portal ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) + (set! (-> arg2 next-poly) #f) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a1-1 this) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a1-1 poly-count))) 2)) + (s3-0 + (logand (the-as int (ash (the-as int (-> this route (shr v1-4 3))) (- (the-as int (logand v1-4 7))))) 3) + ) + ) + (set! (-> arg2 edge-index) -1) + (let ((s2-0 (-> arg0 adj-poly s3-0))) + (when (= s2-0 255) + (format 0 "nav-mesh::get-route-portal: data error in nav mesh~%") + (break!) + 0 + ) + (set! (-> arg2 edge-index) s3-0) + (set! (-> arg2 next-poly) (-> this poly-array s2-0)) + ) + (let ((a0-7 s3-0) + (v1-16 (+ s3-0 1)) + ) + (if (>= (the-as uint v1-16) (-> arg0 vertex-count)) + (set! v1-16 0) + ) + (set! (-> arg2 vertex 1 quad) (-> arg0 vertex a0-7 quad)) + (let ((v0-1 (-> arg2 vertex))) + (set! (-> v0-1 0 quad) (-> arg0 vertex v1-16 quad)) + v0-1 + ) + ) + ) + ) + (else + (the-as (inline-array nav-vertex) #f) + ) + ) + ) + +(defmethod lookup-poly-on-route-to-target ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a3-0 this) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a3-0 poly-count))) 2)) + (v1-9 (logand (ash (the-as int (-> this route (shr v1-4 3))) (- (the-as int (logand v1-4 7)))) 3)) + (a2-5 (new 'stack-no-clear 'array 'int8 4)) + ) + (set! (-> a2-5 0) (the-as int (-> arg0 adj-poly0))) + (set! (-> a2-5 1) (the-as int (-> arg0 adj-poly1))) + (set! (-> a2-5 2) (the-as int (-> arg0 adj-poly2))) + (set! (-> a2-5 3) (the-as int (-> arg0 adj-poly3))) + (let ((v1-11 (-> (the-as (pointer uint8) (&+ a2-5 v1-9))))) + (if (= v1-11 255) + (the-as nav-poly #f) + (-> this poly-array v1-11) + ) + ) + ) + ) + (else + (the-as nav-poly #f) + ) + ) + ) + +(defmethod compute-bounding-box-from-vertices ((this nav-mesh) (arg0 vector) (arg1 vector)) + (let ((f0-0 10000000000000000000000000000000000000.0) + (f1-0 -10000000000000000000000000000000000000.0) + ) + (set! (-> arg0 x) f0-0) + (set! (-> arg0 y) f0-0) + (set! (-> arg0 z) f0-0) + (set! (-> arg1 x) f1-0) + (set! (-> arg1 y) f1-0) + (set! (-> arg1 z) f1-0) + ) + (dotimes (v1-3 (the-as int (-> this poly-count))) + (let ((a3-1 (-> this poly-array v1-3))) + (dotimes (t0-1 (the-as int (-> a3-1 vertex-count))) + (let ((t1-2 (-> a3-1 vertex t0-1))) + (set! (-> arg0 x) (fmin (-> arg0 x) (-> t1-2 x))) + (set! (-> arg0 y) (fmin (-> arg0 y) (-> t1-2 y))) + (set! (-> arg0 z) (fmin (-> arg0 z) (-> t1-2 z))) + (set! (-> arg1 x) (fmax (-> arg1 x) (-> t1-2 x))) + (set! (-> arg1 y) (fmax (-> arg1 y) (-> t1-2 y))) + (set! (-> arg1 z) (fmax (-> arg1 z) (-> t1-2 z))) + ) + ) + ) + ) + (vector+! arg0 arg0 (the-as vector (-> this bounds))) + (vector+! arg1 arg1 (the-as vector (-> this bounds))) + 0 + (none) + ) + +(defmethod initialize-mesh! ((this nav-mesh)) + (local-vars + (sv-32 vector) + (sv-36 uint) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-64 symbol) + (sv-68 (inline-array vector)) + (sv-72 vector) + (sv-76 vector) + ) + (with-pp + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 (-> this poly-count)) + (set! sv-40 0) + (set! sv-48 0) + (set! sv-56 0) + (set! sv-64 (the-as symbol #f)) + (countdown (s5-0 sv-36) + (let ((v1-3 (-> this poly-array s5-0))) + (if (logtest? (-> v1-3 pat) 1) + (set! sv-56 (+ sv-56 1)) + ) + (set! sv-68 (-> v1-3 vertex)) + (set! sv-72 (-> v1-3 vertex1)) + (set! sv-76 (-> v1-3 vertex2)) + ) + (vector-3pt-cross! sv-32 (the-as vector sv-68) sv-72 sv-76) + (cond + ((= (vector-length sv-32) 0.0) + (set! sv-40 (+ sv-40 1)) + ) + (else + (let ((v1-9 sv-32)) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-9 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-11 f0-1)) + (.mov vf3 a0-11) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-9 quad) vf1) + ) + (if (>= 0.0 (-> sv-32 y)) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + (when (zero? sv-36) + (format #t "WARNING: nav-mesh has no triangles. ") + (set! sv-64 #t) + ) + (when (> sv-40 0) + (format #t "WARNING: nav-mesh has ~D triangles with zero area (out of ~D triangles). " sv-40 sv-36) + (set! sv-64 #t) + ) + (when (> sv-48 0) + (format #t "WARNING: nav-mesh has ~D triangles with inverted normals (out of ~D triangles). " sv-48 sv-36) + (set! sv-64 #t) + ) + (when (< (the-as uint 255) sv-36) + (format #t "WARNING: nav-mesh has ~D triangles (only up to ~D are allowed). " sv-36 255) + (set! sv-64 #t) + ) + (when (= sv-56 sv-36) + (format #t "WARNING: nav-mesh only contains gap triangles (~D triangles total). " sv-36) + (set! sv-64 #t) + ) + (when sv-64 + (if pp + (format #t "current process is ~A~%" (-> pp name)) + (format #t "(no current process).~%") + ) + ) + 0 + (none) + ) + ) + ) + +(defun ray-ccw-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f0-2 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f2-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f3-4 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (v0-0 #f) + ) + (let ((f1-7 (- f2-4 f0-2)) + (f2-5 (- f2-4 f3-4)) + (f3-5 (- f3-4 f0-2)) + ) + (when (and (>= (fabs f1-7) (fmax (fabs f3-5) (fabs f2-5))) (!= f1-7 0.0)) + (let ((f0-7 (+ (* (-> arg1 x) (- (-> arg3 z) (-> arg2 z))) (* (-> arg1 z) (- (-> arg2 x) (-> arg3 x)))))) + (set! v0-0 (< 0.0 f0-7)) + ) + ) + ) + v0-0 + ) + ) + +(defun ray-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f1-3 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f0-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f2-6 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (gp-0 #f) + ) + (let ((f30-0 (- f0-4 f1-3)) + (f0-5 (- f0-4 f2-6)) + (f1-4 (- f2-6 f1-3)) + ) + (when (and (>= (fabs f30-0) (fmax (fabs f1-4) (fabs f0-5))) (!= f30-0 0.0)) + (let ((f2-11 (+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 z) (-> arg1 z)))) + (f3-11 (+ (* (-> arg3 x) (-> arg1 x)) (* (-> arg3 z) (-> arg1 z)))) + (f28-0 (+ (* (-> arg0 x) (-> arg1 x)) (* (-> arg0 z) (-> arg1 z)))) + ) + (if (>= (* (+ (* f2-11 f0-5) (* f3-11 f1-4)) (sign f30-0)) (* f28-0 (fabs f30-0))) + (set! gp-0 #t) + ) + ) + ) + ) + gp-0 + ) + ) + +(defmethod nav-mesh-method-41 ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) + (local-vars + (s1-0 vector) + (sv-16 int) + (sv-24 nav-mesh-work) + (sv-28 uint) + (sv-32 (pointer int8)) + (sv-36 (pointer int8)) + (sv-40 vector) + (sv-44 vector) + ) + (set! sv-16 -1) + (set! sv-24 (-> this work)) + (set! sv-28 (-> arg0 vertex-count)) + (set! sv-32 (-> sv-24 vert0-table)) + (set! sv-36 (-> sv-24 vert1-table)) + (set! (-> arg2 quad) (-> arg3 quad)) + (dotimes (v1-8 (the-as int sv-28)) + (set! sv-40 (-> arg0 vertex (-> sv-32 v1-8))) + (set! sv-44 (-> arg0 vertex (-> sv-36 v1-8))) + (let* ((f0-1 (- (-> sv-40 z) (-> sv-44 z))) + (f1-2 (- (-> sv-44 x) (-> sv-40 x))) + (f2-4 (+ (* f0-1 (- (-> sv-40 x) (-> arg1 x))) (* f1-2 (- (-> sv-40 z) (-> arg1 z))))) + (f0-3 (+ (* (-> arg2 x) f0-1) (* (-> arg2 z) f1-2))) + ) + (when (< f2-4 f0-3) + (set! sv-16 v1-8) + (let ((f0-4 (/ f2-4 f0-3))) + (set! (-> arg2 x) (* (-> arg2 x) f0-4)) + (set! (-> arg2 z) (* (-> arg2 z) f0-4)) + ) + ) + ) + ) + (when arg4 + (cond + ((= sv-16 -1) + (set! (-> arg4 0) #f) + ) + (else + (while (!= sv-16 -1) + (let ((v1-16 (-> arg0 adj-poly sv-16))) + (cond + ((!= v1-16 255) + (set! (-> arg4 0) (-> this poly-array v1-16)) + (set! sv-16 -1) + ) + ((let ((a1-1 (-> arg0 vertex (-> sv-32 sv-16)))) + (set! s1-0 (-> arg0 vertex (-> sv-36 sv-16))) + (< (vector-vector-xz-distance arg1 a1-1) (-> this work nav-poly-min-dist)) + ) + (set! sv-16 (+ sv-16 -1)) + (if (< sv-16 0) + (set! sv-16 (the-as int (+ sv-28 -1))) + ) + ) + ((< (vector-vector-xz-distance arg1 s1-0) (-> this work nav-poly-min-dist)) + (set! sv-16 (+ sv-16 1)) + (when (>= sv-16 (the-as int sv-28)) + (set! sv-16 0) + 0 + ) + ) + (else + (set! (-> arg4 0) #f) + (set! sv-16 -1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> arg2 y) (-> arg1 y)) + arg2 + ) + +(defun plane-height-at-xz-point ((arg0 plane) (arg1 vector)) + (/ (- (+ (* (-> arg1 x) (-> arg0 x)) (* (-> arg1 z) (-> arg0 z)) (-> arg0 w))) (-> arg0 y)) + ) + +(defun nav-normal-from-3-points ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (normal-of-plane arg0 arg1 arg2 arg3) + 0 + (none) + ) + +(defmethod project-point-onto-plane-of-poly-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (cond + ((= (-> arg0 vertex-count) 3) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ((let* ((v1-2 (-> arg0 vertex2)) + (a0-3 (-> arg0 vertex)) + (f0-1 (- (-> a0-3 0 x) (-> v1-2 x))) + (f1-2 (- (-> a0-3 0 z) (-> v1-2 z))) + (f2-2 (- (-> arg3 x) (-> v1-2 x))) + (f0-3 (- (* f0-1 (- (-> arg3 z) (-> v1-2 z))) (* f1-2 f2-2))) + ) + (< 0.0 f0-3) + ) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex2) (-> arg0 vertex3)) + ) + (else + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ) + (set! (-> arg2 quad) (-> s4-0 quad)) + (set! (-> s4-0 w) (- (vector-dot s4-0 (the-as vector (-> arg0 vertex))))) + (set! (-> s5-0 quad) (-> arg3 quad)) + (set! (-> s5-0 y) (/ (- (+ (* (-> arg3 x) (-> s4-0 x)) (* (-> arg3 z) (-> s4-0 z)) (-> s4-0 w))) (-> s4-0 y))) + ) + (set! (-> arg1 quad) (-> s5-0 quad)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs nav-mesh. +(defmethod mem-usage ((this nav-mesh) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 47 (-> usage length))) + (set! (-> usage data 46 name) "nav-mesh") + (+! (-> usage data 46 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 46 used) v1-6) + (+! (-> usage data 46 total) (logand -16 (+ v1-6 15))) + ) + (set! (-> usage length) (max 47 (-> usage length))) + (set! (-> usage data 46 name) "nav-mesh") + (+! (-> usage data 46 count) 1) + (let ((v1-16 (* (-> this poly-count) 64))) + (+! (-> usage data 46 used) v1-16) + (+! (-> usage data 46 total) (logand -16 (+ v1-16 15))) + ) + (set! (-> usage length) (max 47 (-> usage length))) + (set! (-> usage data 46 name) "nav-mesh") + (+! (-> usage data 46 count) 1) + (let* ((v1-25 (-> this poly-count)) + (v1-27 (shr (* v1-25 v1-25) 2)) + ) + (+! (-> usage data 46 used) v1-27) + (+! (-> usage data 46 total) (logand -16 (+ v1-27 15))) + ) + (the-as nav-mesh 0) + ) + +(defun get-nav-mesh ((arg0 actor-id)) + (let ((gp-0 (the-as nav-mesh #f))) + (let* ((s5-0 (entity-nav-mesh-by-aid arg0)) + (v1-0 (if (type? s5-0 entity-nav-mesh) + s5-0 + ) + ) + ) + (if v1-0 + (set! gp-0 (-> v1-0 nav-mesh)) + ) + ) + gp-0 + ) + ) + +(defun find-nearest-nav-mesh ((arg0 vector) (arg1 float)) + (local-vars (v1-15 float) (sv-64 nav-find-poly-parms) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-64 (new 'stack-no-clear 'nav-find-poly-parms)) + (set! sv-68 (the-as nav-mesh #f)) + (set! sv-72 arg1) + (set! sv-76 arg0) + (set! (-> sv-64 ignore) (the-as uint 7)) + (dotimes (gp-0 (-> *level* length)) + (let ((v1-5 (-> *level* level gp-0))) + (when (= (-> v1-5 status) 'active) + (let ((s5-0 (-> v1-5 bsp nav-meshes))) + (when (nonzero? s5-0) + (dotimes (s4-0 (-> s5-0 length)) + (let ((s3-0 (-> s5-0 s4-0 nav-mesh))) + (when s3-0 + (vector-! (-> sv-64 point) sv-76 (the-as vector (-> s3-0 bounds))) + (.lvf vf1 (&-> (-> sv-64 point) 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-15 vf1) + (let ((f0-1 v1-15) + (f1-0 (-> s3-0 bounds r)) + ) + (when (< f0-1 (* f1-0 f1-0)) + (set! (-> sv-64 y-threshold) (-> s3-0 nearest-y-threshold)) + (nav-mesh-method-46 s3-0 (the-as nav-poly sv-64)) + (when (>= sv-72 (-> sv-64 dist)) + (set! sv-72 (-> sv-64 dist)) + (set! sv-68 s3-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + sv-68 + ) + ) + +(defmethod nav-mesh-method-10 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> gp-0 poly) arg2) + (vector-! (-> gp-0 point) arg1 (the-as vector (-> this bounds))) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? this (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 3)) + (nav-mesh-method-46 this (the-as nav-poly gp-0)) + (when (-> gp-0 poly) + (project-point-into-poly-2d this (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (the-as vector (-> this bounds))) + ) + ) + (-> gp-0 poly) + ) + ) + +(defun point-to-poly-boundary ((arg0 nav-poly) (arg1 vector) (arg2 vector)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (set! (-> gp-0 4 x) (the-as float #x7f800000)) + (let* ((s2-0 (-> arg0 vertex-count)) + (v1-1 (the-as int (+ s2-0 -1))) + ) + (dotimes (s1-0 (the-as int s2-0)) + (when (= (-> arg0 adj-poly v1-1) 255) + (set! (-> gp-0 2 quad) (-> arg0 vertex v1-1 quad)) + (set! (-> gp-0 3 quad) (-> arg0 vertex s1-0 quad)) + (set! (-> gp-0 2 y) (-> arg2 y)) + (set! (-> gp-0 3 y) (-> arg2 y)) + (set! (-> gp-0 2 w) 1.0) + (set! (-> gp-0 3 w) 1.0) + (let ((f0-5 (vector-segment-distance-point! arg2 (-> gp-0 2) (-> gp-0 3) (-> gp-0 0)))) + (when (< f0-5 (-> gp-0 4 x)) + (set! (-> gp-0 4 x) f0-5) + (set! (-> gp-0 1 quad) (-> gp-0 0 quad)) + ) + ) + ) + (set! v1-1 s1-0) + ) + ) + (set! (-> arg1 quad) (-> gp-0 1 quad)) + (-> gp-0 4 x) + ) + ) + +(defmethod nav-mesh-method-36 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (local-vars (v1-13 int) (sv-80 vector) (sv-84 (pointer uint8))) + (let ((gp-0 (new 'stack-no-clear 'nav-poly))) + (set! sv-80 arg0) + (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) + (set! (-> gp-0 vertex3 x) arg2) + (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) + (set! sv-84 (search-for-sphere (-> this poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) + (let ((s4-0 (-> this poly-hash bucket-size)) + (s3-0 sv-84) + (s2-0 0) + ) + (until (zero? v1-13) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-14 :delay (nop!)) + ;; og:preserve-this + (label cfg-2) + (let ((v1-5 (logand s0-0 1))) + (nop!) + (b! (zero? v1-5) cfg-13 :delay (nop!)) + ) + (let* ((a0-5 (-> this poly-array s1-0)) + (v1-7 a0-5) + (f0-3 (-> gp-0 vertex1 y)) + (f1-0 (-> this nearest-y-threshold)) + ) + (if (and (>= (+ (-> v1-7 vertex3 w) f1-0) f0-3) (>= f0-3 (- (-> v1-7 vertex2 w) f1-0))) + (set! (-> gp-0 vertex3 z) (point-to-poly-boundary a0-5 (-> gp-0 vertex2) (-> gp-0 vertex1))) + ) + ) + (when (< (-> gp-0 vertex3 z) (-> gp-0 vertex3 y)) + (set! (-> gp-0 vertex3 y) (-> gp-0 vertex3 z)) + (set! (-> gp-0 vertex 0 quad) (-> gp-0 vertex2 quad)) + (nop!) + ) + (label cfg-13) + ;; og:preserve-this cast + (set! s0-0 (the-as uint (/ (the-as int s0-0) 2))) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-14) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-13 s2-0 s4-0) + (nop!) + ) + ) + 0 + (set! (-> sv-80 quad) (-> gp-0 vertex 0 quad)) + (-> gp-0 vertex3 y) + ) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod nav-mesh-method-37 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) + (set! (-> gp-0 2 vertex3 y) arg2) + (vector-! (the-as vector (-> gp-0 0)) arg0 (the-as vector (-> this bounds))) + (vector-! (-> gp-0 0 vertex1) arg1 (the-as vector (-> this bounds))) + (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) + (set! (-> gp-0 2 vertex2 x) (-> this nearest-y-threshold)) + (set! (-> gp-0 2 data 36) (the-as uint 3)) + (let ((a1-4 (nav-mesh-method-45 this (the-as nav-poly (-> gp-0 2 vertex1))))) + (cond + (a1-4 + (init-ray-local (the-as nav-ray (-> gp-0 1)) a1-4 (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex1)) + (until #f + (set! (-> gp-0 2 vertex3 z) + (nav-mesh-method-36 this (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) + ) + (when (< (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) + (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) + (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) + ) + (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) + (advance-ray-to-nearest-poly-edge-or-dest! this (the-as nav-ray (-> gp-0 1))) + ) + #f + (label cfg-6) + (if (-> gp-0 2 vertex0 z) + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + (else + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + ) + (-> gp-0 2 vertex3 y) + ) + ) + +;; WARN: Return type mismatch nav-poly vs none. +(defmethod nav-mesh-method-11 ((this nav-mesh) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> v1-0 point) arg0 (the-as vector (-> this bounds))) + (set! (-> v1-0 y-threshold) 4096000000.0) + (set! (-> v1-0 ignore) (the-as uint 2)) + (nav-mesh-method-45 this (the-as nav-poly (-> v1-0 point))) + ) + (none) + ) + +(deftype nav-find-clear-spot-work (structure) + ((id-array int8 16) + (sphere-array sphere 16 :inline) + ) + ) + +(defmethod inspect ((this nav-find-clear-spot-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nav-find-clear-spot-work) + (format #t "~1Tid-array[16] @ #x~X~%" (-> this id-array)) + (format #t "~1Tsphere-array[16] @ #x~X~%" (-> this sphere-array)) + (label cfg-4) + this + ) + +(defmethod nav-mesh-method-12 ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 nav-poly)) + (let ((gp-0 (new 'stack-no-clear 'nav-stack-type))) + (set! (-> gp-0 byte03) 0) + (set! (-> gp-0 byte04) 3) + (set! (-> gp-0 vec3 y) arg1) + (set! (-> gp-0 byte02) 0) + (set! (-> gp-0 vec1 quad) (-> arg0 quad)) + (b! #t cfg-9 :delay (nop!)) + (label cfg-1) + (set! (-> gp-0 nav-id-params bsphere quad) (-> gp-0 vec1 quad)) + (set! (-> gp-0 nav-id-params bsphere r) (-> gp-0 vec3 y)) + (set! (-> gp-0 nav-id-params max-len) 16) + (set! (-> gp-0 nav-id-params mask) (the-as uint 255)) + (set! (-> gp-0 nav-id-params array) (-> gp-0 byte-arr)) + (set! (-> gp-0 nav-id-params y-threshold) 4096000000.0) + (sphere-hash-method-29 (-> this sphere-hash) (-> gp-0 nav-id-params)) + (set! (-> gp-0 byte01) (-> gp-0 nav-id-params len)) + (b! (nonzero? (-> gp-0 byte01)) cfg-3 :delay (empty-form)) + (set! (-> arg2 vertex0 quad) (-> gp-0 vec1 quad)) + (set! (-> gp-0 byte03) 1) + (b! #t cfg-11 :delay (nop!)) + (label cfg-3) + (dotimes (v1-15 (-> gp-0 byte01)) + (let ((a1-2 (-> gp-0 byte-arr v1-15))) + (set! (-> gp-0 vec4 quad) (-> this sphere-hash sphere-array a1-2 quad)) + ) + (vector-! (-> gp-0 vec5) (-> gp-0 vec1) (-> gp-0 vec4)) + (set! (-> gp-0 vec5 y) 0.0) + (let ((a0-9 (-> gp-0 vec5))) + (set! (-> gp-0 vec3 z) (+ (* (-> a0-9 x) (-> a0-9 x)) (* (-> a0-9 z) (-> a0-9 z)))) + ) + (let ((f0-8 (-> gp-0 vec3 z)) + (f1-4 (+ (-> gp-0 vec3 y) (-> gp-0 vec4 w))) + ) + (when (< f0-8 (* f1-4 f1-4)) + (set! (-> gp-0 vec2 quad) (-> gp-0 vec1 quad)) + (set! (-> gp-0 vec3 w) (sqrtf (-> gp-0 vec3 z))) + (vector-float*! (-> gp-0 vec6) (-> gp-0 vec5) (/ 1.0 (-> gp-0 vec3 w))) + (vector+float*! + (-> gp-0 vec1) + (-> gp-0 vec1) + (-> gp-0 vec6) + (+ (- 410.0 (-> gp-0 vec3 w)) (-> gp-0 vec4 w) (-> gp-0 vec3 y)) + ) + 0 + ) + ) + ) + (+! (-> gp-0 byte02) 1) + (label cfg-9) + (b! (< (-> gp-0 byte02) (-> gp-0 byte04)) cfg-1) + (label cfg-11) + (= (-> gp-0 byte03) 1) + ) + ) + +(defmethod nav-mesh-method-38 ((this nav-mesh) (arg0 nav-poly)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector arg0) (the-as vector (-> this bounds))))) + (countdown (s3-0 (-> this nav-control-count)) + (let ((v1-2 (-> this nav-control-array s3-0))) + (if (-> v1-2 process) + (send-event (-> v1-2 process) 'nav-mesh-moved s4-1 arg0) + ) + ) + ) + ) + (set! (-> this bounds quad) (-> arg0 vertex0 quad)) + 0 + (none) + ) + +(none) + +) diff --git a/goal_src/jak3/engine/physics/ragdoll-h.gc b/goal_src/jak3/engine/physics/ragdoll-h.gc index 8b4a4a7af2..6710560b0a 100644 --- a/goal_src/jak3/engine/physics/ragdoll-h.gc +++ b/goal_src/jak3/engine/physics/ragdoll-h.gc @@ -199,7 +199,7 @@ (get-max-angle-for-joint-idx (_type_ int) degrees) (ragdoll-method-23 (_type_ vector vector float symbol) none) (ragdoll-method-24 (_type_ vector int) none) - (ragdoll-method-25 (_type_ process-drawable) none) + (enable-ragdoll! (_type_ process-drawable) none) ) ) diff --git a/goal_src/jak3/engine/physics/ragdoll.gc b/goal_src/jak3/engine/physics/ragdoll.gc index b26bf84be5..2eb67b932a 100644 --- a/goal_src/jak3/engine/physics/ragdoll.gc +++ b/goal_src/jak3/engine/physics/ragdoll.gc @@ -438,7 +438,7 @@ ) ) -(defmethod ragdoll-method-25 ((this ragdoll) (proc process-drawable)) +(defmethod enable-ragdoll! ((this ragdoll) (proc process-drawable)) (let ((s4-0 (-> this ragdoll-joints))) (logior! (-> proc skel status) (joint-control-status no-joint-callbacks)) (do-joint-math (-> proc draw) (-> proc node-list) (-> proc skel)) diff --git a/goal_src/jak3/engine/physics/rigid-body-h.gc b/goal_src/jak3/engine/physics/rigid-body-h.gc index eaaa4f2200..34affb7ddb 100644 --- a/goal_src/jak3/engine/physics/rigid-body-h.gc +++ b/goal_src/jak3/engine/physics/rigid-body-h.gc @@ -227,9 +227,9 @@ (rigid-body-object-method-43 (_type_) none) (impulse-handler (_type_) none) (go-active (_type_) object) - (rigid-body-object-method-46 (_type_) none) + (apply-damage (_type_ float rigid-body-impact) none) (impulse-force<-penetrate (_type_ rigid-body-impact attack-info penetrate) none) - (rigid-body-object-method-48 (_type_) none) + (on-impact (_type_ rigid-body-impact) none) (rbody-event-handler (_type_ process int symbol event-message-block) object) (attack-handler (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol) (touch-handler (_type_ process-focusable touching-shapes-entry) symbol) @@ -249,7 +249,7 @@ (:methods (init-queue! (_type_ process) none) (rigid-body-queue-method-10 (_type_) none) - (rigid-body-queue-method-11 (_type_ process int) none) + (rigid-body-queue-method-11 (_type_ process) none) (rigid-body-queue-method-12 (_type_ int int) none) (rigid-body-queue-method-13 (_type_ int process) none) (rigid-body-queue-method-14 (_type_ int) none) diff --git a/goal_src/jak3/engine/physics/rigid-body-queue.gc b/goal_src/jak3/engine/physics/rigid-body-queue.gc index 413ef0acc6..21a2577ddd 100644 --- a/goal_src/jak3/engine/physics/rigid-body-queue.gc +++ b/goal_src/jak3/engine/physics/rigid-body-queue.gc @@ -122,18 +122,18 @@ ) ) -(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 process) (arg1 int)) +(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 process)) (let ((v1-0 -1)) - (let ((a2-1 0)) + (let ((a2-0 0)) (b! #t cfg-9 :delay (nop!)) (label cfg-1) - (b! (handle->process (-> this array a2-1)) cfg-8 :delay (empty-form)) - (set! v1-0 a2-1) + (b! (handle->process (-> this array a2-0)) cfg-8 :delay (empty-form)) + (set! v1-0 a2-0) (b! #t cfg-11 :delay (nop!)) (label cfg-8) - (+! a2-1 1) + (+! a2-0 1) (label cfg-9) - (b! (< a2-1 (-> this count)) cfg-1) + (b! (< a2-0 (-> this count)) cfg-1) ) (label cfg-11) (cond diff --git a/goal_src/jak3/engine/physics/rigid-body.gc b/goal_src/jak3/engine/physics/rigid-body.gc index eae6e9879c..1d13d98b95 100644 --- a/goal_src/jak3/engine/physics/rigid-body.gc +++ b/goal_src/jak3/engine/physics/rigid-body.gc @@ -1084,12 +1084,12 @@ 0 ) -(defmethod rigid-body-object-method-46 ((this rigid-body-object)) +(defmethod apply-damage ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) -(defmethod rigid-body-object-method-48 ((this rigid-body-object)) +(defmethod on-impact ((this rigid-body-object) (arg0 rigid-body-impact)) 0 (none) ) @@ -1155,7 +1155,7 @@ ) (set! (-> arg0 impulse) (* f0-1 (-> this info extra attack-force-scale))) ) - (rigid-body-object-method-46 this) + (apply-damage this f1-1 arg0) 0 (none) ) @@ -1187,8 +1187,8 @@ (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s5-0 point) s4-1 (meters 0.00024414062) *color-blue*) ) ) + (on-impact this s5-0) ) - (rigid-body-object-method-48 this) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (go-active this) ) @@ -1240,7 +1240,7 @@ *color-blue* ) ) - (rigid-body-object-method-48 this) + (on-impact this s5-0) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (go-active this) ) @@ -1254,11 +1254,12 @@ (defmethod rbody-event-handler ((this rigid-body-object) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) - (-> arg3 param 0) - (if (!= this arg0) - (impulse-handler this) - ) - (rigid-body-object-method-48 this) + (let ((s5-1 (-> arg3 param 0))) + (if (!= this arg0) + (impulse-handler this) + ) + (on-impact this (the-as rigid-body-impact s5-1)) + ) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (go-active this) ) diff --git a/goal_src/jak3/engine/physics/trajectory.gc b/goal_src/jak3/engine/physics/trajectory.gc index 442d31f5c3..8d33df49c3 100644 --- a/goal_src/jak3/engine/physics/trajectory.gc +++ b/goal_src/jak3/engine/physics/trajectory.gc @@ -319,16 +319,19 @@ ) ) (when s4-1 - (cond - (((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1) - (let ((t9-4 (method-of-type nav-control nav-control-method-20))) - #x45000000 - (t9-4) - ) - ) - (else - (set! (-> arg0 quad) (the-as uint128 0)) - ) + (let ((a2-3 ((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1))) + (if a2-3 + ((method-of-type nav-control clamp-vector-to-mesh-cross-gaps) + (the-as nav-control s4-1) + arg1 + a2-3 + arg0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (set! (-> arg0 quad) (the-as uint128 0)) + ) ) ) ) diff --git a/goal_src/jak3/engine/process-drawable/process-drawable.gc b/goal_src/jak3/engine/process-drawable/process-drawable.gc index 8aeb7d2bfd..a58a024a4d 100644 --- a/goal_src/jak3/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak3/engine/process-drawable/process-drawable.gc @@ -622,7 +622,7 @@ ) (let ((a0-3 (-> this nav))) (if (and a0-3 (nonzero? a0-3)) - ((method-of-type nav-control nav-control-method-41)) + (remove! a0-3) ) ) (let* ((s5-0 (-> this root)) @@ -1512,9 +1512,9 @@ (if (or (zero? s4-0) (or (not (-> gp-0 root-channel 0 frame-group)) (zero? (-> gp-0 active-channels)))) (logior! (-> this draw status) (draw-control-status no-draw-temp)) ) - ;; (if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid)) - ;; (merc-blend-shape this) - ;; ) + (if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape this) + ) (if (logtest? (-> this skel status) (joint-control-status eye-anim-valid eye-anim)) (merc-eye-anim this) ) diff --git a/goal_src/jak3/engine/process-drawable/process-taskable.gc b/goal_src/jak3/engine/process-drawable/process-taskable.gc index 284d2d8455..7e2ffee9a4 100644 --- a/goal_src/jak3/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak3/engine/process-drawable/process-taskable.gc @@ -375,7 +375,7 @@ ) :code (behavior () (if (-> self skel effect) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) ) (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 1)) diff --git a/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc b/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc index 7e9734be0c..6e56b36c07 100644 --- a/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc +++ b/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc @@ -119,17 +119,10 @@ ) (logclear! (-> self mask) (process-mask actor-pause enemy)) (set! (-> self event-hook) simple-nav-sphere-event-handler) - (cond - (arg2 - (let ((t9-5 (method-of-object arg2 nav-mesh-method-31))) - self - (t9-5) - ) - ) - (else + (if arg2 + (add-process-drawable-to-nav-mesh arg2 self #f) (nav-mesh-connect-from-ent self) ) - ) (if (>= (-> self track-joint) 0) (go-virtual active) (go-virtual idle) diff --git a/goal_src/jak3/engine/scene/scene.gc b/goal_src/jak3/engine/scene/scene.gc index e43b1987e3..8c8682a146 100644 --- a/goal_src/jak3/engine/scene/scene.gc +++ b/goal_src/jak3/engine/scene/scene.gc @@ -905,6 +905,8 @@ (defstate wait (scene-player) :virtual #t :enter (behavior ((arg0 symbol)) + (format 0 "scene-player: skipping scene~%") + (go-virtual release) (set-time! (-> self state-time)) (if (= (-> *game-info* demo-state) 101) (set-setting! 'audio-language #f 0.0 5) @@ -1880,7 +1882,7 @@ ;; WARN: Return type mismatch object vs none. (defbehavior scene-player-init scene-player ((arg0 object) (arg1 symbol) (arg2 string)) (process-entity-set! self (the-as entity #f)) - (stack-size-set! (-> self main-thread) 512) + (stack-size-set! (-> self main-thread) 1024) (set! (-> self root) (new 'process 'trsqv)) (case (rtype-of arg0) ((array) diff --git a/goal_src/jak3/engine/sound/gsound-h.gc b/goal_src/jak3/engine/sound/gsound-h.gc index c1cb1c55df..f346d2583f 100644 --- a/goal_src/jak3/engine/sound/gsound-h.gc +++ b/goal_src/jak3/engine/sound/gsound-h.gc @@ -108,6 +108,7 @@ (reg1) (reg2) (unk) + (unk2) ) (defenum stream-status diff --git a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc index beed387cfa..713e8ae4fa 100644 --- a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc @@ -76,6 +76,24 @@ O(n^2) 'check everybody against everybody' collision loop." ) ) +;; og:preserve-this added +(deftype nav-stack-type (structure) + "nav-mesh::12" + ((nav-id-params find-nav-sphere-ids-params :inline :offset 0) + (vec1 vector :inline :offset 32) + (vec2 vector :inline :offset 48) + (vec3 vector :inline :offset 64) + (byte01 int8 :offset 64) + (byte02 int8 :offset 65) + (byte03 int8 :offset 66) + (byte04 int8 :offset 67) + (vec4 vector :inline :offset 80) + (vec5 vector :inline :offset 96) + (vec6 vector :inline :offset 112) + (byte-arr uint8 20 :offset 128) + ) + ) + (deftype sphere-hash (grid-hash) "An extension of grid hash that holds spheres inside of the grid." @@ -91,8 +109,8 @@ O(n^2) 'check everybody against everybody' collision loop." (add-a-sphere (_type_ vector) int) (add-a-sphere-with-flag (_type_ vector int) int) (update-from-spheres (_type_) none) - (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none) - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none) + (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) (add-sphere-with-mask-and-id (_type_ vector int int) symbol) (sphere-hash-method-32 (_type_ sphere int) symbol) ) diff --git a/goal_src/jak3/engine/target/board/target-board.gc b/goal_src/jak3/engine/target/board/target-board.gc index 2109a03760..5585ea3fb4 100644 --- a/goal_src/jak3/engine/target/board/target-board.gc +++ b/goal_src/jak3/engine/target/board/target-board.gc @@ -1459,9 +1459,9 @@ ) ) (spawn (-> self board effect-part) (-> self control trans)) - (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + (do-effect (-> self skel effect) "effect-board-poof" 0.0 -1) (if (< (-> self board shock-offset) -2048.0) - (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + (do-effect (-> self skel effect) "effect-board-poof" 0.0 -1) ) ) (vector-lerp! (-> self board slow-transv) (-> self board slow-transv) (-> self control transv) 0.2) diff --git a/goal_src/jak3/engine/target/flut/flut.gc b/goal_src/jak3/engine/target/flut/flut.gc index 63e189b869..70559872ff 100644 --- a/goal_src/jak3/engine/target/flut/flut.gc +++ b/goal_src/jak3/engine/target/flut/flut.gc @@ -491,7 +491,7 @@ ) ) ) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) diff --git a/goal_src/jak3/engine/target/flut/target-flut.gc b/goal_src/jak3/engine/target/flut/target-flut.gc index d7b94ce65a..2e9041df23 100644 --- a/goal_src/jak3/engine/target/flut/target-flut.gc +++ b/goal_src/jak3/engine/target/flut/target-flut.gc @@ -2612,7 +2612,7 @@ (set! (-> self control last-attack-end-time) 0) (set! (-> self control mod-surface) *flut-air-attack-mods*) (sound-play "flop-land" :pitch -0.4) - (do-effect (-> self skel effect) (the-as symbol "group-flut-attack-strike-ground") (ja-frame-num 0) 0) + (do-effect (-> self skel effect) "group-flut-attack-strike-ground" (ja-frame-num 0) 0) (let ((gp-2 (process-spawn touch-tracker diff --git a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc index 877731733a..5566dbf560 100644 --- a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc @@ -44,47 +44,46 @@ (none) ) -(format 0 "SKIP: gun-blue-shot removed lightning specs~%") -;; (set! (-> *lightning-spec-id-table* 12) (new 'static 'lightning-spec -;; :name "lightning-blue-shot-attack-explode" -;; :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 1.0 -;; :fade-time 30.0 -;; :texture (new 'static 'texture-id :index #x8f :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.6 -;; :merge-count 2 -;; :radius 3276.8 -;; :duration 45.0 -;; :duration-rand 60.0 -;; :sound #f -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 12) (new 'static 'lightning-spec + :name "lightning-blue-shot-attack-explode" + :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 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 45.0 + :duration-rand 60.0 + :sound #f + ) + ) -;; (set! (-> *lightning-spec-id-table* 13) (new 'static 'lightning-spec -;; :name "lightning-blue-shot-terminal" -;; :flags (lightning-spec-flags lsf0) -;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) -;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) -;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) -;; :fade-start-factor 1.0 -;; :fade-time 30.0 -;; :texture (new 'static 'texture-id :index #x8f :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.6 -;; :merge-count 2 -;; :radius 3276.8 -;; :duration 75.0 -;; :sound #f -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 13) (new 'static 'lightning-spec + :name "lightning-blue-shot-terminal" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 75.0 + :sound #f + ) + ) ;; WARN: Return type mismatch (pointer process) vs object. (defbehavior gun-fire-blue-1 target () @@ -1600,12 +1599,12 @@ ) (dotimes (gp-1 4) (set! (-> self lt-array gp-1) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> self lt-array gp-1) 12 6 *blue-light-test*) + (init! (-> self lt-array gp-1) 12 6 *blue-light-test*) ) (set! (-> self lt-array 4) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> self lt-array 4) 12 5 *blue-light-test-big*) + (init! (-> self lt-array 4) 12 5 *blue-light-test-big*) (set! (-> self lt-array 5) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> self lt-array 5) 12 5 *blue-light-test-big*) + (init! (-> self lt-array 5) 12 5 *blue-light-test-big*) (set! (-> self revolve-angle) 0.0) (set! (-> self sway-angle) 0.0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 107) self)) @@ -2347,26 +2346,26 @@ () ) -(format 0 "SKIP: gun-blue-shot removed lightning spec 14~%") -;; (set! (-> *lightning-spec-id-table* 14) (new 'static 'lightning-spec -;; :name "lightning-blue-2-impact-shot-attack-thick" -;; :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 1.0 -;; :fade-time 30.0 -;; :texture (new 'static 'texture-id :index #x3f :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.6 -;; :merge-count 2 -;; :radius 3276.8 -;; :duration 60.0 -;; :sound (static-sound-spec "stretched-zap" :group 1) -;; ) -;; ) + +(set! (-> *lightning-spec-id-table* 14) (new 'static 'lightning-spec + :name "lightning-blue-2-impact-shot-attack-thick" + :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 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 60.0 + :sound (static-sound-spec "stretched-zap" :group 1) + ) + ) (defmethod deal-damage! ((this gun-blue-shot-2) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (process-mask guard) (-> arg0 mask)) diff --git a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc index 24fb1db2dd..81242fa680 100644 --- a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc @@ -12,47 +12,46 @@ ;; DECOMP BEGINS -(format 0 "SKIP: gun-dark-shot removed lightning specs~%") -;; (set! (-> *lightning-spec-id-table* 15) (new 'static 'lightning-spec -;; :name "lightning-dark-shot-attack" -;; :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 1.0 -;; :fade-time 30.0 -;; :texture (new 'static 'texture-id :index #x8f :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.6 -;; :merge-count 2 -;; :radius 3276.8 -;; :duration 45.0 -;; :duration-rand 60.0 -;; :sound (static-sound-spec "stretched-zap" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 15) (new 'static 'lightning-spec + :name "lightning-dark-shot-attack" + :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 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 45.0 + :duration-rand 60.0 + :sound (static-sound-spec "stretched-zap" :group 1) + ) + ) -;; (set! (-> *lightning-spec-id-table* 16) (new 'static 'lightning-spec -;; :name "lightning-dark-shot-attack-thick" -;; :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 1.0 -;; :fade-time 30.0 -;; :texture (new 'static 'texture-id :index #x3f :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.6 -;; :merge-count 2 -;; :radius 3276.8 -;; :duration 60.0 -;; :sound (static-sound-spec "stretched-zap" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 16) (new 'static 'lightning-spec + :name "lightning-dark-shot-attack-thick" + :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 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 60.0 + :sound (static-sound-spec "stretched-zap" :group 1) + ) + ) (defpartgroup group-lightning-dark-shot-tip-hit :id 183 diff --git a/goal_src/jak3/engine/target/logic-target.gc b/goal_src/jak3/engine/target/logic-target.gc index 5074108f82..b30a04684e 100644 --- a/goal_src/jak3/engine/target/logic-target.gc +++ b/goal_src/jak3/engine/target/logic-target.gc @@ -3008,7 +3008,7 @@ (set! (-> this game) *game-info*) (set! (-> this ext-geo-control) *target-geo-control*) (set! (-> this pending-ext-geo) - (if (and (logtest? (game-feature feature56) (-> this game features)) + (if (and (logtest? (game-feature jakc) (-> this game features)) (not (logtest? (game-secrets commentary) (-> *game-info* secrets))) ) (target-geo jakc) diff --git a/goal_src/jak3/engine/target/mech/mech-states.gc b/goal_src/jak3/engine/target/mech/mech-states.gc index 45f91dfcda..15bd6eab35 100644 --- a/goal_src/jak3/engine/target/mech/mech-states.gc +++ b/goal_src/jak3/engine/target/mech/mech-states.gc @@ -702,8 +702,8 @@ (set! (-> self mech state-impact? 0) s3-2) (set-forward-vel (-> self mech forward-vel)) (when (< 20480.0 (vector-length (-> self control transv))) - (do-effect (-> self skel effect) (the-as symbol "effect-slide-poof") (ja-frame-num 0) 49) - (do-effect (-> self skel effect) (the-as symbol "effect-slide-poof") (ja-frame-num 0) 43) + (do-effect (-> self skel effect) "effect-slide-poof" (ja-frame-num 0) 49) + (do-effect (-> self skel effect) "effect-slide-poof" (ja-frame-num 0) 43) ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) f30-4))) diff --git a/goal_src/jak3/engine/target/pilot-states.gc b/goal_src/jak3/engine/target/pilot-states.gc index 93adbaed9d..a124f2c2e4 100644 --- a/goal_src/jak3/engine/target/pilot-states.gc +++ b/goal_src/jak3/engine/target/pilot-states.gc @@ -7,3 +7,1148 @@ ;; DECOMP BEGINS +(defstate target-pilot-start (target) + :event target-pilot-handler + :exit target-pilot-exit + :code (behavior ((arg0 handle) (arg1 symbol) (arg2 symbol)) + (target-pilot-init arg0 arg2) + (suspend) + (remove-exit) + (if arg1 + (go target-pilot-stance) + (go target-pilot-get-on) + ) + ) + :post target-post + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-bike-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-pilot-bike-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-bike-turn-front-ja) + (ja :chan 2 :group! jakb-pilot-bike-up-down-ja) + (until #f + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (- 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((f0-3 (fmax 0.0 (fmin 1.0 (* 0.5 (+ 1.0 (* 1.42 (+ -0.3 (-> gp-0 front-back-interp))))))))) + (ja :chan 1 + :frame-interp0 f0-3 + :frame-interp1 f0-3 + :num-func num-func-identity + :frame-num (ja-aframe f30-0 1) + ) + ) + ) + (let ((f0-6 (* 5.0 (- 1.0 (-> gp-0 up-down-interp)))) + (s5-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> gp-0 up-down-interp)))) + (set! (-> s5-2 frame-interp 1) f1-7) + (set! (-> s5-2 frame-interp 0) f1-7) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe f0-6 2)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-car-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-pilot-car-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-car-turn-front-ja) + (ja :chan 2 :group! jakb-pilot-car-up-down-ja) + (until #f + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (+ 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-3) + (set! (-> s5-1 frame-interp 0) f0-3) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let ((f0-6 (* 10.0 (- 1.0 (-> gp-0 up-down-interp)))) + (s5-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> gp-0 up-down-interp)))) + (set! (-> s5-2 frame-interp 1) f1-7) + (set! (-> s5-2 frame-interp 0) f1-7) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe f0-6 2)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-wcar-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-pilot-wcar-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-wcar-turn-front-ja) + (ja :chan 2 :group! jakb-pilot-car-up-down-ja) + (until #f + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (+ 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-3) + (set! (-> s5-1 frame-interp 0) f0-3) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let ((f0-6 (* 10.0 (- 1.0 (-> gp-0 up-down-interp)))) + (s5-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> gp-0 up-down-interp)))) + (set! (-> s5-2 frame-interp 1) f1-7) + (set! (-> s5-2 frame-interp 0) f1-7) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe f0-6 2)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-glider-anim-loop target () + (ja-channel-push! 2 (seconds 0.1)) + (ja :group! jakb-pilot-glider-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-glider-turn-front-ja) + (until #f + (let* ((gp-0 (-> self pilot)) + (f30-0 (* 5.0 (- 1.0 (-> gp-0 left-right-interp)))) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-3) + (set! (-> s5-1 frame-interp 0) f0-3) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-daxter-pilot-car-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-wings-lightjak-stance-ja) + (ja :chan 1 :group! jakb-wings-lightjak-get-on-land-ja) + (ja :chan 2 :group! jakb-wings-lightjak-swoop-fall-loop-ja) + (until #f + (when (or (-> self pilot jumping?) (let ((v1-14 (ja-group))) + (and v1-14 (= v1-14 jakb-wings-lightjak-swoop1-ja)) + ) + ) + (let ((v1-20 (ja-group))) + (if (not (and v1-20 (= v1-20 jakb-wings-lightjak-swoop1-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja :group! jakb-wings-lightjak-swoop1-ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 3 (seconds 0.3)) + (ja :group! jakb-wings-lightjak-stance-ja) + (ja :chan 1 :group! jakb-wings-lightjak-get-on-land-ja) + (ja :chan 2 :group! jakb-wings-lightjak-swoop-fall-loop-ja) + (set! (-> self pilot jumping?) #f) + ) + ) + (when (and (not (-> self pilot jumping?)) (let ((v1-57 (ja-group))) + (not (and v1-57 (= v1-57 jakb-wings-lightjak-swoop1-ja))) + ) + ) + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (+ 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-6 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-6) + (set! (-> s5-1 frame-interp 0) f0-6) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let* ((f30-1 (* 10.0 (- 1.0 (-> gp-0 up-down-interp)))) + (f0-9 (ja-aframe-num 2)) + (f28-0 (-> self skel root-channel 2 frame-interp 0)) + (f30-2 (seek f0-9 f30-1 (* 30.0 (seconds-per-frame)))) + (f0-16 (seek f28-0 (fabs (-> gp-0 up-down-interp)) (* 4.0 (seconds-per-frame)))) + ) + (ja :chan 2 + :frame-interp0 f0-16 + :frame-interp1 f0-16 + :num-func num-func-identity + :frame-num (ja-aframe f30-2 2) + ) + ) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior target-pilot-trans target () + (let ((gp-0 (-> self pilot))) + (process-drawable-set-riding self #t) + ;; og:preserve-this + (let* ((v1-0 (-> gp-0 vehicle)) + (a0-1 v1-0) + (s5-0 (the vehicle (handle->process v1-0))) + ) + (cond + ((not s5-0) + (ja-channel-set! 0) + (go target-falling #f) + ) + (#t + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 accel-array 7 quad) (-> gp-0 accel-array 6 quad)) + (set! (-> gp-0 accel-array 6 quad) (-> gp-0 accel-array 5 quad)) + (set! (-> gp-0 accel-array 5 quad) (-> gp-0 accel-array 4 quad)) + (set! (-> gp-0 accel-array 4 quad) (-> gp-0 accel-array 3 quad)) + (set! (-> gp-0 accel-array 3 quad) (-> gp-0 accel-array 2 quad)) + (set! (-> gp-0 accel-array 2 quad) (-> gp-0 accel-array 1 quad)) + (set! (-> gp-0 accel-array 1 quad) (-> gp-0 accel-array 0 quad)) + (get-linear-accel! s5-0 (the-as vector (-> gp-0 accel-array))) + (vector-reset! (-> s4-0 rvec)) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (the-as vector (-> gp-0 accel-array)) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 1) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 2) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 3) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 4) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 5) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 6) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 7) 1.0) + (vector-float*! (-> s4-0 rvec) (-> s4-0 rvec) 0.5) + (matrix-transpose! (the-as matrix (-> s4-0 uvec)) (-> self node-list data 0 bone transform)) + (vector-rotate*! (-> gp-0 local-accel) (-> s4-0 rvec) (the-as matrix (-> s4-0 uvec))) + ) + (copy-vehicle-controls! s5-0 (-> gp-0 controls)) + (let ((f30-0 (* 182.04445 (* 0.6 (the float (current-time))))) + (s5-1 (-> gp-0 local-accel)) + ) + (let ((f1-6 + (+ (-> gp-0 controls steering) + (-> gp-0 left-right-bias) + (* 0.03 (sin f30-0)) + (* -1.0 (-> s5-1 x) (-> gp-0 left-right-accel-factor)) + ) + ) + ) + (set! (-> gp-0 left-right-interp) + (fmax + (fmin + (+ (-> gp-0 left-right-interp) (* 8.0 (- f1-6 (-> gp-0 left-right-interp)) (seconds-per-frame))) + (-> gp-0 left-right-max) + ) + (-> gp-0 left-right-min) + ) + ) + ) + (let ((f3-1 + (+ (-> gp-0 controls lean-z) (* 0.03 (cos f30-0)) (* -1.0 (-> s5-1 z) (-> gp-0 front-back-accel-factor))) + ) + ) + (set! (-> gp-0 front-back-interp) + (fmax + -1.0 + (fmin 1.0 (+ (-> gp-0 front-back-interp) (* 8.0 (- f3-1 (-> gp-0 front-back-interp)) (seconds-per-frame)))) + ) + ) + ) + (let ((f3-5 (+ (* 0.03 (cos f30-0)) (* -1.0 (-> s5-1 y) (-> gp-0 up-down-accel-factor))))) + (set! (-> gp-0 up-down-interp) + (fmax + -1.0 + (fmin 1.0 (+ (-> gp-0 up-down-interp) (* 8.0 (- f3-5 (-> gp-0 up-down-interp)) (seconds-per-frame)))) + ) + ) + ) + ) + (when (and (-> self next-state) (= (-> self next-state name) 'target-pilot-stance)) + (let* ((v1-65 (-> gp-0 accel-array)) + (f0-30 (+ (* (-> v1-65 0 x) (-> v1-65 0 x)) (* (-> v1-65 0 z) (-> v1-65 0 z)))) + ) + (if (or (and (-> self pilot as-daxter?) (let ((f1-25 1024000.0)) + (< (* f1-25 f1-25) f0-30) + ) + ) + (let ((f1-28 2048000.0)) + (< (* f1-28 f1-28) f0-30) + ) + ) + (go target-pilot-impact) + ) + ) + ) + ) + (else + (go target-pilot-get-off (the-as handle a0-1)) + ) + ) + ) + ) + (none) + ) + +(defbehavior target-pilot-signal-ready target () + (when (not (focus-test? self pilot-riding)) + (logior! (-> self focus-status) (focus-status pilot-riding)) + (let ((gp-0 (handle->process (-> self pilot vehicle)))) + (when gp-0 + (if (logtest? #x80000 (-> (the-as vehicle gp-0) info flags)) + (set-setting! 'cloth #f 0.0 0) + ) + (if (logtest? #x100000 (-> (the-as vehicle gp-0) info flags)) + (set-setting! 'armor #f 0.0 0) + ) + (send-event gp-0 'pilot-on (-> self pilot seat-index)) + ) + ) + ) + ) + +(defstate target-pilot-stance (target) + :event target-pilot-handler + :exit target-pilot-exit + :trans (behavior () + (target-pilot-trans) + ) + :code (behavior () + (local-vars (v1-9 uint)) + (target-pilot-signal-ready) + (logior! (-> self target-flags) (target-flags tf6)) + (set! (-> self control mod-surface) *pilot-mods*) + (logior! (-> self control status) (collide-status on-surface on-ground)) + (cond + ((-> self pilot as-daxter?) + (target-daxter-pilot-car-anim-loop) + ) + ((begin (set! v1-9 (-> self pilot stance)) (zero? v1-9)) + (target-pilot-bike-anim-loop) + ) + ((= v1-9 1) + (target-pilot-car-anim-loop) + ) + ((= v1-9 2) + (target-pilot-wcar-anim-loop) + ) + ((= v1-9 3) + (target-pilot-glider-anim-loop) + ) + (else + (until #f + (suspend) + ) + #f + ) + ) + ) + :post (behavior () + (target-pilot-post) + ) + ) + +(defstate target-pilot-impact (target) + :event target-pilot-handler + :exit target-pilot-exit + :trans target-pilot-trans + :code (behavior () + (local-vars (v1-1 float) (v1-196 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> self pilot))) + (.lvf vf1 (&-> (-> gp-0 local-accel) 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-1 vf1) + (let ((f0-0 v1-1) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> gp-0 local-accel quad)) + (set! (-> s5-0 x) (* 4.0 (-> s5-0 x))) + (vector-float*! s5-0 s5-0 (/ 1.0 (sqrtf f0-0))) + (let ((s4-0 (cond + ((< 0.707 (-> s5-0 x)) + 5 + ) + ((< (-> s5-0 x) -0.707) + 4 + ) + ((< 0.707 (-> s5-0 y)) + 3 + ) + ((< (-> s5-0 y) -0.707) + 2 + ) + ((< 0.707 (-> s5-0 z)) + 1 + ) + ((< (-> s5-0 z) -0.707) + 0 + ) + (else + 6 + ) + ) + ) + ) + (cond + ((-> self pilot as-daxter?) + (ja-channel-push! 1 (seconds 0.05)) + (when (and (not (or (= s4-0 4) (= s4-0 5))) (!= s4-0 6)) + (if (< 0.0 (-> s5-0 x)) + (set! s4-0 5) + (set! s4-0 4) + ) + ) + (cond + ((= s4-0 4) + (ja-no-eval :group! jakb-wings-lightjak-swoop-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= s4-0 5) + (ja-no-eval :group! jakb-shield-shield-lod0-jg :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (else + (let ((v1-73 (-> self pilot stance))) + (cond + ((zero? v1-73) + (ja-channel-push! 1 (seconds 0.05)) + (let ((v1-74 s4-0)) + (cond + ((= v1-74 4) + (ja-no-eval :group! jakb-pilot-bike-smack-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= v1-74 5) + (ja-no-eval :group! jakb-pilot-bike-smack-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((zero? v1-74) + (ja-no-eval :group! jakb-pilot-bike-smack-front-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= v1-74 1) + (ja-no-eval :group! jakb-pilot-bike-smack-back-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-pilot-bike-smack-shock-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ((= v1-73 3) + (suspend) + 0 + ) + ((begin (ja-channel-push! 1 (seconds 0.05)) (set! v1-196 s4-0) (= v1-196 4)) + (ja-no-eval :group! jakb-pilot-car-smack-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= v1-196 5) + (ja-no-eval :group! jakb-pilot-car-smack-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((zero? v1-196) + (ja-no-eval :group! jakb-pilot-car-smack-front-ja :num! (seek! max 1.3) :frame-num (ja-aframe 4.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.3)) + ) + ) + ((= v1-196 1) + (ja-no-eval :group! jakb-pilot-car-smack-back-ja :num! (seek!) :frame-num (ja-aframe 2.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-pilot-car-smack-shock-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + ) + ) + (.svf (&-> (-> gp-0 accel-array) 0 quad) vf0) + ) + (go target-pilot-stance) + ) + ) + :post target-pilot-post + ) + +(defstate target-pilot-daxter-perch (target) + :event target-pilot-handler + :exit target-pilot-exit + :trans target-pilot-trans + :code (behavior () + (set! (-> self control unknown-word04) (the-as uint #f)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-pilot-wcar-snake-in-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (loop + (ja-no-eval :group! jakb-pilot-wcar-snake-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (-> self control unknown-spool-anim00) + (goto cfg-11) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (label cfg-11) + (ja-no-eval :group! jakb-pilot-wcar-snake-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go target-pilot-stance) + ) + :post target-pilot-post + ) + +(let ((v1-12 (copy *empty-mods* 'loading-level))) + (set! (-> v1-12 flags) (surface-flag)) + (set! *pilot-get-on-mods* v1-12) + ) + +(defstate target-pilot-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (let ((v1-1 (-> block param 0)) + (a0-1 'pilot) + ) + (when (= v1-1 a0-1) + (cond + ((focus-test? self pilot-riding) + (go target-pilot-get-off (the-as handle a0-1)) + ) + (else + (ja-channel-set! 0) + (go target-falling #f) + ) + ) + ) + ) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :exit target-pilot-exit + :trans (behavior () + (let* ((s5-0 (handle->process (-> self pilot vehicle))) + (t9-0 type?) + (a0-3 s5-0) + (gp-0 (if (t9-0 a0-3 vehicle) + s5-0 + ) + ) + ) + (cond + ((not gp-0) + (ja-channel-set! 0) + (go target-falling #f) + ) + ((focus-test? (the-as process-focusable gp-0) dead) + (go target-pilot-get-off (the-as handle a0-3)) + ) + (else + (vehicle-method-66 (the-as vehicle gp-0) (-> self control unknown-vector38) (-> self pilot seat-index)) + (set! (-> self control unknown-vector40 quad) (-> (the-as vehicle gp-0) root quat quad)) + ) + ) + ) + ) + :code (behavior () + (logior! (-> self focus-status) (focus-status pilot)) + (logior! (-> self target-flags) (target-flags tf6)) + (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (sound-play "jump") + (let ((gp-1 (if (zero? (-> self pilot stance)) + jakb-pilot-bike-get-on-ja + jakb-pilot-car-get-on-ja + ) + ) + ) + (ja-channel-set! 1) + (set! (-> self control mod-surface) *pilot-get-on-mods*) + (send-event (ppointer->process (-> self manipy)) 'draw #t) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (ja :group! gp-1 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (let ((f30-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 10.0)))) + (let ((f28-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 0.0 10.0))) + (vector-lerp! + (-> self control trans) + (-> self control unknown-vector37) + (-> self control unknown-vector38) + f30-0 + ) + (set! (-> self control trans y) + (lerp (-> self control unknown-vector37 y) (-> self control unknown-vector38 y) f28-0) + ) + ) + (quaternion-slerp! + (-> self control quat-for-control) + (the-as quaternion (-> self control unknown-vector39)) + (the-as quaternion (-> self control unknown-vector40)) + f30-0 + ) + ) + (rot->dir-targ! (-> self control)) + (if (>= (ja-aframe-num 0) 20.5) + (target-pilot-signal-ready) + ) + (suspend) + (let ((a1-8 (handle->process (-> self pilot vehicle)))) + (if a1-8 + (set! (-> self alt-cam-pos quad) (-> (the-as vehicle a1-8) rbody position quad)) + ) + ) + (ja :num! (seek!)) + ) + (go target-pilot-stance) + ) + :post target-no-move-post + ) + +(let ((v1-15 (copy *forward-jump-mods* 'loading-level))) + (set! (-> v1-15 fric) 0.0) + (set! (-> v1-15 nonlin-fric-dist) 0.0) + (set! (-> v1-15 turnv) 0.0) + (set! (-> v1-15 turnvv) 0.0) + (set! (-> v1-15 tiltv) 131072.0) + (set! (-> v1-15 tiltvf) 30.0) + (set! (-> v1-15 mult-hook) + (the-as + (function surface surface surface int none) + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (persist-with-delay *setting-control* 'rapid-tracking (seconds 0.05) 'rapid-tracking #f 0.0 0) + ) + ) + ) + ) + ) + (set! *pilot-get-off-mods* v1-15) + ) + +(defstate target-pilot-get-off (target) + :event target-standard-event-handler + :exit target-pilot-exit + :trans (behavior () + (let ((gp-0 (handle->process (-> self pilot vehicle)))) + (when (not (if (type? gp-0 vehicle) + gp-0 + ) + ) + (ja-channel-set! 0) + (go target-falling #f) + ) + ) + ) + :code (behavior ((arg0 handle)) + (local-vars (f30-0 float)) + (let ((v1-1 (-> self control root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self control backup-collide-with)) + ) + (logclear! (-> self focus-status) (focus-status pilot-riding)) + (set! (-> self control mod-surface) *pilot-get-off-mods*) + (rot->dir-targ! (-> self control)) + (send-event *camera* 'set-dist #f #f) + (set! (-> self neck flex-blend) 0.0) + (persist-with-delay *setting-control* 'mode-name (seconds 0.05) 'mode-name 'cam-decel 0.0 0) + (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'hi 0.0 0) + (persist-with-delay *setting-control* 'interp-time (seconds 0.1) 'interp-time 'lo 300.0 0) + (persist-with-delay + *setting-control* + 'immediate-string-min-max + (seconds 0.05) + 'immediate-string-min-max + #f + 0.0 + 0 + ) + 0.0 + (let ((gp-0 (cond + ((zero? (-> self pilot stance)) + (set! f30-0 7.2) + jakb-pilot-bike-get-off-ja + ) + (else + (set! f30-0 15.2) + jakb-pilot-car-get-off-ja + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! gp-0 :num! (seek! (ja-aframe f30-0 0) 2.0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe f30-0 0) 2.0)) + ) + (let ((v1-37 (camera-matrix)) + (gp-2 (new 'stack-no-clear 'matrix)) + ) + (set! (-> gp-2 rvec quad) (-> v1-37 rvec quad)) + (set! (-> gp-2 uvec quad) (-> v1-37 fvec quad)) + (set! (-> gp-2 uvec y) 0.0) + (vector-normalize! (-> gp-2 uvec) 1.0) + (vector-reset! (-> gp-2 fvec)) + (vector+float*! + (-> gp-2 fvec) + (-> gp-2 fvec) + (-> gp-2 rvec) + (* 16384.0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + ) + (vector+float*! + (-> gp-2 fvec) + (-> gp-2 fvec) + (-> gp-2 uvec) + (* 16384.0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) + ) + (vector+! (-> self control transv) (-> self control transv) (-> gp-2 fvec)) + ) + (let* ((f0-12 (vector-normalize-ret-len! (-> self control transv) 1.0)) + (f0-13 (fmin 122880.0 f0-12)) + ) + (vector-float*! (-> self control transv) (-> self control transv) f0-13) + ) + (go target-jump 10240.0 10240.0 *pilot-get-off-mods*) + ) + :post target-pilot-post + ) + +(defstate target-pilot-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (case (-> block param 0) + (('grab) + (go target-pilot-stance) + ) + (('gun) + (target-gun-end-mode #t) + ) + ) + ) + (('clone-anim) + (go target-pilot-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('vehicle-crash) + (go target-grab 'stance) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self control mod-surface) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self target-flags) (target-flags tf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags tf2)) + (logclear! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self water flags) (water-flag jump-out)) + ((-> target-pilot-start exit)) + ) + :code (behavior () + (until #f + (set-forward-vel 0.0) + (suspend) + ) + #f + ) + :post target-pilot-post + ) + +(defstate target-pilot-clone-anim (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ((-> target-pilot-grab event) proc argc message block) + ) + :enter (-> target-clone-anim enter) + :exit (behavior () + (set! (-> self control draw-offset y) (the-as float (-> self control unknown-word04))) + (set! (-> self control cspace-offset y) (-> self control draw-offset y)) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + ((-> target-clone-anim exit)) + ((-> target-pilot-start exit)) + (vector-reset! (-> self control transv)) + ) + :code (behavior ((arg0 handle)) + (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) + (set! (-> self control draw-offset y) 0.0) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (clone-anim arg0 #t "") + (go target-pilot-stance) + ) + :post (behavior () + (vector+! (-> self pilot pilot-trans) (-> self control trans) (-> self control cspace-offset)) + (quaternion-copy! (the-as quaternion (-> self pilot pilot-quat)) (-> self control quat)) + (set! (-> self pilot pilot-scale quad) (-> self control scale quad)) + (target-no-ja-move-post) + ) + ) + +(defstate target-pilot-edge-grab (target) + :event (-> target-edge-grab event) + :enter (behavior ((arg0 pilot-edge-grab-info)) + (set! (-> self control status) (collide-status)) + (let ((gp-0 *edge-grab-info*)) + (mem-copy! (the-as pointer (-> gp-0 pilot-edge-grab)) (the-as pointer arg0) 40) + (set! (-> gp-0 pilot-grab-interp) 0.0) + (set! (-> gp-0 pilot-start-grab-pos quad) (-> self control trans quad)) + (set! (-> gp-0 actor-handle) (-> arg0 handle)) + ((-> target-edge-grab enter)) + (let* ((s5-1 (handle->process (-> gp-0 actor-handle))) + (a0-9 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (set! (-> gp-0 pilot-edge-grab?) + (if (and a0-9 + (< 24576.0 (fabs (- (-> (get-trans (the-as process-focusable a0-9) 0) y) (-> self control trans y)))) + ) + 'target-double-jump + 'target-jump + ) + ) + ) + ) + ) + :exit (-> target-edge-grab exit) + :trans (-> target-edge-grab trans) + :code (-> target-edge-grab code) + :post target-no-move-post + ) + +(defstate target-pilot-hit (target) + :event target-generic-event-handler + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-death))) + (logclear! (-> self focus-status) (focus-status dead hit)) + ) + ((-> target-pilot-start exit)) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (local-vars (sv-16 attack-info)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! sv-16 (-> self attack-info)) + (let ((v1-4 sv-16)) + (set! (-> v1-4 attacker) (the-as handle #f)) + (set! (-> v1-4 mode) 'generic) + (set! (-> v1-4 shove-back) 6144.0) + (set! (-> v1-4 shove-up) 4915.2) + (set! (-> v1-4 angle) #f) + (set! (-> v1-4 trans quad) (-> self control trans quad)) + (set! (-> v1-4 control) 0.0) + (set! (-> v1-4 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + (set! (-> v1-4 damage) (-> *FACT-bank* health-default-inc)) + ) + (combine! sv-16 arg1 self) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-pilot-death (-> sv-16 mode)) + ) + :post target-no-stick-post + ) + +(defstate target-pilot-death (target) + :event (-> target-death event) + :exit (behavior () + ((-> target-pilot-start exit)) + ((-> target-death exit)) + ) + :code (behavior ((arg0 symbol)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control did-move-to-pole-or-max-jump-height) + (the-as float (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) + ) + (set! (-> self neck flex-blend) 0.0) + (target-timed-invulnerable-off self 0) + (let ((s5-0 (-> self child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'notice 'die) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + (set! (-> self death-resetter continue) #f) + (set! (-> self death-resetter node) (game-task-node none)) + (set! (-> self death-resetter reset-mode) 'life) + (set! (-> self death-resetter execute) #f) + (case arg0 + (('bot) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) + ) + (('endlessfall 'instant-death 'lava 'dark-eco-pool 'melt 'explode 'grenade 'drown-death) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + ) + (else + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (when (using-gun? self) + (send-event (ppointer->process (-> self gun gun)) 'notice 'die) + (target-gun-end-mode #f) + ) + ) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (apply-settings *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self focus-status) (focus-status dead)) + (case arg0 + (('melt 'grenade 'explode) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.2)) + (suspend) + ) + ) + (case arg0 + (('dark-eco-pool) + (sound-play "death-darkeco") + (cond + ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) + ) + ) + ) + (('grenade 'explode) + (sound-play "explosion") + (cond + ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 65)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 65)) + ) + ) + ) + (('lava 'melt) + (sound-play "death-melt") + (cond + ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) + ) + ) + ) + ) + (let ((v1-158 (-> self control root-prim))) + (set! (-> v1-158 prim-core collide-as) (collide-spec)) + (set! (-> v1-158 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (let ((s5-11 (current-time))) + (until (time-elapsed? s5-11 (seconds 1.8)) + (suspend) + ) + ) + ) + (('endlessfall) + (sound-play "death-fall") + (if (not (-> self pilot as-daxter?)) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) + ) + ) + (sound-params-set! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2 -1.0) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((f0-5 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-word04) (the-as uint f0-5)) + (let ((v1-179 (new-stack-vector0))) + (let ((f1-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-179 (-> self control transv) (vector-float*! v1-179 (-> self control dynam gravity-normal) f1-3)) + ) + (let* ((f1-4 (vector-length v1-179)) + (f2-1 f1-4) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-5) + (vector-float*! v1-179 v1-179 (/ f1-4 f2-1)) + ) + ) + ) + ) + (let ((s5-13 (current-time))) + (until (time-elapsed? s5-13 (seconds 0.5)) + (suspend) + ) + ) + ) + (('drown-death) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((f0-8 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-word04) (the-as uint f0-8)) + (let ((v1-190 (new-stack-vector0))) + (let ((f1-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-190 (-> self control transv) (vector-float*! v1-190 (-> self control dynam gravity-normal) f1-8)) + ) + (let* ((f1-9 (vector-length v1-190)) + (f2-3 f1-9) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-8) + (vector-float*! v1-190 v1-190 (/ f1-9 f2-3)) + ) + ) + ) + ) + (let ((s5-14 (current-time))) + (until (time-elapsed? s5-14 (seconds 2)) + (suspend) + ) + ) + ) + (('bot) + (set! (-> self trans-hook) #f) + (while (not (-> self control unknown-spool-anim00)) + (set-forward-vel 0.0) + (suspend) + ) + ) + (('big-explosion) + (let ((s5-15 (current-time))) + (until (time-elapsed? s5-15 (seconds 2)) + (suspend) + ) + ) + ) + (else + ) + ) + (target-death-reset arg0 #f) + ) + :post target-pilot-post + ) diff --git a/goal_src/jak3/engine/target/sidekick.gc b/goal_src/jak3/engine/target/sidekick.gc index 8347525aeb..2b4a6bb39f 100644 --- a/goal_src/jak3/engine/target/sidekick.gc +++ b/goal_src/jak3/engine/target/sidekick.gc @@ -542,9 +542,9 @@ ;; (effect-control-method-9 a0-84) ;; ) ;; ) - ;; (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) - ;; (merc-blend-shape self) - ;; ) + (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape self) + ) (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) (merc-eye-anim self) ) diff --git a/goal_src/jak3/engine/target/target-darkjak.gc b/goal_src/jak3/engine/target/target-darkjak.gc index 4ddd4aae8d..7e2797006b 100644 --- a/goal_src/jak3/engine/target/target-darkjak.gc +++ b/goal_src/jak3/engine/target/target-darkjak.gc @@ -418,7 +418,7 @@ (set! (-> this bolts) (new 'process 'boxed-array lightning-bolt 3)) (dotimes (s5-0 (-> this bolts length)) (set! (-> this bolts s5-0) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> this bolts s5-0) 2 16 *darkjak-ball-lightning*) + (init! (-> this bolts s5-0) 2 16 *darkjak-ball-lightning*) ) (set! (-> this fire-sound) (new-sound-id)) (let ((a0-13 (-> this root transv))) @@ -472,9 +472,11 @@ (let ((a3-0 (the-as darkjak-ball (-> arg1 key proc))) (v1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-1 quad) - (-> (the-as (pointer uint128) (+ (+ (* (-> arg1 user-float) 16) 556) (the-as int a3-0)))) - ) + ;; og:preserve-this + (vector-copy! v1-1 (-> a3-0 ball-pos (-> arg1 user-int32))) + ;; (set! (-> v1-1 quad) + ;; (-> (the-as (pointer uint128) (+ (+ (* (-> arg1 user-float) 16) 556) (the-as int a3-0)))) + ;; ) (set! (-> arg2 x) (-> v1-1 x)) (set! (-> arg2 y) (-> v1-1 y)) (set! (-> arg2 z) (-> v1-1 z)) @@ -2182,27 +2184,26 @@ :post target-no-stick-post ) -(format 0 "SKIP: target-darkjak removed lightning spec~%") -;; (set! (-> *lightning-spec-id-table* 11) (new 'static 'lightning-spec -;; :name "lightning-darkjak-bomb1" -;; :flags (lightning-spec-flags lsf0 lsf4) -;; :adjust-distance #xa -;; :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 #x3a :page #x4) -;; :reduction 0.42 -;; :num-points 80 -;; :box-size 32768.0 -;; :merge-factor 0.2 -;; :merge-count 2 -;; :radius 2048.0 -;; :duration 300.0 -;; :duration-rand 90.0 -;; :sound (static-sound-spec "transform-zap" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 11) (new 'static 'lightning-spec + :name "lightning-darkjak-bomb1" + :flags (lightning-spec-flags lsf0 lsf4) + :adjust-distance #xa + :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 #x3a :page #x4) + :reduction 0.42 + :num-points 80 + :box-size 32768.0 + :merge-factor 0.2 + :merge-count 2 + :radius 2048.0 + :duration 300.0 + :duration-rand 90.0 + :sound (static-sound-spec "transform-zap" :group 1) + ) + ) (defbehavior target-bomb1-fire-shot target ((arg0 (array handle)) (arg1 int) (arg2 int)) (local-vars (sv-128 target) (sv-144 int) (sv-160 vector) (sv-176 vector) (sv-192 vector)) diff --git a/goal_src/jak3/engine/target/target-death.gc b/goal_src/jak3/engine/target/target-death.gc index eda91bf58f..c1af68d886 100644 --- a/goal_src/jak3/engine/target/target-death.gc +++ b/goal_src/jak3/engine/target/target-death.gc @@ -1234,8 +1234,8 @@ (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num 0.0) (when (= (-> arg0 angle) 'air) (sound-play "smack-surface") - (do-effect (-> self skel effect) (the-as symbol "group-smack-surface") 0.0 6) - (do-effect (-> self skel effect) (the-as symbol "group-smack-surface-dizzy") 0.0 9) + (do-effect (-> self skel effect) "group-smack-surface" 0.0 6) + (do-effect (-> self skel effect) "group-smack-surface-dizzy" 0.0 9) ) ) ((= v1-0 'shove) diff --git a/goal_src/jak3/engine/target/target-h.gc b/goal_src/jak3/engine/target/target-h.gc index 0a8c30727d..89a4f9b783 100644 --- a/goal_src/jak3/engine/target/target-h.gc +++ b/goal_src/jak3/engine/target/target-h.gc @@ -106,7 +106,7 @@ (define-extern target-gun-end-mode (function symbol symbol :behavior target)) (define-extern target-powerup-effect (function symbol none :behavior target)) (define-extern target-gun-type-set! (function pickup-type none :behavior target)) -(define-extern vehicle-spawn (function process type traffic-object-spawn-params process-drawable)) +(define-extern vehicle-spawn (function vehicle-type traffic-object-spawn-params process-drawable)) (define-extern target-gun-init (function pickup-type none :behavior target)) (define-extern target-invisible-stop (function none :behavior target)) (define-extern target-gun-fire (function pickup-type none :behavior target)) @@ -189,6 +189,11 @@ (define-extern *flut-air-attack-mods* surface) (define-extern *flut-get-off-mods* surface) +;; target-pilot +(define-extern *pilot-mods* surface) +(define-extern *pilot-get-on-mods* surface) +(define-extern *pilot-get-off-mods* surface) + ;; +++lightjak-stage (defenum lightjak-stage :bitfield #t @@ -488,14 +493,14 @@ target-mech-stance (target-mech-start handle float symbol) target-mech-walk - target-pilot-clone-anim + (target-pilot-clone-anim handle) target-pilot-daxter-perch - target-pilot-death + (target-pilot-death symbol) (target-pilot-edge-grab pilot-edge-grab-info) - target-pilot-get-off + (target-pilot-get-off handle) target-pilot-get-on target-pilot-grab - target-pilot-hit + (target-pilot-hit symbol attack-info) target-pilot-impact target-pilot-stance (target-pilot-start handle symbol symbol) diff --git a/goal_src/jak3/engine/target/target-handler.gc b/goal_src/jak3/engine/target/target-handler.gc index e00ec824b6..dcae8bed95 100644 --- a/goal_src/jak3/engine/target/target-handler.gc +++ b/goal_src/jak3/engine/target/target-handler.gc @@ -502,7 +502,7 @@ ) ) (else - (do-effect (-> self skel effect) (the-as symbol "group-spin-hit") -1.0 49) + (do-effect (-> self skel effect) "group-spin-hit" -1.0 49) ) ) (play-effect-sound @@ -634,7 +634,7 @@ ) ) ) - (do-effect (-> self skel effect) (the-as symbol "group-uppercut-hit") -1.0 28) + (do-effect (-> self skel effect) "group-uppercut-hit" -1.0 28) (play-effect-sound (-> self skel effect) (the-as symbol "sound") @@ -646,8 +646,8 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) ) ((or (= v1-57 'flop) (= v1-57 'flop-down)) - (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 28) - (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 19) + (do-effect (-> self skel effect) "group-flop-hit" -1.0 28) + (do-effect (-> self skel effect) "group-flop-hit" -1.0 19) (play-effect-sound (-> self skel effect) (the-as symbol "sound") @@ -893,11 +893,11 @@ v0-0 ) (('do-effect) - (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) + (do-effect (-> self skel effect) (the-as string (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) (if (-> self sidekick) (do-effect (-> self sidekick 0 skel effect) - (the-as symbol (-> arg3 param 0)) + (the-as string (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1 ) @@ -1161,7 +1161,7 @@ ) (defbehavior target-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (at-0 int) (v1-317 object) (a2-5 symbol)) + (local-vars (at-0 int) (v1-317 object)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -1330,12 +1330,7 @@ (go target-board-start (process->handle (the-as process (-> arg3 param 1)))) ) ) - ((begin (set! a2-5 (= v1-63 'pilot)) (or a2-5 - (begin (set! a2-5 (= v1-63 'pilot-race)) a2-5) - (begin (set! a2-5 (= v1-63 'pilot-daxter)) a2-5) - (= v1-63 'pilot-race-daxter) - ) - ) + ((or (= v1-63 'pilot) (= v1-63 'pilot-race) (= v1-63 'pilot-daxter) (= v1-63 'pilot-race-daxter)) (let ((s5-1 (the-as object (-> arg3 param 1)))) (when (not (the-as uint s5-1)) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) @@ -1354,13 +1349,7 @@ (set! (-> s4-0 position quad) (-> self control trans quad)) (quaternion-copy! (-> s4-0 rotation) (-> self control quat)) (set! (-> s4-0 id) (the-as uint 0)) - (let ((v1-101 (vehicle-spawn - (the-as process (-> arg3 param 2)) - (the-as type s4-0) - (the-as traffic-object-spawn-params a2-5) - ) - ) - ) + (let ((v1-101 (vehicle-spawn (the-as vehicle-type (-> arg3 param 2)) s4-0))) (if v1-101 (set! s5-1 v1-101) ) @@ -1369,13 +1358,13 @@ ) (when s5-1 (let* ((v1-102 (-> arg3 param 0)) - (a2-6 (if (or (= v1-102 'pilot-daxter) (= v1-102 'pilot-race-daxter)) + (a2-8 (if (or (= v1-102 'pilot-daxter) (= v1-102 'pilot-race-daxter)) #t #f ) ) ) - (go target-pilot-start (process->handle s5-1) (the-as symbol (-> arg3 param 3)) a2-6) + (go target-pilot-start (process->handle s5-1) (the-as symbol (-> arg3 param 3)) a2-8) ) ) ) diff --git a/goal_src/jak3/engine/target/target-part.gc b/goal_src/jak3/engine/target/target-part.gc index b97255a22b..aef02d8168 100644 --- a/goal_src/jak3/engine/target/target-part.gc +++ b/goal_src/jak3/engine/target/target-part.gc @@ -856,7 +856,7 @@ (defun spt-birth-func-part-land-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object) (arg4 object)) (spt-birth-func-brightness-part-droppings-for arg0 arg1 arg2 arg3 arg4) - (birth-func-texture-group-2d arg0 arg1 (the-as sparticle-launchinfo arg2)) + (birth-func-texture-group-2d arg0 arg1 (the-as sparticle-launchinfo arg2) arg3 arg4) (none) ) @@ -1697,7 +1697,7 @@ (defun spt-birth-func-part-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) (spt-birth-func-brightness-part-droppings-for arg0 arg1 (the-as sprite-vec-data-2d arg2) arg3 arg4) - (birth-func-texture-group-2d arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) (none) ) @@ -1956,7 +1956,7 @@ arg3 arg4 ) - (birth-func-texture-group-2d arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) (none) ) @@ -2212,7 +2212,7 @@ arg3 arg4 ) - (birth-func-texture-group-2d arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) (none) ) @@ -2746,101 +2746,100 @@ (none) ) -(format 0 "SKIP: target-part remove lightning specs~%") -;; (set! (-> *lightning-spec-id-table* 1) (new 'static 'lightning-spec -;; :name "lightning-shock" -;; :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 #x3f :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 16384.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 2048.0 -;; :duration 30.0 -;; :sound (static-sound-spec "shock" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 1) (new 'static 'lightning-spec + :name "lightning-shock" + :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 #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) -;; (set! (-> *lightning-spec-id-table* 2) (new 'static 'lightning-spec -;; :name "lightning-shock-dim" -;; :flags (lightning-spec-flags lsf0) -;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) -;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) -;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) -;; :fade-start-factor 0.2 -;; :texture (new 'static 'texture-id :index #x3f :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 16384.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 2048.0 -;; :duration 30.0 -;; :sound (static-sound-spec "shock" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 2) (new 'static 'lightning-spec + :name "lightning-shock-dim" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) -;; (set! (-> *lightning-spec-id-table* 3) (new 'static 'lightning-spec -;; :name "lightning-shock-red" -;; :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 #x40 :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 16384.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 2048.0 -;; :duration 30.0 -;; :sound (static-sound-spec "shock" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 3) (new 'static 'lightning-spec + :name "lightning-shock-red" + :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 #x40 :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) -;; (set! (-> *lightning-spec-id-table* 4) (new 'static 'lightning-spec -;; :name "lightning-shock-green" -;; :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 #x3b :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 16384.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 2048.0 -;; :duration 30.0 -;; :sound (static-sound-spec "shock" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 4) (new 'static 'lightning-spec + :name "lightning-shock-green" + :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 #x3b :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) -;; (set! (-> *lightning-spec-id-table* 5) (new 'static 'lightning-spec -;; :name "lightning-dark" -;; :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 #x3a :page #x4) -;; :reduction 0.52 -;; :num-points 32 -;; :box-size 16384.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 1228.8 -;; :duration 30.0 -;; :sound (static-sound-spec "shock" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 5) (new 'static 'lightning-spec + :name "lightning-dark" + :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 #x3a :page #x4) + :reduction 0.52 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1228.8 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) (defpartgroup group-lightning-dark-shot-tip-hit-replace :id 70 @@ -3121,6 +3120,8 @@ 0 ) +;; ERROR: function was not converted to expressions. Cannot decompile. + (defun process-drawable2-shock-effect ((arg0 process-drawable) (arg1 process-drawable) (arg2 lightning-spec) @@ -3178,27 +3179,26 @@ (none) ) -(format 0 "SKIP: target-part remove lightning specs 2~%") -;; (set! (-> *lightning-spec-id-table* 6) (new 'static 'lightning-spec -;; :name "lightning-shock-skel" -;; :flags (lightning-spec-flags lsf0) -;; :rand-func #x2 -;; :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 -;; :fade-time 120.0 -;; :texture (new 'static 'texture-id :index #x3f :page #x4) -;; :reduction 0.5 -;; :num-points 32 -;; :box-size 6144.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 2048.0 -;; :duration 30.0 -;; :sound #f -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 6) (new 'static 'lightning-spec + :name "lightning-shock-skel" + :flags (lightning-spec-flags lsf0) + :rand-func #x2 + :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 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.5 + :num-points 32 + :box-size 6144.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound #f + ) + ) ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully @@ -3521,50 +3521,49 @@ ) ) -(format 0 "SKIP: target-part remove lightning specs 3~%") -;; (set! (-> *lightning-spec-id-table* 7) (new 'static 'lightning-spec -;; :name "lightning-darkjak-transform" -;; :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 #x3a :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 1638.4 -;; :duration 30.0 -;; :duration-rand 90.0 -;; :sound (static-sound-spec "transform-zap" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 7) (new 'static 'lightning-spec + :name "lightning-darkjak-transform" + :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 #x3a :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 90.0 + :sound (static-sound-spec "transform-zap" :group 1) + ) + ) -;; (set! (-> *lightning-spec-id-table* 8) (new 'static 'lightning-spec -;; :name "lightning-darkjak-pill" -;; :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 #x3a :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.5 -;; :merge-count 2 -;; :radius 1638.4 -;; :duration 30.0 -;; :duration-rand 90.0 -;; :sound (static-sound-spec "transform-zap" :group 1) -;; :delay 60.0 -;; :delay-rand 120.0 -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 8) (new 'static 'lightning-spec + :name "lightning-darkjak-pill" + :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 #x3a :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 90.0 + :sound (static-sound-spec "transform-zap" :group 1) + :delay 60.0 + :delay-rand 120.0 + ) + ) -(define *lightning-darkjak-pill* (the lightning-spec #f)) +(define *lightning-darkjak-pill* (-> *lightning-spec-id-table* 8)) (defpart 173 :init-specs ((:texture (hotdot level-default-sprite)) @@ -3867,47 +3866,46 @@ ) ) -(format 0 "SKIP: target-part remove lightning specs 4~%") -;; (set! (-> *lightning-spec-id-table* 9) (new 'static 'lightning-spec -;; :name "lightning-darkjak-local" -;; :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 #x3a :page #x4) -;; :reduction 0.42 -;; :num-points 16 -;; :box-size 8192.0 -;; :merge-factor 0.6 -;; :merge-count 2 -;; :radius 1638.4 -;; :duration 30.0 -;; :duration-rand 150.0 -;; :sound (static-sound-spec "transform-zap" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 9) (new 'static 'lightning-spec + :name "lightning-darkjak-local" + :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 #x3a :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 150.0 + :sound (static-sound-spec "transform-zap" :group 1) + ) + ) -;; (set! (-> *lightning-spec-id-table* 10) (new 'static 'lightning-spec -;; :name "lightning-darkjak-attack" -;; :flags (lightning-spec-flags lsf0 lsf4) -;; :adjust-distance #xa -;; :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 #x3a :page #x4) -;; :reduction 0.42 -;; :num-points 20 -;; :box-size 8192.0 -;; :merge-factor 0.6 -;; :merge-count 2 -;; :radius 1638.4 -;; :duration 30.0 -;; :duration-rand 150.0 -;; :sound (static-sound-spec "stretched-zap" :group 1) -;; ) -;; ) +(set! (-> *lightning-spec-id-table* 10) (new 'static 'lightning-spec + :name "lightning-darkjak-attack" + :flags (lightning-spec-flags lsf0 lsf4) + :adjust-distance #xa + :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 #x3a :page #x4) + :reduction 0.42 + :num-points 20 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 150.0 + :sound (static-sound-spec "stretched-zap" :group 1) + ) + ) (defpart 187 :init-specs ((:texture (glow level-default-sprite)) diff --git a/goal_src/jak3/engine/target/target-pilot.gc b/goal_src/jak3/engine/target/target-pilot.gc index 113c96039a..158e4f1744 100644 --- a/goal_src/jak3/engine/target/target-pilot.gc +++ b/goal_src/jak3/engine/target/target-pilot.gc @@ -5,5 +5,508 @@ ;; name in dgo: target-pilot ;; dgos: HGA, LPATK, RAILA, LFACCAR, CWI, WASALL, LFACTORY, COMBA +(deftype cquery-with-5vec (structure) + "target-pilot-post" + ((cquery collide-query :inline) + (vec vector 5 :inline) + ) + ) + +(define-extern h-warf type) + ;; DECOMP BEGINS +(define *pilot-mods* (new 'static 'surface :name 'empty :seek0 1.0 :seek90 1.0 :seek180 1.0 :fric 1.0)) + +;; WARN: disable def twice: 203. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior target-pilot-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'pilot + ) + (else + (case arg2 + (('end-mode) + (case (-> arg3 param 0) + (('pilot) + (let ((v1-5 (-> self pilot))) + (when (nonzero? v1-5) + (let ((a0-7 (handle->process (-> v1-5 vehicle)))) + (if a0-7 + (put-rider-in-seat (the-as vehicle a0-7) (-> v1-5 seat-index) (the-as process #f)) + ) + ) + ) + ) + (go target-pilot-get-off (process->handle arg0)) + ) + (('fldax) + (when (and (-> self next-state) (= (-> self next-state name) 'target-pilot-daxter-perch)) + (let ((v0-0 (the-as object #t))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + ) + (('gun) + (target-gun-end-mode #t) + ) + ) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-pilot-grab) + ) + ) + ) + (('flut) + (go + target-flut-start + (process->handle (the-as process (-> arg3 param 1))) + (the-as symbol (if (>= arg1 2) + (-> arg3 param 2) + 'normal + ) + ) + (if (>= arg1 4) + (the-as int (-> arg3 param 3)) + -1 + ) + ) + ) + (('normal) + (go target-pilot-get-off (process->handle arg0)) + ) + (('gun) + (when (logtest? (-> self game features) (game-feature gun)) + (let ((gp-1 (-> arg3 param 2))) + (cond + ((using-gun? self) + (when (nonzero? gp-1) + (set! (-> self gun using-gun-type) (the-as pickup-type gp-1)) + gp-1 + ) + ) + (else + (target-gun-init (the-as pickup-type gp-1)) + ) + ) + ) + ) + ) + (('fldax) + (if (and (-> self next-state) (let ((v1-33 (-> self next-state name))) + (or (= v1-33 'target-pilot-stance) (= v1-33 'target-pilot-impact)) + ) + ) + (go target-pilot-daxter-perch) + ) + ) + ) + ) + (('swim) + #f + ) + (('clone-anim) + (go target-pilot-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('get-vehicle) + (if (nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) + ) + ) + (('kill-vehicle) + (if (nonzero? (-> self pilot)) + (send-event (handle->process (-> self pilot vehicle)) 'go-die) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (set-vector! (-> self draw color-mult) 0.25 0.25 0.25 1.0) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-pilot-hit + ) + ) + (('vehicle-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type race-daxter-hit) + (speech-type race-jak-hit) + ) + ) + ) + (('vehicle-got-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type race-daxter-got-hit) + (speech-type race-jak-got-hit) + ) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +(defbehavior target-pilot-pidax-enter target () + (set! (-> self pilot art-group-backup) (-> self draw art-group)) + (set! (-> self draw art-group) (-> self sidekick 0 draw art-group)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds2)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'indax) + ) + +(defbehavior target-pilot-pidax-exit target () + (ja-channel-set! 0) + (set! (-> self draw art-group) (-> self pilot art-group-backup)) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior target-pilot-exit target () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-pilot-stance) + (= v1-3 'target-pilot-impact) + (= v1-3 'target-pilot-daxter-perch) + (= v1-3 'target-pilot-get-off) + (= v1-3 'target-pilot-grab) + (= v1-3 'target-pilot-clone-anim) + (= v1-3 'target-pilot-hit) + (= v1-3 'target-pilot-death) + ) + ) + ) + ) + (let ((v1-4 (-> self manipy))) + (when v1-4 + (deactivate (-> v1-4 0)) + (set! (-> self manipy) (the-as (pointer manipy) #f)) + ) + ) + (process-drawable-set-riding self #f) + (when (-> self pilot as-daxter?) + (format 0 "Pidax exit~%") + (target-pilot-pidax-exit) + ) + (let ((gp-0 (-> self pilot))) + (when (nonzero? gp-0) + (set! (-> self control nav-radius) (-> gp-0 backup-nav-radius)) + (let ((s5-0 (handle->process (-> gp-0 vehicle)))) + (when s5-0 + (send-event *traffic-manager* 'player-exit-vehicle (-> (the-as vehicle s5-0) info object-type)) + (remove-riders (the-as vehicle s5-0) (the-as handle self)) + (send-event s5-0 'player-get-off) + (when (nonzero? (-> gp-0 hud-health)) + (send-event (handle->process (-> gp-0 hud-health)) 'hide-and-die) + (set! (-> gp-0 hud-health) (new 'static 'handle)) + 0 + ) + (when (nonzero? (-> gp-0 hud-turbo)) + (send-event (handle->process (-> gp-0 hud-turbo)) 'hide-and-die) + (set! (-> gp-0 hud-turbo) (new 'static 'handle)) + 0 + ) + ) + ) + ) + ) + (set! (-> self neck flex-blend) 1.0) + (let ((v1-49 (-> self control root-prim))) + (set! (-> v1-49 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-49 prim-core collide-with) (-> self control backup-collide-with)) + ) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self target-flags) (target-flags tf6)) + (remove-setting! 'cloth) + (remove-setting! 'armor) + (enable-set! (-> self arm-ik 0) #f) + (enable-set! (-> self arm-ik 1) #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (let ((v1-74 (-> self node-list data))) + (set! (-> v1-74 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-74 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-74 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (vector-identity! (-> self draw color-mult)) + (set! (-> self control cspace-offset quad) (the-as uint128 0)) + (logior! (-> self water flags) (water-flag find-water)) + (target-exit) + ) + ) + +;; WARN: Return type mismatch water-flag vs object. +(defbehavior target-pilot-init target ((arg0 handle) (arg1 symbol)) + (target-exit) + (target-lightjak-end-mode #f) + (target-darkjak-end-mode #f) + (if (zero? (-> self pilot)) + (set! (-> self pilot) (new 'process 'pilot-info)) + ) + (let ((s5-0 (-> self pilot))) + (set! (-> s5-0 backup-nav-radius) (-> self control nav-radius)) + (set! (-> s5-0 gun?) #t) + (set! (-> s5-0 enable-cam-side-shift) #f) + (set! (-> s5-0 as-daxter?) arg1) + (set! (-> s5-0 entity) #f) + (set! (-> s5-0 cam-side-shift) 0.0) + (if (-> self pilot as-daxter?) + (target-pilot-pidax-enter) + ) + (cond + ((handle->process arg0) + (set! (-> s5-0 vehicle) arg0) + ) + (else + (break!) + 0 + ) + ) + (let ((s4-1 (handle->process (-> s5-0 vehicle)))) + (when s4-1 + (send-event *traffic-manager* 'player-enter-vehicle (-> (the-as vehicle s4-1) info object-type)) + (set! (-> self game current-vehicle) (the-as game-vehicle-u8 (-> (the-as vehicle s4-1) info vehicle-type))) + (set! (-> s5-0 entity) (-> (the-as vehicle s4-1) entity)) + (set! (-> s5-0 gun?) (logtest? (-> (the-as vehicle s4-1) info flags) 32)) + (set! (-> s5-0 enable-cam-side-shift) (logtest? (-> (the-as vehicle s4-1) info flags) 128)) + (if (logtest? (-> (the-as vehicle s4-1) info flags) 256) + (set! (-> s5-0 hud-health) (process->handle (hud-vehicle-health-spawn (the-as vehicle s4-1)))) + ) + (if (logtest? (-> (the-as vehicle s4-1) info flags) 512) + (set! (-> s5-0 hud-turbo) (process->handle (hud-vehicle-turbo-spawn (the-as vehicle s4-1)))) + ) + (set! (-> s5-0 left-right-bias) (-> (the-as vehicle s4-1) info handling player-turn-anim-bias)) + (set! (-> s5-0 left-right-min) (-> (the-as vehicle s4-1) info handling player-turn-anim-min)) + (set! (-> s5-0 left-right-max) (-> (the-as vehicle s4-1) info handling player-turn-anim-max)) + (send-event + (ppointer->process (-> (the-as vehicle s4-1) parent)) + 'player-got-on-vehicle-child + (the-as vehicle s4-1) + ) + (set! (-> s5-0 stance) (the-as uint (vehicle-method-70 (the-as vehicle s4-1)))) + (let ((s3-0 (vehicle-method-65 (the-as vehicle s4-1)))) + (dotimes (s2-0 s3-0) + (let ((a0-35 (get-rider-in-seat (the-as vehicle s4-1) s2-0))) + (if (and a0-35 (send-event a0-35 'knocked-off)) + (put-rider-in-seat (the-as vehicle s4-1) s2-0 (the-as process #f)) + ) + ) + ) + ) + (let ((v1-68 (get-best-seat (the-as vehicle s4-1) (-> self control trans) (vehicle-seat-flag vsf0) 1))) + (set! (-> s5-0 seat-index) (max 0 v1-68)) + ) + (cond + ((-> s5-0 as-daxter?) + (set! (-> s5-0 left-right-accel-factor) 0.0000012207031) + (set! (-> s5-0 front-back-accel-factor) 0.0000012207031) + (set! (-> s5-0 up-down-accel-factor) 0.00000061035155) + ) + ((zero? (-> s5-0 stance)) + (set! (-> s5-0 left-right-accel-factor) 0.0000012207031) + (set! (-> s5-0 front-back-accel-factor) 0.0000012207031) + (set! (-> s5-0 up-down-accel-factor) 0.00000051879886) + ) + (else + (set! (-> s5-0 left-right-accel-factor) 0.0000012207031) + (set! (-> s5-0 front-back-accel-factor) 0.0000012207031) + (set! (-> s5-0 up-down-accel-factor) 0.00000061035155) + ) + ) + (set! (-> s5-0 left-right-accel-factor) + (* (-> s5-0 left-right-accel-factor) (-> (the-as vehicle s4-1) info handling pilot-x-accel-factor)) + ) + (set! (-> s5-0 up-down-accel-factor) + (* (-> s5-0 up-down-accel-factor) (-> (the-as vehicle s4-1) info handling pilot-y-accel-factor)) + ) + (set! (-> s5-0 front-back-accel-factor) + (* (-> s5-0 front-back-accel-factor) (-> (the-as vehicle s4-1) info handling pilot-z-accel-factor)) + ) + ) + ) + (when (not (-> s5-0 gun?)) + (if arg1 + (logior! (-> self control current-surface flags) (surface-flag gun-fast-exit)) + ) + (target-gun-end-mode arg1) + ) + ) + (set! (-> self board latch?) #f) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control ctrl-xz-vel) 0.0) + (logior! (-> self focus-status) (focus-status pilot)) + (set! (-> self control bend-target) 0.0) + (let ((v1-102 (-> self node-list data))) + (set! (-> v1-102 0 param0) (the-as (function cspace transformq none) cspace<-transformq+world-trans!)) + (set! (-> v1-102 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-102 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (let ((v1-104 (-> self control root-prim))) + (set! (-> v1-104 prim-core collide-as) (collide-spec)) + (set! (-> v1-104 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self control root-prim prim-core collide-as) (collide-spec jak-vehicle)) + (set! (-> self control root-prim prim-core collide-with) + (collide-spec hit-by-player-list hit-by-others-list player-list collectable) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control status) (collide-status)) + (let ((v0-16 (logclear (-> self water flags) (water-flag active find-water)))) + (set! (-> self water flags) v0-16) + v0-16 + ) + ) + +(defbehavior pilot-on-ground? target () + (logtest? (-> self control status) (collide-status on-surface)) + ) + +(defbehavior target-pilot-post target () + (local-vars (a0-45 int) (a0-47 int)) + (let* ((v1-1 (-> *perf-stats* data 17)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (vector-! + (-> self control cspace-offset) + (-> self control draw-offset) + (-> self control anim-collide-offset-world) + ) + (let ((a1-5 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-5 options) (overlaps-others-options oo0)) + (set! (-> a1-5 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-5 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-5) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (let* ((gp-2 (-> self pilot)) + (s5-0 (handle->process (-> gp-2 vehicle))) + ) + (when s5-0 + (vehicle-method-66 (the-as vehicle s5-0) (-> self control trans) (-> gp-2 seat-index)) + (set! (-> self control transv quad) (-> (the-as vehicle s5-0) root transv quad)) + (quaternion-copy! (-> self control quat) (-> (the-as vehicle s5-0) root quat)) + (quaternion-copy! (-> self control quat-for-control) (-> self control quat)) + (quaternion-copy! (-> self control dir-targ) (-> self control quat)) + (let ((s4-0 (-> self alt-cam-pos))) + (when (not (focus-test? self dead)) + (let ((s3-0 (new 'stack-no-clear 'cquery-with-5vec))) + (set! (-> s3-0 vec 2 x) 0.0) + (set! (-> s3-0 vec 2 y) 20480.0) + (let ((a0-18 (-> self node-list data 0 bone transform))) + (set! (-> s3-0 vec 1 quad) (-> a0-18 fvec quad)) + ) + (set! (-> s3-0 vec 1 y) 0.0) + (vector-rotate90-around-y! (-> s3-0 vec 1) (-> s3-0 vec 1)) + (vector-normalize! (-> s3-0 vec 1) 1.0) + (set! (-> s3-0 vec 0 quad) (-> self control trans quad)) + (when (-> gp-2 enable-cam-side-shift) + (dotimes (s2-0 2) + (let ((v1-48 (-> s3-0 cquery))) + (set! (-> v1-48 radius) 2048.0) + (set! (-> v1-48 collide-with) (collide-spec backgnd)) + (set! (-> v1-48 ignore-process0) #f) + (set! (-> v1-48 ignore-process1) #f) + (set! (-> v1-48 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-48 action-mask) (collide-action solid)) + ) + (set! (-> s3-0 cquery start-pos quad) (-> s3-0 vec 0 quad)) + (vector-float*! (-> s3-0 cquery move-dist) (-> s3-0 vec 1) (-> s3-0 vec 2 y)) + (let ((f0-10 (fill-and-probe-using-line-sphere *collide-cache* (-> s3-0 cquery)))) + (when (and (>= f0-10 0.0) (= (-> s3-0 cquery best-other-tri pat mode) (pat-mode wall))) + (+! (-> s3-0 vec 2 x) (* -1.0 (-> s3-0 vec 2 y) (- 1.0 f0-10))) + 0 + ) + ) + (set! (-> s3-0 vec 2 y) (* -1.0 (-> s3-0 vec 2 y))) + ) + (set! (-> s3-0 vec 2 x) + (* (-> s3-0 vec 2 x) (fmax 0.25 (fmin 1.0 (* 0.000008138021 (vector-length (-> self control transv)))))) + ) + (seek! (-> gp-2 cam-side-shift) (-> s3-0 vec 2 x) (* 16384.0 (seconds-per-frame))) + ) + (set! (-> s4-0 x) (+ (-> s3-0 vec 0 x) (* (-> gp-2 cam-side-shift) (-> s3-0 vec 1 x)))) + (set! (-> s4-0 z) (+ (-> s3-0 vec 0 z) (* (-> gp-2 cam-side-shift) (-> s3-0 vec 1 z)))) + (if (type? s5-0 h-warf) + (set! (-> s4-0 y) (-> s3-0 vec 0 y)) + (set! (-> s4-0 y) (fmax (fmin (-> s4-0 y) (+ 2048.0 (-> s3-0 vec 0 y))) (+ -2048.0 (-> s3-0 vec 0 y)))) + ) + ) + 0 + ) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix))) + (vehicle-method-113 (the-as vehicle s5-0) (-> s4-1 rvec) (-> gp-2 seat-index) 0) + (vehicle-method-113 (the-as vehicle s5-0) (-> s4-1 uvec) (-> gp-2 seat-index) 1) + (enable-set! (-> self arm-ik 0) #t) + (enable-set! (-> self arm-ik 1) #t) + (set-ik-target! (-> self arm-ik 0) (-> s4-1 rvec)) + (set-ik-target! (-> self arm-ik 1) (-> s4-1 uvec)) + ) + ) + ) + (ja-post) + (joint-points) + (update-transforms (-> self control)) + (do-target-gspot) + (target-powerup-process) + (let ((v1-95 (-> *perf-stats* data 17))) + (b! (zero? (-> v1-95 ctrl)) cfg-31 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-45 pcr0) + (+! (-> v1-95 accum0) a0-45) + (.mfpc a0-47 pcr1) + (+! (-> v1-95 accum1) a0-47) + ) + (label cfg-31) + 0 + 0 + (none) + ) diff --git a/goal_src/jak3/engine/target/target.gc b/goal_src/jak3/engine/target/target.gc index 61298261e5..ab3109f92c 100644 --- a/goal_src/jak3/engine/target/target.gc +++ b/goal_src/jak3/engine/target/target.gc @@ -2354,7 +2354,7 @@ ) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 49) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 49) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -2654,7 +2654,7 @@ ) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 28) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -3075,7 +3075,7 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 43) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 43) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -3387,7 +3387,7 @@ ) (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 28) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) (if (and (= (-> self control danger-mode) 'uppercut) @@ -3591,7 +3591,7 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (if (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-strike-ground") (ja-frame-num 0) 0) + (do-effect (-> self skel effect) "group-red-eco-strike-ground" (ja-frame-num 0) 0) ) (let ((v1-56 (process-spawn @@ -3621,15 +3621,11 @@ ) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect - (-> self skel effect) - (the-as symbol "group-red-eco-spinkick") - (ja-frame-num 0) - (if (rand-vu-percent? 0.5) - 28 - 19 - ) - ) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) (when (and (not (-> self control danger-mode)) @@ -3825,15 +3821,11 @@ (when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) - (do-effect - (-> self skel effect) - (the-as symbol "group-red-eco-spinkick") - (ja-frame-num 0) - (if (rand-vu-percent? 0.5) - 28 - 19 - ) - ) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) (let ((v1-37 (ja-group))) diff --git a/goal_src/jak3/engine/ui/bigmap-h.gc b/goal_src/jak3/engine/ui/bigmap-h.gc index cd1c7001bf..b220a59ff5 100644 --- a/goal_src/jak3/engine/ui/bigmap-h.gc +++ b/goal_src/jak3/engine/ui/bigmap-h.gc @@ -38,7 +38,7 @@ (tpage external-art-buffer) (tpage2 basic) (progress-minimap texture-page) - (progress-minimap2 basic) + (progress-minimap2 texture-page) (load-index uint32) (x0 int32) (y0 int32) @@ -62,7 +62,7 @@ (new (symbol type) _type_) (bigmap-method-9 () none) (update (_type_) none) - (draw (_type_ int int int int) int) + (bigmap-method-11 (_type_) symbol) (bigmap-method-12 () none) (bigmap-method-13 () none) (enable-drawing (_type_) none) diff --git a/goal_src/jak3/engine/ui/hud.gc b/goal_src/jak3/engine/ui/hud.gc index 92057b4aa4..8c5916f58a 100644 --- a/goal_src/jak3/engine/ui/hud.gc +++ b/goal_src/jak3/engine/ui/hud.gc @@ -160,7 +160,8 @@ (test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1)) ) - (set! (-> v1-0 scanline) (mod (+ (-> v1-0 scanline) 6) (the-as uint t2-0))) + ;; og:preserve-this divide by zero guard + (set! (-> v1-0 scanline) (mod-0-guard (+ (-> v1-0 scanline) 6) (the-as uint t2-0))) (let ((t3-6 (the-as (inline-array vector4w) (-> arg0 base)))) (set! (-> t3-6 0 quad) (-> v1-0 scan-tmpl dma-vif quad)) (set! (-> t3-6 1 quad) (-> v1-0 scan-tmpl quad 1)) @@ -169,8 +170,9 @@ (let ((a0-2 (+ (the int (-> this box min y)) 1840))) (dotimes (t3-9 32) (let ((t4-8 (the-as object (-> arg0 base))) - (t5-13 (* (+ a0-2 (mod (+ (-> v1-0 scanline) (* t3-9 2)) (the-as uint t2-0))) 16)) - (t6-6 (* (+ a0-2 (mod (the-as uint (+ (* t3-9 2) 1 (-> v1-0 scanline))) (the-as uint t2-0))) 16)) + ;; og:preserve-this divide by zero guard + (t5-13 (* (+ a0-2 (mod-0-guard (+ (-> v1-0 scanline) (* t3-9 2)) (the-as uint t2-0))) 16)) + (t6-6 (* (+ a0-2 (mod-0-guard (the-as uint (+ (* t3-9 2) 1 (-> v1-0 scanline))) (the-as uint t2-0))) 16)) ) (set! (-> (the-as (pointer uint128) t4-8)) (-> v1-0 scan-colors t3-9 quad)) (let ((t7-4 (the-as (inline-array vector4w) (-> (the-as (inline-array vector4w) t4-8) 1)))) diff --git a/goal_src/jak3/engine/ui/minimap-h.gc b/goal_src/jak3/engine/ui/minimap-h.gc index 9e3de384c4..9762975aef 100644 --- a/goal_src/jak3/engine/ui/minimap-h.gc +++ b/goal_src/jak3/engine/ui/minimap-h.gc @@ -213,17 +213,20 @@ (palace-ruins 176) ) +(declare-type minimap-class-node structure) +(define-extern *minimap-class-list* (inline-array minimap-class-node)) + ;; DECOMP BEGINS (deftype minimap-table-entry (structure) ((corner vector :inline) - (level-name basic) - (tex-name basic) + (level-name symbol) + (tex-name string) (meters-per-texel float) (pos-scale float) (min-inv-scale float) (max-inv-scale float) - (switch-immediate basic) + (switch-immediate symbol) ) ) @@ -231,14 +234,14 @@ (deftype minimap-class-node (structure) ((default-position vector :inline) (flags minimap-flag) - (name basic) + (name string) (icon-xy vector2ub :inline) (class minimap-class) (scale float) (color rgba) ) (:methods - (minimap-class-node-method-9 () none) + (minimap-class-node-method-9 (_type_) symbol) ) ) @@ -277,7 +280,7 @@ ) (:methods (get-distance-with-path (_type_ vector vector) float) - (minimap-trail-method-10 () none) + (reset (_type_) none) ) ) @@ -329,24 +332,24 @@ (frustum-alpha float) ) (:methods - (minimap-method-9 () none) + (debug-draw (_type_) none) (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) - (minimap-method-11 () none) + (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol) (add-icon! (_type_ process uint int vector int) connection-minimap) - (minimap-method-13 () none) - (minimap-method-14 () none) + (free-trail-by-connection (_type_ connection-minimap) none) + (update-trails (_type_) none) (draw-1 (_type_ dma-buffer vector4w symbol) none) - (minimap-method-16 () none) - (minimap-method-17 () none) - (minimap-method-18 () none) - (minimap-method-19 () none) + (draw-connection (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none) + (sub-draw-1-2 (_type_ minimap-draw-work) none) (update! (_type_) symbol) - (minimap-method-21 () none) - (minimap-method-22 () none) - (minimap-method-23 () none) + (sub-draw-1-1 (_type_ minimap-draw-work) none) + (set-color (_type_ vector) none) + (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none) (draw-sprite2 (_type_ dma-buffer vector4w symbol) none) (set-race-texture (_type_ texture float level) none) - (minimap-method-26 () none) + (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none) (set-race-corner (_type_ float float) none) ) ) diff --git a/goal_src/jak3/engine/ui/minimap.gc b/goal_src/jak3/engine/ui/minimap.gc index eae3f77a1a..268d7a4376 100644 --- a/goal_src/jak3/engine/ui/minimap.gc +++ b/goal_src/jak3/engine/ui/minimap.gc @@ -7,3 +7,3903 @@ ;; DECOMP BEGINS +(deftype minimap-texture-name-array (structure) + ((data string 35) + ) + ) + + +(deftype minimap-corner-array (structure) + ((data vector 35 :inline) + ) + ) + + +(define *minimap-texture-name-array* + (new 'static 'minimap-texture-name-array :data (new 'static 'array string 35 + #f + #f + "map-stadium" + "map-ctyslumc" + #f + #f + "map-ctygena" + "map-ctygenb" + "map-ctyslumb" + #f + #f + "map-ctyfarma" + "map-ctygenc" + #f + "map-ctysluma" + #f + "map-ctymarka" + "map-ctypala" + "map-ctymarkb" + "map-ctyindb" + #f + "map-ctyfarmb" + "map-ctypalb" + #f + "map-ctyinda" + #f + "map-ctyporta" + "map-ctyportb" + "map-ctyportc" + #f + #f + "map-ctyportd" + "map-ctyporte" + "map-ctyportf" + #f + ) + ) + ) + +(define *minimap-corner-array* + (new 'static 'minimap-corner-array :data (new 'static 'inline-array vector 35 + (new 'static 'vector :x -4456448.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 4980736.0 :w 1.0) + ) + ) + ) + +(define *minimap* (new 'static 'minimap + :draw-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x908a400000008001 #x535353531) + ) + :draw2-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x900a400000008001 #x525252521) + ) + :draw3-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x90aa400000008001 #x535353531) + ) + :draw4-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x902a400000008001 #x525252521) + ) + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x53531) + ) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) + ) + :color (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :offset (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :last-name #f + :last-tex #f + :engine #f + :engine-key #x800 + :race-tex #f + :race-scale 16384.0 + :race-level #f + :sprite2-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x502b400000008001 #x52521) + ) + :frustum-alpha 1.0 + ) + ) + +(kmemopen global "minimap-engines") + +(define *minimap-class-list* (new 'static 'inline-array minimap-class-node 177 + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap) + :name "none" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3190784.0 :y 32768.0 :z 765952.0 :w 1.0) + :flags (minimap-flag trail bigmap) + :name "onintent" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4505600.0 :z 4505600.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "vinroom" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x5)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4197499.0 :y -34734.08 :z 4187750.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "sewer-kg" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 775413.75 :y 32727.04 :z -1279795.2 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "sewer-genb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3148021.8 :y 8847.36 :z -1200209.9 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "sewer-slumb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "hiphog" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1465712.6 :y 36085.76 :z 5251563.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "gungame" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1843200.0 :y 34816.0 :z 5275648.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "gun-yellow" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x2)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9143050.0 :y 89169.92 :z 9106391.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-nest-entrance" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "guard" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "parking-spot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap goal) + :name "goal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "goal-no-trail" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "goal-no-trail-bigmap" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3906355.2 :y 100352.0 :z 3732922.2 :w 1.0) + :flags (minimap-flag trail bigmap goal ctywide) + :name "cty-sniper-vicinity" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x4c :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -2105467.0 :y 118906.88 :z 3788431.2 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "forest" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6583542.0 :y 262021.12 :z -1945067.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wascity-gungame" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1523712.0 :z 7372800.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only ctywide) + :name "city-transport" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 839680.0 :z 3756032.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wascity-leaper-race" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6039716.0 :y 109895.68 :z -1498153.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wascity-pre-game" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 10678272.0 :z 524288.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-transport" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 86016.0 :z 7151616.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "waspal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1458176.0 :z -1499136.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "stadium" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2895872.0 :z -1855488.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wasteland-arena" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag frustum) + :name "guard-frustum" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9286615.0 :y 125091.84 :z 653434.9 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1843200.0 :y 34816.0 :z 5275648.0 :w 1.0) + :flags (minimap-flag trail bigmap) + :name "gun-dark" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x2)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3137536.0 :y 34324.48 :z -2962923.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport desert) + :name "spargus-city" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag racer) + :name "racer" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag racer) + :name "racer-target" + :scale 1.0 + :color (new 'static 'rgba :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag racer) + :name "racer-errol" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 166871.05 :y 49192.96 :z -2900009.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "monk-temple" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 15650816.0 :y 149913.6 :z 2943385.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3550003.2 :y 321126.4 :z 5485773.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 5525913.5 :y 369049.6 :z 3343564.8 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desa" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12869222.0 :y 158105.6 :z 10319053.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12833587.0 :y 79052.8 :z 14444954.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desh" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6352077.0 :y 331366.4 :z 7294976.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2684108.8 :y 63488.0 :z 10600858.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11691622.0 :y 116326.4 :z 674611.2 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6981632.0 :y 56115.2 :z 378470.4 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desa-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 832307.2 :y 185958.4 :z 6533529.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12394496.0 :y 206438.4 :z 12609126.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 8704819.0 :y 148684.8 :z 5840896.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11052646.0 :y 106086.4 :z 11750605.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 876134.4 :y 251494.4 :z 12136038.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 556646.4 :y 184320.0 :z 15724134.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16105472.0 :y 54886.4 :z 5789696.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 15939994.0 :y 135168.0 :z 1683456.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9377382.0 :y 93798.4 :z 92160.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9970483.0 :y 93388.8 :z 104448.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 10326016.0 :y 131481.6 :z -862208.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9631334.0 :y 88473.6 :z -1377075.2 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 7608729.5 :y 109772.8 :z -1456128.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 7272038.5 :y 371507.2 :z -410828.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 5833523.0 :y 110592.0 :z -1670758.4 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6916915.0 :y 389939.2 :z -420659.2 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12718080.0 :y 141312.0 :z 10554573.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6378701.0 :y 364134.4 :z -371507.2 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6380749.0 :y 156876.8 :z -1238630.4 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-6" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2466611.2 :y 372326.4 :z 2169241.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desa-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 8616755.0 :y 108953.6 :z -924876.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11712922.0 :y 240435.2 :z 3998105.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 10091315.0 :y 263782.4 :z 3800678.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4193894.5 :y 33177.6 :z 858521.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-sluma-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 792576.0 :y 33177.6 :z -570982.4 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1705984.0 :y 8192.0 :z -1542963.2 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2126643.2 :y 8192.0 :z -919552.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4290560.0 :y 411238.4 :z 7154483.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3999744.0 :y 45465.6 :z 4032512.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2407219.2 :y 394035.2 :z 9599795.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6369689.5 :y 128204.8 :z 7754137.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11148493.0 :y 130662.4 :z 1211596.8 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9161114.0 :y 140492.8 :z 355532.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-6" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6171853.0 :y 226508.8 :z -1021132.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-7" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4068556.8 :y 45465.6 :z 2008678.4 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-indb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4970496.0 :y 108953.6 :z 13683098.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desf" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 86016.0 :y 44236.8 :z 7160217.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1570406.4 :y 45875.2 :z -1356185.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1308672.0 :y 45056.0 :z -833536.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 505036.8 :y 45465.6 :z -144588.8 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1736294.4 :y 20480.0 :z -799129.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2141388.8 :y 7782.4 :z -1939865.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumc-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2992128.0 :y 315801.6 :z 13929677.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2893824.0 :y 188006.4 :z 14871757.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-post-game" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2445721.5 :y 20070.4 :z -2903654.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumc-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4145152.0 :y 45056.0 :z 1143193.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-sluma-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3572121.5 :y 45056.0 :z 1372160.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-sluma-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3889152.0 :y 45056.0 :z 1889075.2 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-indb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4385997.0 :y 45056.0 :z 2440396.8 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-indb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3716710.5 :y 45056.0 :z 3579494.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4198809.5 :y 45056.0 :z 4518297.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4687462.5 :y 45056.0 :z 4294246.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3675750.5 :y 32768.0 :z 4731289.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2622750.8 :y 43950.08 :z 6559170.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1377894.4 :y 45056.0 :z 7051264.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -1053491.2 :y 45056.0 :z 6554419.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-6" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -27852.8 :y 43827.2 :z 5318656.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-7" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1216512.0 :y 45056.0 :z 5433344.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-8" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9130394.0 :y 122060.8 :z 3092480.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1542847.2 :y 196168.9 :z -4314233.0 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "atoll-valve" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2277804.5 :y 217672.9 :z -4571725.5 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "atoll-ashelin" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -3100565.5 :y 547275.56 :z 1190112.5 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "mountain-lens" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -2833539.0 :y 496445.44 :z 11345.101 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "mountain-shard" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -3448408.5 :y 567047.8 :z 1029759.4 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "mountain-gear" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4357507.5 :y 205120.72 :z -2286701.2 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "ruins-hut" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -2575550.8 :y 156067.02 :z 3728844.8 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "forest-samos" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "metalhead" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9633792.0 :y 32768.0 :z -1470464.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "kleever-arena" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9181552.0 :y 28517.172 :z -227204.7 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "seem-wascitya" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6039716.0 :y 109895.68 :z -1498153.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "seem-wascityb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9279857.0 :y 126115.84 :z 725073.94 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "kleever-wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9344532.0 :y 126484.48 :z 712171.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "damus-wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 8197611.5 :y 1009336.3 :z -1705738.2 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "damus-waspal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9527296.0 :y 225280.0 :z -1642496.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "damus-arena" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6533816.5 :y 86671.36 :z -1681449.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "kleever-wascityb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "red-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "tiny-red-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16954164.0 :y 495984.62 :z 17066476.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-temple" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2539761.8 :y 74191.26 :z 10381844.0 :w 1.0) + :flags (minimap-flag clamp bigmap local-only transport wasall) + :name "desert-oasis" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12359188.0 :y 90439.68 :z 11306598.0 :w 1.0) + :flags (minimap-flag clamp bigmap local-only transport wasall) + :name "desert-corral" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9344532.0 :y 126484.48 :z 712171.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "sig-wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2669486.0 :y 14131.2 :z -2278359.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "freehq" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x5)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "green-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp trail bigmap) + :name "nest-cocoon" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp trail bigmap) + :name "nest-bridge" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 0.8 + :color (new 'static 'rgba :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2866749.5 :y 10117.12 :z -2174484.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "factory" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-orange-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x33 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-red-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-green-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-purple-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag bigmap) + :name "medium-purple-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "parked-vehicle" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1603706.9 :y 32522.24 :z -194478.08 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "samos-genb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp flash) + :name "projectile" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0) + :flags (minimap-flag trail bigmap goal local-only transport wasall) + :name "desertb-race" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap goal) + :name "big-red-flashing-trail-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap goal) + :name "big-green-flashing-trail-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag frustum) + :name "robot-frustum" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6036357.0 :y 99532.8 :z 12370657.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-marauder-village" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x5)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "gray-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -898404.4 :y 450727.94 :z -570347.1 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "volcano-monk" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 226181.53 :y -85.1968 :z 239582.4 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "volcano-collapsing-rock" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -377453.78 :y 83010.766 :z 401777.88 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "volcano-stone-lid" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -364009.06 :y 4519.936 :z -1827779.0 :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "volcano-dark-maker-idol" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag bigmap) + :name "medium-green-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag bigmap goal) + :name "big-red-flashing-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "factory-clamped-target" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "factory-clamped-tower" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "desglide-ring-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "desglide-thermal-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -338150.6 :y 344064.0 :z -341446.25 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "mine-elevator" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -1054895.8 :y 279489.75 :z -77204.69 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "mine-armor" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "mine-sign-up" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "mine-sign-down" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1078071.8 :y 418296.62 :z -450073.4 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "mine-door" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "ruins-elec-gate" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 791688.4 :y 92675.27 :z 1785077.8 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "ruins-goal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp) + :name "dp-bipedal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp) + :name "neo-wasp" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "dark-maker" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17319976.0 :y 488816.62 :z 16711188.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templea-door" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16893830.0 :y 187146.23 :z 17766400.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-watchers" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17029612.0 :y 189808.64 :z 19156910.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-regen" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16982508.0 :y 180674.56 :z 19045868.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-warpgate" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16956294.0 :y 504422.4 :z 16792166.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only) + :name "templex-darkmaker" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16744653.0 :y 181903.36 :z 17680548.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-tests-door" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16833126.0 :y 189808.64 :z 19508510.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-freeze" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17827010.0 :y 317647.66 :z 18464536.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-elev" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 386252.8 :y 1760583.6 :z 207462.4 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "factoryc-vehicle" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17238630.0 :y 189808.64 :z 19509616.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-defend" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17585848.0 :y 389857.28 :z 18208850.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only) + :name "templeb-seem" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16891248.0 :y 182435.84 :z 17934050.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-defend-door-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17123000.0 :y 199475.2 :z 18286838.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-defend-door-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17571308.0 :y 181125.12 :z 19067166.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-defend-door-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -592445.44 :y 20111.36 :z -1443553.2 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "palace-ruins" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + ) + ) + +(let ((gp-0 *minimap*)) + (set! (-> gp-0 engine) (new 'global 'engine-minimap '*minimap* 64 connection-minimap)) + (countdown (v1-9 6) + (set! (-> gp-0 trail v1-9 used-by) #f) + ) + ) + +(kmemclose) + +(defmethod debug-draw ((this minimap)) + (when *trail-graph* + (dotimes (s5-0 6) + (let ((s4-0 (-> this trail s5-0))) + (when (and (-> s4-0 used-by) + (>= (-> s4-0 node-count) 0) + (not (time-elapsed? (the-as int (-> s4-0 last-updated)) (seconds 5))) + ) + (let* ((a3-0 (target-pos 0)) + (v1-12 s5-0) + (t1-0 (cond + ((zero? v1-12) + *color-green* + ) + ((= v1-12 1) + *color-blue* + ) + ((= v1-12 2) + *color-white* + ) + ((= v1-12 3) + *color-red* + ) + (else + *color-magenta* + ) + ) + ) + ) + (trail-graph-method-16 + *trail-graph* + (-> s4-0 node-count) + (-> s4-0 node-id) + a3-0 + (-> s4-0 cached-info orig-goal-pos) + t1-0 + (* 1024.0 (the float s5-0)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defmethod update-trails ((this minimap)) + (let ((s5-0 *trail-graph*)) + (when s5-0 + (.mtc0 Count 0) + (let ((v1-1 0)) + (while (< (the-as uint v1-1) (the-as uint #x605a)) + (let ((v1-2 (-> s5-0 mode))) + (cond + ((= v1-2 1) + (trail-graph-method-31 s5-0 #x605a) + ) + ((zero? v1-2) + (let ((v1-5 -1)) + (let ((a0-5 0)) + (countdown (a1-1 6) + (let* ((a2-3 (-> this trail a1-1)) + (a3-0 (-> a2-3 used-by)) + ) + (when (and a3-0 (and (< 0.0 (-> a3-0 alpha)) (or (< v1-5 0) (< (the-as int (-> a2-3 last-updated)) a0-5)))) + (set! v1-5 a1-1) + (set! a0-5 (the-as int (-> a2-3 last-updated))) + ) + ) + ) + (let ((a1-5 (current-time))) + (if (or (< v1-5 0) (= a0-5 a1-5)) + (goto cfg-68) + ) + ) + ) + (let ((s4-0 (-> this trail v1-5)) + (s3-0 (the-as vector #f)) + ) + (let* ((v1-9 (-> s4-0 used-by)) + (s2-0 (the-as structure (-> v1-9 position))) + ) + (set! s3-0 (cond + ((= (the-as vector s2-0) #t) + (let* ((s2-1 (handle->process (-> v1-9 handle))) + (v1-13 (if (type? s2-1 process-drawable) + s2-1 + ) + ) + ) + (if v1-13 + (set! s3-0 (-> (the-as process-drawable v1-13) root trans)) + ) + ) + s3-0 + ) + ((and (= (logand (the-as int s2-0) 7) 4) (= (-> (the-as basic s2-0) type) entity-actor)) + (let* ((v1-19 (the-as structure s2-0)) + (s3-1 (if (the-as vector v1-19) + (-> (the-as entity-actor v1-19) extra process) + ) + ) + (v1-21 (if (type? s3-1 process-drawable) + s3-1 + ) + ) + ) + (if v1-21 + (set! s3-0 (-> (the-as process-drawable v1-21) root trans)) + (set! s3-0 (-> (the-as entity-actor s2-0) extra trans)) + ) + ) + s3-0 + ) + (else + (the-as vector s2-0) + ) + ) + ) + ) + (when s3-0 + (let* ((s2-2 s5-0) + (s1-0 (method-of-object s2-2 trail-graph-method-29)) + ) + (target-pos 0) + (-> s4-0 cached-info) + (s1-0 s2-2) + ) + (set! (-> s4-0 search-id) (-> s5-0 search-id)) + ) + ) + ) + ) + ((or (= v1-2 3) (= v1-2 2)) + (countdown (v1-33 6) + (let ((s4-1 (-> this trail v1-33))) + (when (and (= (-> s4-1 search-id) (-> s5-0 search-id)) (-> s4-1 used-by)) + (let* ((a0-29 s5-0) + (t9-5 (method-of-object a0-29 trail-graph-method-21)) + ) + (-> s4-1 node-id) + 64 + (&-> s4-1 goal-node-id) + (&-> s4-1 node-path-dist) + (set! (-> s4-1 node-count) (the-as int (t9-5 a0-29))) + ) + (set! (-> s4-1 last-updated) (the-as uint (current-time))) + (goto cfg-64) + ) + ) + ) + (label cfg-64) + (trail-graph-method-26 s5-0) + ) + ) + ) + (.mfc0 v1-1 Count) + ) + ) + (label cfg-68) + 0 + ) + ) + 0 + (none) + ) + +(defmethod get-trail-for-connection ((this minimap) (arg0 connection-minimap) (arg1 symbol)) + (local-vars (gp-0 minimap-trail)) + (countdown (v1-0 6) + (let ((a3-3 (-> this trail v1-0))) + (when (= (-> a3-3 used-by) arg0) + (set! gp-0 a3-3) + (goto cfg-14) + ) + ) + ) + (when arg1 + (dotimes (v1-4 6) + (let ((a3-7 (-> this trail v1-4))) + (when (not (-> a3-7 used-by)) + (set! (-> a3-7 used-by) arg0) + (set! gp-0 a3-7) + (goto cfg-14) + ) + ) + ) + ) + (set! gp-0 (the-as minimap-trail #f)) + (label cfg-14) + (if (and gp-0 arg1) + (reset gp-0) + ) + gp-0 + ) + +;; WARN: Function (method 13 minimap) has a return type of none, but the expression builder found a return statement. +(defmethod free-trail-by-connection ((this minimap) (arg0 connection-minimap)) + (countdown (v1-0 6) + (let ((a2-3 (-> this trail v1-0))) + (when (= (-> a2-3 used-by) arg0) + (set! (-> a2-3 used-by) #f) + (reset a2-3) + (return #f) + ) + ) + ) + 0 + (none) + ) + +(defmethod reset ((this minimap-trail)) + (set! (-> this node-count) -1) + (set! (-> this search-id) (the-as uint 0)) + (set! (-> this last-updated) (the-as uint 0)) + (set! (-> this cached-info goal-conn-id) -1) + (none) + ) + +(defmethod get-icon-draw-pos ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (vector-reset! (-> s5-0 2)) + (vector-reset! (-> s5-0 1)) + (let ((s1-0 0)) + (while (>= (-> arg1 node-count) s1-0) + (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) + (cond + ((< s1-0 (-> arg1 node-count)) + (trail-graph-method-20 *trail-graph* (-> arg1 node-id s1-0) (-> s5-0 1)) + (+! s1-0 1) + (vector-! (-> s5-0 1) (-> s5-0 1) arg2) + (set! (-> s5-0 1 x) (* (-> s5-0 1 x) arg3)) + (set! (-> s5-0 1 z) (* (-> s5-0 1 z) arg3)) + (set! (-> s5-0 1 y) 0.0) + (set! (-> s5-0 1 w) 1.0) + ) + (else + (vector-negate! (-> s5-0 1) arg4) + (+! s1-0 1) + ) + ) + (let ((v1-12 (-> s5-0 1))) + (when (>= (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) 50.0) + (vector-! (-> s5-0 3) (-> s5-0 0) (-> s5-0 1)) + (let* ((f1-6 (ray-sphere-intersect (-> s5-0 1) (-> s5-0 3) (-> s5-0 2) 50.0)) + (f0-12 (fmax 0.0 (fmin 1.0 f1-6))) + ) + (vector-float*! arg4 (-> s5-0 3) f0-12) + ) + (vector+! arg4 arg4 (-> s5-0 1)) + (vector-negate! arg4 arg4) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +(defmethod get-distance-with-path ((this minimap-trail) (arg0 vector) (arg1 vector)) + (local-vars (f30-1 float)) + 0.0 + (let ((s5-0 *trail-graph*)) + (cond + ((and s5-0 (> (-> this node-count) 0)) + (let ((f30-0 (-> this node-path-dist)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (trail-graph-method-20 s5-0 (-> this node-id 0) s3-0) + (set! f30-1 (+ f30-0 (vector-vector-xz-distance arg0 s3-0))) + (trail-graph-method-20 s5-0 (the-as uint (-> this goal-node-id)) s3-0) + ) + ) + (else + (set! f30-1 (vector-vector-xz-distance arg0 arg1)) + ) + ) + ) + f30-1 + ) + +(defmethod print ((this connection-minimap)) + (format + #t + "#" + (-> this class name) + (-> this flags) + (handle->process (-> this handle)) + this + ) + this + ) + + +(defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame)) + "Run updates if they scheduled. If something is found that has no pending update, kill it. + Note that we won't kill things on this call if they fail to update their `update-time`. + They will survive until the next call to `run-pending-updates`! + (or you can modify their `update-time` before that to prevent them from being killed.)" + (let ((s2-0 (&-> this alive-list)) + (s3-0 (-> this alive-list)) + ) + (while s3-0 + (let ((s4-0 (-> s3-0 next))) + ;; og:preserve-this not-yet-implemented check + (when (or (and (nonzero? *bigmap*) (bigmap-method-11 *bigmap*)) (not (paused?))) + (cond + ((logtest? (-> s3-0 flags) (minimap-flag fade-out)) + (logclear! (-> s3-0 flags) (minimap-flag fade-in)) + (seek! (-> s3-0 alpha) 0.0 (seconds-per-frame)) + ) + ((and (logtest? (-> s3-0 flags) (minimap-flag task-graph)) + (not (logtest? (-> *setting-control* user-current minimap) 32)) + ) + (logior! (-> s3-0 flags) (minimap-flag fade-in)) + (seek! (-> s3-0 alpha) 0.0 (seconds-per-frame)) + ) + ((logtest? (-> s3-0 flags) (minimap-flag fade-in)) + (let ((f30-0 1.0)) + (when (logtest? (-> s3-0 class flags) (minimap-flag trail)) + (let ((v1-29 (get-trail-for-connection *minimap* s3-0 #f))) + (if (or (not v1-29) (time-elapsed? (the-as int (-> v1-29 last-updated)) (seconds 5))) + (set! f30-0 0.0001) + ) + ) + ) + (seek! (-> s3-0 alpha) f30-0 (seconds-per-frame)) + ) + (if (= (-> s3-0 alpha) 1.0) + (logclear! (-> s3-0 flags) (minimap-flag fade-in)) + ) + ) + ) + ) + (cond + ((and (logtest? (-> s3-0 flags) (minimap-flag fade-out)) (= (-> s3-0 alpha) 0.0)) + (kill-callback this s3-0) + (set! (-> s2-0 0) (-> s3-0 next)) + (set! (-> s3-0 next) (-> this dead-list)) + (set! (-> this dead-list) s3-0) + (+! (-> this length) -1) + ) + ((and (handle->process (-> s3-0 handle)) + (not (and (= (logand (the-as int (-> s3-0 position)) 7) 4) + (= (-> (the-as entity-actor (-> s3-0 position)) type) entity-actor) + (logtest? (-> (the-as entity-actor (-> s3-0 position)) extra perm status) + (entity-perm-status dead subtask-complete bit-12) + ) + ) + ) + ) + (update-callback this) + (set! s2-0 (&-> s3-0 next)) + ) + (else + (logior! (-> s3-0 flags) (minimap-flag fade-out)) + (update-callback this) + (set! s2-0 (&-> s3-0 next)) + ) + ) + (set! s3-0 s4-0) + ) + ) + ) + (set! (-> this execute-time) arg0) + 0 + (none) + ) + +(defmethod add-icon! ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) + (when (not arg2) + (let ((v1-3 (+ (-> *minimap* engine-key) 1))) + (set! (-> *minimap* engine-key) v1-3) + (set! arg2 (the-as int v1-3)) + ) + ) + (let ((s3-0 (the-as connection-minimap (schedule-callback (-> this engine) arg2 0)))) + (let ((s2-1 (-> *minimap-class-list* arg1))) + (when s3-0 + (when (not (logtest? (-> s3-0 flags) (minimap-flag active))) + (set! (-> s3-0 class) s2-1) + (set! (-> s3-0 last-world-pos quad) (-> s2-1 default-position quad)) + (vector-! (-> s3-0 last-relative-pos) (target-pos 0) (-> s3-0 last-world-pos)) + (set! (-> s3-0 edge-ry) -131072) + ) + (set! (-> s3-0 handle) (process->handle arg0)) + (set! arg3 (cond + (arg3 + (empty) + arg3 + ) + (else + (-> s2-1 default-position) + ) + ) + ) + (set! (-> s3-0 position) arg3) + (set! (-> s3-0 flags) (minimap-flag active fade-in)) + (set! (-> s3-0 node) (the-as uint arg4)) + ) + ) + s3-0 + ) + ) + +;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. +(defmethod kill-callback ((this engine-minimap) (arg0 connection-pers)) + "Called when a connection is removed." + (if (not arg0) + (return #f) + ) + (if (logtest? (-> (the-as connection-minimap arg0) class flags) (minimap-flag trail)) + (free-trail-by-connection *minimap* (the-as connection-minimap arg0)) + ) + (set! (-> arg0 update-time) (the-as time-frame #f)) + ((method-of-type engine-pers kill-callback) this arg0) + (none) + ) + +(defun lookup-minimap-texture-by-name ((arg0 string) (arg1 string) (arg2 (pointer texture-page))) + (local-vars (sv-16 texture-page)) + (dotimes (s3-0 11) + (let ((s2-0 (-> *level* level s3-0))) + (when (or (= (-> s2-0 status) 'active) (= (-> s2-0 status) 'reserved)) + (set! sv-16 (-> s2-0 texture-page 8)) + (when (and sv-16 (or (not arg1) (string= (-> sv-16 name) arg1))) + (dotimes (s1-0 (-> sv-16 length)) + (let ((s0-0 (-> sv-16 data s1-0))) + (when (and s0-0 (string= (-> s0-0 name) arg0)) + (if arg2 + (set! (-> arg2 0) sv-16) + ) + (set! (-> s2-0 texture-mask 8 mask quad) (-> s0-0 masks data 0 mask quad)) + (return s0-0) + ) + ) + ) + ) + ) + ) + ) + (the-as texture #f) + ) + +(define *minimap-table-entry-array* (new 'static 'boxed-array :type minimap-table-entry + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 5270364.0 :z -3660800.0) + :level-name 'waswide + :tex-name "map-wascity" + :meters-per-texel 22118.4 + :pos-scale 5662310.5 + :min-inv-scale 0.5 + :max-inv-scale 1.0 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -2048000.0 :z -2338816.0) + :level-name 'desert + :tex-name "map-desert" + :meters-per-texel 40960.0 + :pos-scale 20971520.0 + :min-inv-scale 1.0 + :max-inv-scale 1.0 + :switch-immediate #f + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 5270364.0 :z -3660800.0) + :level-name 'wasdoors + :tex-name "map-wasdoors" + :meters-per-texel 22118.4 + :pos-scale 5662310.5 + :min-inv-scale 0.5 + :max-inv-scale 0.5 + :switch-immediate #f + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 4505600.0 :z 3442688.0) + :level-name 'lwassig + :tex-name "map-nst-lower" + :meters-per-texel 25600.0 + :pos-scale 6553600.0 + :min-inv-scale 0.5 + :max-inv-scale 0.5 + :switch-immediate #f + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 1662976.0 :z 163840.0) + :level-name 'nsta + :tex-name "map-nst-upper" + :meters-per-texel 25600.0 + :pos-scale 6553600.0 + :min-inv-scale 0.5 + :max-inv-scale 0.5 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -1433600.0 :z -1433600.0) + :level-name 'factoryb + :tex-name "map-factoryb" + :meters-per-texel 20480.0 + :pos-scale 5242880.0 + :min-inv-scale 0.4 + :max-inv-scale 0.4 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -3909755.0 :z 3309977.5) + :level-name 'foresta + :tex-name "map-forest" + :meters-per-texel 8519.68 + :pos-scale 2181038.0 + :min-inv-scale 0.15 + :max-inv-scale 0.15 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -2129920.0 :z -2338816.0) + :level-name 'jakx + :tex-name "map-desert" + :meters-per-texel 40960.0 + :pos-scale 20971520.0 + :min-inv-scale 1.0 + :max-inv-scale 1.0 + :switch-immediate #t + ) + ) + ) + +(defmethod update! ((this minimap)) + (set! (-> this map-bits) (the-as uint 0)) + (let* ((s5-0 (the-as level #f)) + (s4-0 *minimap-table-entry-array*) + (v1-0 (-> s4-0 length)) + (s3-0 99) + ) + (let ((a0-2 (-> *setting-control* user-current minimap-level))) + (dotimes (a1-0 (-> *level* length)) + (let ((a2-3 (-> *level* level a1-0))) + (when (= (-> a2-3 status) 'active) + ;; og:preserve-this + (set! (-> this map-bits) (logior (the-as uint (-> this map-bits)) (-> a2-3 info city-map-bits))) + (dotimes (a3-5 v1-0) + (cond + (a0-2 + (when (= a0-2 (-> s4-0 a3-5 level-name)) + (set! s3-0 a3-5) + (set! s5-0 a2-3) + ) + ) + ((and (= (-> a2-3 name) (-> s4-0 a3-5 level-name)) (< a3-5 s3-0)) + (set! s3-0 a3-5) + (set! s5-0 a2-3) + ) + ) + ) + ) + ) + ) + ) + (cond + (s5-0 + (when (not (paused?)) + (seek! (-> this min-inv-scale) (-> s4-0 s3-0 min-inv-scale) (* 0.5 (seconds-per-frame))) + (seek! (-> this max-inv-scale) (-> s4-0 s3-0 max-inv-scale) (* 0.5 (seconds-per-frame))) + ) + (when (or (-> s4-0 s3-0 switch-immediate) + (and (= (-> this min-inv-scale) (-> s4-0 s3-0 min-inv-scale)) + (= (-> this max-inv-scale) (-> s4-0 s3-0 max-inv-scale)) + ) + ) + (set! (-> this last-name) (-> s4-0 s3-0 tex-name)) + (set! (-> this minimap-corner quad) (-> s4-0 s3-0 corner quad)) + (set! (-> this meters-per-texel) (-> s4-0 s3-0 meters-per-texel)) + (set! (-> this pos-scale) (-> s4-0 s3-0 pos-scale)) + (set! (-> this level) s5-0) + (set! (-> this ctywide) s5-0) + (cond + ((= (-> this level name) 'lwassig) + (if (level-get *level* 'nsta) + (set! (-> this map-bits) (the-as uint 1)) + ) + ) + (else + (set! (-> this map-bits) (the-as uint 1)) + ) + ) + ) + ) + (else + (set! (-> this ctywide) (level-get *level* 'ctywide)) + (let ((s5-1 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) x))))) + (s4-1 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) z))))) + ) + (set! (-> this meters-per-texel) 16384.0) + (set! (-> this pos-scale) (* 256.0 (-> this meters-per-texel))) + (when (not (paused?)) + (seek! (-> this min-inv-scale) 0.25 (* 0.5 (seconds-per-frame))) + (seek! (-> this max-inv-scale) 0.5 (* 0.5 (seconds-per-frame))) + ) + (when (and (< s5-1 5) (< s4-1 7) (logtest? (-> this map-bits) (ash 1 (+ (* 5 s4-1) s5-1)))) + (let ((a0-23 (-> *minimap-texture-name-array* data (+ (* 5 s4-1) s5-1)))) + (when a0-23 + (set! (-> this last-name) a0-23) + (set! (-> this minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 s4-1) s5-1) quad)) + (dotimes (v1-69 (-> *level* length)) + (let ((a0-34 (-> *level* level v1-69))) + (when (= (-> a0-34 status) 'active) + (if (logtest? (-> a0-34 info city-map-bits) (ash 1 (+ (* 5 s4-1) s5-1))) + (set! (-> this level) a0-34) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + ((string= (-> this last-name) "map-nst-upper") + (cond + ((or (and (task-node-closed? (game-task-node nest-eggs-introduction)) + (not (task-node-closed? (game-task-node nest-eggs-gas))) + ) + (and (task-node-closed? (game-task-node nest-hunt-introduction)) + (not (task-node-closed? (game-task-node nest-hunt-resolution))) + ) + ) + (if (task-node-closed? (game-task-node nest-eggs-resolution)) + (set! (-> this last-name) "map-nst-upper-2") + ) + ) + (else + (set! (-> this last-name) #f) + ) + ) + ) + ((string= (-> this last-name) "map-forest") + (if (not (or (and (task-node-closed? (game-task-node forest-kill-plants-introduction)) + (not (task-node-closed? (game-task-node forest-kill-plants-resolution))) + ) + (and (task-node-closed? (game-task-node forest-turn-on-machine-introduction)) + (not (task-node-closed? (game-task-node precursor-tour-introduction))) + ) + ) + ) + (set! (-> this last-name) #f) + ) + ) + ) + (set! (-> this last-tex) + (lookup-minimap-texture-by-name (-> this last-name) (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (let ((f30-2 (seconds-per-frame))) + (let ((v1-84 (-> this last-tex))) + (cond + ((or (not (-> this level)) (zero? (-> this level)) (!= (-> this level status) 'active) (not v1-84)) + (set! (-> this offset w) 0.0) + ) + ((not (logtest? (-> *setting-control* user-current minimap) 128)) + (seek! (-> this offset w) 0.0 f30-2) + ) + ((and *target* (nonzero? (-> this map-bits))) + (set! (-> this offset w) (fmin 0.5 (+ (-> this offset w) f30-2))) + ) + (else + (set! (-> this offset w) 0.0) + ) + ) + ) + (cond + ((and *target* (or (focus-test? *target* board pilot) (= (-> this min-inv-scale) (-> this max-inv-scale)))) + (let ((f0-40 0.000008138021) + (f1-10 122880.0) + (v1-105 (-> *target* control transv)) + ) + (set! (-> this target-inv-scale) + (fmax + (fmin + (* f0-40 (fmin f1-10 (sqrtf (+ (* (-> v1-105 x) (-> v1-105 x)) (* (-> v1-105 z) (-> v1-105 z)))))) + (-> this max-inv-scale) + ) + (-> this min-inv-scale) + ) + ) + ) + ) + (else + (set! (-> this target-inv-scale) 0.5) + ) + ) + (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) + ) + (set! (-> this icon-inv-scale) (/ (* 32768.0 (-> this offset y)) (-> this meters-per-texel))) + (set! (-> this map-inv-scale) + (/ (* 256.0 (-> this meters-per-texel) (-> this icon-inv-scale)) (-> this pos-scale)) + ) + (set! (-> this icon-inv-scale) (* 1.1428572 (-> this icon-inv-scale))) + (run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter)) + (when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0))) + (update-trails this) + (if *display-trail-graph* + (debug-draw this) + ) + #t + ) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-racer-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (local-vars + (sv-16 process) + (sv-20 dma-buffer) + (sv-208 pointer) + (sv-212 vector) + (sv-216 vector) + (sv-220 vector) + (sv-224 matrix) + (sv-228 matrix) + ) + (let ((s3-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (set! sv-20 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-208 (-> sv-20 base)) + (set! sv-212 (new 'stack-no-clear 'vector)) + (set! sv-216 (new 'stack-no-clear 'vector)) + (set! sv-220 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'matrix)) + (set! sv-228 (new 'stack-no-clear 'matrix)) + (set! (-> sv-216 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-216 y) 0.0) + (vector-normalize! sv-216 1.0) + (vector-z-quaternion! sv-220 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-220 1.0) + (set! (-> sv-220 y) 0.0) + (set! (-> sv-220 w) 0.0) + (vector-! sv-212 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) + (let ((f0-4 (/ (-> sv-212 x) (* (-> this meters-per-texel) (-> this icon-inv-scale)))) + (f1-3 (/ (-> sv-212 z) (* (-> this meters-per-texel) (-> this icon-inv-scale)))) + ) + (set-vector! (-> sv-224 rvec) (-> sv-216 z) 0.0 (- (-> sv-216 x)) 0.0) + (set-vector! (-> sv-224 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-224 fvec) (-> sv-216 x) 0.0 (-> sv-216 z) 0.0) + (set-vector! (-> sv-224 trans) 164.0 0.0 164.0 1.0) + (set-vector! (-> sv-228 rvec) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) + (set-vector! (-> sv-228 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-228 fvec) (-> sv-220 x) 0.0 (-> sv-220 z) 0.0) + (set-vector! (-> sv-228 trans) f0-4 0.0 f1-3 1.0) + ) + (let ((v1-42 (-> sv-228 trans))) + (when (< (sqrtf (+ (* (-> v1-42 x) (-> v1-42 x)) (* (-> v1-42 z) (-> v1-42 z)))) 50.0) + (matrix*! sv-228 sv-228 sv-224) + (let ((f0-12 7.0)) + (set-vector! (-> arg0 corner 0) 0.0 0.0 (- f0-12) 1.0) + (set-vector! (-> arg0 corner 1) f0-12 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 2) (- f0-12) 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 3) 0.0 0.0 f0-12 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-228) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-228) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-228) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-228) + (let* ((a0-38 (-> arg1 class color)) + (a0-45 (copy-and-set-field a0-38 r (shr (* (-> a0-38 r) (the-as uint (-> this color x))) 7))) + (a0-52 (copy-and-set-field a0-45 g (shr (* (-> a0-45 g) (the-as uint (-> this color y))) 7))) + (v1-59 + (copy-and-set-field + (copy-and-set-field a0-52 b (shr (* (-> a0-52 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((a0-65 (-> this draw4-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208)) a0-65) + ) + (let ((a0-66 (-> this draw4-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 1) a0-66) + ) + (set-vector! + (-> (the-as (inline-array vector4w) sv-208) 2) + (the-as int (-> v1-59 r)) + (the-as int (-> v1-59 g)) + (the-as int (-> v1-59 b)) + (the-as int (-> v1-59 a)) + ) + ) + (let ((v1-62 (the-as object (&+ sv-208 48)))) + (set! (-> (the-as (inline-array vector) v1-62) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-62) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-62) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-62) 0 w) 0.0) + ) + (let ((v1-64 (the-as object (&+ sv-208 64)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 w) 0) + ) + (let ((v1-66 (the-as object (&+ sv-208 80)))) + (set! (-> (the-as (inline-array vector) v1-66) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 w) 0.0) + ) + (let ((v1-68 (the-as object (&+ sv-208 96)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 w) 0) + ) + (let ((v1-70 (the-as object (&+ sv-208 112)))) + (set! (-> (the-as (inline-array vector) v1-70) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 w) 0.0) + ) + (let ((v1-72 (the-as object (&+ sv-208 128)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 w) 0) + ) + (let ((v1-74 (the-as object (&+ sv-208 144)))) + (set! (-> (the-as (inline-array vector) v1-74) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 w) 0.0) + ) + (let ((v1-76 (the-as object (&+ sv-208 160)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 w) 0) + ) + (&+! (-> sv-20 base) 176) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-racer-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) + (local-vars + (sv-16 process) + (sv-20 float) + (sv-24 dma-buffer) + (sv-128 pointer) + (sv-132 vector) + (sv-136 vector) + (sv-140 matrix) + ) + (let ((s0-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s0-0 process-drawable) + s0-0 + ) + ) + ) + (set! sv-20 (-> *video-params* relative-x-scale)) + (set! sv-24 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-128 (-> sv-24 base)) + (set! sv-132 (new 'stack-no-clear 'vector)) + (set! sv-136 (new 'stack-no-clear 'vector)) + (set! sv-140 (new 'stack-no-clear 'matrix)) + (vector-z-quaternion! sv-136 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-136 -1.0) + (set! (-> sv-136 y) 0.0) + (set! (-> sv-136 w) 0.0) + (vector-! sv-132 (-> (the-as process-drawable sv-16) root trans) (-> this race-corner)) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (let ((f0-4 (+ arg3 (* (- 128.0 (/ (-> sv-132 x) arg2)) sv-20))) + (f1-4 (+ arg4 (/ (-> sv-132 z) arg2))) + ) + (set-vector! (-> sv-140 rvec) (-> sv-136 z) 0.0 (-> sv-136 x) 0.0) + (set-vector! (-> sv-140 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-140 fvec) (- (-> sv-136 x)) 0.0 (-> sv-136 z) 0.0) + (set-vector! (-> sv-140 trans) f0-4 0.0 f1-4 1.0) + ) + ) + (else + (let ((f0-8 (+ arg3 (* (/ (-> sv-132 x) arg2) sv-20))) + (f1-9 (+ arg4 (/ (-> sv-132 z) arg2))) + ) + (set-vector! (-> sv-140 rvec) (-> sv-136 z) 0.0 (- (-> sv-136 x)) 0.0) + (set-vector! (-> sv-140 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-140 fvec) (-> sv-136 x) 0.0 (-> sv-136 z) 0.0) + (set-vector! (-> sv-140 trans) f0-8 0.0 f1-9 1.0) + ) + ) + ) + (let ((f0-11 7.0)) + (set-vector! (-> arg0 corner 0) 0.0 0.0 (- f0-11) 1.0) + (set-vector! (-> arg0 corner 1) f0-11 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 2) (- f0-11) 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 3) 0.0 0.0 f0-11 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-140) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-140) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-140) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-140) + (let* ((a0-33 (-> arg1 class color)) + (a0-40 (copy-and-set-field a0-33 r (shr (* (-> a0-33 r) (the-as uint (-> this color x))) 7))) + (a0-47 (copy-and-set-field a0-40 g (shr (* (-> a0-40 g) (the-as uint (-> this color y))) 7))) + (v1-57 (copy-and-set-field + (copy-and-set-field a0-47 b (shr (* (-> a0-47 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((a0-60 (-> this draw4-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-128)) a0-60) + ) + (let ((a0-61 (-> this draw4-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-128) 1) a0-61) + ) + (let ((a0-63 (the-as object (&+ sv-128 32)))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 x) (the-as int (-> v1-57 r))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 y) (the-as int (-> v1-57 g))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 z) (the-as int (-> v1-57 b))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 w) (the-as int (-> v1-57 a))) + ) + ) + (let ((v1-60 (the-as object (&+ sv-128 48)))) + (set! (-> (the-as (inline-array vector) v1-60) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-60) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-60) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-60) 0 w) 0.0) + ) + (let ((v1-62 (the-as object (&+ sv-128 64)))) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 w) 0) + ) + (let ((v1-64 (the-as object (&+ sv-128 80)))) + (set! (-> (the-as (inline-array vector) v1-64) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-64) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-64) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-64) 0 w) 0.0) + ) + (let ((v1-66 (the-as object (&+ sv-128 96)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 w) 0) + ) + (let ((v1-68 (the-as object (&+ sv-128 112)))) + (set! (-> (the-as (inline-array vector) v1-68) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-68) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-68) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-68) 0 w) 0.0) + ) + (let ((v1-70 (the-as object (&+ sv-128 128)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 w) 0) + ) + (let ((v1-72 (the-as object (&+ sv-128 144)))) + (set! (-> (the-as (inline-array vector) v1-72) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-72) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-72) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-72) 0 w) 0.0) + ) + (let ((v1-74 (the-as object (&+ sv-128 160)))) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 w) 0) + ) + (&+! (-> sv-24 base) 176) + ) + (none) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-frustum-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (local-vars + (sv-16 process) + (sv-20 dma-buffer) + (sv-208 pointer) + (sv-212 texture) + (sv-216 vector) + (sv-220 vector) + (sv-224 vector) + (sv-228 matrix) + (sv-232 matrix) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (let ((s3-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (set! sv-20 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-208 (-> sv-20 base)) + (set! sv-212 (get-texture map-guard-frustum level-default-minimap)) + (set! sv-216 (new 'stack-no-clear 'vector)) + (set! sv-220 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! sv-228 (new 'stack-no-clear 'matrix)) + (set! sv-232 (new 'stack-no-clear 'matrix)) + (when sv-212 + (set! (-> sv-220 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-220 y) 0.0) + (vector-normalize! sv-220 1.0) + (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-224 1.0) + (set! (-> sv-224 y) 0.0) + (set! (-> sv-224 w) 0.0) + (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) + (let ((f0-4 (/ (-> sv-216 x) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + (f1-3 (/ (-> sv-216 z) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + ) + (set-vector! (-> sv-228 rvec) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) + (set-vector! (-> sv-228 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-228 fvec) (-> sv-220 x) 0.0 (-> sv-220 z) 0.0) + (set-vector! (-> sv-228 trans) 164.0 0.0 164.0 1.0) + (set-vector! (-> sv-232 rvec) (-> sv-224 z) 0.0 (- (-> sv-224 x)) 0.0) + (set-vector! (-> sv-232 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-232 fvec) (-> sv-224 x) 0.0 (-> sv-224 z) 0.0) + (set-vector! (-> sv-232 trans) f0-4 0.0 f1-3 1.0) + ) + (matrix*! sv-232 sv-232 sv-228) + (let ((f0-8 (/ -10.0 (-> this map-inv-scale)))) + (set-vector! (-> arg0 corner 0) 0.0 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 1) (- f0-8) 0.0 f0-8 1.0) + (set-vector! (-> arg0 corner 2) f0-8 0.0 f0-8 1.0) + (set-vector! (-> arg0 corner 3) 0.0 0.0 (* 2.0 f0-8) 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-232) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-232) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-232) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-232) + (let ((v1-47 (new 'stack-no-clear 'vector)) + (a0-40 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 corner 0 quad)) + (.lvf vf2 (&-> arg0 corner 1 quad)) + (.lvf vf3 (&-> arg0 corner 2 quad)) + (.lvf vf4 (&-> arg0 corner 3 quad)) + (.min.vf vf5 vf1 vf2) + (.min.vf vf5 vf5 vf3) + (.min.vf vf5 vf5 vf4) + (.max.vf vf6 vf1 vf2) + (.max.vf vf6 vf6 vf3) + (.max.vf vf6 vf6 vf4) + (.svf (&-> v1-47 quad) vf5) + (.svf (&-> a0-40 quad) vf6) + (when (and (< (-> a0-40 x) 228.0) (< (-> a0-40 z) 228.0) (< 100.0 (-> v1-47 x)) (< 100.0 (-> v1-47 z))) + (let* ((a0-46 (-> arg1 class color)) + (a0-53 (copy-and-set-field a0-46 r (shr (* (-> a0-46 r) (the-as uint (-> this color x))) 7))) + (a0-60 (copy-and-set-field a0-53 g (shr (* (-> a0-53 g) (the-as uint (-> this color y))) 7))) + (s4-1 (copy-and-set-field + (copy-and-set-field a0-60 b (shr (* (-> a0-60 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> this frustum-alpha) (-> arg1 alpha))) + ) + ) + ) + (let ((v1-58 (-> this adgif-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208) 0) v1-58) + ) + (let ((v1-59 (-> this adgif-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 1) v1-59) + ) + (adgif-shader<-texture-simple! (the-as adgif-shader (&+ sv-208 32)) sv-212) + (let ((v1-61 (-> this draw4-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208) 7) v1-61) + ) + (let ((v1-62 (-> this draw4-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 8) v1-62) + ) + (let ((v1-64 (the-as object (&+ sv-208 144)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 x) (the-as int (-> s4-1 r))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 y) (the-as int (-> s4-1 g))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 z) (the-as int (-> s4-1 b))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 w) (the-as int (-> s4-1 a))) + ) + ) + (let ((v1-66 (the-as object (&+ sv-208 160)))) + (set! (-> (the-as (inline-array vector) v1-66) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 w) 0.0) + ) + (let ((v1-68 (the-as object (&+ sv-208 176)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 w) 0) + ) + (let ((v1-70 (the-as object (&+ sv-208 192)))) + (set! (-> (the-as (inline-array vector) v1-70) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 w) 0.0) + ) + (let ((v1-72 (the-as object (&+ sv-208 208)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 w) 0) + ) + (let ((v1-74 (the-as object (&+ sv-208 224)))) + (set! (-> (the-as (inline-array vector) v1-74) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 w) 0.0) + ) + (let ((v1-76 (the-as object (&+ sv-208 240)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 w) 0) + ) + (let ((v1-78 (the-as object (&+ sv-208 256)))) + (set! (-> (the-as (inline-array vector) v1-78) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-78) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-78) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-78) 0 w) 0.0) + ) + (let ((v1-80 (the-as object (&+ sv-208 272)))) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 w) 0) + ) + (&+! (-> sv-20 base) 288) + ) + ) + ) + ) + (none) + ) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-frustum-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (local-vars + (sv-16 process) + (sv-20 dma-buffer) + (sv-208 pointer) + (sv-212 texture) + (sv-216 vector) + (sv-220 vector) + (sv-224 vector) + (sv-228 matrix) + (sv-232 matrix) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (let ((s3-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (set! sv-20 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-208 (-> sv-20 base)) + (set! sv-212 (get-texture map-guard-frustum level-default-minimap)) + (set! sv-216 (new 'stack-no-clear 'vector)) + (set! sv-220 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! sv-228 (new 'stack-no-clear 'matrix)) + (set! sv-232 (new 'stack-no-clear 'matrix)) + (when sv-212 + (set! (-> sv-220 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-220 y) 0.0) + (vector-normalize! sv-220 1.0) + (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-224 1.0) + (set! (-> sv-224 y) 0.0) + (set! (-> sv-224 w) 0.0) + (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) + (let ((f0-4 (/ (-> sv-216 x) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + (f1-3 (/ (-> sv-216 z) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + ) + (set-vector! (-> sv-228 rvec) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) + (set-vector! (-> sv-228 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-228 fvec) (-> sv-220 x) 0.0 (-> sv-220 z) 0.0) + (set-vector! (-> sv-228 trans) 164.0 0.0 164.0 1.0) + (set-vector! (-> sv-232 rvec) (-> sv-224 z) 0.0 (- (-> sv-224 x)) 0.0) + (set-vector! (-> sv-232 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-232 fvec) (-> sv-224 x) 0.0 (-> sv-224 z) 0.0) + (set-vector! (-> sv-232 trans) f0-4 0.0 f1-3 1.0) + ) + (matrix*! sv-232 sv-232 sv-228) + (let ((f0-7 12.0)) + (set-vector! (-> arg0 corner 0) (- f0-7) 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 1) 0.0 0.0 f0-7 1.0) + (set-vector! (-> arg0 corner 2) 0.0 0.0 (- f0-7) 1.0) + (set-vector! (-> arg0 corner 3) f0-7 0.0 0.0 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-232) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-232) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-232) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-232) + (let ((v1-47 (new 'stack-no-clear 'vector)) + (a0-39 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 corner 0 quad)) + (.lvf vf2 (&-> arg0 corner 1 quad)) + (.lvf vf3 (&-> arg0 corner 2 quad)) + (.lvf vf4 (&-> arg0 corner 3 quad)) + (.min.vf vf5 vf1 vf2) + (.min.vf vf5 vf5 vf3) + (.min.vf vf5 vf5 vf4) + (.max.vf vf6 vf1 vf2) + (.max.vf vf6 vf6 vf3) + (.max.vf vf6 vf6 vf4) + (.svf (&-> v1-47 quad) vf5) + (.svf (&-> a0-39 quad) vf6) + (when (and (< (-> a0-39 x) 228.0) (< (-> a0-39 z) 228.0) (< 100.0 (-> v1-47 x)) (< 100.0 (-> v1-47 z))) + (let* ((a3-0 (-> arg1 class color)) + ;; og:preserve-this + (a2-6 (the int (+ (* (the-as uint 320) (-> arg1 class icon-xy x)) 8))) + (a1-14 (the int (+ (* (the-as uint 320) (-> arg1 class icon-xy y)) 8))) + (v1-54 (+ a2-6 304)) + (a0-49 (+ a1-14 304)) + ) + (let* ((t0-2 (copy-and-set-field a3-0 r (shr (* (-> a3-0 r) (the-as uint (-> this color x))) 7))) + (t0-9 (copy-and-set-field t0-2 g (shr (* (-> t0-2 g) (the-as uint (-> this color y))) 7))) + (a3-13 (copy-and-set-field + (copy-and-set-field t0-9 b (shr (* (-> t0-9 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((t0-22 (-> this draw3-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208) 0) t0-22) + ) + (let ((t0-23 (-> this draw3-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 1) t0-23) + ) + (let ((t0-25 (the-as (object object) (&-> (the-as (pointer uint128) sv-208) 2)))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 x) (the-as int (-> a3-13 r))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 y) (the-as int (-> a3-13 g))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 z) (the-as int (-> a3-13 b))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 w) (the-as int (-> a3-13 a))) + ) + ) + (let ((a3-16 (the-as (inline-array vector4w) (&+ sv-208 48)))) + (set! (-> a3-16 0 x) a2-6) + (set! (-> a3-16 0 y) a1-14) + (set! (-> a3-16 0 z) 0) + (set! (-> a3-16 0 w) 0) + ) + (let ((a3-18 (the-as object (&+ sv-208 64)))) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 w) 0) + ) + (let ((a3-20 (the-as (inline-array vector4w) (&+ sv-208 80)))) + (set! (-> a3-20 0 x) a2-6) + (set! (-> a3-20 0 y) a0-49) + (set! (-> a3-20 0 z) 0) + (set! (-> a3-20 0 w) 0) + ) + (let ((a2-8 (the-as object (&+ sv-208 96)))) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 w) 0) + ) + (let ((a2-10 (the-as (inline-array vector4w) (&+ sv-208 112)))) + (set! (-> a2-10 0 x) v1-54) + (set! (-> a2-10 0 y) a1-14) + (set! (-> a2-10 0 z) 0) + (set! (-> a2-10 0 w) 0) + ) + (let ((a1-16 (the-as object (&+ sv-208 128)))) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 w) 0) + ) + (let ((a1-18 (the-as (inline-array vector4w) (&+ sv-208 144)))) + (set! (-> a1-18 0 x) v1-54) + (set! (-> a1-18 0 y) a0-49) + (set! (-> a1-18 0 z) 0) + (set! (-> a1-18 0 w) 0) + ) + ) + (let ((v1-56 (the-as object (&+ sv-208 160)))) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 w) 0) + ) + (&+! (-> sv-20 base) 176) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod sub-draw-1-1 ((this minimap) (arg0 minimap-draw-work)) + (let ((s5-0 (-> arg0 buf))) + (set-display-gs-state s5-0 (the-as int (-> *map-texture-base* vram-page)) 128 128 0 0) + (let ((s3-0 (-> s5-0 base))) + (set! (-> (the-as (pointer uint128) s3-0) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-0) 1) (-> this adgif-tmpl quad 1)) + (let ((a1-2 (-> this last-tex))) + (if (not a1-2) + (set! a1-2 (get-texture common-white common)) + ) + (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s3-0 32)) (the-as texture a1-2)) + ) + ) + (&+! (-> s5-0 base) 112) + (dma-buffer-add-gs-set s5-0 + (clamp-1 (new 'static 'gs-clamp)) + (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (texa (new 'static 'gs-texa :ta1 #x80)) + ) + (let ((s3-1 (-> s5-0 base))) + (let ((f30-0 (-> *video-params* relative-x-scale))) + (set! (-> (the-as (pointer uint128) s3-1) 0) (-> this draw2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-1) 1) (-> this draw2-tmpl quad 1)) + (let ((s2-0 (new-stack-vector0))) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 quad) (-> (matrix-local->world #f #f) fvec quad)) + (set! (-> s1-0 y) 0.0) + (vector-normalize! s1-0 1.0) + (let ((v1-16 (-> arg0 mat))) + (set! (-> v1-16 rvec x) (* (-> s1-0 z) f30-0)) + (set! (-> v1-16 rvec y) 0.0) + (set! (-> v1-16 rvec z) (- (-> s1-0 x))) + (set! (-> v1-16 rvec w) 0.0) + ) + (set-vector! (-> arg0 mat uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> arg0 mat fvec) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0) + ) + (vector-! s2-0 (target-pos 0) (-> this minimap-corner)) + (set! (-> s2-0 x) (/ (-> s2-0 x) (-> this pos-scale))) + (set! (-> s2-0 z) (/ (-> s2-0 z) (-> this pos-scale))) + (vector+! (-> arg0 mat trans) s2-0 (-> this offset)) + ) + ) + (set! (-> arg0 mat trans y) 0.0) + (set! (-> arg0 corner 0 x) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 0 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 0 w) 1.0) + (set! (-> arg0 corner 1 x) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 1 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 1 w) 1.0) + (set! (-> arg0 corner 2 x) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 2 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 2 w) 1.0) + (set! (-> arg0 corner 3 x) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 3 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 3 w) 1.0) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) (-> arg0 mat)) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) (-> arg0 mat)) + (let ((v1-33 (the-as object (&+ s3-1 32)))) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 x) 128) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 y) 128) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 z) 128) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 w) 128) + ) + (let ((v1-34 (the-as object (&+ s3-1 48)))) + (set! (-> (the-as (inline-array vector) v1-34) 0 x) (-> arg0 corner 0 x)) + (set! (-> (the-as (inline-array vector) v1-34) 0 y) (-> arg0 corner 0 z)) + (set! (-> (the-as (inline-array vector) v1-34) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 w) 1.0) + ) + (let ((v1-35 (the-as (inline-array vector4w) (&+ s3-1 64)))) + (set! (-> v1-35 0 x) 0) + (set! (-> v1-35 0 y) 0) + (set! (-> v1-35 0 z) #xffffff) + (set! (-> v1-35 0 w) 0) + ) + (let ((v1-36 (the-as object (&+ s3-1 80)))) + (set! (-> (the-as (inline-array vector) v1-36) 0 x) (-> arg0 corner 1 x)) + (set! (-> (the-as (inline-array vector) v1-36) 0 y) (-> arg0 corner 1 z)) + (set! (-> (the-as (inline-array vector) v1-36) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-36) 0 w) 1.0) + ) + (let ((v1-37 (the-as object (&+ s3-1 96)))) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 y) 0) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 w) 0) + ) + (let ((v1-38 (the-as object (&+ s3-1 112)))) + (set! (-> (the-as (inline-array vector) v1-38) 0 x) (-> arg0 corner 2 x)) + (set! (-> (the-as (inline-array vector) v1-38) 0 y) (-> arg0 corner 2 z)) + (set! (-> (the-as (inline-array vector) v1-38) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-38) 0 w) 1.0) + ) + (let ((v1-39 (the-as (inline-array vector4w) (&+ s3-1 128)))) + (set! (-> v1-39 0 x) 0) + (set! (-> v1-39 0 y) 2048) + (set! (-> v1-39 0 z) #xffffff) + (set! (-> v1-39 0 w) 0) + ) + (let ((v1-40 (the-as object (&+ s3-1 144)))) + (set! (-> (the-as (inline-array vector) v1-40) 0 x) (-> arg0 corner 3 x)) + (set! (-> (the-as (inline-array vector) v1-40) 0 y) (-> arg0 corner 3 z)) + (set! (-> (the-as (inline-array vector) v1-40) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-40) 0 w) 1.0) + ) + (let ((v1-41 (the-as object (&+ s3-1 160)))) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 y) 2048) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 w) 0) + ) + ) + (&+! (-> s5-0 base) 176) + (let ((f0-57 1.0)) + (when *target* + (if (focus-test? *target* pilot) + (set! f0-57 0.0) + ) + ) + (seek! (-> this frustum-alpha) f0-57 (seconds-per-frame)) + ) + (dma-buffer-add-gs-set s5-0 (xyoffset-1 (new 'static 'gs-xy-offset :ofx #x640 :ofy #x640))) + (when (!= (-> this frustum-alpha) 0.0) + (let ((s3-2 (-> *minimap* engine alive-list))) + (while s3-2 + (let ((a2-6 s3-2)) + (if (logtest? (-> a2-6 class flags) (minimap-flag frustum)) + (draw-frustum-1 this arg0 a2-6) + ) + ) + (set! s3-2 (-> s3-2 next)) + ) + ) + ) + (let ((s2-1 (-> arg0 buf base)) + (s3-3 (get-texture mini-map-icons level-default-minimap)) + ) + (when s3-3 + (set! (-> (the-as (pointer uint128) s2-1) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s2-1) 2)) s3-3) + (&+! (-> arg0 buf base) 112) + ) + (if (not s3-3) + (format *stdebug* "minimap: mini-map-icons texture is #f~%") + ) + ) + (let ((s3-4 (-> *minimap* engine alive-list))) + (while s3-4 + (let ((a2-7 s3-4)) + (if (logtest? (-> a2-7 class flags) (minimap-flag frustum)) + (draw-frustum-2 this arg0 a2-7) + ) + ) + (set! s3-4 (-> s3-4 next)) + ) + ) + (let ((s3-5 (-> arg0 buf base)) + (a1-37 (get-texture map-target-marker level-default-minimap)) + ) + (when a1-37 + (set! (-> (the-as (pointer uint128) s3-5) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-5) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-5) 2)) a1-37) + (&+! (-> arg0 buf base) 112) + ) + ) + (let ((s3-6 (-> *minimap* engine alive-list))) + (while s3-6 + (let ((a2-8 s3-6)) + (if (logtest? (-> a2-8 class flags) (minimap-flag racer)) + (draw-racer-2 this arg0 a2-8) + ) + ) + (set! s3-6 (-> s3-6 next)) + ) + ) + (dma-buffer-add-gs-set s5-0 + (frame-1 (new 'static 'gs-frame :fbw #x2 :fbmsk #xffffff :fbp (-> *map-texture-base* vram-page))) + (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) + (xyoffset-1 (new 'static 'gs-xy-offset)) + ) + (let ((s3-7 (-> s5-0 base))) + (set! (-> (the-as (pointer uint128) s3-7) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! + (the-as adgif-shader (&-> (the-as (pointer uint128) s3-7) 2)) + (get-texture minimap-mask level-default-minimap) + ) + (set! (-> (the-as (pointer uint128) s3-7) 7) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 8) (-> this sprite-tmpl quad 1)) + (let ((v1-110 (the-as object (&+ s3-7 144)))) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 x) 128) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 y) 128) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 z) 128) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 w) 128) + ) + (let ((v1-111 (the-as (inline-array vector4w) (&+ s3-7 160)))) + (set! (-> v1-111 0 x) 0) + (set! (-> v1-111 0 y) 0) + (set! (-> v1-111 0 z) 0) + (set! (-> v1-111 0 w) 0) + ) + (let ((v1-112 (the-as (inline-array vector4w) (&+ s3-7 176)))) + (set! (-> v1-112 0 x) 0) + (set! (-> v1-112 0 y) 0) + (set! (-> v1-112 0 z) #xffffff) + (set! (-> v1-112 0 w) 0) + ) + (let ((v1-113 (the-as object (&+ s3-7 192)))) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 x) 1024) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 y) 1024) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 w) 0) + ) + (let ((v1-114 (the-as object (&+ s3-7 208)))) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 y) 2048) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 w) 0) + ) + ) + (&+! (-> s5-0 base) 224) + (set! (-> arg0 buf) s5-0) + ) + 0 + (none) + ) + +(defmethod sub-draw-1-2 ((this minimap) (arg0 minimap-draw-work)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 vector) (sv-64 int) (sv-80 int)) + (let ((s5-0 (-> arg0 buf))) + (reset-display-gs-state *display* s5-0) + (dma-buffer-add-gs-set s5-0 + (test-1 (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))) + (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) + (tex0-1 (new 'static 'gs-tex0 + :tbw #x2 + :tcc #x1 + :th (log2 128) + :tw (log2 128) + :tbp0 (-> *map-texture-base* vram-block) + ) + ) + (tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (clamp-1 (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) + (texflush 0) + ) + (let ((f30-0 (-> *video-params* relative-x-scale))) + (let ((s3-1 (the-as object (-> s5-0 base))) + (v1-22 (the int (* 112.0 f30-0))) + ) + 0 + 0 + (let ((s0-0 (* (+ (-> arg0 draw-pos y) 1840) 16)) + (s2-1 (* (+ (-> arg0 draw-pos y) 1952) 16)) + (s1-2 (-> arg0 draw-pos z)) + ) + (cond + ((-> arg0 justify-right) + (set! sv-64 (* (+ (- 1792 v1-22) (-> arg0 draw-pos x)) 16)) + (set! sv-80 (* (+ (-> arg0 draw-pos x) 1792) 16)) + sv-80 + ) + (else + (set! sv-64 (* (+ (-> arg0 draw-pos x) 1792) 16)) + (set! sv-80 (* (+ v1-22 1792 (-> arg0 draw-pos x)) 16)) + sv-80 + ) + ) + (set! (-> (the-as (inline-array vector4w) s3-1) 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) s3-1) 1 quad) (-> this sprite-tmpl quad 1)) + (let ((v1-36 (-> this color quad))) + (set! (-> (the-as (inline-array vector4w) s3-1) 2 quad) v1-36) + ) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 3) 0 0 0 0) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 4) sv-80 s0-0 s1-2 0) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 5) 2048 2048 0 0) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 6) sv-64 s2-1 s1-2 0) + ) + (else + (let ((v1-42 (the-as (inline-array vector4w) (&+ (the-as pointer s3-1) 48)))) + (set! (-> v1-42 0 x) 0) + (set! (-> v1-42 0 y) 0) + (set! (-> v1-42 0 z) 0) + (set! (-> v1-42 0 w) 0) + ) + (let ((a0-31 (the-as object (&+ (the-as pointer s3-1) 64)))) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 x) sv-64) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 y) s0-0) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 z) s1-2) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 w) 0) + ) + (let ((v1-44 (the-as object (&+ (the-as pointer s3-1) 80)))) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 y) 2048) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 w) 0) + ) + (let ((v1-45 (the-as object (&+ (the-as pointer s3-1) 96)))) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 x) sv-80) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 y) s2-1) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 z) s1-2) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 w) 0) + ) + ) + ) + ) + ) + (&+! (-> s5-0 base) 112) + (dma-buffer-add-gs-set s5-0 + (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest greater) :zte #x1 :ztst (gs-ztest always))) + ) + (set! sv-48 (new-stack-vector0)) + (set! sv-52 (new-stack-vector0)) + (set! sv-56 (target-pos 0)) + (set! (-> sv-52 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-52 y) 0.0) + (vector-normalize! sv-52 1.0) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (let ((v1-57 (-> arg0 mat))) + (set! (-> v1-57 rvec x) (* (-> sv-52 z) (- f30-0))) + (set! (-> v1-57 rvec y) 0.0) + (set! (-> v1-57 rvec z) (- (-> sv-52 x))) + (set! (-> v1-57 rvec w) 0.0) + ) + (set-vector! (-> arg0 mat uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> arg0 mat fvec) (* (-> sv-52 x) (- f30-0)) 0.0 (-> sv-52 z) 0.0) + (set-vector! (-> arg0 mat trans) 0.0 0.0 (the float (+ (-> arg0 draw-pos y) 1896)) 1.0) + ) + (else + (let ((v1-61 (-> arg0 mat))) + (set! (-> v1-61 rvec x) (* (-> sv-52 z) f30-0)) + (set! (-> v1-61 rvec y) 0.0) + (set! (-> v1-61 rvec z) (- (-> sv-52 x))) + (set! (-> v1-61 rvec w) 0.0) + ) + (set-vector! (-> arg0 mat uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> arg0 mat fvec) (* (-> sv-52 x) f30-0) 0.0 (-> sv-52 z) 0.0) + (set-vector! (-> arg0 mat trans) 0.0 0.0 (the float (+ (-> arg0 draw-pos y) 1896)) 1.0) + ) + ) + (let ((v1-66 (the int (* 56.0 f30-0)))) + (if (-> arg0 justify-right) + (set! (-> arg0 mat trans x) (the float (+ (- 1792 v1-66) (-> arg0 draw-pos x)))) + (set! (-> arg0 mat trans x) (the float (+ v1-66 1792 (-> arg0 draw-pos x)))) + ) + ) + ) + (set! (-> arg0 buf) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-connection ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (let ((s1-0 (target-pos 0))) + (cond + ((= (-> arg1 position) #t) + (let* ((s3-0 (handle->process (-> arg1 handle))) + (v1-4 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (when (and v1-4 (nonzero? (-> (the-as process-drawable v1-4) root))) + (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable v1-4) root trans quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + ) + ) + ((and (= (logand (the-as int (-> arg1 position)) 7) 4) + (= (-> (the-as entity-actor (-> arg1 position)) type) entity-actor) + ) + (let* ((v1-15 (the-as structure (-> arg1 position))) + (s3-1 (if (the-as vector v1-15) + (-> (the-as entity-actor v1-15) extra process) + ) + ) + (a0-16 (if (type? s3-1 process-drawable) + s3-1 + ) + ) + ) + (cond + (a0-16 + (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable a0-16) root trans quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + (else + (set! (-> arg1 last-world-pos quad) (-> (the-as entity-actor (-> arg1 position)) extra trans quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + ) + ) + ) + (else + (set! (-> arg1 last-world-pos quad) (-> arg1 position quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + ) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s2-0 #f) + ) + 1.0 + 0.0 + (let ((f30-0 (/ 1.0 (* (-> this icon-inv-scale) (-> this meters-per-texel))))) + (set! (-> s3-2 quad) (-> arg1 last-relative-pos quad)) + (set! (-> s3-2 x) (* (-> s3-2 x) f30-0)) + (set! (-> s3-2 z) (* (-> s3-2 z) f30-0)) + (set! (-> s3-2 y) 0.0) + (set! (-> s3-2 w) 1.0) + (let* ((v1-29 s3-2) + (f28-0 (sqrtf (+ (* (-> v1-29 x) (-> v1-29 x)) (* (-> v1-29 z) (-> v1-29 z))))) + ) + (if (or (and (logtest? (minimap-flag local-only) (-> arg1 class flags)) + (not (logtest? (the-as minimap-flag (logand #x3c0000 (-> arg0 global-flags))) (-> arg1 class flags))) + ) + (logtest? (-> arg1 class flags) (minimap-flag bigmap-only)) + ) + (set! s2-0 #t) + ) + (cond + ((logtest? (-> arg1 class flags) (minimap-flag trail)) + (cond + (*trail-graph* + (let ((a2-2 (get-trail-for-connection this arg1 #f))) + (cond + ((not a2-2) + (when (!= (-> arg1 alpha) 0.0) + (when (not (get-trail-for-connection this arg1 #t)) + (let ((s2-1 (-> *minimap* engine alive-list))) + (while s2-1 + (let ((a1-15 s2-1)) + (if (and (= (-> a1-15 alpha) 0.0) (logtest? (-> arg1 class flags) (minimap-flag trail))) + (free-trail-by-connection *minimap* a1-15) + ) + ) + (set! s2-1 (-> s2-1 next)) + ) + ) + ) + ) + (set! s2-0 #t) + (set! (-> arg1 edge-ry) -131072) + ) + ((time-elapsed? (the-as int (-> a2-2 last-updated)) (seconds 5)) + (set! s2-0 #t) + (set! (-> arg1 edge-ry) -131072) + ) + ((< 50.0 f28-0) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! (-> s0-0 quad) (-> s3-2 quad)) + (let ((s1-1 (get-icon-draw-pos *minimap* arg1 a2-2 s1-0 f30-0 s3-2))) + (if (not s1-1) + (vector-normalize-copy! s3-2 s0-0 50.0) + ) + (let ((f30-1 (atan (-> s3-2 x) (-> s3-2 z)))) + (let ((f28-1 (the float (-> arg1 edge-ry)))) + (when (!= f28-1 -131072.0) + (let* ((f0-20 (deg- f30-1 f28-1)) + (f1-7 (fabs f0-20)) + (f2-3 (* 16384.0 (seconds-per-frame))) + ) + (when (< f2-3 f1-7) + (set! f30-1 (+ f28-1 (if (>= f0-20 0.0) + f2-3 + (- f2-3) + ) + ) + ) + (set-vector! s3-2 (sin f30-1) 0.0 (cos f30-1) 1.0) + (vector-normalize! s3-2 (if s1-1 + 50.0 + 66.0 + ) + ) + ) + ) + ) + ) + (set! (-> arg1 edge-ry) (the int f30-1)) + ) + ) + ) + ) + (else + (set! (-> arg1 edge-ry) (the int (atan (-> s3-2 x) (-> s3-2 z)))) + ) + ) + ) + ) + (else + (set! s2-0 #t) + (set! (-> arg1 edge-ry) -131072) + ) + ) + ) + ((logtest? (-> arg1 class flags) (minimap-flag clamp)) + (cond + ((< 50.0 f28-0) + (let ((a1-22 (new 'stack-no-clear 'vector))) + (set! (-> a1-22 quad) (-> s3-2 quad)) + (vector-normalize-copy! s3-2 a1-22 54.0) + ) + (let ((f30-2 (atan (-> s3-2 x) (-> s3-2 z)))) + (let ((f28-2 (the float (-> arg1 edge-ry)))) + (when (!= f28-2 -131072.0) + (let* ((f0-37 (deg- f30-2 f28-2)) + (f1-9 (fabs f0-37)) + (f2-5 (* 16384.0 (seconds-per-frame))) + ) + (when (< f2-5 f1-9) + (set! f30-2 (+ f28-2 (if (>= f0-37 0.0) + f2-5 + (- f2-5) + ) + ) + ) + (set-vector! s3-2 (sin f30-2) 0.0 (cos f30-2) 1.0) + (vector-normalize! s3-2 54.0) + ) + ) + ) + ) + (set! (-> arg1 edge-ry) (the int f30-2)) + ) + ) + (else + (set! (-> arg1 edge-ry) (the int (atan (-> s3-2 x) (-> s3-2 z)))) + ) + ) + ) + (else + (if (< 50.0 f28-0) + (set! s2-0 #t) + ) + ) + ) + ) + ) + (if (or (logtest? (-> arg1 class flags) (minimap-flag frustum)) + (logtest? (-> arg1 class flags) (minimap-flag racer)) + (and (logtest? (-> arg1 class flags) (minimap-flag flash)) + (< (logand (-> *display* base-clock integral-frame-counter) 15) (seconds 0.027)) + ) + ) + (set! s2-0 #t) + ) + (if (logtest? (-> arg1 class flags) (minimap-flag goal)) + (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> this goal-time)) 6))) + ) + (when (not s2-0) + (vector-matrix*! s3-2 s3-2 (-> arg0 mat)) + (let ((v1-122 (-> arg0 buf base))) + (let* ((f0-52 (-> arg1 class scale)) + (a1-28 (-> arg1 class color)) + (a1-35 (copy-and-set-field a1-28 r (shr (* (-> a1-28 r) (the-as uint (-> this color x))) 7))) + (a1-42 (copy-and-set-field a1-35 g (shr (* (-> a1-35 g) (the-as uint (-> this color y))) 7))) + (a0-78 (copy-and-set-field + (copy-and-set-field a1-42 b (shr (* (-> a1-42 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((f1-16 (* 20.0 (-> *video-params* relative-x-scale) f0-52)) + (f0-53 (* 20.0 f0-52)) + ) + (set! (-> arg0 corner 0 x) (the float (the int (- (-> s3-2 x) (* 0.5 f1-16))))) + (set! (-> arg0 corner 0 z) (the float (the int (- (-> s3-2 z) (* 0.5 f0-53))))) + (set! (-> arg0 corner 1 x) (+ (-> arg0 corner 0 x) f1-16)) + (set! (-> arg0 corner 1 z) (+ (-> arg0 corner 0 z) f0-53)) + ) + ;; og:preserve-this + (let* ((a3-1 (the int (+ (* (the-as uint 320) (-> arg1 class icon-xy x)) 8))) + (t0-1 (the int (+ (* (the-as uint 320) (-> arg1 class icon-xy y)) 8))) + (a1-65 (+ a3-1 312)) + (a2-14 (+ t0-1 312)) + ) + (set! (-> (the-as (pointer uint128) v1-122) 0) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-122) 1) (-> this sprite-tmpl quad 1)) + (let ((t1-3 (the-as object (&+ v1-122 32)))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 x) (the-as int (-> a0-78 r))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 y) (the-as int (-> a0-78 g))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 z) (the-as int (-> a0-78 b))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 w) (the-as int (-> a0-78 a))) + ) + (let ((a0-80 (the-as (inline-array vector4w) (&+ v1-122 48)))) + (set! (-> a0-80 0 x) a3-1) + (set! (-> a0-80 0 y) t0-1) + (set! (-> a0-80 0 z) 0) + (set! (-> a0-80 0 w) 0) + ) + (let ((a0-81 (the-as object (&+ v1-122 64)))) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 w) 0) + ) + (let ((a0-82 (the-as (inline-array vector4w) (&+ v1-122 80)))) + (set! (-> a0-82 0 x) a1-65) + (set! (-> a0-82 0 y) a2-14) + (set! (-> a0-82 0 z) 0) + (set! (-> a0-82 0 w) 0) + ) + ) + ) + (let ((v1-123 (the-as object (&+ v1-122 96)))) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 w) 0) + ) + ) + (&+! (-> arg0 buf base) 112) + ) + ) + ) + (none) + ) + +(defmethod draw-1 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) + (local-vars (v1-35 uint128)) + (let ((gp-0 (new 'stack-no-clear 'minimap-draw-work))) + (set! (-> gp-0 buf) arg0) + (set! (-> gp-0 draw-pos quad) (-> arg1 quad)) + (set! (-> gp-0 justify-right) arg2) + (set! (-> gp-0 global-flags) (the-as uint 0)) + (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (logior! (-> gp-0 global-flags) #x40000) + ) + (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (logior! (-> gp-0 global-flags) #x100000) + ) + (if (= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (logior! (-> gp-0 global-flags) #x80000) + ) + (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (logior! (-> gp-0 global-flags) #x200000) + ) + (sub-draw-1-1 this gp-0) + (sub-draw-1-2 this gp-0) + (when #t + (let ((s1-0 (-> gp-0 buf base)) + (s3-4 (get-texture mini-map-icons level-default-minimap)) + (s2-0 (-> *level* level-default texture-mask 8)) + ) + (cond + (s3-4 + (set! (-> (the-as (pointer uint128) s1-0) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s1-0) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s1-0) 2)) s3-4) + (&+! (-> gp-0 buf base) 112) + (let ((v1-34 (-> s2-0 mask quad)) + (a0-15 (-> s3-4 masks data 0 mask quad)) + ) + (.por v1-35 v1-34 a0-15) + ) + (set! (-> s2-0 mask quad) v1-35) + ) + (else + (format *stdebug* "minimap: mini-map-icons texture is #f~%") + ) + ) + ) + ) + (let ((s3-5 (-> *minimap* engine alive-list))) + (while s3-5 + (let ((a2-5 s3-5)) + (draw-connection this gp-0 a2-5) + ) + (set! s3-5 (-> s3-5 next)) + ) + ) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (f30-0 (-> *video-params* relative-x-scale)) + ) + (when *target* + (vector-z-quaternion! s0-0 (-> *target* control quat)) + (vector-xz-normalize! s0-0 1.0) + (set! (-> s0-0 y) 0.0) + (set! (-> s0-0 w) 0.0) + (vector-matrix*! s0-0 s0-0 (-> gp-0 mat)) + (let ((s3-6 (-> arg0 base)) + (s2-1 (get-texture map-target-marker level-default-minimap)) + (s1-1 (new 'stack-no-clear 'matrix)) + (v1-48 (the int (* 56.0 f30-0))) + ) + (when s2-1 + (set-vector! (-> s1-1 rvec) (* (-> s0-0 z) f30-0) 0.0 (- (-> s0-0 x)) 0.0) + (set-vector! (-> s1-1 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> s1-1 fvec) (* (-> s0-0 x) f30-0) 0.0 (-> s0-0 z) 1.0) + (set-vector! (-> s1-1 trans) 0.0 0.0 (the float (+ (-> gp-0 draw-pos y) 1896)) 1.0) + (if (-> gp-0 justify-right) + (set! (-> s1-1 trans x) (the float (+ (- 1792 v1-48) (-> gp-0 draw-pos x)))) + (set! (-> s1-1 trans x) (the float (+ v1-48 1792 (-> gp-0 draw-pos x)))) + ) + (let ((f0-29 7.0)) + (set-vector! (-> gp-0 corner 0) 0.0 0.0 (- f0-29) 1.0) + (set-vector! (-> gp-0 corner 1) f0-29 0.0 0.0 1.0) + (set-vector! (-> gp-0 corner 2) (- f0-29) 0.0 0.0 1.0) + (set-vector! (-> gp-0 corner 3) 0.0 0.0 f0-29 1.0) + ) + (vector-matrix*! (the-as vector (-> gp-0 corner)) (the-as vector (-> gp-0 corner)) s1-1) + (vector-matrix*! (-> gp-0 corner 1) (-> gp-0 corner 1) s1-1) + (vector-matrix*! (-> gp-0 corner 2) (-> gp-0 corner 2) s1-1) + (vector-matrix*! (-> gp-0 corner 3) (-> gp-0 corner 3) s1-1) + (set! (-> (the-as (pointer uint128) s3-6) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-6) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-6) 2)) s2-1) + (set! (-> (the-as (pointer uint128) s3-6) 7) (-> this draw-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-6) 8) (-> this draw-tmpl quad 1)) + (let ((v1-64 (the-as (inline-array vector4w) (&+ s3-6 144)))) + (set! (-> v1-64 0 x) 0) + (set! (-> v1-64 0 y) 255) + (set! (-> v1-64 0 z) 255) + (set! (-> v1-64 0 w) 128) + ) + (let ((v1-65 (the-as (inline-array vector4w) (&+ s3-6 160)))) + (set! (-> v1-65 0 x) 0) + (set! (-> v1-65 0 y) 0) + (set! (-> v1-65 0 z) #xffffff) + (set! (-> v1-65 0 w) 0) + ) + (let ((v1-66 (the-as object (&+ s3-6 176)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 x) (the int (* 16.0 (-> gp-0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 y) (the int (* 16.0 (-> gp-0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 w) 0) + ) + (let ((v1-67 (the-as object (&+ s3-6 192)))) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 x) 256) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 y) 0) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 w) 0) + ) + (let ((v1-68 (the-as object (&+ s3-6 208)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 x) (the int (* 16.0 (-> gp-0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 y) (the int (* 16.0 (-> gp-0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 w) 0) + ) + (let ((v1-69 (the-as (inline-array vector4w) (&+ s3-6 224)))) + (set! (-> v1-69 0 x) 0) + (set! (-> v1-69 0 y) 256) + (set! (-> v1-69 0 z) #xffffff) + (set! (-> v1-69 0 w) 0) + ) + (let ((v1-70 (the-as object (&+ s3-6 240)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 x) (the int (* 16.0 (-> gp-0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 y) (the int (* 16.0 (-> gp-0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 w) 0) + ) + (let ((v1-71 (the-as object (&+ s3-6 256)))) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 x) 256) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 y) 256) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 w) 0) + ) + (let ((v1-72 (the-as object (&+ s3-6 272)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 x) (the int (* 16.0 (-> gp-0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 y) (the int (* 16.0 (-> gp-0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 w) 0) + ) + (&+! (-> arg0 base) 288) + ) + ) + ) + ) + (if (not (paused?)) + (+! (-> this goal-time) (* 14.0 (seconds-per-frame))) + ) + (reset-display-gs-state *display* (-> gp-0 buf)) + ) + 0 + (none) + ) + +(defmethod draw-sprite2 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) + (local-vars (v1-47 uint128) (a0-8 uint128) (sv-176 int) (sv-192 int)) + (when (-> this race-tex) + (let ((s5-0 (new 'stack-no-clear 'minimap-draw-work))) + (set! (-> s5-0 buf) arg0) + (set! (-> s5-0 draw-pos quad) (-> arg1 quad)) + (set! (-> s5-0 justify-right) arg2) + (let ((v1-4 (the-as object (-> s5-0 buf base))) + (s3-0 (-> this race-tex)) + (s2-0 (-> this race-level texture-mask 8)) + ) + (when s3-0 + (set! (-> (the-as adgif-shader v1-4) quad 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as adgif-shader v1-4) quad 1 quad) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as adgif-shader v1-4) miptbp1)) s3-0) + (&+! (-> s5-0 buf base) 112) + (let ((v1-8 (-> s2-0 mask quad)) + (a0-7 (-> s3-0 masks data 0 mask quad)) + ) + (.por a0-8 v1-8 a0-7) + ) + (set! (-> s2-0 mask quad) a0-8) + ) + ) + (let* ((f0-0 (-> *video-params* relative-x-scale)) + (s3-1 (-> arg0 base)) + (v1-11 (the int (* 128.0 f0-0))) + ) + 0 + 0 + (let ((s0-0 (* (+ (-> s5-0 draw-pos y) 1840) 16)) + (s2-1 (* (+ (-> s5-0 draw-pos y) 1968) 16)) + (s1-0 (-> s5-0 draw-pos z)) + ) + (cond + ((-> s5-0 justify-right) + (set! sv-176 (* (+ (- 1792 v1-11) (-> s5-0 draw-pos x)) 16)) + (set! sv-192 (* (+ (-> s5-0 draw-pos x) 1792) 16)) + sv-192 + ) + (else + (set! sv-176 (* (+ (-> s5-0 draw-pos x) 1792) 16)) + (set! sv-192 (* (+ v1-11 1792 (-> s5-0 draw-pos x)) 16)) + sv-192 + ) + ) + (set! (-> s5-0 draw-pos x) sv-176) + (set! (-> s5-0 draw-pos y) s0-0) + (set! (-> (the-as (pointer uint128) s3-1) 0) (-> this sprite2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-1) 1) (-> this sprite2-tmpl quad 1)) + (let ((v1-26 (-> this color quad))) + (set! (-> (the-as (pointer uint128) (&+ s3-1 32))) v1-26) + ) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (let ((v1-28 (the-as object (&+ s3-1 48)))) + (set! (-> (the-as (inline-array vector) v1-28) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-28) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-28) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-28) 0 w) 0.0) + ) + (let ((a0-25 (the-as object (&+ s3-1 64)))) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 x) sv-192) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 y) s0-0) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 w) 0) + ) + (let ((v1-30 (the-as object (&+ s3-1 80)))) + (set! (-> (the-as (inline-array vector) v1-30) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-30) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-30) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-30) 0 w) 0.0) + ) + (let ((v1-31 (the-as object (&+ s3-1 96)))) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 x) sv-176) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 y) s2-1) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 w) 0) + ) + ) + (else + (let ((v1-32 (the-as object (&+ s3-1 48)))) + (set! (-> (the-as (inline-array vector) v1-32) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-32) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-32) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-32) 0 w) 0.0) + ) + (let ((a0-31 (the-as object (&+ s3-1 64)))) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 x) sv-176) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 y) s0-0) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 w) 0) + ) + (let ((v1-34 (the-as object (&+ s3-1 80)))) + (set! (-> (the-as (inline-array vector) v1-34) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 w) 0.0) + ) + (let ((v1-35 (the-as object (&+ s3-1 96)))) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 x) sv-192) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 y) s2-1) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 w) 0) + ) + ) + ) + ) + ) + (&+! (-> arg0 base) 112) + (let ((s2-2 (the-as object (-> s5-0 buf base))) + (s4-1 (get-texture map-target-marker level-default-minimap)) + (s3-2 (-> this ctywide texture-mask 8)) + ) + (when s4-1 + (set! (-> (the-as (pointer uint128) s2-2)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as adgif-shader s2-2) quad 1 quad) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as adgif-shader s2-2) miptbp1)) s4-1) + (&+! (-> s5-0 buf base) 112) + (let ((v1-46 (-> s3-2 mask quad)) + (a0-39 (-> s4-1 masks data 0 mask quad)) + ) + (.por v1-47 v1-46 a0-39) + ) + (set! (-> s3-2 mask quad) v1-47) + ) + ) + (let ((f30-0 (the float (/ (-> s5-0 draw-pos x) 16))) + (f28-0 (the float (/ (-> s5-0 draw-pos y) 16))) + (s4-2 (the-as connection-minimap #f)) + ) + (let ((s3-3 (-> *minimap* engine alive-list))) + (while s3-3 + (let ((s2-3 s3-3)) + (when (logtest? (-> s2-3 class flags) (minimap-flag racer)) + (if (string= (-> s2-3 class name) "racer-target") + (set! s4-2 s2-3) + (draw-racer-1 this s5-0 s2-3 (-> this race-scale) f30-0 f28-0) + ) + ) + ) + (set! s3-3 (-> s3-3 next)) + ) + ) + (if s4-2 + (draw-racer-1 this s5-0 s4-2 (-> this race-scale) f30-0 f28-0) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-race-texture ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) + (set! (-> this race-tex) arg0) + (set! (-> this race-scale) arg1) + (set! (-> this race-level) arg2) + 0 + (none) + ) + +(defmethod set-race-corner ((this minimap) (arg0 float) (arg1 float)) + (set! (-> this race-corner x) arg0) + (set! (-> this race-corner z) arg1) + 0 + (none) + ) + +(defmethod set-color ((this minimap) (arg0 vector)) + (set! (-> this color quad) (-> arg0 quad)) + 0 + (none) + ) + +(defmethod minimap-class-node-method-9 ((this minimap-class-node)) + (let ((gp-0 (-> this flags))) + (when (and (logtest? (minimap-flag local-only) gp-0) (not (logtest? (minimap-flag transport) gp-0))) + (cond + ((and (logtest? (minimap-flag ctywide) gp-0) + (!= (status-of-level-and-borrows *level* 'ctywide 'ignore-borrow) 'active) + ) + (return #f) + ) + ((and (logtest? (minimap-flag wasall) gp-0) + (!= (status-of-level-and-borrows *level* 'wasall 'ignore-borrow) 'active) + ) + (return #f) + ) + ((and (logtest? (minimap-flag waswide) gp-0) + (!= (status-of-level-and-borrows *level* 'waswide 'ignore-borrow) 'active) + ) + (return #f) + ) + ((and (logtest? (minimap-flag desert) gp-0) + (!= (status-of-level-and-borrows *level* 'desert 'ignore-borrow) 'active) + ) + (return #f) + ) + ) + ) + ) + #t + ) diff --git a/goal_src/jak3/engine/ui/progress/progress-draw.gc b/goal_src/jak3/engine/ui/progress/progress-draw.gc index 14c9138d3d..dc91c0aee2 100644 --- a/goal_src/jak3/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak3/engine/ui/progress/progress-draw.gc @@ -2434,21 +2434,17 @@ ) (defmethod draw-option ((this menu-sound-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) - (let* ((gp-0 arg0) - (s5-0 arg1) - (s4-0 arg2) - (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> gp-0 menu-transition))))) - ) - (set! (-> s5-0 alpha) f30-0) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (set! (-> arg1 alpha) f30-0) (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 gp-0 s5-0) + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) ) (else (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) (progress-method-52 - gp-0 - s5-0 + arg0 + arg1 (lookup-text! *common-text* (-> this name) #f) f30-0 (-> this offset-y) @@ -2459,8 +2455,8 @@ ) ) ) - (if (zero? s4-0) - (progress-method-46 gp-0 s5-0 f30-0 30) + (if (zero? arg2) + (progress-method-46 arg0 arg1 f30-0 30) ) ) 0 @@ -2469,99 +2465,94 @@ (defmethod draw-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (s5-0 int)) - (let* ((s3-0 arg0) - (gp-0 arg1) - (s2-0 arg2) - (s1-0 arg3) - (f28-0 (fmax 0.0 (* 2.0 (- 0.5 (-> s3-0 menu-transition))))) - ) - (let ((v1-2 gp-0)) + (let ((f28-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (let ((v1-2 arg1)) (set! (-> v1-2 scale) 0.65) ) - (set! (-> gp-0 alpha) f28-0) - (let ((a0-2 gp-0)) + (set! (-> arg1 alpha) f28-0) + (let ((a0-2 arg1)) (set! (-> a0-2 flags) (font-flags kerning middle large)) ) (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 s3-0 gp-0) + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) ) ((begin - (progress-method-38 s3-0 gp-0 (-> this offset-y)) + (progress-method-38 arg0 arg1 (-> this offset-y)) (set! s5-0 (-> *setting-control* user-default stereo-mode)) - s1-0 + arg3 ) (let ((f30-2 (fmax (fmax - (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-mono) #f) gp-0) length) - (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-stereo) #f) gp-0) length) + (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-mono) #f) arg1) length) + (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-stereo) #f) arg1) length) ) - (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-surround) #f) gp-0) length) + (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-surround) #f) arg1) length) ) ) ) - (let ((a0-12 gp-0)) + (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-34)) ) - (progress-method-40 s3-0 gp-0 (the int (+ -1.0 (-> gp-0 origin y))) 42 f28-0) + (progress-method-40 arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) 42 f28-0) (let ((s3-1 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) - (s3-1 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s3-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) - (+! (-> gp-0 origin y) 22.0) - (let ((v1-23 gp-0)) + (+! (-> arg1 origin y) 22.0) + (let ((v1-23 arg1)) (set! (-> v1-23 scale) 0.5) ) - (let ((a0-19 gp-0)) + (let ((a0-19 arg1)) (set! (-> a0-19 color) (font-color font-color-33)) ) - (let ((a0-20 gp-0)) + (let ((a0-20 arg1)) (set! (-> a0-20 flags) (font-flags kerning middle large)) ) (print-game-text (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f) - gp-0 + arg1 #f 44 (bucket-id hud-draw-hud-alpha) ) - (let ((a0-23 gp-0)) + (let ((a0-23 arg1)) (set! (-> a0-23 color) (font-color font-color-32)) ) - (set! (-> gp-0 origin x) (- (-> gp-0 origin x) (the float (the int (* 0.5 f30-2))))) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (the int (* 0.5 f30-2))))) (let ((s5-1 print-game-text)) (format (clear *temp-string*) "~33L~C" 163) - (s5-1 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s5-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) - (+! (-> gp-0 origin x) (the float (the int f30-2))) + (+! (-> arg1 origin x) (the float (the int f30-2))) ) (let ((s5-2 print-game-text)) (format (clear *temp-string*) "~33L~C" 161) - (s5-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s5-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) (else - (if (= (-> s3-0 option-index) s2-0) - (progress-method-40 s3-0 gp-0 (the int (-> gp-0 origin y)) 21 f28-0) + (if (= (-> arg0 option-index) arg2) + (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 21 f28-0) ) (let ((s3-2 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) - (s3-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s3-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) - (+! (-> gp-0 origin y) 22.0) - (let ((v1-38 gp-0)) + (+! (-> arg1 origin y) 22.0) + (let ((v1-38 arg1)) (set! (-> v1-38 scale) 0.5) ) - (let ((a0-36 gp-0)) + (let ((a0-36 arg1)) (set! (-> a0-36 color) (font-color font-color-32)) ) - (let ((a0-37 gp-0)) + (let ((a0-37 arg1)) (set! (-> a0-37 flags) (font-flags kerning middle large)) ) (print-game-text (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f) - gp-0 + arg1 #f 44 (bucket-id hud-draw-hud-alpha) @@ -2574,39 +2565,31 @@ ) (defmethod draw-option ((this menu-picture-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) - (let ((s5-0 arg1) - (s4-0 arg2) - (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) - ) - (set! (-> s5-0 alpha) f30-0) - (let* ((a0-1 arg0) - (t9-0 (method-of-object a0-1 progress-method-33)) - (a1-1 (-> *progress-work* body)) - ) - (t9-0 a0-1 a1-1) - (cond - ((not (draw *bigmap* (the-as int a1-1) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 arg0 s5-0) - ) - (else - (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) - (progress-method-52 - arg0 - s5-0 - (lookup-text! *common-text* (-> this name) #f) - f30-0 - (-> this offset-y) - 0.9 - f28-0 - (the-as float #f) - ) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (set! (-> arg1 alpha) f30-0) + (progress-method-33 arg0 (-> *progress-work* body)) + (cond + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) + ) + (else + (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) + (progress-method-52 + arg0 + arg1 + (lookup-text! *common-text* (-> this name) #f) + f30-0 + (-> this offset-y) + 0.9 + f28-0 + (the-as float #f) ) ) ) ) - (when (zero? s4-0) + (when (zero? arg2) (let ((s4-1 (get-scissor-stack-top arg0))) - (progress-method-46 arg0 s5-0 f30-0 1520) + (progress-method-46 arg0 arg1 f30-0 1520) (draw-icon-array! (-> *progress-icon-arrays* 75) 256 @@ -2762,62 +2745,59 @@ (sv-176 (function string font-context symbol int bucket-id float)) (sv-192 (function _varargs_ object)) ) - (let* ((s5-0 arg0) - (gp-0 arg1) - (s4-0 arg2) - (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> s5-0 menu-transition))))) - (f28-0 (if (= (-> s5-0 current) 'select-save-title) - 0.2 - 0.25 - ) - ) - (s3-0 *progress-work*) - (f24-0 (-> *video-params* relative-x-scale)) - ) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (f28-0 (if (= (-> arg0 current) 'select-save-title) + 0.2 + 0.25 + ) + ) + (s3-0 *progress-work*) + (f24-0 (-> *video-params* relative-x-scale)) + ) (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 s5-0 gp-0) + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) ) (else - (set! (-> gp-0 alpha) f30-0) - (let ((v1-8 gp-0)) + (set! (-> arg1 alpha) f30-0) + (let ((v1-8 arg1)) (set! (-> v1-8 scale) 0.6) ) - (progress-method-33 s5-0 (-> s3-0 body)) - (let* ((s3-1 (get-scissor-stack-top s5-0)) + (progress-method-33 arg0 (-> s3-0 body)) + (let* ((s3-1 (get-scissor-stack-top arg0)) (s0-0 (new 'stack 'hud-box)) (f0-4 (* (- (-> s3-1 w) (-> s3-1 y)) f28-0)) - (f26-0 (+ (-> s3-1 y) (* f0-4 (the float s4-0)))) + (f26-0 (+ (-> s3-1 y) (* f0-4 (the float arg2)))) (f28-1 (+ f26-0 f0-4)) (s1-0 (the int (+ (-> s3-1 x) (* 0.7 (- (-> s3-1 z) (-> s3-1 x))) (* -48.0 f24-0)))) ) (set! sv-160 (the int (+ 32.0 (-> s3-1 y)))) (let ((s2-0 *progress-save-info*)) - (let ((v1-16 gp-0) + (let ((v1-16 arg1) (f1-12 (+ 10.0 (-> s3-1 x))) - (f2-13 (+ f26-0 (* 0.5 (- f0-4 (* 32.0 (-> gp-0 scale)))))) + (f2-13 (+ f26-0 (* 0.5 (- f0-4 (* 32.0 (-> arg1 scale)))))) ) (set! (-> v1-16 origin x) f1-12) (set! (-> v1-16 origin y) f2-13) ) - (set! (-> gp-0 height) f0-4) - (let ((a0-11 gp-0)) + (set! (-> arg1 height) f0-4) + (let ((a0-11 arg1)) (set! (-> a0-11 flags) (font-flags kerning large)) ) (when (and s2-0 (= (-> s2-0 formatted) 1) (= (-> s2-0 inited) 1)) (cond - ((= (-> s2-0 file s4-0 present) 1) + ((= (-> s2-0 file arg2 present) 1) (set! sv-48 print-game-text) (set! sv-64 format) (set! sv-80 (clear *temp-string*)) (set! sv-96 "~S ~D") (let ((a2-2 (lookup-text! *common-text* (text-id text-0073) #f)) - (a3-1 (+ s4-0 1)) + (a3-1 (+ arg2 1)) ) (sv-64 sv-80 sv-96 a2-2 a3-1) ) (let ((a0-21 *temp-string*) - (a1-6 gp-0) + (a1-6 arg1) (a2-3 #f) (a3-2 44) (t0-1 579) @@ -2825,10 +2805,10 @@ (sv-48 a0-21 a1-6 a2-3 a3-2 (the-as bucket-id t0-1)) ) ) - ((zero? (-> s2-0 file s4-0 present)) + ((zero? (-> s2-0 file arg2 present)) (set! sv-112 print-game-text) (let ((a0-23 (lookup-text! *common-text* (text-id progress-empty) #f)) - (a1-8 gp-0) + (a1-8 arg1) (a2-5 #f) (a3-3 44) (t0-2 579) @@ -2837,8 +2817,8 @@ ) ) ) - (when (= s4-0 (-> s5-0 option-index)) - (let ((v1-39 gp-0)) + (when (= arg2 (-> arg0 option-index)) + (let ((v1-39 arg1)) (set! (-> v1-39 scale) 0.8) ) (set! sv-128 (-> *display* frames (-> *display* on-screen) global-buf)) @@ -2882,9 +2862,9 @@ ) ) ) - (when (= (-> s2-0 file s4-0 present) 1) - (when (= s4-0 (-> s5-0 option-index)) - (let* ((a0-49 (-> *progress-icon-arrays* (-> s2-0 file s4-0 level-index))) + (when (= (-> s2-0 file arg2 present) 1) + (when (= arg2 (-> arg0 option-index)) + (let* ((a0-49 (-> *progress-icon-arrays* (-> s2-0 file arg2 level-index))) (t9-16 (method-of-object a0-49 draw-icon-array!)) (a3-5 1.0) (t0-3 1.0) @@ -2893,22 +2873,22 @@ ) (t9-16 a0-49 s1-0 sv-160 a3-5 t0-3 (the-as rgba t1-0) t2-0) ) - (let ((v1-84 gp-0)) + (let ((v1-84 arg1)) (set! (-> v1-84 scale) 0.6) ) - (let ((a0-51 gp-0)) + (let ((a0-51 arg1)) (set! (-> a0-51 color) (font-color font-color-32)) ) - (progress-method-38 s5-0 gp-0 0.675) - (let ((a0-53 gp-0)) + (progress-method-38 arg0 arg1 0.675) + (let ((a0-53 arg1)) (set! (-> a0-53 flags) (font-flags kerning right large)) ) - (let* ((v1-91 (-> s2-0 file s4-0 game-time0)) - (v1-92 (logior (shl (-> s2-0 file s4-0 game-time1) 32) v1-91)) + (let* ((v1-91 (-> s2-0 file arg2 game-time0)) + (v1-92 (logior (shl (-> s2-0 file arg2 game-time1) 32) v1-91)) (s1-1 (/ (the-as int v1-92) #x107ac0)) (s0-1 (/ (mod (the-as int v1-92) #x107ac0) #x4650)) ) - (set! (-> gp-0 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) + (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) (set! sv-176 print-game-text) (set! sv-192 format) (let ((a0-63 (clear *temp-string*)) @@ -2918,7 +2898,7 @@ ) ) (let ((a0-64 *temp-string*) - (a1-17 gp-0) + (a1-17 arg1) (a2-10 #f) (a3-7 44) (t0-4 579) @@ -2928,67 +2908,67 @@ (draw-icon-array! (-> *progress-icon-arrays* 66) (the int (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (-> gp-0 origin y)) + (the int (-> arg1 origin y)) 0.65 0.65 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (set! (-> gp-0 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) + (set! (-> arg1 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) (let ((s1-2 print-game-text)) - (format (clear *temp-string*) "~D%" (the int (-> s2-0 file s4-0 completion-percentage))) - (s1-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (format (clear *temp-string*) "~D%" (the int (-> s2-0 file arg2 completion-percentage))) + (s1-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (draw-icon-array! (-> *progress-icon-arrays* 67) (the int (+ -8.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (-> gp-0 origin y)) + (the int (-> arg1 origin y)) 0.7 0.7 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (progress-method-38 s5-0 gp-0 0.83) - (set! (-> gp-0 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) + (progress-method-38 arg0 arg1 0.83) + (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) (let ((s1-3 print-game-text)) - (format (clear *temp-string*) "~D" (the int (-> s2-0 file s4-0 skill-count))) - (s1-3 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (format (clear *temp-string*) "~D" (the int (-> s2-0 file arg2 skill-count))) + (s1-3 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (draw-icon-array! (-> *progress-icon-arrays* 68) (the int (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (+ -2.0 (-> gp-0 origin y))) + (the int (+ -2.0 (-> arg1 origin y))) 0.7 0.7 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (set! (-> gp-0 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) + (set! (-> arg1 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) (let ((s1-4 print-game-text)) - (format (clear *temp-string*) "~D" (the int (-> s2-0 file s4-0 gem-count))) - (s1-4 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (format (clear *temp-string*) "~D" (the int (-> s2-0 file arg2 gem-count))) + (s1-4 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (draw-icon-array! (-> *progress-icon-arrays* 69) (the int (+ -14.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (-> gp-0 origin y)) + (the int (-> arg1 origin y)) 0.5 0.5 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (when (logtest? (-> s2-0 file s4-0 secrets) 1) - (let ((a0-79 gp-0)) + (when (logtest? (-> s2-0 file arg2 secrets) 1) + (let ((a0-79 arg1)) (set! (-> a0-79 flags) (font-flags kerning middle large)) ) - (set! (-> gp-0 origin x) (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x))))) - (set! (-> gp-0 origin y) (+ 8.0 (-> s3-1 y))) - (let ((v1-140 gp-0)) + (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x))))) + (set! (-> arg1 origin y) (+ 8.0 (-> s3-1 y))) + (let ((v1-140 arg1)) (set! (-> v1-140 width) (* 0.6 (- (-> s3-1 z) (-> s3-1 x)))) ) (let ((s3-2 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-secrets-hero-mode) #f)) - (s3-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s3-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ) @@ -2996,17 +2976,17 @@ ) ) ) - (progress-method-34 s5-0) - (when (zero? s4-0) - (case (-> s5-0 current) + (progress-method-34 arg0) + (when (zero? arg2) + (case (-> arg0 current) (('select-load) - (progress-method-46 s5-0 gp-0 f30-0 45) + (progress-method-46 arg0 arg1 f30-0 45) ) (('select-save-hero) - (progress-method-46 s5-0 gp-0 f30-0 2198) + (progress-method-46 arg0 arg1 f30-0 2198) ) (else - (progress-method-46 s5-0 gp-0 f30-0 44) + (progress-method-46 arg0 arg1 f30-0 44) ) ) ) @@ -4640,448 +4620,444 @@ (sv-400 (function _varargs_ object)) (sv-416 (function _varargs_ object)) ) - (let ((gp-0 arg0) - (s5-0 arg1) - ) - (set! sv-16 (fmax 0.0 (* 2.0 (- 0.5 (-> gp-0 menu-transition))))) - (set! sv-24 (the int (-> *game-info* skill))) - (set! (-> s5-0 alpha) sv-16) - (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 gp-0 s5-0) - ) - (else - (new 'stack 'hud-sprite) - (let ((s2-0 (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x11)))) - (when (and s2-0 (not (-> this available-title))) - (progress-method-33 gp-0 (-> *progress-work* sub-header)) - (let ((s3-0 (get-scissor-stack-top gp-0))) - (let* ((f0-5 0.64) - (f30-0 (+ 10.0 (* (the float (-> s2-0 w)) f0-5 (-> *video-params* relative-x-scale)))) - ) - (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) - (+ (- (- -20.0 f30-0) (-> s3-0 x)) (-> s3-0 z)) - (set! t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) - (draw-icon-array! - (-> *progress-icon-arrays* 68) - (the int (+ 10.0 (-> s3-0 x))) - (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) - f0-5 - f0-5 - (the-as rgba t1-0) - sv-16 - ) + (set! sv-16 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (set! sv-24 (the int (-> *game-info* skill))) + (set! (-> arg1 alpha) sv-16) + (cond + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) + ) + (else + (new 'stack 'hud-sprite) + (let ((s2-0 (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x11)))) + (when (and s2-0 (not (-> this available-title))) + (progress-method-33 arg0 (-> *progress-work* sub-header)) + (let ((s3-0 (get-scissor-stack-top arg0))) + (let* ((f0-5 0.64) + (f30-0 (+ 10.0 (* (the float (-> s2-0 w)) f0-5 (-> *video-params* relative-x-scale)))) + ) + (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) + (+ (- (- -20.0 f30-0) (-> s3-0 x)) (-> s3-0 z)) + (set! t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) + (draw-icon-array! + (-> *progress-icon-arrays* 68) + (the int (+ 10.0 (-> s3-0 x))) + (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) + f0-5 + f0-5 + (the-as rgba t1-0) + sv-16 ) - (let ((v1-26 s5-0)) - (set! (-> v1-26 height) 28.0) + ) + (let ((v1-26 arg1)) + (set! (-> v1-26 height) 28.0) + ) + (let ((a0-13 arg1)) + (set! (-> a0-13 flags) (font-flags kerning large)) + ) + (let ((f28-0 0.45)) + (let ((a0-14 arg1)) + (set! (-> a0-14 color) (font-color font-color-34)) ) - (let ((a0-13 s5-0)) - (set! (-> a0-13 flags) (font-flags kerning large)) - ) - (let ((f28-0 0.45)) - (let ((a0-14 s5-0)) - (set! (-> a0-14 color) (font-color font-color-34)) - ) - (cond - ((-> this buy-menu) - (let ((s2-1 format) - (s1-0 (clear *temp-string*)) - (s0-0 "x~D ~S") - ) - (set! sv-96 (-> *menu-secrets-array* (-> this selected-index) cost)) - (let ((a3-2 (lookup-text! *common-text* (text-id progress-secrets-price) #f))) - (s2-1 s1-0 s0-0 sv-96 a3-2) + (cond + ((-> this buy-menu) + (let ((s2-1 format) + (s1-0 (clear *temp-string*)) + (s0-0 "x~D ~S") ) + (set! sv-96 (-> *menu-secrets-array* (-> this selected-index) cost)) + (let ((a3-2 (lookup-text! *common-text* (text-id progress-secrets-price) #f))) + (s2-1 s1-0 s0-0 sv-96 a3-2) ) - (set! a0-19 *temp-string*) + ) + (set! a0-19 *temp-string*) + ) + (else + (let ((s2-2 format) + (s1-1 (clear *temp-string*)) + (s0-1 "x~D ~S") + ) + (set! sv-112 sv-24) + (let ((a3-3 (lookup-text! *common-text* (text-id progress-secrets-orbs-available) #f))) + (s2-2 s1-1 s0-1 sv-112 a3-3) + ) + ) + (set! a0-19 *temp-string*) + ) + ) + (let ((v1-42 arg1)) + (set! (-> v1-42 scale) f28-0) + ) + (let ((v1-43 arg1) + (f0-10 (+ (-> s3-0 x) f30-0)) + (f1-11 (+ (-> s3-0 y) (* 0.5 (- 28.0 (* 32.0 f28-0))))) + ) + (set! (-> v1-43 origin x) f0-10) + (set! (-> v1-43 origin y) f1-11) + ) + ) + ) + (print-game-text a0-19 arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (let ((a0-23 arg1)) + (set! (-> a0-23 flags) (font-flags kerning right large)) + ) + (set! (-> arg1 origin x) (+ -10.0 (-> s3-0 z))) + ) + (let ((s3-1 print-game-text)) + (let ((s2-3 format) + (s1-2 (clear *temp-string*)) + (s0-2 "~D/600 ~S") + ) + (set! sv-128 (the int (-> *game-info* skill-total))) + (let ((a3-5 (lookup-text! *common-text* (text-id progress-secrets-orbs-collected) #f))) + (s2-3 s1-2 s0-2 sv-128 a3-5) + ) + ) + (let ((a0-27 *temp-string*) + (a1-15 arg1) + (a2-9 #f) + (a3-6 44) + ) + (set! arg3 (the-as symbol 579)) + (s3-1 a0-27 a1-15 a2-9 a3-6 (the-as bucket-id arg3)) + ) + ) + (progress-method-34 arg0) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) 0.42) + ) + (cond + ((-> this available-title) + (progress-method-33 arg0 (-> *progress-work* body-footer)) + (progress-method-53 arg0 arg1) + (let ((a0-32 arg1)) + (set! (-> a0-32 color) (font-color font-color-32)) + ) + (let ((a0-33 arg1)) + (set! (-> a0-33 flags) (font-flags kerning middle middle-vert large)) + ) + (let ((s4-1 print-game-text)) + (let* ((s3-2 format) + (s2-4 (clear *temp-string*)) + (a0-35 *common-text*) + (t9-22 (method-of-object a0-35 lookup-text!)) + (a1-18 128) + (a2-10 #f) + ) + (s3-2 s2-4 (t9-22 a0-35 (the-as text-id a1-18) a2-10) (the-as none a2-10)) + ) + (s4-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (progress-method-34 arg0) + (progress-method-33 arg0 (-> *progress-work* footer)) + (let ((a0-40 arg1)) + (set! (-> a0-40 flags) (font-flags kerning middle large)) + ) + (progress-method-38 arg0 arg1 0.1) + (let ((a0-42 arg1)) + (set! (-> a0-42 color) (font-color font-color-33)) + ) + (let ((f0-16 (print-game-text + (lookup-text! *common-text* (text-id progress-continue) #f) + arg1 + #f + 32 + (bucket-id hud-draw-hud-alpha) + ) + ) + ) + (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) + ) + (progress-method-34 arg0) + ) + ((-> this buy-menu) + (progress-method-33 arg0 (-> *progress-work* body)) + (progress-method-38 arg0 arg1 0.45) + (progress-method-50 + arg0 + arg1 + (-> *menu-secrets-array* (-> this selected-index) name) + (text-id progress-secrets-buy) + (text-id progress-secrets-cancel) + #t + #t + 0.65 + ) + (let ((s4-3 *progress-work*)) + (progress-method-46 arg0 arg1 sv-16 84) + (progress-method-41 arg0 (-> s4-3 sub-header) (* 128.0 sv-16)) + ) + (progress-method-34 arg0) + ) + (else + (progress-method-33 arg0 (-> *progress-work* sub-body-footer)) + (let* ((s3-3 (get-scissor-stack-top arg0)) + (f22-0 (- (-> s3-3 w) (-> s3-3 y))) + (f30-1 (+ 10.0 (* 24.0 (-> *video-params* relative-x-scale) (-> arg1 scale)))) + (f28-1 (+ (- -10.0 (-> s3-3 x)) (-> s3-3 z))) + (s2-5 get-string-length) + ) + (let ((s1-3 format) + (s0-3 (clear *temp-string*)) + ) + (set! sv-144 "~32L~S~44L ~S") + (set! sv-160 (lookup-text! *common-text* (text-id progress-on) #f)) + (let ((a3-12 (lookup-text! *common-text* (text-id progress-off) #f))) + (s1-3 s0-3 sv-144 sv-160 a3-12 (the-as none arg3) (the-as none t1-0)) + ) + ) + (let* ((f0-27 (-> (s2-5 *temp-string* arg1) length)) + (f26-0 (- (- (- f28-1 f30-1) f0-27) f30-1)) + ) + (- f28-1 f26-0) + (let ((a0-60 arg1)) + (set! (-> a0-60 flags) (font-flags kerning large)) + ) + (let ((v1-100 arg1)) + (set! (-> v1-100 width) f26-0) + ) + (let ((s2-6 *menu-secrets-array*) + (s1-5 (max 0 (the int (-> this current-index)))) + ) + (let* ((a0-61 (-> s2-6 s1-5)) + (s0-4 (-> a0-61 name)) + ) + (case (secret-item-option-method-12 a0-61) + ((4) + (set! sv-192 "?????????") ) (else - (let ((s2-2 format) - (s1-1 (clear *temp-string*)) - (s0-1 "x~D ~S") + (set! sv-192 (lookup-text! *common-text* s0-4 #f)) + ) + ) + ) + (let ((s0-5 print-game-text)) + (set! sv-176 format) + (let ((a0-65 (clear *temp-string*)) + (a1-37 "~S") + ) + (sv-176 a0-65 a1-37 sv-192) + ) + (let ((f24-0 (s0-5 *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha)))) + (let ((f0-33 4.0) + (f1-25 (-> this current-index)) + ) + (set! (-> arg1 origin y) + (+ (- f0-33 (* f24-0 (- f1-25 (* (the float (the int (/ f1-25 1.0))) 1.0)))) (-> s3-3 y)) ) - (set! sv-112 sv-24) - (let ((a3-3 (lookup-text! *common-text* (text-id progress-secrets-orbs-available) #f))) - (s2-2 s1-1 s0-1 sv-112 a3-3) - ) - ) - (set! a0-19 *temp-string*) ) - ) - (let ((v1-42 s5-0)) - (set! (-> v1-42 scale) f28-0) - ) - (let ((v1-43 s5-0) - (f0-10 (+ (-> s3-0 x) f30-0)) - (f1-11 (+ (-> s3-0 y) (* 0.5 (- 28.0 (* 32.0 f28-0))))) - ) - (set! (-> v1-43 origin x) f0-10) - (set! (-> v1-43 origin y) f1-11) - ) - ) - ) - (print-game-text a0-19 s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) - (let ((a0-23 s5-0)) - (set! (-> a0-23 flags) (font-flags kerning right large)) - ) - (set! (-> s5-0 origin x) (+ -10.0 (-> s3-0 z))) - ) - (let ((s3-1 print-game-text)) - (let ((s2-3 format) - (s1-2 (clear *temp-string*)) - (s0-2 "~D/600 ~S") - ) - (set! sv-128 (the int (-> *game-info* skill-total))) - (let ((a3-5 (lookup-text! *common-text* (text-id progress-secrets-orbs-collected) #f))) - (s2-3 s1-2 s0-2 sv-128 a3-5) - ) - ) - (let ((a0-27 *temp-string*) - (a1-15 s5-0) - (a2-9 #f) - (a3-6 44) - ) - (set! arg3 (the-as symbol 579)) - (s3-1 a0-27 a1-15 a2-9 a3-6 (the-as bucket-id arg3)) - ) - ) - (progress-method-34 gp-0) - ) - ) - (let ((v1-52 s5-0)) - (set! (-> v1-52 scale) 0.42) - ) - (cond - ((-> this available-title) - (progress-method-33 gp-0 (-> *progress-work* body-footer)) - (progress-method-53 gp-0 s5-0) - (let ((a0-32 s5-0)) - (set! (-> a0-32 color) (font-color font-color-32)) - ) - (let ((a0-33 s5-0)) - (set! (-> a0-33 flags) (font-flags kerning middle middle-vert large)) - ) - (let ((s4-1 print-game-text)) - (let* ((s3-2 format) - (s2-4 (clear *temp-string*)) - (a0-35 *common-text*) - (t9-22 (method-of-object a0-35 lookup-text!)) - (a1-18 128) - (a2-10 #f) - ) - (s3-2 s2-4 (t9-22 a0-35 (the-as text-id a1-18) a2-10) (the-as none a2-10)) - ) - (s4-1 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) - ) - (progress-method-34 gp-0) - (progress-method-33 gp-0 (-> *progress-work* footer)) - (let ((a0-40 s5-0)) - (set! (-> a0-40 flags) (font-flags kerning middle large)) - ) - (progress-method-38 gp-0 s5-0 0.1) - (let ((a0-42 s5-0)) - (set! (-> a0-42 color) (font-color font-color-33)) - ) - (let ((f0-16 (print-game-text - (lookup-text! *common-text* (text-id progress-continue) #f) - s5-0 - #f - 32 - (bucket-id hud-draw-hud-alpha) - ) - ) - ) - (progress-method-40 gp-0 s5-0 (the int (+ -2.0 (-> s5-0 origin y))) (the int (+ 4.0 f0-16)) (-> s5-0 alpha)) - ) - (progress-method-34 gp-0) - ) - ((-> this buy-menu) - (progress-method-33 gp-0 (-> *progress-work* body)) - (progress-method-38 gp-0 s5-0 0.45) - (progress-method-50 - gp-0 - s5-0 - (-> *menu-secrets-array* (-> this selected-index) name) - (text-id progress-secrets-buy) - (text-id progress-secrets-cancel) - #t - #t - 0.65 - ) - (let ((s4-3 *progress-work*)) - (progress-method-46 gp-0 s5-0 sv-16 84) - (progress-method-41 gp-0 (-> s4-3 sub-header) (* 128.0 sv-16)) - ) - (progress-method-34 gp-0) - ) - (else - (progress-method-33 gp-0 (-> *progress-work* sub-body-footer)) - (let* ((s3-3 (get-scissor-stack-top gp-0)) - (f22-0 (- (-> s3-3 w) (-> s3-3 y))) - (f30-1 (+ 10.0 (* 24.0 (-> *video-params* relative-x-scale) (-> s5-0 scale)))) - (f28-1 (+ (- -10.0 (-> s3-3 x)) (-> s3-3 z))) - (s2-5 get-string-length) - ) - (let ((s1-3 format) - (s0-3 (clear *temp-string*)) - ) - (set! sv-144 "~32L~S~44L ~S") - (set! sv-160 (lookup-text! *common-text* (text-id progress-on) #f)) - (let ((a3-12 (lookup-text! *common-text* (text-id progress-off) #f))) - (s1-3 s0-3 sv-144 sv-160 a3-12 (the-as none arg3) (the-as none t1-0)) - ) - ) - (let* ((f0-27 (-> (s2-5 *temp-string* s5-0) length)) - (f26-0 (- (- (- f28-1 f30-1) f0-27) f30-1)) - ) - (- f28-1 f26-0) - (let ((a0-60 s5-0)) - (set! (-> a0-60 flags) (font-flags kerning large)) - ) - (let ((v1-100 s5-0)) - (set! (-> v1-100 width) f26-0) - ) - (let ((s2-6 *menu-secrets-array*) - (s1-5 (max 0 (the int (-> this current-index)))) - ) - (let* ((a0-61 (-> s2-6 s1-5)) - (s0-4 (-> a0-61 name)) - ) - (case (secret-item-option-method-12 a0-61) - ((4) - (set! sv-192 "?????????") - ) - (else - (set! sv-192 (lookup-text! *common-text* s0-4 #f)) - ) - ) - ) - (let ((s0-5 print-game-text)) - (set! sv-176 format) - (let ((a0-65 (clear *temp-string*)) - (a1-37 "~S") - ) - (sv-176 a0-65 a1-37 sv-192) - ) - (let ((f24-0 (s0-5 *temp-string* s5-0 #t 40 (bucket-id hud-draw-hud-alpha)))) - (let ((f0-33 4.0) - (f1-25 (-> this current-index)) - ) - (set! (-> s5-0 origin y) - (+ (- f0-33 (* f24-0 (- f1-25 (* (the float (the int (/ f1-25 1.0))) 1.0)))) (-> s3-3 y)) + (set! (-> arg1 height) f22-0) + (while (and (< (-> arg1 origin y) (-> s3-3 w)) (< s1-5 (-> *menu-secrets-array* length))) + (let ((s0-6 (-> s2-6 s1-5))) + (set! sv-208 (-> s2-6 s1-5 name)) + (set! sv-288 (secret-item-option-method-12 s0-6)) + (case sv-288 + ((4) + (set! sv-240 "?????????") + ) + (else + (let* ((a0-69 *common-text*) + (t9-51 (method-of-object a0-69 lookup-text!)) + (a2-27 #f) + ) + (set! sv-240 (t9-51 a0-69 sv-208 a2-27)) ) - ) - (set! (-> s5-0 height) f22-0) - (while (and (< (-> s5-0 origin y) (-> s3-3 w)) (< s1-5 (-> *menu-secrets-array* length))) - (let ((s0-6 (-> s2-6 s1-5))) - (set! sv-208 (-> s2-6 s1-5 name)) - (set! sv-288 (secret-item-option-method-12 s0-6)) - (case sv-288 - ((4) - (set! sv-240 "?????????") + ) + ) + (cond + ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0)) + (set! (-> arg1 origin x) (+ 10.0 (-> s3-3 x))) + (let ((v1-130 arg1)) + (set! (-> v1-130 width) f28-1) ) - (else - (let* ((a0-69 *common-text*) - (t9-51 (method-of-object a0-69 lookup-text!)) - (a2-27 #f) + (let ((a0-70 arg1)) + (set! (-> a0-70 color) (font-color font-color-34)) + ) + (let ((a0-71 arg1)) + (set! (-> a0-71 flags) (font-flags kerning large)) + ) + (let ((f22-1 (-> arg1 origin y)) + (s0-7 print-game-text) + ) + (set! sv-224 format) + (let ((a0-73 (clear *temp-string*)) + (a1-40 "~S") + ) + (sv-224 a0-73 a1-40 sv-240) + ) + (set! (-> arg1 origin y) (+ f22-1 (s0-7 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) + ) + ) + ((not (and (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf4)) + (or (nonzero? (-> *setting-control* user-current subtitle-language)) + (nonzero? (-> *setting-control* user-current language)) + (nonzero? (-> *setting-control* user-current audio-language)) + ) ) - (set! sv-240 (t9-51 a0-69 sv-208 a2-27)) ) - ) - ) - (cond - ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0)) - (set! (-> s5-0 origin x) (+ 10.0 (-> s3-3 x))) - (let ((v1-130 s5-0)) - (set! (-> v1-130 width) f28-1) - ) - (let ((a0-70 s5-0)) - (set! (-> a0-70 color) (font-color font-color-34)) - ) - (let ((a0-71 s5-0)) - (set! (-> a0-71 flags) (font-flags kerning large)) - ) - (let ((f22-1 (-> s5-0 origin y)) - (s0-7 print-game-text) + (set! (-> arg1 origin x) (+ (-> s3-3 x) f30-1)) + (let ((v1-147 arg1)) + (set! (-> v1-147 width) f26-0) + ) + (let ((v1-148 sv-288)) + (cond + ((or (= v1-148 4) (= v1-148 3)) + (let ((a0-79 arg1)) + (set! (-> a0-79 flags) (font-flags kerning large ff7)) + ) + (let ((v1-150 arg1)) + (set! (-> v1-150 color) (font-color font-color-44)) + ) + ) + ((zero? v1-148) + (let ((a0-81 arg1)) + (set! (-> a0-81 flags) (font-flags kerning large)) + ) + (let ((v1-152 arg1)) + (set! (-> v1-152 color) (font-color font-color-34)) + ) + ) + (else + (let ((a0-83 arg1)) + (set! (-> a0-83 flags) (font-flags kerning large)) + ) + (let ((v1-154 arg1)) + (set! (-> v1-154 color) (font-color font-color-32)) ) - (set! sv-224 format) - (let ((a0-73 (clear *temp-string*)) - (a1-40 "~S") - ) - (sv-224 a0-73 a1-40 sv-240) ) - (set! (-> s5-0 origin y) (+ f22-1 (s0-7 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)))) ) ) - ((not (and (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf4)) - (or (nonzero? (-> *setting-control* user-current subtitle-language)) - (nonzero? (-> *setting-control* user-current language)) - (nonzero? (-> *setting-control* user-current audio-language)) + (let ((f22-2 (-> arg1 origin y))) + (set! sv-256 print-game-text) + (set! sv-272 format) + (let ((a0-86 (clear *temp-string*)) + (a1-44 "~S") + (a2-30 sv-240) + ) + (sv-272 a0-86 a1-44 a2-30) + ) + (let* ((a0-87 *temp-string*) + (a1-45 arg1) + (a2-31 #f) + (a3-15 40) + (t0-9 579) + (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-9))) + ) + (when (not (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0))) + (set! (-> arg1 origin x) (+ (-> s3-3 x) f28-1)) + (let ((a0-88 arg1)) + (set! (-> a0-88 flags) (font-flags kerning right large)) + ) + (set! sv-352 (lookup-text! *common-text* (text-id progress-on) #f)) + (set! sv-368 (lookup-text! *common-text* (text-id progress-off) #f)) + (cond + ((or (zero? sv-288) (= sv-288 3)) + (set! sv-304 print-game-text) + (set! sv-320 format) + (let ((a0-93 (clear *temp-string*)) + (a1-48 "~d") + (a2-34 (-> s0-6 cost)) + ) + (sv-320 a0-93 a1-48 a2-34) + ) + (let ((a0-94 *temp-string*) + (a1-49 arg1) + (a2-35 #f) + (a3-16 40) + (t0-10 579) + ) + (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-10)) + ) + ) + ((= sv-288 1) + (cond + ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) + (let ((s0-8 print-game-text)) + (set! sv-336 format) + (let ((a0-97 (clear *temp-string*)) + (a1-50 "~32L~S~44L ~S") + ) + (sv-336 a0-97 a1-50 sv-352 sv-368 (the-as none t0-9) (the-as none t1-0)) ) + (s0-8 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) + ) ) - ) - (set! (-> s5-0 origin x) (+ (-> s3-3 x) f30-1)) - (let ((v1-147 s5-0)) - (set! (-> v1-147 width) f26-0) - ) - (let ((v1-148 sv-288)) - (cond - ((or (= v1-148 4) (= v1-148 3)) - (let ((a0-79 s5-0)) - (set! (-> a0-79 flags) (font-flags kerning large ff7)) - ) - (let ((v1-150 s5-0)) - (set! (-> v1-150 color) (font-color font-color-44)) - ) - ) - ((zero? v1-148) - (let ((a0-81 s5-0)) - (set! (-> a0-81 flags) (font-flags kerning large)) - ) - (let ((v1-152 s5-0)) - (set! (-> v1-152 color) (font-color font-color-34)) - ) - ) - (else - (let ((a0-83 s5-0)) - (set! (-> a0-83 flags) (font-flags kerning large)) - ) - (let ((v1-154 s5-0)) - (set! (-> v1-154 color) (font-color font-color-32)) - ) - ) - ) - ) - (let ((f22-2 (-> s5-0 origin y))) - (set! sv-256 print-game-text) - (set! sv-272 format) - (let ((a0-86 (clear *temp-string*)) - (a1-44 "~S") - (a2-30 sv-240) - ) - (sv-272 a0-86 a1-44 a2-30) - ) - (let* ((a0-87 *temp-string*) - (a1-45 s5-0) - (a2-31 #f) - (a3-15 40) - (t0-9 579) - (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-9))) - ) - (when (not (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0))) - (set! (-> s5-0 origin x) (+ (-> s3-3 x) f28-1)) - (let ((a0-88 s5-0)) - (set! (-> a0-88 flags) (font-flags kerning right large)) - ) - (set! sv-352 (lookup-text! *common-text* (text-id progress-on) #f)) - (set! sv-368 (lookup-text! *common-text* (text-id progress-off) #f)) - (cond - ((or (zero? sv-288) (= sv-288 3)) - (set! sv-304 print-game-text) - (set! sv-320 format) - (let ((a0-93 (clear *temp-string*)) - (a1-48 "~d") - (a2-34 (-> s0-6 cost)) - ) - (sv-320 a0-93 a1-48 a2-34) - ) - (let ((a0-94 *temp-string*) - (a1-49 s5-0) - (a2-35 #f) - (a3-16 40) - (t0-10 579) - ) - (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-10)) - ) - ) - ((= sv-288 1) - (cond - ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) - (let ((s0-8 print-game-text)) - (set! sv-336 format) - (let ((a0-97 (clear *temp-string*)) - (a1-50 "~32L~S~44L ~S") - ) - (sv-336 a0-97 a1-50 sv-352 sv-368 (the-as none t0-9) (the-as none t1-0)) - ) - (s0-8 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) - ) - ) - (else - (let ((s0-9 print-game-text)) - (set! sv-384 format) - (let ((a0-100 (clear *temp-string*)) - (a1-52 "~S") - (a2-38 sv-352) - ) - (sv-384 a0-100 a1-52 a2-38) - ) - (s0-9 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) + (else + (let ((s0-9 print-game-text)) + (set! sv-384 format) + (let ((a0-100 (clear *temp-string*)) + (a1-52 "~S") + (a2-38 sv-352) + ) + (sv-384 a0-100 a1-52 a2-38) ) + (s0-9 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) ) ) - ((= sv-288 2) - (cond - ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) - (let ((s0-10 print-game-text)) - (set! sv-400 format) - (let ((a0-104 (clear *temp-string*)) - (a1-54 "~44L~S ~32L~S~1L") - (a2-40 sv-352) - (a3-20 sv-368) - ) - (sv-400 a0-104 a1-54 a2-40 a3-20 (the-as none t0-9) (the-as none t1-0)) - ) - (s0-10 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + ((= sv-288 2) + (cond + ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) + (let ((s0-10 print-game-text)) + (set! sv-400 format) + (let ((a0-104 (clear *temp-string*)) + (a1-54 "~44L~S ~32L~S~1L") + (a2-40 sv-352) + (a3-20 sv-368) + ) + (sv-400 a0-104 a1-54 a2-40 a3-20 (the-as none t0-9) (the-as none t1-0)) ) + (s0-10 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) - (else - (let ((s0-11 print-game-text)) - (set! sv-416 format) - (let ((a0-107 (clear *temp-string*)) - (a1-56 "~S") - (a2-42 sv-368) - ) - (sv-416 a0-107 a1-56 a2-42) - ) - (s0-11 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + (else + (let ((s0-11 print-game-text)) + (set! sv-416 format) + (let ((a0-107 (clear *temp-string*)) + (a1-56 "~S") + (a2-42 sv-368) + ) + (sv-416 a0-107 a1-56 a2-42) ) + (s0-11 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) ) ) - ) + ) ) - (+! (-> s5-0 origin y) f20-0) - (if (= s1-5 (-> this selected-index)) - (progress-method-40 gp-0 s5-0 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) - ) ) + (+! (-> arg1 origin y) f20-0) + (if (= s1-5 (-> this selected-index)) + (progress-method-40 arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) + ) ) ) - ) + ) ) - (+! s1-5 1) ) - (seek! (-> this current-index) (-> this target-index) (* (/ 600.0 f24-0) (seconds-per-frame))) + (+! s1-5 1) ) + (seek! (-> this current-index) (-> this target-index) (* (/ 600.0 f24-0) (seconds-per-frame))) ) ) ) ) - (progress-method-34 gp-0) - (let ((s3-4 *progress-work*)) - (progress-method-46 gp-0 s5-0 sv-16 84) - (progress-method-41 gp-0 (-> s3-4 sub-header) (* 128.0 sv-16)) - (progress-method-42 gp-0 (-> s3-4 footer) (* 64.0 sv-16)) - (progress-method-41 gp-0 (-> s3-4 footer) (* 128.0 sv-16)) - ) - (progress-method-47 - gp-0 - s5-0 - (!= (-> this current-index) 0.0) - (!= (-> this current-index) (the float (+ (-> *menu-secrets-array* length) -1))) - ) + ) + (progress-method-34 arg0) + (let ((s3-4 *progress-work*)) + (progress-method-46 arg0 arg1 sv-16 84) + (progress-method-41 arg0 (-> s3-4 sub-header) (* 128.0 sv-16)) + (progress-method-42 arg0 (-> s3-4 footer) (* 64.0 sv-16)) + (progress-method-41 arg0 (-> s3-4 footer) (* 128.0 sv-16)) + ) + (progress-method-47 + arg0 + arg1 + (!= (-> this current-index) 0.0) + (!= (-> this current-index) (the float (+ (-> *menu-secrets-array* length) -1))) ) ) ) diff --git a/goal_src/jak3/engine/ui/progress/progress-h.gc b/goal_src/jak3/engine/ui/progress/progress-h.gc index f16acea717..b5a4c3fd8e 100644 --- a/goal_src/jak3/engine/ui/progress/progress-h.gc +++ b/goal_src/jak3/engine/ui/progress/progress-h.gc @@ -13,6 +13,7 @@ (define-extern progress-allowed? (function symbol)) (define-extern deactivate-progress (function none)) (define-extern hide-progress-screen (function none)) +(define-extern menu-secrets-notify-task-node-close (function game-task-node none)) ;; +++progress-icon-flags (defenum progress-icon-flags diff --git a/goal_src/jak3/engine/ui/progress/progress-static.gc b/goal_src/jak3/engine/ui/progress/progress-static.gc index 1cdcb26954..e373177f69 100644 --- a/goal_src/jak3/engine/ui/progress/progress-static.gc +++ b/goal_src/jak3/engine/ui/progress/progress-static.gc @@ -3251,7 +3251,7 @@ :icon (inventory-icon pass-wascity) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.225 0.05)) - :item (game-items pass-wascity) + :item (game-items pass-front-gate) ) ) ) @@ -3295,7 +3295,7 @@ :icon (inventory-icon pass-factory) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.825 0.05)) - :item (game-items pass-factory) + :item (game-items cypher-gliph) ) ) ) @@ -3324,7 +3324,7 @@ :icon (inventory-icon artifact-beam-generator) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.225 0.35)) - :item (game-items artifact-beam-generator) + :item (game-items artifact-av-generator) ) ) ) @@ -3339,7 +3339,7 @@ :icon (inventory-icon artifact-prism) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.425 0.35)) - :item (game-items artifact-prism) + :item (game-items artifact-av-prism) ) ) ) @@ -3354,7 +3354,7 @@ :icon (inventory-icon artifact-quantum-reflector) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.625 0.35)) - :item (game-items artifact-quantum-reflector) + :item (game-items artifact-av-reflector) ) ) ) @@ -3369,7 +3369,7 @@ :icon (inventory-icon artifact-time-map) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.825 0.35)) - :item (game-items artifact-time-map) + :item (game-items artifact-av-map) ) ) ) diff --git a/goal_src/jak3/engine/ui/progress/progress.gc b/goal_src/jak3/engine/ui/progress/progress.gc index c87194a928..9a4c97e70f 100644 --- a/goal_src/jak3/engine/ui/progress/progress.gc +++ b/goal_src/jak3/engine/ui/progress/progress.gc @@ -504,7 +504,8 @@ "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set! (-> *progress-work* hero-mode-save) #f) (remove-setting-by-arg0 *setting-control* 'extra-bank) - (disable-drawing *bigmap*) + ;; og:preserve-this not-yet-implemented check + (if (nonzero? *bigmap*) (disable-drawing *bigmap*)) (set-menu-mode *blit-displays-work* #f) (set! *progress-process* (the-as (pointer progress) #f)) (enable-level-text-file-loading) @@ -1865,7 +1866,8 @@ (defstate gone (progress) :virtual #t :code (behavior () - (disable-drawing *bigmap*) + ;; og:preserve-this not-yet-implemented check + (if (nonzero? *bigmap*) (disable-drawing *bigmap*)) (set-menu-mode *blit-displays-work* #f) (while (or (-> *blit-displays-work* screen-copied) (nonzero? (-> *blit-displays-work* count-down))) (suspend) @@ -1882,107 +1884,95 @@ 0 ) -;; ERROR: Function may read a register that is not set: a3 -;; ERROR: Function may read a register that is not set: t0 (defmethod respond-progress ((this menu-slider-option) (arg0 progress) (arg1 symbol)) - (local-vars (a3-0 none) (t0-0 none)) (with-pp - (let ((gp-0 arg0)) - (when (draw *bigmap* (the-as int arg0) (the-as int arg1) (the-as int a3-0) (the-as int t0-0)) - (let ((s5-0 (&+ (the-as (pointer float) *setting-control*) (-> this setting-offset))) - (s3-0 #f) - ) - (let ((f30-0 (* 0.02 (-> pp clock time-adjust-ratio))) - (f28-0 0.0) - ) - (when (type? this menu-picture-slider-option) - (set! f30-0 (* 0.005 (-> pp clock time-adjust-ratio))) - (set! f28-0 0.25) - ) - (cond - ((cpad-hold? 0 left l-analog-left) - (seek! (-> s5-0 0) f28-0 f30-0) - (if (!= (-> s5-0 0) 0.0) - (set! s3-0 #t) - ) - ) - ((cpad-hold? 0 right l-analog-right) - (seek! (-> s5-0 0) 1.0 f30-0) - (if (!= (-> s5-0 0) 1.0) - (set! s3-0 #t) - ) - ) - ) + (when (bigmap-method-11 *bigmap*) + (let ((s5-0 (&+ (the-as (pointer float) *setting-control*) (-> this setting-offset))) + (s3-0 #f) ) - (when s3-0 - (let ((f30-1 1.0)) - (case (-> this name) - (((text-id progress-music-volume) (text-id progress-speech-volume)) - (set! f30-1 (-> s5-0 0)) + (let ((f30-0 (* 0.02 (-> pp clock time-adjust-ratio))) + (f28-0 0.0) + ) + (when (type? this menu-picture-slider-option) + (set! f30-0 (* 0.005 (-> pp clock time-adjust-ratio))) + (set! f28-0 0.25) + ) + (cond + ((cpad-hold? 0 left l-analog-left) + (seek! (-> s5-0 0) f28-0 f30-0) + (if (!= (-> s5-0 0) 0.0) + (set! s3-0 #t) ) - ) - (when (< (seconds 0.03) (- (current-time) (-> gp-0 last-sound))) - (set-time! (-> gp-0 last-sound)) - (sound-play-by-name - (static-sound-name "menu-slide") - (new-sound-id) - (the int (* 1024.0 f30-1)) - 0 - 0 - (sound-group) - #t - ) + ) + ((cpad-hold? 0 right l-analog-right) + (seek! (-> s5-0 0) 1.0 f30-0) + (if (!= (-> s5-0 0) 1.0) + (set! s3-0 #t) + ) + ) + ) + ) + (when s3-0 + (let ((f30-1 1.0)) + (case (-> this name) + (((text-id progress-music-volume) (text-id progress-speech-volume)) + (set! f30-1 (-> s5-0 0)) + ) + ) + (when (< (seconds 0.03) (- (current-time) (-> arg0 last-sound))) + (set-time! (-> arg0 last-sound)) + (sound-play-by-name + (static-sound-name "menu-slide") + (new-sound-id) + (the int (* 1024.0 f30-1)) + 0 + 0 + (sound-group) + #t ) ) ) ) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) ) 0 ) ) -;; ERROR: Function may read a register that is not set: a3 -;; ERROR: Function may read a register that is not set: t0 (defmethod respond-progress ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) - (local-vars (a3-0 none) (t0-0 none)) - (let ((gp-0 arg0) - (s5-0 arg1) - ) - (when (draw *bigmap* (the-as int arg0) (the-as int arg1) (the-as int a3-0) (the-as int t0-0)) - (let ((a0-2 (-> *setting-control* user-default stereo-mode)) - (v1-4 #f) + (when (bigmap-method-11 *bigmap*) + (let ((a0-2 (-> *setting-control* user-default stereo-mode)) + (v1-4 #f) + ) + (let ((a2-1 2)) + (cond + (arg1 + (cond + ((cpad-pressed? 0 left l-analog-left) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 -1) 0 a2-1)) + (set! v1-4 #t) + ) + ((cpad-pressed? 0 right l-analog-right) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 1) 0 a2-1)) + (set! v1-4 #t) + ) + ((cpad-pressed? 0 triangle) + (set! (-> *setting-control* user-default stereo-mode) (-> arg0 stereo-mode-backup)) + ) + ) ) - (let ((a2-1 2)) - (cond - (s5-0 - (cond - ((cpad-pressed? 0 left l-analog-left) - (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 -1) 0 a2-1)) - (set! v1-4 #t) - ) - ((cpad-pressed? 0 right l-analog-right) - (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 1) 0 a2-1)) - (set! v1-4 #t) - ) - ((cpad-pressed? 0 triangle) - (set! (-> *setting-control* user-default stereo-mode) (-> gp-0 stereo-mode-backup)) - ) + (else + (if (cpad-pressed? 0 confirm) + (set! (-> arg0 stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) ) - ) - (else - (if (cpad-pressed? 0 confirm) - (set! (-> gp-0 stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) - ) - ) ) ) - (if v1-4 - (sound-play "generic-beep") - ) ) + (if v1-4 + (sound-play "generic-beep") + ) ) ) 0 @@ -2231,57 +2221,50 @@ 0 ) -;; ERROR: Function may read a register that is not set: a3 -;; ERROR: Function may read a register that is not set: t0 (defmethod respond-progress ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) - (local-vars (a3-0 none) (t0-0 none)) (memcard-unlocked-secrets? arg0 #t) - (let* ((a1-3 (get-state-check-card arg0 (-> arg0 current))) - (a0-3 arg0) - (t9-2 (method-of-object a0-3 set-next-state)) - (a2-1 0) - ) - (t9-2 a0-3 a1-3 a2-1) - (set! (-> arg0 selected-option) #f) - (when (draw *bigmap* (the-as int a1-3) a2-1 (the-as int a3-0) (the-as int t0-0)) - (cond - ((cpad-pressed? 0 triangle) - ) - ((cpad-pressed? 0 confirm) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) - (let ((s5-0 #f)) - *progress-save-info* - (set! (-> arg0 which-slot) (-> arg0 option-index)) - (cond - ((= (-> arg0 current) 'select-load) - (when (= (-> *progress-save-info* file (-> arg0 option-index) present) 1) - (set! s5-0 #t) - (set-next-state arg0 'loading 0) - ) - ) - ((and (= (-> arg0 current) 'select-save-hero) - (-> *setting-control* user-default auto-save) - (= (-> *game-info* auto-save-card) (-> *progress-save-info* handle)) - (= (-> *game-info* auto-save-which) (-> arg0 which-slot)) - ) - (sound-play "generic-beep" :pitch -0.6) - ) - ((= (-> *progress-save-info* file (-> arg0 which-slot) present) 1) + (let ((a1-3 (get-state-check-card arg0 (-> arg0 current)))) + (set-next-state arg0 a1-3 0) + ) + (set! (-> arg0 selected-option) #f) + (when (bigmap-method-11 *bigmap*) + (cond + ((cpad-pressed? 0 triangle) + ) + ((cpad-pressed? 0 confirm) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (let ((s5-0 #f)) + *progress-save-info* + (set! (-> arg0 which-slot) (-> arg0 option-index)) + (cond + ((= (-> arg0 current) 'select-load) + (when (= (-> *progress-save-info* file (-> arg0 option-index) present) 1) (set! s5-0 #t) - (set-next-state arg0 'already-exists 0) + (set-next-state arg0 'loading 0) ) - (else - (set! s5-0 #t) - (set-next-state arg0 'saving 0) - ) + ) + ((and (= (-> arg0 current) 'select-save-hero) + (-> *setting-control* user-default auto-save) + (= (-> *game-info* auto-save-card) (-> *progress-save-info* handle)) + (= (-> *game-info* auto-save-which) (-> arg0 which-slot)) + ) + (sound-play "generic-beep" :pitch -0.6) + ) + ((= (-> *progress-save-info* file (-> arg0 which-slot) present) 1) + (set! s5-0 #t) + (set-next-state arg0 'already-exists 0) + ) + (else + (set! s5-0 #t) + (set-next-state arg0 'saving 0) ) - (if s5-0 - (sound-play "generic-beep") - ) ) + (if s5-0 + (sound-play "generic-beep") + ) ) - ) + ) ) ) 0 diff --git a/goal_src/jak3/engine/util/script.gc b/goal_src/jak3/engine/util/script.gc index 4de2b37d2e..f30468756e 100644 --- a/goal_src/jak3/engine/util/script.gc +++ b/goal_src/jak3/engine/util/script.gc @@ -3021,12 +3021,7 @@ (when (-> arg0 side-effect?) (cond ((not (logtest? (the-as int (-> arg0 param 1)) 7)) - (let ((s5-0 task-node-close!) - (a0-2 (command-get-int (-> arg0 param 1) 0)) - ) - 'event - (s5-0 (the-as game-task-node a0-2)) - ) + (task-node-close! (the-as game-task-node (command-get-int (-> arg0 param 1) 0)) 'event) ) (else (let ((s5-1 (-> arg0 param 1))) @@ -3990,20 +3985,20 @@ (set! (-> arg0 param 2) (-> arg0 process)) ) (let* ((gp-0 (command-get-process (-> arg0 param 1) (the-as process #f))) - (s0-0 (if (type? gp-0 process-drawable) - gp-0 - ) - ) - (gp-1 (command-get-process (-> arg0 param 2) (the-as process #f))) - (s2-0 (if (type? gp-1 process-drawable) - gp-1 - ) - ) - (s4-0 0) - (s3-0 0) - (s5-0 (command-get-time (-> arg0 param 5) 1)) - (gp-2 (-> arg0 param 6)) - ) + (s0-0 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + (gp-1 (command-get-process (-> arg0 param 2) (the-as process #f))) + (s2-0 (if (type? gp-1 process-drawable) + gp-1 + ) + ) + (s4-0 0) + (s3-0 0) + (s5-0 (command-get-time (-> arg0 param 5) 1)) + (gp-2 (-> arg0 param 6)) + ) (when (and s0-0 s2-0) (when (and s0-0 (nonzero? (-> (the-as process-drawable s0-0) root))) (let ((a1-5 (-> arg0 param 3))) diff --git a/goal_src/jak3/game.gp b/goal_src/jak3/game.gp index 9fecee4056..a75712eb9e 100644 --- a/goal_src/jak3/game.gp +++ b/goal_src/jak3/game.gp @@ -97,279 +97,302 @@ ;; works out. (define common-dep '("$OUT/obj/default-menu.o")) -(cgo-file "halfpipe.gd" common-dep) -(cgo-file "wasall.gd" common-dep) -;; (cgo-file "preca.gd" common-dep) -;; (cgo-file "outrocst.gd" common-dep) -;; (cgo-file "ltornsam.gd" common-dep) -;; (cgo-file "lnstcst.gd" common-dep) -;; (cgo-file "combx.gd" common-dep) -;; (cgo-file "lfreeout.gd" common-dep) -;; (cgo-file "lgunrnc.gd" common-dep) -;; (cgo-file "ctc.gd" common-dep) -;; (cgo-file "ltowcity.gd" common-dep) -;; (cgo-file "temc.gd" common-dep) -;; (cgo-file "loutro.gd" common-dep) -;; (cgo-file "railcst.gd" common-dep) -;; (cgo-file "sem.gd" common-dep) -;; (cgo-file "dese.gd" common-dep) -;; (cgo-file "ljkdxvin.gd" common-dep) -;; (cgo-file "waspgame.gd" common-dep) -;; (cgo-file "wascast.gd" common-dep) -;; (cgo-file "lbbsdrp1.gd" common-dep) -;; (cgo-file "raild.gd" common-dep) -;; (cgo-file "lwlandm.gd" common-dep) -;; (cgo-file "gungame2.gd" common-dep) -;; (cgo-file "railc.gd" common-dep) -;; (cgo-file "precd.gd" common-dep) -;; (cgo-file "combe.gd" common-dep) -;; (cgo-file "lctyhijk.gd" common-dep) -;; (cgo-file "desoasis.gd" common-dep) -;; (cgo-file "ctypesc.gd" common-dep) -;; (cgo-file "wasseem.gd" common-dep) -;; (cgo-file "towb.gd" common-dep) -;; (cgo-file "wasstadc.gd" common-dep) -;; (cgo-file "gungame1.gd" common-dep) -;; (cgo-file "ljak.gd" common-dep) -;; (cgo-file "lwassig.gd" common-dep) -;; (cgo-file "deshover.gd" common-dep) -;; (cgo-file "wsd.gd" common-dep) -;; (cgo-file "lsamos.gd" common-dep) -;; (cgo-file "lfaccity.gd" common-dep) -;; (cgo-file "lblowtmh.gd" common-dep) -;; (cgo-file "ljaksig.gd" common-dep) -;; (cgo-file "ldmpckgn.gd" common-dep) -;; (cgo-file "lbbtcha1.gd" common-dep) -;; (cgo-file "railx.gd" common-dep) -;; (cgo-file "staa.gd" common-dep) -;; (cgo-file "wcaseem.gd" common-dep) -;; (cgo-file "dst.gd" common-dep) -;; (cgo-file "rubc.gd" common-dep) -;; (cgo-file "ipf.gd" common-dep) -;; (cgo-file "lnstoa.gd" common-dep) -;; (cgo-file "railf.gd" common-dep) -;; (cgo-file "deshunt.gd" common-dep) -;; (cgo-file "oasiscst.gd" common-dep) -;; (cgo-file "desinter.gd" common-dep) -;; (cgo-file "ctypesa.gd" common-dep) -;; (cgo-file "seo.gd" common-dep) -;; (cgo-file "railb.gd" common-dep) -;; (cgo-file "lerrol.gd" common-dep) -;; (cgo-file "lbbsprt3.gd" common-dep) -;; (cgo-file "ltowa.gd" common-dep) -;; (cgo-file "comba.gd" common-dep) -;; (cgo-file "stb.gd" common-dep) -;; (cgo-file "desc.gd" common-dep) -;; (cgo-file "lctyprot.gd" common-dep) -;; (cgo-file "lctyblow.gd" common-dep) -;; (cgo-file "voca.gd" common-dep) -;; (cgo-file "lbbring3.gd" common-dep) -;; (cgo-file "ctb.gd" common-dep) -;; (cgo-file "lbbring4.gd" common-dep) -;; (cgo-file "mic.gd" common-dep) -;; (cgo-file "lnstobc.gd" common-dep) -;; (cgo-file "ctypesb.gd" common-dep) -;; (cgo-file "cia.gd" common-dep) -;; (cgo-file "ldampksm.gd" common-dep) -;; (cgo-file "ljndklev.gd" common-dep) -;; (cgo-file "desrace2.gd" common-dep) -;; (cgo-file "hhg.gd" common-dep) -;; (cgo-file "ljakc.gd" common-dep) -;; (cgo-file "lbombbot.gd" common-dep) -;; (cgo-file "loutro2.gd" common-dep) -;; (cgo-file "citycast.gd" common-dep) -;; (cgo-file "seb.gd" common-dep) -;; (cgo-file "combn.gd" common-dep) -;; (cgo-file "lprenme.gd" common-dep) -;; (cgo-file "rbct.gd" common-dep) -;; (cgo-file "lbbsdrp2.gd" common-dep) -;; (cgo-file "lbbring5.gd" common-dep) -;; (cgo-file "rubb.gd" common-dep) -;; (cgo-file "ltrtwhls.gd" common-dep) -;; (cgo-file "ctycarc.gd" common-dep) -;; (cgo-file "towera.gd" common-dep) -;; (cgo-file "desw.gd" common-dep) -;; (cgo-file "lpatk.gd" common-dep) -;; (cgo-file "ljkdmpk.gd" common-dep) -;; (cgo-file "ltowb.gd" common-dep) -;; (cgo-file "destrack.gd" common-dep) -;; (cgo-file "slumbset.gd" common-dep) -;; (cgo-file "desboss2.gd" common-dep) -;; (cgo-file "combb.gd" common-dep) -;; (cgo-file "precc.gd" common-dep) -;; (cgo-file "desbcst.gd" common-dep) -;; (cgo-file "lctypalt.gd" common-dep) -;; (cgo-file "ltornjnx.gd" common-dep) -;; (cgo-file "factorya.gd" common-dep) -;; (cgo-file "ljakklev.gd" common-dep) -;; (cgo-file "sef.gd" common-dep) -;; (cgo-file "museum4.gd" common-dep) -;; (cgo-file "tema.gd" common-dep) -;; (cgo-file "lbbring1.gd" common-dep) -;; (cgo-file "ljakndax.gd" common-dep) -;; (cgo-file "vin.gd" common-dep) -;; (cgo-file "lfacb.gd" common-dep) -;; (cgo-file "lashelin.gd" common-dep) -;; (cgo-file "ljkcdmkl.gd" common-dep) -;; (cgo-file "lfacrm2.gd" common-dep) -;; (cgo-file "ljinx.gd" common-dep) -;; (cgo-file "lfactory.gd" common-dep) -;; (cgo-file "arenacst.gd" common-dep) -;; (cgo-file "lbbtcha3.gd" common-dep) -;; (cgo-file "wasdefen.gd" common-dep) -;; (cgo-file "templee.gd" common-dep) -;; (cgo-file "lmhcb.gd" common-dep) -;; (cgo-file "freecast.gd" common-dep) -;; (cgo-file "frstx.gd" common-dep) -;; (cgo-file "sek.gd" common-dep) -;; (cgo-file "lmhca.gd" common-dep) -;; (cgo-file "cwi.gd" common-dep) -;; (cgo-file "lprecc.gd" common-dep) -;; (cgo-file "hgb.gd" common-dep) -;; (cgo-file "desrace1.gd" common-dep) -;; (cgo-file "sea.gd" common-dep) -;; (cgo-file "nsa.gd" common-dep) -;; (cgo-file "lbiped.gd" common-dep) -;; (cgo-file "waschase.gd" common-dep) -;; (cgo-file "desrescc.gd" common-dep) -;; (cgo-file "desf.gd" common-dep) -;; (cgo-file "deserrol.gd" common-dep) -;; (cgo-file "cfb.gd" common-dep) -;; (cgo-file "lgunnorm.gd" common-dep) -;; (cgo-file "outcast3.gd" common-dep) -;; (cgo-file "mhca.gd" common-dep) -;; (cgo-file "ltnfxhip.gd" common-dep) -;; (cgo-file "introcst.gd" common-dep) -;; (cgo-file "cta.gd" common-dep) -;; (cgo-file "combc.gd" common-dep) -;; (cgo-file "seh.gd" common-dep) -;; (cgo-file "lfaccar.gd" common-dep) -;; (cgo-file "warpcast.gd" common-dep) -;; (cgo-file "lfacrm1.gd" common-dep) -;; (cgo-file "wca.gd" common-dep) -;; (cgo-file "lblowtkg.gd" common-dep) -;; (cgo-file "onintent.gd" common-dep) -;; (cgo-file "freehq.gd" common-dep) -;; (cgo-file "lform.gd" common-dep) -;; (cgo-file "towercst.gd" common-dep) -;; (cgo-file "lbbring2.gd" common-dep) -;; (cgo-file "ctypepc.gd" common-dep) -;; (cgo-file "lblowcst.gd" common-dep) -;; (cgo-file "see.gd" common-dep) -;; (cgo-file "lctysnpr.gd" common-dep) -;; (cgo-file "desrescg.gd" common-dep) -;; (cgo-file "mhctycst.gd" common-dep) -;; (cgo-file "ltorn.gd" common-dep) -;; (cgo-file "desg.gd" common-dep) -;; (cgo-file "facd.gd" common-dep) -;; (cgo-file "desboss1.gd" common-dep) -;; (cgo-file "lforp.gd" common-dep) -;; (cgo-file "ljakcklv.gd" common-dep) -;; (cgo-file "ctycarkg.gd" common-dep) -;; (cgo-file "temp.gd" common-dep) -;; (cgo-file "lkeira.gd" common-dep) -;; (cgo-file "ctypepb.gd" common-dep) -;; (cgo-file "sej.gd" common-dep) -;; (cgo-file "desh.gd" common-dep) -;; (cgo-file "wasstadb.gd" common-dep) -;; (cgo-file "lbbsprt2.gd" common-dep) -;; (cgo-file "lbbsdrp3.gd" common-dep) -;; (cgo-file "museum.gd" common-dep) -;; (cgo-file "ldesgcst.gd" common-dep) -;; (cgo-file "ltnjxhip.gd" common-dep) -;; (cgo-file "ldax.gd" common-dep) -;; (cgo-file "intpalrf.gd" common-dep) -;; (cgo-file "lcitysml.gd" common-dep) -;; (cgo-file "title.gd" common-dep) -;; (cgo-file "desb.gd" common-dep) -;; (cgo-file "facb.gd" common-dep) -;; (cgo-file "mia.gd" common-dep) -;; (cgo-file "temx.gd" common-dep) -;; (cgo-file "ctycarb.gd" common-dep) -;; (cgo-file "hga.gd" common-dep) -;; (cgo-file "ctycara.gd" common-dep) -;; (cgo-file "lnstobb.gd" common-dep) -;; (cgo-file "lmech.gd" common-dep) -;; (cgo-file "gridcst.gd" common-dep) -;; (cgo-file "lbbtcha2.gd" common-dep) -;; (cgo-file "ljkfeet.gd" common-dep) -;; (cgo-file "mib.gd" common-dep) -;; (cgo-file "facc.gd" common-dep) -;; (cgo-file "raile.gd" common-dep) -;; (cgo-file "combd.gd" common-dep) -;; (cgo-file "lsigklv.gd" common-dep) -;; (cgo-file "ldampeck.gd" common-dep) -;; (cgo-file "deschase.gd" common-dep) -;; (cgo-file "museum3.gd" common-dep) -;; (cgo-file "minee.gd" common-dep) -;; (cgo-file "lctyass.gd" common-dep) -;; (cgo-file "wcb.gd" common-dep) -;; (cgo-file "lpatkcs.gd" common-dep) -;; (cgo-file "cfa.gd" common-dep) -;; (cgo-file "ruba2.gd" common-dep) -;; (cgo-file "ldamsig.gd" common-dep) -;; (cgo-file "precb.gd" common-dep) -;; (cgo-file "railb2.gd" common-dep) -;; (cgo-file "lbbspirt.gd" common-dep) -;; (cgo-file "temd.gd" common-dep) -;; (cgo-file "mined.gd" common-dep) -;; (cgo-file "wwd.gd" common-dep) -;; (cgo-file "loutro3.gd" common-dep) -;; (cgo-file "sec.gd" common-dep) -;; (cgo-file "lsnkwhls.gd" common-dep) -;; (cgo-file "loninsim.gd" common-dep) -;; (cgo-file "cib.gd" common-dep) -;; (cgo-file "inttitle.gd" common-dep) -;; (cgo-file "desresc.gd" common-dep) -;; (cgo-file "lwasbbv.gd" common-dep) -;; (cgo-file "lforring.gd" common-dep) -;; (cgo-file "museum3b.gd" common-dep) -;; (cgo-file "gga.gd" common-dep) -;; (cgo-file "desliz.gd" common-dep) -;; (cgo-file "desjump.gd" common-dep) -;; (cgo-file "raila.gd" common-dep) -;; (cgo-file "lseemwca.gd" common-dep) -;; (cgo-file "lkleever.gd" common-dep) -;; (cgo-file "desd.gd" common-dep) -;; (cgo-file "lfaco.gd" common-dep) -;; (cgo-file "ldamklev.gd" common-dep) -;; (cgo-file "powergd.gd" common-dep) -;; (cgo-file "lptrl.gd" common-dep) -;; (cgo-file "lsig.gd" common-dep) -;; (cgo-file "ruba.gd" common-dep) -;; (cgo-file "win.gd" common-dep) -;; (cgo-file "wasstada.gd" common-dep) -;; (cgo-file "sei.gd" common-dep) -;; (cgo-file "cpo.gd" common-dep) -;; (cgo-file "waspala.gd" common-dep) -;; (cgo-file "museum4b.gd" common-dep) -;; (cgo-file "seg.gd" common-dep) -;; (cgo-file "frstb.gd" common-dep) -;; (cgo-file "nsb.gd" common-dep) -;; (cgo-file "cgb.gd" common-dep) -;; (cgo-file "lvincst.gd" common-dep) -;; (cgo-file "sel.gd" common-dep) -;; (cgo-file "lctydest.gd" common-dep) -;; (cgo-file "sta.gd" common-dep) -;; (cgo-file "wasleapr.gd" common-dep) -;; (cgo-file "desrally.gd" common-dep) -;; (cgo-file "temb.gd" common-dep) -;; (cgo-file "ctypepa.gd" common-dep) -;; (cgo-file "lwstdpck.gd" common-dep) -;; (cgo-file "museum2.gd" common-dep) -;; (cgo-file "sed.gd" common-dep) -;; (cgo-file "desa.gd" common-dep) -;; (cgo-file "towerc.gd" common-dep) -;; (cgo-file "desbattl.gd" common-dep) -;; (cgo-file "frsta.gd" common-dep) -;; (cgo-file "lsigjakc.gd" common-dep) -;; (cgo-file "vocx.gd" common-dep) -;; (cgo-file "lbbspid.gd" common-dep) -;; (cgo-file "sen.gd" common-dep) -;; (cgo-file "mhcb.gd" common-dep) -;; (cgo-file "lctypatk.gd" common-dep) -;; (cgo-file "lbbring6.gd" common-dep) +;; wascity +(cgo-file "wwd.gd" common-dep) ;; waswide +(cgo-file "wsd.gd" common-dep) ;; wasdoors (garage) +(cgo-file "waschase.gd" common-dep) +(cgo-file "wasdefen.gd" common-dep) +(cgo-file "wasleapr.gd" common-dep) +(cgo-file "waspala.gd" common-dep) +(cgo-file "wasseem.gd" common-dep) +(cgo-file "waspgame.gd" common-dep) +(cgo-file "wca.gd" common-dep) +(cgo-file "wcb.gd" common-dep) +(cgo-file "wcaseem.gd" common-dep) +(cgo-file "wascast.gd" common-dep) +(cgo-file "wasall.gd" common-dep) +; ;; arena +; (cgo-file "wasstada.gd" common-dep) +; (cgo-file "wasstadb.gd" common-dep) +; (cgo-file "wasstadc.gd" common-dep) +; (cgo-file "arenacst.gd" common-dep) +; ;; desert +; (cgo-file "desa.gd" common-dep) +; (cgo-file "desb.gd" common-dep) +; (cgo-file "desbattl.gd" common-dep) +; (cgo-file "desbcst.gd" common-dep) +; (cgo-file "desboss1.gd" common-dep) +; (cgo-file "desboss2.gd" common-dep) +; (cgo-file "desc.gd" common-dep) +; (cgo-file "deschase.gd" common-dep) +; (cgo-file "desd.gd" common-dep) +; (cgo-file "dese.gd" common-dep) +; (cgo-file "deserrol.gd" common-dep) +; (cgo-file "desf.gd" common-dep) +; (cgo-file "desg.gd" common-dep) +; (cgo-file "desh.gd" common-dep) +; (cgo-file "deshover.gd" common-dep) +; (cgo-file "deshunt.gd" common-dep) +; (cgo-file "desinter.gd" common-dep) +; (cgo-file "desjump.gd" common-dep) +; (cgo-file "desliz.gd" common-dep) +; (cgo-file "desoasis.gd" common-dep) +; (cgo-file "desrace1.gd" common-dep) +; (cgo-file "desrace2.gd" common-dep) +; (cgo-file "desrally.gd" common-dep) +; (cgo-file "desresc.gd" common-dep) +; (cgo-file "desrescc.gd" common-dep) +; (cgo-file "desrescg.gd" common-dep) +; (cgo-file "destrack.gd" common-dep) +; (cgo-file "desw.gd" common-dep) +(cgo-file "dst.gd" common-dep) +; (cgo-file "oasiscst.gd" common-dep) +; (cgo-file "warpcast.gd" common-dep) ;; air train +; ;; nest +; (cgo-file "nsa.gd" common-dep) +; (cgo-file "nsb.gd" common-dep) +; ;; temple +; (cgo-file "tema.gd" common-dep) +; (cgo-file "temb.gd" common-dep) +; (cgo-file "temc.gd" common-dep) +; (cgo-file "temd.gd" common-dep) +; (cgo-file "temp.gd" common-dep) +; (cgo-file "templee.gd" common-dep) +; (cgo-file "temx.gd" common-dep) +; ;; hang +; (cgo-file "hga.gd" common-dep) +; (cgo-file "hgb.gd" common-dep) +; ;; volcano +; (cgo-file "voca.gd" common-dep) +; (cgo-file "vocx.gd" common-dep) +;; mine +(cgo-file "mia.gd" common-dep) +(cgo-file "mib.gd" common-dep) +(cgo-file "mic.gd" common-dep) +(cgo-file "mined.gd" common-dep) +(cgo-file "minee.gd" common-dep) +; ;; city +; (cgo-file "cwi.gd" common-dep) ;; ctywide +; (cgo-file "cfa.gd" common-dep) ;; ctyfarm +; (cgo-file "cfb.gd" common-dep) +; (cgo-file "cgb.gd" common-dep) ;; ctygen +; (cgo-file "cia.gd" common-dep) ;; ctyind +; (cgo-file "cib.gd" common-dep) +; (cgo-file "cpo.gd" common-dep) ;; ctyport +; (cgo-file "cta.gd" common-dep) +; (cgo-file "ctb.gd" common-dep) +; (cgo-file "ctc.gd" common-dep) +; (cgo-file "ctypepa.gd" common-dep) ;; citizens +; (cgo-file "ctypepb.gd" common-dep) ;; predator +; (cgo-file "ctypepc.gd" common-dep) ;; empty +; (cgo-file "ctypesa.gd" common-dep) ;; guards +; (cgo-file "ctypesb.gd" common-dep) ;; metal heads +; (cgo-file "ctypesc.gd" common-dep) ;; kg +; (cgo-file "ctycara.gd" common-dep) ;; cars +; (cgo-file "ctycarb.gd" common-dep) ;; bikes +; (cgo-file "ctycarc.gd" common-dep) ;; hellcat +; (cgo-file "ctycarkg.gd" common-dep) ;; empty +; (cgo-file "onintent.gd" common-dep) +; (cgo-file "hhg.gd" common-dep) ;; hiphog +; (cgo-file "gga.gd" common-dep) ;; gungame +; (cgo-file "gungame1.gd" common-dep) +; (cgo-file "gungame2.gd" common-dep) +; (cgo-file "powergd.gd" common-dep) +; (cgo-file "freehq.gd" common-dep) +; (cgo-file "vin.gd" common-dep) +; (cgo-file "freecast.gd" common-dep) +; (cgo-file "citycast.gd" common-dep) +; (cgo-file "gridcst.gd" common-dep) ;; city-destroy-grid-res +; (cgo-file "slumbset.gd" common-dep) ;; sewer-met-hum-intro +; ;; sewer +(cgo-file "sea.gd" common-dep) +; (cgo-file "seb.gd" common-dep) +; (cgo-file "sec.gd" common-dep) +; (cgo-file "sed.gd" common-dep) +; (cgo-file "see.gd" common-dep) +; (cgo-file "sef.gd" common-dep) +; (cgo-file "seg.gd" common-dep) +; (cgo-file "seh.gd" common-dep) +; (cgo-file "sei.gd" common-dep) +; (cgo-file "sej.gd" common-dep) +; (cgo-file "sek.gd" common-dep) +; (cgo-file "sel.gd" common-dep) +; (cgo-file "sem.gd" common-dep) +; (cgo-file "sen.gd" common-dep) +; (cgo-file "seo.gd" common-dep) +; ;; mhcity +; (cgo-file "mhca.gd" common-dep) +; (cgo-file "mhcb.gd" common-dep) +; (cgo-file "mhctycst.gd" common-dep) +;; forest +(cgo-file "frsta.gd" common-dep) +(cgo-file "frstb.gd" common-dep) +(cgo-file "frstx.gd" common-dep) +; ;; factory +; (cgo-file "factorya.gd" common-dep) +; (cgo-file "facb.gd" common-dep) +; (cgo-file "facc.gd" common-dep) +; (cgo-file "facd.gd" common-dep) +; ;; tower +; (cgo-file "towb.gd" common-dep) +; (cgo-file "towera.gd" common-dep) +; (cgo-file "towerc.gd" common-dep) +; (cgo-file "towercst.gd" common-dep) +; ;; stadium +; (cgo-file "sta.gd" common-dep) +; (cgo-file "staa.gd" common-dep) +; (cgo-file "stb.gd" common-dep) +; ;; rubble +; (cgo-file "rbct.gd" common-dep) +; (cgo-file "ruba.gd" common-dep) +; (cgo-file "ruba2.gd" common-dep) +; (cgo-file "rubb.gd" common-dep) +; (cgo-file "rubc.gd" common-dep) +; ;; comb +; (cgo-file "comba.gd" common-dep) +; (cgo-file "combb.gd" common-dep) +; (cgo-file "combc.gd" common-dep) +; (cgo-file "combd.gd" common-dep) +; (cgo-file "combe.gd" common-dep) +; (cgo-file "combn.gd" common-dep) +; (cgo-file "combx.gd" common-dep) +; (cgo-file "raila.gd" common-dep) +; (cgo-file "railb.gd" common-dep) +; (cgo-file "railb2.gd" common-dep) +; (cgo-file "railc.gd" common-dep) +; (cgo-file "railcst.gd" common-dep) +; (cgo-file "raild.gd" common-dep) +; (cgo-file "raile.gd" common-dep) +; (cgo-file "railf.gd" common-dep) +; (cgo-file "railx.gd" common-dep) +; ;; precursor +; (cgo-file "preca.gd" common-dep) +; (cgo-file "precb.gd" common-dep) +; (cgo-file "precc.gd" common-dep) +; (cgo-file "precd.gd" common-dep) +; ;; title/intro +; (cgo-file "win.gd" common-dep) ;; wasintro +; (cgo-file "title.gd" common-dep) +; (cgo-file "inttitle.gd" common-dep) +; (cgo-file "intpalrf.gd" common-dep) ;; intro-palace-roof +; (cgo-file "ipf.gd" common-dep) ;; intro-palace-fall +; (cgo-file "introcst.gd" common-dep) +; ;; outro +; (cgo-file "outcast3.gd" common-dep) +; (cgo-file "outrocst.gd" common-dep) +; ;; museum +; (cgo-file "museum.gd" common-dep) +; (cgo-file "museum2.gd" common-dep) +; (cgo-file "museum3.gd" common-dep) +; (cgo-file "museum3b.gd" common-dep) +; (cgo-file "museum4.gd" common-dep) +; (cgo-file "museum4b.gd" common-dep) +; ;; test +; (cgo-file "halfpipe.gd" common-dep) +; ;; borrow +; (cgo-file "lashelin.gd" common-dep) +; (cgo-file "lbbring1.gd" common-dep) +; (cgo-file "lbbring2.gd" common-dep) +; (cgo-file "lbbring3.gd" common-dep) +; (cgo-file "lbbring4.gd" common-dep) +; (cgo-file "lbbring5.gd" common-dep) +; (cgo-file "lbbring6.gd" common-dep) +; (cgo-file "lbbsdrp1.gd" common-dep) +; (cgo-file "lbbsdrp2.gd" common-dep) +; (cgo-file "lbbsdrp3.gd" common-dep) +; (cgo-file "lbbspid.gd" common-dep) +; (cgo-file "lbbspirt.gd" common-dep) +; (cgo-file "lbbsprt2.gd" common-dep) +; (cgo-file "lbbsprt3.gd" common-dep) +; (cgo-file "lbbtcha1.gd" common-dep) +; (cgo-file "lbbtcha2.gd" common-dep) +; (cgo-file "lbbtcha3.gd" common-dep) +; (cgo-file "lbiped.gd" common-dep) +; (cgo-file "lblowcst.gd" common-dep) +; (cgo-file "lblowtkg.gd" common-dep) +; (cgo-file "lblowtmh.gd" common-dep) +; (cgo-file "lbombbot.gd" common-dep) +; (cgo-file "lcitysml.gd" common-dep) +; (cgo-file "lctyass.gd" common-dep) +; (cgo-file "lctyblow.gd" common-dep) +; (cgo-file "lctydest.gd" common-dep) +; (cgo-file "lctyhijk.gd" common-dep) +; (cgo-file "lctypalt.gd" common-dep) +; (cgo-file "lctypatk.gd" common-dep) +; (cgo-file "lctyprot.gd" common-dep) +; (cgo-file "lctysnpr.gd" common-dep) +; (cgo-file "ldamklev.gd" common-dep) +; (cgo-file "ldampeck.gd" common-dep) +; (cgo-file "ldampksm.gd" common-dep) +; (cgo-file "ldamsig.gd" common-dep) +; (cgo-file "ldax.gd" common-dep) +; (cgo-file "ldesgcst.gd" common-dep) +; (cgo-file "ldmpckgn.gd" common-dep) +; (cgo-file "lerrol.gd" common-dep) +; (cgo-file "lfacb.gd" common-dep) +; (cgo-file "lfaccar.gd" common-dep) +; (cgo-file "lfaccity.gd" common-dep) +; (cgo-file "lfaco.gd" common-dep) +; (cgo-file "lfacrm1.gd" common-dep) +; (cgo-file "lfacrm2.gd" common-dep) +; (cgo-file "lfactory.gd" common-dep) +; (cgo-file "lform.gd" common-dep) +; (cgo-file "lforp.gd" common-dep) +; (cgo-file "lforring.gd" common-dep) +; (cgo-file "lfreeout.gd" common-dep) +; (cgo-file "lgunnorm.gd" common-dep) +; (cgo-file "lgunrnc.gd" common-dep) +; (cgo-file "ljak.gd" common-dep) +; (cgo-file "ljakc.gd" common-dep) +; (cgo-file "ljakcklv.gd" common-dep) +; (cgo-file "ljakklev.gd" common-dep) +; (cgo-file "ljakndax.gd" common-dep) +; (cgo-file "ljaksig.gd" common-dep) +; (cgo-file "ljinx.gd" common-dep) +; (cgo-file "ljkcdmkl.gd" common-dep) +; (cgo-file "ljkdmpk.gd" common-dep) +; (cgo-file "ljkdxvin.gd" common-dep) +; (cgo-file "ljkfeet.gd" common-dep) +; (cgo-file "ljndklev.gd" common-dep) +; (cgo-file "lkeira.gd" common-dep) +; (cgo-file "lkleever.gd" common-dep) +; (cgo-file "lmech.gd" common-dep) +; (cgo-file "lmhca.gd" common-dep) +; (cgo-file "lmhcb.gd" common-dep) +; (cgo-file "lnstcst.gd" common-dep) +; (cgo-file "lnstoa.gd" common-dep) +; (cgo-file "lnstobb.gd" common-dep) +; (cgo-file "lnstobc.gd" common-dep) +; (cgo-file "loninsim.gd" common-dep) +; (cgo-file "loutro.gd" common-dep) +; (cgo-file "loutro2.gd" common-dep) +; (cgo-file "loutro3.gd" common-dep) +; (cgo-file "lpatk.gd" common-dep) +; (cgo-file "lpatkcs.gd" common-dep) +; (cgo-file "lprecc.gd" common-dep) +; (cgo-file "lprenme.gd" common-dep) +; (cgo-file "lptrl.gd" common-dep) +; (cgo-file "lsamos.gd" common-dep) +; (cgo-file "lseemwca.gd" common-dep) +; (cgo-file "lsig.gd" common-dep) +; (cgo-file "lsigjakc.gd" common-dep) +; (cgo-file "lsigklv.gd" common-dep) +; (cgo-file "lsnkwhls.gd" common-dep) +; (cgo-file "ltnfxhip.gd" common-dep) +; (cgo-file "ltnjxhip.gd" common-dep) +; (cgo-file "ltorn.gd" common-dep) +; (cgo-file "ltornjnx.gd" common-dep) +; (cgo-file "ltornsam.gd" common-dep) +; (cgo-file "ltowa.gd" common-dep) +; (cgo-file "ltowb.gd" common-dep) +; (cgo-file "ltowcity.gd" common-dep) +; (cgo-file "ltrtwhls.gd" common-dep) +; (cgo-file "lvincst.gd" common-dep) +; (cgo-file "lwasbbv.gd" common-dep) +; (cgo-file "lwassig.gd" common-dep) +; (cgo-file "lwlandm.gd" common-dep) +; (cgo-file "lwstdpck.gd" common-dep) ;;;;;;;;;;;;;;;;;;;;; ;; ANIMATIONS diff --git a/goal_src/jak3/levels/city/common/trail-h.gc b/goal_src/jak3/levels/city/common/trail-h.gc index baaac3aedc..00254b93c3 100644 --- a/goal_src/jak3/levels/city/common/trail-h.gc +++ b/goal_src/jak3/levels/city/common/trail-h.gc @@ -10,6 +10,7 @@ :bitfield #t (tnf0 0) ;; unused?? (tnf1 1) + (tnf2 2) ) (defenum conn-flag @@ -21,6 +22,8 @@ (cf3 3) ) +(declare-type trail-graph basic) + ;; DECOMP BEGINS (deftype trail-node (structure) @@ -36,10 +39,11 @@ (flags trail-node-flag) (conn-count uint8) ) + :pack-me (:methods - (trail-node-method-9 () none) - (trail-node-method-10 () none) - (trail-node-method-11 () none) + (get-dist-score (_type_ vector) uint) + (debug-draw (_type_ int) none) + (get-position (_type_ vector) vector) ) ) @@ -67,8 +71,9 @@ (visgroup-id uint8) (cost uint16) ) + :pack-me (:methods - (trail-conn-method-9 () none) + (debug-draw (_type_ trail-graph int) none) ) ) @@ -79,6 +84,7 @@ (pov-count uint8) (first-pov uint16) ) + :pack-me ) @@ -158,31 +164,31 @@ (closed-bits vector16ub 2 :inline :overlay-at closed-quads) ) (:methods - (trail-graph-method-9 () none) - (trail-graph-method-10 () none) - (trail-graph-method-11 () none) - (trail-graph-method-12 () none) - (trail-graph-method-13 () none) + (trail-graph-method-9 (_type_ int) none) + (trail-graph-method-10 (_type_ int) none) + (trail-graph-method-11 (_type_ int int) trail-node) + (trail-graph-method-12 (_type_) none) + (trail-graph-method-13 (_type_ vector vector) none) (debug-draw (_type_) none) - (trail-graph-method-15 () none) - (trail-graph-method-16 () none) - (trail-graph-method-17 () none) - (trail-graph-method-18 () none) - (trail-graph-method-19 () none) - (trail-graph-method-20 () none) - (trail-graph-method-21 () none) - (trail-graph-method-22 () none) - (trail-graph-method-23 () none) - (trail-graph-method-24 () none) - (trail-graph-method-25 () none) - (trail-graph-method-26 () none) - (trail-graph-method-27 () none) - (trail-graph-method-28 () none) - (trail-graph-method-29 () none) - (trail-graph-method-30 () none) - (trail-graph-method-31 () none) - (trail-graph-method-32 () none) - (trail-graph-method-33 () none) + (trail-graph-method-15 (_type_ int) none) + (trail-graph-method-16 (_type_ int (pointer uint16) vector vector rgba float) none) + (trail-graph-method-17 (_type_) none) + (trail-graph-method-18 (_type_ vector) int) + (trail-graph-method-19 (_type_) none) + (trail-graph-method-20 (_type_ uint vector) none) + (trail-graph-method-21 (_type_) none) + (trail-graph-method-22 (_type_) none) + (trail-graph-method-23 (_type_) none) + (trail-graph-method-24 (_type_) none) + (trail-graph-method-25 (_type_ int) none) + (trail-graph-method-26 (_type_) none) + (trail-graph-method-27 (_type_) none) + (trail-graph-method-28 (_type_) none) + (trail-graph-method-29 (_type_) none) + (trail-graph-method-30 (_type_) none) + (trail-graph-method-31 (_type_ int) none) + (trail-graph-method-32 (_type_) none) + (trail-graph-method-33 (_type_) none) ) ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc index 985675f8d6..ece2e66243 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc @@ -7,3 +7,431 @@ ;; DECOMP BEGINS +(defmethod rigid-body-object-method-38 ((this vehicle)) + (cond + ((< 0.0 (-> this scrape-sound-envelope)) + (if (zero? (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new-sound-id)) + ) + (sound-play-by-name + (-> this info sound scrape-sound) + (-> this scrape-sound-id) + (the int (* 1024.0 (-> this scrape-sound-envelope))) + 0 + 0 + (sound-group) + (-> this impact-pos) + ) + ) + (else + (when (nonzero? (-> this scrape-sound-id)) + (sound-stop (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defun calc-fade-vals ((arg0 float)) + (let* ((f1-1 (* 0.00024414062 arg0)) + (f0-3 (- f1-1 (the float (the int f1-1)))) + (f1-3 (* 4096.0 (- f1-1 f0-3))) + (f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3))) + (f0-4 (/ f0-3 (- 1.0 f0-3))) + ) + (format #t ":fade-a ~,,10f~%:fade-b ~,,10f~%" f1-5 f0-4) + ) + (none) + ) + +(define *vehicle-headlight-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 8192.0) + :size-probe 163.84 + :z-offset 819.2 + :size-y 8192.0 + :color (new 'static 'rgbaf :x 255.0 :y 128.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xd :page #x4) + ) + ) + +(define *vehicle-taillight-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 3072.0) + :size-probe 122.88 + :z-offset 409.6 + :size-y 3072.0 + :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xe :page #x4) + ) + ) + +(define *vehicle-thruster-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 4096.0) + :size-probe 102.4 + :size-y 4096.0 + :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xf :page #x4) + ) + ) + +(defmethod init! ((this vehicle-particle-common-info)) + (set! (-> this sp-system2d) *sp-particle-system-2d*) + (set! (-> this sp-system3d) *sp-particle-system-3d*) + (set! (-> this part-quat) *particle-quat*) + (set! (-> this part-vel) *particle-vel*) + (set! (-> this part-thruster) (-> *part-id-table* 922)) + (set! (-> this part-thruster-x) (-> *part-id-table* 922 init-specs 2)) + (set! (-> this part-spec2) (-> *part-id-table* 922 init-specs 3)) + (set! (-> this headlight-glow-template) *vehicle-headlight-glow-template*) + (set! (-> this taillight-glow-template) *vehicle-taillight-glow-template*) + (set! (-> this thruster-glow-template) *vehicle-thruster-glow-template*) + 0 + (none) + ) + +(define *vehicle-particle-common-info* (new 'static 'vehicle-particle-common-info)) + +(init! *vehicle-particle-common-info*) + +(defmethod vehicle-method-78 ((this vehicle)) + (local-vars (sv-224 sparticle-launcher) (sv-228 sparticle-launcher)) + (let ((a1-0 (-> this clock)) + (a0-1 (-> this traffic-priority-id)) + ) + (when (not (logtest? (logxor a0-1 (-> a1-0 integral-frame-counter)) 31)) + (let ((f0-1 + (+ (-> *time-of-day-context* time) (* 0.048387095 (the float (logand (-> this traffic-priority-id) 31)))) + ) + ) + (cond + ((and (logtest? (-> this v-flags) (vehicle-flag riding)) (or (< f0-1 7.0) (< 19.0 f0-1))) + (if (not (logtest? (vehicle-flag lights-on) (-> this v-flags))) + (vehicle-method-125 this) + ) + ) + (else + (if (logtest? (vehicle-flag lights-on) (-> this v-flags)) + (vehicle-method-126 this) + ) + ) + ) + ) + ) + ) + (when (logtest? (vehicle-flag lights-update) (-> this v-flags)) + (let ((f30-0 (if (logtest? (vehicle-flag lights-on) (-> this v-flags)) + 1.0 + 0.0 + ) + ) + ) + (seek! (-> this lights-factor) f30-0 (* 2.0 (seconds-per-frame))) + (if (= (-> this lights-factor) f30-0) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag lights-update)))) + ) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vehicle-stack-type3))) + (let* ((v1-38 (-> s5-0 mat0)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-14 (-> a3-0 rvec quad)) + (a1-3 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-38 rvec quad) a0-14) + (set! (-> v1-38 uvec quad) a1-3) + (set! (-> v1-38 fvec quad) a2-1) + (set! (-> v1-38 trans quad) a3-1) + ) + (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) + (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat0)) + (set! (-> this fog-fade) (calc-fade-from-fog (-> this root trans))) + (set! (-> s5-0 float1) (* (-> this fog-fade) (-> this lights-factor))) + (when (< 0.0 (-> s5-0 float1)) + (dotimes (s4-0 (-> this info particles headlight-count)) + (quad-copy! + (the-as pointer (-> s5-0 glow)) + (the-as pointer (-> this info particle-common headlight-glow-template)) + 4 + ) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles headlight-local-pos s4-0) (-> s5-0 mat0)) + (let* ((v1-46 (-> s5-0 glow)) + (a1-8 (-> s5-0 vec0)) + (f0-15 (-> v1-46 position w)) + ) + (set! (-> v1-46 position quad) (-> a1-8 quad)) + (set! (-> v1-46 position w) f0-15) + ) + 0 + (set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> s5-0 glow color x) 255.0) + (set! (-> s5-0 glow color y) (rand-vu-float-range 192.0 255.0)) + (set! (-> s5-0 glow color w) (* (-> s5-0 float1) (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + (let ((f0-22 (-> this camera-dist2)) + (f1-7 245760.0) + ) + (when (< f0-22 (* f1-7 f1-7)) + (let ((f0-23 3276.8)) + (set! (-> s5-0 glow position w) f0-23) + (set! (-> s5-0 glow size-y) f0-23) + ) + (set! (-> s5-0 glow fade-a) -0.00001356) + (set! (-> s5-0 glow fade-b) 2.3332994) + (set! (-> s5-0 glow color z) (rand-vu-float-range 128.0 160.0)) + (set! (-> s5-0 glow color w) (* (-> s5-0 float1) (rand-vu-float-range 32.0 36.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + ) + ) + ) + (quad-copy! + (the-as pointer (-> s5-0 glow)) + (the-as pointer (-> this info particle-common taillight-glow-template)) + 4 + ) + (dotimes (s4-1 (-> this info particles taillight-count)) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles taillight-local-pos s4-1) (-> s5-0 mat0)) + (let* ((v1-70 (-> s5-0 glow)) + (a1-20 (-> s5-0 vec0)) + (f0-29 (-> v1-70 position w)) + ) + (set! (-> v1-70 position quad) (-> a1-20 quad)) + (set! (-> v1-70 position w) f0-29) + ) + 0 + (set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -4.0 4.0))) + (set! (-> s5-0 glow color y) (* 64.0 (rand-vu))) + (set! (-> s5-0 glow color w) (* (-> s5-0 float1) (rand-vu-float-range 16.0 21.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + ) + ) + (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (set! (-> *part-id-table* 923 init-specs 2 initial-valuef) + (* 6.0 (+ 0.25 (-> this engine-power-factor)) (rand-vu)) + ) + (let* ((f0-39 1.0) + (f1-12 (-> this engine-power-factor)) + (f0-40 (- f0-39 (* f1-12 f1-12))) + ) + (set! (-> *part-id-table* 923 init-specs 9 initial-valuef) (* 16.0 f0-40)) + (set! (-> *part-id-table* 923 init-specs 9 random-rangef) (* 48.0 f0-40)) + ) + (set! (-> s5-0 float0) + (* 0.2 (-> this info handling max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) + ) + (let ((s4-2 (-> *part-id-table* 923))) + (dotimes (s3-0 2) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles exhaust-local-pos s3-0) (-> s5-0 mat0)) + (vector-rotate*! (-> s5-0 vec1) (-> this info particles exhaust-local-dir s3-0) (-> s5-0 mat0)) + (vector+float*! (-> s5-0 vec2) (-> this rbody lin-velocity) (-> s5-0 vec1) (-> s5-0 float0)) + (let ((v1-116 (-> this info particle-common part-vel)) + (a0-40 (-> s5-0 vec2)) + (f0-46 300.0) + ) + (vector-float*! v1-116 a0-40 (/ 1.0 f0-46)) + ) + (set! (-> s4-2 birthaccum) (the-as float (-> this exhaust-part-accum s3-0))) + (let ((t9-23 sp-launch-particles-var) + (a0-41 (-> this info particle-common sp-system2d)) + (a1-33 s4-2) + (a2-9 *launch-matrix*) + ) + (set! (-> a2-9 trans quad) (-> s5-0 vec0 quad)) + (t9-23 a0-41 a1-33 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (set! (-> this exhaust-part-accum s3-0) (the-as sparticle-launch-control (-> s4-2 birthaccum))) + ) + ) + ) + (when (< (-> this hit-points) 0.75) + (let* ((f28-1 (+ -32768.0 (* 32768.0 (rand-vu)))) + (f24-0 (* 65536.0 (rand-vu))) + (f30-10 (cos f28-1)) + (f28-2 (sin f28-1)) + (f26-0 (cos f24-0)) + ) + (set! (-> s5-0 vec3 x) (* f30-10 (sin f24-0))) + (set! (-> s5-0 vec3 y) f28-2) + (set! (-> s5-0 vec3 z) (* f30-10 f26-0)) + ) + (set! sv-224 (the-as sparticle-launcher #f)) + (set! sv-228 (the-as sparticle-launcher #f)) + (cond + ((< (-> this hit-points) 0.25) + (set! sv-224 (-> *part-id-table* 925)) + (set! sv-228 (-> *part-id-table* 921)) + ) + ((< (-> this hit-points) 0.5) + (set! sv-224 (-> *part-id-table* 928)) + ) + (else + (if (< (rand-vu) 0.05) + (set! sv-224 (-> *part-id-table* 930)) + ) + ) + ) + (when sv-224 + (set! (-> s5-0 byte0) 0) + (dotimes (s4-3 2) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles smoke-local-pos s4-3) (-> s5-0 mat0)) + (vector-rotate*! (-> s5-0 vec2) (-> this info particles smoke-local-vel s4-3) (-> s5-0 mat0)) + (vector+! (-> s5-0 vec2) (-> s5-0 vec2) (-> this rbody lin-velocity)) + (vector+float*! (-> s5-0 vec2) (-> s5-0 vec2) (-> s5-0 vec3) (* 24576.0 (rand-vu))) + (let ((v1-155 (-> this info particle-common part-vel)) + (a0-50 (-> s5-0 vec2)) + (f0-63 300.0) + ) + (vector-float*! v1-155 a0-50 (/ 1.0 f0-63)) + ) + (when (and sv-228 (< (rand-vu) 0.005)) + (let ((t9-35 sp-launch-particles-var) + (a0-51 (-> this info particle-common sp-system2d)) + (a1-43 sv-228) + (a2-12 *launch-matrix*) + ) + (set! (-> a2-12 trans quad) (-> s5-0 vec0 quad)) + (t9-35 a0-51 a1-43 a2-12 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (+! (-> s5-0 byte0) 1) + ) + (set! (-> sv-224 birthaccum) (the-as float (-> this smoke-part-accum s4-3))) + (let ((t9-36 sp-launch-particles-var) + (a0-52 (-> this info particle-common sp-system2d)) + (a1-44 sv-224) + (a2-13 *launch-matrix*) + ) + (set! (-> a2-13 trans quad) (-> s5-0 vec0 quad)) + (t9-36 a0-52 a1-44 a2-13 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (set! (-> this smoke-part-accum s4-3) (the-as sparticle-launch-control (-> sv-224 birthaccum))) + ) + (if (> (-> s5-0 byte0) 0) + (sound-play "damage-zaps" :id (-> this damage-zap-sound-id)) + ) + ) + ) + (when (>= (-> this scrape-sound-envelope) 0.75) + (let ((a1-46 (-> *part-id-table* 920)) + (t9-38 sp-launch-particles-var) + (a0-55 (-> this info particle-common sp-system2d)) + (a2-15 *launch-matrix*) + ) + (set! (-> a2-15 trans quad) (-> this impact-pos quad)) + (t9-38 a0-55 a1-46 a2-15 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +(defun vehicle-draw-thruster ((arg0 vehicle-particle-common-info) (arg1 vehicle-draw-thruster-params)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'vehicle-thruster-work))) + (set! (-> s5-0 vec2 quad) (-> arg1 trans quad)) + (quaternion-copy! (-> s5-0 quat1) (-> arg1 quat)) + (quaternion-rotate-local-x! (-> s5-0 quat1) (-> s5-0 quat1) 32768.0) + (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) + (set! (-> s5-0 vec4 quad) (-> s5-0 vec0 quad)) + (let ((f0-0 (rand-vu-float-range 1.0 1.33))) + (set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust))) + (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (* 0.5 (-> s5-0 float0)))) + ) + (let ((a1-5 (-> s5-0 vec3))) + (let ((v1-4 (-> arg1 trans))) + (let ((a0-9 (-> s5-0 vec4))) + (let ((a2-2 (* 0.25 (-> s5-0 float0)))) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-4 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-5 quad) vf6) + ) + (quad-copy! (the-as pointer (-> s5-0 glow)) (the-as pointer (-> arg0 thruster-glow-template)) 4) + (let* ((v1-5 (-> s5-0 glow)) + (a1-7 (-> s5-0 vec3)) + (f0-5 (-> v1-5 position w)) + ) + (set! (-> v1-5 position quad) (-> a1-7 quad)) + (set! (-> v1-5 position w) f0-5) + ) + 0 + (set! (-> s5-0 glow color y) (rand-vu-float-range 0.0 64.0)) + (set! (-> s5-0 glow color w) (* (-> arg1 fog-fade) (+ (* 16.0 (-> arg1 thrust)) (* 4.0 (rand-vu))))) + (let ((f0-13 (* 4.0 (-> s5-0 float1)))) + (set! (-> s5-0 glow position w) f0-13) + (set! (-> s5-0 glow size-y) f0-13) + (set! (-> s5-0 glow size-probe) (* 0.025 f0-13)) + ) + (add! *simple-sprite-system* (-> s5-0 glow)) + (let ((v1-15 (-> s5-0 vec3))) + (let ((a0-14 (-> arg1 trans))) + (let ((a1-11 (-> s5-0 vec4))) + (let ((a2-5 (* 0.5 (-> s5-0 float0)))) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-14 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-15 quad) vf6) + ) + (set! (-> arg0 part-thruster-x initial-valuef) (-> s5-0 float1)) + (set! (-> arg0 part-spec2 initial-valuef) (-> s5-0 float0)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (launch-particles + :system (-> arg0 sp-system3d) + (-> arg0 part-thruster) + (the-as matrix (-> s5-0 quat0)) + :origin-is-matrix #t + ) + (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) + (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (launch-particles + :system (-> arg0 sp-system3d) + (-> arg0 part-thruster) + (the-as matrix (-> s5-0 quat0)) + :origin-is-matrix #t + ) + (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) + (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (launch-particles + :system (-> arg0 sp-system3d) + (-> arg0 part-thruster) + (the-as matrix (-> s5-0 quat0)) + :origin-is-matrix #t + ) + ) + 0 + (none) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc index ee54c4c123..9824a222d9 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc @@ -5,5 +5,782 @@ ;; name in dgo: vehicle-h ;; dgos: HGA, LPATK, RAILA, LFACCAR, CWI, WASALL, LFACTORY, COMBA +;; +++vehicle-wheel-flag +(defenum vehicle-wheel-flag + :type uint64 + :bitfield #t + (vwf0 0) + (vwf1 1) + (vwf2 2) + (vwf3 3) + (vwf4 4) + (vwf5 5) + ) +;; ---vehicle-wheel-flag + + +;; +++vehicle-seat-flag +(defenum vehicle-seat-flag + :type uint8 + :bitfield #t + (vsf0 0) + (vsf1 1) + (vsf2 2) + ) +;; ---vehicle-seat-flag + + +;; +++vehicle-flag +(defenum vehicle-flag + :type uint64 + :bitfield #t + (enable-collision 0) + (disturbed 1) + (damaged 2) + (dead 3) + (player-touching 4) + (player-edge-grabbing 5) + (player-standing-on 6) + (player-impulse-force 7) + (player-contact-force 8) + (persistent 9) + (impact 10) + (in-air 11) + (on-ground 12) + (on-flight-level 13) + (riding 14) + (player-grabbed 15) + (player-dismounting 16) + (player-driving 17) + (net-player-driving 18) + (ai-driving 19) + (waiting-for-player 20) + (ignition 21) + (nav-spheres 22) + (turbo-boost 23) + (reverse-gear 24) + (traffic-managed 25) + (flight-level-transition 26) + (flight-level-transition-ending 27) + (camera-bike-mode 28) + (camera-rapid-tracking-mode 29) + (camera 30) + (camera-inside-view 31) + (camera-look-mode 32) + (alert 33) + (in-pursuit 34) + (target-in-sight 35) + (rammed-target 36) + (sounds 37) + (particles 38) + (joints 39) + (lights-on 40) + (lights-update 41) + (lights-dead 42) + (no-hijack 43) + (unique 44) + (tracking-mode 45) + (overturned 46) + (gun-dark-2-zero-g 47) + (ignore-damage 48) + (ignore-impulse 49) + (player-killed 50) + (draw-marks 51) + (vf52 52) + (vf53 53) + (vf54 54) + (vf55 55) + (vf56 56) + ) +;; ---vehicle-flag + + +(deftype mystery-vehicle-type0 (structure) + "vehicle::check-player-get-on" + ((mat matrix 3 :inline :offset-assert 0) + (vec vector 2 :inline :offset-assert 192) + (proc handle 2 :offset-assert 224) + (cquery collide-query :inline :offset-assert 240) + (floats float 5 :offset-assert 780) + ) + ) + +(deftype mystery-vehicle-type1 (structure) + "vehicle::94" + ((vec0 vector :inline :offset 0) + (time uint32 :offset 0) + (word01 uint32 :offset 4) + (word00 uint32 :offset 8) + (float00 float :offset 16) + (word02 uint32 :offset 20) + ) + ) + +(deftype mystery-vehicle-type2 (structure) + "vehicle::93" + ((time uint32 :offset 0) + (word01 uint32 :offset 4) + (word00 uint32 :offset 8) + (float00 float :offset 16) + (word02 uint32 :offset 20) + ) + ) + +(deftype vehicle-thruster-work (structure) + ((quat0 quaternion :inline :offset 0) + (vec0 vector :inline :offset 32) + (vec1 vector :inline :offset 48) + (quat1 quaternion :inline :offset 64) + (vec2 vector :inline :offset 80) + (vec3 vector :inline :offset 96) + (vec4 vector :inline :offset 112) + (float0 float :offset 128) + (float1 float :offset 132) + (glow sprite-glow-data :inline :offset 144) + ) + ) + +(deftype vehicle-stack-type3 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 vector :inline :offset 32) + (vec3 vector :inline :offset 48) + (mat0 matrix :inline :offset 64) + (glow sprite-glow-data :inline :offset 128) + (float0 float :offset 192) + (float1 float :offset 196) + (byte0 int8 :offset 200) + ) + ) + +(declare-type vehicle-physics-work structure) +(declare-type vehicle-wheel-state structure) + +;; +++vehicle-type-u8 +(defenum vehicle-type-u8 + :type uint8 + :copy-entries vehicle-type + ) +;; ---vehicle-type-u8 + + ;; DECOMP BEGINS +(deftype vehicle-info (structure) + ((handle-by-vehicle-type handle 44) + ) + ) + + +(deftype vehicle-lookup-info (structure) + ((turn-radius meters) + (throttle-turning float) + (throttle-straight float) + ) + ) + + +(deftype vehicle-control-point (structure) + ((local-pos vector :inline) + (normal vector :inline) + ) + ) + + +(deftype vehicle-attach-point (structure) + ((local-pos vector :inline) + (rot vector :inline) + ) + ) + + +(deftype vehicle-wheel-info (structure) + ((local-pos vector :inline) + (flags vehicle-wheel-flag) + (callback (function rigid-body-object vehicle-wheel-state vehicle-wheel-info none)) + (inertia float) + (radius float) + (susp-arm-length float) + (steer-arm-length float) + (scale float) + (travel float) + (probe-y-offset float) + (width float) + (suspension-spring float) + (suspension-damping float) + (forward-grip float) + (side-grip float) + (max-brake-torque float) + (camber float) + (settle-pos float) + (probe-radius float) + (tread-texture string) + (tread-tid texture-id) + ) + ) + + +(deftype vehicle-engine-info (structure) + ((max-torque float) + (inertia float) + (drag float) + (idle-rpm float) + (clutch-min-rpm float) + (clutch-max-rpm float) + (min-rpm float) + (max-rpm float) + (peak-torque-rpm float) + (powerband-width-rpm float) + ) + :pack-me + ) + + +(deftype vehicle-transmission-info (structure) + ((inertia float) + (upshift-rpm float) + (downshift-rpm float) + (final-drive-ratio float) + (gear-ratio-array float 8) + (gear-count int8) + ) + ) + + +(deftype vehicle-handling-info (structure) + ((max-engine-thrust meters) + (inv-max-engine-thrust float) + (engine-response-rate float) + (engine-intake-factor float) + (brake-factor float) + (turbo-boost-factor float) + (turbo-boost-duration uint16) + (max-xz-speed meters) + (player-turn-anim-bias float) + (player-turn-anim-min float) + (player-turn-anim-max float) + (pilot-x-accel-factor float) + (pilot-y-accel-factor float) + (pilot-z-accel-factor float) + (ground-probe-distance meters) + (ground-probe-offset meters) + (cos-ground-effect-angle float) + (spring-lift-factor float) + (air-steering-factor float) + (air-drag-factor float) + (steering-fin-angle float) + (steering-thruster-factor float) + (steering-thruster-max-gain float) + (steering-thruster-half-gain-speed meters) + (tire-steering-angle float) + (tire-steering-speed-factor float) + (tire-steering-speed-bias float) + (ackermann-factor float) + (tire-friction-factor float) + (tire-static-friction float) + (tire-static-friction-speed meters) + (tire-dynamic-friction float) + (tire-dynamic-friction-speed meters) + (tire-inv-max-friction-speed float) + (airfoil-factor float) + (drag-force-factor float) + (rolling-resistance float) + (speed-scrubbing-drag float) + (speed-limiting-drag float) + (pitch-control-factor float) + (roll-control-factor float) + (roll-angle float) + (jump-thrust-factor float) + (buoyancy-factor float) + (water-drag-factor float) + (player-weight float) + (player-shift-x meters) + (player-shift-z meters) + (air-roll-torque float) + (air-pitch-torque float) + (air-angular-damping float) + (hop-turn-torque float) + (ground-torque-scale float) + (ai-steering-factor float) + (ai-throttle-factor float) + ) + :pack-me + ) + + +(deftype vehicle-physics-model-info (structure) + ((lift-thruster-count int8) + (roll-thruster-count int8) + (stabilizer-count int8) + (inv-lift-thruster-count float) + (lift-thruster-array vehicle-attach-point 4 :inline) + (roll-thruster-array vehicle-attach-point 2 :inline) + (stabilizer-array vehicle-attach-point 6 :inline) + (engine-thrust-local-pos vector :inline) + (brake-local-pos vector :inline) + (wheel-count int8) + (drive-wheel-count int8) + (front-wheel vehicle-wheel-info :inline) + (rear-wheel vehicle-wheel-info :inline) + ) + ) + + +(deftype vehicle-camera-info (structure) + ((string-min-height meters) + (string-max-height meters) + (string-min-length meters) + (string-max-length meters) + (min-fov float) + (max-fov float) + (head-offset float) + (foot-offset float) + (normal-max-angle-offset float) + (air-max-angle-offset float) + (max-lookaround-speed float) + (look-pos-array vector 4 :inline) + (look-front vector :inline :overlay-at (-> look-pos-array 0)) + (look-left vector :inline :overlay-at (-> look-pos-array 1)) + (look-right vector :inline :overlay-at (-> look-pos-array 2)) + (look-rear vector :inline :overlay-at (-> look-pos-array 3)) + ) + ) + + +(deftype vehicle-sound-loop-info (structure) + ((sound sound-name) + (speed float) + (min-speed float) + (max-speed float) + (pitch-offset float) + (pitch-scale float) + (min-pitch float) + (max-pitch float) + ) + ) + + +(deftype vehicle-sound-info (structure) + ((engine-pitch-scale float) + (engine-pitch-offset float) + (engine-pitch-mod-amp float) + (engine-sound-select int8) + (thrust-sound sound-name :offset 16) + (scrape-sound sound-name) + (glance-sound sound-name) + (impact-sound sound-name) + (impact2-sound sound-name) + (explode-sound sound-name) + (explode2-sound sound-name) + (extra-sound sound-name) + (water-sound sound-name) + (jump-sound sound-name) + (turbo-sound sound-name) + (damage-sound sound-name) + (bank-replace pair) + (idle-rpm float) + (idle-pitch-scale float) + (idle-crossover-rpm float) + (engine-rpm float) + (engine-crossover-rpm float) + (start-sound sound-name :offset 240) + (stop-sound sound-name) + (idle-sound sound-name) + (engine-sound sound-name) + (engine-load-sound sound-name) + (susp-creak-sound sound-name) + (susp-bottom-out-sound sound-name) + (susp-speed-threshold float) + (tire-roll-sounds vehicle-sound-loop-info 4 :inline) + (tire-slide-sounds vehicle-sound-loop-info 2 :inline) + (tire-roll-hum-sound vehicle-sound-loop-info :inline :overlay-at (-> tire-roll-sounds 0)) + (tire-roll-dirt-sound vehicle-sound-loop-info :inline :offset 416) + (tire-roll-sand-sound vehicle-sound-loop-info :inline :offset 464) + (tire-roll-knobby-sound vehicle-sound-loop-info :inline :offset 512) + (tire-slide-road-sound vehicle-sound-loop-info :inline :overlay-at (-> tire-slide-sounds 0)) + (tire-slide-dirt-sound vehicle-sound-loop-info :inline :offset 608) + ) + ) + + +(deftype vehicle-particle-info (structure) + ((headlight-count int8) + (taillight-count int8) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (headlight-local-pos vector 3 :inline) + (taillight-local-pos vector 2 :inline) + ) + ) + + +(deftype vehicle-section-info (structure) + ((damage-seg-array uint64 3) + (damage-seg-count int8) + ) + :pack-me + ) + + +(deftype vehicle-damage-info (structure) + ((inv-toughness-factor float) + (hit-points float) + (inv-hit-points float) + (hit-threshold float) + (hit-small float) + (hit-big float) + (hit-deadly float) + (impact-damage-factor float) + (section-count int8) + (section-array vehicle-section-info 4 :inline) + (section-bike-front vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-bike-rear vehicle-section-info :inline :offset 72) + (section-car-front-left vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-car-rear-left vehicle-section-info :inline :overlay-at section-bike-rear) + (section-car-front-right vehicle-section-info :inline :offset 104) + (section-car-rear-right vehicle-section-info :inline :offset 136) + ) + ) + + +(deftype vehicle-setup-info (structure) + ((settle-height float) + (settle-rot-x float) + (shadow-bot-clip float) + (shadow-locus-dist float) + (look-select uint8) + (color-option-count int8) + (color-option-select int8) + (color vector) + (gun-yaw-min float) + (gun-yaw-max float) + (gun-pitch-min float) + (gun-pitch-max float) + (gun-z-offset float) + ) + :pack-me + ) + + +(deftype vehicle-seat-info (structure) + ((data uint8 16) + (position vector :inline :overlay-at (-> data 0)) + (pos-x float :overlay-at (-> data 0)) + (pos-y float :overlay-at (-> data 4)) + (pos-z float :overlay-at (-> data 8)) + (angle int16 :overlay-at (-> data 12)) + (flags vehicle-seat-flag :overlay-at (-> data 14)) + ) + ) + + +(deftype vehicle-grab-rail-info (structure) + ((local-pos vector 2 :inline) + (normal vector :inline) + ) + ) + + +(deftype vehicle-rider-info (structure) + ((seat-count int8) + (rider-stance uint8) + (grab-rail-count int8) + (attach-point-count int8) + (grab-rail-array (pointer vehicle-grab-rail-info)) + (seat-array vehicle-seat-info 4 :inline) + (rider-hand-offset vector 2 :inline) + (attach-point-array (inline-array vehicle-attach-point)) + ) + ) + + +(deftype vehicle-explosion-info (joint-exploder-static-params) + ((skel skeleton-group) + (skel-name string) + (anim int32) + ) + ) + + +(deftype vehicle-particle-common-info (structure) + ((sp-system2d sparticle-system) + (sp-system3d sparticle-system) + (part-thruster sparticle-launcher) + (part-thruster-x sp-field-init-spec) + (part-spec2 sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) + (headlight-glow-template sprite-glow-data) + (taillight-glow-template sprite-glow-data) + (thruster-glow-template sprite-glow-data) + ) + (:methods + (init! (_type_) none) + ) + ) + + +(deftype rigid-body-vehicle-constants (rigid-body-object-constants) + ((flags uint32) + (object-type uint8) + (guard-type uint8) + (vehicle-type vehicle-type-u8) + (engine vehicle-engine-info :inline) + (transmission vehicle-transmission-info :inline) + (handling vehicle-handling-info :inline) + (target-speed-offset meters) + (turning-accel meters) + (camera vehicle-camera-info :inline) + (sound vehicle-sound-info :inline) + (particles vehicle-particle-info :inline) + (damage vehicle-damage-info :inline) + (physics-model vehicle-physics-model-info :inline) + (setup vehicle-setup-info :inline) + (rider vehicle-rider-info :inline) + (explosion vehicle-explosion-info) + (explosion-part int32) + (debris debris-static-params) + (name-text text-id) + (particle-common vehicle-particle-common-info) + ) + (:methods + (init-part! (_type_) none) + ) + ) + + +(deftype vehicle-section (structure) + ((damage float) + ) + :allow-misaligned + ) + + +(deftype vehicle (rigid-body-object) + ((info rigid-body-vehicle-constants :override) + (v-flags vehicle-flag :overlay-at flags) + (unknown-flags vehicle-flag :offset 296) + (squad squad-control) + (control-hook (function vehicle vehicle-controls)) + (controls vehicle-controls :inline) + (prev-controls vehicle-controls :inline) + (engine-power-factor float) + (force-scale float) + (target-distance2 meters) + (water-flags uint32) + (target-acceleration vector :inline) + (impact-pos vector :inline) + (impact-local-pos vector :inline) + (lin-acceleration vector :inline) + (hit-points float) + (damage-factor float) + (crash-level int8) + (force-level int8) + (traffic-hash-id int8) + (traffic-priority-id int8) + (power-fluctuation-factor float) + (power-level float) + (overlap-player-counter uint8) + (physics-counter uint8) + (cam-view int8) + (brake-factor float) + (cam-speed-interp float) + (camera-dist2 float) + (player-dist2 float) + (bound-radius float) + (rider-array handle 4) + (impact-proc handle) + (impact-pat uint32) + (impact-time uint32) + (prev-impact-time uint32) + (sent-attack-time uint32) + (air-time uint32) + (water-time uint32) + (offscreen-time uint32) + (crash-time uint32) + (turbo-boost-time uint32) + (player-dismount-time uint32) + (crash-duration uint16) + (turbo-boost-duration uint16) + (turbo-boost-factor float) + (crash-impulse float) + (water-height float) + (lights-factor float) + (outgoing-attack-id uint32) + (fog-fade float) + (scrape-sound-id sound-id) + (damage-zap-sound-id sound-id) + (scrape-sound-envelope float) + (exhaust-part-accum sparticle-launch-control 2) + (smoke-part-accum sparticle-launch-control 2) + (section-array vehicle-section 4 :inline) + ) + (:state-methods + inactive + waiting + player-control + crash + explode + die + ) + (:methods + (vehicle-method-62 (_type_) none) + (vehicle-method-63 (_type_) none) + (vehicle-method-64 (_type_) none) + (vehicle-method-65 (_type_) int) + (vehicle-method-66 (_type_ vector int) none) + (get-rider-in-seat (_type_ int) process) + (vehicle-method-68 (_type_) none) + (put-rider-in-seat (_type_ int process) none) + (vehicle-method-70 (_type_) none) + (get-best-seat (_type_ vector vehicle-seat-flag int) int) + (remove-riders (_type_ handle) none) + (vehicle-method-73 (_type_) none) + (vehicle-method-74 (_type_ int time-frame) none) + (vehicle-method-75 (_type_) none) + (vehicle-method-76 (_type_) none) + (vehicle-method-77 (_type_) none) + (vehicle-method-78 (_type_) none) + (vehicle-method-79 (_type_) none) + (vehicle-method-80 (_type_) none) + (vehicle-method-81 (_type_) none) + (vehicle-method-82 (_type_) none) + (vehicle-method-83 (_type_) none) + (vehicle-method-84 (_type_) none) + (vehicle-method-85 (_type_) none) + (vehicle-method-86 (_type_) none) + (vehicle-method-87 (_type_) none) + (vehicle-method-88 (_type_ vehicle-controls) none) + (init-reverse (_type_ vehicle-controls) none) + (control-hook-ai (_type_ vehicle-controls) none) + (control-hook-player (_type_ vehicle-controls) none) + (vehicle-method-92 (_type_ vehicle-controls) none) + (vehicle-method-93 (_type_) none) + (vehicle-method-94 (_type_) none) + (vehicle-method-95 (_type_ vector float) none) + (vehicle-method-96 (_type_ float) none) + (vehicle-method-97 (_type_ float vehicle-physics-work) none) + (vehicle-method-98 (_type_) none) + (vehicle-method-99 (_type_) none) + (vehicle-method-100 (_type_) none) + (vehicle-method-101 (_type_) none) + (vehicle-method-102 (_type_) symbol) + (vehicle-method-103 (_type_) none) + (vehicle-method-104 (_type_) none) + (vehicle-method-105 (_type_) none) + (vehicle-method-106 (_type_) none) + (vehicle-method-107 (_type_ int process) none) + (vehicle-method-108 (_type_ int) none) + (vehicle-method-109 (_type_) none) + (vehicle-method-110 (_type_) none) + (get-linear-accel! (_type_ vector) none) + (copy-vehicle-controls! (_type_ vehicle-controls) none) + (vehicle-method-113 (_type_ vector int int) none) + (vehicle-method-114 (_type_ int) none) + (vehicle-method-115 (_type_) none) + (vehicle-method-116 (_type_ symbol) none) + (vehicle-method-117 (_type_) none) + (vehicle-method-118 (_type_) none) + (vehicle-method-119 (_type_) none) + (apply-gravity (_type_ float) none) + (apply-gravity1 (_type_ float) none) + (vehicle-method-122 (_type_) none) + (vehicle-method-123 (_type_) none) + (vehicle-method-124 (_type_) none) + (vehicle-method-125 (_type_) none) + (vehicle-method-126 (_type_) none) + (check-player-get-on (_type_ process-focusable) symbol) + (vehicle-method-128 (_type_) symbol) + (vehicle-method-129 (_type_) none) + (vehicle-method-130 (_type_) none) + (vehicle-method-131 (_type_) none) + (vehicle-method-132 (_type_ traffic-object-spawn-params) none) + (vehicle-method-133 (_type_) none) + (vehicle-method-134 (_type_) none) + (vehicle-method-135 (_type_) none) + (vehicle-method-136 (_type_) none) + (vehicle-method-137 (_type_) none) + (vehicle-method-138 (_type_) none) + (vehicle-method-139 (_type_) none) + (vehicle-method-140 (_type_) none) + (vehicle-method-141 (_type_) symbol) + (vehicle-method-142 (_type_) none) + (vehicle-method-143 (_type_ process) object) + (vehicle-method-144 (_type_) none) + (vehicle-method-145 (_type_) none) + (vehicle-method-146 (_type_ vector) none) + (vehicle-method-147 (_type_) none) + (vehicle-method-148 (_type_) none) + (vehicle-method-149 (_type_) none) + (vehicle-method-150 (_type_) none) + (set-hit-points (_type_ float) none) + ) + ) + + +(deftype vehicle-probe-work (structure) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (probe-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (velocity vector :inline) + (tire-force vector :inline) + (wheel-axis vector :inline) + ) + ) + + +(deftype vehicle-physics-work (structure) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (lift-dir vector :inline) + (normal vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal vector :inline) + (impulse float) + (vel-dot-norm float) + (friction-coef float) + (speed-factor float) + (probe-work-array vehicle-probe-work 4 :inline) + ) + ) + + +(deftype vehicle-draw-thruster-params (structure) + ((quat quaternion :inline) + (trans vector :inline) + (thrust float) + (width float) + (length float) + (fog-fade float) + ) + ) + + +(defun meters-per-sec->mph ((arg0 float)) + (* 0.00031568037 arg0) + ) + +(deftype debug-vehicle-work (basic) + ((impact-time time-frame) + (impact rigid-body-impact :inline) + (prim-sphere1 sphere :inline) + (prim-sphere2 sphere :inline) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-part.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-part.gc index 2436a1d341..1e34459e40 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-part.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-part.gc @@ -7,3 +7,709 @@ ;; DECOMP BEGINS +(defpart 916 + :init-specs ((:texture (common-white common)) + (:birth-func 'birth-func-laser-pointer) + (:num 1.0) + (:scale-x (meters 0.075) (meters 0.05)) + (:scale-y (meters 40)) + (:r 255.0) + (:g 0.0) + (:b :copy g) + (:a 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 917 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.15)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b :copy g) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpart 918 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0) + (:b :copy g) + (:a 48.0 16.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpart 919 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.025)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 32.0) + (:b :copy g) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 920 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0 2.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.025) (meters 0.01)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375) (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -0.85 -0.85) + (:fade-g -1.7 -1.7) + (:fade-b -8.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 921 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0 2.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.025) (meters 0.01)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375) (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -0.85 -0.85) + (:fade-g -1.7 -1.7) + (:fade-b -8.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 922 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y (meters 3)) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b :copy g) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 923 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 0.1 0.2) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 160.0) + (:b 96.0) + (:a 1.0 1.0) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.64) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.94) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.167)) + (:next-launcher 924) + ) + ) + +(defpart 924 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpart 925 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 1.0 0.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 64.0 32.0) + (:vel-y (meters 0.00033333333) (meters 0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1)) + (:next-launcher 926) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0.1)) + ) + ) + +(defpart 926 + :init-specs ((:scalevel-x (meters 0.005)) + (:scalevel-y :copy scalevel-x) + (:fade-r -8.5) + (:fade-g -4.266667) + (:fade-b 0.0) + (:next-time (seconds 0.1)) + (:next-launcher 927) + ) + ) + +(defpart 927 + :init-specs ((:r 0.0 64.0) + (:g :copy r) + (:b :copy g) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.24615385 -0.64) + ) + ) + +(defpart 928 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 0.4) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:vel-y (meters 0.00033333333) (meters 0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667 -4.266667) + (:fade-g :copy fade-r) + (:fade-b :copy fade-g) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1)) + (:next-launcher 929) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0.1)) + ) + ) + +(defpart 929 + :init-specs ((:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.24615385 -0.64) + ) + ) + +(defpart 930 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 1.0 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:vel-y (meters 0.00033333333) (meters 0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667 -4.266667) + (:fade-g :copy fade-r) + (:fade-b :copy fade-g) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1)) + (:next-launcher 929) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0.1)) + ) + ) + +(defpartgroup group-vehicle-explosion + :id 224 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 931 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 932 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 933 :period (seconds 3) :length (seconds 0.05)) + (sp-item 934 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 935 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 936 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 937 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 932 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 938) + ) + ) + +(defpart 938 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +(defpart 937 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 939) + (:conerot-x '*sp-temp*) + ) + ) + +(defpart 936 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 939) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 939 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 940)) + ) + +(defpart 940 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 941) + ) + ) + +(defpart 941 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 942) + ) + ) + +(defpart 942 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +(defpart 931 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 943) + ) + ) + +(defpart 943 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +(defpart 935 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 944) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 944 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 945) + ) + ) + +(defpart 945 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +(defpart 933 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 946) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +(defpart 946 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 947) + ) + ) + +(defpart 947 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +(defpart 934 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defpartgroup group-vehicle-engine-start + :id 225 + :duration (seconds 0.535) + :linger-duration (seconds 1) + :flags (sp0 sp4 sp6) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 948 :flags (sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.535)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.335)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.235)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.135)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.067)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.05)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.035)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 950 :flags (sp7) :period (seconds 1) :length (seconds 0.035)) + (sp-item 951 :period (seconds 1) :length (seconds 0.017)) + ) + ) + +(defpart 951 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:scalevel-x (meters 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -6.4) + (:fade-b -12.75) + (:fade-a -1.6) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 950 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 3.0 3.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.025) (meters 0.01)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375) (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -0.85 -0.85) + (:fade-g -1.7 -1.7) + (:fade-b -8.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 948 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 160.0) + (:b 96.0) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.0) + (:fade-g -1.0) + (:fade-b 1.0) + (:fade-a -0.21333334 -0.85333335) + (:accel-y (meters 0.00033333333) (meters 0.0005)) + (:friction 0.92 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.085)) + (:next-launcher 952) + (:conerot-x (degrees -30) (degrees 30)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 952 + :init-specs ((:fade-r 0.0 -0.85333335) (:fade-g :copy fade-r) (:fade-b :copy fade-g)) + ) + +(defpart 949 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 160.0) + (:b 96.0) + (:a 32.0 32.0) + (:vel-y (meters 0.006666667) (meters 0.013333334)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.0) + (:fade-g -1.0) + (:fade-b 1.0) + (:fade-a -0.21333334 -0.85333335) + (:accel-y (meters 0.00033333333) (meters 0.0005)) + (:friction 0.92 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.085)) + (:next-launcher 952) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc index d0408dc0ce..36b456d781 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc @@ -7,3 +7,81 @@ ;; DECOMP BEGINS +(defmethod vehicle-method-95 ((this vehicle) (arg0 vector) (arg1 float)) + (let ((f0-1 (- (-> arg0 y) (-> arg0 w)))) + (when (< f0-1 (-> this water-height)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 rvec quad) (-> arg0 quad)) + (let ((s3-0 (-> this info)) + (f1-3 (fmin (-> this water-height) (+ (-> arg0 y) (-> arg0 w)))) + ) + 0.0 + (let* ((f2-4 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> arg0 y)) (-> arg0 w))))) + (f30-0 (+ 0.5 (* -0.25 f2-4 f2-4 f2-4) (* 0.75 f2-4))) + ) + (set! (-> s5-0 rvec y) (* 0.5 (+ f0-1 f1-3))) + (rigid-body-control-method-23 (-> this rbody) (-> s5-0 rvec) (-> s5-0 fvec)) + (let* ((f0-8 + (* 0.025132721 (vector-length (-> s5-0 fvec)) (-> s3-0 handling water-drag-factor) (-> s3-0 info mass) f30-0) + ) + (f1-7 (-> arg0 w)) + (f0-9 (* f0-8 (* f1-7 f1-7))) + (f1-10 68719480000.0) + (f0-11 (fmin (* f0-9 (/ 1.0 f1-10)) (* 0.125 (/ 1.0 arg1) (-> s3-0 info mass)))) + ) + (vector-float*! (-> s5-0 uvec) (-> s5-0 fvec) (* -1.0 f0-11)) + ) + (apply-impact! (-> this rbody) (-> s5-0 rvec) (-> s5-0 uvec)) + (vector-reset! (-> s5-0 uvec)) + (let ((f0-18 (* 514718.12 (-> s3-0 handling buoyancy-factor) f30-0 (-> arg0 w) (-> arg0 w) (-> arg0 w))) + (f1-21 68719480000.0) + ) + (set! (-> s5-0 uvec y) (* f0-18 (/ 1.0 f1-21))) + ) + ) + ) + (apply-impact! (-> this rbody) (-> s5-0 rvec) (-> s5-0 uvec)) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-96 ((this vehicle) (arg0 float)) + (let ((s4-0 (-> this root root-prim)) + (s3-0 1) + ) + (when (< (-> this rbody position y) (+ (-> this water-height) (-> s4-0 local-sphere w))) + (when (zero? (-> s4-0 prim-core prim-type)) + (let ((v1-5 s4-0)) + (set! s4-0 (-> (the-as collide-shape-prim-group v1-5) child 0)) + (set! s3-0 (the-as int (-> v1-5 specific 0))) + ) + ) + (while (nonzero? s3-0) + (+! s3-0 -1) + (when (= (-> s4-0 prim-core prim-type) -1) + (let ((a1-1 (-> s4-0 prim-core))) + (if (< (- (-> a1-1 world-sphere y) (-> a1-1 world-sphere w)) (-> this water-height)) + (vehicle-method-95 this (the-as vector a1-1) arg0) + ) + ) + ) + (&+! s4-0 80) + ) + ) + ) + 0 + (none) + ) + +(defmethod apply-gravity ((this vehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) + +(defmethod apply-gravity1 ((this vehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-states.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-states.gc index 453d920b32..6009f2b577 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-states.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-states.gc @@ -7,3 +7,370 @@ ;; DECOMP BEGINS +(defstate idle (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (disable-physics! self) + (go-virtual waiting) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate inactive (vehicle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off 'rider-on 'rider-off) + (rbody-event-handler self proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self focus-status) (focus-status disable inactive)) + (disable-physics! self) + (rigid-body-object-method-43 self) + (vehicle-method-81 self) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (rigid-body-object-method-42 self) + (logclear! (-> self focus-status) (focus-status disable inactive)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +(defstate waiting (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-method-136 self) + (logior! (-> self v-flags) (vehicle-flag waiting-for-player nav-spheres)) + (logclear! (-> self v-flags) (vehicle-flag riding player-driving)) + (update-transforms (-> self root)) + (vehicle-method-140 self) + (let ((v1-13 (find-prim-by-id-logtest (-> self root) (the-as uint 32)))) + (when v1-13 + (set! (-> v1-13 prim-core collide-with) (collide-spec)) + (set! (-> v1-13 prim-core collide-as) (collide-spec)) + 0 + ) + ) + ) + :exit (behavior () + (logclear! (-> self v-flags) (vehicle-flag waiting-for-player)) + (let ((v1-3 (find-prim-by-id-logtest (-> self root) (the-as uint 32)))) + (when v1-3 + (set! (-> v1-3 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (vehicle-method-118 self) + ) + ) + +(defstate player-control (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (when (!= (-> arg0 prim-core prim-type) 1) + (logior! (-> arg0 prim-core collide-as) (collide-spec jak)) + (logior! (-> arg0 prim-core collide-with) (collide-spec blocking-plane)) + ) + (none) + ) + ) + (vehicle-method-135 self) + (logior! (-> self v-flags) (vehicle-flag riding player-driving nav-spheres)) + (set! (-> self v-flags) + (the-as + vehicle-flag + (logclear (-> self v-flags) (vehicle-flag reverse-gear camera-inside-view camera-look-mode)) + ) + ) + (set! (-> self unknown-flags) + (the-as vehicle-flag (logclear (-> self unknown-flags) (vehicle-flag camera-inside-view))) + ) + (set! (-> self controls flags) (vehicle-controls-flag)) + (set! (-> self controls prev-flags) (vehicle-controls-flag)) + (set! (-> self control-hook) + (the-as (function vehicle vehicle-controls) (method-of-object self control-hook-player)) + ) + (set! (-> self max-time-step) 0.02) + (apply-momentum! self) + (vehicle-method-99 self) + (vehicle-method-80 self) + (logior! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) + 0 + ) + :exit (behavior () + (logclear! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (when (!= (-> arg0 prim-core prim-type) 1) + (logclear! (-> arg0 prim-core collide-as) (collide-spec jak)) + (logclear! (-> arg0 prim-core collide-with) (collide-spec blocking-plane)) + ) + (none) + ) + ) + (if (and (not (logtest? (-> self info flags) 9216)) + (not (-> *setting-control* user-current pilot-death)) + (= (send-event *target* 'query 'mode) 'pilot) + ) + (send-event *target* 'end-mode 'pilot) + ) + (set! (-> self max-time-step) 0.033333335) + (vehicle-method-81 self) + (impulse-handler self) + (set! (-> self v-flags) + (the-as + vehicle-flag + (logclear (-> self v-flags) (vehicle-flag player-driving reverse-gear camera-inside-view camera-look-mode)) + ) + ) + (set! (-> self controls flags) (vehicle-controls-flag)) + (set! (-> self controls prev-flags) (vehicle-controls-flag)) + (remove-setting! 'sound-flava) + ) + :trans (behavior () + (set! (-> self v-flags) (the-as vehicle-flag (logclear (-> self v-flags) (vehicle-flag gun-dark-2-zero-g)))) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (not *target*) + (go-virtual waiting) + ) + (when (and (cpad-pressed? 0 triangle) (and (not (logtest? (-> self info flags) 1024)) + (-> *setting-control* user-current pilot-exit) + (not (focus-test? *target* dead hit grabbed)) + (!= (-> self crash-level) 3) + (< (-> self water-height) (-> self rbody position y)) + ) + ) + (when (send-event *target* 'end-mode 'pilot) + (let ((v1-32 (find-prim-by-id-logtest (-> self root) (the-as uint 64)))) + (if v1-32 + (set! (-> v1-32 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ) + (logior! (-> self v-flags) (vehicle-flag player-dismounting)) + (set! (-> self player-dismount-time) (the-as uint (current-time))) + (go-virtual waiting) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (local-vars (a0-3 int) (a0-5 int)) + (let* ((v1-1 (-> *perf-stats* data 18)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (vehicle-method-119 self) + (let ((v1-6 (-> *perf-stats* data 18))) + (b! (zero? (-> v1-6 ctrl)) cfg-4 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-3 pcr0) + (+! (-> v1-6 accum0) a0-3) + (.mfpc a0-5 pcr1) + (+! (-> v1-6 accum1) a0-5) + ) + (label cfg-4) + 0 + ) + ) + +(defstate crash (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (logclear! (-> self v-flags) (vehicle-flag player-driving net-player-driving)) + (set-time! (-> self state-time)) + (vehicle-method-124 self) + (set! (-> self crash-level) 3) + (vehicle-method-81 self) + (dotimes (gp-0 (-> self info rider seat-count)) + (send-event (handle->process (-> self rider-array gp-0)) 'vehicle-crash) + ) + ) + :trans (behavior () + (set! (-> self hit-points) (- (-> self hit-points) (* 0.5 (seconds-per-frame)))) + (if (and (time-elapsed? (-> self state-time) 1) (< (-> self hit-points) -0.25)) + (go-virtual explode) + ) + ) + :code sleep-code + :post (behavior () + (vehicle-method-117 self) + ) + ) + +(defbehavior vehicle-explode-post vehicle () + (local-vars (v1-42 float) (v1-47 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> self camera-dist2) (vector-vector-distance-squared (-> self root trans) (camera-pos))) + (set! (-> self player-dist2) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) + (cond + ((logtest? (-> self draw status) (draw-control-status on-screen)) + (set! (-> self offscreen-time) (the-as uint (current-time))) + ) + (else + (let ((v1-7 (new 'stack-no-clear 'array 'uint32 1))) + (set! (-> v1-7 0) (the-as uint (current-time))) + (if (or (>= (- (-> v1-7 0) (-> self offscreen-time)) (the-as uint 1500)) + (let ((f0-2 409600.0)) + (< (* f0-2 f0-2) (-> self camera-dist2)) + ) + ) + (go-virtual die) + ) + ) + ) + ) + (let ((f0-5 819200.0)) + (if (< (* f0-5 f0-5) (-> self camera-dist2)) + (go-virtual die) + ) + ) + (cond + ((logtest? (-> self rbody flags) (rigid-body-flag enable-physics)) + (vehicle-method-117 self) + (when (and (logtest? (-> self v-flags) (vehicle-flag disturbed)) (logtest? (-> self v-flags) (vehicle-flag impact))) + (let* ((f0-9 (* 0.0033333334 (the float (- (current-time) (-> self disturbed-time))))) + (f0-12 (* f0-9 f0-9 (-> self camera-dist2))) + (f1-5 0.000016276043) + (f0-13 (* f0-12 (* f1-5 f1-5))) + ) + (.lvf vf1 (&-> (-> self rbody ang-velocity) 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-42 vf1) + (if (and (< v1-42 f0-13) (begin + (.lvf vf1 (&-> (-> self rbody lin-velocity) 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-47 vf1) + (let ((f1-9 v1-47) + (f2-0 614.4) + ) + (< f1-9 (* f0-13 (* f2-0 f2-0))) + ) + ) + ) + (logclear! (-> self v-flags) (vehicle-flag disturbed)) + ) + ) + ) + (when (not (vehicle-method-102 self)) + (disable-physics! self) + (let ((gp-2 (-> self rbody))) + (logclear! (-> gp-2 flags) (rigid-body-flag enable-physics active)) + (vehicle-method-142 self) + (set! (-> gp-2 force quad) (the-as uint128 0)) + (set! (-> gp-2 torque quad) (the-as uint128 0)) + ) + 0 + (logior! (-> self v-flags) (vehicle-flag nav-spheres)) + (vehicle-method-140 self) + ) + ) + (else + (rigid-body-object-method-30 self) + ) + ) + 0 + (none) + ) + ) + +(defstate explode (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-method-116 self 'big-explosion) + (logior! (-> self focus-status) (focus-status dead)) + (set! (-> self crash-level) 3) + (set! (-> self force-level) 3) + (logclear! (-> self v-flags) (vehicle-flag persistent player-driving net-player-driving)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-dead) (-> self v-flags)))) + (vehicle-method-126 self) + (sound-play-by-name (-> self info sound explode-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play-by-name (-> self info sound explode2-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + (vehicle-method-106 self) + (vehicle-method-136 self) + (vehicle-method-100 self) + ) + :code sleep-code + :post (behavior () + (vehicle-explode-post) + ) + ) + +(defstate die (vehicle) + :virtual #t + :code (behavior () + (cond + ((logtest? (vehicle-flag traffic-managed) (-> self v-flags)) + (send-event (ppointer->process (-> self parent)) 'child-killed) + (vehicle-method-109 self) + ) + (else + (cleanup-for-death self) + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc index dadce99884..356adffcb4 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc @@ -7,3 +7,1257 @@ ;; DECOMP BEGINS +(defmethod init-part! ((this rigid-body-vehicle-constants)) + (set! (-> this particle-common) *vehicle-particle-common-info*) + (init! (-> this particle-common)) + 0 + (none) + ) + +(deftype vehicle-hud-request (structure) + ((handle handle) + (hack-handle-init symbol :overlay-at handle) + (priority float) + ) + :pack-me + ) + + +(deftype vehicle-hud-requests (structure) + ((time time-frame) + (requests vehicle-hud-request 4 :inline) + ) + :pack-me + (:methods + (vehicle-hud-requests-method-9 (_type_) none) + (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) + (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request) + ) + ) + + +(defmethod vehicle-hud-requests-method-9 ((this vehicle-hud-requests)) + (dotimes (v1-0 4) + (let ((a1-2 (-> this requests v1-0))) + (set! (-> a1-2 handle) (the-as handle #f)) + (set! (-> a1-2 priority) 0.0) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-hud-requests-method-10 ((this vehicle-hud-requests)) + (let ((v1-0 0)) + (let ((f0-0 0.0)) + (countdown (a1-0 4) + (let ((a2-2 (-> this requests a1-0))) + (when (and (handle->process (-> a2-2 handle)) (< f0-0 (-> a2-2 priority))) + (set! v1-0 a1-0) + (set! f0-0 (-> a2-2 priority)) + ) + ) + ) + ) + (-> this requests v1-0) + ) + ) + +(defmethod vehicle-hud-requests-method-11 ((this vehicle-hud-requests)) + (let ((v1-0 0)) + (let ((f0-0 (the-as float #x7f800000)) + (a1-1 4) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-1) + (+! a1-1 -1) + (let ((a2-2 (-> this requests a1-1))) + (b! (handle->process (-> a2-2 handle)) cfg-8 :delay (empty-form)) + (set! v1-0 a1-1) + (set! (-> a2-2 priority) 0.0) + (b! #t cfg-12 :delay (nop!)) + (label cfg-8) + (when (< (-> a2-2 priority) f0-0) + (set! v1-0 a1-1) + (set! f0-0 (-> a2-2 priority)) + ) + ) + (label cfg-10) + (b! (nonzero? a1-1) cfg-1 :delay (nop!)) + ) + (label cfg-12) + (-> this requests v1-0) + ) + ) + +(deftype vehicle-hud-chooser (structure) + ((cur vehicle-hud-requests :inline) + (last vehicle-hud-requests :inline) + ) + (:methods + (vehicle-hud-chooser-method-9 (_type_ handle float) symbol) + ) + ) + + +(defmethod vehicle-hud-chooser-method-9 ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) + (let ((s3-0 (current-time))) + (when (!= s3-0 (-> this cur time)) + (if (zero? (-> this cur time)) + (vehicle-hud-requests-method-9 (-> this cur)) + ) + (mem-copy! (the-as pointer (-> this last)) (the-as pointer (-> this cur)) 72) + (set! (-> this cur time) s3-0) + (vehicle-hud-requests-method-9 (-> this cur)) + ) + ) + (let ((v1-10 (vehicle-hud-requests-method-11 (-> this cur)))) + (when (< (-> v1-10 priority) arg1) + (set! (-> v1-10 handle) arg0) + (set! (-> v1-10 priority) arg1) + ) + ) + (let ((s4-1 #f)) + (let ((v1-12 (vehicle-hud-requests-method-10 (-> this last)))) + (if (and (handle->process arg0) (= (-> v1-12 handle) arg0)) + (set! s4-1 #t) + ) + ) + s4-1 + ) + ) + +(define *vehicle-hud-chooser* (new 'static 'vehicle-hud-chooser)) + +(define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info)) + +(defmethod deactivate ((this vehicle)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (vehicle-method-106 this) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +(defmethod rigid-body-object-method-37 ((this vehicle)) + (let ((t9-0 (method-of-type rigid-body-object rigid-body-object-method-37))) + (t9-0 this) + ) + (cond + ((logtest? #x10000 (-> this info flags)) + (set! (-> this rbody force-callback) (method-of-object this apply-gravity)) + ) + ((logtest? #x20000 (-> this info flags)) + (set! (-> this rbody force-callback) (method-of-object this apply-gravity1)) + ) + ) + (vehicle-method-62 this) + (init-part! (-> this info)) + (none) + ) + +(defmethod check-player-get-on ((this vehicle) (arg0 process-focusable)) + (with-pp + (and (not (focus-test? arg0 dead grabbed in-head under-water pole flut tube pilot)) + (or (not (focus-test? arg0 edge-grab)) (logtest? (-> this v-flags) (vehicle-flag player-edge-grabbing))) + (-> *setting-control* user-current pilot) + (let ((v1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-8 from) (process->ppointer pp)) + (set! (-> v1-8 num-params) 1) + (set! (-> v1-8 message) 'query) + (set! (-> v1-8 param 0) (the-as uint 'mode)) + (let ((v1-9 (send-event-function arg0 v1-8))) + (and (or (= v1-9 #f) (= v1-9 'board)) (or (logtest? (vehicle-flag waiting-for-player) (-> this v-flags)) + (-> *setting-control* user-current vehicle-hijacking) + ) + ) + ) + ) + ) + ) + ) + +(defmethod vehicle-method-128 ((this vehicle)) + #t + ) + +(defmethod vehicle-method-129 ((this vehicle)) + (let ((f0-0 (-> this player-dist2)) + (f1-0 102400.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type0))) + (set! (-> s5-0 floats 4) (+ 8192.0 (-> this root root-prim local-sphere w))) + (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) + (set! (-> s5-0 floats 4) (* 1.5 (-> s5-0 floats 4))) + ) + (set! (-> s5-0 mat 0 uvec quad) (-> (target-pos 0) quad)) + (+! (-> s5-0 mat 0 uvec y) 8192.0) + (let* ((v1-14 (-> s5-0 mat 1)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-5 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-14 rvec quad) a0-5) + (set! (-> v1-14 uvec quad) a1-0) + (set! (-> v1-14 fvec quad) a2-0) + (set! (-> v1-14 trans quad) a3-1) + ) + (set! (-> s5-0 mat 0 fvec quad) (-> s5-0 mat 1 trans quad)) + (set! (-> s5-0 floats 2) (- (-> s5-0 mat 0 uvec y) (-> s5-0 mat 0 fvec y))) + (let ((f0-9 (vector-vector-xz-distance-squared (-> s5-0 mat 0 uvec) (-> s5-0 mat 0 fvec))) + (f1-7 (-> s5-0 floats 4)) + ) + (when (and (< f0-9 (* f1-7 f1-7)) + (< -81920.0 (-> s5-0 floats 2)) + (and (< (-> s5-0 floats 2) 20480.0) *target* (check-player-get-on this *target*)) + ) + (let ((s2-0 #f) + (s4-1 #f) + (s3-0 #f) + ) + (let ((a2-2 (get-best-seat this (-> s5-0 mat 0 uvec) (vehicle-seat-flag vsf0) 0))) + (when (!= a2-2 -1) + (vehicle-method-66 this (-> s5-0 mat 0 fvec) a2-2) + (vector+float*! (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 fvec) (-> s5-0 mat 1 uvec) 4096.0) + ) + ) + (set! (-> s5-0 floats 1) (vector-vector-distance-squared (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 uvec))) + (let ((f0-14 (-> s5-0 floats 1)) + (f1-12 81920.0) + ) + (when (< f0-14 (* f1-12 f1-12)) + (set! (-> s5-0 cquery start-pos quad) (-> s5-0 mat 0 uvec quad)) + (vector-! (-> s5-0 cquery move-dist) (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 uvec)) + (let ((v1-38 (-> s5-0 cquery))) + (set! (-> v1-38 radius) 4096.0) + (set! (-> v1-38 collide-with) + (collide-spec + backgnd + crate + civilian + enemy + obstacle + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + ) + ) + (set! (-> v1-38 ignore-process0) this) + (set! (-> v1-38 ignore-process1) #f) + (set! (-> v1-38 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-38 action-mask) (collide-action solid)) + ) + (set! s2-0 (< (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)) 0.0)) + 0 + ) + ) + (when s2-0 + (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> this v-flags) (vehicle-flag player-edge-grabbing))) + (not (logtest? (vehicle-flag no-hijack gun-dark-2-zero-g) (-> this v-flags))) + ) + (set! s4-1 #t) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) + ) + (when (and (not s4-1) + (and (< (-> s5-0 floats 2) -8192.0) (not (logtest? (-> *target* focus-status) (focus-status edge-grab)))) + ) + (matrix-4x4-inverse! (-> s5-0 mat 2) (-> s5-0 mat 1)) + (vector-matrix*! (the-as vector (-> s5-0 mat)) (-> s5-0 mat 0 uvec) (-> s5-0 mat 2)) + (set! (-> s5-0 floats 0) 81920.0) + (dotimes (s2-1 (-> this info rider grab-rail-count)) + (let ((s1-0 (&+ (-> this info rider grab-rail-array) (* 48 s2-1)))) + (vector-! (-> s5-0 mat 0 trans) (the-as vector (-> s5-0 mat)) (the-as vector (&+ s1-0 0))) + (when #t + (let ((f30-0 (vector-segment-distance-point! + (the-as vector (-> s5-0 mat)) + (the-as vector (&+ s1-0 0)) + (the-as vector (&+ s1-0 16)) + (-> s5-0 mat 0 trans) + ) + ) + ) + (when (< f30-0 (-> s5-0 floats 0)) + (set! (-> s5-0 floats 0) f30-0) + (set! (-> s5-0 vec 0 quad) (-> s5-0 mat 0 trans quad)) + (vector-! (-> s5-0 vec 1) (the-as vector (&+ s1-0 16)) (the-as vector (&+ s1-0 0))) + (vector-normalize! (-> s5-0 vec 1) 1.0) + (set! s3-0 #t) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 f30-0))) + ) + ) + ) + ) + 0 + ) + ) + (set! s3-0 (or s4-1 s3-0)) + (when (and s3-0 (and (vehicle-hud-chooser-method-9 *vehicle-hud-chooser* (process->handle this) (-> s5-0 floats 3)) + (can-display-query? this "vehicle" (/ 1.0 (-> s5-0 floats 3))) + ) + ) + (cond + ((vehicle-method-128 this) + (vehicle-method-144 this) + (when (cpad-pressed? 0 triangle) + (cond + (s4-1 + (when (send-event *target* 'change-mode 'pilot this 0 #f) + (logior! (-> this v-flags) (vehicle-flag player-driving)) + (logclear! (-> this v-flags) (vehicle-flag ai-driving)) + (vehicle-method-80 this) + ) + ) + (else + (set! (-> s5-0 proc 0) (process->handle this)) + (mem-copy! (the-as pointer *pilot-edge-grab-info*) (the-as pointer (-> s5-0 vec)) 40) + (if (send-event *target* 'pilot-edge-grab *pilot-edge-grab-info*) + (format 0 "vehicle::check-player-get-on: (send-event *target* 'pilot-edge-grab self)~%") + ) + ) + ) + ) + ) + (else + (vehicle-method-145 this) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + ((and (logtest? (vehicle-flag player-driving) (-> this v-flags)) *target* (!= (-> this crash-level) 3)) + (if (focus-test? *target* pilot-riding) + (vehicle-method-134 this) + ) + ) + (else + (vehicle-method-81 this) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-144 ((this vehicle)) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 22 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-1 gp-0)) + (set! (-> v1-1 width) (the float 350)) + ) + (let ((v1-2 gp-0)) + (set! (-> v1-2 height) (the float 80)) + ) + (let ((v1-3 gp-0) + (a0-5 (-> *setting-control* user-default language)) + ) + (set! (-> v1-3 scale) (if (or (= a0-5 (language-enum korean)) (= a0-5 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text + (lookup-text! *common-text* (text-id text-0083) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-145 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-106 ((this vehicle)) + (sound-stop (-> this scrape-sound-id)) + (set! (-> this scrape-sound-envelope) 0.0) + 0 + (none) + ) + +(defmethod vehicle-method-63 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-64 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-65 ((this vehicle)) + (-> this info rider seat-count) + ) + +(defmethod vehicle-method-66 ((this vehicle) (arg0 vector) (arg1 int)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> this info rider seat-array arg1 position quad)) + (set! (-> v1-0 w) 1.0) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) + ) + 0 + (none) + ) + +(defmethod get-rider-in-seat ((this vehicle) (arg0 int)) + (let ((v0-0 (the-as process #f))) + (if (< arg0 (-> this info rider seat-count)) + (set! v0-0 (handle->process (-> this rider-array arg0))) + ) + v0-0 + ) + ) + +;; WARN: Return type mismatch process vs none. +(defmethod vehicle-method-68 ((this vehicle)) + (let ((gp-0 (the-as process #f))) + (countdown (s4-0 (-> this info rider seat-count)) + (when (logtest? (-> this info rider seat-array s4-0 flags) (vehicle-seat-flag vsf0)) + (let ((v1-7 (get-rider-in-seat this s4-0))) + (if v1-7 + (set! gp-0 v1-7) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod get-best-seat ((this vehicle) (arg0 vector) (arg1 vehicle-seat-flag) (arg2 int)) + (let ((gp-0 -1)) + (let ((f30-0 (the-as float #x7f800000)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s0-0 (-> this info rider seat-count)) + (when (logtest? arg1 (-> this info rider seat-array s0-0 flags)) + (let ((v1-7 arg2)) + (when (cond + ((zero? v1-7) + #t + ) + ((= v1-7 1) + (not (get-rider-in-seat this s0-0)) + ) + ((= v1-7 2) + (get-rider-in-seat this s0-0) + ) + (else + #f + ) + ) + (vehicle-method-66 this s1-0 s0-0) + (let ((f0-0 (vector-vector-distance-squared arg0 s1-0))) + (when (< f0-0 f30-0) + (set! f30-0 f0-0) + (set! gp-0 s0-0) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +(defmethod remove-riders ((this vehicle) (arg0 handle)) + (let ((v1-1 (-> this info rider seat-count))) + (dotimes (a2-0 v1-1) + (if (= arg0 (handle->process (-> this rider-array a2-0))) + (set! (-> this rider-array a2-0) (the-as handle #f)) + ) + ) + ) + 0 + (none) + ) + +(defmethod put-rider-in-seat ((this vehicle) (arg0 int) (arg1 process)) + (if (< arg0 (-> this info rider seat-count)) + (set! (-> this rider-array arg0) (process->handle arg1)) + ) + 0 + (none) + ) + +(defmethod vehicle-method-113 ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector+! + v1-0 + (the-as vector (-> this info rider seat-array arg1)) + (-> this info rider rider-hand-offset arg2) + ) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch uint vs none. +(defmethod vehicle-method-70 ((this vehicle)) + (-> this info rider rider-stance) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod vehicle-method-73 ((this vehicle)) + (-> this controls steering) + (none) + ) + +(defmethod get-linear-accel! ((this vehicle) (arg0 vector)) + (set! (-> arg0 quad) (-> this lin-acceleration quad)) + 0 + (none) + ) + +(defmethod copy-vehicle-controls! ((this vehicle) (arg0 vehicle-controls)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> this controls)) 24) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod vehicle-method-150 ((this vehicle)) + (-> this hit-points) + (none) + ) + +(defmethod set-hit-points ((this vehicle) (arg0 float)) + (set! (-> this hit-points) arg0) + 0 + (none) + ) + +(defmethod apply-damage ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) + (case (-> arg1 pat event) + (((pat-event melt)) + (set! arg0 (* 10.0 arg0)) + (format #t "vehicle::apply-damage: hit melt (damage ~f)~%" arg0) + ) + ) + (if (logtest? (vehicle-flag ignore-damage) (-> this v-flags)) + (set! arg0 0.0) + ) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (if (or (and (logtest? (game-secrets invulnerable) (-> *game-info* secrets)) (logtest? #x200000 (-> this info flags))) + *debug-player-vehicle-unkillable* + ) + (set! arg0 0.0) + ) + (if (logtest? (game-secrets vehicle-hit-points) (-> *game-info* secrets)) + (set! arg0 (* 0.5 arg0)) + ) + ) + (set! (-> this hit-points) (- (-> this hit-points) (* arg0 (-> this damage-factor)))) + (when (< (-> this hit-points) 0.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this crash-level) 3) + ) + (let ((s4-1 (-> arg1 prim-id)) + (s3-0 0) + ) + (while (nonzero? s4-1) + (when (and (logtest? s4-1 1) (< s3-0 (-> this info damage section-count))) + (let ((v1-37 (-> this section-array s3-0))) + (+! (-> v1-37 damage) (* 4.0 (-> this damage-factor) arg0)) + ) + (vehicle-method-114 this s3-0) + ) + (set! s4-1 (shr s4-1 1)) + (+! s3-0 1) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-114 ((this vehicle) (arg0 int)) + (let* ((v1-2 (-> this section-array arg0)) + (s4-0 (-> this info damage section-array arg0)) + (s5-1 + (max + 0 + (min (the int (* (-> v1-2 damage) (the float (-> s4-0 damage-seg-count)))) (+ (-> s4-0 damage-seg-count) -1)) + ) + ) + ) + (let ((a2-0 0)) + (dotimes (v1-6 (-> s4-0 damage-seg-count)) + (if (!= v1-6 s5-1) + (set! a2-0 (logior a2-0 (-> s4-0 damage-seg-array v1-6))) + ) + ) + (setup-masks (-> this draw) 0 a2-0) + ) + (setup-masks (-> this draw) (the-as int (-> s4-0 damage-seg-array s5-1)) 0) + (when (> s5-1 0) + (if (not (logtest? (vehicle-flag lights-dead) (-> this v-flags))) + (sound-play "headlight-pop") + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-dead) (-> this v-flags)))) + (vehicle-method-126 this) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-76 ((this vehicle)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag + disturbed + damaged + dead + player-touching + player-edge-grabbing + player-standing-on + persistent + impact + in-air + riding + player-driving + net-player-driving + ai-driving + waiting-for-player + ignition + turbo-boost + reverse-gear + flight-level-transition + alert + in-pursuit + target-in-sight + rammed-target + lights-on + lights-update + lights-dead + ) + ) + ) + ) + (set! (-> this unknown-flags) (-> this v-flags)) + (logior! (-> this rbody flags) (rigid-body-flag active)) + (logclear! (-> this focus-status) (focus-status disable dead inactive)) + (rigid-body-object-method-37 this) + (disable-physics! this) + (set! (-> this hit-points) 1.0) + (set! (-> this damage-factor) (-> this info damage inv-hit-points)) + (set! (-> this crash-level) 0) + (set! (-> this power-fluctuation-factor) 0.02) + (set! (-> this power-level) 1.0) + (set! (-> this lights-factor) 0.0) + (set-time! (-> this state-time)) + (let ((v1-19 (-> this info setup))) + (let ((a1-0 (-> v1-19 color-option-select))) + (set! (-> this draw color-mult quad) + (-> (the-as (pointer uint128) (+ (the-as uint (-> v1-19 color)) (* a1-0 16)))) + ) + ) + (+! (-> v1-19 color-option-select) 1) + (when (>= (-> v1-19 color-option-select) (-> v1-19 color-option-count)) + (set! (-> v1-19 color-option-select) 0) + 0 + ) + ) + (dotimes (s5-0 (-> this info damage section-count)) + (let ((v1-22 (-> this section-array s5-0))) + (set! (-> v1-22 damage) 0.0) + ) + (vehicle-method-114 this s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-98 ((this vehicle)) + (set! (-> this hit-points) 1.0) + 0 + (none) + ) + +(defmethod vehicle-method-130 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-74 ((this vehicle) (arg0 int) (arg1 time-frame)) + (when (< (-> this crash-level) arg0) + (set! (-> this crash-level) arg0) + (set! (-> this crash-duration) (the-as uint arg1)) + (set! (-> this crash-time) (the-as uint (current-time))) + (set! (-> this force-scale) 0.0) + ) + (when (and (>= 0.0 (-> this hit-points)) (!= (-> this crash-level) 3)) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this crash-level) 3) + (set! (-> this crash-duration) (the-as uint 1500)) + (set! (-> this crash-time) (the-as uint (current-time))) + ) + 0 + (none) + ) + +(defmethod vehicle-method-75 ((this vehicle)) + (set! (-> this crash-level) 0) + 0 + (none) + ) + +(defmethod vehicle-method-125 ((this vehicle)) + (if (not (logtest? (vehicle-flag lights-dead) (-> this v-flags))) + (set! (-> this v-flags) + (the-as vehicle-flag (logior (vehicle-flag lights-on lights-update) (-> this v-flags))) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-126 ((this vehicle)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag lights-on)))) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-update) (-> this v-flags)))) + 0 + (none) + ) + +(defmethod vehicle-method-135 ((this vehicle)) + (when (not (logtest? (vehicle-flag ignition) (-> this v-flags))) + (logior! (-> this v-flags) (vehicle-flag ignition)) + (sound-play-by-name (-> this info sound start-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + (let ((s5-1 (-> this node-list data 0 bone transform)) + (s4-1 (new 'stack-no-clear 'inline-array 'matrix 2)) + ) + (set-vector! (-> s4-1 0 fvec) 0.0 1.0 0.0 1.0) + (mem-copy! (the-as pointer (-> s4-1 1)) (the-as pointer s5-1) 64) + (dotimes (s3-0 2) + (vector-matrix*! (the-as vector (-> s4-1 0)) (-> this info particles exhaust-local-pos s3-0) s5-1) + (vector-rotate*! (-> s4-1 0 uvec) (-> this info particles exhaust-local-dir s3-0) s5-1) + (vector-cross! (-> s4-1 0 trans) (-> s4-1 0 uvec) (-> s4-1 0 fvec)) + (vector-normalize! (-> s4-1 0 trans) 1.0) + (vector-cross! (-> s4-1 1 fvec) (-> s4-1 0 trans) (-> s4-1 0 uvec)) + (set! (-> s4-1 1 rvec quad) (-> s4-1 0 trans quad)) + (set! (-> s4-1 1 uvec quad) (-> s4-1 0 uvec quad)) + (set! (-> s4-1 1 fvec quad) (-> s4-1 0 fvec quad)) + (set! (-> s4-1 1 trans quad) (-> s4-1 0 rvec quad)) + (if (logtest? (-> *part-group-id-table* 225 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 225) + :mat-joint (-> s4-1 1) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 225) + :mat-joint (-> s4-1 1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-136 ((this vehicle)) + (if (logtest? (vehicle-flag ignition) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag ignition)) + ) + 0 + (none) + ) + +(defmethod vehicle-method-137 ((this vehicle)) + (let ((a0-2 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) + (when a0-2 + (add-process-drawable-to-nav-mesh a0-2 this #t) + (vehicle-method-139 this) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-139 ((this vehicle)) + (logior! (-> this nav flags) (nav-control-flag display-marks)) + 0 + (none) + ) + +(defmethod vehicle-method-138 ((this vehicle)) + (let ((v1-0 (-> this nav))) + (when v1-0 + (remove-process-drawable (-> v1-0 state mesh) this) + (set! (-> this nav) #f) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-141 ((this vehicle)) + (or (logtest? (vehicle-flag dead waiting-for-player) (-> this v-flags)) + (and (logtest? (vehicle-flag player-driving net-player-driving ai-driving) (-> this v-flags)) + (not (logtest? (-> this v-flags) (vehicle-flag on-flight-level))) + ) + ) + ) + +(defmethod vehicle-method-140 ((this vehicle)) + (let ((v1-1 (vehicle-method-141 this)) + (s5-0 (-> this nav)) + ) + (cond + (v1-1 + (cond + (s5-0 + (do-navigation-to-destination (-> s5-0 state) (-> this root trans)) + (when (not (logtest? (-> s5-0 state flags) (nav-state-flag in-mesh))) + (let ((a0-4 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) + (when (and a0-4 (!= a0-4 (-> s5-0 state mesh))) + (change-to a0-4 this) + (logclear! (-> this nav flags) (nav-control-flag output-sphere-hash)) + ) + ) + ) + ) + (else + (vehicle-method-137 this) + ) + ) + ) + (else + (if s5-0 + (vehicle-method-138 this) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-80 ((this vehicle)) + (when (not (logtest? (vehicle-flag camera) (-> this v-flags))) + (vehicle-method-82 this) + (logior! (-> this v-flags) (vehicle-flag camera)) + ) + 0 + (none) + ) + +(defmethod vehicle-method-81 ((this vehicle)) + (when (logtest? (vehicle-flag camera) (-> this v-flags)) + (vehicle-method-83 this) + (logclear! (-> this v-flags) (vehicle-flag camera)) + ) + 0 + (none) + ) + +(defmethod vehicle-method-82 ((this vehicle)) + (logclear! (-> this v-flags) (vehicle-flag camera-bike-mode camera-rapid-tracking-mode)) + (set! (-> this cam-speed-interp) 0.0) + (set-setting! 'string-min-height 'abs (-> this info camera string-min-height) 0) + (set-setting! 'string-max-height 'abs (-> this info camera string-max-height) 0) + (set-setting! 'head-offset 'abs (-> this info camera head-offset) 0) + (set-setting! 'foot-offset 'abs (-> this info camera foot-offset) 0) + (set-setting! 'target-height 'abs (meters 0) 0) + (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) + (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) + 0 + (none) + ) + +(defmethod vehicle-method-83 ((this vehicle)) + (remove-setting! 'bike-mode) + (remove-setting! 'rapid-tracking) + (remove-setting! 'fov) + (remove-setting! 'string-camera-ceiling) + (remove-setting! 'string-camera-floor) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'extra-follow-height) + (remove-setting! 'head-offset) + (remove-setting! 'foot-offset) + (remove-setting! 'target-height) + (remove-setting! 'slave-options) + (remove-setting! 'vertical-follow-matches-camera) + (remove-setting! 'mode-name) + (remove-setting! 'butt-handle) + (remove-setting! 'lock-sound-camera-to-target) + (remove-setting! 'interp-time) + (vehicle-method-148 this) + 0 + (none) + ) + +(defmethod vehicle-method-84 ((this vehicle)) + (when (not (logtest? (vehicle-flag camera-bike-mode) (-> this v-flags))) + (logior! (-> this v-flags) (vehicle-flag camera-bike-mode)) + (set-setting! 'bike-mode #f 0.0 0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-85 ((this vehicle)) + (when (logtest? (vehicle-flag camera-bike-mode) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag camera-bike-mode)) + (remove-setting! 'bike-mode) + ) + 0 + (none) + ) + +(defmethod vehicle-method-86 ((this vehicle)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logior! (-> this v-flags) (vehicle-flag camera-rapid-tracking-mode)) + (set-setting! 'rapid-tracking #f 0.0 0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-87 ((this vehicle)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag camera-rapid-tracking-mode)) + (remove-setting! 'rapid-tracking) + ) + 0 + (none) + ) + +(defmethod rigid-body-object-method-42 ((this vehicle)) + (logior! (-> this v-flags) (vehicle-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> this root backup-collide-with)) + ) + 0 + (none) + ) + +(defmethod rigid-body-object-method-43 ((this vehicle)) + (logclear! (-> this v-flags) (vehicle-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + 0 + (none) + ) + +(defmethod vehicle-method-99 ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + 0 + (none) + ) + +(defmethod vehicle-method-100 ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) + (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + 0 + (none) + ) + +(defmethod vehicle-method-148 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-147 ((this vehicle)) + 0 + (none) + ) + +(defmethod apply-momentum! ((this vehicle)) + (let ((s5-0 (-> this rbody))) + (when (not (logtest? (-> s5-0 flags) (rigid-body-flag enable-physics))) + (logior! (-> s5-0 flags) (rigid-body-flag enable-physics)) + (rigid-body-control-method-28 s5-0 (-> this root trans) (-> this root quat)) + (set! (-> s5-0 lin-velocity quad) (-> this root transv quad)) + (vector-float*! (-> s5-0 lin-momentum) (-> s5-0 lin-velocity) (-> this info info mass)) + (vector-reset! (-> s5-0 ang-momentum)) + (vector-reset! (-> this lin-acceleration)) + ) + ) + 0 + (none) + ) + +(defmethod disable-physics! ((this vehicle)) + (set! (-> this force-scale) 1.0) + (logclear! (-> this rbody flags) (rigid-body-flag enable-physics)) + (vehicle-method-106 this) + 0 + (none) + ) + +(defmethod vehicle-method-107 ((this vehicle) (arg0 int) (arg1 process)) + (let ((a0-1 (-> this squad))) + (when (and a0-1 arg1) + (if #t + (squad-control-method-18 a0-1 arg0 arg1) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-108 ((this vehicle) (arg0 int)) + (set-alert-level0 (-> this squad) arg0) + 0 + (none) + ) + +(defmethod impulse-handler ((this vehicle)) + (if (and (not (focus-test? this inactive)) + (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + ) + ((method-of-type rigid-body-object impulse-handler) this) + ) + 0 + (none) + ) + +(defmethod vehicle-method-109 ((this vehicle)) + (vehicle-method-122 this) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) + 0 + (none) + ) + +(defmethod vehicle-method-110 ((this vehicle)) + (if (focus-test? this inactive) + (vehicle-method-123 this) + ) + (go (method-of-object this active)) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-active ((this vehicle)) + (go (method-of-object this waiting)) + 0 + ) + +(defmethod vehicle-method-134 ((this vehicle)) + (go (method-of-object this player-control)) + 0 + (none) + ) + +(defmethod vehicle-method-132 ((this vehicle) (arg0 traffic-object-spawn-params)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((= v1-0 1) + (vehicle-method-131 this) + (vehicle-method-109 this) + ) + ((zero? v1-0) + (go (method-of-object this idle)) + ) + ((= v1-0 4) + (go (method-of-object this player-control)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-124 ((this vehicle)) + (if (= this *debug-actor*) + (format #t "hook-dead~%") + ) + (logior! (-> this focus-status) (focus-status dead)) + (vehicle-method-136 this) + (set! (-> this v-flags) + (the-as vehicle-flag (logclear + (-> this v-flags) + (vehicle-flag riding player-driving net-player-driving in-pursuit target-in-sight) + ) + ) + ) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + 0 + (none) + ) + +(defmethod vehicle-method-133 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-102 ((this vehicle)) + (logtest? (vehicle-flag disturbed player-touching player-driving in-pursuit) (-> this v-flags)) + ) + +(defmethod vehicle-method-142 ((this vehicle)) + (reset-momentum! (-> this rbody)) + (none) + ) + +(defmethod vehicle-method-103 ((this vehicle)) + (local-vars (v1-8 float) (v1-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) + (let* ((f0-0 (-> this camera-dist2)) + (f1-0 0.000024414063) + (f0-1 (* f0-0 (* f1-0 f1-0))) + ) + (.lvf vf1 (&-> (-> this rbody ang-velocity) 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-8 vf1) + (when (and (< v1-8 f0-1) (begin + (.lvf vf1 (&-> (-> this rbody lin-velocity) 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-13 vf1) + (let ((f1-4 v1-13) + (f2-0 614.4) + ) + (< f1-4 (* f0-1 (* f2-0 f2-0))) + ) + ) + ) + (logclear! (-> this v-flags) (vehicle-flag disturbed)) + (vehicle-method-142 this) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod vehicle-method-79 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-115 ((this vehicle)) + (dotimes (s5-0 (-> this info rider seat-count)) + (let ((s4-0 (handle->process (-> this rider-array s5-0)))) + (when (and s4-0 (focus-test? (the-as process-focusable s4-0) pilot-riding)) + (vehicle-method-66 this (-> (the-as process-focusable s4-0) root trans) s5-0) + (set! (-> (the-as process-focusable s4-0) root transv quad) (-> this root transv quad)) + (let ((f0-1 (the float (-> this info rider seat-array s5-0 angle)))) + (quaternion-rotate-local-y! (-> (the-as process-focusable s4-0) root quat) (-> this root quat) f0-1) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-146 ((this vehicle) (arg0 vector)) + 0 + (none) + ) + +(defmethod vehicle-method-149 ((this vehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this vehicle)) + (let ((v1-1 (-> this root root-prim)) + (f0-0 0.0) + ) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a1-3 (-> (the-as collide-shape-prim-group v1-1) child a0-1 local-sphere))) + (set! f0-0 (fmax f0-0 (+ (vector-length a1-3) (-> a1-3 w)))) + ) + ) + (vector-reset! (-> v1-1 local-sphere)) + (set! (-> v1-1 local-sphere w) f0-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-116 ((this vehicle) (arg0 symbol)) + (dotimes (s4-0 (-> this info rider seat-count)) + (let* ((s3-0 (handle->process (-> this rider-array s4-0))) + (a0-5 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (send-event + a0-5 + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode arg0)) + ) + ) + ) + (put-rider-in-seat this s4-0 (the-as process #f)) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc index ae58a54666..cb0652342a 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc @@ -7,3 +7,1354 @@ ;; DECOMP BEGINS +(define *debug-vehicle-work* (new 'static 'debug-vehicle-work)) + +(defskelgroup skel-vehicle-explosion vehicle-explosion vehicle-explosion-lod0-jg vehicle-explosion-idle-ja + ((vehicle-explosion-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +(define *vehicle-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +(define *vehicle-shadow-control-disabled* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x2a)) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +(defbehavior vehicle-event-handler vehicle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (rbody-event-handler self arg0 arg1 arg2 arg3) + ) + +(defmethod on-impact ((this vehicle) (arg0 rigid-body-impact)) + (local-vars (v1-79 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (logior! (-> this v-flags) (vehicle-flag impact)) + (set! (-> this impact-pos quad) (-> arg0 point quad)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (matrix-inverse-of-rot-trans! (the-as matrix (-> s4-0 rvec)) (-> this rbody matrix)) + (vector-matrix*! (-> this impact-local-pos) (-> this impact-pos) (the-as matrix (-> s4-0 rvec))) + ) + (set! (-> this prev-impact-time) (-> this impact-time)) + (set! (-> this impact-time) (the-as uint (current-time))) + (set! (-> this impact-pat) (the-as uint (-> arg0 pat))) + (set! (-> this impact-proc) (the-as handle #f)) + (let ((a0-5 (-> arg0 process))) + (if a0-5 + (set! (-> this impact-proc) (process->handle a0-5)) + ) + ) + (let ((s4-1 (-> this info)) + (f0-0 1.0) + ) + (let ((v1-14 (-> arg0 prim-id))) + (if (logtest? v1-14 512) + (set! f0-0 (* 1.5 f0-0)) + ) + (if (logtest? v1-14 1024) + (set! f0-0 (* 2.0 f0-0)) + ) + (if (logtest? v1-14 2048) + (set! f0-0 (* 4.0 f0-0)) + ) + (if (logtest? v1-14 256) + (set! f0-0 (/ 1.0 f0-0)) + ) + ) + (let ((f30-0 (* (-> arg0 impulse) f0-0 (-> s4-1 info inv-mass) (-> s4-1 damage inv-toughness-factor)))) + (set! (-> this crash-impulse) (-> arg0 impulse)) + (cond + ((< f30-0 (-> s4-1 damage hit-threshold)) + ) + ((>= f30-0 (-> s4-1 damage hit-deadly)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1)) + 0 + ) + (apply-damage this (* 2.0 (-> s4-1 damage hit-points)) arg0) + (vehicle-method-74 this 2 (seconds 1)) + ) + ((>= f30-0 (-> s4-1 damage hit-big)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + 0 + ) + (apply-damage this (* 10.0 (-> s4-1 damage impact-damage-factor)) arg0) + (vehicle-method-74 this 1 (seconds 0.25)) + ) + ((>= f30-0 (-> s4-1 damage hit-small)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25)) + 0 + ) + (apply-damage this (* 5.0 (-> s4-1 damage impact-damage-factor)) arg0) + (vehicle-method-74 this 1 (seconds 0.25)) + ) + (else + (let* ((f0-14 0.0) + (f1-10 40.0) + (f2-0 16384000.0) + (f0-15 (fmax f0-14 (* f1-10 (/ 1.0 f2-0) (- f30-0 (-> s4-1 damage hit-threshold))))) + ) + (apply-damage this (* f0-15 (-> s4-1 damage impact-damage-factor)) arg0) + ) + (when (< 32768.0 f30-0) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + ) + ) + ) + ) + (let* ((f0-18 1.0) + (f1-14 61440.0) + (f28-0 (fmin f0-18 (* f30-0 (/ 1.0 f1-14)))) + ) + (cond + ((>= f30-0 (-> s4-1 damage hit-small)) + (sound-play-by-name + (-> this info sound impact-sound) + (new-sound-id) + (the int (* 1024.0 f28-0)) + 0 + 0 + (sound-group) + #t + ) + (logclear! (-> this v-flags) (vehicle-flag turbo-boost)) + ) + ((< 0.1 f28-0) + (sound-play-by-name + (-> this info sound glance-sound) + (new-sound-id) + (the int (* 1024.0 f28-0)) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + ) + (let ((a0-39 (new 'stack-no-clear 'vector))) + (vector+float*! + a0-39 + (-> arg0 velocity) + (-> arg0 normal) + (- (vector-dot (-> arg0 velocity) (-> arg0 normal))) + ) + (.lvf vf1 (&-> a0-39 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-79 vf1) + (let ((f0-30 v1-79) + (f1-18 12288.0) + ) + (when (< (* f1-18 f1-18) f0-30) + (set! (-> this scrape-sound-envelope) 1.0) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.05)) + ) + ) + ) + (if (>= 0.0 (-> this hit-points)) + (vehicle-method-74 this 2 (seconds 1)) + ) + 0 + (none) + ) + ) + +(defmethod vehicle-method-92 ((this vehicle) (arg0 vehicle-controls)) + (seek! (-> this controls steering) (-> arg0 steering) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 lean-z) (* 8.0 (seconds-per-frame))) + (let ((f0-10 (-> arg0 throttle)) + (f30-0 (-> arg0 brake)) + ) + (seek! (-> this controls throttle) f0-10 (* 4.0 (seconds-per-frame))) + (+! (-> this controls brake) (* (- f30-0 (-> this controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) + ) + (set! (-> this controls prev-flags) (-> this controls flags)) + (set! (-> this controls flags) (-> arg0 flags)) + 0 + (none) + ) + +(defmethod vehicle-method-88 ((this vehicle) (arg0 vehicle-controls)) + 0 + (none) + ) + +(defmethod control-hook-player ((this vehicle) (arg0 vehicle-controls)) + (let ((gp-0 (new 'stack-no-clear 'vehicle-controls))) + (mem-set32! (&-> gp-0 steering) 6 0) + (cond + ((or (logtest? (-> this v-flags) (vehicle-flag player-grabbed)) + (and *target* (focus-test? *target* dead grabbed)) + (-> *setting-control* user-current stop-vehicle?) + ) + (set! (-> gp-0 steering) 0.0) + (set! (-> gp-0 lean-z) 0.0) + (set! (-> gp-0 throttle) 0.0) + (set! (-> gp-0 brake) 1.0) + (set! (-> gp-0 handbrake) 0.0) + (set! (-> this v-flags) + (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag reverse-gear camera-look-mode))) + ) + ) + (else + (vehicle-method-88 this (the-as vehicle-controls (&-> gp-0 steering))) + ) + ) + (vehicle-method-92 this (the-as vehicle-controls (&-> gp-0 steering))) + ) + 0 + (none) + ) + +(defmethod vehicle-method-93 ((this vehicle)) + (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type2))) + (set! (-> s5-0 time) (the-as uint (current-time))) + (when (and *target* (logtest? (vehicle-flag ignition) (-> this v-flags))) + (when (and (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (zero? (-> this root num-riders)) + (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))) + (focus-test? *target* teleporting) + ) + ) + ) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + (set! (-> this controls lean-z) 0.0) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 24) + ) + ) + (cond + ((zero? (-> this crash-level)) + (seek! (-> this force-scale) 1.0 (seconds-per-frame)) + ) + ((< (-> this crash-level) 3) + (set! (-> s5-0 word01) (- (-> s5-0 time) (-> this crash-time))) + (when (>= (-> s5-0 word01) (-> this crash-duration)) + (if (or (>= (-> this rbody matrix uvec y) (cos 18204.445)) (>= (-> s5-0 word01) (the-as uint 900))) + (vehicle-method-75 this) + ) + ) + ) + ) + (set! (-> this force-level) (-> this crash-level)) + (cond + ((>= (-> this hit-points) 0.9) + (set! (-> this power-fluctuation-factor) 0.01) + ) + ((>= (-> this hit-points) 0.75) + (set! (-> this power-fluctuation-factor) 0.02) + ) + ((>= (-> this hit-points) 0.5) + (set! (-> this power-fluctuation-factor) 0.04) + ) + ((>= (-> this hit-points) 0.3) + (set! (-> this power-fluctuation-factor) 0.08) + ) + ((>= (-> this hit-points) 0.15) + (set! (-> this power-fluctuation-factor) 0.16) + ) + ((>= (-> this hit-points) 0.05) + (set! (-> this power-fluctuation-factor) 0.32) + ) + (else + (set! (-> this power-fluctuation-factor) 0.5) + ) + ) + (let ((f1-6 0.0)) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (let ((f0-23 (- 1.0 (* (rand-vu) (-> this power-fluctuation-factor))))) + (set! f1-6 (* f0-23 f0-23)) + ) + (if (not (logtest? (-> this v-flags) (vehicle-flag riding))) + (set! f1-6 (* 0.5 f1-6)) + ) + ) + (+! (-> this power-level) + (* (- f1-6 (-> this power-level)) + (fmin 1.0 (* (+ 1.0 (* 50.0 (-> this power-fluctuation-factor))) (seconds-per-frame))) + ) + ) + ) + (when (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (set! (-> s5-0 word00) (- (-> s5-0 time) (-> this turbo-boost-time))) + (if (or (>= (-> s5-0 word00) (-> this turbo-boost-duration)) + (and (>= (-> s5-0 word00) (the-as uint 30)) (>= (-> this controls brake) 0.75)) + ) + (logclear! (-> this v-flags) (vehicle-flag turbo-boost)) + ) + ) + ) + (if (logtest? (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (set! (-> this air-time) (the-as uint (current-time))) + ) + 0 + (none) + ) + +(defmethod vehicle-method-94 ((this vehicle)) + (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type1))) + (set! (-> s5-0 word02) (the-as uint (current-time))) + (cond + ((logtest? (-> this v-flags) (vehicle-flag in-air)) + (when (or (< 55296.0 (-> this rbody lin-velocity y)) (>= (- (-> s5-0 word02) (-> this air-time)) (the-as uint 225))) + (set-setting! 'extra-follow-height 'abs (meters -4) 0) + (send-event *camera* 'set-max-angle-offset (-> this info camera air-max-angle-offset)) + ) + ) + (else + (remove-setting! 'extra-follow-height) + (send-event *camera* 'set-max-angle-offset (-> this info camera normal-max-angle-offset)) + ) + ) + (let ((f0-4 (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec)))) + (cond + ((= (-> this crash-level) 2) + (vehicle-method-85 this) + ) + ((< f0-4 (-> this info camera max-lookaround-speed)) + (vehicle-method-85 this) + ) + ((< (+ 4096.0 (-> this info camera max-lookaround-speed)) f0-4) + (vehicle-method-84 this) + ) + ) + ) + (when (not (logtest? (vehicle-flag flight-level-transition) (-> this v-flags))) + (let* ((f0-5 1.0) + (v1-49 (-> this rbody lin-velocity)) + (f0-6 (fmin f0-5 (/ (sqrtf (+ (* (-> v1-49 x) (-> v1-49 x)) (* (-> v1-49 z) (-> v1-49 z)))) + (-> this info handling max-xz-speed) + ) + ) + ) + ) + (seek! (-> this cam-speed-interp) f0-6 (* 0.1 (seconds-per-frame))) + ) + ) + (let ((f30-0 (-> this cam-speed-interp))) + (if #f + (set! f30-0 + (fmax 0.0 (fmin 1.0 (analog-input (the-as int (-> *cpad-list* cpads 1 righty)) 128.0 48.0 110.0 -1.0))) + ) + ) + (set! (-> s5-0 float00) + (lerp-scale (-> this info camera min-fov) (-> this info camera max-fov) f30-0 0.0 1.0) + ) + (set-setting! 'fov 'abs (-> s5-0 float00) 0) + (let ((f30-2 (lerp-scale 1.0 0.6 f30-0 0.0 1.0))) + (set-setting! 'string-min-length 'abs (* f30-2 (-> this info camera string-min-length)) 0) + (set-setting! 'string-max-length 'abs (* f30-2 (-> this info camera string-max-length)) 0) + ) + ) + (when *target* + (set! (-> s5-0 vec0 quad) (-> *target* draw shadow-ctrl settings shadow-dir quad)) + (let ((v1-75 (-> this draw shadow-ctrl settings shadow-dir))) + (set! (-> s5-0 vec0 w) (-> v1-75 w)) + (set! (-> v1-75 quad) (-> s5-0 vec0 quad)) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'collide-query 2))) + (let* ((v1-76 (-> s4-0 1)) + (a3-7 (-> this rbody matrix)) + (a0-29 (-> a3-7 rvec quad)) + (a1-11 (-> a3-7 uvec quad)) + (a2-9 (-> a3-7 fvec quad)) + (a3-8 (-> a3-7 trans quad)) + ) + (set! (-> v1-76 best-other-tri vertex 0 quad) a0-29) + (set! (-> v1-76 best-other-tri vertex 1 quad) a1-11) + (set! (-> v1-76 best-other-tri vertex 2 quad) a2-9) + (set! (-> v1-76 best-other-tri intersect quad) a3-8) + ) + (cond + ((logtest? (vehicle-flag camera-look-mode) (-> this v-flags)) + (let ((a0-31 *camera*)) + (when a0-31 + (let ((s3-0 (-> a0-31 slave))) + (when s3-0 + (set! (-> s3-0 0 fov) (-> s5-0 float00)) + (let ((v1-83 (-> this cam-view))) + (cond + ((zero? v1-83) + (vector-matrix*! + (the-as vector (-> s4-0 1 bbox)) + (the-as vector (-> this info camera look-pos-array)) + (the-as matrix (-> s4-0 1)) + ) + ) + ((= v1-83 1) + (vector-matrix*! (the-as vector (-> s4-0 1 bbox)) (-> this info camera look-rear) (the-as matrix (-> s4-0 1))) + (matrix-rotate-yx! (the-as matrix (-> s4-0 1 best-other-tri normal)) 32768.0 3640.889) + (matrix*! + (the-as matrix (-> s4-0 1)) + (the-as matrix (-> s4-0 1 best-other-tri normal)) + (the-as matrix (-> s4-0 1)) + ) + ) + ((= v1-83 2) + (vector-matrix*! (the-as vector (-> s4-0 1 bbox)) (-> this info camera look-left) (the-as matrix (-> s4-0 1))) + (matrix-rotate-yx! (the-as matrix (-> s4-0 1 best-other-tri normal)) 16384.0 3640.889) + (matrix*! + (the-as matrix (-> s4-0 1)) + (the-as matrix (-> s4-0 1 best-other-tri normal)) + (the-as matrix (-> s4-0 1)) + ) + ) + ((= v1-83 3) + (vector-matrix*! + (the-as vector (-> s4-0 1 bbox)) + (-> this info camera look-right) + (the-as matrix (-> s4-0 1)) + ) + (matrix-rotate-yx! (the-as matrix (-> s4-0 1 best-other-tri normal)) -16384.0 3640.889) + (matrix*! + (the-as matrix (-> s4-0 1)) + (the-as matrix (-> s4-0 1 best-other-tri normal)) + (the-as matrix (-> s4-0 1)) + ) + ) + (else + (vector-matrix*! + (the-as vector (-> s4-0 1 bbox)) + (the-as vector (-> this info camera look-pos-array)) + (the-as matrix (-> s4-0 1)) + ) + ) + ) + ) + (when (nonzero? (-> this cam-view)) + (let ((v1-96 (-> s4-0 0))) + (set! (-> v1-96 radius) 2048.0) + (set! (-> v1-96 collide-with) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-96 ignore-process0) this) + (set! (-> v1-96 ignore-process1) #f) + (set! (-> v1-96 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-96 action-mask) (collide-action solid)) + ) + (set! (-> s4-0 0 start-pos quad) (-> this rbody position quad)) + (vector-! (-> s4-0 0 move-dist) (the-as vector (-> s4-0 1 bbox)) (-> s4-0 0 start-pos)) + (let ((f0-23 (fill-and-probe-using-line-sphere *collide-cache* (-> s4-0 0)))) + (if (>= f0-23 0.0) + (vector+float*! (the-as vector (-> s4-0 1 bbox)) (-> s4-0 0 start-pos) (-> s4-0 0 move-dist) f0-23) + ) + ) + ) + (set! (-> s3-0 0 saved-pt quad) (-> s4-0 1 bbox min quad)) + (let ((v1-107 (-> s3-0 0 tracking))) + (set! (-> v1-107 inv-mat rvec quad) (-> s4-0 1 best-other-tri vertex 0 quad)) + (set! (-> v1-107 inv-mat uvec quad) (-> s4-0 1 best-other-tri vertex 1 quad)) + (set! (-> v1-107 inv-mat fvec quad) (-> s4-0 1 best-other-tri vertex 2 quad)) + ) + ) + ) + ) + ) + (if (zero? (-> this cam-view)) + (vehicle-method-147 this) + (vehicle-method-148 this) + ) + (when (not (logtest? (vehicle-flag camera-look-mode) (-> this unknown-flags))) + (set-setting! 'interp-time 'abs 3.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'lock-sound-camera-to-target #t 0.0 0) + ) + ) + (else + (when (logtest? (vehicle-flag camera-look-mode) (-> this unknown-flags)) + (vehicle-method-148 this) + (let ((v1-130 *camera*)) + (when v1-130 + (when (-> v1-130 slave) + (let ((s5-1 (new 'static 'vector))) + (let ((v1-132 (new 'stack-no-clear 'inline-array 'matrix 2))) + (let ((a0-72 (-> v1-132 1))) + (set! (-> a0-72 rvec x) 0.0) + (set! (-> a0-72 rvec y) 0.0) + (set! (-> a0-72 rvec z) -1.0) + (set! (-> a0-72 rvec w) 1.0) + ) + (let* ((a0-73 (-> v1-132 0)) + (t0-10 (-> this rbody matrix)) + (a1-37 (-> t0-10 rvec quad)) + (a2-24 (-> t0-10 uvec quad)) + (a3-12 (-> t0-10 fvec quad)) + (t0-11 (-> t0-10 trans quad)) + ) + (set! (-> a0-73 rvec quad) a1-37) + (set! (-> a0-73 uvec quad) a2-24) + (set! (-> a0-73 fvec quad) a3-12) + (set! (-> a0-73 trans quad) t0-11) + ) + (vector-rotate*! s5-1 (the-as vector (-> v1-132 1)) (-> v1-132 0)) + ) + (persist-with-delay + *setting-control* + 'string-startup-vector + (seconds 0.05) + 'string-startup-vector + 'abs + (the-as float s5-1) + 0 + ) + ) + ) + ) + ) + (set-setting! 'interp-time 'abs 0.0 0) + (remove-setting! 'mode-name) + (remove-setting! 'lock-sound-camera-to-target) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-101 ((this vehicle)) + 0 + (none) + ) + +(defmethod rigid-body-object-method-30 ((this vehicle)) + (cond + ((logtest? (vehicle-flag sounds) (-> this v-flags)) + (rigid-body-object-method-38 this) + ) + (else + (if (logtest? (vehicle-flag sounds) (-> this unknown-flags)) + (vehicle-method-106 this) + ) + ) + ) + (if (logtest? (vehicle-flag particles) (-> this v-flags)) + (vehicle-method-78 this) + ) + (if (logtest? (vehicle-flag joints) (-> this v-flags)) + (vehicle-method-79 this) + ) + (when (logtest? (vehicle-flag player-dismounting) (-> this v-flags)) + (let ((a0-10 (new 'stack-no-clear 'array 'uint32 1))) + (set! (-> a0-10 0) (the-as uint (current-time))) + (when (< (the-as uint 150) (- (-> a0-10 0) (-> this player-dismount-time))) + (logclear! (-> this v-flags) (vehicle-flag player-dismounting)) + (let ((v1-32 (find-prim-by-id-logtest (-> this root) (the-as uint 64)))) + (if v1-32 + (set! (-> v1-32 prim-core collide-as) (collide-spec vehicle-sphere vehicle-mesh)) + ) + ) + ) + ) + ) + (set! (-> this unknown-flags) (-> this v-flags)) + (ja-post) + 0 + (none) + ) + +(defmethod rigid-body-object-method-54 ((this vehicle)) + (logclear! (-> this v-flags) (vehicle-flag impact)) + (let ((s5-0 (new 'stack-no-clear 'rigid-body-move-work))) + (set! (-> s5-0 mat trans w) -4096000.0) + (water-info-init! (-> this root) (the-as water-info (-> s5-0 mat)) (collide-action solid semi-solid)) + (set! (-> this water-flags) (the-as uint (-> s5-0 mat trans x))) + (if (and (logtest? (the-as int (-> s5-0 mat trans x)) 1) (logtest? #x20000000 (the-as int (-> s5-0 mat trans x)))) + (set! (-> s5-0 mat trans w) (-> s5-0 mat fvec x)) + ) + (set! (-> this water-height) (-> s5-0 mat trans w)) + (set! (-> s5-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-float*! (-> s5-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) + (let ((v1-15 (-> s5-0 cquery))) + (set! (-> v1-15 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-15 collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-15 ignore-process0) this) + (set! (-> v1-15 ignore-process1) #f) + (set! (-> v1-15 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-15 action-mask) (collide-action solid)) + ) + (if (focus-test? this dead) + (set! (-> s5-0 cquery ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + ) + (fill-using-line-sphere *collide-cache* (-> s5-0 cquery)) + ) + (rigid-body-control-method-10 (-> this rbody) this (-> this rbody time-remaining) (-> this max-time-step)) + 0 + (none) + ) + +(defmethod vehicle-method-77 ((this vehicle)) + (vehicle-method-115 this) + (if (logtest? (vehicle-flag camera) (-> this v-flags)) + (vehicle-method-94 this) + ) + (if (logtest? (vehicle-flag nav-spheres) (-> this v-flags)) + (vehicle-method-140 this) + ) + (when (< (-> this hit-points) 0.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this crash-level) 3) + ) + (if (and (logtest? (-> this v-flags) (vehicle-flag dead)) + (not (logtest? (-> this focus-status) (focus-status dead))) + ) + (go (method-of-object this crash)) + ) + 0 + (none) + ) + +(defmethod clear-impulse-force-flag! ((this vehicle)) + (with-pp + (let ((v1-0 (new 'stack-no-clear 'matrix))) + (set! (-> v1-0 rvec quad) (-> this root transv quad)) + (vector-! (-> v1-0 uvec) (-> this rbody lin-velocity) (-> v1-0 rvec)) + (vector-float*! (-> this lin-acceleration) (-> v1-0 uvec) (-> pp clock frames-per-second)) + ) + (set! (-> this root transv quad) (-> this rbody lin-velocity quad)) + (quaternion-copy! (-> this root quat) (the-as quaternion (-> this rbody rot))) + (rigid-body-control-method-25 (-> this rbody) (-> this root trans)) + (let* ((v1-11 (-> this node-list data 0 bone transform)) + (a3-0 (-> this rbody matrix)) + (a0-12 (-> a3-0 rvec quad)) + (a1-8 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-11 rvec quad) a0-12) + (set! (-> v1-11 uvec quad) a1-8) + (set! (-> v1-11 fvec quad) a2-1) + (set! (-> v1-11 trans quad) a3-1) + ) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vehicle-method-77 this) + (rigid-body-object-method-30 this) + (update-transforms (-> this root)) + (seek! (-> this scrape-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 24) + (logclear! (-> this v-flags) (vehicle-flag player-impulse-force player-contact-force)) + 0 + (none) + ) + ) + +(defmethod vehicle-method-117 ((this vehicle)) + (if (time-elapsed? (-> this player-touch-time) (seconds 0.1)) + (logclear! (-> this v-flags) (vehicle-flag player-touching player-edge-grabbing player-standing-on)) + ) + (when (logtest? (-> this v-flags) (vehicle-flag player-touching)) + (detect-riders! (-> this root)) + 0 + ) + (if (logtest? (vehicle-flag player-touching player-driving) (-> this v-flags)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + ) + (vehicle-method-93 this) + 0 + (none) + ) + +(defmethod rbody-post ((this vehicle)) + (local-vars (a0-14 int) (a0-16 int) (a0-19 int) (a0-21 int)) + (let* ((v1-1 (-> *perf-stats* data 37)) + (a0-1 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-1) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-1) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (cond + ((logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (if (not (vehicle-method-102 this)) + (disable-physics! this) + ) + ) + (else + (if (vehicle-method-102 this) + (apply-momentum! this) + ) + ) + ) + (cond + ((logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (vehicle-method-117 this) + (vehicle-method-103 this) + ) + (else + (let* ((v1-26 (-> *perf-stats* data 20)) + (a0-11 (-> v1-26 ctrl)) + ) + (+! (-> v1-26 count) 1) + (b! (zero? a0-11) cfg-12 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-11) + ) + (.sync.l) + (.sync.p) + (label cfg-12) + 0 + (rigid-body-object-method-30 this) + (let ((v1-31 (-> *perf-stats* data 20))) + (b! (zero? (-> v1-31 ctrl)) cfg-14 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-14 pcr0) + (+! (-> v1-31 accum0) a0-14) + (.mfpc a0-16 pcr1) + (+! (-> v1-31 accum1) a0-16) + ) + (label cfg-14) + 0 + ) + ) + (let ((v1-34 (-> *perf-stats* data 37))) + (b! (zero? (-> v1-34 ctrl)) cfg-17 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-19 pcr0) + (+! (-> v1-34 accum0) a0-19) + (.mfpc a0-21 pcr1) + (+! (-> v1-34 accum1) a0-21) + ) + (label cfg-17) + 0 + 0 + (none) + ) + +(defmethod init-reverse ((this vehicle) (arg0 vehicle-controls)) + (set! (-> arg0 steering) 0.0) + (set! (-> arg0 lean-z) 0.0) + (set! (-> arg0 throttle) 0.0) + (set! (-> arg0 brake) 1.0) + (set! (-> arg0 handbrake) 1.0) + (logclear! (-> this v-flags) (vehicle-flag reverse-gear)) + 0 + (none) + ) + +(defmethod vehicle-method-118 ((this vehicle)) + (local-vars (a0-25 int) (a0-27 int)) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (b! + (not (and (logtest? (vehicle-flag traffic-managed) (-> this v-flags)) + (not (logtest? (-> this v-flags) (vehicle-flag persistent))) + ) + ) + cfg-20 + :delay (empty-form) + ) + (let ((f0-3 (fmin (-> this player-dist2) (-> this camera-dist2)))) + (let ((f1-1 819200.0)) + (b! (>= (* f1-1 f1-1) f0-3) cfg-8) + ) + (let ((f1-4 819200.0)) + (if (< (* f1-4 f1-4) f0-3) + (vehicle-method-109 this) + ) + ) + (b! #t cfg-19 :delay (nop!)) + (label cfg-8) + (let ((f1-7 81920.0)) + (b! (>= (* f1-7 f1-7) f0-3) cfg-18) + ) + (b! (not (logtest? (-> this draw status) (draw-control-status on-screen))) cfg-11 :delay (nop!)) + (set-time! (-> this state-time)) + (b! #t cfg-17 :delay (nop!)) + (label cfg-11) + (if (or (time-elapsed? (-> this state-time) (seconds 10)) (let ((f1-10 409600.0)) + (< (* f1-10 f1-10) f0-3) + ) + ) + (vehicle-method-109 this) + ) + ) + (label cfg-17) + (b! #t cfg-19 :delay (nop!)) + (label cfg-18) + (set-time! (-> this state-time)) + (label cfg-19) + 0 + (label cfg-20) + (vehicle-method-129 this) + (cond + ((logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (when (not (vehicle-method-102 this)) + (disable-physics! this) + (vehicle-method-142 this) + ) + ) + (else + (if (vehicle-method-102 this) + (apply-momentum! this) + ) + ) + ) + (b! (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) cfg-31 :delay (nop!)) + (vector-reset! (-> this target-acceleration)) + (when (logtest? (-> this v-flags) (vehicle-flag disturbed)) + (if (logtest? (-> this v-flags) (vehicle-flag in-air)) + (set-time! (-> this disturbed-time)) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'vehicle-controls))) + (mem-set32! (&-> s5-2 steering) 6 0) + (init-reverse this (the-as vehicle-controls (&-> s5-2 steering))) + (vehicle-method-92 this (the-as vehicle-controls (&-> s5-2 steering))) + ) + (vehicle-method-117 this) + (vehicle-method-103 this) + (b! #t cfg-36 :delay (nop!)) + (label cfg-31) + (let* ((v1-71 (-> *perf-stats* data 20)) + (a0-22 (-> v1-71 ctrl)) + ) + (+! (-> v1-71 count) 1) + (b! (zero? a0-22) cfg-33 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-22) + ) + (.sync.l) + (.sync.p) + (label cfg-33) + 0 + (rigid-body-object-method-30 this) + (let ((v1-76 (-> *perf-stats* data 20))) + (b! (zero? (-> v1-76 ctrl)) cfg-35 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-25 pcr0) + (+! (-> v1-76 accum0) a0-25) + (.mfpc a0-27 pcr1) + (+! (-> v1-76 accum1) a0-27) + ) + (label cfg-35) + 0 + (label cfg-36) + 0 + (none) + ) + +(defmethod vehicle-method-119 ((this vehicle)) + (set! (-> this player-dist2) 0.0) + (set! (-> this camera-dist2) 0.0) + ((-> this control-hook) this) + (vehicle-method-117 this) + 0 + (none) + ) + +(defmethod alloc-rbody-control! ((this vehicle) (arg0 rigid-body-object-constants)) + (if (logtest? (-> (the-as rigid-body-vehicle-constants arg0) flags) 8) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh)) + ) + ((zero? v1-0) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere vehicle-mesh)) + ) + ) + ) + (none) + ) + ) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere vehicle-mesh)) + (none) + ) + ) + ) + (set! (-> this bound-radius) (-> this draw bounds w)) + (set! (-> this draw shadow-ctrl) + (new 'process 'shadow-control -61440.0 -2048.0 69632.0 (-> this root trans) (shadow-flags shdf03) 245760.0) + ) + (logior! (-> this root root-prim prim-core action) (collide-action pull-rider-can-collide)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + (set! (-> this root event-self) 'touched) + (let ((t9-3 (method-of-type rigid-body-object alloc-rbody-control!))) + (t9-3 this (the-as rigid-body-vehicle-constants arg0)) + ) + (logior! (-> this rbody flags) (rigid-body-flag enable-collision)) + (set! (-> this root max-iteration-count) (the-as uint 8)) + (set! (-> this max-time-step) 0.033333335) + (logior! (-> this mask) (process-mask vehicle)) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this nav) #f) + (set! (-> this squad) #f) + (let ((v1-29 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-29 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-29 prim-core collide-with)) + ) + (rigid-body-object-method-42 this) + (vehicle-method-76 this) + (set! (-> this power-level) 0.5) + (set! (-> this lights-factor) 0.0) + (set! (-> this turbo-boost-factor) 1.0) + (dotimes (v1-37 4) + (set! (-> this rider-array v1-37) (the-as handle #f)) + ) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) + (set! (-> this damage-zap-sound-id) (new-sound-id)) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 204800.0) + (set! (-> this draw lod-set lod 2 dist) 819200.0) + (set! (-> this event-hook) vehicle-event-handler) + 0 + (none) + ) + +(defmethod attack-handler ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'rigid-body-impact 2))) + (init-rbody-impact-from-tshape! this (-> s5-0 0) arg2) + (cond + ((logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (set! (-> s5-0 0 velocity quad) (-> arg1 attacker-velocity quad)) + ) + (else + (let ((s0-0 arg0)) + (cond + ((if (type? s0-0 process-focusable) + s0-0 + ) + (set! (-> s5-0 1 point quad) (-> (get-trans (the-as process-focusable arg0) 3) quad)) + (vector-! (-> s5-0 0 velocity) (the-as vector (-> s5-0 0)) (the-as vector (-> s5-0 1))) + ) + (else + (vector-! (-> s5-0 0 velocity) (the-as vector (-> s5-0 0)) (-> arg0 root trans)) + ) + ) + ) + ) + ) + (let ((f28-0 0.0)) + (let ((f30-0 0.0)) + (if (and (logtest? (penetrate jak-dark-nuke) arg3) + (not (logtest? (vehicle-flag ignore-damage) (-> this v-flags))) + ) + (send-event this 'traffic-off-force) + ) + (set! f28-0 + (cond + ((logtest? (penetrate jak-dark-blackhole) arg3) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag gun-dark-2-zero-g) (-> this v-flags)))) + f28-0 + ) + ((or (logtest? (penetrate dark-punch dark-bomb) arg3) + (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) + ) + (set! f30-0 (* 204800.0 (-> this info info mass))) + (* 0.2 (-> this info damage hit-points)) + ) + ((logtest? (penetrate jak-red-shockwave) arg3) + (case (-> arg1 mode) + (('eco-red-shove) + (set! f30-0 (* (lerp 4096.0 8192.0 (-> arg1 control)) (-> this info info mass))) + (set! f28-0 0.0) + ) + (('eco-red) + (let ((f0-6 (* (lerp 20480.0 122880.0 (-> arg1 control)) (-> this info info mass)))) + (set! f30-0 (* 2.0 f0-6)) + ) + (set! f28-0 (* 8.0 (-> arg1 control))) + ) + ) + f28-0 + ) + (else + (cond + ((logtest? arg3 (penetrate punch)) + (set! f30-0 40960.0) + (set! f28-0 4.0) + ) + ((logtest? arg3 (penetrate flop spin)) + (set! f30-0 20480.0) + (set! f28-0 2.0) + ) + ((logtest? (attack-mask vehicle-damage-factor) (-> arg1 mask)) + (set! f28-0 (* (-> arg1 damage) (-> arg1 vehicle-damage-factor))) + (set! f30-0 (* 49152.0 (-> arg1 vehicle-impulse-factor) (-> arg1 damage))) + 0 + ) + (else + (set! f30-0 8192.0) + (set! f28-0 2.0) + ) + ) + f28-0 + ) + ) + ) + (set! (-> s5-0 0 impulse) f30-0) + ) + (apply-damage this f28-0 (-> s5-0 0)) + ) + (when (not (logtest? (vehicle-flag ignore-impulse) (-> this v-flags))) + (impulse-handler this) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> s5-0 0 velocity quad)) + (vector-normalize! s3-1 1.0) + (vector-float*! s3-1 s3-1 (-> s5-0 0 impulse)) + (apply-impact! (-> this rbody) (the-as vector (-> s5-0 0)) s3-1) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + (when #f + (set-time! (-> *debug-vehicle-work* impact-time)) + (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer (-> s5-0 0)) 64) + (let ((v1-84 (-> arg2 head))) + (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-84 prim1 cprim prim-core world-sphere quad)) + (set! (-> *debug-vehicle-work* prim-sphere2 quad) (-> v1-84 prim2 cprim prim-core world-sphere quad)) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (the-as vector (-> s5-0 0)) *color-blue*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s5-0 0)) + s3-1 + (meters 0.00024414062) + *color-blue* + ) + ) + ) + ) + ) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) + ) + #t + ) + +(defmethod touch-handler ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) + #t + ) + +;; WARN: disable def twice: 317. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 331. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod rbody-event-handler ((this vehicle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-2 object)) + (when (and (= arg2 'touched) arg0 (logtest? (process-mask collectable) (-> arg0 mask))) + (dotimes (s1-0 4) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer arg0)) + (set! (-> a1-2 num-params) arg1) + (set! (-> a1-2 message) arg2) + (set! (-> a1-2 param 0) (-> arg3 param 0)) + (set! (-> a1-2 param 1) (-> arg3 param 1)) + (set! (-> a1-2 param 2) (-> arg3 param 2)) + (set! (-> a1-2 param 3) (-> arg3 param 3)) + (set! (-> a1-2 param 4) (-> arg3 param 4)) + (set! (-> a1-2 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> this rider-array s1-0)) a1-2) + ) + ) + ) + (case arg2 + (('attack) + (let ((s3-1 (the-as object (-> arg3 param 1))) + (s2-1 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3)) + ) + (when (and (!= (-> (the-as attack-info s3-1) id) (-> this incoming-attack-id)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (or (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) + ) + ) + (set! (-> this incoming-attack-id) (-> (the-as attack-info s3-1) id)) + (when (and (logtest? (-> this info flags) 4) (logtest? (vehicle-flag ai-driving) (-> this v-flags))) + (let ((a1-6 (find-offending-process-focusable arg0 (the-as attack-info s3-1)))) + (if (and a1-6 (logtest? (-> a1-6 mask) (process-mask target))) + (vehicle-method-130 this) + ) + ) + ) + (attack-handler + this + (the-as process-drawable arg0) + (the-as attack-info s3-1) + (the-as touching-shapes-entry (-> arg3 param 0)) + s2-1 + ) + ) + ) + ) + (('apply-impulse) + (when (not (logtest? (vehicle-flag ignore-impulse) (-> this v-flags))) + (impulse-handler this) + (let ((a1-8 (-> arg3 param 0)) + (a2-3 (-> arg3 param 1)) + ) + (apply-impact! (-> this rbody) (the-as vector a1-8) (the-as vector a2-3)) + ) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + ) + ) + (('get-offending-focusable) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + *target* + ) + ) + (('pilot-on) + (let* ((s3-2 (-> arg3 param 0)) + (s2-2 arg0) + (s5-1 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + (when s5-1 + (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> this pid) (-> arg0 pid)) + (logior! (-> this v-flags) (vehicle-flag riding)) + (put-rider-in-seat this (the-as int s3-2) s5-1) + (if (logtest? (-> s5-1 mask) (process-mask target)) + (logior! (-> this v-flags) (vehicle-flag player-driving)) + ) + #t + ) + ) + ) + (('player-get-off) + (if (and (logtest? (vehicle-flag player-driving) (-> this v-flags)) (!= (-> this crash-level) 3)) + (go (method-of-object this waiting)) + ) + ) + (('nav-mesh-kill) + (vehicle-method-138 this) + #t + ) + (('go-hostile) + (let ((a1-13 (-> arg3 param 0))) + (vehicle-method-143 this (the-as process a1-13)) + ) + ) + (('go-die) + (let ((v1-71 (-> this root root-prim))) + (set! (-> v1-71 prim-core collide-as) (collide-spec)) + (set! (-> v1-71 prim-core collide-with) (collide-spec)) + ) + 0 + (go (method-of-object this die)) + ) + (('scale-max-hit-points) + (let ((f1-0 (the-as float (-> arg3 param 0)))) + (set! (-> this damage-factor) (* (-> this damage-factor) (/ 1.0 f1-0))) + ) + 0 + ) + (('push-trans) + (let ((a1-14 (-> arg3 param 0))) + (vehicle-method-146 this (the-as vector a1-14)) + ) + #t + ) + (('gun-dark-2-off) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag gun-dark-2-zero-g)))) + (let* ((f1-2 (the-as float (-> arg3 param 0))) + (f30-0 (fmin (-> this hit-points) (- 1.0 f1-2))) + (a2-6 (new 'stack 'rigid-body-impact)) + ) + (apply-damage this (* (-> this info damage hit-points) (- (-> this hit-points) f30-0)) a2-6) + ) + ) + (('set-control-hook-ai) + (set! v0-2 (method-of-object this control-hook-ai)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-2)) + v0-2 + ) + (('set-control-hook-player) + (set! v0-2 (method-of-object this control-hook-player)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-2)) + v0-2 + ) + (('ignore-damage) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag ignore-damage)))) + (when (-> arg3 param 0) + (set! v0-2 (logior (vehicle-flag ignore-damage) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-2)) + v0-2 + ) + ) + (('ignore-impulse) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag ignore-impulse)))) + (when (-> arg3 param 0) + (set! v0-2 (logior (vehicle-flag ignore-impulse) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-2)) + v0-2 + ) + ) + (else + ((method-of-type rigid-body-object rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod vehicle-method-131 ((this vehicle)) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod vehicle-method-143 ((this vehicle) (arg0 process)) + 0 + ) diff --git a/goal_src/jak3/levels/common/battle.gc b/goal_src/jak3/levels/common/battle.gc index 5b970cb776..d64a4ad4f2 100644 --- a/goal_src/jak3/levels/common/battle.gc +++ b/goal_src/jak3/levels/common/battle.gc @@ -5,5 +5,1615 @@ ;; name in dgo: battle ;; dgos: TEMA, SEA, LFORM, LBIPED, TOWERA +;; +++battle-spawner-flags +(defenum battle-spawner-flags + :bitfield #t + :type int64 + (hit) + ) +;; ---battle-spawner-flags + + +;; +++battle-flags +(defenum battle-flags + :bitfield #t + :type uint8 + (noticed) + (active) + (beaten) + (no-spawner-block) + (battle-music-set) + ) +;; ---battle-flags + + ;; DECOMP BEGINS +(deftype battle-info (basic) + ((id int8) + (notice-spec uint64) + (pick-logic int8) + (notice-distance float) + (dont-spawn-initial-until-notice? symbol) + (play-battle-music symbol) + (min-battle-spawn-delay uint32) + (max-battle-spawn-delay uint32) + (min-spawner-notice-attack-delay uint32) + (max-spawner-notice-attack-delay uint32) + (spawner-blocked-by-player-xz float) + (spawner-blocked-by-collide-radius float) + (pick-spawner-max-dist float) + (max-count uint32) + (desired-alive-count uint8) + (spawner-collide-with collide-spec) + ) + ) + + +(deftype battle-ally (structure) + ((entity entity-actor) + ) + ) + + +(deftype battle-ally-array (inline-array-class) + ((data battle-ally :inline :dynamic) + ) + ) + + +(set! (-> battle-ally-array heap-base) (the-as uint 16)) + +(deftype battle-breed (structure) + ((breed-type type) + (percent float) + ) + ) + + +(deftype battle-breed-array (inline-array-class) + ((data battle-breed :inline :dynamic) + ) + ) + + +(set! (-> battle-breed-array heap-base) (the-as uint 16)) + +(deftype battle-spawner (structure) + ((flags battle-spawner-flags) + (entity entity-actor) + (breeds battle-breed-array) + (creature-index int8) + (ready-index int8) + (attack-index int8) + (mode uint8) + (intro-path path-control) + (notice-attack-delay uint32) + (creature handle) + (last-spawn-time time-frame) + (noticed-attack-time time-frame) + (attack-pos vector :inline) + ) + ) + + +(deftype battle-spawner-array (inline-array-class) + ((data battle-spawner :inline :dynamic) + ) + ) + + +(set! (-> battle-spawner-array heap-base) (the-as uint 80)) + +(deftype battle (process-drawable) + ((info battle-info) + (flags battle-flags) + (spawn-initial-creatures? symbol) + (next-spawn-delay uint32) + (on-notice basic) + (on-hostile basic) + (on-beaten basic) + (max-count uint32) + (count uint32) + (die-count uint32) + (stat-child-count uint16) + (cant-spawn-time time-frame) + (jammed-starting-time time-frame) + (spawners battle-spawner-array) + (allies battle-ally-array) + ) + (:state-methods + idle + undefined + notice + hostile + beaten + ) + (:methods + (spawner-blocked? (_type_ battle-spawner) symbol) + (spawner-blocked-by-collide? (_type_ battle-spawner) symbol) + (draw-battle-marks (_type_) none) + (initialize-enemy-lists (_type_) none) + (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none) + (get-spawner-for-enemy (_type_ process) battle-spawner) + (initialize-ally (_type_ battle-ally entity-actor) none) + (initialize-spawner (_type_ battle-spawner entity-actor) none) + (initialize-battle (_type_) none) + (init-go (_type_) int) + (get-spawn-delay (_type_) int) + (get-best-spawner (_type_) battle-spawner) + (spawner-free? (_type_ battle-spawner) symbol) + (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle) + (spawn-from-spawner (_type_ battle-spawner symbol) none) + (spawn-initial-creatures (_type_) none) + (get-random-breed (_type_ battle-spawner) battle-breed) + (spawner-hit (_type_ battle-spawner process) symbol) + (spawner-try-jump (_type_ battle-spawner enemy) symbol) + (spawner-do-jump (_type_ battle-spawner) int) + (spawner-hittable? (_type_ battle-spawner) symbol) + (spawner-in-intro? (_type_ battle-spawner) symbol) + (set-battle-music (_type_) none) + (unset-battle-music (_type_) none) + (update-allies-list (_type_) int) + (beaten? (_type_) symbol) + (spawner-active? (_type_ battle-spawner symbol) symbol) + (spawner-active-count (_type_) int) + ) + ) + + +(define *battles* (new 'static 'boxed-array :type battle-info + (new 'static 'battle-info + :notice-spec #x2 + :notice-distance 163840.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x384 + :max-battle-spawn-delay #x708 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xa + :desired-alive-count #x2 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 1 + :notice-spec #x2 + :notice-distance 163840.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x4b0 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xf + :desired-alive-count #x2 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 2 + :notice-spec #x2 + :notice-distance 204800.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x4b0 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x11 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 3 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x1 + :desired-alive-count #x1 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 4 + :notice-spec #x2 + :notice-distance 245760.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x4b0 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x14 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 6 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x1e + :desired-alive-count #xf + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 7 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x3c + :max-battle-spawn-delay #x96 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x32 + :desired-alive-count #xf + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 8 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xc + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 9 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xc + :desired-alive-count #x3 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 10 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x8 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 11 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x32 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 12 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x1e + :desired-alive-count #x8 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 13 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x20000000 + :desired-alive-count #x8 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 14 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xc + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 15 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x28 + :desired-alive-count #xf + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 16 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x4 + :desired-alive-count #x3 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 17 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x7 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 18 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x8 + :desired-alive-count #x3 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 19 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x22 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 20 + :notice-spec #x1 + :pick-logic 1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x14 + :desired-alive-count #x8 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 21 + :notice-spec #x2 + :notice-distance 1228800.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music 'wasfight + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x20000000 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 22 + :notice-spec #x2 + :notice-distance 819200.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music 'wasfight + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x20000000 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + ) + ) + +;; WARN: disable def twice: 9. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 19. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 29. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior battle-event-handler battle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('query) + (case (-> arg3 param 0) + (('beaten) + (and (-> self next-state) (= (-> self next-state name) 'beaten)) + ) + (('hostile) + (and (-> self next-state) (= (-> self next-state name) 'hostile)) + ) + (('idle) + (and (-> self next-state) (= (-> self next-state name) 'idle)) + ) + (('die-count) + (-> self die-count) + ) + (else + #f + ) + ) + ) + (('child-die) + (+! (-> self die-count) 1) + (let ((v1-14 (get-spawner-for-enemy self arg0))) + (when v1-14 + (set! (-> v1-14 creature) (the-as handle #f)) + #f + ) + ) + ) + (('child-hit) + (let ((a1-3 (get-spawner-for-enemy self arg0))) + (when a1-3 + (logior! (-> a1-3 flags) (battle-spawner-flags hit)) + (spawner-hit self a1-3 arg0) + ) + ) + ) + (('child-jumped) + (let ((a1-5 (get-spawner-for-enemy self arg0))) + (if a1-5 + (spawner-do-jump self a1-5) + ) + ) + ) + (('trigger) + (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + (go-virtual notice) + ) + ) + (('untrigger) + (if (not (and (-> self next-state) (= (-> self next-state name) 'idle))) + (go-virtual idle) + ) + ) + (('beaten) + (logior! (-> self flags) (battle-flags beaten)) + (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + (go-virtual beaten) + ) + ) + (('resume) + (logclear! (-> self flags) (battle-flags beaten)) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (if (and (-> self next-state) (= (-> self next-state name) 'beaten)) + (go-virtual hostile) + ) + ) + ) + ) + +(defmethod draw-battle-marks ((this battle)) + (local-vars (sv-16 string) (sv-32 string)) + (let ((s4-0 (-> this root trans)) + (s5-0 (the-as int (-> this max-count))) + ) + (if (= (the-as uint s5-0) #x20000000) + (set! s5-0 0) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) s4-0 (new 'static 'rgba :g #xff :b #xff :a #x80)) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 577) + ) + (format + (clear *temp-string*) + "~%~S~%count ~d/~d~%child ~d~%ally ~d~%die count ~d" + (-> this name) + (-> this count) + s5-0 + (-> this stat-child-count) + (-> this allies length) + (-> this die-count) + ) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color orange) (the-as vector2h #f)) + ) + ) + (dotimes (s5-1 (-> this spawners length)) + (let ((s4-1 (-> this spawners data s5-1))) + (let ((a0-6 (-> s4-1 intro-path))) + (if a0-6 + (debug-draw a0-6) + ) + ) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> s4-1 entity extra trans) + (new 'static 'rgba :g #xff :b #xff :a #x80) + ) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 577) + ) + (let ((s0-1 format)) + (set! sv-16 (clear *temp-string*)) + (set! sv-32 "~%spawner~%~S") + (let ((a2-5 (res-lump-struct (-> s4-1 entity) 'name structure))) + (s0-1 sv-16 sv-32 a2-5) + ) + ) + (s3-1 + s2-1 + (the-as bucket-id s1-1) + *temp-string* + (-> s4-1 entity extra trans) + (font-color yellow) + (the-as vector2h #f) + ) + ) + ) + 0 + ) + 0 + (none) + ) + +(defmethod spawner-blocked-by-collide? ((this battle) (arg0 battle-spawner)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f0-0 (-> this info spawner-blocked-by-collide-radius)) + ) + (set! (-> gp-0 quad) (-> arg0 attack-pos quad)) + (set! (-> gp-0 w) f0-0) + (let ((s5-0 (-> this info spawner-collide-with)) + (f30-0 (* f0-0 f0-0)) + ) + (set! *actor-list-length* 0) + (if (logtest? s5-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (the-as bounding-box gp-0) *actor-list* 256)) + ) + (when (logtest? s5-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-15 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-4 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s5-0 (-> a1-4 prim-core collide-as)) + (let ((a1-5 (-> a1-4 prim-core))) + (let ((a2-4 a1-5) + (a3-1 gp-0) + ) + (.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-1 (+ (-> a1-5 world-sphere w) (-> gp-0 w))) + ) + (when (< f0-2 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-15) + *collide-player-list* + (set! v1-15 (-> v1-15 next0)) + ) + ) + ) + ) + (when (logtest? s5-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-23 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-16 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? s5-0 (-> a1-16 prim-core collide-as)) + (let ((a1-17 (-> a1-16 prim-core))) + (let ((a2-11 a1-17) + (a3-2 gp-0) + ) + (.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-5 (+ (-> a1-17 world-sphere w) (-> gp-0 w))) + ) + (when (< f0-3 (* f1-5 f1-5)) + (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-23) + *collide-hit-by-player-list* + (set! v1-23 (-> v1-23 next0)) + ) + ) + ) + ) + (dotimes (s4-0 *actor-list-length*) + (let ((v1-28 (-> *actor-list* s4-0))) + (when (logtest? s5-0 (-> v1-28 root-prim prim-core collide-as)) + (if (>= f30-0 (vector-vector-xz-distance-squared gp-0 (-> v1-28 trans))) + (return #t) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +(defmethod spawner-blocked? ((this battle) (arg0 battle-spawner)) + (when (not (logtest? (-> this flags) (battle-flags no-spawner-block))) + (let ((f0-0 (-> this info spawner-blocked-by-player-xz))) + (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) + (return #t) + ) + ) + (let ((f0-3 (-> this info spawner-blocked-by-collide-radius))) + (if (and (< 0.0 f0-3) (spawner-blocked-by-collide? this arg0)) + (return #t) + ) + ) + ) + #f + ) + +(defmethod spawner-free? ((this battle) (arg0 battle-spawner)) + (and (not (handle->process (-> arg0 creature))) + (and (not (-> *setting-control* user-current nuke-active?)) + (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? this arg0))) + ) + ) + ) + +(defmethod get-best-spawner ((this battle)) + (if (-> *setting-control* user-current nuke-active?) + (return (the-as battle-spawner #f)) + ) + (let ((s5-0 (-> this spawners length)) + (v1-6 (-> this info pick-logic)) + ) + (if (not *target*) + (set! v1-6 0) + ) + (cond + ((zero? v1-6) + (let ((s3-0 (rand-vu-int-count s5-0))) + (dotimes (s4-0 s5-0) + (let ((s2-0 (-> this spawners data s3-0))) + (if (spawner-free? this s2-0) + (return s2-0) + ) + ) + (set! s3-0 (mod (+ s3-0 1) s5-0)) + ) + ) + ) + ((= v1-6 1) + (let ((s4-1 0) + (f30-0 -1.0) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (let ((s3-1 (-> this spawners data s5-0))) + (when (spawner-free? this s3-1) + (let ((f0-0 (vector-vector-distance (target-pos 0) (-> s3-1 entity extra trans)))) + (when (and (>= (-> this info pick-spawner-max-dist) f0-0) (or (< f30-0 0.0) (< f0-0 f30-0))) + (set! s4-1 s5-0) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + (if (< 0.0 f30-0) + (return (-> this spawners data s4-1)) + ) + ) + ) + ) + ) + (the-as battle-spawner #f) + ) + +(defmethod get-random-breed ((this battle) (arg0 battle-spawner)) + (let ((f0-0 (rand-vu)) + (v1-0 0) + ) + (let ((a0-2 (-> arg0 breeds length))) + (dotimes (a1-1 a0-2) + (when (>= f0-0 0.0) + (set! f0-0 (- f0-0 (-> arg0 breeds data a1-1 percent))) + (if (< f0-0 0.0) + (set! v1-0 a1-1) + ) + ) + ) + ) + (-> arg0 breeds data v1-0) + ) + ) + +;; WARN: Return type mismatch int vs handle. +(defmethod spawn-from-breed ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) + (let* ((a1-1 (-> arg0 breed-type)) + (s4-0 (get-process *default-dead-pool* a1-1 #x4000 1)) + (v1-1 (when s4-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s4-0 this "battle-slave" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 enemy-init-by-other this arg1) + (-> s4-0 ppointer) + ) + ) + ) + (if (not v1-1) + (return (the-as handle #f)) + ) + (+! (-> this count) 1) + (the-as handle (ppointer->handle v1-1)) + ) + ) + +;; WARN: Return type mismatch handle vs none. +(defmethod spawn-from-spawner ((this battle) (arg0 battle-spawner) (arg1 symbol)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'quaternion)) + (s2-0 (-> arg0 intro-path)) + ) + (cond + (s2-0 + (let ((s1-0 0)) + (when arg1 + (set! s1-0 (-> arg0 ready-index)) + (set! s1-0 (cond + ((>= s1-0 0) + (empty) + s1-0 + ) + (else + (-> arg0 attack-index) + ) + ) + ) + ) + (set! (-> arg0 creature-index) s1-0) + (get-point-in-path! s2-0 s3-0 (the float s1-0) 'exact) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (displacement-between-two-points-normalized! s2-0 s0-0 (the float s1-0)) + (set! (-> s0-0 y) 0.0) + (vector-normalize! s0-0 1.0) + (forward-up->quaternion s4-0 s0-0 *up-vector*) + ) + ) + ) + (else + (set! (-> arg0 creature-index) 0) + (let ((v1-7 (-> arg0 entity))) + (set! (-> s3-0 quad) (-> v1-7 extra trans quad)) + (quaternion-copy! s4-0 (-> v1-7 quat)) + ) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'enemy-init-by-other-params)) + (s2-1 (!= s2-0 #f)) + (s0-1 (get-random-breed this arg0)) + ) + (set! (-> s1-1 trans quad) (-> s3-0 quad)) + (quaternion-copy! (-> s1-1 quat) s4-0) + (set! (-> s1-1 entity) (-> arg0 entity)) + (set! (-> s1-1 directed?) #t) + (set! (-> s1-1 no-initial-move-to-ground?) s2-1) + (set! (-> s1-1 art-level) #f) + (let ((v0-7 (spawn-from-breed this s0-1 s1-1))) + (when (handle->process v0-7) + (set! (-> arg0 creature) v0-7) + (set! (-> arg0 mode) (the-as uint 1)) + (set-time! (-> arg0 last-spawn-time)) + ) + ) + ) + ) + (none) + ) + +(defmethod get-spawner-for-enemy ((this battle) (arg0 process)) + (let ((v1-0 (if (type? arg0 nav-enemy) + (the-as nav-enemy arg0) + ) + ) + ) + (when v1-0 + (dotimes (a0-3 (-> this spawners length)) + (let* ((a1-5 (-> this spawners data a0-3)) + (a2-2 (handle->process (-> a1-5 creature))) + ) + (when (and a2-2 (= a2-2 v1-0)) + (when (not (logtest? (enemy-flag directed) (-> (the-as nav-enemy a2-2) enemy-flags))) + (set! (-> a1-5 creature) (the-as handle #f)) + (set! a1-5 (the-as battle-spawner #f)) + ) + (return a1-5) + ) + ) + ) + ) + ) + (the-as battle-spawner #f) + ) + +(defmethod spawner-active? ((this battle) (arg0 battle-spawner) (arg1 symbol)) + (when (and (logtest? (-> this flags) (battle-flags active)) (not (logtest? (-> this flags) (battle-flags beaten)))) + (let ((v1-5 (-> arg0 noticed-attack-time))) + (cond + ((zero? v1-5) + (set-time! (-> arg0 noticed-attack-time)) + ) + (else + (if (time-elapsed? v1-5 (the-as time-frame (-> arg0 notice-attack-delay))) + (logior! (-> arg0 flags) (battle-spawner-flags hit)) + ) + ) + ) + ) + ) + (let ((s4-0 (handle->process (-> arg0 creature)))) + (when s4-0 + (when (not (logtest? (enemy-flag directed) (-> (the-as nav-enemy s4-0) enemy-flags))) + (set! (-> arg0 creature) (the-as handle #f)) + (return #f) + ) + (let ((v1-20 (-> arg0 mode))) + (cond + ((= v1-20 1) + (set! (-> arg0 mode) (the-as uint 0)) + 0 + ) + ((zero? v1-20) + (when (or (logtest? (enemy-flag directed-ready) (-> (the-as nav-enemy s4-0) enemy-flags)) (not arg1)) + (cond + ((spawner-in-intro? this arg0) + (if (not (spawner-try-jump this arg0 (the-as enemy s4-0))) + (return #t) + ) + ) + ((spawner-hittable? this arg0) + (spawner-hit this arg0 s4-0) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +(defmethod spawner-in-intro? ((this battle) (arg0 battle-spawner)) + (when (-> arg0 intro-path) + (let ((v1-1 (-> arg0 creature-index)) + (a0-1 (-> arg0 attack-index)) + ) + (or (< v1-1 (-> arg0 ready-index)) (and (< v1-1 a0-1) (logtest? (-> arg0 flags) (battle-spawner-flags hit)))) + ) + ) + ) + +(defmethod spawner-try-jump ((this battle) (arg0 battle-spawner) (arg1 enemy)) + (let ((s3-0 (+ (-> arg0 creature-index) 1)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (if (and (= s3-0 (-> arg0 attack-index)) (spawner-blocked? this arg0)) + (return #f) + ) + (get-point-in-path! (-> arg0 intro-path) s4-0 (the float s3-0) 'exact) + (let ((s3-1 (-> arg0 mode))) + (set! (-> arg0 mode) (the-as uint 2)) + (set! (-> arg1 enemy-flags) + (the-as enemy-flag (logclear (-> arg1 enemy-flags) (enemy-flag jump-check-blocked))) + ) + (cond + ((send-event arg1 'jump 3 s4-0) + #t + ) + (else + (set! (-> arg0 mode) s3-1) + #f + ) + ) + ) + ) + ) + +(defmethod spawner-hittable? ((this battle) (arg0 battle-spawner)) + (when (logtest? (-> arg0 flags) (battle-spawner-flags hit)) + (if (-> arg0 intro-path) + (>= (-> arg0 creature-index) (-> arg0 attack-index)) + #t + ) + ) + ) + +(defmethod spawner-hit ((this battle) (arg0 battle-spawner) (arg1 process)) + (let ((s5-0 (-> arg0 creature))) + (set! (-> arg0 creature) (the-as handle #f)) + (cond + ((send-event arg1 'cue-chase) + #t + ) + (else + (set! (-> arg0 creature) s5-0) + #f + ) + ) + ) + ) + +(defmethod spawner-do-jump ((this battle) (arg0 battle-spawner)) + (when (= (-> arg0 mode) 2) + (+! (-> arg0 creature-index) 1) + (set! (-> arg0 mode) (the-as uint 0)) + (spawner-active? this arg0 #f) + ) + 0 + ) + +(defmethod spawner-active-count ((this battle)) + (let ((gp-0 0)) + (dotimes (s4-0 (-> this spawners length)) + (if (spawner-active? this (-> this spawners data s4-0) #t) + (+! gp-0 1) + ) + ) + gp-0 + ) + ) + +(defmethod spawn-initial-creatures ((this battle)) + (set! (-> this spawn-initial-creatures?) #f) + (let ((s5-0 (-> this spawners))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((s3-0 (-> s5-0 data s4-0))) + (when (spawner-free? this s3-0) + (let ((v1-7 (res-lump-value (-> s3-0 entity) 'enemy-options uint128 :time -1000000000.0))) + (when (logtest? #x100000 v1-7) + (spawn-from-spawner this s3-0 #t) + (+! (-> this stat-child-count) 1) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod get-spawn-delay ((this battle)) + (let ((v1-0 (-> this info))) + (rand-vu-int-range + (the-as int (-> v1-0 min-battle-spawn-delay)) + (the-as int (-> v1-0 max-battle-spawn-delay)) + ) + ) + ) + +(defstate idle (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (if (and (-> self spawn-initial-creatures?) (not (-> self info dont-spawn-initial-until-notice?))) + (spawn-initial-creatures self) + ) + (unset-battle-music self) + ) + :trans (behavior () + (let ((v1-1 (-> self info notice-spec))) + (when (not (logtest? v1-1 1)) + (let ((gp-0 #t)) + (if (and (logtest? v1-1 2) + (not (and *target* + (and (>= (-> self info notice-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + ) + ) + (set! gp-0 #f) + ) + (if gp-0 + (go-virtual notice) + ) + ) + ) + ) + (if *display-battle-marks* + (draw-battle-marks self) + ) + ) + :code sleep-code + ) + +(defstate notice (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval (the-as pair gp-0) :vector (-> self root trans)) + ) + ) + (set-battle-music self) + (if (-> self spawn-initial-creatures?) + (spawn-initial-creatures self) + ) + (if (logtest? (-> self flags) (battle-flags noticed)) + (go-virtual hostile) + ) + (logior! (-> self flags) (battle-flags noticed)) + ) + :trans (behavior () + (if *display-battle-marks* + (draw-battle-marks self) + ) + ) + :code (behavior () + (go-virtual hostile) + ) + ) + +(defmethod update-allies-list ((this battle)) + (with-pp + (let ((v1-0 (-> this allies)) + (gp-0 (-> this allies length)) + ) + (when (> gp-0 0) + (let* ((a1-4 (mod (-> pp clock integral-frame-counter) gp-0)) + (a3-0 (-> v1-0 data a1-4)) + ) + (when (logtest? (-> a3-0 entity extra perm status) (entity-perm-status dead)) + (+! (-> this die-count) 1) + (+! gp-0 -1) + (set! (-> v1-0 length) gp-0) + (if (and (nonzero? gp-0) (!= a1-4 gp-0)) + (mem-copy! (the-as pointer a3-0) (the-as pointer (-> v1-0 data gp-0)) 4) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +(defmethod beaten? ((this battle)) + (let ((s5-0 (spawner-active-count this)) + (v1-2 (update-allies-list this)) + (a1-0 (-> this child)) + (a0-3 0) + ) + (while a1-0 + (+! a0-3 1) + (set! a1-0 (-> a1-0 0 brother)) + (nop!) + (nop!) + ) + (set! (-> this stat-child-count) (the-as uint a0-3)) + (let ((a0-4 (+ v1-2 a0-3)) + (v1-4 (-> this max-count)) + ) + (if (>= (-> this die-count) v1-4) + (return #t) + ) + (logclear! (-> this flags) (battle-flags no-spawner-block)) + (cond + ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> this die-count))))) + (let ((a1-10 (-> this jammed-starting-time))) + (cond + ((zero? (-> this jammed-starting-time)) + (set-time! (-> this jammed-starting-time)) + ) + (else + (if (time-elapsed? a1-10 (seconds 3.5)) + (logior! (-> this flags) (battle-flags no-spawner-block)) + ) + ) + ) + ) + ) + (else + (set! (-> this jammed-starting-time) 0) + 0 + ) + ) + (cond + ((and (not (logtest? (-> this flags) (battle-flags beaten))) + (> (-> this spawners length) 0) + (< a0-4 (the-as int (-> this info desired-alive-count))) + (< (-> this count) v1-4) + ) + (when (time-elapsed? (-> this cant-spawn-time) (the-as time-frame (-> this next-spawn-delay))) + (let ((a1-25 (get-best-spawner this))) + (cond + (a1-25 + (spawn-from-spawner this a1-25 #f) + (set! (-> this next-spawn-delay) (the-as uint (get-spawn-delay this))) + (set-time! (-> this cant-spawn-time)) + ) + (else + (set-time! (-> this cant-spawn-time)) + ) + ) + ) + ) + ) + (else + (set-time! (-> this cant-spawn-time)) + ) + ) + ) + ) + #f + ) + +(defstate hostile (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self flags) (battle-flags active)) + (logclear! (-> self flags) (battle-flags no-spawner-block)) + (set! (-> self jammed-starting-time) 0) + (set! (-> self cant-spawn-time) 0) + (set! (-> self next-spawn-delay) (the-as uint 0)) + (set-battle-music self) + (let ((gp-0 (-> self on-hostile))) + (if gp-0 + (script-eval (the-as pair gp-0) :vector (-> self root trans)) + ) + ) + ) + :trans (behavior () + (if (beaten? self) + (go-virtual beaten) + ) + (if *display-battle-marks* + (draw-battle-marks self) + ) + ) + :code sleep-code + ) + +(defstate beaten (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (let ((gp-0 (-> self on-beaten))) + (if gp-0 + (script-eval (the-as pair gp-0) :vector (-> self root trans)) + ) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (unset-battle-music self) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch battle-flags vs none. +(defmethod set-battle-music ((this battle)) + (let ((a3-0 (-> this info play-battle-music))) + (when (and a3-0 (not (logtest? (-> this flags) (battle-flags battle-music-set)))) + (case a3-0 + (('sound-mode) + (set-setting! 'sound-mode #f 0.0 1) + ) + (else + (set-setting! 'music a3-0 0.0 0) + ) + ) + (logior! (-> this flags) (battle-flags battle-music-set)) + ) + ) + (none) + ) + +(defmethod unset-battle-music ((this battle)) + (when (logtest? (-> this flags) (battle-flags battle-music-set)) + (remove-setting! 'sound-mode) + (remove-setting! 'music) + ) + 0 + (none) + ) + +(defmethod relocate ((this battle-spawner-array) (offset int)) + (dotimes (v1-0 (-> this length)) + (let ((a2-3 (-> this data v1-0))) + (&+! (-> a2-3 breeds) offset) + (if (-> a2-3 intro-path) + (&+! (-> a2-3 intro-path) offset) + ) + ) + ) + this + ) + +(defmethod relocate ((this battle) (offset int)) + (&+! (-> this spawners) offset) + (&+! (-> this allies) offset) + (call-parent-method this offset) + ) + +(defmethod initialize-spawner-breeds ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (let ((s2-0 0) + (s5-0 0) + (s4-0 0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((s1-0 (res-lump-data arg1 'spawn-types pointer :tag-ptr (& sv-16)))) + (dotimes (s0-0 2) + (set! s2-0 0) + (when s1-0 + (set! s4-0 (the-as int (-> sv-16 elt-count))) + (dotimes (v1-5 s4-0) + (let ((a0-4 (-> (the-as (pointer uint32) (&+ s1-0 (* v1-5 4)))))) + (when (nonzero? a0-4) + (set! s5-0 (logior s5-0 (ash 1 v1-5))) + (+! s2-0 1) + (when (= s0-0 1) + (let ((a1-10 (-> arg0 breeds data (+ s2-0 -1)))) + (set! (-> a1-10 breed-type) (the-as type a0-4)) + (set! (-> a1-10 percent) 1.0) + ) + ) + ) + ) + ) + ) + (if (zero? s0-0) + (set! (-> arg0 breeds) (new 'process 'battle-breed-array (max 1 s2-0))) + ) + ) + ) + (cond + ((zero? s2-0) + (let ((v1-15 (-> arg0 breeds data))) + (set! (-> v1-15 0 breed-type) (-> arg1 etype)) + (set! (-> v1-15 0 percent) 1.0) + ) + ) + (else + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-18 (res-lump-data arg1 'spawn-percs pointer :tag-ptr (& sv-32)))) + (when v1-18 + (let ((a0-16 (min (the-as int (-> sv-32 elt-count)) s4-0)) + (a1-14 0) + (a2-7 (-> arg0 breeds)) + ) + (dotimes (a3-2 a0-16) + (when (logtest? s5-0 (ash 1 a3-2)) + (let ((t0-8 (-> a2-7 data a1-14))) + (set! (-> t0-8 percent) (-> (the-as (pointer float) (&+ v1-18 (* a3-2 4))))) + ) + (+! a1-14 1) + ) + ) + ) + ) + ) + (let ((f30-0 0.0) + (s5-1 (-> arg0 breeds)) + ) + (dotimes (v1-20 (-> s5-1 length)) + (+! f30-0 (-> s5-1 data v1-20 percent)) + ) + (when (!= f30-0 1.0) + (format + 0 + "WARNING: battle spawner ~A has spawn percents that don't sum to 1.0.~%" + (res-lump-struct (-> arg0 entity) 'name structure) + ) + (dotimes (v1-26 (-> s5-1 length)) + (let ((a0-27 (-> s5-1 data v1-26))) + (set! (-> a0-27 percent) (/ (-> a0-27 percent) f30-0)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod initialize-spawner ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) + (set! (-> arg0 flags) (battle-spawner-flags)) + (set! (-> arg0 entity) arg1) + (set! (-> arg0 creature-index) 0) + (set! (-> arg0 ready-index) -1) + (set! (-> arg0 attack-index) 0) + (set! (-> arg0 intro-path) #f) + (set! (-> arg0 notice-attack-delay) + (the-as uint (rand-vu-int-range + (the-as int (-> this info min-spawner-notice-attack-delay)) + (the-as int (-> this info max-spawner-notice-attack-delay)) + ) + ) + ) + (set! (-> arg0 creature) (the-as handle #f)) + (set! (-> arg0 last-spawn-time) 0) + (set! (-> arg0 noticed-attack-time) 0) + (initialize-spawner-breeds this arg0 arg1) + (let ((a0-4 (new 'process 'path-control this 'intro 0.0 arg1 #t))) + (cond + ((nonzero? a0-4) + (set! (-> arg0 intro-path) a0-4) + (logior! (-> a0-4 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s5-1 (-> a0-4 curve num-cverts))) + (let ((v1-9 (+ s5-1 -1))) + (set! (-> arg0 attack-index) v1-9) + (get-point-in-path! a0-4 (-> arg0 attack-pos) (the float v1-9) 'exact) + ) + (let ((v0-4 -1)) + (if (< 2 s5-1) + (set! v0-4 1) + ) + (set! (-> arg0 ready-index) v0-4) + ) + ) + ) + (else + (set! (-> arg0 attack-pos quad) (-> arg0 entity extra trans quad)) + ) + ) + ) + (none) + ) + +(defmethod initialize-ally ((this battle) (arg0 battle-ally) (arg1 entity-actor)) + (set! (-> arg0 entity) arg1) + 0 + (none) + ) + +(defmethod initialize-enemy-lists ((this battle)) + (local-vars (v0-4 battle-ally-array) (sv-16 res-tag) (sv-32 entity)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v0-0 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (when (and v0-0 (nonzero? (-> sv-16 elt-count))) + (let* ((s5-0 (-> (the-as (pointer actor-group) v0-0) 0)) + (s4-0 (-> s5-0 length)) + ) + (dotimes (s3-0 2) + (let ((s1-0 0) + (s2-0 0) + ) + (dotimes (s0-0 s4-0) + (set! sv-32 (-> s5-0 data s0-0 actor)) + (when sv-32 + (let ((v0-1 (res-lump-value sv-32 'enemy-options uint128 :time -1000000000.0))) + (cond + ((logtest? #x80000 v0-1) + (+! s1-0 1) + (cond + ((zero? s3-0) + 0 + ) + (else + (let ((a1-2 (-> this spawners data (+ s1-0 -1)))) + (initialize-spawner this a1-2 (the-as entity-actor sv-32)) + ) + ) + ) + ) + (else + (when (not (logtest? (-> sv-32 extra perm status) (entity-perm-status dead))) + (+! s2-0 1) + (cond + ((zero? s3-0) + 0 + ) + (else + (let ((a1-3 (-> this allies data (+ s2-0 -1)))) + (initialize-ally this a1-3 (the-as entity-actor sv-32)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v0-4 (when (zero? s3-0) + (set! (-> this spawners) (new 'process 'battle-spawner-array s1-0)) + (set! v0-4 (new 'process 'battle-ally-array s2-0)) + (set! (-> this allies) v0-4) + v0-4 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod initialize-battle ((this battle)) + (set! (-> this spawn-initial-creatures?) #t) + (set! (-> this count) (the-as uint 0)) + (set! (-> this die-count) (the-as uint 0)) + (set! (-> this stat-child-count) (the-as uint 0)) + (let ((v1-2 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)) + (a0-2 *battles*) + ) + (dotimes (a1-1 (-> a0-2 length)) + (let ((a2-3 (-> a0-2 a1-1))) + (when (= (the-as uint v1-2) (-> a2-3 id)) + (set! (-> this info) a2-3) + (goto cfg-7) + ) + ) + ) + ) + (go process-drawable-art-error "bad battle id") + (label cfg-7) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice basic)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile basic)) + (set! (-> this on-beaten) (res-lump-struct (-> this entity) 'on-beaten basic)) + (initialize-enemy-lists this) + (+! (-> this count) (-> this allies length)) + (let ((v1-16 (-> this info max-count))) + (cond + ((and (= v1-16 #x20000000) (zero? (-> this spawners length))) + (set! v1-16 (-> this count)) + ) + ((< v1-16 (-> this count)) + (set! v1-16 (-> this count)) + ) + ) + (set! (-> this max-count) v1-16) + ) + 0 + (none) + ) + +(defmethod init-go ((this battle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this beaten)) + (go (method-of-object this idle)) + ) + 0 + ) + +;; WARN: Return type mismatch int vs object. +(defmethod init-from-entity! ((this battle) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'trsqv))) + (set! (-> this root) s4-0) + (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) + (vector-identity! (-> s4-0 scale)) + ) + (initialize-battle this) + (init-go this) + ) diff --git a/goal_src/jak3/levels/common/elec-gate.gc b/goal_src/jak3/levels/common/elec-gate.gc index c531b249ab..ead26fbfac 100644 --- a/goal_src/jak3/levels/common/elec-gate.gc +++ b/goal_src/jak3/levels/common/elec-gate.gc @@ -5,5 +5,955 @@ ;; name in dgo: elec-gate ;; dgos: SEH, DESG, MIA, CIA, STAA +(define-extern set-sewg-electricity-scale! (function float int none)) +(define-extern set-sewh-electricity-scale! (function float int none)) + ;; DECOMP BEGINS +(deftype elec-gate-params (structure) + ((bolt-spec lightning-spec) + (ring-spec lightning-spec) + (ring-radius-min float) + (ring-radius-max float) + (speed-mult float) + (min-dist float) + (max-dist float) + (plane-expand-xz float) + (plane-expand-y float) + (plane-shift-z float) + ) + ) + + +(deftype elec-gate-bolt (structure) + ((ring lightning-control 2) + (bolt lightning-control) + (ring-radius float) + (pos float) + ) + ) + + +(deftype elec-wall (structure) + ((pos vector :inline) + (dir vector :inline) + ) + ) + + +(deftype elec-gate (process-drawable) + ((params elec-gate-params) + (path-l path-control :overlay-at path) + (path-r path-control) + (l-bolt elec-gate-bolt 5 :inline) + (part-on sparticle-launch-control :overlay-at part) + (part-off sparticle-launch-control) + (part-spawner-left part-spawner) + (part-spawner-right part-spawner) + (on-start pair) + (on-stop pair) + (on-shutdown pair) + (on-trigger pair) + (dividing-wall elec-wall :inline) + (plane elec-wall 2 :inline) + (wall-y float) + (wall-xz float) + (lightning-quality float) + (quality-enabled? symbol) + ) + (:state-methods + idle + active + shutdown-camera + shutdown + ) + (:methods + (get-params (_type_) elec-gate-params) + (elec-gate-method-25 (_type_) none) + (elec-gate-method-26 (_type_) none) + (go-initial-state (_type_) object) + (spawn-particles (_type_ sparticle-launch-control) none) + (set-elec-scale! (_type_ float) none) + (elec-gate-method-30 (_type_ float) none) + ) + ) + + +(define *default-elec-gate-params* (new 'static 'elec-gate-params + :bolt-spec (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8601.6 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + :ring-spec (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :rand-func #x3 + :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 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 12 + :box-size 3072.0 + :merge-factor 0.5 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + :ring-radius-min 1638.4 + :ring-radius-max 2867.2 + :speed-mult 1.0 + :min-dist 163840.0 + :max-dist 491520.0 + :plane-expand-xz 8192.0 + :plane-expand-y 81920.0 + ) + ) + +(defbehavior elec-gate-post elec-gate () + (local-vars (sv-96 lightning-control) (sv-112 vector)) + (let ((gp-0 (-> self params))) + (dotimes (s5-0 5) + (let* ((s2-0 (-> self l-bolt s5-0)) + (s4-0 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) (-> s2-0 pos) 'interp)) + (s3-0 (get-point-at-percent-along-path! (-> self path-r) (new 'stack-no-clear 'vector) (-> s2-0 pos) 'interp)) + ) + (let ((a0-2 (-> s2-0 bolt)) + (v1-4 s4-0) + ) + (set! (-> a0-2 state meet data 0 quad) (-> v1-4 quad)) + ) + (let ((a0-5 (-> s2-0 bolt)) + (v1-6 s3-0) + ) + (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-6 quad)) + ) + (when (-> gp-0 ring-spec) + (let ((s1-0 (-> gp-0 ring-spec num-points)) + (s0-0 (-> s2-0 ring 0)) + ) + (set! sv-96 (-> s2-0 ring 1)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! (-> sv-112 x) 0.0) + (set! (-> sv-112 y) 0.0) + (set! (-> sv-112 z) (-> s2-0 ring-radius)) + (set! (-> sv-112 w) 0.0) + (let ((f30-0 (* 65536.0 (/ 1.0 (the float (+ s1-0 -1)))))) + (dotimes (s2-1 s1-0) + (set-point! s0-0 s2-1 (vector+! (new 'stack-no-clear 'vector) s4-0 sv-112)) + (set-point! sv-96 s2-1 (vector+! (new 'stack-no-clear 'vector) s3-0 sv-112)) + (vector-rotate-y! sv-112 sv-112 f30-0) + ) + ) + ) + ) + ) + ) + ) + (debug-draw (-> self path)) + (debug-draw (-> self path-r)) + (none) + ) + +(defstate idle (elec-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (let ((gp-0 (-> self on-trigger))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + (go-virtual active) + ) + ) + ) + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (dotimes (v1-0 5) + (let ((a0-3 (-> self l-bolt v1-0 bolt)) + (a1-1 0) + ) + (let ((a2-2 (!= a1-1 (-> a0-3 state mode)))) + (case a1-1 + ((3) + (if a2-2 + (set! (-> a0-3 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-3 state start-color) (-> a0-3 spec start-color)) + (set! (-> a0-3 state end-color) (-> a0-3 spec end-color)) + ) + ) + ) + (set! (-> a0-3 state mode) (the-as uint a1-1)) + ) + (when (-> self params ring-spec) + (let ((a0-9 (-> self l-bolt v1-0 ring 0)) + (a1-2 0) + ) + (let ((a2-12 (!= a1-2 (-> a0-9 state mode)))) + (case a1-2 + ((3) + (if a2-12 + (set! (-> a0-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-9 state start-color) (-> a0-9 spec start-color)) + (set! (-> a0-9 state end-color) (-> a0-9 spec end-color)) + ) + ) + ) + (set! (-> a0-9 state mode) (the-as uint a1-2)) + ) + (let ((a0-12 (-> self l-bolt v1-0 ring 1)) + (a1-3 0) + ) + (let ((a2-22 (!= a1-3 (-> a0-12 state mode)))) + (case a1-3 + ((3) + (if a2-22 + (set! (-> a0-12 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-12 state start-color) (-> a0-12 spec start-color)) + (set! (-> a0-12 state end-color) (-> a0-12 spec end-color)) + ) + ) + ) + (set! (-> a0-12 state mode) (the-as uint a1-3)) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (set-elec-scale! self 0.0) + (if (nonzero? (-> self part-off)) + (spawn-particles self (-> self part-off)) + ) + ) + ) + +(defstate active (elec-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('shutdown) + (go-virtual shutdown-camera) + ) + ) + ) + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (if (-> self on-start) + (script-eval (-> self on-start) :vector (-> self root trans)) + ) + (dotimes (v1-7 5) + (set! (-> self l-bolt v1-7 pos) (+ -1.0 (* 0.2 (the float v1-7)))) + (let ((a0-9 (-> self l-bolt v1-7 bolt)) + (a1-3 0) + ) + (let ((a2-3 (!= a1-3 (-> a0-9 state mode)))) + (case a1-3 + ((3) + (if a2-3 + (set! (-> a0-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-9 state start-color) (-> a0-9 spec start-color)) + (set! (-> a0-9 state end-color) (-> a0-9 spec end-color)) + ) + ) + ) + (set! (-> a0-9 state mode) (the-as uint a1-3)) + ) + (when (-> self params ring-spec) + (let ((a0-15 (-> self l-bolt v1-7 ring 0)) + (a1-4 0) + ) + (let ((a2-13 (!= a1-4 (-> a0-15 state mode)))) + (case a1-4 + ((3) + (if a2-13 + (set! (-> a0-15 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-15 state start-color) (-> a0-15 spec start-color)) + (set! (-> a0-15 state end-color) (-> a0-15 spec end-color)) + ) + ) + ) + (set! (-> a0-15 state mode) (the-as uint a1-4)) + ) + (let ((a0-18 (-> self l-bolt v1-7 ring 1)) + (a1-5 0) + ) + (let ((a2-23 (!= a1-5 (-> a0-18 state mode)))) + (case a1-5 + ((3) + (if a2-23 + (set! (-> a0-18 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-18 state start-color) (-> a0-18 spec start-color)) + (set! (-> a0-18 state end-color) (-> a0-18 spec end-color)) + ) + ) + ) + (set! (-> a0-18 state mode) (the-as uint a1-5)) + ) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 2))) + (dotimes (v1-10 2) + (set! (-> gp-0 v1-10 quad) (the-as uint128 0)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + (get-point-in-path! (-> self path) (-> gp-0 0) 0.0 'interp) + (get-point-in-path! (-> self path-r) (-> gp-0 1) 0.0 'interp) + (vector-! s5-0 (-> gp-0 1) (-> gp-0 0)) + (vector-normalize! s5-0 (+ (-> self params plane-expand-xz) (res-lump-float (-> self entity) 'width))) + (vector+! (-> gp-0 1) (-> gp-0 1) s5-0) + (vector-negate! s5-0 s5-0) + (vector+! (-> gp-0 0) (-> gp-0 0) s5-0) + (vector-! s5-0 (-> gp-0 1) (-> gp-0 0)) + (vector-normalize! s5-0 -1.0) + (vector-cross! s5-0 s5-0 *y-vector*) + (vector+float*! (-> gp-0 0) (-> gp-0 0) s5-0 (-> self params plane-shift-z)) + (vector+float*! (-> gp-0 1) (-> gp-0 1) s5-0 (-> self params plane-shift-z)) + (vector-normalize-copy! s5-0 *up-vector* -8192.0) + (vector+! (-> gp-0 0) (-> gp-0 0) s5-0) + (vector+! (-> gp-0 1) (-> gp-0 1) s5-0) + ) + (let ((f0-12 + (+ (- (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (get-num-segments (-> self path)) 'interp) + y + ) + (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp) y) + ) + (-> self params plane-expand-y) + ) + ) + ) + (blocking-plane-spawn (the-as curve-control #f) gp-0 f0-12) + ) + ) + ) + :trans (behavior () + (local-vars + (sv-176 lightning-spec) + (sv-192 int) + (sv-208 symbol) + (sv-224 symbol) + (sv-240 int) + (sv-256 symbol) + (sv-272 symbol) + ) + (let ((gp-0 *target*)) + (when gp-0 + (when (not (focus-test? gp-0 disable dead ignore grabbed pilot-riding pilot mech teleporting invulnerable)) + (let* ((v1-5 (get-trans gp-0 0)) + (a1-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (the-as vector (-> self dividing-wall)))) + (s5-0 (-> self plane (if (< 0.0 (vector-dot a1-2 (-> self dividing-wall dir))) + 0 + 1 + ) + ) + ) + (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> s5-0 pos))) + ) + (when (and (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 1.0) (-> s5-0 dir)) 0.0) + (let ((v1-10 s4-1)) + (< (sqrtf (+ (* (-> v1-10 x) (-> v1-10 x)) (* (-> v1-10 z) (-> v1-10 z)))) (-> self wall-xz)) + ) + (< (fabs (-> s4-1 y)) (-> self wall-y)) + ) + (send-event + gp-0 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (vector (-> s5-0 dir)) + (shove-back (meters 6)) + (shove-up (meters 3)) + (control (if (focus-test? gp-0 board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (let* ((s5-1 (-> self l-bolt)) + (s4-2 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) (-> s5-1 0 pos) 'interp)) + (s5-2 + (get-point-at-percent-along-path! (-> self path-r) (new 'stack-no-clear 'vector) (-> s5-1 0 pos) 'interp) + ) + ) + (let ((s3-0 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when s3-0 + (let ((t9-6 (method-of-type lightning-tracker activate))) + (t9-6 (the-as lightning-tracker s3-0) *entity-pool* "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((s2-0 run-function-in-process) + (s1-0 s3-0) + (s0-0 lightning-tracker-init) + ) + (set! sv-176 (-> self params bolt-spec)) + (set! sv-192 15) + (set! sv-208 (the-as symbol #f)) + (set! sv-224 (the-as symbol #f)) + (let ((t3-0 (get-trans gp-0 3))) + ((the-as (function object object object object object object object object none) s2-0) + s1-0 + s0-0 + sv-176 + sv-192 + sv-208 + sv-224 + s4-2 + t3-0 + ) + ) + ) + (-> s3-0 ppointer) + ) + ) + (let ((s4-3 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when s4-3 + (let ((t9-10 (method-of-type lightning-tracker activate))) + (t9-10 (the-as lightning-tracker s4-3) *entity-pool* "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((s3-1 run-function-in-process) + (s2-1 s4-3) + (s1-1 lightning-tracker-init) + (s0-1 (-> self params bolt-spec)) + ) + (set! sv-240 15) + (set! sv-256 (the-as symbol #f)) + (set! sv-272 (the-as symbol #f)) + (let ((t3-1 (get-trans gp-0 3))) + ((the-as (function object object object object object object object object none) s3-1) + s2-1 + s1-1 + s0-1 + sv-240 + sv-256 + sv-272 + s5-2 + t3-1 + ) + ) + ) + (-> s4-3 ppointer) + ) + ) + ) + ) + ) + ) + (set! (-> self lightning-quality) (lerp-scale + 0.0 + 1.0 + (vector-vector-distance (get-trans gp-0 0) (-> self root trans)) + (-> self params max-dist) + (-> self params min-dist) + ) + ) + ) + ) + (let ((gp-1 (+ (the int (* 5.0 (-> self lightning-quality))) 1))) + (dotimes (s5-4 5) + (let ((s3-3 (-> self l-bolt s5-4)) + (s2-3 (-> self params)) + (s4-5 (if (and (-> self quality-enabled?) (zero? (mod s5-4 gp-1))) + 0 + -1 + ) + ) + ) + (seek! (-> s3-3 pos) 1.5 (* (-> s2-3 speed-mult) (+ 0.2 (fabs (-> s3-3 pos))) (seconds-per-frame))) + (cond + ((>= (-> s3-3 pos) 1.5) + (set! (-> s3-3 ring-radius) (rand-vu-float-range (-> s2-3 ring-radius-min) (-> s2-3 ring-radius-max))) + (set! (-> s3-3 pos) 0.0) + ) + ((>= (-> s3-3 pos) 1.0) + (let ((v1-56 (-> self l-bolt s5-4 bolt)) + (a0-40 (logand 0 s4-5)) + ) + (let ((a1-21 (!= a0-40 (-> v1-56 state mode)))) + (case a0-40 + ((3) + (if a1-21 + (set! (-> v1-56 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-56 state start-color) (-> v1-56 spec start-color)) + (set! (-> v1-56 state end-color) (-> v1-56 spec end-color)) + ) + ) + ) + (set! (-> v1-56 state mode) (the-as uint a0-40)) + ) + (when (-> self params ring-spec) + (let ((v1-62 (-> self l-bolt s5-4 ring 0)) + (a0-41 (logand 0 s4-5)) + ) + (let ((a1-31 (!= a0-41 (-> v1-62 state mode)))) + (case a0-41 + ((3) + (if a1-31 + (set! (-> v1-62 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-62 state start-color) (-> v1-62 spec start-color)) + (set! (-> v1-62 state end-color) (-> v1-62 spec end-color)) + ) + ) + ) + (set! (-> v1-62 state mode) (the-as uint a0-41)) + ) + (let ((a0-42 (-> self l-bolt s5-4 ring 1)) + (v1-65 (logand 0 s4-5)) + ) + (let ((a1-41 (!= v1-65 (-> a0-42 state mode)))) + (case v1-65 + ((3) + (if a1-41 + (set! (-> a0-42 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-42 state start-color) (-> a0-42 spec start-color)) + (set! (-> a0-42 state end-color) (-> a0-42 spec end-color)) + ) + ) + ) + (set! (-> a0-42 state mode) (the-as uint v1-65)) + ) + ) + ) + ((< 0.0 (-> s3-3 pos)) + (when (zero? (-> self l-bolt s5-4 bolt state mode)) + (let ((v1-74 (-> self l-bolt s5-4 bolt)) + (a0-43 (logand s4-5 1)) + ) + (let ((a1-51 (!= a0-43 (-> v1-74 state mode)))) + (case a0-43 + ((3) + (if a1-51 + (set! (-> v1-74 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-74 state start-color) (-> v1-74 spec start-color)) + (set! (-> v1-74 state end-color) (-> v1-74 spec end-color)) + ) + ) + ) + (set! (-> v1-74 state mode) (the-as uint a0-43)) + ) + (when (-> self params ring-spec) + (let ((v1-80 (-> self l-bolt s5-4 ring 0)) + (a0-44 (logand s4-5 1)) + ) + (let ((a1-61 (!= a0-44 (-> v1-80 state mode)))) + (case a0-44 + ((3) + (if a1-61 + (set! (-> v1-80 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-80 state start-color) (-> v1-80 spec start-color)) + (set! (-> v1-80 state end-color) (-> v1-80 spec end-color)) + ) + ) + ) + (set! (-> v1-80 state mode) (the-as uint a0-44)) + ) + (let ((a0-45 (-> self l-bolt s5-4 ring 1)) + (v1-83 (logand s4-5 1)) + ) + (let ((a1-71 (!= v1-83 (-> a0-45 state mode)))) + (case v1-83 + ((3) + (if a1-71 + (set! (-> a0-45 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-45 state start-color) (-> a0-45 spec start-color)) + (set! (-> a0-45 state end-color) (-> a0-45 spec end-color)) + ) + ) + ) + (set! (-> a0-45 state mode) (the-as uint v1-83)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (set-elec-scale! self 1.0) + (if (nonzero? (-> self part)) + (spawn-particles self (-> self part)) + ) + (update! (-> self sound)) + (elec-gate-post) + ) + ) + +(defstate shutdown-camera (elec-gate) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (format 0 "~s~%" (-> self name)) + (if (res-lump-struct (-> self entity) 'camera-name structure) + (process-spawn + external-camera-controller + (-> self entity) + 600 + #f + :name "external-camera-controller" + :to *entity-pool* + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (go-virtual shutdown) + ) + :post (behavior () + (elec-gate-post) + ) + ) + +(defstate shutdown (elec-gate) + :virtual #t + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (stop! (-> self sound)) + (sound-play "elec-gate-off") + (blocking-plane-destroy) + (if (-> self on-stop) + (script-eval (-> self on-stop) :vector (-> self root trans)) + ) + ) + :trans (behavior () + (let ((gp-0 #t)) + (dotimes (s5-0 5) + (let ((s4-0 (-> self l-bolt s5-0))) + (seek! (-> s4-0 pos) 0.0 (seconds-per-frame)) + (set! gp-0 (cond + ((or (< 1.0 (-> s4-0 pos)) (>= 0.0 (-> s4-0 pos))) + (when (= (-> self l-bolt s5-0 bolt state mode) 2) + (let ((v1-9 (-> self l-bolt s5-0 bolt)) + (a0-6 3) + ) + (let ((a1-2 (!= a0-6 (-> v1-9 state mode)))) + (case a0-6 + ((3) + (if a1-2 + (set! (-> v1-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-9 state start-color) (-> v1-9 spec start-color)) + (set! (-> v1-9 state end-color) (-> v1-9 spec end-color)) + ) + ) + ) + (set! (-> v1-9 state mode) (the-as uint a0-6)) + ) + (when (-> self params ring-spec) + (let ((v1-14 (-> self l-bolt s5-0 ring 0)) + (a0-8 3) + ) + (let ((a1-12 (!= a0-8 (-> v1-14 state mode)))) + (case a0-8 + ((3) + (if a1-12 + (set! (-> v1-14 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-14 state start-color) (-> v1-14 spec start-color)) + (set! (-> v1-14 state end-color) (-> v1-14 spec end-color)) + ) + ) + ) + (set! (-> v1-14 state mode) (the-as uint a0-8)) + ) + (let ((v1-17 (-> self l-bolt s5-0 ring 1)) + (a0-9 3) + ) + (let ((a1-22 (!= a0-9 (-> v1-17 state mode)))) + (case a0-9 + ((3) + (if a1-22 + (set! (-> v1-17 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) + (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) + ) + ) + ) + (set! (-> v1-17 state mode) (the-as uint a0-9)) + ) + ) + ) + gp-0 + ) + (else + #f + ) + ) + ) + ) + ) + (when gp-0 + (let ((gp-1 (-> self on-shutdown))) + (if gp-1 + (script-eval gp-1 :vector (-> self root trans)) + ) + ) + (go-virtual idle) + ) + ) + ) + :code sleep-code + :post (behavior () + (set-elec-scale! self 0.0) + (if (nonzero? (-> self part-off)) + (spawn-particles self (-> self part-off)) + ) + (elec-gate-post) + ) + ) + +(defmethod set-elec-scale! ((this elec-gate) (arg0 float)) + (if (< (vector-vector-distance (-> this root trans) (target-pos 0)) 327680.0) + (elec-gate-method-30 this arg0) + ) + 0 + (none) + ) + +(defmethod elec-gate-method-30 ((this elec-gate) (arg0 float)) + 0 + (none) + ) + +(defmethod spawn-particles ((this elec-gate) (arg0 sparticle-launch-control)) + (if (-> this part-spawner-left) + (spawn arg0 (the-as vector (&-> (-> this part-spawner-left child) 8))) + ) + (if (-> this part-spawner-right) + (spawn arg0 (the-as vector (&-> (-> this part-spawner-right child) 8))) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch process-drawable vs elec-gate. +(defmethod relocate ((this elec-gate) (offset int)) + (dotimes (v1-0 5) + (let ((a2-2 (-> this l-bolt v1-0))) + (if (nonzero? (-> a2-2 bolt)) + (&+! (-> a2-2 bolt) offset) + ) + (if (nonzero? (-> a2-2 ring 0)) + (&+! (-> a2-2 ring 0) offset) + ) + (if (nonzero? (-> a2-2 ring 1)) + (&+! (-> a2-2 ring 1) offset) + ) + ) + ) + (if (nonzero? (-> this path-r)) + (&+! (-> this path-r) offset) + ) + (when (nonzero? (-> this part-off)) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) offset) + ) + ) + (the-as elec-gate ((method-of-type process-drawable relocate) this offset)) + ) + +(defmethod deactivate ((this elec-gate)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this root)) + (set-elec-scale! this 0.0) + ) + (if (nonzero? (-> this part-off)) + (kill-particles (-> this part-off)) + ) + (call-parent-method this) + (none) + ) + +(defmethod get-params ((this elec-gate)) + *default-elec-gate-params* + ) + +(defmethod elec-gate-method-25 ((this elec-gate)) + 0 + (none) + ) + +(defmethod elec-gate-method-26 ((this elec-gate)) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-initial-state ((this elec-gate)) + (if (or (logtest? (actor-option user17) (-> this fact options)) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + (go (method-of-object this idle)) + (go (method-of-object this active)) + ) + 0 + ) + +(defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this entity) arg0) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> this params) (get-params this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'pathl 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-r) (new 'process 'path-control this 'pathr 0.0 (the-as entity #f) #f)) + (logior! (-> this path-r flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this part-spawner-left) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this part-spawner-right) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 1))) + (let ((s5-1 (-> this params))) + (dotimes (s4-0 5) + (let ((s3-0 (-> this l-bolt s4-0))) + (set! (-> s3-0 bolt) (new 'process 'lightning-control (-> s5-1 bolt-spec) this 0.0)) + (when (-> s5-1 ring-spec) + (set! (-> s3-0 ring 0) (new 'process 'lightning-control (-> s5-1 ring-spec) this 0.0)) + (set! (-> s3-0 ring 1) (new 'process 'lightning-control (-> s5-1 ring-spec) this 0.0)) + ) + (set! (-> s3-0 ring-radius) (rand-vu-float-range (-> s5-1 ring-radius-min) (-> s5-1 ring-radius-max))) + (set! (-> s3-0 pos) (* 0.2 (the float s4-0))) + ) + ) + ) + (let* ((s4-1 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-29 (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp)) + (a1-15 (vector-! (new 'stack-no-clear 'vector) v1-29 s4-1)) + (s5-3 (vector+float*! (new 'stack-no-clear 'vector) s4-1 a1-15 0.5)) + (v1-31 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-15 1.0)) + ) + (vector-cross! v1-31 v1-31 *up-vector*) + (set! (-> this dividing-wall pos quad) (-> s5-3 quad)) + (set! (-> this dividing-wall dir quad) (-> v1-31 quad)) + (vector+float*! (the-as vector (-> this plane)) s5-3 v1-31 12288.0) + (set! (-> this plane 0 dir quad) (-> v1-31 quad)) + (vector-float*! v1-31 v1-31 -1.0) + (vector+float*! (the-as vector (-> this plane 1)) s5-3 v1-31 12288.0) + (set! (-> this plane 1 dir quad) (-> v1-31 quad)) + ) + (set! (-> this wall-xz) + (vector-vector-distance + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) + (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) + ) + ) + (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (+! (-> this wall-xz) 4096.0) + (set! (-> this wall-y) + (fabs + (- (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (get-num-segments (-> this path)) 'interp) + y + ) + (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) y) + ) + ) + ) + (+! (-> this wall-y) 4096.0) + (set! (-> this quality-enabled?) #t) + (set! (-> this lightning-quality) 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "electric-gate" :group 1 :fo-max 70) (-> this root trans) 0.0) + ) + (set! (-> this on-start) (res-lump-struct (-> this entity) 'on-start pair)) + (set! (-> this on-stop) (res-lump-struct (-> this entity) 'on-stop pair)) + (set! (-> this on-shutdown) (res-lump-struct (-> this entity) 'on-shutdown pair)) + (set! (-> this on-trigger) (res-lump-struct (-> this entity) 'on-trigger pair)) + (elec-gate-method-25 this) + (elec-gate-method-26 this) + (go-initial-state this) + ) + +(deftype sewer-elec-gate (elec-gate) + ((gate-index int32) + ) + ) + + +(defmethod set-elec-scale! ((this sewer-elec-gate) (arg0 float)) + (set-sewh-electricity-scale! arg0 (-> this gate-index)) + (if (zero? (-> this gate-index)) + (set-sewg-electricity-scale! arg0 (-> this gate-index)) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this sewer-elec-gate) (arg0 entity-actor)) + (set! (-> this gate-index) (res-lump-value (-> this entity) 'index int :time -1000000000.0)) + (call-parent-method this arg0) + ) diff --git a/goal_src/jak3/levels/common/enemy/grunt.gc b/goal_src/jak3/levels/common/enemy/grunt.gc index 5b14a2225e..3880431288 100644 --- a/goal_src/jak3/levels/common/enemy/grunt.gc +++ b/goal_src/jak3/levels/common/enemy/grunt.gc @@ -5,5 +5,1954 @@ ;; name in dgo: grunt ;; dgos: MIC +;; +++grunt-flags +(defenum grunt-flags + :type uint8 + :bitfield #t + (gf0 0) + (gf1 1) + (gf2 2) + ) +;; ---grunt-flags + + ;; DECOMP BEGINS +(defskelgroup skel-grunt grunt grunt-lod0-jg -1 + ((grunt-lod0-mg (meters 20)) (grunt-lod1-mg (meters 40)) (grunt-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow grunt-shadow-mg + :origin-joint-index 18 + ) + +(deftype grunt-anim-info (structure) + ((anim-index int32) + (travel-speed meters) + ) + :pack-me + ) + + +(deftype grunt-global-info (basic) + ((patrol-anim grunt-anim-info 4 :inline) + (charge-anim grunt-anim-info 3 :inline) + (attack-anim grunt-anim-info 2 :inline) + ) + ) + + +(deftype grunt (nav-enemy) + ((patrol-anim grunt-anim-info) + (charge-anim grunt-anim-info) + (attack-anim grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8 :offset 640) + (jumping-ambush-path-pt int8) + (grunt-flags grunt-flags) + (state-timeout2 time-frame) + (next-warn-time time-frame) + (dest vector :inline) + (minimap connection-minimap :offset 704) + ) + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) + (:methods + (grunt-method-196 (_type_ float) process-focusable) + (get-enemy-info (_type_) nav-enemy-info) + ) + ) + + +(define *grunt-global-info* (new 'static 'grunt-global-info + :patrol-anim (new 'static 'inline-array grunt-anim-info 4 + (new 'static 'grunt-anim-info :anim-index 11 :travel-speed (meters 4)) + (new 'static 'grunt-anim-info :anim-index 12 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + ) + :charge-anim (new 'static 'inline-array grunt-anim-info 3 + (new 'static 'grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 16 :travel-speed (meters 7)) + ) + :attack-anim (new 'static 'inline-array grunt-anim-info 2 + (new 'static 'grunt-anim-info :anim-index 17 :travel-speed (meters 12)) + (new 'static 'grunt-anim-info :anim-index 18 :travel-speed (meters 12)) + ) + ) + ) + +(define *grunt-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 'inline-array idle-control-frame 36 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x14 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 13 + :hostile-anim -1 + :hit-anim -1 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim -1 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim 22 + :jump-in-air-anim 23 + :jump-land-anim 24 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 18 + :sound-hit (static-sound-name "grunt-hit") + :sound-die (static-sound-name "grunt-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.5) + :ragdoll-rotate-velocity-mult 0.5 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 73728.0 + :knocked-red-vy-hi 114688.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) + :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) + :bg-collide-with (collide-spec backgnd crate obstacle hit-by-others-list player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 1170.3455) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 2268.7744 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4000.9365) + :geo-tform (new 'static 'vector :x 1.0 :w 12817.95) + :axial-slop 2169.078 + :max-angle 2296.8184 + :coll-rad 2867.2 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10540.374) + :geo-tform (new 'static 'vector :x -1.0 :w 12551.108) + :axial-slop 2169.078 + :max-angle 2226.3489 + :coll-rad 2209.3823 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 13046.233) + :geo-tform (new 'static 'vector :x 1.0 :w 18078.088) + :axial-slop 2169.078 + :max-angle 3210.7178 + :coll-rad 1644.544 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 16901.771) + :geo-tform (new 'static 'vector :x 1.0 :w 359.3193) + :axial-slop 2169.078 + :max-angle 2605.129 + :coll-rad 1722.368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4178 :z -0.9083 :w 11487.004) + :geo-tform (new 'static 'vector :x -0.5907 :y -0.4565 :z 0.665 :w 25388.248) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1641.6768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1565 :z -0.9875 :w 12747.589) + :geo-tform (new 'static 'vector :x -0.0123 :y 0.7268 :z 0.6864 :w 28823.824) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1295.1552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.3463 :w 15464.585) + :geo-tform (new 'static 'vector :x 0.0404 :y 0.9991 :z 0.0016 :w 26660.428) + :axial-slop 2169.078 + :max-angle 2671.921 + :coll-rad 1899.3152 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.346 :w 14.381512) + :geo-tform (new 'static 'vector :x 0.5827 :y 0.8005 :z 0.1389 :w 27752.074) + :axial-slop 2169.078 + :max-angle 2077.3455 + :coll-rad 1787.904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.418 :z 0.9082 :w 11484.565) + :geo-tform (new 'static 'vector :x 0.5908 :y -0.4564 :z 0.665 :w 40148.812) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1563.8528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1563 :z 0.9875 :w 12751.085) + :geo-tform (new 'static 'vector :x 0.0122 :y 0.7266 :z 0.6866 :w 36713.688) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z -0.3461 :w 15469.664) + :geo-tform (new 'static 'vector :x -0.0404 :y 0.9991 :z 0.0015 :w 38877.887) + :axial-slop 2169.078 + :max-angle 2330.5876 + :coll-rad 1610.1376 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9377 :z -0.3468 :w 16.074524) + :geo-tform (new 'static 'vector :x -0.2371 :y 0.2169 :z -0.9468 :w 20556.623) + :axial-slop 2169.078 + :max-angle 1879.882 + :coll-rad 1629.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 42847.234) + :geo-tform (new 'static 'vector :x -1.0 :w 16468.232) + :axial-slop 2169.078 + :max-angle 2508.973 + :coll-rad 1812.0704 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 3567.2522) + :geo-tform (new 'static 'vector :x 1.0 :w 42973.14) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1858.3552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2349 :z -0.9718 :w 18020.252) + :geo-tform (new 'static 'vector :x 0.3808 :y 0.3151 :z 0.8691 :w 29486.395) + :axial-slop 2169.078 + :max-angle 3698.87 + :coll-rad 877.3632 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z 0.0086 :w 4412.9214) + :geo-tform (new 'static 'vector :x 0.3995 :y -0.4805 :z 0.7804 :w 25729.781) + :axial-slop 2169.078 + :max-angle 3691.5154 + :coll-rad 1524.9408 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7835 :z 0.621 :w 14960.958) + :geo-tform (new 'static 'vector :x 0.2887 :y 0.6587 :z 0.6945 :w 40555.97) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7644 :z -0.6445 :w 17272.176) + :geo-tform (new 'static 'vector :x 0.5513 :y 0.3614 :z 0.7516 :w 33063.24) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9734 :z 0.2283 :w 7149.304) + :geo-tform (new 'static 'vector :x -0.7224 :y -0.6901 :z -0.0373 :w 15253.522) + :axial-slop 2169.078 + :max-angle 1294.1176 + :coll-rad 659.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 22 + :pre-tform (new 'static 'vector :x 0.4934 :z 0.8696 :w 6514.1875) + :geo-tform (new 'static 'vector :x -0.0332 :y 0.8825 :z 0.4687 :w 37613.457) + :axial-slop 2169.078 + :max-angle 1411.5544 + :coll-rad 605.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 18 + :pre-tform (new 'static 'vector :x -1.0 :w 9863.842) + :geo-tform (new 'static 'vector :x -1.0 :w 12698.965) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1488.0768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -1.0 :w 1462.5452) + :geo-tform (new 'static 'vector :x 0.9995 :y -0.0161 :z -0.0185 :w 7921.737) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1285.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9958 :z -0.09 :w 1956.7229) + :geo-tform (new 'static 'vector :x 0.9998 :y 0.0041 :z 0.0071 :w 33050.805) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1801.8304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6114.891) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0127 :z 0.0043 :w 8018.73) + :axial-slop 2169.078 + :max-angle 2497.213 + :coll-rad 794.2144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6305.8555) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0172 :z 0.0018 :w 6908.7324) + :axial-slop 2169.078 + :max-angle 1846.1127 + :coll-rad 556.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6830.7266) + :geo-tform (new 'static 'vector :x 0.9993 :y -0.0365 :z -0.006 :w 3790.2383) + :axial-slop 2169.078 + :max-angle 1491.563 + :coll-rad 542.3104 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint 18 + :pre-tform (new 'static 'vector :x -0.2352 :z 0.9718 :w 18022.729) + :geo-tform (new 'static 'vector :x -0.3537 :y 0.3542 :z 0.8654 :w 34566.508) + :axial-slop 2169.078 + :max-angle 3739.2292 + :coll-rad 1540.096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8967 :z -0.4423 :w 5274.7744) + :geo-tform (new 'static 'vector :x -0.0105 :y 0.862 :z -0.5065 :w 24694.367) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8194 :z -0.573 :w 13110.112) + :geo-tform (new 'static 'vector :x -0.2576 :y 0.7211 :z 0.6428 :w 24504.475) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1751.4496 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8027 :z 0.596 :w 15135.011) + :geo-tform (new 'static 'vector :x -0.5895 :y 0.2007 :z 0.7821 :w 36329.734) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8262 :z 0.5632 :w 7707.525) + :geo-tform (new 'static 'vector :x -0.6943 :y 0.7184 :z -0.0381 :w 14762.858) + :axial-slop 2169.078 + :max-angle 2015.6871 + :coll-rad 573.0304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 34 + :pre-tform (new 'static 'vector :x 0.9975 :z -0.0684 :w 3277.692) + :geo-tform (new 'static 'vector :x -0.2795 :y 0.7979 :z 0.5336 :w 35258.77) + :axial-slop 2169.078 + :max-angle 1851.9927 + :coll-rad 468.992 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5769 :z -0.8166 :w 8297.695) + :geo-tform (new 'static 'vector :x -0.6954 :y -0.0651 :z 0.7153 :w 9511.8955) + :axial-slop 2169.078 + :max-angle 2863.5044 + :coll-rad 1868.5952 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5774 :z 0.8162 :w 8293.489) + :geo-tform (new 'static 'vector :x 0.948 :y -0.2986 :z 0.1083 :w 34953.68) + :axial-slop 2169.078 + :max-angle 2569.885 + :coll-rad 1893.9904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 12 + :pre-tform (new 'static 'vector :x 0.3449 :z -0.9384 :w 16372.404) + :geo-tform (new 'static 'vector :x 0.088 :y -0.8342 :z 0.5442 :w 20057.604) + :axial-slop 2169.078 + :max-angle 3185.0312 + :coll-rad 1327.9232 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6081 :z 0.7936 :w 10429.526) + :geo-tform (new 'static 'vector :x 0.213 :y -0.975 :z -0.061 :w 19499.654) + :axial-slop 2169.078 + :max-angle 2031.8344 + :coll-rad 423.1168 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint 12 + :pre-tform (new 'static 'vector :x 0.9512 :z -0.3084 :w 2006.2573) + :geo-tform (new 'static 'vector :x -0.0464 :y 0.9956 :z 0.0799 :w 26746.152) + :axial-slop 2169.078 + :max-angle 2505.2957 + :coll-rad 533.7088 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7105 :z 0.7034 :w 3017.6597) + :geo-tform (new 'static 'vector :x 0.0381 :y 0.9847 :z -0.1692 :w 26846.422) + :axial-slop 2169.078 + :max-angle 2064.8572 + :coll-rad 408.3712 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.9371 :z 0.3486 :w 15668.893) + :geo-tform (new 'static 'vector :x -0.2897 :y 0.1004 :z 0.9516 :w 31568.328) + :axial-slop 2169.078 + :max-angle 2784.2424 + :coll-rad 1593.7535 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 44 + :parent-joint 16 + :pre-tform (new 'static 'vector :x 0.3452 :z 0.9383 :w 16373.424) + :geo-tform (new 'static 'vector :x 0.1347 :y 0.823 :z -0.5515 :w 19233.342) + :axial-slop 2169.078 + :max-angle 2773.2288 + :coll-rad 1373.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 45 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4593 :z -0.888 :w 10428.289) + :geo-tform (new 'static 'vector :x 0.1971 :y 0.977 :z 0.079 :w 17810.5) + :axial-slop 2169.078 + :max-angle 1984.8488 + :coll-rad 616.448 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 46 + :parent-joint 16 + :pre-tform (new 'static 'vector :x 0.9998 :z -0.0063 :w 3668.4868) + :geo-tform (new 'static 'vector :x 0.0529 :y 0.9969 :z 0.056 :w 38759.062) + :axial-slop 2169.078 + :max-angle 1981.1897 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 47 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7207 :z -0.6929 :w 3011.8708) + :geo-tform (new 'static 'vector :x -0.0298 :y 0.9808 :z -0.1918 :w 38536.098) + :axial-slop 2169.078 + :max-angle 2276.2654 + :coll-rad 534.528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 48 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.9375 :z -0.3477 :w 15673.973) + :geo-tform (new 'static 'vector :x 0.2894 :y 0.1005 :z 0.9517 :w 33957.168) + :axial-slop 2169.078 + :max-angle 2685.1372 + :coll-rad 1853.0304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 49 + :parent-joint 22 + :pre-tform (new 'static 'vector :x -0.9829 :z 0.1831 :w 2492.6619) + :geo-tform (new 'static 'vector :x 0.5546 :y 0.2592 :z 0.7904 :w 34067.453) + :axial-slop 2169.078 + :max-angle 1536.3458 + :coll-rad 525.9264 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 50 + :parent-joint 34 + :pre-tform (new 'static 'vector :x -0.275 :z 0.9613 :w 5964.5225) + :geo-tform (new 'static 'vector :x -0.5191 :y 0.2888 :z 0.8042 :w 30864.797) + :axial-slop 2169.078 + :max-angle 1445.3237 + :coll-rad 382.5664 + ) + ) + ) + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 6 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 614.4 :z -3276.8 :r 327680.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #t + :use-pacing #t + :walk-anim 11 + :turn-anim -1 + :run-anim 14 + :taunt-anim 19 + :run-travel-speed (meters 7) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod event-handler ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((= (-> this hit-points) 0.0) + (let ((s5-1 (-> this incoming knocked-type))) + (cond + ((and (= s5-1 (knocked-type yellow-shot)) + (not (and (-> this next-state) (let ((v1-31 (-> this next-state name))) + (or (= v1-31 'knocked) (= v1-31 'jump) (= v1-31 'jump-land)) + ) + ) + ) + (zero? (rnd-int this 3)) + (let ((f0-2 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (f1-2 32768.0) + ) + (>= f0-2 (* f1-2 f1-2)) + ) + ) + (go-die this) + ) + ((or (= s5-1 (knocked-type yellow-shot)) (= s5-1 (knocked-type blue-shot))) + (set! (-> this incoming knocked-type) (knocked-type none)) + (go (method-of-object this knocked)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + ) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod go-ambush-delay ((this grunt)) + (cond + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) + ) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) + ) + (else + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) + ) + ) + ) + +(defstate falling-ambush (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let* ((gp-1 *target*) + (a0-4 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when a0-4 + (let* ((gp-2 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0)) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-2 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-2 quat) (-> gp-2 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let* ((v1-17 *game-info*) + (a0-15 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-15) + (set! (-> self attack-id) a0-15) + ) + (let ((v1-19 (-> self root root-prim))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((v1-6 (-> self root root-prim))) + (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) + ) + (sound-play "grunt-notice") + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max 1.8) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (until (logtest? (-> self root status) (collide-status on-ground touch-surface touch-wall)) + (suspend) + ) + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +(defmethod go-directed2 ((this grunt)) + (case (-> this jump-why) + ((2) + (go (method-of-object this jumping-ambush-cont)) + ) + (else + ((method-of-type nav-enemy go-directed2) this) + ) + ) + ) + +(defstate jumping-ambush (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy ambush) enter)) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping jumping-ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self jumping-ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate jumping-ambush-cont (grunt) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self jumping-ambush-path-pt) 1)) + ) + (if (< v1-1 (-> a0-0 curve num-cverts)) + (set! (-> self jumping-ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self jumping-ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate active (grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-8 (ja-group))) + (and v1-8 + (or (= v1-8 grunt-patrol0-ja) (= v1-8 grunt-patrol1-ja) (= v1-8 grunt-charge0-ja) (= v1-8 grunt-charge1-ja)) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-37 (ja-group))) + (if (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (nonzero? (-> self patrol-anim anim-index)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self patrol-anim) (the-as grunt-anim-info (-> *grunt-global-info* patrol-anim))) + (let ((v1-67 (-> self nav))) + (set! (-> v1-67 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (zero? (rnd-int self 3)) + (let ((v1-107 self)) + (set! (-> v1-107 enemy-flags) (the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-107 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-171 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-171 enemy-flags))) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-171 enemy-flags)))) + ) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-171 enemy-flags)))) + (set! (-> v1-171 nav callback-info) (-> v1-171 enemy-info callback-info)) + ) + 0 + ) + ) + ) + #f + ) + ) + +(defmethod grunt-method-196 ((this grunt) (arg0 float)) + (local-vars (v1-5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (get-focus! this))) + (when gp-0 + (let ((v1-3 (get-trans gp-0 0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 v1-3 (-> this root trans)) + (.lvf vf1 (&-> s4-0 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-5 vf1) + (let* ((f30-0 v1-5) + (f0-0 arg0) + (f28-0 (* f0-0 f0-0)) + (f0-2 12288.0) + ) + (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) + (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f1-0 1228.8) + ) + (cond + ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) + (go (method-of-object this attack)) + ) + ((let ((f0-10 12288.0)) + (< f30-0 (* f0-10 f0-10)) + ) + (go (method-of-object this spin-attack)) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +(defstate hostile (grunt) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (grunt-method-196 self 13312.0)) + (gp-0 (current-time)) + ) + (when (and (>= gp-0 (-> self next-warn-time)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + (when (and a0-1 (let ((f0-0 65536.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans a0-1 0) (-> self root trans))) + ) + ) + (sound-play "grunt-warn") + (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (let ((v1-19 (-> self use-charge-anim-index))) + (cond + ((>= v1-19 0) + (set! (-> self charge-anim) (-> *grunt-global-info* charge-anim v1-19)) + (set! (-> self use-charge-anim-index) -1) + ) + (else + (set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (rnd-int self 3))) + ) + ) + ) + (until #f + (grunt-method-196 self 22528.0) + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-37 (ja-group))) + (when (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-41 (-> self nav))) + (set! (-> v1-41 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +(defstate attack (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state))) + (set! (-> v1-1 speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-10 *game-info*) + (v0-1 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) v0-1) + (set! (-> self attack-id) v0-1) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int self 2))) + (let ((v1-5 (-> self nav))) + (set! (-> v1-5 target-speed) (-> self attack-anim travel-speed)) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 turning-acceleration) 49152.0) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self charge-anim anim-index)))) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 3.0 0)) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (let ((v1-57 0)) + (let ((a0-22 (the-as object (-> *grunt-global-info* charge-anim))) + (a1-7 (-> self charge-anim)) + ) + (dotimes (a2-3 3) + (when (= a0-22 a1-7) + (set! v1-57 a2-3) + (goto cfg-21) + ) + (set! a0-22 (-> (the-as grunt-global-info a0-22) patrol-anim 1)) + ) + ) + (label cfg-21) + (set! (-> self use-charge-anim-index) v1-57) + ) + (go-virtual hostile) + ) + :post nav-enemy-chase-post + ) + +(defstate spin-attack (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-stare self) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-21 *game-info*) + (v0-3 (+ (-> v1-21 attack-id) 1)) + ) + (set! (-> v1-21 attack-id) v0-3) + (set! (-> self attack-id) v0-3) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int self 2))) + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-13 (ja-group))) + (if (not (and v1-13 (= v1-13 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-9 (handle->process (-> self focus handle)))) + (if a0-9 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + ) + ) + (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (go-virtual hostile) + ) + :post nav-enemy-simple-post + ) + +(defstate circling (grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (rnd-int self 3))) + (let ((v1-22 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-22 enemy-flags))) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-22 enemy-flags)))) + ) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-22 enemy-flags)))) + (set! (-> v1-22 nav callback-info) (-> v1-22 enemy-info callback-info)) + ) + 0 + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-25 enemy-flags)))) + ) + 0 + (let ((v1-27 (-> self nav))) + (set! (-> v1-27 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-29 (-> self nav))) + (set! (-> v1-29 acceleration) (-> self enemy-info run-acceleration)) + ) + 0 + (let ((v1-31 (-> self nav))) + (set! (-> v1-31 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-39 (ja-group))) + (if (not (and v1-39 (= v1-39 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((s5-0 (rnd-int self 8)) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (< 20480.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (let ((v1-66 self)) + (set! (-> v1-66 enemy-flags) (the-as enemy-flag (logclear (-> v1-66 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-66 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-71 self)) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logclear (-> v1-71 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((v1-77 (ja-group))) + (if (not (and v1-77 (= v1-77 grunt-celebrate-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((f30-2 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! grunt-celebrate-start-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + (ja-no-eval :group! grunt-celebrate-finish-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + ) + ) + ) + #f + ) + ) + +(defstate pacing (grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-28 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-28 enemy-flags))) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-28 enemy-flags)))) + ) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-28 enemy-flags)))) + (set! (-> v1-28 nav callback-info) (-> v1-28 enemy-info callback-info)) + ) + 0 + (let ((v1-31 self)) + (set! (-> v1-31 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-31 enemy-flags)))) + ) + 0 + (let ((v1-33 (-> self nav))) + (set! (-> v1-33 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((v1-35 (-> self nav))) + (set! (-> v1-35 acceleration) (-> self enemy-info walk-acceleration)) + ) + 0 + (let ((v1-37 (-> self nav))) + (set! (-> v1-37 turning-acceleration) (-> self enemy-info walk-turning-acceleration)) + ) + 0 + (let ((v1-41 (ja-group))) + (if (not (and v1-41 (= v1-41 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate stop-chase (grunt) + :virtual #t + :code (behavior () + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-24 (ja-group))) + (if (not (and v1-24 (= v1-24 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate wait-for-focus (grunt) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy idle) enter) + :trans (behavior () + (let ((s5-0 (handle->process (-> self focus handle)))) + (when s5-0 + (let ((gp-0 (get-trans (the-as process-focusable s5-0) 0))) + (when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))) + (>= 163840.0 (vector-vector-distance (-> self root trans) gp-0)) + ) + (or (not (logtest? (-> self fact enemy-options) (enemy-option user8))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) + (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root trans y)))) + ) + ) + ) + (cond + ((and (logtest? (-> self fact enemy-options) (enemy-option user9)) + (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-! s5-1 gp-0 (-> self root trans)) + (let ((f0-2 32768.0) + (v1-26 s5-1) + ) + (if (or (>= f0-2 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + (>= 20024.889 (fabs (deg- (y-angle (-> self root)) (atan (-> s5-1 x) (-> s5-1 z))))) + ) + (go-virtual notice) + ) + ) + ) + ) + (else + (go-virtual notice) + ) + ) + ) + ) + ) + ) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +(defstate knocked-recover (grunt) + :virtual #t + :code (behavior () + (local-vars (v1-49 object)) + (ja-channel-push! 1 0) + (let ((gp-0 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll))) + (when gp-0 + (let ((a0-5 (-> gp-0 ragdoll-joints))) + (if (< 0.0 (vector-dot (-> self node-list data (-> a0-5 0 joint-index) bone transform fvec) *y-vector*)) + (ja-no-eval :group! grunt-getup-front-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! grunt-getup-back-ja :num! (seek!) :frame-num 0.0) + ) + ) + (enable-ragdoll! gp-0 self) + ) + ) + (until v1-49 + (suspend) + (ja :num! (seek!)) + (set! v1-49 (and (ja-done? 0) (let ((a0-15 (handle->process (-> self ragdoll-proc)))) + (or (not a0-15) (ragdoll-proc-method-19 (the-as ragdoll-proc a0-15))) + ) + ) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +(defmethod ragdoll-settled? ((this grunt)) + (let ((t9-0 (method-of-type nav-enemy ragdoll-settled?))) + (and (t9-0 this) (or (= (-> this root gspot-pos y) -40959590.0) + (< (- (-> this root trans y) (-> this root gspot-pos y)) 4096.0) + ) + ) + ) + ) + +(defmethod on-dying ((this grunt)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch nav-enemy vs grunt. +(defmethod relocate ((this grunt) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (the-as grunt ((method-of-type nav-enemy relocate) this offset)) + ) + +(defmethod init-enemy-collision! ((this grunt)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (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 17408.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd crate obstacle hit-by-others-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 9830.4 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 4915.2) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-19 transform-index) 18) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 2252.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 16) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 12) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-25 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-25 transform-index) 6) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-enemy-info ((this grunt)) + *grunt-nav-enemy-info* + ) + +(defmethod coin-flip? ((this grunt)) + #f + ) + +(defmethod init-enemy! ((this grunt)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this (get-enemy-info this)) + (let ((v1-6 (-> this neck))) + (set! (-> v1-6 up) (the-as uint 1)) + (set! (-> v1-6 nose) (the-as uint 2)) + (set! (-> v1-6 ear) (the-as uint 0)) + (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-6 ignore-angle) 30947.555) + ) + (let ((v1-8 (-> this nav))) + (set! (-> v1-8 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((s5-2 *grunt-global-info*)) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (rnd-int this 4))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (rnd-int this 3))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (rnd-int this 2))) + ) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (rnd-int this 2)) + (logior! (-> this grunt-flags) (grunt-flags gf0)) + ) + (if (zero? (rnd-int this 2)) + (logior! (-> this grunt-flags) (grunt-flags gf2)) + ) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-idle2 ((this grunt)) + (if (logtest? (-> this fact enemy-options) (enemy-option user9)) + (go (method-of-object this wait-for-focus)) + (go (method-of-object this idle)) + ) + 0 + ) diff --git a/goal_src/jak3/levels/common/enemy/kg-grunt.gc b/goal_src/jak3/levels/common/enemy/kg-grunt.gc index 4b9aea188d..41e0146b17 100644 --- a/goal_src/jak3/levels/common/enemy/kg-grunt.gc +++ b/goal_src/jak3/levels/common/enemy/kg-grunt.gc @@ -7,3 +7,1925 @@ ;; DECOMP BEGINS +(defskelgroup skel-kg-grunt kg-grunt kg-grunt-lod0-jg -1 + ((kg-grunt-lod1-mg (meters 20)) (kg-grunt-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow kg-grunt-shadow-mg + :origin-joint-index 18 + ) + +(defskelgroup skel-kg-grunt-lowres kg-grunt kg-grunt-lod0-jg -1 + ((kg-grunt-lod1-mg (meters 20)) (kg-grunt-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow kg-grunt-shadow-mg + :origin-joint-index 18 + ) + +(define *kg-grunt-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 20 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 30 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 31 :group "skel-kg-debris-d") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +(define *kg-grunt-debris-elbow-shoulder-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +(define *kg-grunt-debris-array-params* + (new 'static 'boxed-array :type debris-static-params + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 21 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 40 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 32 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 44 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 30 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 27 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + ) + +(define *kg-grunt-debris-knee-hip-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 20 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 31 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 26 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +(deftype kg-grunt-anim-info (structure) + ((anim-index int32) + (travel-speed meters) + ) + :pack-me + ) + + +(deftype kg-grunt-global-info (basic) + ((prev-knocked-anim-index int32) + (prev-yellow-hit-anim-index int32) + (prev-blue-hit-anim-index int32) + (patrol-anim kg-grunt-anim-info 4 :inline) + (charge-anim kg-grunt-anim-info 3 :inline) + (attack-anim kg-grunt-anim-info 2 :inline) + (knocked-anim kg-grunt-anim-info 4 :inline) + (knocked-land-anim kg-grunt-anim-info 4 :inline) + (yellow-hit-anim kg-grunt-anim-info 4 :inline) + (blue-hit-anim kg-grunt-anim-info 6 :inline) + ) + ) + + +(deftype kg-grunt (nav-enemy) + ((patrol-anim kg-grunt-anim-info) + (charge-anim kg-grunt-anim-info) + (attack-anim kg-grunt-anim-info) + (knocked-anim kg-grunt-anim-info) + (yellow-hit-anim kg-grunt-anim-info) + (blue-hit-anim kg-grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8 :offset 652) + (knocked-anim-index int8) + (jumping-ambush-path-pt int8) + (kg-grunt-flags uint8) + (state-timeout2 time-frame) + (next-warn-time time-frame) + (dest vector :inline) + (minimap connection-minimap :offset 704) + (debris-count uint32) + (debris-mask uint32) + ) + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + explode + ) + (:methods + (go-attack (_type_ float) process-focusable) + (get-nav-enemy-info (_type_) nav-enemy-info) + ) + ) + + +(define *kg-grunt-global-info* (new 'static 'kg-grunt-global-info + :patrol-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 11 :travel-speed (meters 4)) + (new 'static 'kg-grunt-anim-info :anim-index 12 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + ) + :charge-anim (new 'static 'inline-array kg-grunt-anim-info 3 + (new 'static 'kg-grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 16 :travel-speed (meters 7)) + ) + :attack-anim (new 'static 'inline-array kg-grunt-anim-info 2 + (new 'static 'kg-grunt-anim-info :anim-index 17 :travel-speed (meters 12)) + (new 'static 'kg-grunt-anim-info :anim-index 18 :travel-speed (meters 12)) + ) + :knocked-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 22) + (new 'static 'kg-grunt-anim-info :anim-index 24) + (new 'static 'kg-grunt-anim-info :anim-index 26) + (new 'static 'kg-grunt-anim-info :anim-index 28) + ) + :knocked-land-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 23) + (new 'static 'kg-grunt-anim-info :anim-index 25) + (new 'static 'kg-grunt-anim-info :anim-index 27) + (new 'static 'kg-grunt-anim-info :anim-index 29) + ) + :yellow-hit-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 34) + (new 'static 'kg-grunt-anim-info :anim-index 35) + (new 'static 'kg-grunt-anim-info :anim-index 36) + (new 'static 'kg-grunt-anim-info :anim-index 37) + ) + :blue-hit-anim (new 'static 'inline-array kg-grunt-anim-info 6 + (new 'static 'kg-grunt-anim-info :anim-index 38) + (new 'static 'kg-grunt-anim-info :anim-index 39) + (new 'static 'kg-grunt-anim-info :anim-index 40) + (new 'static 'kg-grunt-anim-info :anim-index 41) + (new 'static 'kg-grunt-anim-info :anim-index 42) + (new 'static 'kg-grunt-anim-info :anim-index 43) + ) + ) + ) + +(define *fact-info-kg-grunt-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 48 :pickup-amount 10.0) + ) + +(define *kg-grunt-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 'inline-array idle-control-frame 36 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x1e + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 13 + :hostile-anim -1 + :hit-anim 34 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 19 + :die-falling-anim 32 + :victory-anim -1 + :jump-wind-up-anim 45 + :jump-in-air-anim 46 + :jump-land-anim 47 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 18 + :sound-hit (static-sound-name "kg-impact") + :sound-die (static-sound-name "kg-explo") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #t + :use-pacing #t + :walk-anim 11 + :turn-anim -1 + :run-anim 14 + :taunt-anim 20 + :run-travel-speed (meters 7) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *kg-grunt-nav-enemy-info* fact-defaults) *fact-info-kg-grunt-defaults*) + +(defmethod get-inv-mass ((this kg-grunt)) + 2.0 + ) + +(defmethod event-handler ((this kg-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((= (-> this hit-points) 0.0) + (go (method-of-object this explode)) + ) + (else + (let ((s5-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> s5-1 hit-xz-reaction) 0.95) + (set! (-> s5-1 hit-y-reaction) 0.6) + (set! (-> s5-1 fountain-rand-transv-lo quad) (-> this incoming attack-position quad)) + (dotimes (s4-0 8) + (let ((v1-32 (rand-vu-int-count-excluding 18 (the-as int (-> this debris-mask))))) + (logior! (-> this debris-mask) (ash 1 v1-32)) + (debris-spawn this s5-1 (-> *kg-grunt-debris-array-params* v1-32) (the-as process-drawable #f)) + ) + ) + ) + (setup-masks (-> this draw) 0 (the-as int (* (-> this debris-mask) 2))) + (go (method-of-object this knocked)) + ) + ) + #t + ) + (('impact-impulse) + (let ((v1-44 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-44) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> this hit-points) 0.0) + (send-event arg0 'lawsuit (-> this root trans)) + (go (method-of-object this explode)) + #t + ) + ) + ) + (('death-start) + (set! (-> this draw death-timer) (the-as uint 0)) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod go-ambush-delay ((this kg-grunt)) + (cond + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) + ) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) + ) + (else + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) + ) + ) + ) + +(defstate explode (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "kg-explo") + (send-event self 'death-start) + ) + :code (behavior () + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-1 hit-xz-reaction) 0.95) + (set! (-> a1-1 hit-y-reaction) 0.6) + (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (debris-spawn self a1-1 *kg-grunt-debris-params* (the-as process-drawable #f)) + ) + (let ((v1-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-grunt-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 220 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 220)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 220)) + ) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defstate falling-ambush (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let* ((gp-1 *target*) + (a0-4 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when a0-4 + (let* ((gp-2 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0)) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-2 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-2 quat) (-> gp-2 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let* ((v1-17 *game-info*) + (a0-15 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-15) + (set! (-> self attack-id) a0-15) + ) + (let ((v1-19 (-> self root root-prim))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((v1-6 (-> self root root-prim))) + (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) + ) + (sound-play "kg-grunt-notice") + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max 1.8) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (until (logtest? (-> self root status) (collide-status on-ground touch-surface touch-wall)) + (suspend) + ) + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +(defmethod go-directed2 ((this kg-grunt)) + (case (-> this jump-why) + ((2) + (go (method-of-object this jumping-ambush-cont)) + ) + (else + ((method-of-type nav-enemy go-directed2) this) + ) + ) + ) + +(defstate jumping-ambush (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy ambush) enter)) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping jumping-ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self jumping-ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate jumping-ambush-cont (kg-grunt) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self jumping-ambush-path-pt) 1)) + ) + (if (and (nonzero? a0-0) (< v1-1 (-> a0-0 curve num-cverts))) + (set! (-> self jumping-ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self jumping-ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate active (kg-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 kg-grunt-patrol0-ja) + (= v1-8 kg-grunt-patrol1-ja) + (= v1-8 kg-grunt-charge0-ja) + (= v1-8 kg-grunt-charge1-ja) + ) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (set! (-> self patrol-anim) (-> *kg-grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-37 (ja-group))) + (if (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (nonzero? (-> self patrol-anim anim-index)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self patrol-anim) (the-as kg-grunt-anim-info (-> *kg-grunt-global-info* patrol-anim))) + (let ((v1-67 (-> self nav))) + (set! (-> v1-67 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (zero? (rnd-int self 3)) + (let ((v1-107 self)) + (set! (-> v1-107 enemy-flags) (the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-107 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-171 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-171 enemy-flags))) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-171 enemy-flags)))) + ) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-171 enemy-flags)))) + (set! (-> v1-171 nav callback-info) (-> v1-171 enemy-info callback-info)) + ) + 0 + ) + ) + ) + #f + ) + ) + +(defmethod go-attack ((this kg-grunt) (arg0 float)) + (local-vars (v1-5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (get-focus! this))) + (when gp-0 + (let ((v1-3 (get-trans gp-0 0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 v1-3 (-> this root trans)) + (.lvf vf1 (&-> s4-0 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-5 vf1) + (let* ((f30-0 v1-5) + (f0-0 arg0) + (f28-0 (* f0-0 f0-0)) + (f0-2 12288.0) + ) + (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) + (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f1-0 1228.8) + ) + (cond + ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) + (go (method-of-object this attack)) + ) + ((let ((f0-10 12288.0)) + (< f30-0 (* f0-10 f0-10)) + ) + (go (method-of-object this spin-attack)) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +(defstate hostile (kg-grunt) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (go-attack self 13312.0)) + (gp-0 (current-time)) + ) + (when (and (>= gp-0 (-> self next-warn-time)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + (when (and a0-1 (let ((f0-0 65536.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans a0-1 0) (-> self root trans))) + ) + ) + (sound-play "kg-grunt-warn") + (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (let ((v1-19 (-> self use-charge-anim-index))) + (cond + ((>= v1-19 0) + (set! (-> self charge-anim) (-> *kg-grunt-global-info* charge-anim v1-19)) + (set! (-> self use-charge-anim-index) -1) + ) + (else + (set! (-> self charge-anim) (-> *kg-grunt-global-info* charge-anim (rnd-int self 3))) + ) + ) + ) + (until #f + (go-attack self 22528.0) + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-37 (ja-group))) + (when (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-41 (-> self nav))) + (set! (-> v1-41 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +(defstate attack (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state))) + (set! (-> v1-1 speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-10 *game-info*) + (v0-1 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) v0-1) + (set! (-> self attack-id) v0-1) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "kg-grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *kg-grunt-global-info* attack-anim (rnd-int self 2))) + (let ((v1-5 (-> self nav))) + (set! (-> v1-5 target-speed) (-> self attack-anim travel-speed)) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 turning-acceleration) 49152.0) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self charge-anim anim-index)))) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 3.0 0)) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (let ((v1-57 0)) + (let ((a0-22 (the-as object (-> *kg-grunt-global-info* charge-anim))) + (a1-7 (-> self charge-anim)) + ) + (dotimes (a2-3 3) + (when (= (the-as kg-grunt-anim-info a0-22) a1-7) + (set! v1-57 a2-3) + (goto cfg-21) + ) + (set! a0-22 (&+ (the-as kg-grunt-anim-info a0-22) 8)) + ) + ) + (label cfg-21) + (set! (-> self use-charge-anim-index) v1-57) + ) + (go-virtual hostile) + ) + :post nav-enemy-chase-post + ) + +(defstate spin-attack (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-stare self) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-21 *game-info*) + (v0-3 (+ (-> v1-21 attack-id) 1)) + ) + (set! (-> v1-21 attack-id) v0-3) + (set! (-> self attack-id) v0-3) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "kg-grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *kg-grunt-global-info* attack-anim (rnd-int self 2))) + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-13 (ja-group))) + (if (not (and v1-13 (= v1-13 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-9 (handle->process (-> self focus handle)))) + (if a0-9 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + ) + ) + (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (go-virtual hostile) + ) + :post nav-enemy-simple-post + ) + +(defstate circling (kg-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (set! (-> self charge-anim) (-> *kg-grunt-global-info* charge-anim (rnd-int self 3))) + (let ((v1-22 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-22 enemy-flags))) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-22 enemy-flags)))) + ) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-22 enemy-flags)))) + (set! (-> v1-22 nav callback-info) (-> v1-22 enemy-info callback-info)) + ) + 0 + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-25 enemy-flags)))) + ) + 0 + (let ((v1-27 (-> self nav))) + (set! (-> v1-27 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-29 (-> self nav))) + (set! (-> v1-29 acceleration) (-> self enemy-info run-acceleration)) + ) + 0 + (let ((v1-31 (-> self nav))) + (set! (-> v1-31 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-39 (ja-group))) + (if (not (and v1-39 (= v1-39 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((s5-0 (rnd-int self 8)) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (< 20480.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (let ((v1-66 self)) + (set! (-> v1-66 enemy-flags) (the-as enemy-flag (logclear (-> v1-66 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-66 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-71 self)) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logclear (-> v1-71 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((v1-77 (ja-group))) + (if (not (and v1-77 (= v1-77 kg-grunt-celebrate-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((f30-2 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! kg-grunt-celebrate-start-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + (ja-no-eval :group! kg-grunt-celebrate-finish-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + ) + ) + ) + #f + ) + ) + +(defstate pacing (kg-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (set! (-> self patrol-anim) (-> *kg-grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-28 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-28 enemy-flags))) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-28 enemy-flags)))) + ) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-28 enemy-flags)))) + (set! (-> v1-28 nav callback-info) (-> v1-28 enemy-info callback-info)) + ) + 0 + (let ((v1-31 self)) + (set! (-> v1-31 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-31 enemy-flags)))) + ) + 0 + (let ((v1-33 (-> self nav))) + (set! (-> v1-33 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((v1-35 (-> self nav))) + (set! (-> v1-35 acceleration) (-> self enemy-info walk-acceleration)) + ) + 0 + (let ((v1-37 (-> self nav))) + (set! (-> v1-37 turning-acceleration) (-> self enemy-info walk-turning-acceleration)) + ) + 0 + (let ((v1-41 (ja-group))) + (if (not (and v1-41 (= v1-41 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate stop-chase (kg-grunt) + :virtual #t + :code (behavior () + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self patrol-anim) (-> *kg-grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-24 (ja-group))) + (if (not (and v1-24 (= v1-24 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defmethod knocked-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (let ((v1-2 (ash 1 (-> *kg-grunt-global-info* prev-yellow-hit-anim-index))) + (a0-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and a0-7 (or (= a0-7 (-> this draw art-group data 16)) + (= a0-7 (-> this draw art-group data 38)) + (= a0-7 (-> this draw art-group data 39)) + (= a0-7 (-> this draw art-group data 40)) + ) + ) + (set! a2-3 (logior v1-2 4)) + (set! a2-3 (logior v1-2 8)) + ) + ) + (let ((s4-0 (enemy-method-131 this 4 a2-3))) + (set! (-> *kg-grunt-global-info* prev-yellow-hit-anim-index) s4-0) + (set! (-> this yellow-hit-anim) (-> *kg-grunt-global-info* yellow-hit-anim s4-0)) + (let ((v1-11 (rnd-int this 3))) + (if (= s4-0 3) + (set! v1-11 2) + ) + (set! (-> this use-charge-anim-index) v1-11) + ) + ) + (let ((s4-1 (-> this draw art-group data (-> this yellow-hit-anim anim-index)))) + (ja-channel-push! 1 0) + (let ((a0-19 (-> this skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-19 param 1) (-> arg0 anim-speed)) + (set! (-> a0-19 frame-num) 0.0) + (joint-control-channel-group! a0-19 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + #t + ) + (((knocked-type blue-shot)) + (let* ((v1-24 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (s4-2 (and v1-24 (or (= v1-24 (-> this draw art-group data 16)) + (= v1-24 (-> this draw art-group data 38)) + (= v1-24 (-> this draw art-group data 39)) + (= v1-24 (-> this draw art-group data 40)) + ) + ) + ) + ) + (if (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (logior! (-> this kg-grunt-flags) 2) + ) + (cond + ((and (not s4-2) (logtest? (-> this kg-grunt-flags) 2)) + (set! s4-2 #t) + (ja-channel-push! 1 (seconds 0.17)) + ) + (else + (let ((v1-36 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-36 (= v1-36 (-> this draw art-group data 44))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + ) + ) + (let ((v1-42 (ash 1 (-> *kg-grunt-global-info* prev-blue-hit-anim-index)))) + (if s4-2 + (set! a2-5 (logior v1-42 56)) + (set! a2-5 (logior v1-42 7)) + ) + ) + (let ((v1-46 (enemy-method-131 this 6 a2-5))) + (set! (-> *kg-grunt-global-info* prev-blue-hit-anim-index) v1-46) + (set! (-> this blue-hit-anim) (-> *kg-grunt-global-info* blue-hit-anim v1-46)) + ) + (let ((a2-6 0)) + (when (not (logtest? (-> this kg-grunt-flags) 2)) + (if s4-2 + (set! a2-6 (logior a2-6 3)) + (set! a2-6 (logior a2-6 4)) + ) + ) + (set! (-> this use-charge-anim-index) (enemy-method-131 this 3 a2-6)) + ) + ) + (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) + (a0-51 (-> this skel root-channel 0)) + ) + (set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26)) + (set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1))) + (set! (-> a0-51 param 1) (-> arg0 anim-speed)) + (set! (-> a0-51 frame-num) 0.0) + (joint-control-channel-group! a0-51 (the-as art-joint-anim a1-26) num-func-seek!) + ) + #t + ) + (else + 0 + (cond + ((or (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (= (-> this incoming knocked-type) (knocked-type dark-shot)) + ) + (set! v1-72 3) + ) + (else + (let ((s4-3 (ash 1 (-> *kg-grunt-global-info* prev-knocked-anim-index)))) + (let ((s3-0 (-> this root))) + (if (>= 16384.0 (fabs (deg- (quaternion-y-angle (-> s3-0 quat)) (atan (-> s3-0 transv x) (-> s3-0 transv z))))) + (set! s4-3 (logior s4-3 4)) + ) + ) + (set! v1-72 (enemy-method-131 this 3 s4-3)) + ) + ) + ) + (set! (-> *kg-grunt-global-info* prev-knocked-anim-index) v1-72) + (set! (-> this knocked-anim-index) v1-72) + (set! (-> this knocked-anim) (-> *kg-grunt-global-info* knocked-anim v1-72)) + (let ((s4-4 (-> this draw art-group data (-> this knocked-anim anim-index)))) + (ja-channel-push! 1 0) + (let ((a0-68 (-> this skel root-channel 0))) + (set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4)) + (set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1))) + (set! (-> a0-68 param 1) (-> arg0 anim-speed)) + (set! (-> a0-68 frame-num) 0.0) + (joint-control-channel-group! a0-68 (the-as art-joint-anim s4-4) num-func-seek!) + ) + ) + #t + ) + ) + ) + +(defmethod knocked-land-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + #f + ) + ((!= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (let ((v1-8 (-> this + draw + art-group + data + (-> *kg-grunt-global-info* knocked-land-anim (-> this knocked-anim-index) anim-index) + ) + ) + (a0-3 (-> this skel root-channel 0)) + ) + (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-8)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-8) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim v1-8) num-func-seek!) + ) + #t + ) + ) + ) + +(defmethod go-die ((this kg-grunt)) + (go (method-of-object this explode)) + ) + +(defstate wait-for-focus (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy idle) enter) + :trans (behavior () + (let ((s5-0 (handle->process (-> self focus handle)))) + (when s5-0 + (let ((gp-0 (get-trans (the-as process-focusable s5-0) 0))) + (when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))) + (>= 163840.0 (vector-vector-distance (-> self root trans) gp-0)) + ) + (or (not (logtest? (-> self fact enemy-options) (enemy-option user8))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) + (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root trans y)))) + ) + ) + ) + (cond + ((and (logtest? (-> self fact enemy-options) (enemy-option user9)) + (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-! s5-1 gp-0 (-> self root trans)) + (let ((f0-2 32768.0) + (v1-26 s5-1) + ) + (if (or (>= f0-2 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + (>= 20024.889 (fabs (deg- (y-angle (-> self root)) (atan (-> s5-1 x) (-> s5-1 z))))) + ) + (go-virtual notice) + ) + ) + ) + ) + (else + (go-virtual notice) + ) + ) + ) + ) + ) + ) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +(defmethod on-dying ((this kg-grunt)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch nav-enemy vs kg-grunt. +(defmethod relocate ((this kg-grunt) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (the-as kg-grunt ((method-of-type nav-enemy relocate) this offset)) + ) + +(defmethod init-enemy-collision! ((this kg-grunt)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (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 17408.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd crate obstacle hit-by-others-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 9830.4 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 4915.2) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-19 transform-index) 18) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 2252.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 16) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 12) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-25 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-25 transform-index) 6) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-nav-enemy-info ((this kg-grunt)) + *kg-grunt-nav-enemy-info* + ) + +(defmethod init-enemy! ((this kg-grunt)) + (if (and (-> this entity) (= (-> this entity extra level name) 'factoryd)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-kg-grunt-lowres" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-kg-grunt" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (logior! (-> this mask) (process-mask kg-robot)) + (init-enemy-defaults! this (get-nav-enemy-info this)) + (let ((v1-17 (-> this neck))) + (set! (-> v1-17 up) (the-as uint 1)) + (set! (-> v1-17 nose) (the-as uint 2)) + (set! (-> v1-17 ear) (the-as uint 0)) + (set-vector! (-> v1-17 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-17 ignore-angle) 30947.555) + ) + (let ((v1-19 (-> this nav))) + (set! (-> v1-19 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((s5-3 *kg-grunt-global-info*)) + (set! (-> this patrol-anim) (-> s5-3 patrol-anim (rnd-int this 4))) + (set! (-> this charge-anim) (-> s5-3 charge-anim (rnd-int this 3))) + (set! (-> this attack-anim) (-> s5-3 attack-anim (rnd-int this 2))) + ) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (rnd-int this 2)) + (logior! (-> this kg-grunt-flags) 1) + ) + (if (zero? (rnd-int this 2)) + (logior! (-> this kg-grunt-flags) 4) + ) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + (set-vector! (-> this root scale) 1.25 1.25 1.25 1.0) + (setup-masks (-> this draw) -1 0) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-idle2 ((this kg-grunt)) + (if (logtest? (-> this fact enemy-options) (enemy-option user9)) + (go (method-of-object this wait-for-focus)) + (go (method-of-object this idle)) + ) + 0 + ) diff --git a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc index ecc210c195..fb50426ecc 100644 --- a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc +++ b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc @@ -5,5 +5,3451 @@ ;; name in dgo: prebot-eco-creature ;; dgos: DESW, TOWERA, MINED +;; +++eco-creature-flag +(defenum eco-creature-flag + :type uint64 + :bitfield #t + (ecf0 0) + (ecf1 1) + (ecf2 2) + (ecf3 3) + (ecf4 4) + (ecf5 5) + ) +;; ---eco-creature-flag + +(declare-type prebot-large-eco-creature nav-enemy) +(define-extern prebot-medium-eco-creature type) +(define-extern prebot-small-eco-creature type) +(define-extern medium-eco-creature-launched type) +(define-extern small-eco-creature-launched type) +(define-extern large-eco-creature-split (function none :behavior prebot-large-eco-creature)) +(define-extern prebot-eco-creature-joint-callback (function cspace transformq none)) + + ;; DECOMP BEGINS +(defpartgroup group-prebot-critter-trail + :id 440 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 1754 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 1755 :flags (sp6)) + (sp-item 1756 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +(defpart 1756 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 4.0) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 48.0 16.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 6761.25)) + (:vel-y (meters 0) (meters 0.01)) + (:fade-a -0.10666667) + (:accel-y (meters -0.000033333334) (meters -0.000016666667)) + (:friction 0.96) + (:timer (seconds 0.5) (seconds 3.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.017) (seconds 0.497)) + (:next-launcher 1757) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 1757 + :init-specs ((:r 32.0) (:g 128.0 128.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 1758)) + ) + +(defpart 1758 + :init-specs ((:r 0.0) (:g 48.0 16.0) (:b 64.0) (:next-time (seconds 0.017) (seconds 0.497)) (:next-launcher 1757)) + ) + +(defpart 1755 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -0.8) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +(defpart 1754 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 3.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 64.0 8.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters 0.005) (meters 0.008333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.2) + (:fade-g 0.0) + (:fade-b -3.2) + (:fade-a -0.8) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.135)) + (:next-launcher 1759) + ) + ) + +(defpart 1759 + :init-specs ((:r 128.0) + (:g 128.0) + (:b 128.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.10666667 -0.21333334) + (:func 'nothing) + ) + ) + +(defskelgroup skel-cav-eco-lg cav-eco-lg cav-eco-lg-lod0-jg cav-eco-lg-idle-ja + ((cav-eco-lg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(deftype prebot-large-eco-creature (nav-enemy) + ((old-y-deg float) + (diff-angle float) + (attack-anims (array int32)) + (victory-anims (array int32)) + (turn-left-anim int32) + (turn-right-anim int32) + (split-type type) + (attack-stop-frame float) + (traj trajectory :inline) + (which-trajectory int8) + (x-rotate float) + (y-rotate float) + (launch-pos vector :inline) + (launch vector :inline) + (spin-jm joint-mod) + (trail-part sparticle-launch-control) + (trail-sound sound-id) + (flags eco-creature-flag) + ) + (:state-methods + unfold + fly-to-dest + attack + wait-for-children + ) + (:methods + (prebot-large-eco-creature-method-194 (_type_) none) + (prebot-large-eco-creature-method-195 (_type_) none) + ) + ) + + +(define *prebot-large-eco-creature-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 3 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim 2 + :victory-anim 10 + :jump-wind-up-anim 2 + :jump-in-air-anim 2 + :jump-land-anim 2 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 16384.0 + :knocked-red-vxz-hi 40960.0 + :knocked-red-vy-lo 49152.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 20480.0 + :knocked-blue-vxz-hi 28672.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 1.0 :w 35404.914) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8223.438) + :geo-tform (new 'static 'vector :x 1.0 :w 27181.492) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14248.819) + :geo-tform (new 'static 'vector :x -1.0 :w 10623.986) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 12262.859) + :geo-tform (new 'static 'vector :x 1.0 :w 33438.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.137 :z -0.9905 :w 11373.791) + :geo-tform (new 'static 'vector :x 0.2271 :y 0.9734 :z 0.0279 :w 36639.176) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5102 :z -0.86 :w 20530.754) + :geo-tform (new 'static 'vector :x 0.409 :y -0.0529 :z 0.9109 :w 32271.676) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6644 :z -0.7473 :w 1968.9199) + :geo-tform (new 'static 'vector :x 0.4093 :y 0.033 :z 0.9117 :w 33077.91) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9613 :z -0.2752 :w 2214.5525) + :geo-tform (new 'static 'vector :x 0.4059 :y -0.0481 :z 0.9126 :w 34502.54) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5153 :z 0.8569 :w 2080.0034) + :geo-tform (new 'static 'vector :x 0.4027 :y -0.0356 :z 0.9146 :w 32440.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.4859 :z 0.8739 :w 3273.5598) + :geo-tform (new 'static 'vector :x 0.414 :y 0.0464 :z 0.909 :w 29818.152) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8326 :z -0.5538 :w 3106.5886) + :geo-tform (new 'static 'vector :x 0.419 :y -0.032 :z 0.9073 :w 32459.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.9421 :z -0.3352 :w 6646.0605) + :geo-tform (new 'static 'vector :x 0.3914 :y -0.2 :z 0.8982 :w 37623.16) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3413 :z -0.9399 :w 1832.5868) + :geo-tform (new 'static 'vector :x 0.4204 :y -0.1424 :z 0.896 :w 38915.023) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1371 :z 0.9905 :w 11369.786) + :geo-tform (new 'static 'vector :x -0.2272 :y 0.9734 :z 0.0279 :w 28896.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5101 :z 0.86 :w 20534.176) + :geo-tform (new 'static 'vector :x -0.026 :y 0.9979 :z 0.0579 :w 23979.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6645 :z 0.7472 :w 1958.0337) + :geo-tform (new 'static 'vector :x 0.016 :y 0.9992 :z -0.0358 :w 23969.791) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9615 :z 0.2744 :w 2230.645) + :geo-tform (new 'static 'vector :x 0.0911 :y 0.9943 :z 0.0536 :w 24079.475) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5098 :z -0.8602 :w 2098.3352) + :geo-tform (new 'static 'vector :x -0.0178 :y 0.999 :z 0.0406 :w 24125.459) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 19 + :pre-tform (new 'static 'vector :x 0.4819 :z -0.8762 :w 3256.2107) + :geo-tform (new 'static 'vector :x -0.1538 :y 0.9868 :z -0.0491 :w 23956.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8364 :z 0.548 :w 3087.583) + :geo-tform (new 'static 'vector :x -0.017 :y 0.9991 :z 0.0369 :w 23745.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.9425 :z 0.3339 :w 6655.1807) + :geo-tform (new 'static 'vector :x 0.2492 :y 0.945 :z 0.2115 :w 24615.268) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3403 :z 0.9402 :w 1852.0657) + :geo-tform (new 'static 'vector :x 0.3178 :y 0.9363 :z 0.1493 :w 24121.836) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 20948.764) + :geo-tform (new 'static 'vector :x -1.0 :w 9182.285) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0068 :w 7387.509) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.003 :z -0.0014 :w 16198.405) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9697 :z -0.244 :w 191.6382) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4854 :z -0.8742 :w 21186.406) + :geo-tform (new 'static 'vector :x 0.6599 :y 0.6796 :z 0.3201 :w 35879.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0363 :w 2717.3774) + :geo-tform (new 'static 'vector :x 0.6708 :y 0.7057 :z 0.2277 :w 34044.242) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3584 :z -0.9335 :w 11286.792) + :geo-tform (new 'static 'vector :x -0.4444 :y 0.7119 :z -0.5437 :w 28463.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1147 :z -0.9933 :w 2024.0066) + :geo-tform (new 'static 'vector :x -0.5154 :y 0.6809 :z -0.5201 :w 27281.908) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4859 :z 0.8739 :w 21191.012) + :geo-tform (new 'static 'vector :x 0.1968 :y 0.4177 :z -0.8869 :w 17933.508) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z -0.0361 :w 2729.0828) + :geo-tform (new 'static 'vector :x 0.0825 :y 0.3055 :z -0.9485 :w 17459.846) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3588 :z 0.9333 :w 11281.3125) + :geo-tform (new 'static 'vector :x 0.2273 :y 0.5912 :z 0.7738 :w 23386.34) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1145 :z 0.9934 :w 2026.6462) + :geo-tform (new 'static 'vector :x 0.2996 :y 0.5792 :z 0.758 :w 21904.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + ) + ) + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 5) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 4) + :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! (-> *prebot-large-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod go-ambush-delay ((this prebot-large-eco-creature)) + (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) + (go-idle2 this) + ((method-of-type nav-enemy go-ambush-delay) this) + ) + ) + +(defmethod go-dormant ((this prebot-large-eco-creature)) + (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) + (go-idle2 this) + ((method-of-type nav-enemy go-dormant) this) + ) + ) + +(defmethod go-dormant-aware ((this prebot-large-eco-creature)) + (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) + (go-idle2 this) + ((method-of-type nav-enemy go-dormant-aware) this) + ) + ) + +(defmethod event-handler ((this prebot-large-eco-creature) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((s4-0 (the-as object (-> arg3 param 1)))) + (cond + ((or (not (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s4-0) mask))) + (logand (penetrate + vehicle + dark-skin + dark-punch + dark-bomb + dark-smack + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + ) + (-> (the-as attack-info s4-0) penetrate-using) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + (when (and (logtest? (-> (the-as attack-info s4-0) mask) (attack-mask id)) + (!= (-> (the-as attack-info s4-0) id) (-> this incoming attack-id)) + ) + (set! (-> this incoming attack-id) (-> (the-as attack-info s4-0) id)) + #t + ) + ) + ) + ) + ) + (('death-end) + (prebot-large-eco-creature-method-195 this) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('eco-creature-died) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer arg0)) + (set! (-> a1-4 num-params) arg1) + (set! (-> a1-4 message) arg2) + (set! (-> a1-4 param 0) (-> arg3 param 0)) + (set! (-> a1-4 param 1) (-> arg3 param 1)) + (set! (-> a1-4 param 2) (-> arg3 param 2)) + (set! (-> a1-4 param 3) (-> arg3 param 3)) + (set! (-> a1-4 param 4) (-> arg3 param 4)) + (set! (-> a1-4 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> this parent)) a1-4) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod coin-flip? ((this prebot-large-eco-creature)) + #f + ) + +(defmethod enemy-common-post ((this prebot-large-eco-creature)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (let ((f0-0 (quaternion-y-angle (-> this root quat)))) + (set! (-> this diff-angle) (- (-> this old-y-deg) f0-0)) + (cond + ((< 32768.0 (-> this diff-angle)) + (+! (-> this diff-angle) -65536.0) + ) + ((< (-> this diff-angle) -32768.0) + (+! (-> this diff-angle) 65536.0) + ) + ) + (set! (-> this old-y-deg) f0-0) + ) + (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (logior! (-> this flags) (eco-creature-flag ecf0)) + (logclear! (-> this flags) (eco-creature-flag ecf0)) + ) + 0 + (none) + ) + +(defmethod prebot-large-eco-creature-method-194 ((this prebot-large-eco-creature)) + (cond + ((< 0.0 (-> this diff-angle)) + (let ((v1-2 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((not (and v1-2 (= v1-2 (-> this draw art-group data (-> this turn-left-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-0 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-0 + (the-as art-joint-anim (-> this draw art-group data (-> this turn-left-anim))) + num-func-identity + ) + (set! (-> s5-0 frame-num) 0.0) + ) + ) + (else + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 param 0) (* 0.0019975142 (-> this diff-angle))) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + ) + ) + ) + (else + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((not (and v1-17 (= v1-17 (-> this draw art-group data (-> this turn-right-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data (-> this turn-right-anim))) + num-func-identity + ) + (set! (-> s5-1 frame-num) 0.0) + ) + ) + (else + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 param 0) (* -0.0019975142 (-> this diff-angle))) + (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod prebot-large-eco-creature-method-195 ((this prebot-large-eco-creature)) + (when (not (logtest? (-> this flags) (eco-creature-flag ecf2))) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (send-event (ppointer->process (-> this parent)) 'eco-creature-died (-> this root trans)) + ) + 0 + (none) + ) + +(defstate knocked (prebot-large-eco-creature) + :virtual #t + :enter (behavior () + (cond + ((and (-> self split-type) (or (= (-> self hit-points) 0.0) (nonzero? (-> self fated-time)))) + (large-eco-creature-split) + (go-virtual wait-for-children) + ) + (else + (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + ) + ) + ) + +(defstate wait-for-children (prebot-large-eco-creature) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('eco-creature-died) + (let ((v1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-1 from) (process->ppointer proc)) + (set! (-> v1-1 num-params) argc) + (set! (-> v1-1 message) message) + (set! (-> v1-1 param 0) (-> block param 0)) + (set! (-> v1-1 param 1) (-> block param 1)) + (set! (-> v1-1 param 2) (-> block param 2)) + (set! (-> v1-1 param 3) (-> block param 3)) + (set! (-> v1-1 param 4) (-> block param 4)) + (set! (-> v1-1 param 5) (-> block param 5)) + (send-event-function (ppointer->process (-> self parent)) v1-1) + ) + ) + ) + ) + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-6 (-> self nav))) + (logclear! (-> v1-6 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + ) + +(defstate attack (prebot-large-eco-creature) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (eco-creature-flag ecf1)) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-9 *game-info*) + (a0-5 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-5) + (set! (-> self attack-id) a0-5) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self attack-anims (rand-vu-int-count (-> self attack-anims length)))) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-179 self) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 max-rotation-rate) (-> self enemy-info maximum-rotation-rate)) + ) + 0 + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + nav-state + (if (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logior! (-> self flags) (eco-creature-flag ecf1)) + ) + (cond + ((ja-group-in-array? (-> self attack-anims)) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) (-> self attack-stop-frame)) + (let ((v1-17 (-> self nav))) + (set! (-> v1-17 target-speed) 0.0) + ) + 0 + (let ((v1-20 (-> self nav state))) + (set! (-> v1-20 speed) 0.0) + ) + 0 + (let ((v1-22 (-> self nav))) + (set! (-> v1-22 max-rotation-rate) 0.0) + ) + 0 + ) + (when (ja-done? 0) + (if (logtest? (-> self flags) (eco-creature-flag ecf1)) + (go-virtual victory) + (go-hostile self) + ) + ) + ) + ((logtest? (-> self flags) (eco-creature-flag ecf1)) + (go-virtual victory) + ) + (else + (go-hostile self) + ) + ) + ) + :code sleep-code + :post nav-enemy-chase-post + ) + +(defstate notice (prebot-large-eco-creature) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-best-state self) + ) + ) + +(defstate hostile (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when (and a0-1 (time-elapsed? (-> self state-time) (seconds 0.1))) + (let ((gp-1 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-1) 0) (-> self root trans)) + ) + ) + (if (and (< (vector-normalize-ret-len! gp-1 1.0) 18432.0) + (< (cos 5461.3335) (vector-dot gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + ) + (go-virtual attack) + ) + ) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-29 (ja-group))) + (when (not (and v1-29 (= v1-29 (-> self draw art-group data (-> self enemy-info hostile-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defstate circling (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy circling) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (nav-enemy-method-176 self) + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defstate pacing (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy pacing) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defstate stare (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! min) + ) + ) + (ja :num! (loop!)) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defstate victory (prebot-large-eco-creature) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (ja-no-eval :group! (-> self draw art-group data (-> self victory-anims (rand-vu-int-count (-> self victory-anims length)))) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +(defstate unfold (prebot-large-eco-creature) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (event-handler self proc argc message block) + ) + :enter (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + :trans (behavior () + (ja :num! (seek!)) + (if (ja-done? 0) + (go-best-state self) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate fly-to-dest (prebot-large-eco-creature) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (the-as object (-> block param 1)))) + (if (or (not (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-1) mask))) + (logand (penetrate + vehicle + dark-skin + dark-punch + dark-bomb + dark-smack + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + ) + (-> (the-as attack-info v1-1) penetrate-using) + ) + ) + (enemy-event-handler proc argc message block) + (send-event proc 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + ) + #f + ) + (('touch 'bonk) + (if (and (< (-> self which-trajectory) 2) (= proc *target*)) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + (event-handler self proc argc message block) + ) + #t + ) + (('set-dest) + (let ((s5-0 (the-as object (-> block param 0))) + (gp-0 (the-as object (-> block param 1))) + ) + (let ((f30-0 (the-as float (-> block param 2))) + (f28-0 (the-as float (-> block param 3))) + ) + (if (< (-> (the-as vector s5-0) y) (-> (the-as vector gp-0) y)) + (+! f30-0 (- (-> (the-as vector gp-0) y) (-> (the-as vector s5-0) y))) + ) + (let ((f0-15 (* 0.0000061035157 (vector-vector-xz-distance (the-as vector s5-0) (the-as vector gp-0)) f28-0))) + (setup-from-to-duration-and-height! (-> self traj) (the-as vector s5-0) (the-as vector gp-0) f0-15 f30-0) + ) + ) + (let ((v1-27 (new 'stack-no-clear 'vector))) + (vector-! v1-27 (the-as vector gp-0) (the-as vector s5-0)) + (set! (-> v1-27 y) 0.0) + (let ((f30-1 (atan (-> v1-27 x) (-> v1-27 z)))) + (quaternion-set! (-> self root quat) 0.0 (sin (* 0.5 f30-1)) 0.0 (cos (* 0.5 f30-1))) + ) + ) + (set! (-> self which-trajectory) 0) + (set! (-> self x-rotate) 0.0) + (set! (-> self y-rotate) 0.0) + (set! (-> self root trans quad) (-> (the-as vector s5-0) quad)) + (set! (-> self launch-pos quad) (-> (the-as vector s5-0) quad)) + (set! (-> self launch quad) (-> (the-as vector s5-0) quad)) + (let* ((v1-36 (-> self nav)) + (f0-25 (-> v1-36 extra-nav-sphere w)) + ) + (set! (-> v1-36 extra-nav-sphere quad) (-> (the-as vector gp-0) quad)) + (set! (-> v1-36 extra-nav-sphere w) f0-25) + ) + ) + 0 + (let ((v1-39 (-> self nav))) + (set! (-> v1-39 extra-nav-sphere w) 16384.0) + ) + 0 + (let ((v1-41 (-> self nav))) + (logior! (-> v1-41 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + (else + (if (> (-> self which-trajectory) 0) + (event-handler self proc argc message block) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (ja :group! (-> self draw art-group data 12) :num! min) + ) + :exit (behavior () + (quaternion-identity! (-> self spin-jm quat)) + (let ((v1-1 (-> self nav))) + (logclear! (-> v1-1 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + :trans (behavior () + (let ((v1-0 (-> self which-trajectory))) + (cond + ((zero? v1-0) + (sound-play "launch-trail" :id (-> self trail-sound) :position (-> self root trans)) + (logior! (-> self flags) (eco-creature-flag ecf4)) + (+! (-> self x-rotate) 4369.067) + (+! (-> self y-rotate) 3458.8445) + ) + ((= v1-0 1) + (when (logtest? (-> self flags) (eco-creature-flag ecf4)) + (sound-stop (-> self trail-sound)) + (logclear! (-> self flags) (eco-creature-flag ecf4)) + ) + (+! (-> self x-rotate) 7281.778) + (set! (-> self y-rotate) 0.0) + ) + (else + (seek! (-> self x-rotate) 65353.957 7281.778) + ) + ) + ) + (if (< 65536.0 (-> self x-rotate)) + (+! (-> self x-rotate) -65536.0) + ) + (if (< 65536.0 (-> self y-rotate)) + (+! (-> self y-rotate) -65536.0) + ) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-set! s5-0 (sin (* 0.5 (-> self x-rotate))) 0.0 0.0 (cos (* 0.5 (-> self x-rotate)))) + (quaternion-set! gp-0 0.0 (sin (* 0.5 (-> self y-rotate))) 0.0 (cos (* 0.5 (-> self y-rotate)))) + (quaternion-normalize! (quaternion*! (-> self spin-jm quat) gp-0 s5-0)) + ) + (cond + ((time-elapsed? (-> self state-time) (the int (-> self traj time))) + (let ((v1-34 (-> self which-trajectory))) + (cond + ((zero? v1-34) + (set! (-> self which-trajectory) 1) + (sound-play "caveco-land" :position (-> self root trans)) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (set-time! (-> self state-time)) + (let ((gp-3 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) + (set! (-> gp-3 y) 0.0) + (vector-normalize! gp-3 12288.0) + (vector+! gp-3 gp-3 (-> self root trans)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-3 75.0 4096.0) + ) + ) + ((= v1-34 1) + (set! (-> self which-trajectory) 2) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (set-time! (-> self state-time)) + (let ((gp-5 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) + (set! (-> gp-5 y) 0.0) + (vector-normalize! gp-5 4096.0) + (vector+! gp-5 gp-5 (-> self root trans)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-5 37.5 1024.0) + ) + ) + ((= v1-34 2) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (set! (-> self which-trajectory) 3) + (let* ((gp-6 (-> self state-time)) + (f30-0 300.0) + (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-77 (the-as number (logior #x3f800000 v1-76))) + ) + (set! (-> self state-time) (+ gp-6 (the int (* f30-0 (+ -1.0 (the-as float v1-77)))))) + ) + ) + (else + (go-virtual unfold) + ) + ) + ) + ) + ((< (-> self which-trajectory) 3) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (if (logtest? (-> self flags) (eco-creature-flag ecf3)) + (spawn-from-cspace (-> self trail-part) (-> self node-list data 3)) + ) + ) + ) + (ja :num! (loop! 0.2)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (logior! (-> self flags) (eco-creature-flag ecf3)) + (do-push-aways (-> self root)) + ) + ) + +(defmethod go-idle2 ((this prebot-large-eco-creature)) + (set! (-> this event-hook) (-> (method-of-object this fly-to-dest) event)) + (go (method-of-object this fly-to-dest)) + ) + +(defmethod init-enemy-collision! ((this prebot-large-eco-creature)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 16) 0))) + (set! (-> s5-0 total-prims) (the-as uint 17)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 26) + (set-vector! (-> s4-0 local-sphere) 1076.4288 -3118.6943 2700.0833 18061.312) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set-vector! (-> v1-14 local-sphere) 0.0 5734.4 0.0 8192.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) -26.2144 -2495.2832 378.88 4096.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly)) + (set! (-> v1-20 transform-index) 6) + (set-vector! (-> v1-20 local-sphere) -32.3584 281.8048 1412.7104 2940.109) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly)) + (set! (-> v1-22 transform-index) 9) + (set-vector! (-> v1-22 local-sphere) -12.288 84.3776 -2.4576 2387.5583) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly)) + (set! (-> v1-24 transform-index) 10) + (set-vector! (-> v1-24 local-sphere) 178.5856 -1004.3392 81.5104 2358.4768) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly)) + (set! (-> v1-26 transform-index) 18) + (set-vector! (-> v1-26 local-sphere) 0.0 0.0 0.0 2896.6912) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly)) + (set! (-> v1-28 transform-index) 19) + (set-vector! (-> v1-28 local-sphere) -130.2528 1489.7152 -119.1936 2784.8704) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid deadly)) + (set! (-> v1-30 transform-index) 28) + (set-vector! (-> v1-30 local-sphere) 0.0 0.0 0.0 2600.5503) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid deadly)) + (set! (-> v1-32 transform-index) 29) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 2296.6272) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid deadly)) + (set! (-> v1-34 transform-index) 30) + (set-vector! (-> v1-34 local-sphere) 82.7392 -43.008 -394.0352 1869.824) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid deadly)) + (set! (-> v1-36 transform-index) 31) + (set-vector! (-> v1-36 local-sphere) 151.9616 0.0 -608.256 1713.3568) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-38 prim-core action) (collide-action solid deadly)) + (set! (-> v1-38 transform-index) 33) + (set-vector! (-> v1-38 local-sphere) -1664.2048 -741.7856 -648.8064 3235.4304) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-40 prim-core action) (collide-action solid deadly)) + (set! (-> v1-40 transform-index) 35) + (set-vector! (-> v1-40 local-sphere) 1078.4768 509.1328 511.1808 3509.8623) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-42 prim-core action) (collide-action solid deadly)) + (set! (-> v1-42 transform-index) 37) + (set-vector! (-> v1-42 local-sphere) 791.7568 571.8016 355.9424 3460.3008) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-44 prim-core action) (collide-action solid deadly)) + (set! (-> v1-44 transform-index) 39) + (set-vector! (-> v1-44 local-sphere) -593.1008 -499.712 -635.6992 3313.2544) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-46 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-46 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-46 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod relocate ((this prebot-large-eco-creature) (offset int)) + (if (nonzero? (-> this spin-jm)) + (&+! (-> this spin-jm) offset) + ) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this prebot-large-eco-creature)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this trail-part)) + (kill-particles (-> this trail-part)) + ) + (when (logtest? (-> this flags) (eco-creature-flag ecf4)) + (sound-stop (-> this trail-sound)) + (logclear! (-> this flags) (eco-creature-flag ecf4)) + ) + (call-parent-method this) + (none) + ) + +(defmethod init-enemy! ((this prebot-large-eco-creature)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *prebot-large-eco-creature-nav-enemy-info*) + (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) + (let ((v1-8 (-> this neck))) + (set! (-> v1-8 up) (the-as uint 1)) + (set! (-> v1-8 nose) (the-as uint 2)) + (set! (-> v1-8 ear) (the-as uint 0)) + (set-vector! (-> v1-8 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-8 ignore-angle) 15473.777) + ) + (let ((v1-10 (-> this nav))) + (set! (-> v1-10 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (set! (-> this attack-anims) (new 'static 'boxed-array :type int32 8 9)) + (set! (-> this victory-anims) (new 'static 'boxed-array :type int32 10 11)) + (set! (-> this turn-left-anim) 6) + (set! (-> this turn-right-anim) 7) + (set! (-> this split-type) prebot-medium-eco-creature) + (set! (-> this attack-stop-frame) 0.0) + (set! (-> this which-trajectory) 0) + (set! (-> this spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this trail-part) (create-launch-control (-> *part-group-id-table* 440) this)) + (set! (-> this flags) (eco-creature-flag)) + (set! (-> this trail-sound) (new-sound-id)) + (send-event (ppointer->process (-> this parent)) 'start-critter) + 0 + (none) + ) + +(deftype prebot-medium-eco-creature (prebot-large-eco-creature) + ((is-top basic) + (is-bottom basic) + (initial-scale float) + (final-scale float) + ) + (:methods + (prebot-medium-eco-creature-method-196 (_type_) none) + (prebot-medium-eco-creature-method-197 (_type_) none) + ) + ) + + +(defbehavior large-eco-creature-split prebot-large-eco-creature () + (sound-play "caveco-spawn" :position (-> self root trans)) + (let ((gp-1 (new 'stack-no-clear 'enemy-init-by-other-params))) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (-> self root transv) + (set! (-> v1-2 quad) (-> self root trans quad)) + (set! (-> gp-1 trans quad) (-> v1-2 quad)) + ) + (quaternion-copy! (-> gp-1 quat) (-> self root quat)) + (set! (-> gp-1 entity) (-> self entity)) + (set! (-> gp-1 directed?) #f) + (set! (-> gp-1 no-initial-move-to-ground?) #f) + (set! (-> gp-1 art-level) (the-as level (-> self level name))) + (let* ((s5-1 (get-process *default-dead-pool* (-> self split-type) #x4000 1)) + (v1-9 (when s5-1 + (let ((t9-4 (method-of-type process activate))) + (t9-4 s5-1 self "eco-creature" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 enemy-init-by-other self gp-1) + (-> s5-1 ppointer) + ) + ) + ) + (when v1-9 + (set-vector! + (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0 incoming attack-direction) + (-> self incoming attack-direction z) + (-> self incoming attack-direction y) + (- (-> self incoming attack-direction x)) + 1.0 + ) + (set! (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0 incoming knocked-type) + (knocked-type blue-shot) + ) + (if (logtest? (-> self flags) (eco-creature-flag ecf2)) + (set! (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) flags) + (logior (-> (the-as prebot-large-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) flags) + (eco-creature-flag ecf2) + ) + ) + (logclear! + (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) flags) + (eco-creature-flag ecf2) + ) + ) + (prebot-medium-eco-creature-method-196 + (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) + ) + ) + ) + (let* ((s5-2 (get-process *default-dead-pool* (-> self split-type) #x4000 1)) + (v1-13 (when s5-2 + (let ((t9-8 (method-of-type process activate))) + (t9-8 s5-2 self "eco-creature" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 enemy-init-by-other self gp-1) + (-> s5-2 ppointer) + ) + ) + ) + (when v1-13 + (set-vector! + (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0 incoming attack-direction) + (- (-> self incoming attack-direction z)) + (-> self incoming attack-direction y) + (-> self incoming attack-direction x) + 1.0 + ) + (set! (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0 incoming knocked-type) + (knocked-type blue-shot) + ) + (if (logtest? (-> self flags) (eco-creature-flag ecf2)) + (logior! + (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0)) flags) + (eco-creature-flag ecf2) + ) + (logclear! + (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0)) flags) + (eco-creature-flag ecf2) + ) + ) + (prebot-medium-eco-creature-method-197 + (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0)) + ) + ) + ) + ) + (prebot-large-eco-creature-method-195 self) + 0 + (none) + ) + +(define *prebot-medium-eco-creature-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 15 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim 2 + :victory-anim 2 + :jump-wind-up-anim 2 + :jump-in-air-anim 2 + :jump-land-anim 2 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 49152.0 + :knocked-red-vy-lo 57344.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 40960.0 + :knocked-blue-vy-lo 20480.0 + :knocked-blue-vy-hi 53248.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 1.0 :w 35404.914) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8223.438) + :geo-tform (new 'static 'vector :x 1.0 :w 27181.492) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14248.819) + :geo-tform (new 'static 'vector :x -1.0 :w 10623.986) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 12262.859) + :geo-tform (new 'static 'vector :x 1.0 :w 33438.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.137 :z -0.9905 :w 11373.791) + :geo-tform (new 'static 'vector :x 0.2271 :y 0.9734 :z 0.0279 :w 36639.176) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5102 :z -0.86 :w 20530.754) + :geo-tform (new 'static 'vector :x 0.409 :y -0.0529 :z 0.9109 :w 32271.676) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6644 :z -0.7473 :w 1968.9199) + :geo-tform (new 'static 'vector :x 0.4093 :y 0.033 :z 0.9117 :w 33077.91) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9613 :z -0.2752 :w 2214.5525) + :geo-tform (new 'static 'vector :x 0.4059 :y -0.0481 :z 0.9126 :w 34502.54) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5153 :z 0.8569 :w 2080.0034) + :geo-tform (new 'static 'vector :x 0.4027 :y -0.0356 :z 0.9146 :w 32440.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.4859 :z 0.8739 :w 3273.5598) + :geo-tform (new 'static 'vector :x 0.414 :y 0.0464 :z 0.909 :w 29818.152) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8326 :z -0.5538 :w 3106.5886) + :geo-tform (new 'static 'vector :x 0.419 :y -0.032 :z 0.9073 :w 32459.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.9421 :z -0.3352 :w 6646.0605) + :geo-tform (new 'static 'vector :x 0.3914 :y -0.2 :z 0.8982 :w 37623.16) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3413 :z -0.9399 :w 1832.5868) + :geo-tform (new 'static 'vector :x 0.4204 :y -0.1424 :z 0.896 :w 38915.023) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1371 :z 0.9905 :w 11369.786) + :geo-tform (new 'static 'vector :x -0.2272 :y 0.9734 :z 0.0279 :w 28896.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5101 :z 0.86 :w 20534.176) + :geo-tform (new 'static 'vector :x -0.026 :y 0.9979 :z 0.0579 :w 23979.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6645 :z 0.7472 :w 1958.0337) + :geo-tform (new 'static 'vector :x 0.016 :y 0.9992 :z -0.0358 :w 23969.791) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9615 :z 0.2744 :w 2230.645) + :geo-tform (new 'static 'vector :x 0.0911 :y 0.9943 :z 0.0536 :w 24079.475) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5098 :z -0.8602 :w 2098.3352) + :geo-tform (new 'static 'vector :x -0.0178 :y 0.999 :z 0.0406 :w 24125.459) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 19 + :pre-tform (new 'static 'vector :x 0.4819 :z -0.8762 :w 3256.2107) + :geo-tform (new 'static 'vector :x -0.1538 :y 0.9868 :z -0.0491 :w 23956.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8364 :z 0.548 :w 3087.583) + :geo-tform (new 'static 'vector :x -0.017 :y 0.9991 :z 0.0369 :w 23745.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.9425 :z 0.3339 :w 6655.1807) + :geo-tform (new 'static 'vector :x 0.2492 :y 0.945 :z 0.2115 :w 24615.268) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3403 :z 0.9402 :w 1852.0657) + :geo-tform (new 'static 'vector :x 0.3178 :y 0.9363 :z 0.1493 :w 24121.836) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 20948.764) + :geo-tform (new 'static 'vector :x -1.0 :w 9182.285) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0068 :w 7387.509) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.003 :z -0.0014 :w 16198.405) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9697 :z -0.244 :w 191.6382) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4854 :z -0.8742 :w 21186.406) + :geo-tform (new 'static 'vector :x 0.6599 :y 0.6796 :z 0.3201 :w 35879.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0363 :w 2717.3774) + :geo-tform (new 'static 'vector :x 0.6708 :y 0.7057 :z 0.2277 :w 34044.242) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3584 :z -0.9335 :w 11286.792) + :geo-tform (new 'static 'vector :x -0.4444 :y 0.7119 :z -0.5437 :w 28463.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1147 :z -0.9933 :w 2024.0066) + :geo-tform (new 'static 'vector :x -0.5154 :y 0.6809 :z -0.5201 :w 27281.908) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4859 :z 0.8739 :w 21191.012) + :geo-tform (new 'static 'vector :x 0.1968 :y 0.4177 :z -0.8869 :w 17933.508) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z -0.0361 :w 2729.0828) + :geo-tform (new 'static 'vector :x 0.0825 :y 0.3055 :z -0.9485 :w 17459.846) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3588 :z 0.9333 :w 11281.3125) + :geo-tform (new 'static 'vector :x 0.2273 :y 0.5912 :z 0.7738 :w 23386.34) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1145 :z 0.9934 :w 2026.6462) + :geo-tform (new 'static 'vector :x 0.2996 :y 0.5792 :z 0.758 :w 21904.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + ) + ) + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 15 + :turn-anim -1 + :run-anim 15 + :taunt-anim -1 + :run-travel-speed (meters 5) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 3) + :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! (-> *prebot-medium-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defun prebot-eco-creature-joint-callback ((arg0 cspace) (arg1 transformq)) + (when (and (= (the-as float (-> arg0 param1)) 1.0) (= (-> arg0 param0) prebot-eco-creature-joint-callback)) + (let ((a2-1 arg0)) + (set! (-> a2-1 param0) cspace<-parented-transformq-joint!) + ) + ) + (set-vector! + (-> arg1 scale) + (the-as float (-> arg0 param1)) + (the-as float (-> arg0 param1)) + (the-as float (-> arg0 param1)) + 1.0 + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(defmethod prebot-medium-eco-creature-method-196 ((this prebot-medium-eco-creature)) + (set! (-> this is-top) (the-as basic #t)) + (let ((v1-2 (-> this node-list data 32))) + (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-2 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-4 (-> this node-list data 33))) + (set! (-> v1-4 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-4 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-6 (-> this node-list data 36))) + (set! (-> v1-6 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-6 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-8 (-> this node-list data 37))) + (set! (-> v1-8 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-8 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-10 (-> this node-list data 34))) + (set! (-> v1-10 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-10 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-12 (-> this node-list data 35))) + (set! (-> v1-12 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-12 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-14 (-> this node-list data 38))) + (set! (-> v1-14 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-14 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-16 (-> this node-list data 39))) + (set! (-> v1-16 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-16 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-18 (-> this node-list data 27))) + (set! (-> v1-18 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-18 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-20 (-> this node-list data 28))) + (set! (-> v1-20 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-20 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-22 (-> this node-list data 29))) + (set! (-> v1-22 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-22 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-24 (-> this node-list data 30))) + (set! (-> v1-24 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-24 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-26 (-> this node-list data 31))) + (set! (-> v1-26 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-26 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-28 (-> this node-list data 26))) + (set! (-> v1-28 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-28 param1) (the-as basic #x3e99999a)) + ) + 0 + (none) + ) + +(defmethod prebot-medium-eco-creature-method-197 ((this prebot-medium-eco-creature)) + (set! (-> this is-bottom) (the-as basic #t)) + (let ((v1-2 (-> this node-list data 4))) + (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-2 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-4 (-> this node-list data 5))) + (set! (-> v1-4 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-4 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-6 (-> this node-list data 6))) + (set! (-> v1-6 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-6 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-8 (-> this node-list data 7))) + (set! (-> v1-8 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-8 param1) (the-as basic #x3d23d70a)) + ) + 0 + (none) + ) + +(defmethod go-idle2 ((this prebot-medium-eco-creature)) + (set-vector! (-> this root scale) (-> this initial-scale) (-> this initial-scale) (-> this initial-scale) 1.0) + (go (method-of-object this knocked)) + ) + +(defmethod init-enemy-collision! ((this prebot-medium-eco-creature)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 12) 0))) + (set! (-> s5-0 total-prims) (the-as uint 13)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 26) + (set-vector! (-> s4-0 local-sphere) 532.48 -1556.48 1310.72 9011.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set-vector! (-> v1-14 local-sphere) 0.0 2867.2 0.0 4096.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) 0.0 -1228.8 204.8 2048.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly)) + (set! (-> v1-20 transform-index) 6) + (set-vector! (-> v1-20 local-sphere) 0.0 163.84 696.32 1474.56) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly)) + (set! (-> v1-22 transform-index) 28) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 1269.76) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly)) + (set! (-> v1-24 transform-index) 29) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 1146.88) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly)) + (set! (-> v1-26 transform-index) 30) + (set-vector! (-> v1-26 local-sphere) 40.96 0.0 -204.8 942.08) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly)) + (set! (-> v1-28 transform-index) 31) + (set-vector! (-> v1-28 local-sphere) 81.92 0.0 -286.72 860.16) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid deadly)) + (set! (-> v1-30 transform-index) 33) + (set-vector! (-> v1-30 local-sphere) -819.2 -368.64 -327.68 1597.44) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid deadly)) + (set! (-> v1-32 transform-index) 35) + (set-vector! (-> v1-32 local-sphere) 532.48 245.76 245.76 1761.28) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid deadly)) + (set! (-> v1-34 transform-index) 37) + (set-vector! (-> v1-34 local-sphere) 368.64 286.72 163.84 1720.32) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid deadly)) + (set! (-> v1-36 transform-index) 39) + (set-vector! (-> v1-36 local-sphere) -286.72 -245.76 -327.68 1638.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-38 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this prebot-medium-eco-creature)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *prebot-medium-eco-creature-nav-enemy-info*) + (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) + (let ((v1-8 (-> this neck))) + (set! (-> v1-8 up) (the-as uint 1)) + (set! (-> v1-8 nose) (the-as uint 2)) + (set! (-> v1-8 ear) (the-as uint 0)) + (set-vector! (-> v1-8 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-8 ignore-angle) 15473.777) + ) + (let ((v1-10 (-> this nav))) + (set! (-> v1-10 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (set! (-> this attack-anims) (new 'static 'boxed-array :type int32 14)) + (set! (-> this victory-anims) (new 'static 'boxed-array :type int32 10 11)) + (set! (-> this turn-left-anim) 6) + (set! (-> this turn-right-anim) 7) + (setup-masks (-> this draw) 0 2) + (set! (-> this is-top) #f) + (set! (-> this is-bottom) #f) + (set! (-> this initial-scale) 1.0) + (set! (-> this final-scale) 0.6) + (set! (-> this split-type) prebot-small-eco-creature) + (set! (-> this attack-stop-frame) 7.0) + (when (type? this medium-eco-creature-launched) + (set! (-> this spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this trail-part) (create-launch-control (-> *part-group-id-table* 440) this)) + (logclear! (-> this flags) (eco-creature-flag ecf3)) + ) + (set! (-> this flags) (eco-creature-flag)) + (send-event (ppointer->process (-> this parent)) 'start-critter) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defbehavior adjust-split-joints prebot-medium-eco-creature () + (cond + ((-> self is-top) + (let ((f0-2 (lerp-scale (-> self initial-scale) (-> self final-scale) (ja-aframe-num 0) 3.0 8.0))) + (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) + ) + (let ((f0-4 (lerp-scale 0.04 1.0 (ja-aframe-num 0) 2.0 7.0))) + (set! (-> self node-list data 32 param1) (the-as basic f0-4)) + (set! (-> self node-list data 33 param1) (the-as basic f0-4)) + (set! (-> self node-list data 36 param1) (the-as basic f0-4)) + (set! (-> self node-list data 37 param1) (the-as basic f0-4)) + (set! (-> self node-list data 34 param1) (the-as basic f0-4)) + (set! (-> self node-list data 35 param1) (the-as basic f0-4)) + (set! (-> self node-list data 38 param1) (the-as basic f0-4)) + (set! (-> self node-list data 39 param1) (the-as basic f0-4)) + (set! (-> self node-list data 27 param1) (the-as basic f0-4)) + (set! (-> self node-list data 28 param1) (the-as basic f0-4)) + (set! (-> self node-list data 29 param1) (the-as basic f0-4)) + (set! (-> self node-list data 30 param1) (the-as basic f0-4)) + (set! (-> self node-list data 31 param1) (the-as basic f0-4)) + (set! (-> self node-list data 26 param1) (the-as basic f0-4)) + ) + ) + (else + (let ((f0-7 (lerp-scale (-> self initial-scale) (-> self final-scale) (ja-aframe-num 0) 4.0 8.0))) + (set-vector! (-> self root scale) f0-7 f0-7 f0-7 1.0) + ) + (let ((f0-9 (lerp-scale 0.04 1.0 (ja-aframe-num 0) 3.0 7.0))) + (set! (-> self node-list data 4 param1) (the-as basic f0-9)) + (set! (-> self node-list data 5 param1) (the-as basic f0-9)) + (set! (-> self node-list data 6 param1) (the-as basic f0-9)) + (set! (-> self node-list data 7 param1) (the-as basic f0-9)) + ) + ) + ) + (none) + ) + +(defstate knocked-recover (prebot-medium-eco-creature) + :virtual #t + :code (behavior () + (cond + ((or (-> self is-top) (-> self is-bottom)) + (let ((gp-0 (if (-> self is-top) + (-> self draw art-group data 4) + (-> self draw art-group data 5) + ) + ) + ) + (cond + ((handle->process (-> self ragdoll-proc)) + (ja-channel-push! 1 0) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (adjust-split-joints) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (adjust-split-joints) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (set! (-> self is-top) #f) + (set! (-> self is-bottom) #f) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + (else + (let ((t9-14 (-> (method-of-type prebot-large-eco-creature knocked-recover) code))) + (if t9-14 + ((the-as (function none) t9-14)) + ) + ) + ) + ) + ) + ) + +(deftype prebot-small-eco-creature (prebot-medium-eco-creature) + () + ) + + +(define *prebot-small-eco-creature-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 19 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim 2 + :victory-anim 2 + :jump-wind-up-anim 2 + :jump-in-air-anim 2 + :jump-land-anim 2 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-die (static-sound-name "caveco-death") + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 32768.0 + :knocked-red-vxz-hi 57344.0 + :knocked-red-vy-lo 65536.0 + :knocked-red-vy-hi 77824.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 61440.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 1.0 :w 35404.914) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8223.438) + :geo-tform (new 'static 'vector :x 1.0 :w 27181.492) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14248.819) + :geo-tform (new 'static 'vector :x -1.0 :w 10623.986) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 12262.859) + :geo-tform (new 'static 'vector :x 1.0 :w 33438.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.137 :z -0.9905 :w 11373.791) + :geo-tform (new 'static 'vector :x 0.2271 :y 0.9734 :z 0.0279 :w 36639.176) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5102 :z -0.86 :w 20530.754) + :geo-tform (new 'static 'vector :x 0.409 :y -0.0529 :z 0.9109 :w 32271.676) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6644 :z -0.7473 :w 1968.9199) + :geo-tform (new 'static 'vector :x 0.4093 :y 0.033 :z 0.9117 :w 33077.91) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9613 :z -0.2752 :w 2214.5525) + :geo-tform (new 'static 'vector :x 0.4059 :y -0.0481 :z 0.9126 :w 34502.54) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5153 :z 0.8569 :w 2080.0034) + :geo-tform (new 'static 'vector :x 0.4027 :y -0.0356 :z 0.9146 :w 32440.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.4859 :z 0.8739 :w 3273.5598) + :geo-tform (new 'static 'vector :x 0.414 :y 0.0464 :z 0.909 :w 29818.152) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8326 :z -0.5538 :w 3106.5886) + :geo-tform (new 'static 'vector :x 0.419 :y -0.032 :z 0.9073 :w 32459.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.9421 :z -0.3352 :w 6646.0605) + :geo-tform (new 'static 'vector :x 0.3914 :y -0.2 :z 0.8982 :w 37623.16) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3413 :z -0.9399 :w 1832.5868) + :geo-tform (new 'static 'vector :x 0.4204 :y -0.1424 :z 0.896 :w 38915.023) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1371 :z 0.9905 :w 11369.786) + :geo-tform (new 'static 'vector :x -0.2272 :y 0.9734 :z 0.0279 :w 28896.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5101 :z 0.86 :w 20534.176) + :geo-tform (new 'static 'vector :x -0.026 :y 0.9979 :z 0.0579 :w 23979.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6645 :z 0.7472 :w 1958.0337) + :geo-tform (new 'static 'vector :x 0.016 :y 0.9992 :z -0.0358 :w 23969.791) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9615 :z 0.2744 :w 2230.645) + :geo-tform (new 'static 'vector :x 0.0911 :y 0.9943 :z 0.0536 :w 24079.475) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5098 :z -0.8602 :w 2098.3352) + :geo-tform (new 'static 'vector :x -0.0178 :y 0.999 :z 0.0406 :w 24125.459) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 19 + :pre-tform (new 'static 'vector :x 0.4819 :z -0.8762 :w 3256.2107) + :geo-tform (new 'static 'vector :x -0.1538 :y 0.9868 :z -0.0491 :w 23956.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8364 :z 0.548 :w 3087.583) + :geo-tform (new 'static 'vector :x -0.017 :y 0.9991 :z 0.0369 :w 23745.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.9425 :z 0.3339 :w 6655.1807) + :geo-tform (new 'static 'vector :x 0.2492 :y 0.945 :z 0.2115 :w 24615.268) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3403 :z 0.9402 :w 1852.0657) + :geo-tform (new 'static 'vector :x 0.3178 :y 0.9363 :z 0.1493 :w 24121.836) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 20948.764) + :geo-tform (new 'static 'vector :x -1.0 :w 9182.285) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0068 :w 7387.509) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.003 :z -0.0014 :w 16198.405) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9697 :z -0.244 :w 191.6382) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4854 :z -0.8742 :w 21186.406) + :geo-tform (new 'static 'vector :x 0.6599 :y 0.6796 :z 0.3201 :w 35879.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0363 :w 2717.3774) + :geo-tform (new 'static 'vector :x 0.6708 :y 0.7057 :z 0.2277 :w 34044.242) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3584 :z -0.9335 :w 11286.792) + :geo-tform (new 'static 'vector :x -0.4444 :y 0.7119 :z -0.5437 :w 28463.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1147 :z -0.9933 :w 2024.0066) + :geo-tform (new 'static 'vector :x -0.5154 :y 0.6809 :z -0.5201 :w 27281.908) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4859 :z 0.8739 :w 21191.012) + :geo-tform (new 'static 'vector :x 0.1968 :y 0.4177 :z -0.8869 :w 17933.508) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z -0.0361 :w 2729.0828) + :geo-tform (new 'static 'vector :x 0.0825 :y 0.3055 :z -0.9485 :w 17459.846) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3588 :z 0.9333 :w 11281.3125) + :geo-tform (new 'static 'vector :x 0.2273 :y 0.5912 :z 0.7738 :w 23386.34) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1145 :z 0.9934 :w 2026.6462) + :geo-tform (new 'static 'vector :x 0.2996 :y 0.5792 :z 0.758 :w 21904.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + ) + ) + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 19 + :turn-anim -1 + :run-anim 19 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 6) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *prebot-small-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod init-enemy-collision! ((this prebot-small-eco-creature)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 12) 0))) + (set! (-> s5-0 total-prims) (the-as uint 13)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 26) + (set-vector! (-> s4-0 local-sphere) 532.48 -1556.48 1310.72 9011.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set-vector! (-> v1-14 local-sphere) 0.0 2867.2 0.0 4096.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) 0.0 -1228.8 204.8 2048.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly)) + (set! (-> v1-20 transform-index) 6) + (set-vector! (-> v1-20 local-sphere) 0.0 163.84 696.32 1474.56) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly)) + (set! (-> v1-22 transform-index) 28) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 1269.76) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly)) + (set! (-> v1-24 transform-index) 29) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 1146.88) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly)) + (set! (-> v1-26 transform-index) 30) + (set-vector! (-> v1-26 local-sphere) 40.96 0.0 -204.8 942.08) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly)) + (set! (-> v1-28 transform-index) 31) + (set-vector! (-> v1-28 local-sphere) 81.92 0.0 -286.72 860.16) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid deadly)) + (set! (-> v1-30 transform-index) 33) + (set-vector! (-> v1-30 local-sphere) -819.2 -368.64 -327.68 1597.44) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid deadly)) + (set! (-> v1-32 transform-index) 35) + (set-vector! (-> v1-32 local-sphere) 532.48 245.76 245.76 1761.28) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid deadly)) + (set! (-> v1-34 transform-index) 37) + (set-vector! (-> v1-34 local-sphere) 368.64 286.72 163.84 1720.32) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid deadly)) + (set! (-> v1-36 transform-index) 39) + (set-vector! (-> v1-36 local-sphere) -286.72 -245.76 -327.68 1638.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-38 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this prebot-small-eco-creature)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *prebot-small-eco-creature-nav-enemy-info*) + (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) + (let ((v1-8 (-> this neck))) + (set! (-> v1-8 up) (the-as uint 1)) + (set! (-> v1-8 nose) (the-as uint 2)) + (set! (-> v1-8 ear) (the-as uint 0)) + (set-vector! (-> v1-8 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-8 ignore-angle) 15473.777) + ) + (let ((v1-10 (-> this nav))) + (set! (-> v1-10 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (set! (-> this attack-anims) (new 'static 'boxed-array :type int32 18)) + (set! (-> this victory-anims) (new 'static 'boxed-array :type int32 10 11)) + (set! (-> this turn-left-anim) 16) + (set! (-> this turn-right-anim) 17) + (setup-masks (-> this draw) 0 2) + (set! (-> this is-top) #f) + (set! (-> this is-bottom) #f) + (set! (-> this initial-scale) 0.6) + (set! (-> this final-scale) 0.4) + (set! (-> this split-type) #f) + (set! (-> this attack-stop-frame) 10.0) + (when (type? this small-eco-creature-launched) + (set! (-> this spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this trail-part) (create-launch-control (-> *part-group-id-table* 440) this)) + (logclear! (-> this flags) (eco-creature-flag ecf3)) + ) + (set! (-> this flags) (eco-creature-flag)) + (send-event (ppointer->process (-> this parent)) 'start-critter) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + ) + (transform-post) + 0 + (none) + ) + +(deftype medium-eco-creature-launched (prebot-medium-eco-creature) + () + ) + + +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! ((this medium-eco-creature-launched)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (none) + ) + +(defmethod go-idle2 ((this medium-eco-creature-launched)) + ((method-of-type prebot-large-eco-creature go-idle2) this) + ) + +(deftype small-eco-creature-launched (prebot-small-eco-creature) + () + ) + + +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! ((this small-eco-creature-launched)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (none) + ) + +(defmethod go-idle2 ((this small-eco-creature-launched)) + ((method-of-type prebot-large-eco-creature go-idle2) this) + ) + +(deftype large-eco-creature (prebot-large-eco-creature) + () + ) + + +(defmethod go-idle2 ((this large-eco-creature)) + ((method-of-type nav-enemy go-idle2) this) + ) + +;; WARN: Return type mismatch eco-creature-flag vs none. +(defmethod init-enemy! ((this large-eco-creature)) + (call-parent-method this) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (none) + ) + +(deftype medium-eco-creature (prebot-medium-eco-creature) + () + ) + + +(defmethod go-idle2 ((this medium-eco-creature)) + ((method-of-type nav-enemy go-idle2) this) + ) + +;; WARN: Return type mismatch eco-creature-flag vs none. +(defmethod init-enemy! ((this medium-eco-creature)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (none) + ) + +(deftype small-eco-creature (prebot-small-eco-creature) + () + ) + + +(defmethod go-idle2 ((this small-eco-creature)) + ((method-of-type nav-enemy go-idle2) this) + ) + +;; WARN: Return type mismatch eco-creature-flag vs none. +(defmethod init-enemy! ((this small-eco-creature)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (none) + ) diff --git a/goal_src/jak3/levels/common/enemy/roboguard.gc b/goal_src/jak3/levels/common/enemy/roboguard.gc index 833775d056..60ba2bdde1 100644 --- a/goal_src/jak3/levels/common/enemy/roboguard.gc +++ b/goal_src/jak3/levels/common/enemy/roboguard.gc @@ -5,5 +5,1756 @@ ;; name in dgo: roboguard ;; dgos: SEA, FACC, FACD +;; +++roboguard-flag +(defenum roboguard-flag + :type uint16 + :bitfield #t + (rf0 0) + (rf1 1) + (rf2 2) + ) +;; ---roboguard-flag + + ;; DECOMP BEGINS +(defpartgroup group-roboguard-armor-explode + :id 223 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 810) (sp-item 812) (sp-item 814)) + ) + +(deftype roboguard (nav-enemy) + ((los los-control :inline) + (rotation-matrix matrix :inline) + (upper-rotation-matrix matrix :inline) + (fire-at-pos vector :inline) + (formation-position vector :inline) + (focus-formation-source vector :inline) + (me-to-focus-dir vector :inline) + (me-to-focus-angle float) + (flags roboguard-flag) + (torso-aim-blend float) + (torso-angle float) + (torso-seek-speed float) + (torso-to-focus-angle float) + (last-torso-frame-num float) + (stand-angle-threshold float) + (arm-rot-mult float 2) + (arm-rot degrees 2) + (fire-time time-frame) + (fire-count uint32) + (last-attack-time time-frame) + (update-focus-pos symbol) + (formation-angle-sign float) + (last-hit-points int32) + ) + (:state-methods + hostile-stand + close-attack + shoot-attack + explode + ) + (:methods + (roboguard-method-194 (_type_ vector float) symbol) + (roboguard-method-195 (_type_) none) + (roboguard-method-196 (_type_ int) none) + ) + ) + + +(defskelgroup skel-roboguard roboguard roboguard-lod0-jg roboguard-idle0-ja + ((roboguard-lod0-mg (meters 20)) (roboguard-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow roboguard-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-roboguard-explode roboguard roboguard-explode-lod0-jg roboguard-explode-idle-ja + ((roboguard-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *roboguard-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 24) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 27) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 4) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(define *roboguard-explode-joints* (new 'static 'boxed-array :type int32 0 10 19 9 14 22 13 6)) + +(define *roboguard-debris-array-params* + (new 'static 'boxed-array :type debris-static-params + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + ) + ) + +(dotimes (v1-27 (-> *roboguard-debris-array-params* length)) + (set! (-> *roboguard-debris-array-params* v1-27 joints 0 parent-joint-index) + (-> *roboguard-explode-joints* (+ v1-27 1)) + ) + ) + +(set! (-> *lightning-spec-id-table* 17) (new 'static 'lightning-spec + :name "lightning-shock-roboguard" + :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 + :fade-time 15.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 819.2 + :duration 90.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +(set! (-> *lightning-spec-id-table* 18) (new 'static 'lightning-spec + :name "lightning-awe-roboguard" + :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 + :fade-time 15.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 90.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +(define *fact-info-roboguard-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 48 :pickup-amount 10.0) + ) + +(define *roboguard-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script #f + :idle-anim 5 + :notice-anim -1 + :hostile-anim 14 + :hit-anim 5 + :knocked-anim 27 + :knocked-land-anim 28 + :die-anim 18 + :die-falling-anim 29 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint -1 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 50) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 61440.0 + :knocked-soft-vy-lo 49152.0 + :knocked-soft-vy-hi 65536.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 73728.0 + :knocked-hard-vxz-hi 114688.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 73728.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 20480.0 + :knocked-yellow-vxz-hi 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 4096.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 114688.0 + :knocked-red-vy-lo 53248.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 13 + :turn-anim 4 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 16) + :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! (-> *roboguard-nav-enemy-info* fact-defaults) *fact-info-roboguard-defaults*) + +(defpart 913 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 40)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 914 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 915 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defmethod init-enemy-collision! ((this roboguard)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy camera-blocker los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 12288.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 enemy)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 12697.6 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core action) (collide-action)) + (set! (-> v1-16 transform-index) 11) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 0.0 11468.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defbehavior roboguard-turn-torso-post roboguard () + (seek! (-> self torso-aim-blend) 1.0 (* 5.0 (seconds-per-frame))) + (let ((v1-3 (joint-node roboguard-lod0-jg chest)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) + (set! (-> gp-0 y) 0.0) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! gp-0 1.0) + (vector-xz-normalize! s5-1 1.0) + (set! (-> self torso-to-focus-angle) (acos (vector-dot gp-0 s5-1))) + ) + ) + (if (>= 2730.6667 (-> self torso-to-focus-angle)) + (seek! (-> self torso-seek-speed) 0.0 (* 54613.332 (seconds-per-frame))) + (seek! (-> self torso-seek-speed) 43690.668 (* 72817.78 (seconds-per-frame))) + ) + (nav-enemy-simple-post) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior roboguard-turret-code roboguard () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! roboguard-idle-shoot0-loop-ja :num! zero) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((gp-1 + (lambda ((arg0 roboguard) (arg1 symbol)) + (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 + 1.0 + -1.0 + ) + ) + ) + ) + ) + (f30-0 (-> self stand-angle-threshold)) + ) + (until #f + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-20 (if (< 0.0 (-> self me-to-focus-angle)) + 7 + 9 + ) + ) + (s5-1 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-20) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-1) + (suspend) + (ja :num! (seek!)) + ) + ) + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-40 (if (< 0.0 (-> self me-to-focus-angle)) + 8 + 10 + ) + ) + (s5-3 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-40) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-3) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + (none) + ) + +(defstate idle (roboguard) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)) :frame-num 2.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)) :frame-num 3.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)) :frame-num 4.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)) :frame-num 5.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 7.0 0.07) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0 0.07)) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 8.0 0.07) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0 0.07)) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 9.0 0.07) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 9.0 0.07)) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)) :frame-num 9.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05))) + ) + ) + #f + ) + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set-time! (-> self last-draw-time)) + ) + (update-focus self) + (ja-post) + ) + ) + +(defstate notice (roboguard) + :virtual #t + :exit (behavior () + (set! (-> self formation-position quad) (-> self root trans quad)) + (let ((t9-0 (-> (method-of-type nav-enemy notice) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (ja-no-eval :group! roboguard-notice-jump-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (vector-! gp-0 (target-pos 0) (-> self root trans)) + (seek-toward-heading-vec! (-> self root) gp-0 131072.0 (seconds 0.05)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (ja-no-eval :group! roboguard-notice-land-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +(defstate stare (roboguard) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self stand-angle-threshold) 9102.223) + ) + :code roboguard-turret-code + :post roboguard-turn-torso-post + ) + +(defstate hostile (roboguard) + :virtual #t + :exit (behavior () + (let ((v1-0 (-> self nav))) + (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (cond + ((< (vector-vector-xz-distance (-> self root trans) (-> self formation-position)) 8192.0) + (go-virtual hostile-stand) + ) + ((and (< (fabs (-> self torso-to-focus-angle)) 3640.889) + (and (get-focus! self) (>= 24576.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)))) + ) + (go-virtual close-attack) + ) + ) + ) + ) + :post (behavior () + (seek! (-> self torso-aim-blend) 0.0 (seconds-per-frame)) + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (roboguard-method-195 self) + (let ((a0-4 (-> self nav state)) + (v1-8 (-> self formation-position)) + ) + (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-4 target-pos quad) (-> v1-8 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +(defstate hostile-stand (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self stand-angle-threshold) 9102.223) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + ) + :exit (behavior () + (nav-enemy-method-179 self) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (ja-done? 0)) + (if (or (and (< 65536.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (< 2048.0 (vector-vector-xz-distance (-> self root trans) (-> self formation-position))) + ) + (< 14336.0 (vector-vector-xz-distance (-> self root trans) (-> self formation-position))) + ) + (go-virtual hostile) + ) + (when (and (time-elapsed? (-> self state-time) (seconds 0.3)) + (and (< (fabs (-> self torso-to-focus-angle)) 3640.889) (get-focus! self)) + ) + (cond + ((>= 24576.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos))) + (go-virtual close-attack) + ) + ((should-check-los? (-> self los) (seconds 0.4)) + (go-virtual shoot-attack) + ) + ) + ) + ) + ) + :code roboguard-turret-code + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (roboguard-method-195 self) + (roboguard-turn-torso-post) + ) + ) + +(defstate close-attack (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-time! (-> self fire-time)) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + ) + :exit (behavior () + (nav-enemy-method-179 self) + ) + :code (behavior () + (let ((f30-0 + (lerp-scale 0.0 1.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 12288.0 20480.0) + ) + ) + (ja-channel-push! 2 (seconds 0.3)) + (ja-no-eval :group! roboguard-punch-close-rotate-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-punch-far-rotate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (seek-to-point-toward-point! + (-> self root) + (-> self focus-pos) + (* 1.2 (-> self nav max-rotation-rate)) + (seconds 0.02) + ) + (seek! (-> self torso-aim-blend) 0.0 (* 3.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + (let ((f28-0 8192.0)) + (let* ((a0-10 (-> self root root-prim)) + (v1-53 (-> (the-as collide-shape-prim-group a0-10) child 2)) + ) + (+! (-> a0-10 local-sphere w) f28-0) + (set! (-> v1-53 prim-core action) (collide-action solid deadly)) + (set! (-> v1-53 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-53 prim-core collide-with) (collide-spec jak bot obstacle player-list)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! roboguard-punch-close-go-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-punch-far-go-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek! max 1.2)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! roboguard-punch-close-hold-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-punch-far-hold-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek! max 4.0)) + ) + (let* ((v1-147 (-> self root root-prim)) + (a0-26 (-> (the-as collide-shape-prim-group v1-147) child 2)) + ) + (set! (-> v1-147 local-sphere w) (- (-> v1-147 local-sphere w) f28-0)) + (set! (-> a0-26 prim-core action) (collide-action)) + (set! (-> a0-26 prim-core collide-as) (collide-spec)) + (set! (-> a0-26 prim-core collide-with) (collide-spec)) + ) + ) + ) + 0 + (go-virtual hostile-stand) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (nav-enemy-simple-post) + ) + ) + +(defstate shoot-attack (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self fire-time) (+ (current-time) (seconds -0.4))) + (set! (-> self fire-count) (the-as uint 0)) + (set! (-> self last-torso-frame-num) 0.0) + (set! (-> self stand-angle-threshold) 16384.0) + (set! (-> self update-focus-pos) #f) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + ) + :exit (behavior () + (when (> (-> self skel float-channels) 0) + (let ((a0-1 (joint-control-method-12 (-> self skel) 0))) + (joint-channel-float-delete! a0-1) + ) + ) + (set! (-> self update-focus-pos) #t) + (nav-enemy-method-179 self) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) (zero? (-> self skel float-channels))) + (if (or (= (-> self fire-count) 8) (los-control-method-11 (-> self los) (seconds 0.1))) + (go-virtual hostile-stand) + ) + (let ((f0-0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)))) + (if (>= 24576.0 f0-0) + (go-virtual close-attack) + ) + ) + (let ((v1-22 (ja-channel-float! (the-as art-joint-anim roboguard-idle-shoot0-loop-ja) 0.0 1.0 0.0))) + (when v1-22 + (set! (-> self skel interp-select 0) #x1bbf8) + (set! (-> self skel interp-select 1) 0) + (set! (-> v1-22 param 0) 1.0) + (set! (-> v1-22 param 1) 1.0) + (set! (-> v1-22 param 2) 2.0) + (set! (-> v1-22 num-func) num-func-interp1-play!) + ) + ) + (set-time! (-> self fire-time)) + ) + (let ((gp-0 (joint-control-method-12 (-> self skel) 0))) + (when gp-0 + (let ((f1-1 (-> gp-0 frame-num)) + (f0-4 (-> self last-torso-frame-num)) + ) + (cond + ((and (< 0.5 f1-1) (>= 0.5 f0-4)) + (roboguard-method-196 self 11) + ) + ((and (< 3.0 f1-1) (>= 3.0 f0-4)) + (roboguard-method-196 self 15) + ) + ) + ) + (set! (-> self last-torso-frame-num) (-> gp-0 frame-num)) + ) + ) + ) + :code roboguard-turret-code + :post (behavior () + (seek! (-> self arm-rot-mult 0) 1.0 (* 30.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 1.0 (* 30.0 (seconds-per-frame))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self focus-pos)))) + (let ((s5-0 vector-normalize!) + (s4-0 gp-1) + (f0-8 -8192.0) + (v1-7 gp-1) + ) + (s5-0 s4-0 (fmin + (+ f0-8 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z))))) + (lerp-scale 0.0 32768.0 (the float (- (current-time) (-> self state-time))) 600.0 60.0) + ) + ) + ) + (vector+! (-> self fire-at-pos) (-> self focus-pos) gp-1) + ) + 0 + (let ((gp-2 + (lambda :behavior roboguard + ((arg0 int) (arg1 int) (arg2 float)) + (let* ((s5-0 (-> self node-list data arg0)) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) + ) + (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 bone transform uvec) -1.0) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (vector-! (-> s5-1 rvec) (-> self fire-at-pos) v1-2) + (set! (-> s5-1 uvec quad) (-> s5-1 rvec quad)) + (set! (-> s5-1 uvec y) 0.0) + (vector-normalize! (-> s5-1 uvec) 1.0) + (vector-normalize-copy! (-> s5-1 fvec) (-> s5-1 rvec) 1.0) + (vector-flatten! (-> s5-1 fvec) (-> s5-1 fvec) (the-as vector (-> self upper-rotation-matrix))) + (set! (-> self arm-rot-mult arg1) + (* (-> self arm-rot-mult arg1) (vector-dot (-> s5-1 uvec) (-> self upper-rotation-matrix fvec))) + ) + (let ((f0-6 (* arg2 (acos (vector-dot (-> s5-1 fvec) (-> self upper-rotation-matrix fvec)))))) + (set! (-> self arm-rot arg1) + (seek + (-> self arm-rot arg1) + (fmax -8192.0 (fmin 13653.333 (if (< 0.0 (vector-dot (-> s5-1 fvec) *y-vector*)) + (- f0-6) + f0-6 + ) + ) + ) + (* 65536.0 (seconds-per-frame)) + ) + ) + ) + ) + ) + ) + ) + ) + (gp-2 11 0 1.0) + (gp-2 15 1 1.0) + ) + (roboguard-turn-torso-post) + ) + ) + +(defstate knocked (roboguard) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 (- (-> self last-hit-points) (the int (-> self hit-points)))) + (let ((s5-0 (enemy-method-131 self 8 (the-as int (logior (-> self draw seg-mask) 1))))) + (when (> s5-0 0) + (let ((a1-2 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-2 hit-xz-reaction) 0.5) + (set! (-> a1-2 hit-y-reaction) 0.3) + (set! (-> a1-2 fountain-rand-transv-lo quad) (-> self root root-prim prim-core world-sphere quad)) + (let ((s3-0 (-> *roboguard-debris-array-params* (+ s5-0 -1)))) + (debris-spawn self a1-2 s3-0 (the-as process-drawable #f)) + (cond + ((logtest? (-> *part-group-id-table* 223 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + quad + ) + ) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 223)) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + quad + ) + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 223)) + ) + ) + ) + ) + (setup-masks (-> self draw) 0 (ash 1 s5-0)) + ) + ) + ) + (set! (-> self last-hit-points) (the int (-> self hit-points))) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (let ((t9-2 (-> (method-of-type nav-enemy knocked) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +(defstate knocked-recover (roboguard) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (let ((t9-2 (-> (method-of-type nav-enemy knocked-recover) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +(defstate die (roboguard) + :virtual #t + :enter (behavior () + (on-dying self) + (set-time! (-> self state-time)) + (set! (-> self hit-points) 0.0) + ) + :code (behavior () + (when (!= (-> self incoming knocked-type) (knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! roboguard-death-standing-ja + :num! (seek! (ja-aframe 20.0 0) 1.5) + :frame-num (ja-aframe 13.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0) 1.5)) + ) + ) + (go-virtual explode) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (let ((t9-2 (-> (method-of-type nav-enemy die) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +(defstate explode (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (sound-play "robo-explode") + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (send-event self 'death-start) + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((v1-14 (-> gp-1 fountain-rand-transv-lo))) + (let ((a0-8 (-> self root trans))) + (let ((a1-3 *up-vector*)) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-8 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-14 quad) vf6) + ) + (set! (-> s5-1 quad) (-> self incoming attack-direction quad)) + (vector-normalize-copy! (-> gp-1 fountain-rand-transv-lo) s5-1 -20480.0) + (vector-normalize-copy! (-> gp-1 fountain-rand-transv-hi) s5-1 122880.0) + ) + (set! (-> gp-1 fountain-rand-transv-lo y) 40960.0) + (set! (-> gp-1 fountain-rand-transv-hi y) 81920.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-roboguard-explode" (the-as (pointer level) #f)) + 35 + gp-1 + *roboguard-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((v1-25 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + ) + ) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defmethod roboguard-method-194 ((this roboguard) (arg0 vector) (arg1 float)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> arg0 quad)) + (set! (-> a1-1 w) arg1) + (and (not (add-root-sphere-to-hash! (-> this nav) a1-1 #x100068)) + (let ((a0-5 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) arg0))) + (< (vector-x-angle a0-5) 5461.3335) + ) + (let ((s3-0 (-> this nav)) + (s2-0 (-> this focus-pos)) + (s4-0 (new 'stack 'nav-find-poly-parms)) + ) + (vector-! (-> s4-0 point) s2-0 (the-as vector (-> s3-0 state mesh bounds))) + (set! (-> s4-0 y-threshold) (-> s3-0 nearest-y-threshold)) + (set! (-> s4-0 ignore) (the-as uint 2)) + (nav-mesh-method-46 (-> s3-0 state mesh) (the-as nav-poly s4-0)) + (let ((s4-1 (-> s4-0 poly)) + (s3-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this focus-pos))) + (s5-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (or (not s4-1) (begin + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this focus-pos) s4-1 s3-2 s5-1) + (not (-> s5-1 found-boundary)) + ) + ) + ) + ) + ) + ) + ) + +(define *roboguard-formation-table* (new 'static 'boxed-array :type float + 0.0 + 1820.4445 + 3640.889 + 5461.3335 + -1820.4445 + -3640.889 + -5461.3335 + 7281.778 + 9102.223 + 10922.667 + -7281.778 + -9102.223 + -10922.667 + 12743.111 + 14563.556 + 16384.0 + -12743.111 + -14563.556 + -16384.0 + 18204.445 + 20024.889 + 21845.334 + -18204.445 + -20024.889 + -21845.334 + 23665.777 + 25486.223 + 27306.666 + -23665.777 + -25486.223 + -27306.666 + 29127.111 + 30947.555 + 32768.0 + -29127.111 + -30947.555 + ) + ) + +(defmethod roboguard-method-195 ((this roboguard)) + (when (or (< 8192.0 (vector-vector-xz-distance (-> this focus-pos) (-> this focus-formation-source))) + (let ((f0-1 (vector-vector-distance (-> this formation-position) (-> this focus-formation-source))) + (f1-0 40960.0) + (f2-0 65536.0) + ) + (or (>= f1-0 f0-1) (>= f0-1 f2-0)) + ) + (not (roboguard-method-194 this (-> this formation-position) 9011.2)) + ) + (set! (-> this focus-formation-source quad) (-> this focus-pos quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this formation-position) (-> this focus-formation-source))) + ) + (when (< 0.0 (vector-length s4-1)) + (set! (-> s4-1 y) 0.0) + (dotimes (s3-0 (-> *roboguard-formation-table* length)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector-normalize-copy! s1-0 s4-1 1.0) + (vector-rotate-y! s1-0 s1-0 (* (-> this formation-angle-sign) (-> *roboguard-formation-table* s3-0))) + (vector-normalize! s1-0 53248.0) + (vector+! s2-0 (-> this focus-formation-source) s1-0) + (when (and (closest-point-on-mesh (-> this nav) s2-0 s2-0 (the-as nav-poly #f)) + (roboguard-method-194 this s2-0 9011.2) + ) + (set! (-> s5-0 quad) (-> s2-0 quad)) + #t + (goto cfg-26) + ) + ) + ) + ) + ) + (label cfg-26) + (set! (-> this formation-angle-sign) (* -1.0 (-> this formation-angle-sign))) + (set! (-> this formation-position quad) (-> s5-0 quad)) + ) + ) + 0 + (none) + ) + +(defmethod roboguard-method-196 ((this roboguard) (arg0 int)) + (let* ((s5-0 (-> this node-list data arg0)) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) + (a3-1 (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 bone transform uvec) -1.0)) + ) + (spawn-guard-projectile + this + v1-2 + (vector+! (new 'stack-no-clear 'vector) v1-2 a3-1) + 819200.0 + (the-as vector #f) + ) + ) + (sound-play "robo-fire" :position (-> this root trans)) + (+! (-> this fire-count) 1) + 0 + (none) + ) + +(defmethod knocked-anim ((this roboguard) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 0) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) + ) + ) + (else + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 29))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 29)) 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 (-> this draw art-group data 29)) num-func-seek!) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this roboguard) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 28))) + (set! (-> v1-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 28)) frames num-frames) -1)) + ) + (set! (-> v1-4 param 1) (-> arg0 anim-speed)) + (set! (-> v1-4 frame-num) 0.0) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 28)) num-func-seek!) + ) + ) + (else + (let ((v1-8 (-> this skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + (set! (-> v1-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) + ) + (set! (-> v1-8 param 1) (-> arg0 anim-speed)) + (set! (-> v1-8 frame-num) 0.0) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) + ) + ) + ) + #t + ) + +;; WARN: Return type mismatch int vs penetrate. +(defmethod get-penetrated-by ((this roboguard)) + (the-as penetrate 0) + ) + +(defmethod get-inv-mass ((this roboguard)) + 2.0 + ) + +(defmethod enemy-method-109 ((this roboguard)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) + ) + (do-navigation-to-destination s3-0 (-> gp-0 trans)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ) + (else + (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) + (let ((f0-0 8192.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (-> gp-0 trans))) + ) + (< (- (-> gp-0 trans y) (-> s5-0 y)) -4096.0) + ) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +(defmethod event-handler ((this roboguard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((or (= (-> this hit-points) 0.0) + (and (>= 1.0 (-> this hit-points)) (= (-> this incoming knocked-type) (knocked-type blue-shot))) + ) + (on-dying this) + (go (method-of-object this explode)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (('impact-impulse) + (let ((v1-38 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-38) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> this hit-points) 0.0) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 210 + 16384.0 + ) + (send-event arg0 'lawsuit (-> this root trans)) + (go (method-of-object this explode)) + #t + ) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod enemy-common-post ((this roboguard)) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + (vector-rotate-around-y! + (the-as vector (-> this upper-rotation-matrix)) + (the-as vector (-> this rotation-matrix)) + (-> this torso-angle) + ) + (set! (-> this upper-rotation-matrix uvec quad) (-> this rotation-matrix uvec quad)) + (vector-rotate-around-y! + (-> this upper-rotation-matrix fvec) + (-> this rotation-matrix fvec) + (-> this torso-angle) + ) + (when (< 1 (the-as int (-> this focus aware))) + (when (-> this update-focus-pos) + (let ((s5-0 (handle->process (-> this focus handle)))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-0) 5) quad)) + (los-control-method-9 (-> this los) (the-as process-focusable s5-0) (-> this focus-pos) 819.2 4096.0) + ) + ) + ) + (vector-! (-> this me-to-focus-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this me-to-focus-dir y) 0.0) + (vector-xz-normalize! (-> this me-to-focus-dir) 1.0) + (let* ((a1-9 (-> this rotation-matrix fvec)) + (s5-1 (-> this rotation-matrix)) + (f0-3 (vector-vector-angle-safe (-> this me-to-focus-dir) a1-9)) + ) + (if (< (vector-dot (-> this me-to-focus-dir) (the-as vector s5-1)) 0.0) + (set! f0-3 (* -1.0 f0-3)) + ) + (set! (-> this me-to-focus-angle) f0-3) + ) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +(defmethod coin-flip? ((this roboguard)) + #f + ) + +(defmethod init-enemy! ((this roboguard)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask kg-robot)) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + ) + (init-enemy-defaults! this *roboguard-nav-enemy-info*) + (init-los! + (-> this los) + this + (seconds 0.1) + 327680.0 + (collide-spec backgnd obstacle hit-by-others-list los-blocker) + ) + (set! (-> this torso-aim-blend) 0.0) + (set! (-> this torso-angle) 0.0) + (set! (-> this torso-seek-speed) 0.0) + (set! (-> this torso-to-focus-angle) 0.0) + (let ((v1-13 (-> this node-list data 4))) + (set! (-> v1-13 param0) + (lambda ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-96 vector)) + (let ((s3-0 (the-as roboguard (-> arg0 param1))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> s3-0 rotation-matrix rvec quad)) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! (-> s0-0 quad) (-> s3-0 rotation-matrix fvec quad)) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! sv-96 (-> s3-0 focus-pos)) + (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) arg0)) + (s1-1 (vector-! s1-0 sv-96 v0-1)) + ) + (set! (-> s1-1 y) 0.0) + (set! (-> s2-0 y) 0.0) + (set! (-> s0-0 y) 0.0) + (vector-xz-normalize! s1-1 1.0) + (vector-xz-normalize! s2-0 1.0) + (vector-xz-normalize! s0-0 1.0) + (let ((f0-5 (fmin 18204.445 (acos (vector-dot s0-0 s1-1))))) + (if (< (vector-dot s2-0 s1-1) 0.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (seek! (-> s3-0 torso-angle) f0-5 (* (-> s3-0 torso-seek-speed) (seconds-per-frame))) + ) + ) + ) + ) + ) + (quaternion-vector-angle! gp-0 *y-vector* (* (-> s3-0 torso-angle) (-> s3-0 torso-aim-blend))) + (quaternion*! (-> arg1 quat) (-> arg1 quat) gp-0) + ) + (quaternion-normalize! (-> arg1 quat)) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + ) + (set! (-> v1-13 param1) this) + ) + (let ((v1-14 (lambda ((arg0 cspace) (arg1 transformq)) + (let ((s3-0 (-> arg0 param1)) + (s2-0 (the-as object (-> arg0 param2))) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (quaternion-vector-angle! + (the-as quaternion s4-0) + (the-as vector (-> (the-as roboguard s3-0) upper-rotation-matrix)) + (* (-> (the-as roboguard s3-0) arm-rot (the-as int s2-0)) + (-> (the-as roboguard s3-0) arm-rot-mult (the-as int s2-0)) + ) + ) + (matrix->trans (-> arg0 bone transform) gp-0) + (matrix*! + (-> arg0 bone transform) + (-> arg0 bone transform) + (quaternion->matrix (new 'stack-no-clear 'matrix) (the-as quaternion s4-0)) + ) + (matrix<-trans (-> arg0 bone transform) gp-0) + ) + (none) + ) + ) + ) + (let ((a0-9 (-> this node-list data 10))) + (set! (-> a0-9 param0) v1-14) + (set! (-> a0-9 param1) this) + (set! (-> a0-9 param2) (the-as basic 0)) + ) + (let ((a0-11 (-> this node-list data 14))) + (set! (-> a0-11 param0) v1-14) + (set! (-> a0-11 param1) this) + (set! (-> a0-11 param2) (the-as basic 1)) + ) + ) + (set! (-> this arm-rot-mult 0) 0.0) + (set! (-> this arm-rot-mult 1) 0.0) + (set! (-> this flags) (roboguard-flag)) + (set! (-> this last-attack-time) 0) + (set! (-> this update-focus-pos) #t) + (set! (-> this formation-angle-sign) (if (not (logtest? (-> this pid) 1)) + 1.0 + -1.0 + ) + ) + (set! (-> this last-hit-points) (the int (-> this enemy-info default-hit-points))) + (setup-masks (-> this draw) -1 0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc index 78c6020a5b..3035c0944d 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc @@ -5,5 +5,1708 @@ ;; name in dgo: spydroid-orig ;; dgos: SEA, FACTORYA +;; +++spydroid-orig-flag +(defenum spydroid-orig-flag + :type uint64 + :bitfield #t + (sof0 0) + (sof1 1) + (sof2 2) + ) +;; ---spydroid-orig-flag + + ;; DECOMP BEGINS +(defpartgroup group-spydroid-orig-trail + :id 1521 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4976 :fade-after (meters 120) :falloff-to (meters 160)) + (sp-item 4977 :flags (sp6)) + (sp-item 4978 :fade-after (meters 120) :falloff-to (meters 160)) + ) + ) + +(defpart 4977 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 1.7) (meters 1)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees -17) (degrees 17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -1.0666667) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +(defpart 4978 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 2.0 2.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.033)) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.03375)) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:fade-r -8.0) + (:fade-g -0.85 -0.85) + (:fade-a -0.10666667 -0.42666668) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 135) (degrees 90)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters -0.5)) + ) + ) + +(defpart 4976 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.5 1.0) + (:scale-x (meters 1.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 64.0 8.0) + (:vel-x (meters -0.0033333334) (meters 0.006666667)) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:vel-z (meters -0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667) (meters 0.008333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.2) + (:fade-g 0.0) + (:fade-b -3.2) + (:fade-a -0.8) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.135)) + (:next-launcher 4979) + ) + ) + +(defpart 4979 + :init-specs ((:r 128.0) + (:g 128.0) + (:b 128.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.10666667 -0.21333334) + (:func 'nothing) + ) + ) + +(defpartgroup group-spydroid-orig-explode + :id 1522 + :duration (seconds 3) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4980 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 4981 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 4982 :period (seconds 3) :length (seconds 0.05)) + (sp-item 4983 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 4984 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 4985 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 4986 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 4981 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -8.5) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 4987) + ) + ) + +(defpart 4987 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +(defpart 4986 + :init-specs ((:texture (explosion-wave factoryc-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 4988) + (:conerot-x '*sp-temp*) + ) + ) + +(defpart 4985 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 4988) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 4988 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 4989)) + ) + +(defpart 4989 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4990) + ) + ) + +(defpart 4990 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 4991) + ) + ) + +(defpart 4991 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +(defpart 4980 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 4992) + ) + ) + +(defpart 4992 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +(defpart 4984 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4993) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 4993 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4994) + ) + ) + +(defpart 4994 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +(defpart 4982 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4995) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +(defpart 4995 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4996) + ) + ) + +(defpart 4996 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +(defpart 4983 + :init-specs ((:texture (flamingstick factoryc-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defpart 4997 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 4998 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 16.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 4999 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 6.0 2.0) + (:omega (degrees 1811.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 5000 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1811.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defskelgroup skel-spydroid-orig spydroid-orig spydroid-orig-lod0-jg spydroid-orig-idle-ja + ((spydroid-orig-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow spydroid-orig-shadow-mg + ) + +(defskelgroup skel-spydroid-orig-exploding spydroid-orig spydroid-orig-exploding-lod0-jg spydroid-orig-exploding-idle-ja + ((spydroid-orig-exploding-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + ) + +(define *spydroid-orig-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd obstacle hit-by-others-list) + ) + ) + +(deftype spydroid-orig (nav-enemy) + ((old-y-deg float) + (diff-angle float) + (flags spydroid-orig-flag) + (lightning lightning-control 4) + (floor float) + (explode-part sparticle-launch-control) + ) + (:state-methods + attack + explode + ) + ) + + +(define *fact-info-spydroid-orig-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +(define *spydroid-orig-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 5 + :hit-anim 15 + :knocked-anim 11 + :knocked-land-anim 12 + :die-anim 15 + :die-falling-anim 15 + :victory-anim -1 + :jump-wind-up-anim 8 + :jump-in-air-anim 9 + :jump-land-anim 10 + :neck-joint 4 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "spydroid-orig-h") + :sound-die (static-sound-name "droid-explode") + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 4 + :turn-anim -1 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *spydroid-orig-nav-enemy-info* fact-defaults) *fact-info-spydroid-orig-defaults*) + +(defmethod enemy-common-post ((this spydroid-orig)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (when (< (-> this root scale x) 1.0) + (let ((f0-2 (fmin 1.0 (+ 0.025 (-> this root scale x))))) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) + ) + ) + (when (logtest? (-> this flags) (spydroid-orig-flag sof0)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! s5-0 (-> this node-list data 12)) + (dotimes (s3-0 4) + (let ((a0-4 (-> this lightning s3-0)) + (v1-15 s5-0) + ) + (set! (-> a0-4 state meet data 0 quad) (-> v1-15 quad)) + ) + (let ((v1-17 s3-0)) + (cond + ((zero? v1-17) + (vector<-cspace! s4-0 (-> this node-list data 16)) + ) + ((= v1-17 1) + (vector<-cspace! s4-0 (-> this node-list data 20)) + ) + ((= v1-17 2) + (vector<-cspace! s4-0 (-> this node-list data 28)) + ) + (else + (vector<-cspace! s4-0 (-> this node-list data 24)) + ) + ) + ) + (let ((a0-13 (-> this lightning s3-0)) + (v1-28 s4-0) + ) + (set! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1) quad) (-> v1-28 quad)) + ) + (when (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'die-falling) (= v1-33 'explode)) + ) + ) + ) + (let ((v1-38 (-> this lightning s3-0 state mode))) + (when (or (zero? v1-38) (= v1-38 3)) + (let ((v1-42 (-> this lightning s3-0)) + (a0-20 1) + ) + (let ((a1-11 (!= a0-20 (-> v1-42 state mode)))) + (case a0-20 + ((3) + (if a1-11 + (set! (-> v1-42 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-42 state start-color) (-> v1-42 spec start-color)) + (set! (-> v1-42 state end-color) (-> v1-42 spec end-color)) + ) + ) + ) + (set! (-> v1-42 state mode) (the-as uint a0-20)) + ) + ) + ) + ) + ) + ) + ) + (let ((f0-5 (quaternion-y-angle (-> this root quat)))) + (set! (-> this diff-angle) (- (-> this old-y-deg) f0-5)) + (cond + ((< 32768.0 (-> this diff-angle)) + (+! (-> this diff-angle) -65536.0) + ) + ((< (-> this diff-angle) -32768.0) + (+! (-> this diff-angle) 65536.0) + ) + ) + (set! (-> this old-y-deg) f0-5) + ) + (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (logior! (-> this flags) (spydroid-orig-flag sof1)) + (logclear! (-> this flags) (spydroid-orig-flag sof1)) + ) + (if (and (< (-> this root trans y) (+ -122880.0 (-> this floor))) + (-> this next-state) + (= (-> this next-state name) 'jump) + ) + (deactivate this) + ) + (if (and (-> this next-state) (= (-> this next-state name) 'jump)) + (spawn (-> this part) (-> this root trans)) + ) + 0 + (none) + ) + +(defmethod event-handler ((this spydroid-orig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v1-8 structure) (sv-144 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (case arg2 + (('touch 'bonk 'attack) + (cond + ((logtest? (-> this flags) (spydroid-orig-flag sof0)) + (set! sv-144 (the-as vector (send-event (ppointer->process (-> this parent)) 'widow-get-center))) + (let* ((s1-0 arg0) + (s0-0 (if (type? s1-0 process-drawable) + s1-0 + ) + ) + ) + (let ((v1-7 sv-144)) + (b! (not v1-7) cfg-16 :likely-delay (set! v1-8 sv-144)) + ) + (set! v1-8 s0-0) + (label cfg-16) + (cond + (v1-8 + (let ((v1-12 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) sv-144)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-1 x) (- (-> v1-12 z))) + (set! (-> s1-1 y) 0.0) + (set! (-> s1-1 z) (-> v1-12 x)) + (set! (-> s1-1 w) 1.0) + (let ((v1-15 + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> this root trans)) + ) + ) + (set! (-> s1-1 y) 0.0) + (set! (-> v1-15 y) 0.0) + (if (< (vector-dot v1-15 s1-1) 0.0) + (vector-negate! s1-1 s1-1) + ) + ) + (vector-normalize! s1-1 16384.0) + (vector+! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans)) + (vector-! s1-1 s1-1 sv-144) + (set! (-> s1-1 y) 0.0) + (vector-normalize! s1-1 204800.0) + (let ((v1-20 s1-1)) + (let ((a0-19 s1-1)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-19 quad)) + ) + (.lvf vf5 (&-> sv-144 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-20 quad) vf6) + ) + (vector-! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans)) + (set! (-> s1-1 y) 8192.0) + (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'shock) + (vector s1-1) + ) + ) + ) + ) + ) + ((and s0-0 (= (-> s0-0 type) target)) + (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'shock) + (shove-up (meters 2)) + (shove-back (meters 4)) + ) + ) + ) + ) + ) + ) + (let ((v1-36 (the-as object (-> arg3 param 1)))) + (if (or (!= arg0 *target*) + (and (= arg2 'attack) + (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-36) mask)) + (logtest? (penetrate vehicle dark-bomb) (-> (the-as attack-info v1-36) penetrate-using)) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('jump) + (set! (-> this floor) (-> (the-as vector (-> arg3 param 1)) y)) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('use-lightning) + (cond + ((-> arg3 param 0) + (let ((v0-7 (the-as object (logior (-> this flags) (spydroid-orig-flag sof0))))) + (set! (-> this flags) (the-as spydroid-orig-flag v0-7)) + v0-7 + ) + ) + (else + (logclear! (-> this flags) (spydroid-orig-flag sof0)) + (dotimes (v1-47 4) + (let ((a0-56 (-> this lightning v1-47 state mode))) + (cond + ((or (zero? a0-56) (= a0-56 3)) + ) + (else + (let ((a0-60 (-> this lightning v1-47)) + (a1-28 3) + ) + (let ((a2-9 (!= a1-28 (-> a0-60 state mode)))) + (case a1-28 + ((3) + (if a2-9 + (set! (-> a0-60 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-60 state start-color) (-> a0-60 spec start-color)) + (set! (-> a0-60 state end-color) (-> a0-60 spec end-color)) + ) + ) + ) + (set! (-> a0-60 state mode) (the-as uint a1-28)) + ) + ) + ) + ) + ) + #f + ) + ) + ) + (('impact-impulse) + (let ((v1-49 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-49) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> this hit-points) 0.0) + (send-event arg0 'lawsuit (-> this root trans)) + (go (method-of-object this explode)) + #t + ) + ) + ) + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) + (on-dying this) + (go (method-of-object this explode)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +(defstate explode (spydroid-orig) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (send-event self 'death-start) + (sound-play "droid-explode") + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (when (logtest? (-> self flags) (spydroid-orig-flag sof0)) + (dotimes (v1-16 4) + (let ((a0-7 (-> self lightning v1-16)) + (a1-2 3) + ) + (let ((a2-2 (!= a1-2 (-> a0-7 state mode)))) + (case a1-2 + ((3) + (if a2-2 + (set! (-> a0-7 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-7 state start-color) (-> a0-7 spec start-color)) + (set! (-> a0-7 state end-color) (-> a0-7 spec end-color)) + ) + ) + ) + (set! (-> a0-7 state mode) (the-as uint a1-2)) + ) + ) + ) + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-spydroid-orig-exploding" (the-as (pointer level) #f)) + 20 + gp-1 + *spydroid-orig-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((v1-25 (new 'stack-no-clear 'vector))) + (set! (-> v1-25 quad) (-> self root trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + ) + (let ((gp-4 (-> self child))) + (while gp-4 + (send-event (ppointer->process gp-4) 'notice 'die) + (set! gp-4 (-> gp-4 0 brother)) + ) + ) + ) + :trans (behavior () + (when (not (-> self child)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + ) + +(defstate die-falling (spydroid-orig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-time! (-> self state-time)) + (send-event self 'death-start) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 2))) + (spawn (-> self explode-part) (-> self root trans)) + ) + ) + :code (behavior () + (when (logtest? (-> self flags) (spydroid-orig-flag sof0)) + (dotimes (v1-3 4) + (let ((a0-2 (-> self lightning v1-3)) + (a1-0 3) + ) + (let ((a2-1 (!= a1-0 (-> a0-2 state mode)))) + (case a1-0 + ((3) + (if a2-1 + (set! (-> a0-2 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-2 state start-color) (-> a0-2 spec start-color)) + (set! (-> a0-2 state end-color) (-> a0-2 spec end-color)) + ) + ) + ) + (set! (-> a0-2 state mode) (the-as uint a1-0)) + ) + ) + ) + (suspend) + (ja-channel-set! 0) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (let ((gp-1 (-> self child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'notice 'die) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defstate attack (spydroid-orig) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (spydroid-orig-flag sof2)) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (+ 8192.0 (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-7 (-> self nav state))) + (set! (-> v1-7 speed) (+ 8192.0 (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 turning-acceleration) (* 4.0 (-> self enemy-info run-turning-acceleration))) + ) + 0 + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-14 *game-info*) + (a0-11 (+ (-> v1-14 attack-id) 1)) + ) + (set! (-> v1-14 attack-id) a0-11) + (set! (-> self attack-id) a0-11) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-attack-jump-ja :num! min) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-179 self) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + nav-state + (if (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logior! (-> self flags) (spydroid-orig-flag sof2)) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (= v1-10 spydroid-orig-attack-jump-ja)) + (ja :num! (seek!)) + (if (and (< 4.0 (ja-aframe-num 0)) (not (logtest? (-> self flags) (spydroid-orig-flag sof0)))) + (logior! (-> self focus-status) (focus-status dangerous)) + ) + (when (ja-done? 0) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) 0.0) + ) + 0 + (let ((v1-30 (-> self nav))) + (set! (-> v1-30 acceleration) 262144.0) + ) + 0 + (let ((v1-32 (-> self nav))) + (set! (-> v1-32 turning-acceleration) 0.0) + ) + 0 + (ja :group! spydroid-orig-attack-land-ja :num! min) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + ) + (else + (let ((v1-45 (ja-group))) + (cond + ((and v1-45 (= v1-45 spydroid-orig-attack-land-ja)) + (ja :num! (seek!)) + (cond + ((ja-done? 0) + (go-hostile self) + ) + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + ) + ((< 0.0 (-> self diff-angle)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + ) + ) + ((let ((v1-69 (ja-group))) + (and (and v1-69 (= v1-69 spydroid-orig-turn-left-ja)) + (and (logtest? (-> self flags) (spydroid-orig-flag sof1)) (< 0.0 (-> self diff-angle))) + ) + ) + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + (else + (let ((v1-80 (ja-group))) + (if (and (and v1-80 (= v1-80 spydroid-orig-turn-right-ja)) + (and (logtest? (-> self flags) (spydroid-orig-flag sof1)) (< (-> self diff-angle) 0.0)) + ) + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + (go-hostile self) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post nav-enemy-chase-post + ) + +(defstate notice (spydroid-orig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-best-state self) + ) + ) + +(defstate hostile (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (and a0-1 + (let ((f0-0 (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (-> self root trans))) + (f1-0 16384.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + ) + (go-virtual attack) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-24 (ja-group))) + (when (not (and v1-24 (= v1-24 (-> self draw art-group data (-> self enemy-info hostile-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-44 (ja-group))) + (cond + ((not (and v1-44 (= v1-44 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-56 (ja-group))) + (cond + ((not (and v1-56 (= v1-56 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defstate circling (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy circling) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-28 (ja-group))) + (cond + ((not (and v1-28 (= v1-28 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-40 (ja-group))) + (cond + ((not (and v1-40 (= v1-40 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (nav-enemy-method-176 self) + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defstate pacing (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy pacing) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-28 (ja-group))) + (cond + ((not (and v1-28 (= v1-28 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-40 (ja-group))) + (cond + ((not (and v1-40 (= v1-40 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defstate stare (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! min) + ) + ) + (ja :num! (loop!)) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-24 (ja-group))) + (cond + ((not (and v1-24 (= v1-24 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-36 (ja-group))) + (cond + ((not (and v1-36 (= v1-36 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +(defmethod init-enemy-collision! ((this spydroid-orig)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4300.8) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action deadly)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 3686.4) + ) + (set! (-> s5-0 nav-radius) 8192.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod coin-flip? ((this spydroid-orig)) + #f + ) + +(defmethod get-inv-mass ((this spydroid-orig)) + 3.3333333 + ) + +(defmethod deactivate ((this spydroid-orig)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this explode-part)) + (kill-particles (-> this explode-part)) + ) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch nav-enemy vs spydroid-orig. +(defmethod relocate ((this spydroid-orig) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) offset) + ) + ) + (when (nonzero? (-> this explode-part)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) offset) + ) + ) + (the-as spydroid-orig ((method-of-type nav-enemy relocate) this offset)) + ) + +(defmethod init-enemy! ((this spydroid-orig)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid-orig" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *spydroid-orig-nav-enemy-info*) + (dotimes (s5-1 4) + (set! (-> this lightning s5-1) + (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 512.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + (let ((v1-10 (-> this lightning s5-1)) + (a0-5 0) + ) + (let ((a1-5 (!= a0-5 (-> v1-10 state mode)))) + (case a0-5 + ((3) + (if a1-5 + (set! (-> v1-10 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-10 state start-color) (-> v1-10 spec start-color)) + (set! (-> v1-10 state end-color) (-> v1-10 spec end-color)) + ) + ) + ) + (set! (-> v1-10 state mode) (the-as uint a0-5)) + ) + ) + (let ((v1-13 (-> this neck))) + (set! (-> v1-13 up) (the-as uint 1)) + (set! (-> v1-13 nose) (the-as uint 2)) + (set! (-> v1-13 ear) (the-as uint 0)) + (set-vector! (-> v1-13 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-13 ignore-angle) 15473.777) + ) + (set-vector! (-> this root scale) 0.5 0.5 0.5 1.0) + (let ((v1-17 (-> this nav))) + (set! (-> v1-17 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1521) this)) + (set! (-> this explode-part) (create-launch-control (-> *part-group-id-table* 1522) this)) + (add-connection + *part-engine* + this + 8 + this + 4997 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 163840.0) + ) + (add-connection + *part-engine* + this + 10 + this + 4997 + (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 163840.0) + ) + (add-connection + *part-engine* + this + 4 + this + 4998 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 163840.0) + ) + (add-connection *part-engine* this 6 this 4999 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 6 this 5000 (new 'static 'vector :w 163840.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this flags) (spydroid-orig-flag)) + (if (-> this entity) + (set! (-> this flags) + (res-lump-value (-> this entity) 'spydroid-flags spydroid-orig-flag :time -1000000000.0) + ) + ) + (logclear! (-> this flags) (spydroid-orig-flag sof1 sof2)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc b/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc index 7821ec0816..c94a3a63f7 100644 --- a/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc +++ b/goal_src/jak3/levels/common/hvehicle/squad-control-h.gc @@ -5,5 +5,126 @@ ;; name in dgo: squad-control-h ;; dgos: HGA, LPATK, RAILA, LFACCAR, CWI, WASALL, LFACTORY, COMBA +;; +++squad-target-flag +(defenum squad-target-flag + :type uint8 + :bitfield #t + (visible-now) + (visible-recently) + (visible-ever) + (updated) + (force-visible) + ) +;; ---squad-target-flag + + +;; +++squad-alert-flag +(defenum squad-alert-flag + :type uint8 + :bitfield #t + (alert-ending) + (alarm-on) + (guard-multi-focus) + (sticky-guard-settings) + (disable-pursuit-control) + (update-target-search) + (war) + ) +;; ---squad-alert-flag + + ;; DECOMP BEGINS +(deftype squad-unit-settings (structure) + ((target-count int8) + (shot-count int8) + (rand-shot-count int8) + (inaccuracy float) + (acquire-delay uint16) + (shot-delay uint16) + (burst-delay uint16) + (rand-burst-delay uint16) + (rand-shot-delay uint16) + ) + ) + + +(deftype squad-target-status (structure) + ((flags squad-target-flag) + (handle handle) + (last-seen-time time-frame) + (position vector :inline) + (velocity vector :inline) + (threat-level float) + ) + ) + + +(deftype squad-alert-state (structure) + ((flags squad-alert-flag) + (level uint8) + (max-level uint8) + (guards-in-sight-of-target int8) + (guard-aim-count int8) + (guard-inaccuracy-factor float) + (guard-target-level float) + (duration uint32) + (start-time time-frame) + (notify-time time-frame) + (alarm-sound-id sound-id) + (target-status-array squad-target-status 3 :inline) + (target-status squad-target-status :inline :overlay-at (-> target-status-array 0)) + ) + (:methods + (init! (_type_) none) + ) + ) + + +(deftype primary-target-pos-vel (structure) + ((position vector :inline) + (velocity vector :inline) + (time uint32 :overlay-at (-> velocity data 3)) + ) + ) + + +(deftype squad-control (basic) + ((sync-clock uint8) + (sync-mask-8 uint8) + (sync-mask-16 uint16) + (sync-mask-32 uint32) + (alert-state squad-alert-state :inline) + (primary-target-history primary-target-pos-vel 16 :inline) + ) + (:methods + (initialize (_type_ process) none) + (squad-control-method-10 (_type_) none) + (stop-alarm-sound (_type_) none) + (init-alert (_type_) none) + (update (_type_) none) + (set-sync-mask (_type_) none) + (probe-backgnd-collision (_type_ vector vector) symbol) + (squad-control-method-16 (_type_ vector process-focusable squad-target-status) none) + (squad-control-method-17 (_type_ vector int squad-target-status) none) + (squad-control-method-18 (_type_ int process) int) + (set-alert-level0 (_type_ int) int) + (start-alert (_type_ int) none) + (set-alert-level (_type_ int) none) + (get-alert-level (_type_) int) + (set-alert-duration (_type_ time-frame) none) + (squad-control-method-24 (_type_) int) + (squad-control-method-25 (_type_ primary-target-pos-vel time-frame) none) + (set-pos-vel (_type_ primary-target-pos-vel) primary-target-pos-vel) + (squad-control-method-27 (_type_ process float) none) + (get-idx-in-status-arr (_type_ handle) int) + (valid-target-handle? (_type_ handle) symbol) + (get-target-focus (_type_) process-focusable) + (squad-control-method-31 (_type_ vector process-focusable handle float float) none) + (get-handle-pos (_type_ handle vector) vector) + (get-focus-in-range (_type_ process-focusable) process-focusable) + ) + ) + + +(define *waswide-squad-control* (the-as squad-control #f)) diff --git a/goal_src/jak3/levels/common/hvehicle/squad-control.gc b/goal_src/jak3/levels/common/hvehicle/squad-control.gc index bc850129b9..ff096269df 100644 --- a/goal_src/jak3/levels/common/hvehicle/squad-control.gc +++ b/goal_src/jak3/levels/common/hvehicle/squad-control.gc @@ -5,5 +5,523 @@ ;; name in dgo: squad-control ;; dgos: HGA, LPATK, RAILA, LFACCAR, CWI, WASALL, LFACTORY, COMBA +(deftype squad-control-stack-type0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (float0 float :offset 32) + (byte0 int8 :offset 36) + (mesh nav-mesh :offset 40) + (cquery collide-query :inline :offset 64) + (vec2 vector :inline :offset 272) + (vec3 vector :inline :offset 288) + (float1 float :offset 604) + (float2 float :offset 608) + (float3 float :offset 612) + ) + ) + ;; DECOMP BEGINS +(defmethod init! ((this squad-alert-state)) + (set! (-> this flags) (squad-alert-flag)) + (set! (-> this level) (the-as uint 0)) + (set! (-> this duration) (the-as uint 9000)) + (set! (-> this alarm-sound-id) (new-sound-id)) + (set! (-> this guard-inaccuracy-factor) 1.0) + (dotimes (v1-2 3) + (let ((a0-4 (-> this target-status-array v1-2))) + (set! (-> a0-4 flags) (squad-target-flag)) + (set! (-> a0-4 handle) (the-as handle #f)) + (vector-reset! (-> a0-4 position)) + (vector-reset! (-> a0-4 velocity)) + (set! (-> a0-4 threat-level) 0.0) + ) + ) + 0 + (none) + ) + +(defmethod initialize ((this squad-control) (arg0 process)) + 0 + (none) + ) + +(defmethod squad-control-method-10 ((this squad-control)) + (init! (-> this alert-state)) + (init-alert this) + 0 + (none) + ) + +(defmethod stop-alarm-sound ((this squad-control)) + (sound-stop (-> this alert-state alarm-sound-id)) + 0 + (none) + ) + +(defmethod init-alert ((this squad-control)) + (logclear! + (-> this alert-state flags) + (squad-alert-flag guard-multi-focus sticky-guard-settings disable-pursuit-control war) + ) + (let ((v1-2 (-> this alert-state target-status-array))) + (logclear! (-> v1-2 0 flags) (squad-target-flag force-visible)) + ) + (set-alert-duration this (seconds 30)) + (set-alert-level this 4) + 0 + (none) + ) + +(defmethod set-sync-mask ((this squad-control)) + (+! (-> this sync-clock) 1) + (let ((v1-2 (-> this sync-clock))) + (set! (-> this sync-mask-8) (the-as uint (ash 1 (the-as int (logand v1-2 7))))) + (set! (-> this sync-mask-16) (the-as uint (ash 1 (the-as int (logand v1-2 15))))) + (set! (-> this sync-mask-32) (the-as uint (ash 1 (the-as int (logand v1-2 31))))) + ) + 0 + (none) + ) + +(defmethod update ((this squad-control)) + (set-sync-mask this) + 0 + (none) + ) + +;; WARN: Return type mismatch squad-target-status vs none. +;; og:preserve-this +; (defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) +; (empty) +; (none) +; ) + +(defmethod squad-control-method-18 ((this squad-control) (arg0 int) (arg1 process)) + (if (logtest? (-> this alert-state flags) (squad-alert-flag war)) + (return 0) + ) + (when (valid-target-handle? this (process->handle arg1)) + (let ((v1-10 (min arg0 (the-as int (-> this alert-state max-level))))) + (if (< (-> this alert-state level) (the-as uint v1-10)) + (logior! (-> this alert-state flags) (squad-alert-flag update-target-search)) + ) + (set-time! (-> this alert-state start-time)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + (set! (-> this alert-state level) (the-as uint (max (the-as int (-> this alert-state level)) v1-10))) + ) + ) + 0 + ) + +(defmethod set-alert-level0 ((this squad-control) (arg0 int)) + (if (logtest? (-> this alert-state flags) (squad-alert-flag war)) + (return 0) + ) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) + 0 + ) + +(defmethod start-alert ((this squad-control) (arg0 int)) + (set! (-> this alert-state level) (the-as uint arg0)) + (set-time! (-> this alert-state start-time)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + 0 + (none) + ) + +(defmethod set-alert-level ((this squad-control) (arg0 int)) + (set! (-> this alert-state max-level) (the-as uint arg0)) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) + 0 + (none) + ) + +(defmethod get-alert-level ((this squad-control)) + (if (logtest? (-> this alert-state flags) (squad-alert-flag war)) + (return 0) + ) + (the-as int (-> this alert-state level)) + ) + +(defmethod set-alert-duration ((this squad-control) (arg0 time-frame)) + (set! (-> this alert-state duration) (the-as uint arg0)) + 0 + (none) + ) + +(defmethod probe-backgnd-collision ((this squad-control) (arg0 vector) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> v1-0 move-dist) arg1 arg0) + (let ((a0-4 v1-0)) + (set! (-> a0-4 radius) 2048.0) + (set! (-> a0-4 collide-with) (collide-spec backgnd)) + (set! (-> a0-4 ignore-process0) #f) + (set! (-> a0-4 ignore-process1) #f) + (set! (-> a0-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a0-4 action-mask) (collide-action solid)) + ) + (< (fill-and-probe-using-line-sphere *collide-cache* v1-0) 0.0) + ) + ) + +(defmethod squad-control-method-16 ((this squad-control) (arg0 vector) (arg1 process-focusable) (arg2 squad-target-status)) + (cond + ((zero? (get-idx-in-status-arr this (process->handle arg1))) + (let ((s5-1 (-> this alert-state target-status-array))) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'primary-target-pos-vel 2))) + (set-pos-vel this (-> s4-0 0)) + (set! (-> s4-0 1 position quad) (-> s4-0 0 position quad)) + (logior! (-> s5-1 0 flags) (squad-target-flag updated)) + (cond + ((or (logtest? (-> s5-1 0 flags) (squad-target-flag force-visible)) + (probe-backgnd-collision this arg0 (the-as vector (-> s4-0 1))) + ) + (logior! (-> s5-1 0 flags) (squad-target-flag visible-now visible-recently visible-ever)) + (set-time! (-> s5-1 0 last-seen-time)) + (set! (-> s5-1 0 position quad) (-> s4-0 1 position quad)) + (set! (-> s5-1 0 velocity quad) (-> s4-0 0 velocity quad)) + ) + (else + (logclear! (-> s5-1 0 flags) (squad-target-flag visible-now)) + (if (time-elapsed? (-> s5-1 0 last-seen-time) (seconds 2)) + (logclear! (-> s5-1 0 flags) (squad-target-flag visible-recently)) + ) + ) + ) + ) + (mem-copy! (the-as pointer arg2) (the-as pointer s5-1) 68) + ) + 0 + ) + (else + (logior! (-> arg2 flags) (squad-target-flag visible-now visible-recently visible-ever)) + (set-time! (-> arg2 last-seen-time)) + (set! (-> arg2 position quad) (-> (get-trans arg1 3) quad)) + (set! (-> arg2 velocity quad) (-> (get-transv arg1) quad)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod valid-target-handle? ((this squad-control) (arg0 handle)) + (the-as symbol (and (handle->process arg0) (= (get-idx-in-status-arr this arg0) 0))) + ) + +;; WARN: Return type mismatch squad-target-status vs none. +(defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) + (logclear! (-> arg2 flags) (squad-target-flag visible-now updated)) + (cond + ((or (= (-> this sync-mask-16) (ash 1 (logand arg1 15))) + (or (logtest? (-> this alert-state flags) (squad-alert-flag update-target-search)) + (< (get-idx-in-status-arr this (-> arg2 handle)) 0) + ) + ) + (logclear! (-> this alert-state flags) (squad-alert-flag update-target-search)) + (logior! (-> arg2 flags) (squad-target-flag updated)) + (let ((a2-1 (handle->process (-> arg2 handle)))) + (if a2-1 + (squad-control-method-16 this arg0 (the-as process-focusable a2-1) arg2) + ) + ) + ) + (else + (when (and (handle->process (-> arg2 handle)) (valid-target-handle? this (-> arg2 handle))) + (let ((s4-1 (-> this alert-state target-status-array))) + (when (logtest? (-> s4-1 0 flags) (squad-target-flag visible-recently)) + (let ((s3-0 (new 'stack-no-clear 'primary-target-pos-vel))) + (set-pos-vel this (the-as primary-target-pos-vel (-> s3-0 position))) + (set! (-> s4-1 0 position quad) (-> s3-0 position quad)) + (set! (-> s4-1 0 velocity quad) (-> s3-0 velocity quad)) + ) + ) + (mem-copy! (the-as pointer arg2) (the-as pointer s4-1) 68) + ) + ) + (logclear! (-> arg2 flags) (squad-target-flag updated)) + ) + ) + (none) + ) + +(defmethod squad-control-method-24 ((this squad-control)) + (if (not (handle->process (-> this alert-state target-status handle))) + (return 0) + ) + (let* ((s5-0 (handle->process (-> this alert-state target-status handle))) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (new 'stack-no-clear 'primary-target-pos-vel))) + (set! (-> s5-1 position quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (set! (-> s5-1 velocity quad) (-> (get-transv (the-as process-focusable s4-0)) quad)) + (set! (-> s5-1 time) (the-as uint (current-time))) + (if (>= (- (-> s5-1 time) (-> this primary-target-history 1 time)) (the-as uint 30)) + (qmem-copy->! + (the-as pointer (-> this primary-target-history 1)) + (the-as pointer (-> this primary-target-history)) + 480 + ) + ) + (mem-copy! (the-as pointer (-> this primary-target-history)) (the-as pointer (-> s5-1 position)) 32) + ) + 0 + ) + ) + 0 + ) + +;; WARN: Return type mismatch primary-target-pos-vel vs none. +(defmethod squad-control-method-25 ((this squad-control) (arg0 primary-target-pos-vel) (arg1 time-frame)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'primary-target-pos-vel 2))) + (set! (-> s5-0 0 time) (the-as uint (- (current-time) arg1))) + (let ((v1-3 0)) + (let ((a1-1 0)) + (b! #t cfg-7 :delay (nop!)) + (label cfg-1) + (b! + (not (and (>= (-> this primary-target-history a1-1 time) (-> s5-0 0 time)) + (>= (-> s5-0 0 time) (-> this primary-target-history (+ a1-1 1) time)) + ) + ) + cfg-6 + :delay (empty-form) + ) + (set! v1-3 a1-1) + (b! #t cfg-9 :delay (nop!)) + (label cfg-6) + (+! a1-1 1) + (label cfg-7) + (b! (< a1-1 14) cfg-1) + ) + (set! (-> s5-0 0 time) (-> this primary-target-history 0 time)) + (label cfg-9) + (let ((s4-0 (-> this primary-target-history v1-3)) + (s3-0 (-> this primary-target-history (+ v1-3 1))) + ) + (set! (-> s5-0 1 position x) + (/ (the float (- (-> s5-0 0 time) (-> s4-0 time))) (the float (- (-> s3-0 time) (-> s4-0 time)))) + ) + (vector-lerp! (-> arg0 position) (-> s4-0 position) (-> s3-0 position) (-> s5-0 1 position x)) + (vector-lerp! (-> arg0 velocity) (-> s4-0 velocity) (-> s3-0 velocity) (-> s5-0 1 position x)) + ) + ) + (set! (-> arg0 time) (-> s5-0 0 time)) + ) + (none) + ) + +(defmethod set-pos-vel ((this squad-control) (arg0 primary-target-pos-vel)) + (let* ((s4-0 (handle->process (-> this alert-state target-status handle))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-0 + (set! (-> arg0 position quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (set! (-> arg0 velocity quad) (-> (get-transv (the-as process-focusable s5-0)) quad)) + ) + ) + arg0 + ) + +;; WARN: Return type mismatch float vs none. +(defmethod squad-control-method-27 ((this squad-control) (arg0 process) (arg1 float)) + (let ((a1-4 (process->handle arg0)) + (v1-2 (-> this alert-state target-status-array)) + ) + (when (!= (-> v1-2 0 handle) a1-4) + (set! (-> v1-2 0 handle) (the-as handle a1-4)) + (set! (-> v1-2 0 flags) (squad-target-flag)) + (vector-reset! (-> v1-2 0 position)) + (vector-reset! (-> v1-2 0 velocity)) + (set! (-> v1-2 0 threat-level) arg1) + ) + ) + (none) + ) + +(defmethod get-idx-in-status-arr ((this squad-control) (arg0 handle)) + (if (not (handle->process arg0)) + (return -1) + ) + (dotimes (v1-5 3) + (if (= (-> this alert-state target-status-array v1-5 handle) arg0) + (return v1-5) + ) + ) + -1 + ) + +;; WARN: Return type mismatch process vs process-focusable. +(defmethod get-target-focus ((this squad-control)) + (let ((gp-0 (handle->process (-> this alert-state target-status handle)))) + (the-as process-focusable (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + ) + +;; WARN: Return type mismatch process vs process-focusable. +(defmethod get-focus-in-range ((this squad-control) (arg0 process-focusable)) + (let* ((f0-0 4915200.0) + (f30-0 (* f0-0 f0-0)) + (s4-0 (the-as process #f)) + ) + (dotimes (s3-0 3) + (let* ((s1-0 (handle->process (-> this alert-state target-status-array s3-0 handle))) + (s2-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-0 + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s2-0) 0))) + ) + (when (< f0-2 f30-0) + (set! f30-0 f0-2) + (set! s4-0 s2-0) + ) + ) + ) + ) + ) + (the-as process-focusable s4-0) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod squad-control-method-31 ((this squad-control) (arg0 vector) (arg1 process-focusable) (arg2 handle) (arg3 float) (arg4 float)) + (local-vars (v1-40 float) (sv-672 float) (sv-688 vector) (sv-704 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (set! sv-672 arg4) + (let ((s5-0 (get-handle-pos this arg2 (new 'stack-no-clear 'vector)))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> arg1 root trans)))) + (set! sv-688 s5-0) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (let ((s2-0 (new 'stack-no-clear 'squad-control-stack-type0)) + (s1-0 (the-as nav-mesh #f)) + (f30-0 sv-672) + ) + (if (and (nonzero? (-> arg1 nav)) (-> arg1 nav)) + (set! s1-0 (-> arg1 nav state mesh)) + ) + (if (not s1-0) + (set! s1-0 (find-nearest-nav-mesh sv-688 (the-as float #x7f800000))) + ) + (when s1-0 + (nav-mesh-method-10 s1-0 sv-688 sv-688 (the-as nav-poly #f)) + (set! (-> s2-0 float0) 40960.0) + (set! (-> s2-0 byte0) 2) + (vector-! (-> s2-0 vec1) sv-688 (the-as vector (-> s1-0 bounds))) + (nav-mesh-method-46 s1-0 (the-as nav-poly (-> s2-0 vec1))) + (let ((s0-1 (-> s2-0 mesh))) + (when s0-1 + (project-point-into-poly-2d s1-0 (the-as nav-poly s0-1) (-> s2-0 vec1) (-> s2-0 vec1)) + (let ((v1-18 (-> s2-0 vec1)) + (a0-9 (-> s1-0 bounds)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-18 quad)) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-688 quad) vf6) + (set! sv-704 0) + (while (< sv-704 16) + (when #t + (set! (-> s2-0 float1) + (the float (sar (shl (the int (+ f30-0 (* 182.04445 (* 22.5 (the float sv-704))))) 48) 48)) + ) + (set! (-> s2-0 float2) arg3) + (vector-rotate-around-y! (-> s2-0 vec0) s3-1 (-> s2-0 float1)) + (vector-float*! (-> s2-0 vec0) (-> s2-0 vec0) (-> s2-0 float2)) + (clamp-vector-to-mesh-cross-gaps + s1-0 + (-> s2-0 vec1) + (the-as nav-poly s0-1) + (-> s2-0 vec0) + (-> s2-0 float2) + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (set! (-> s2-0 cquery start-pos quad) (-> s5-0 quad)) + (set! (-> s2-0 cquery move-dist quad) (-> s2-0 vec0 quad)) + (let ((v1-34 (-> s2-0 cquery))) + (set! (-> v1-34 radius) 2048.0) + (set! (-> v1-34 collide-with) (collide-spec backgnd)) + (set! (-> v1-34 ignore-process0) #f) + (set! (-> v1-34 ignore-process1) #f) + (set! (-> v1-34 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-34 action-mask) (collide-action solid)) + ) + (set! (-> s2-0 float3) (fill-and-probe-using-line-sphere *collide-cache* (-> s2-0 cquery))) + (if (< 0.0 (-> s2-0 float3)) + (vector-float*! (-> s2-0 vec0) (-> s2-0 vec0) (-> s2-0 float3)) + ) + (.lvf vf1 (&-> (-> s2-0 vec0) 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-40 vf1) + (let ((f0-17 v1-40) + (f1-4 (* 0.5 arg3)) + ) + (when (< (* f1-4 f1-4) f0-17) + (vector+! s5-0 s5-0 (-> s2-0 vec0)) + 0 + (goto cfg-19) + ) + ) + ) + (set! sv-704 (+ sv-704 1)) + ) + ) + ) + ) + ) + ) + (label cfg-19) + (set! (-> arg0 quad) (-> s5-0 quad)) + ) + (none) + ) + ) + +(defmethod get-handle-pos ((this squad-control) (arg0 handle) (arg1 vector)) + (let* ((s5-0 (handle->process arg0)) + (a0-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (new 'stack-no-clear 'vector) + (if a0-5 + (set! (-> arg1 quad) (-> (get-trans (the-as process-focusable a0-5) 0) quad)) + ) + ) + arg1 + ) diff --git a/goal_src/jak3/levels/common/hvehicle/vehicle-hud.gc b/goal_src/jak3/levels/common/hvehicle/vehicle-hud.gc index cc2968bf90..2ed808186a 100644 --- a/goal_src/jak3/levels/common/hvehicle/vehicle-hud.gc +++ b/goal_src/jak3/levels/common/hvehicle/vehicle-hud.gc @@ -5,5 +5,76 @@ ;; name in dgo: vehicle-hud ;; dgos: HGA, LPATK, RAILA, LFACCAR, CWI, WASALL, LFACTORY, COMBA +(declare-type hud-vehicle-turbo hud) +(define-extern hud-vehicle-turbo-spawn (function process hud-vehicle-turbo)) + ;; DECOMP BEGINS +(deftype hud-vehicle-health (hud) + () + ) + + +(defmethod draw ((this hud-vehicle-health)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (+ (the int (* -100.0 (-> this offset))) 5) + 366 + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 4 6) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-4 (fmax 0.0 (fmin 1.0 (-> *game-info* health-bar-vehicle))))) + (set! (-> this sprites 1 color x) (the int (* 255.0 (- 1.0 f0-4)))) + (set! (-> this sprites 1 color y) (the int (* 255.0 f0-4))) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* 20.5 f0-4)) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-vehicle-health)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-vehicle-health)) + (vehicle-entity-hack 27) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-2) (gui-action play) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (lookup-texture-by-name + "hud-small-vehicle-health-bar-01" + (the-as string #f) + (the-as (pointer texture-page) #f) + ) + ) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags)) + (set! (-> this sprites 0 scale-x) 1.43) + (set! (-> this sprites 0 scale-y) 1.3) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 2.5) + (set! (-> this sprites 1 color w) 48) + 0 + (none) + ) + +;; WARN: Return type mismatch process vs hud-vehicle-health. +(defun hud-vehicle-health-spawn ((arg0 vehicle)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn hud-vehicle-health :init hud-init-by-other :name "hud-vehicle-health" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as hud-vehicle-health gp-0) + ) + ) diff --git a/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc b/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc index 04518a91e6..52d8e53129 100644 --- a/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc +++ b/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc @@ -5,5 +5,352 @@ ;; name in dgo: vehicle-manager ;; dgos: HGA, LPATK, RAILA, LFACCAR, CWI, WASALL, LFACTORY, COMBA +(define-extern type-from-vehicle-type (function vehicle-type type)) + +(define-extern h-bike-a type) +(declare-type h-bike-a vehicle) +(define-extern h-bike-b type) +(declare-type h-bike-b vehicle) +(define-extern h-bike-c type) +(declare-type h-bike-c vehicle) +(define-extern h-bike-d type) +(declare-type h-bike-d vehicle) +(define-extern h-car-a type) +(declare-type h-car-a vehicle) +(define-extern h-car-b type) +(declare-type h-car-b vehicle) +(define-extern h-car-c type) +(declare-type h-car-c vehicle) +(define-extern h-car-d type) +(declare-type h-car-d vehicle) +(define-extern h-hellcat type) +(declare-type h-hellcat vehicle) +(define-extern h-warf type) +(declare-type h-warf vehicle) +(define-extern h-glider type) +(declare-type h-glider vehicle) +(define-extern h-sled type) +(declare-type h-sled vehicle) +(define-extern h-kg-pickup type) +(declare-type h-kg-pickup vehicle) +(define-extern v-turtle type) +(declare-type v-turtle vehicle) +(define-extern v-snake type) +(declare-type v-snake vehicle) +(define-extern v-scorpion type) +(declare-type v-scorpion vehicle) +(define-extern v-toad type) +(declare-type v-toad vehicle) +(define-extern v-fox type) +(declare-type v-fox vehicle) +(define-extern v-rhino type) +(declare-type v-rhino vehicle) +(define-extern v-mirage type) +(declare-type v-mirage vehicle) +(define-extern v-x-ride type) +(declare-type v-x-ride vehicle) +(declare-type v-marauder vehicle) +(define-extern v-faccar type) +(declare-type v-faccar vehicle) +(define-extern v-catapult type) +(declare-type v-catapult vehicle) +(define-extern v-marauder-b type) +(declare-type v-marauder-b vehicle) +(define-extern evan-test-bike type) +(declare-type evan-test-bike vehicle) +(define-extern wbike-test type) +(declare-type wbike-test vehicle) +(define-extern test-car type) +(declare-type test-car vehicle) + ;; DECOMP BEGINS +(define *vehicle-rigid-body-queue* (new 'static 'rigid-body-queue)) + +(define *vehicle-info* (new 'static 'vehicle-info)) + +(dotimes (v1-2 44) + (set! (-> *vehicle-info* handle-by-vehicle-type v1-2) (the-as handle #f)) + ) + +(defun vehicle-entity-hack ((arg0 int)) + (with-pp + (case arg0 + ((27) + (set! (-> pp level) (the-as level (-> *traffic-info* vehicle-level))) + ) + (else + (set! (-> pp level) (level-get *level* (-> *traffic-info* vehicle-levels arg0))) + ) + ) + 0 + (none) + ) + ) + +(deftype vehicle-manager (process) + () + (:state-methods + idle + active + ) + (:methods + (vehicle-manager-method-16 (_type_) none) + (vehicle-manager-method-17 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch process vs vehicle-manager. +(defmethod relocate ((this vehicle-manager) (offset int)) + (set! *vehicle-manager* this) + (if *vehicle-manager* + (set! *vehicle-manager* (&+ *vehicle-manager* offset)) + ) + (the-as vehicle-manager ((method-of-type process relocate) this offset)) + ) + +(defmethod deactivate ((this vehicle-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set! *vehicle-manager* #f) + (remove-setting *setting-control* this 'task-mask) + (apply-settings *setting-control*) + ((method-of-type process deactivate) this) + (none) + ) + +(defmethod vehicle-manager-method-17 ((this vehicle-manager)) + 0 + (none) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior vehicle-manager-event-handler vehicle-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('no-extra-bank) + (remove-setting! 'extra-bank) + ) + (('extra-bank) + (let ((a3-1 (-> arg3 param 0))) + (set-setting! 'extra-bank a3-1 0.0 0) + ) + ) + ) + ) + +(defbehavior vehicle-manager-init-by-other vehicle-manager () + (stack-size-set! (-> self main-thread) 128) + (vehicle-entity-hack 27) + (set! *vehicle-manager* self) + (vehicle-manager-method-17 self) + (add-setting! 'task-mask 'clear 0.0 (task-mask vehicle)) + (set! (-> self event-hook) vehicle-manager-event-handler) + (set! *rigid-body-queue-manager* + (the-as rigid-body-queue-manager (rigid-body-queue-manager-spawn *vehicle-rigid-body-queue* self)) + ) + (go-virtual idle) + ) + +(defstate idle (vehicle-manager) + :virtual #t + :event vehicle-manager-event-handler + :code (behavior () + (suspend) + (suspend) + (go-virtual active) + ) + ) + +(defstate active (vehicle-manager) + :virtual #t + :event vehicle-manager-event-handler + :code sleep-code + ) + +(defun vehicle-manager-start ((arg0 process)) + (if *vehicle-manager* + (change-parent *vehicle-manager* arg0) + (process-spawn vehicle-manager :name "vehicle-manager" :to arg0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun vehicle-manager-kill () + (kill-by-type vehicle-manager *active-pool*) + (none) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior vehicle-init-by-other vehicle ((arg0 int) (arg1 traffic-object-spawn-params)) + (stack-size-set! (-> self main-thread) 16) + (logior! (-> self mask) (process-mask vehicle)) + (init-collision! self) + (set! (-> self root trans quad) (-> arg1 position quad)) + (quaternion-copy! (-> self root quat) (-> arg1 rotation)) + (set! (-> self root transv quad) (-> arg1 velocity quad)) + (if (logtest? (-> arg1 flags) (traffic-spawn-flags tsf6)) + (vehicle-method-149 self) + ) + (if (not (logtest? (-> arg1 flags) (traffic-spawn-flags tsf0))) + (vehicle-entity-hack arg0) + ) + (init-rbody-control! self) + (rigid-body-queue-method-11 *vehicle-rigid-body-queue* self) + (if (logtest? (-> arg1 flags) (traffic-spawn-flags tsf5)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag unique) (-> self v-flags)))) + ) + (set! (-> self traffic-priority-id) (the-as int (-> arg1 id))) + (vehicle-method-132 self arg1) + ) + +;; WARN: Return type mismatch process vs vehicle. +(defun vehicle-spawn-hack ((arg0 type) (arg1 traffic-object-spawn-params) (arg2 process)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg0 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg2 "vehicle" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-init-by-other 27 arg1) + (-> s3-0 ppointer) + ) + ) + ) + (when v1-1 + (set! gp-0 (-> v1-1 0)) + (change-parent gp-0 *vehicle-manager*) + ) + ) + (if (and gp-0 (logtest? (-> arg1 flags) (traffic-spawn-flags tsf1))) + (vehicle-method-133 (the-as vehicle gp-0)) + ) + (the-as vehicle gp-0) + ) + ) + +;; WARN: Return type mismatch process vs process-drawable. +(defun vehicle-spawn ((arg0 vehicle-type) (arg1 traffic-object-spawn-params)) + (let ((gp-0 (the-as process #f))) + (cond + ((level-get *level* (-> *traffic-info* vehicle-levels arg0)) + (let* ((a1-3 (type-from-vehicle-type arg0)) + (s3-0 (get-process *default-dead-pool* a1-3 #x4000 1)) + (a0-4 (when s3-0 + (let ((t9-3 (method-of-type process activate))) + (t9-3 s3-0 *vehicle-manager* "vehicle" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-init-by-other arg0 arg1) + (-> s3-0 ppointer) + ) + ) + ) + (when a0-4 + (set! gp-0 (-> a0-4 0)) + (when (logtest? (-> arg1 flags) (traffic-spawn-flags tsf5)) + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type arg0)) 'go-die) + (set! (-> *vehicle-info* handle-by-vehicle-type arg0) (process->handle gp-0)) + ) + ) + ) + ) + (else + 0 + ) + ) + (if (and gp-0 (logtest? (-> arg1 flags) (traffic-spawn-flags tsf1))) + (vehicle-method-133 (the-as vehicle gp-0)) + ) + (the-as process-drawable gp-0) + ) + ) + +(defun type-from-vehicle-type ((arg0 vehicle-type)) + (case arg0 + (((vehicle-type h-bike-a)) + h-bike-a + ) + (((vehicle-type h-bike-b)) + h-bike-b + ) + (((vehicle-type h-bike-c)) + h-bike-c + ) + (((vehicle-type h-bike-d)) + h-bike-d + ) + (((vehicle-type h-car-a)) + h-car-a + ) + (((vehicle-type h-car-b)) + h-car-b + ) + (((vehicle-type h-car-c)) + h-car-c + ) + (((vehicle-type h-hellcat)) + h-hellcat + ) + (((vehicle-type h-warf)) + h-warf + ) + (((vehicle-type h-glider)) + h-glider + ) + (((vehicle-type h-sled)) + h-sled + ) + (((vehicle-type h-kg-pickup)) + h-kg-pickup + ) + (((vehicle-type v-turtle)) + v-turtle + ) + (((vehicle-type v-snake)) + v-snake + ) + (((vehicle-type v-scorpion)) + v-scorpion + ) + (((vehicle-type v-toad)) + v-toad + ) + (((vehicle-type v-fox)) + v-fox + ) + (((vehicle-type v-rhino)) + v-rhino + ) + (((vehicle-type v-mirage)) + v-mirage + ) + (((vehicle-type v-x-ride)) + v-x-ride + ) + (((vehicle-type v-marauder)) + v-marauder + ) + (((vehicle-type v-faccar)) + v-faccar + ) + (((vehicle-type v-catapult)) + v-catapult + ) + (((vehicle-type v-marauder-b)) + v-marauder-b + ) + (((vehicle-type evan-test-bike)) + evan-test-bike + ) + (((vehicle-type wbike-test)) + wbike-test + ) + (((vehicle-type test-car)) + test-car + ) + (else + (the-as type #f) + ) + ) + ) diff --git a/goal_src/jak3/levels/common/race/race-control.gc b/goal_src/jak3/levels/common/race/race-control.gc index 041a4a045b..b3371ae337 100644 --- a/goal_src/jak3/levels/common/race/race-control.gc +++ b/goal_src/jak3/levels/common/race/race-control.gc @@ -7,3 +7,108 @@ ;; DECOMP BEGINS +(deftype race-control (structure) + ((state race-state) + (mesh race-mesh) + (path-select int8) + (path-group race-path-group) + (path race-path) + (path-t float) + (racer-state racer-state) + (path-sample race-path-sample :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) + ) + (:methods + (race-control-method-9 (_type_ int vector) none) + (race-control-method-10 (_type_ race-state racer-state) none) + (race-control-method-11 (_type_ float) none) + (race-control-method-12 (_type_ vector) none) + ) + ) + + +(defmethod race-control-method-12 ((this race-control) (arg0 vector)) + (let* ((f0-0 (-> this path-t)) + (f0-2 (race-path-method-12 (-> this path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) + ) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) + ) + 0 + (none) + ) + +(defmethod race-control-method-11 ((this race-control) (arg0 float)) + (let ((f0-1 (+ (-> this path-t) (* 15.0 arg0)))) + (set! f0-1 (cond + ((logtest? (-> this mesh flags) (race-mesh-flag rmf0)) + (let ((f1-3 (the float (-> this path sample-count)))) + (if (>= f0-1 f1-3) + (set! f0-1 (- f0-1 f1-3)) + ) + ) + f0-1 + ) + (else + (fmin f0-1 (the float (+ (-> this path sample-count) -1))) + ) + ) + ) + (set! (-> this path-t) f0-1) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-1) + ) + (vector-reset! (-> this ang-velocity)) + 0 + (none) + ) + +(defmethod race-control-method-9 ((this race-control) (arg0 int) (arg1 vector)) + (let ((v1-1 (-> this path-group path-count))) + (if (>= arg0 v1-1) + (set! arg0 0) + ) + (set! (-> this path-select) arg0) + (cond + ((> v1-1 0) + (let ((s4-0 (-> this path-group paths arg0))) + (set! (-> this path) s4-0) + (let ((s3-0 (new 'stack-no-clear 'race-mesh-slice-query))) + (set! (-> s3-0 search-sphere quad) (-> arg1 quad)) + (set! (-> s3-0 search-sphere r) 61440.0) + (race-mesh-method-13 (-> this mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) + (when (!= (-> s3-0 slice-id) -1) + (let* ((v1-12 (-> this mesh slices (-> s3-0 slice-id))) + (f0-1 (-> (the-as (pointer float) (+ (* (-> v1-12 start-edge) 4) (the-as int (-> s4-0 edge-infos)))))) + (f1-0 (-> (the-as (pointer float) (+ (* (-> v1-12 end-edge) 4) (the-as int (-> s4-0 edge-infos)))))) + ) + (when (and (>= f0-1 0.0) (>= f1-0 0.0)) + (let ((f0-2 (race-path-method-12 s4-0 arg1 f0-1 f1-0))) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this path) #f) + ) + ) + ) + 0 + (none) + ) + +(defmethod race-control-method-10 ((this race-control) (arg0 race-state) (arg1 racer-state)) + (set! (-> this state) arg0) + (set! (-> this mesh) (-> arg0 info mesh)) + (if (-> this mesh) + (set! (-> this path-group) (-> this mesh path-groups 0)) + ) + (set! (-> this racer-state) arg1) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/common/race/race-h.gc b/goal_src/jak3/levels/common/race/race-h.gc index 0b3882ec92..0b7107da16 100644 --- a/goal_src/jak3/levels/common/race/race-h.gc +++ b/goal_src/jak3/levels/common/race/race-h.gc @@ -5,5 +5,241 @@ ;; name in dgo: race-h ;; dgos: WASLEAPR, DESRALLY, DESTRACK +;; +++racer-info-flag +(defenum racer-info-flag + :type uint8 + :bitfield #t + ) +;; ---racer-info-flag + + +;; +++race-info-flag +(defenum race-info-flag + :type uint8 + :bitfield #t + ) +;; ---race-info-flag + + +;; +++racer-state-flags +(defenum racer-state-flags + :type uint8 + :bitfield #t + ) +;; ---racer-state-flags + + +;; +++race-state-enum +(defenum race-state-enum + :type uint8 + ) +;; ---race-state-enum + + +;; +++race-flag +(defenum race-flag + :type uint8 + ) +;; ---race-flag + + +;; +++race-mesh-flag +(defenum race-mesh-flag + :type uint8 + :bitfield #t + (rmf0 0) + (rmf1 1) + ) +;; ---race-mesh-flag + + ;; DECOMP BEGINS +(deftype race-turbo-pad (structure) + ((position vector :inline) + (handle handle) + ) + ) + + +(deftype race-decision-point (structure) + ((pos float) + (decision-type uint8) + (shortcuts uint8) + (safe-paths uint8) + ) + ) + + +(deftype race-racer-info (structure) + ((rider uint8) + (vehicle uint8) + (flags racer-info-flag) + (seek-offset int8) + ) + ) + + +(deftype race-info (basic) + ((race-mesh-name string) + (path-group-name string) + (task-node uint16) + (mesh race-mesh) + (ai-min-speed-factor float) + (ai-max-speed-factor float) + (ai-spread-factor float) + (start-sphere sphere :inline) + (start-dir vector :inline) + (finish-sphere sphere :inline) + (finish-dir vector :inline) + (player-intro-pos vector :inline) + (flags racer-info-flag) + (score uint8) + (lap-count int8) + (racer-count int8) + (turbo-pad-count int8) + (map-index int8) + (decision-point-count int8) + (safe-paths uint8) + (turbo-pad-array (inline-array race-turbo-pad)) + (racer-array (inline-array race-racer-info)) + (decision-point-array (inline-array race-decision-point)) + (level symbol) + (borrow-level symbol) + (borrow pair) + (manager handle) + (manager-handle-init-hack symbol :overlay-at manager) + (hatch-actor-name string) + (countdown-scene string) + (complete-continue string) + (start-camera string) + (go-speech uint16) + ) + (:methods + (race-info-method-9 () none) + ) + ) + + +(deftype racer-state (structure) + ((position vector :inline) + (racer handle) + (flags racer-state-flags) + (rank int8) + (finish-count int8) + (lap-count int8) + (lap-quadrant int8) + (rider uint8) + (lap-distance float) + (lap-distance-prev float) + (pos float) + (target-pos-offset float) + (speed-factor float) + (finish-time uint32) + (lap-start uint32) + (best-lap-time uint32) + (lap-time-array float 5) + (start-position vector :inline) + ) + (:methods + (racer-state-method-9 () none) + (racer-state-method-10 () none) + (racer-state-method-11 () none) + (racer-state-method-12 () none) + (racer-state-method-13 () none) + ) + ) + + +(deftype race-state (structure) + ((info race-info) + (flags race-flag) + (state race-state-enum) + (racer-count int8) + (finished-count int8) + (i-player int8) + (i-countdown int8) + (manager handle) + (scene-player handle) + (race-signal handle) + (arrow handle) + (hud-timer handle) + (hud-lap-counter handle) + (hud-turbo-counter handle) + (hud-position handle) + (current-time uint32) + (countdown-start-time uint32) + (race-start-time uint32) + (rankings int8 10) + (target-pos float) + (suck-factor float) + (player-win? symbol) + (new-score? symbol) + (racer-array racer-state 10 :inline) + (player-intro-curve cubic-curve :inline) + ) + (:methods + (race-state-method-9 () none) + (race-state-method-10 () none) + (race-state-method-11 () none) + (race-state-method-12 () none) + (race-state-method-13 () none) + (race-state-method-14 () none) + (race-state-method-15 () none) + (race-state-method-16 () none) + (race-state-method-17 () none) + (race-state-method-18 () none) + (race-state-method-19 () none) + (race-state-method-20 () none) + ) + ) + + +(deftype race-manager (process) + ((race-state race-state) + (state-time time-frame) + (player-on-track-time time-frame) + (message-id sound-id) + (finish-sound-id sound-id) + (show-stats? symbol) + ) + (:methods + (race-manager-method-14 () none) + (race-manager-method-15 () none) + (race-manager-method-16 () none) + (race-manager-method-17 () none) + (race-manager-method-18 () none) + (race-manager-method-19 () none) + (race-manager-method-20 () none) + (race-manager-method-21 () none) + (race-manager-method-22 () none) + (race-manager-method-23 () none) + (race-manager-method-24 () none) + (race-manager-method-25 () none) + (race-manager-method-26 () none) + (race-manager-method-27 () none) + ) + ) + + +(deftype hud-race-timer (hud) + () + ) + + +(deftype hud-race-lap-counter (hud) + () + ) + + +(deftype hud-race-turbo-counter (hud) + () + ) + + +(deftype hud-race-position (hud) + () + ) + + +(define *race-manager* (the-as (pointer race-manager) #f)) diff --git a/goal_src/jak3/levels/common/race/race-mesh.gc b/goal_src/jak3/levels/common/race/race-mesh.gc index 2aef51a2fc..637c294723 100644 --- a/goal_src/jak3/levels/common/race/race-mesh.gc +++ b/goal_src/jak3/levels/common/race/race-mesh.gc @@ -7,3 +7,781 @@ ;; DECOMP BEGINS +(deftype race-mesh-hash-search (structure) + ((best-dist float) + (debug-cells-searched int32) + (debug-slices-searched int32) + (bounds bounding-box4w :inline) + (cell-quads vector 2 :inline) + (slice-quads vector 4 :inline) + (cell-bits vector16ub 2 :inline :overlay-at cell-quads) + (slice-bits vector16ub 2 :inline :overlay-at slice-quads) + ) + ) + + +(deftype race-mesh-slice-query (structure) + ((slice-id int16) + (lap-dist float) + (pt-on-slice vector :inline) + (slice-corners vector 4 :inline) + (search-sphere sphere :inline) + ) + ) + + +(deftype race-path-edge-info (structure) + ((sample-t float) + ) + ) + + +(deftype race-path-sample (structure) + ((bytes uint8 32) + (pos vector :inline :overlay-at (-> bytes 0)) + (quat quaternion :inline :overlay-at (-> bytes 16)) + (stick-x int8 :overlay-at (-> bytes 12)) + (stick-y int8 :overlay-at (-> bytes 13)) + (throttle uint8 :overlay-at (-> bytes 14)) + (flags uint8 :overlay-at (-> bytes 15)) + ) + ) + + +(deftype race-path (structure) + ((sample-count uint16) + (record-id int8) + (pad uint8) + (samples (inline-array race-path-sample)) + (edge-infos (inline-array race-path-edge-info)) + ) + (:methods + (draw-path-debug (_type_ rgba rgba) none) + (race-path-method-10 (_type_ vector float float) none) + (race-path-method-11 (_type_ race-path-sample vector float) none) + (race-path-method-12 (_type_ vector float float) float) + ) + ) + + +(deftype race-path-group (structure) + ((name string) + (path-count int8) + (pad uint8 3) + (paths (inline-array race-path)) + ) + ) + + +(deftype race-mesh-edge (structure) + ((left vector :inline) + (right vector :inline) + (lap-dist float :overlay-at (-> left data 3)) + ) + ) + + +(deftype race-mesh-slice (structure) + ((edge-index-array uint16 2) + (start-edge int16 :overlay-at (-> edge-index-array 0)) + (end-edge int16 :overlay-at (-> edge-index-array 1)) + ) + :pack-me + ) + + +(deftype race-mesh-hash-cell (structure) + ((first-slice int16) + (slice-count uint8) + (pad uint8) + ) + ) + + +(deftype race-mesh-hash (structure) + ((cells-wide int8) + (cells-tall int8) + (cell-length float) + (cells (inline-array race-mesh-hash-cell)) + (slice-table (inline-array race-mesh-slice)) + (origin vector :inline) + ) + ) + + +(deftype race-mesh (basic) + ((version uint8) + (path-group-count uint8) + (flags race-mesh-flag) + (pad uint8 1) + (slice-count int16) + (edge-count int16) + (slices (inline-array race-mesh-slice)) + (edges (inline-array race-mesh-edge)) + (hash race-mesh-hash) + (path-groups (inline-array race-path-group)) + ) + (:methods + (debug-draw-path (_type_ int int rgba rgba) none) + (debug-draw-path-from-history (_type_ int int) symbol) + (debug-draw-slice (_type_ int) none) + (debug-draw-edges (_type_) none) + (race-mesh-method-13 (_type_ race-mesh-slice-query) none) + (race-mesh-method-14 (_type_ race-mesh-slice-query) none) + (race-mesh-method-15 (_type_ int race-mesh-slice-query) none) + (race-mesh-method-16 (_type_ race-mesh-slice-query) none) + (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol) + (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none) + (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol) + ) + ) + + +(defmethod race-path-method-10 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) + (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) + (a3-1 (the int arg1)) + ) + (set! (-> v1-0 0 quad) (-> this samples a3-1 pos quad)) + (set! (-> v1-0 1 quad) (-> this samples (+ a3-1 1) pos quad)) + (let ((f0-3 (- arg1 (the float a3-1)))) + (vector-lerp! arg0 (-> v1-0 0) (-> v1-0 1) f0-3) + ) + ) + 0 + (none) + ) + +(defmethod race-path-method-11 ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'race-path-sample 6))) + (let ((f0-1 (the float (-> this sample-count)))) + (if (< f0-1 arg2) + (set! arg2 (- arg2 f0-1)) + ) + (if (< arg2 0.0) + (set! arg2 (+ arg2 f0-1)) + ) + ) + (let ((s1-0 (the int arg2))) + (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> this samples s1-0)) 32) + (mem-copy! (the-as pointer (-> gp-0 1)) (the-as pointer (-> this samples (+ s1-0 1))) 32) + (let ((v1-7 (+ s1-0 2))) + (if (< (the-as int (-> this sample-count)) v1-7) + (set! v1-7 (- v1-7 (the-as int (-> this sample-count)))) + ) + (mem-copy! (the-as pointer (-> gp-0 2)) (the-as pointer (-> this samples v1-7)) 32) + ) + (let ((f30-0 (- arg2 (the float s1-0)))) + (vector-lerp! (-> arg0 pos) (the-as vector (-> gp-0 0)) (the-as vector (-> gp-0 1)) f30-0) + (quaternion-slerp! (-> arg0 quat) (-> gp-0 0 quat) (-> gp-0 1 quat) f30-0) + (set! (-> arg0 stick-x) + (the int (+ 0.5 (* (the float (-> gp-0 1 stick-x)) f30-0) (* (the float (-> gp-0 0 stick-x)) (- 1.0 f30-0)))) + ) + (set! (-> arg0 stick-y) (-> gp-0 0 stick-y)) + (set! (-> arg0 throttle) + (the-as + uint + (the int + (+ 0.5 (* (the float (-> gp-0 1 throttle)) f30-0) (* (the float (-> gp-0 0 throttle)) (- 1.0 f30-0))) + ) + ) + ) + (set! (-> arg0 flags) (-> gp-0 0 flags)) + (vector-! (the-as vector (-> gp-0 4)) (the-as vector (-> gp-0 1)) (the-as vector (-> gp-0 0))) + (vector-float*! (the-as vector (-> gp-0 3)) (the-as vector (-> gp-0 4)) 15.0) + (vector-! (the-as vector (-> gp-0 4)) (the-as vector (-> gp-0 2)) (the-as vector (-> gp-0 1))) + (vector-float*! (the-as vector (-> gp-0 3 quat)) (the-as vector (-> gp-0 4)) 15.0) + (vector-lerp! arg1 (the-as vector (-> gp-0 3)) (the-as vector (-> gp-0 3 quat)) f30-0) + ) + ) + ) + 0 + 0 + (none) + ) + +(defmethod race-path-method-12 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) + (local-vars (v1-15 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 arg2) + (s4-0 (new 'stack-no-clear 'matrix)) + (f30-0 (the float (-> this sample-count))) + ) + (if (< f30-0 gp-0) + (set! gp-0 (- gp-0 f30-0)) + ) + (if (< arg1 0.0) + (set! arg1 (+ arg1 f30-0)) + ) + (race-path-method-10 this (-> s4-0 rvec) arg1 arg2) + (race-path-method-10 this (-> s4-0 uvec) gp-0 arg2) + (vector-! (-> s4-0 fvec) (-> s4-0 uvec) (-> s4-0 rvec)) + (vector-! (-> s4-0 trans) arg0 (-> s4-0 rvec)) + (let ((f0-7 0.0) + (f1-1 1.0) + (f2-1 (vector-dot (-> s4-0 fvec) (-> s4-0 trans))) + ) + (.lvf vf1 (&-> (-> s4-0 fvec) 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-15 vf1) + (let ((f0-8 (fmax f0-7 (fmin f1-1 (/ f2-1 v1-15))))) + (if (< gp-0 arg1) + (set! gp-0 (+ gp-0 f30-0)) + ) + (let ((f0-10 (+ (* arg1 (- 1.0 f0-8)) (* gp-0 f0-8)))) + (if (< f30-0 f0-10) + (set! f0-10 (- f0-10 f30-0)) + ) + (if (< f0-10 0.0) + (+! f0-10 f30-0) + ) + f0-10 + ) + ) + ) + ) + ) + ) + +(defmethod draw-path-debug ((this race-path) (arg0 rgba) (arg1 rgba)) + (local-vars (sv-32 vector) (sv-48 race-path-sample)) + (let ((s0-0 0) + (s3-0 1) + (s2-0 (+ (-> this sample-count) -1)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-32 s1-0) + (let ((v1-1 (-> (math-camera-pos) quad))) + (set! (-> sv-32 quad) v1-1) + ) + (while (< s0-0 (the-as int s2-0)) + (let ((s0-1 (-> this samples s0-0))) + (set! sv-48 (-> this samples s3-0)) + (let ((f0-0 (vector-vector-distance-squared (-> s0-1 pos) s1-0)) + (f1-0 819200.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (add-debug-line #t (bucket-id debug) (-> s0-1 pos) (-> sv-48 pos) arg0 #f arg1) + ) + ) + ) + (set! s0-0 s3-0) + (set! s3-0 (min (+ s3-0 1) (the-as int s2-0))) + ) + ) + (format + *stdcon* + "path ~d time ~5,,3f~%" + (-> this record-id) + (* 0.06666667 (the float (-> this sample-count))) + ) + 0 + (none) + ) + +(defmethod debug-draw-path ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) + (if (< arg0 (-> v1-2 path-count)) + (draw-path-debug (-> v1-2 paths arg0) arg2 arg3) + ) + ) + ) + (none) + ) + +(defmethod debug-draw-path-from-history ((this race-mesh) (arg0 int) (arg1 int)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) + (countdown (a2-1 (-> v1-2 path-count)) + (let ((a0-3 (-> v1-2 paths a2-1))) + (when (= (-> a0-3 record-id) arg0) + (let ((v1-3 (new 'static 'array rgba 16 + (new 'static 'rgba :r #x40 :a #x80) + (new 'static 'rgba :r #xff :g #x30 :b #x30 :a #x80) + (new 'static 'rgba :g #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #xff :g #xff :a #x80) + (new 'static 'rgba :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + ) + (a2-2 (* arg0 2)) + ) + (draw-path-debug a0-3 (-> v1-3 a2-2) (-> v1-3 (+ a2-2 1))) + ) + (return #f) + ) + ) + ) + ) + #f + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod debug-draw-slice ((this race-mesh) (arg0 int)) + (let* ((v1-1 (-> this slices arg0)) + (s3-0 (-> this edges (-> v1-1 start-edge))) + (s4-0 (-> this edges (-> v1-1 end-edge))) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s3-0 left) + (-> s3-0 right) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s3-0 right) + (-> s4-0 right) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 right) + (-> s4-0 left) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 left) + (-> s3-0 left) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector+! s5-0 (-> s3-0 left) (-> s3-0 right)) + (vector+! s5-0 s5-0 (-> s4-0 left)) + (vector+! s5-0 s5-0 (-> s4-0 right)) + (vector-float*! s5-0 s5-0 0.25) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-0 577) + ) + (format (clear *temp-string*) "~D" arg0) + (s4-1 s3-1 (the-as bucket-id s2-0) *temp-string* s5-0 (font-color white) (the-as vector2h #f)) + ) + ) + ) + (none) + ) + +(defmethod debug-draw-edges ((this race-mesh)) + (let ((s5-0 0) + (s4-0 (+ (-> this slice-count) -1)) + ) + (while (>= s4-0 s5-0) + (let* ((v1-2 (-> this slices s5-0)) + (s3-0 (-> this edges (-> v1-2 start-edge))) + (s2-0 (-> this edges (-> v1-2 end-edge))) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 left) (-> s2-0 left) *color-white* #f (the-as rgba -1)) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s3-0 right) + (-> s2-0 right) + *color-white* + #f + (the-as rgba -1) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s2-0 left) (-> s2-0 right) *color-gray* #f (the-as rgba -1)) + ) + (+! s5-0 1) + ) + ) + (let ((v1-8 (-> this edges 0))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> v1-8 left) + (-> v1-8 right) + *color-green* + #f + (the-as rgba -1) + ) + ) + (let ((s5-1 (+ (-> this edge-count) -1))) + (let ((v1-12 (-> this edges s5-1))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> v1-12 left) + (-> v1-12 right) + *color-red* + #f + (the-as rgba -1) + ) + ) + (format *stdcon* "edge-count ~d last-edge ~d~%" (-> this edge-count) s5-1) + ) + 0 + (none) + ) + +(defmethod race-mesh-method-19 ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) + (set! (-> arg1 slice-id) -1) + (let* ((v1-2 (-> this slices arg0)) + (a1-3 (-> this edges (-> v1-2 start-edge))) + (v1-5 (-> this edges (-> v1-2 end-edge))) + ) + (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) + (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) + (set! (-> arg1 slice-corners 2 quad) (-> v1-5 right quad)) + (set! (-> arg1 slice-corners 3 quad) (-> v1-5 left quad)) + ) + (let ((v1-8 (new 'stack-no-clear 'vector)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (countdown (a1-8 4) + (vector-! a0-6 (-> arg1 slice-corners (logand (+ a1-8 1) 3)) (-> arg1 slice-corners a1-8)) + (vector-! v1-8 (the-as vector (-> arg1 search-sphere)) (-> arg1 slice-corners a1-8)) + (if (< (- (* (-> a0-6 z) (-> v1-8 x)) (* (-> a0-6 x) (-> v1-8 z))) 0.0) + (return #f) + ) + ) + ) + (let ((v1-11 (new 'stack-no-clear 'vector)) + (a0-7 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-11 (-> arg1 slice-corners 2) (the-as vector (-> arg1 slice-corners))) + (vector-! a0-7 (the-as vector (-> arg1 search-sphere)) (the-as vector (-> arg1 slice-corners))) + (let ((f0-5 (- (* (-> v1-11 z) (-> a0-7 x)) (* (-> v1-11 x) (-> a0-7 z)))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((< f0-5 0.0) + (vector-! s4-0 (-> arg1 slice-corners 1) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s3-0 s4-0 v1-11) + ) + (else + (vector-! s4-0 (-> arg1 slice-corners 3) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s3-0 v1-11 s4-0) + ) + ) + (vector-normalize! s3-0 1.0) + (set-vector! s4-0 0.0 -1.0 0.0 1.0) + (let ((f0-10 (intersect-ray-plane (-> arg1 search-sphere) s4-0 (the-as vector (-> arg1 slice-corners)) s3-0))) + (vector+float*! (-> arg1 pt-on-slice) (the-as vector (-> arg1 search-sphere)) s4-0 f0-10) + ) + ) + ) + (if (< (- (-> arg1 search-sphere y) (-> arg1 pt-on-slice y)) -8192.0) + (return #f) + ) + (set! (-> arg1 slice-id) arg0) + #t + ) + +(defmethod race-mesh-method-17 ((this race-mesh) (arg0 race-mesh-slice-query)) + (set! (-> arg0 slice-id) -1) + (let* ((s4-0 (-> this hash)) + (v1-2 (max 0 (min + (the int (/ (- (-> arg0 search-sphere x) (-> s4-0 origin x)) (-> s4-0 cell-length))) + (+ (-> s4-0 cells-wide) -1) + ) + ) + ) + (a0-4 (max 0 (min + (the int (/ (- (-> arg0 search-sphere z) (-> s4-0 origin z)) (-> s4-0 cell-length))) + (+ (-> s4-0 cells-tall) -1) + ) + ) + ) + (s3-0 (the-as object (+ (the-as uint (-> s4-0 cells)) (* (+ (* a0-4 (-> s4-0 cells-wide)) v1-2) 4)))) + (s1-0 (-> (the-as race-mesh-hash-cell s3-0) slice-count)) + ) + (when (nonzero? s1-0) + (let ((s2-0 (new 'stack-no-clear 'race-mesh-slice-query))) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg0) 112) + (while (nonzero? s1-0) + (+! s1-0 -1) + (let ((a1-7 (-> (&-> (-> s4-0 slice-table) 0 edge-index-array (+ (-> (the-as (pointer int16) s3-0)) s1-0)) 0))) + (when (race-mesh-method-19 this (the-as int a1-7) s2-0) + (if (or (= (-> arg0 slice-id) -1) + (< (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> arg0 search-sphere)) + (vector-vector-distance-squared (-> arg0 pt-on-slice) (-> arg0 search-sphere)) + ) + ) + (mem-copy! (the-as pointer arg0) (the-as pointer s2-0) 112) + ) + ) + ) + ) + ) + #f + ) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod race-mesh-method-15 ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) + (local-vars (v1-8 symbol)) + (set! (-> arg1 slice-id) arg0) + (let* ((v1-1 (-> this slices arg0)) + (a1-3 (-> this edges (-> v1-1 start-edge))) + (v1-4 (-> this edges (-> v1-1 end-edge))) + ) + (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) + (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) + (set! (-> arg1 slice-corners 2 quad) (-> v1-4 right quad)) + (set! (-> arg1 slice-corners 3 quad) (-> v1-4 left quad)) + ) + (let ((v1-7 (new 'stack-no-clear 'vector)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (countdown (a1-8 4) + (vector-! a0-6 (-> arg1 slice-corners (logand (+ a1-8 1) 3)) (-> arg1 slice-corners a1-8)) + (vector-! v1-7 (the-as vector (-> arg1 search-sphere)) (-> arg1 slice-corners a1-8)) + (when (< (- (* (-> a0-6 z) (-> v1-7 x)) (* (-> a0-6 x) (-> v1-7 z))) 0.0) + (set! v1-8 #f) + (goto cfg-6) + ) + ) + ) + (set! v1-8 #t) + (label cfg-6) + (cond + (v1-8 + (let ((v1-11 (new 'stack-no-clear 'vector)) + (a0-7 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-11 (-> arg1 slice-corners 2) (the-as vector (-> arg1 slice-corners))) + (vector-! a0-7 (the-as vector (-> arg1 search-sphere)) (the-as vector (-> arg1 slice-corners))) + (let ((f0-5 (- (* (-> v1-11 z) (-> a0-7 x)) (* (-> v1-11 x) (-> a0-7 z)))) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((< f0-5 0.0) + (vector-! s5-0 (-> arg1 slice-corners 1) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s4-0 s5-0 v1-11) + ) + (else + (vector-! s5-0 (-> arg1 slice-corners 3) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s4-0 v1-11 s5-0) + ) + ) + (vector-normalize! s4-0 1.0) + (set-vector! s5-0 0.0 -1.0 0.0 1.0) + (let ((f0-10 (intersect-ray-plane (-> arg1 search-sphere) s5-0 (the-as vector (-> arg1 slice-corners)) s4-0))) + (vector+float*! (-> arg1 pt-on-slice) (the-as vector (-> arg1 search-sphere)) s5-0 f0-10) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f30-0 -1.0) + ) + (countdown (s4-1 4) + (let ((f0-11 (vector-segment-distance-point! + (-> arg1 search-sphere) + (-> arg1 slice-corners s4-1) + (-> arg1 slice-corners (logand (+ s4-1 1) 3)) + s5-1 + ) + ) + ) + (when (or (< f30-0 0.0) (< f0-11 f30-0)) + (set! f30-0 f0-11) + (set! (-> arg1 pt-on-slice quad) (-> s5-1 quad)) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod race-mesh-method-18 ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) + (let* ((v1-3 (+ (* arg2 (-> this hash cells-wide)) arg1)) + (a0-1 (/ v1-3 8)) + (a1-2 (ash 1 (logand v1-3 7))) + (a2-4 (-> (the-as race-mesh-hash-search (+ a0-1 (the-as int arg0))) cell-bits 0 data 0)) + ) + (when (not (logtest? a2-4 a1-2)) + (set! (-> arg0 cell-bits 0 data a0-1) (logior a2-4 a1-2)) + (let* ((v1-5 (the-as object (+ (the-as uint (-> this hash cells)) (* v1-3 4)))) + (s3-0 (&-> (-> this hash slice-table) 0 edge-index-array (-> (the-as (pointer int16) v1-5)))) + (s1-0 (-> (the-as race-mesh-hash-cell v1-5) slice-count)) + ) + (when (nonzero? s1-0) + (let ((s2-0 (new 'stack-no-clear 'race-mesh-slice-query))) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg3) 112) + (while (nonzero? s1-0) + (+! s1-0 -1) + (let* ((a1-7 (-> s3-0 0)) + (v1-6 (shr a1-7 3)) + (a0-10 (ash 1 (the-as int (logand a1-7 7)))) + (a2-9 (-> arg0 slice-bits 0 data v1-6)) + ) + (when (not (logtest? a2-9 a0-10)) + (set! (-> arg0 slice-bits 0 data v1-6) (logior a2-9 a0-10)) + (race-mesh-method-15 this (the-as int a1-7) s2-0) + (let ((f0-0 (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> arg3 search-sphere)))) + (when (or (= (-> arg3 slice-id) -1) (< f0-0 (-> arg0 best-dist))) + (set! (-> arg0 best-dist) f0-0) + (mem-copy! (the-as pointer arg3) (the-as pointer s2-0) 112) + ) + ) + ) + ) + (set! s3-0 (&-> s3-0 1)) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod race-mesh-method-16 ((this race-mesh) (arg0 race-mesh-slice-query)) + (set! (-> arg0 slice-id) -1) + (let ((s4-0 (-> this hash)) + (s3-0 (new 'stack-no-clear 'race-mesh-hash-search)) + ) + (let ((v1-3 (/ (+ (-> this slice-count) 127) 128))) + (when (< 4 v1-3) + (break!) + 0 + ) + (while (nonzero? v1-3) + (+! v1-3 -1) + (set! (-> s3-0 slice-bits v1-3 quad) (the-as uint128 0)) + ) + ) + (set! (-> s3-0 cell-bits 0 quad) (the-as uint128 0)) + (set! (-> s3-0 cell-bits 1 quad) (the-as uint128 0)) + (let ((f0-1 (/ 1.0 (-> s4-0 cell-length))) + (f1-2 (fmin (-> arg0 search-sphere r) (* 0.5 (-> s4-0 cell-length)))) + ) + (let ((f3-1 (- (-> arg0 search-sphere x) f1-2)) + (f2-4 (- (-> arg0 search-sphere z) f1-2)) + ) + (set! (-> s3-0 bounds min x) + (max 0 (min (the int (* (- f3-1 (-> s4-0 origin x)) f0-1)) (+ (-> s4-0 cells-wide) -1))) + ) + (set! (-> s3-0 bounds min z) + (max 0 (min (the int (* (- f2-4 (-> s4-0 origin z)) f0-1)) (+ (-> s4-0 cells-tall) -1))) + ) + ) + (let ((f2-9 (+ (-> arg0 search-sphere x) f1-2)) + (f1-3 (+ (-> arg0 search-sphere z) f1-2)) + ) + (set! (-> s3-0 bounds max x) + (max 0 (min (the int (* (- f2-9 (-> s4-0 origin x)) f0-1)) (+ (-> s4-0 cells-wide) -1))) + ) + (set! (-> s3-0 bounds max z) + (max 0 (min (the int (* (- f1-3 (-> s4-0 origin z)) f0-1)) (+ (-> s4-0 cells-tall) -1))) + ) + ) + ) + (let ((s2-0 (-> s3-0 bounds min z))) + (until (< (-> s3-0 bounds max z) s2-0) + (let ((s1-0 (-> s3-0 bounds min x))) + (until (< (-> s3-0 bounds max x) s1-0) + (race-mesh-method-18 this s3-0 s1-0 s2-0 arg0) + (+! s1-0 1) + ) + ) + (+! s2-0 1) + ) + ) + (when (and (= (-> arg0 slice-id) -1) (< (* 0.5 (-> s4-0 cell-length)) (-> arg0 search-sphere r))) + (while (= (-> arg0 slice-id) -1) + (set! (-> s3-0 bounds min x) (max 0 (+ (-> s3-0 bounds min x) -1))) + (set! (-> s3-0 bounds min z) (max 0 (+ (-> s3-0 bounds min z) -1))) + (set! (-> s3-0 bounds max x) (min (+ (-> s3-0 bounds max x) 1) (+ (-> s4-0 cells-wide) -1))) + (set! (-> s3-0 bounds max z) (min (+ (-> s3-0 bounds max z) 1) (+ (-> s4-0 cells-tall) -1))) + (let ((s2-1 (-> s3-0 bounds min x))) + (until (< (-> s3-0 bounds max x) s2-1) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds min z) arg0) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds max z) arg0) + (+! s2-1 1) + ) + ) + (let ((s2-2 (-> s3-0 bounds min z))) + (until (< (-> s3-0 bounds max z) s2-2) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds min x) s2-2 arg0) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds max x) s2-2 arg0) + (+! s2-2 1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod race-mesh-method-14 ((this race-mesh) (arg0 race-mesh-slice-query)) + (let* ((f30-0 (vector-line-distance-point! + (-> arg0 pt-on-slice) + (the-as vector (-> arg0 slice-corners)) + (-> arg0 slice-corners 1) + (the-as vector #f) + ) + ) + (f1-0 (vector-line-distance-point! + (-> arg0 pt-on-slice) + (-> arg0 slice-corners 2) + (-> arg0 slice-corners 3) + (the-as vector #f) + ) + ) + (f0-0 (+ f30-0 f1-0)) + (v1-1 (-> this slices (-> arg0 slice-id))) + (f2-0 (-> this edges (-> v1-1 start-edge) left w)) + (f3-0 (-> this edges (-> v1-1 end-edge) left w)) + ) + (set! (-> arg0 lap-dist) (+ (* (/ f1-0 f0-0) f2-0) (* (/ f30-0 f0-0) f3-0))) + ) + (none) + ) + +(defmethod race-mesh-method-13 ((this race-mesh) (arg0 race-mesh-slice-query)) + (race-mesh-method-17 this arg0) + (if (and (= (-> arg0 slice-id) -1) (< 0.0 (-> arg0 search-sphere r))) + (race-mesh-method-16 this arg0) + ) + (when (!= (-> arg0 slice-id) -1) + (race-mesh-method-14 this arg0) + 0 + ) + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc index 7b2e5fe4ad..38fdfb2072 100644 --- a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc +++ b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc @@ -7,3 +7,267 @@ ;; DECOMP BEGINS +(deftype w-parking-spot (process-drawable) + ((vehicle handle) + (should-spawn? symbol) + (should-cleanup? symbol) + (v-type game-vehicle-u8) + (minimap connection-minimap) + (test-sphere sphere :inline) + (arrow handle) + ) + (:state-methods + idle + ) + (:methods + (w-parking-spot-method-21 (_type_) none) + (w-parking-spot-method-22 (_type_) none) + (w-parking-spot-method-23 (_type_) none) + (w-parking-spot-method-24 (_type_) none) + (w-parking-spot-method-25 (_type_) symbol) + (w-parking-spot-method-26 (_type_) int) + ) + ) + + +(defmethod w-parking-spot-method-24 ((this w-parking-spot)) + (let ((gp-0 (new 'stack-no-clear 'cquery-with-5vec))) + (set! (-> gp-0 vec 0 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec 0 quad)) + (vector-reset! (-> gp-0 vec 1)) + (set! (-> gp-0 vec 1 y) 1.0) + (vector-z-quaternion! (-> gp-0 vec 2) (-> this root quat)) + (set! (-> gp-0 vec 2 y) 0.0) + (vector-normalize! (-> gp-0 vec 2) 1.0) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-6 (-> gp-0 cquery))) + (set! (-> v1-6 radius) 1024.0) + (set! (-> v1-6 collide-with) (collide-spec backgnd)) + (set! (-> v1-6 ignore-process0) #f) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f30-0 0.0) + (vector+float*! (the-as vector (-> gp-0 vec)) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) + (set! (-> gp-0 vec 1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (when (< (-> gp-0 vec 1 y) (cos 3640.889)) + (vector-reset! (-> gp-0 vec 1)) + (set! (-> gp-0 vec 1 y) 1.0) + ) + (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (format #t "w-parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec 0 y)) + ) + (if (< f30-0 0.0) + (format #t "w-parking-spot::find-ground: could not find ground~%") + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec 2) (-> gp-0 vec 1)) + ) + 0 + (none) + ) + +(defmethod w-parking-spot-method-25 ((this w-parking-spot)) + (let ((v1-1 (handle->process (-> this vehicle)))) + (if v1-1 + (or (focus-test? (the-as vehicle v1-1) dead inactive) + (not (logtest? (vehicle-flag waiting-for-player) (-> (the-as vehicle v1-1) v-flags))) + (let ((f0-0 (-> this test-sphere r))) + (< (* f0-0 f0-0) (vector-vector-distance-squared (-> (the-as vehicle v1-1) root trans) (-> this test-sphere))) + ) + (let ((v1-5 *target*)) + (when v1-5 + (if (focus-test? v1-5 pilot-riding) + (= (-> v1-5 pilot vehicle) (-> this vehicle)) + ) + ) + ) + ) + ) + ) + ) + +(defmethod w-parking-spot-method-21 ((this w-parking-spot)) + (let ((s5-0 (handle->process (-> this vehicle)))) + (cond + (s5-0 + (cond + ((w-parking-spot-method-25 this) + (logclear! (-> (the-as vehicle s5-0) v-flags) (vehicle-flag persistent)) + (set! (-> this vehicle) (the-as handle #f)) + ) + ((and (nonzero? (-> *setting-control* user-current vehicles)) + (have-vehicle-v-type? (the-as int (-> this v-type))) + ) + (when (not (handle->process (-> this arrow))) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> this root trans quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags taf8)) + (set! (-> s5-1 map-icon) (the-as uint 12)) + (set! (-> this arrow) (process->handle (task-arrow-spawn s5-1 this))) + ) + ) + ) + (else + (let ((a0-21 (handle->process (-> this arrow)))) + (if a0-21 + (send-event a0-21 'leave) + ) + ) + ) + ) + ) + (else + (let ((a0-25 (handle->process (-> this arrow)))) + (if a0-25 + (send-event a0-25 'leave) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod w-parking-spot-method-23 ((this w-parking-spot)) + (let ((v1-0 #t) + (s5-0 (-> this v-type)) + ) + (if (= s5-0 (game-vehicle-u8 v-scorpion v-toad v-fox)) + (set! s5-0 (-> *game-info* current-vehicle)) + ) + (when *target* + (let ((v1-3 (-> *vehicle-info* handle-by-vehicle-type s5-0))) + (-> *target* pilot) + (set! v1-0 (not (handle->process v1-3))) + ) + ) + (when (and v1-0 (!= s5-0 27) *vehicle-manager*) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 behavior) (the-as uint 0)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (the-as handle #f)) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (traffic-spawn-flags tsf5)) + (set! (-> s4-0 guard-type) (the-as uint 11)) + (set! (-> s4-0 entity) #f) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) + (let ((a0-22 (vehicle-spawn (the-as vehicle-type s5-0) s4-0))) + (when a0-22 + (set! (-> this vehicle) (process->handle a0-22)) + (set! (-> this should-spawn?) #f) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod w-parking-spot-method-26 ((this w-parking-spot)) + (let ((gp-0 0)) + (let ((v1-1 + (res-lump-value (-> this entity) 'vehicle-type-mask int :default (the-as uint128 4096) :time -1000000000.0) + ) + ) + (while (not (logtest? v1-1 1)) + (+! gp-0 1) + (set! v1-1 (the-as int (/ v1-1 2))) + ) + ) + gp-0 + ) + ) + +(defmethod init-from-entity! ((this w-parking-spot) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (set! (-> this minimap) #f) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this should-spawn?) #t) + (set! (-> this should-cleanup?) (= (-> this level name) 'wasdoors)) + (set! (-> this v-type) (the-as game-vehicle-u8 (w-parking-spot-method-26 this))) + (let ((v1-9 (res-lump-struct arg0 'spawn-trans vector))) + (cond + (v1-9 + (set! (-> this root trans quad) (-> v1-9 quad)) + (let ((a1-5 (res-lump-struct arg0 'spawn-quat structure))) + (when a1-5 + (quaternion-copy! (-> this root quat) (the-as quaternion a1-5)) + 0 + ) + ) + ) + (else + (w-parking-spot-method-24 this) + ) + ) + ) + (let ((s5-1 (res-lump-struct (-> this entity) 'on-activate structure))) + (if s5-1 + (set! (-> this should-spawn?) (the-as symbol (script-eval (the-as pair s5-1)))) + ) + ) + (set! (-> this test-sphere quad) (-> this root trans quad)) + (set! (-> this test-sphere r) 24576.0) + (set-time! (-> this state-time)) + (go (method-of-object this idle)) + ) + +(defstate idle (w-parking-spot) + :virtual #t + :exit (behavior () + (w-parking-spot-method-21 self) + (if (and (-> self should-cleanup?) (not (w-parking-spot-method-25 self))) + (send-event (handle->process (-> self vehicle)) 'go-die) + ) + ) + :code (behavior () + (suspend) + (if (-> self should-spawn?) + (w-parking-spot-method-23 self) + ) + (until #f + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.25)) + (suspend) + ) + ) + (w-parking-spot-method-21 self) + (when (-> self should-spawn?) + (let ((f0-0 (vector-vector-distance-squared (camera-pos) (-> self test-sphere))) + (f1-0 327680.0) + ) + (when (< (* f1-0 f1-0) f0-0) + (let ((f1-3 614400.0)) + (if (or (< (* f1-3 f1-3) f0-0) (not (sphere-in-view-frustum? (-> self test-sphere)))) + (w-parking-spot-method-23 self) + ) + ) + ) + ) + ) + ) + #f + (sleep-code) + ) + :post (behavior () + 0 + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc index c6bb24584b..80c2d6b1e9 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc @@ -7,3 +7,115 @@ ;; DECOMP BEGINS +(deftype v-fox (wcar-snake-base) + () + ) + + +(defmethod vehicle-method-62 ((this v-fox)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3317.76 :z 9011.2 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -14336.0 :w 6144.0)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this v-fox)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-fox-constants*) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 2 0) + (set! (-> this shoot-delay) (the-as uint 18)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 8) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 17) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel-blur" (the-as (pointer level) #f))) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc index 7d2342b3aa..45900b27d7 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc @@ -7,3 +7,219 @@ ;; DECOMP BEGINS +(deftype v-mirage (wcar-snake-base) + () + ) + + +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod wvehicle-method-169 ((this v-mirage)) + (sound-play "toad-shot-fire") + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((gp-1 (new 'stack-no-clear 'wcar-toad-stack-var0))) + (set! (-> gp-1 barrel-idx) (-> this i-barrel)) + (set! (-> gp-1 vec10 x) 61440.0) + (set! (-> gp-1 vec10 y) 204800.0) + (set! (-> gp-1 vec10 z) 409600.0) + (set! (-> gp-1 vec10 w) 163840.0) + (let* ((v1-9 (-> gp-1 mat0)) + (a3-1 (-> this rbody matrix)) + (a0-4 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-9 rvec quad) a0-4) + (set! (-> v1-9 uvec quad) a1-1) + (set! (-> v1-9 fvec quad) a2-1) + (set! (-> v1-9 trans quad) a3-2) + ) + (let ((v1-10 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0))) + (vector-matrix*! + (-> gp-1 vec0) + (the-as vector (+ (the-as uint v1-10) (* (-> gp-1 barrel-idx) 16))) + (-> gp-1 mat0) + ) + ) + 0 + (vector-reset! (-> gp-1 vec4)) + (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) + (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) + (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) + (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) + (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> s4-1 length) (fill-actor-list-for-sphere + *actor-hash* + (-> gp-1 vec3) + (-> gp-1 vec9) + (-> gp-1 vec10 x) + (the-as (pointer collide-shape) (-> s4-1 data)) + (-> s4-1 allocated-length) + -1 + ) + ) + (let ((s4-2 (find-nearest-focusable + (the-as (array collide-shape) s4-1) + (-> gp-1 vec3) + (-> gp-1 vec10 z) + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> gp-1 vec1) + (the-as vector #f) + 8192.0 + ) + ) + ) + (when s4-2 + (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) + (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) + (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) + (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (vector-! (-> gp-1 vec5) (-> gp-1 vec7) (-> gp-1 vec2)) + (set! (-> gp-1 vec11 y) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) + (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) + (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) + (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + ) + ) + (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) + (set! (-> gp-1 vec4 y) (fmax (fmin (-> gp-1 vec4 y) (* 0.3638 (-> gp-1 vec10 y))) (* 0.0 (-> gp-1 vec10 y)))) + 0 + ) + ) + ) + (vector-rotate*! (-> gp-1 vec2) (-> gp-1 vec4) (-> gp-1 mat0)) + (vector+! (-> gp-1 vec2) (-> gp-1 vec2) (-> this rbody lin-velocity)) + (set! (-> gp-1 params ent) (-> this entity)) + (set! (-> gp-1 params charge) 1.0) + (set! (-> gp-1 params options) (projectile-options)) + (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) + (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (set! (-> gp-1 params notify-handle) (the-as handle #f)) + (set! (-> gp-1 params owner-handle) (process->handle this)) + (set! (-> gp-1 params target-handle) (the-as handle #f)) + (set! (-> gp-1 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-1 params ignore-handle) (process->handle this)) + (let* ((v1-60 *game-info*) + (a0-37 (+ (-> v1-60 attack-id) 1)) + ) + (set! (-> v1-60 attack-id) a0-37) + (set! (-> gp-1 params attack-id) a0-37) + ) + (set! (-> gp-1 params timeout) (seconds 4)) + (spawn-projectile v-toad-shot (-> gp-1 params) *rigid-body-queue-manager* *default-dead-pool*) + ) + (none) + ) + +(defmethod vehicle-method-62 ((this v-mirage)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z 9011.2 :w 4505.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -11878.4 :w 5734.4)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this v-mirage)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-mirage" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 2 0) + (alloc-rbody-control! this *v-mirage-constants*) + (set! (-> this shoot-delay) (the-as uint 240)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 17) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 19) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc index 513fb39f05..89d72dbc97 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc @@ -7,3 +7,625 @@ ;; DECOMP BEGINS +(deftype v-scorp-shot (projectile) + ((init-pos vector :inline) + (init-dir vector :inline) + (collide-normal vector :inline) + ) + ) + + +(defmethod projectile-method-24 ((this v-scorp-shot)) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this v-scorp-shot)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this init-pos)))) + (draw-beam (-> *part-id-table* 975) (-> this init-pos) s3-1 #t) + (draw-beam (-> *part-id-table* 978) (-> this init-pos) (-> this starting-dir) #f) + (when (not (logtest? (projectile-options po20) (-> this options))) + (let ((s5-0 (-> *part-id-table* 986)) + (s4-0 (-> *part-id-table* 985)) + ) + (new 'stack-no-clear 'vector) + (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> this collide-normal)))) + (vector-normalize! s2-0 1.0) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-x)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-y)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-z)) + (let ((a1-7 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) + (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) + (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (matrix->eul (the-as euler-angles s1-0) a1-7 21) + (vector-negate! s3-2 s1-0) + (let ((a0-15 s3-2)) + (let ((v1-19 s3-2)) + (let ((a1-10 -3640.889)) + (.mov vf6 a1-10) + ) + (.lvf vf4 (&-> v1-19 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-15 quad) vf5) + ) + (sparticle-set-conerot s5-0 s3-2) + (sparticle-set-conerot s4-0 s3-2) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 228 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 228)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 228)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-27 ((this v-scorp-shot)) + (draw-beam (-> *part-id-table* 975) (-> this init-pos) (-> this init-dir) #f) + (draw-beam (-> *part-id-table* 978) (-> this init-pos) (-> this starting-dir) #f) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-scorp-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "scorp-gun-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +(defun v-scorp-shot-move ((arg0 v-scorp-shot)) + (projectile-move-fill-line-sphere arg0) + (cond + ((logtest? (-> arg0 root status) (collide-status touch-actor)) + (projectile-method-26 arg0) + ) + ((logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs collide-status. +(defun cshape-reaction-scorp-shot ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (vector-reset! arg2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (set! (-> (the-as v-scorp-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (let* ((s5-1 (-> arg1 best-other-tri collide-ptr)) + (v1-7 (if (type? s5-1 collide-shape-prim) + s5-1 + ) + ) + (v0-2 4) + ) + (cond + (v1-7 + (set! v0-2 32) + ) + (else + ) + ) + (logior! (-> arg0 status) v0-2) + (the-as collide-status v0-2) + ) + ) + +(defmethod setup-collision! ((this v-scorp-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-scorp-shot) + (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 bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 1228.8) + (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 obstacle pusher shield)) + (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 bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (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! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this v-scorp-shot)) + (with-pp + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 491520.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 491520.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) v-scorp-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) 4.0) + (set! (-> this vehicle-impulse-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + ) + +(deftype v-snake-shot (v-scorp-shot) + () + ) + + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-snake-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "snake-gun-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +(defmethod deal-damage! ((this v-snake-shot) (arg0 process) (arg1 event-message-block)) + (let ((gp-0 ((method-of-type v-scorp-shot deal-damage!) this arg0 arg1))) + (when gp-0 + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (sound-play "snake-riccos") + ) + ) + gp-0 + ) + ) + +(deftype v-rhino-shot (guard-shot) + () + ) + + +(defmethod projectile-method-24 ((this v-rhino-shot)) + (draw-beam (-> *part-id-table* 854) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 855)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this v-rhino-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> s4-0 quad) vf6) + (set! (-> *part-id-table* 980 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 980) a1-0 s5-1 #f) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 981) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000008138021 f30-0)) + (f30-1 (-> *part-id-table* 982 init-specs 3 initial-valuef)) + (f28-0 (-> *part-id-table* 982 init-specs 5 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 982 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 982 init-specs 5 initial-valuef) (* f26-0 f28-0)) + (launch-particles (-> *part-id-table* 982) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 982 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 982 init-specs 5 initial-valuef) f28-0) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this v-rhino-shot)) + (let* ((s5-0 (-> this root)) + (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-1 quad) (-> s5-0 trans quad)) + (vector+! v1-1 v1-1 a0-3) + (cond + ((-> this hit-actor?) + (cond + ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-rhino-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "rhino-gun-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +(defmethod deal-damage! ((this v-rhino-shot) (arg0 process) (arg1 event-message-block)) + (let ((gp-0 ((method-of-type v-scorp-shot deal-damage!) (the-as v-scorp-shot this) arg0 arg1))) + (when gp-0 + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (sound-play "rhino-riccos") + ) + ) + gp-0 + ) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this v-rhino-shot)) + (let ((t9-0 (method-of-type guard-shot init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this damage) 6.0) + (set! (-> this vehicle-damage-factor) 1.0) + (set! (-> this vehicle-impulse-factor) 0.5) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + +(deftype v-toad-shot (projectile) + ((trail-tracker handle) + (blast-radius float) + ) + (:methods + (set-y-vel (_type_) none) + ) + ) + + +(defskelgroup skel-v-toad-shot gun gun-grenade-lod0-jg gun-grenade-idle-ja + ((gun-grenade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :texture-level 10 + ) + +(defmethod play-impact-sound ((this v-toad-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "toad-shot-hit") + ) + ) + ) + 0 + (none) + ) + +(defmethod set-y-vel ((this v-toad-shot)) + (+! (-> this root transv y) (* -163840.0 (seconds-per-frame))) + 0 + (none) + ) + +(defmethod setup-collision! ((this v-toad-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (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 penetrate-using) (penetrate explode)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 819.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set-collide-with! + (-> this root) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set-collide-as! (-> this root) (collide-spec projectile)) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +(defmethod projectile-method-40 ((this v-toad-shot)) + 256 + ) + +(defmethod init-proj-settings! ((this v-toad-shot)) + (set! (-> this attack-mode) 'explode) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-shot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile init-proj-settings!))) + (t9-2 this) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 213) this)) + (set! (-> this blast-radius) 102400.0) + (set! (-> this max-speed) 90112.0) + (set! (-> this timeout) (seconds 4)) + (set! (-> this update-velocity) (method-of-object this set-y-vel)) + (set! (-> this damage) 0.0) + (let ((v1-13 (new 'stack-no-clear 'vector))) + (set! (-> v1-13 x) 2.0) + (set! (-> v1-13 y) 2.0) + (set! (-> v1-13 z) 2.0) + (set! (-> v1-13 w) 1.0) + (set! (-> this root scale quad) (-> v1-13 quad)) + ) + (let ((s5-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> s5-1 tracked-obj) (process->handle this)) + (set! (-> s5-1 appearance) *toad-grenade-trail*) + (set! (-> s5-1 max-num-crumbs) (the int (* 0.5 (the float (-> s5-1 appearance max-age))))) + (set! (-> s5-1 track-immediately?) #t) + (let* ((v1-26 + (estimate-light-trail-mem-usage + (the-as uint (-> s5-1 max-num-crumbs)) + (the-as uint (= (-> s5-1 appearance lie-mode) 3)) + ) + ) + (s4-1 (get-process *default-dead-pool* light-trail-tracker-projectile (+ v1-26 8192) 1)) + ) + (set! (-> this trail-tracker) + (ppointer->handle (when s4-1 + (let ((t9-6 (method-of-type process activate))) + (t9-6 s4-1 this "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-1 light-trail-tracker-init-by-other s5-1) + (-> s4-1 ppointer) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod projectile-method-24 ((this v-toad-shot)) + (draw-beam (-> *part-id-table* 979) (-> this root trans) (-> this starting-dir) #f) + (none) + ) + +(defmethod projectile-method-25 ((this v-toad-shot)) + (spawn (-> this part) (-> this root trans)) + (ja-post) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod projectile-method-39 ((this v-toad-shot)) + (if (logtest? (-> this root status) (collide-status impact-surface)) + (go (method-of-object this impact)) + ) + (none) + ) + +(defstate impact (v-toad-shot) + :virtual #t + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) (-> self blast-radius)) + (set! (-> gp-0 scale) 2.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 230)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 20.0) + (set! (-> gp-0 damage-scale) 3.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle (handle->process (-> self ignore-handle)))) + (explosion-spawn gp-0 self) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-20 (-> self root root-prim))) + (set! (-> v1-20 prim-core collide-as) (collide-spec)) + (set! (-> v1-20 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event (handle->process (-> self trail-tracker)) 'notice 'die) + (while (-> self child) + (suspend) + ) + (deactivate self) + ) + ) + +(deftype v-marauder-shot (guard-shot) + () + ) + + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-marauder-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "inter-gun-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "inter-doppler" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "guard-shot-hit") + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this v-marauder-shot)) + (let ((t9-0 (method-of-type guard-shot init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this vehicle-damage-factor) 0.333) + (set! (-> this vehicle-impulse-factor) 0.25) + (set! (-> this timeout) (seconds 1.25)) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + +(defmethod deal-damage! ((this v-marauder-shot) (arg0 process) (arg1 event-message-block)) + (when ((method-of-type guard-shot deal-damage!) this arg0 arg1) + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (sound-play "inter-riccos") + ) + #t + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc index ede80efbed..ad8e4d6977 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc @@ -7,3 +7,238 @@ ;; DECOMP BEGINS +(deftype v-rhino (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-gun-kick joint-mod-add-local :inline) + (jmod-gun-turn joint-mod-rotate-local :inline) + ) + ) + + +(defmethod wvehicle-method-169 ((this v-rhino)) + (set! (-> this shoot-time) (the-as uint (current-time))) + (set! (-> this gun-kick) 1638.4) + (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) + (let* ((v1-3 (-> gp-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-3) + (set! (-> v1-3 uvec quad) a1-0) + (set! (-> v1-3 fvec quad) a2-0) + (set! (-> v1-3 trans quad) a3-1) + ) + (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) + (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) + (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) + (set! (-> gp-0 params ent) (-> this entity)) + (set! (-> gp-0 params charge) 1.0) + (set! (-> gp-0 params options) (projectile-options)) + (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) + (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (set! (-> gp-0 params notify-handle) (the-as handle #f)) + (set! (-> gp-0 params owner-handle) (process->handle this)) + (set! (-> gp-0 params target-handle) (the-as handle #f)) + (set! (-> gp-0 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 params ignore-handle) (process->handle this)) + (let* ((v1-19 *game-info*) + (a0-20 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-20) + (set! (-> gp-0 params attack-id) a0-20) + ) + (set! (-> gp-0 params timeout) (seconds 4)) + (spawn-projectile v-rhino-shot (-> gp-0 params) *rigid-body-queue-manager* *default-dead-pool*) + ) + 0 + (none) + ) + +(defmethod init-collision! ((this v-rhino)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2305)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2308)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2309)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1040)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((a0-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> a0-18 prim-core action) (collide-action solid)) + (set! (-> a0-18 transform-index) 0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 28262.4) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this v-rhino)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 14336.0 :y -2867.2 :z 15769.6 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -14336.0 :y -2867.2 :z 15769.6 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 15155.2 :y -2867.2 :z -12902.4 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -15155.2 :y -2867.2 :z -12902.4 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 1638.4 :z 15769.6 :w 9830.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 4505.6 :w 11878.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 2457.6 :z -13516.8 :w 9830.4)) + 16 + ) + ) + (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 6553.6 :z 14745.6 :w 1.0) quad)) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod vehicle-method-88 ((this v-rhino) (arg0 vehicle-controls)) + (let ((t9-0 (method-of-type wcar-base vehicle-method-88))) + (t9-0 this arg0) + ) + (wvehicle-method-199 this) + 0 + (none) + ) + +(defmethod vehicle-method-94 ((this v-rhino)) + (let ((f0-0 (vector-length (-> this lin-acceleration)))) + (if (and (< 327680.0 f0-0) (and (not (logtest? (-> this controls flags) (vehicle-controls-flag vcf0))) + (not (-> *setting-control* cam-current entity-name)) + ) + ) + (activate! *camera-smush-control* (fmin 1331.2 (* 0.5 f0-0)) 120 360 1.0 0.9 (-> *display* camera-clock)) + ) + ) + ((method-of-type wcar-base vehicle-method-94) this) + (none) + ) + +(defmethod vehicle-method-79 ((this v-rhino)) + (set! (-> this turbo-supply) 3.0) + (seek! (-> this gun-kick) 0.0 (* 32768.0 (seconds-per-frame))) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set! (-> this jmod-gun-kick transform trans z) (-> this gun-kick)) + (quaternion-axis-angle! (-> s5-0 1) 1.0 0.0 0.0 (- (-> this gun-pitch))) + (quaternion-axis-angle! (-> s5-0 2) 0.0 1.0 0.0 (-> this gun-yaw)) + (quaternion*! (-> this jmod-gun-turn rotation) (-> s5-0 2) (-> s5-0 1)) + ) + 0 + (let ((s5-1 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-1 2) 0.0 0.0 0.0 0.0) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((v1-8 (-> this wheel s4-0))) + (-> v1-8 info) + (quaternion-set! (-> s5-1 0) 0.0 0.0 (-> v1-8 sin-susp-ang) (+ 1.0 (-> v1-8 cos-susp-ang))) + ) + (quaternion-normalize! (-> s5-1 0)) + (quaternion-axis-angle! (-> s5-1 1) 0.0 1.0 0.0 (-> (&-> s5-1 0 data s4-0) 8)) + (let ((v1-13 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-13 rotation) (-> s5-1 0) (-> s5-1 1)) + ) + 0 + ) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this v-rhino)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-rhino" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-rhino-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + (init (-> this jmod-gun-turn) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-kick) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z 12288.0 :w 1.0) quad)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 4) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-rhino-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-rhino-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc index 4092349eaa..bcb893e641 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc @@ -5,5 +5,384 @@ ;; name in dgo: wcar-scorpion ;; dgos: LPATK, LFACCAR, WASALL +(deftype wcar-rhino-proj-params (structure) + ((mat matrix :inline :offset 0) + (gun-local-pos vector :inline :offset 64) + (gun-local-dir vector :inline :offset 80) + (gun-dir vector :inline :offset 96) + (params projectile-init-by-other-params :inline :offset 128) + ) + ) + ;; DECOMP BEGINS +(deftype v-scorpion (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 4 :inline) + (jmod-shock-mids joint-mod-set-local 4 :inline) + (jmod-shock-bots joint-mod-set-local 4 :inline) + (jmod-gun-kick joint-mod-add-local :inline) + (jmod-gun-tilt joint-mod-add-local :inline) + (jmod-gun-turn joint-mod-rotate-local :inline) + ) + ) + + +(defmethod init-collision! ((this v-scorpion)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 16)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((a0-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> a0-18 prim-core action) (collide-action solid)) + (set! (-> a0-18 transform-index) 0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 27033.6) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this v-scorpion)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 12697.6 :y -819.2 :z 14336.0 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -12697.6 :y -819.2 :z 14336.0 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 12697.6 :y -819.2 :z -12492.8 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -12697.6 :y -819.2 :z -12492.8 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 1638.4 :z 14336.0 :w 9830.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 2457.6 :w 9830.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 2457.6 :z -12492.8 :w 9830.4)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod wvehicle-method-169 ((this v-scorpion)) + (set! (-> this shoot-time) (the-as uint (current-time))) + (set! (-> this gun-kick) 1638.4) + (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) + (let* ((v1-3 (-> gp-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-3) + (set! (-> v1-3 uvec quad) a1-0) + (set! (-> v1-3 fvec quad) a2-0) + (set! (-> v1-3 trans quad) a3-1) + ) + (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) + (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) + (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) + (set! (-> gp-0 params ent) (-> this entity)) + (set! (-> gp-0 params charge) 1.0) + (set! (-> gp-0 params options) (projectile-options)) + (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) + (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (set! (-> gp-0 params notify-handle) (the-as handle #f)) + (set! (-> gp-0 params owner-handle) (process->handle this)) + (set! (-> gp-0 params target-handle) (the-as handle #f)) + (set! (-> gp-0 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 params ignore-handle) (process->handle this)) + (let* ((v1-19 *game-info*) + (a0-20 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-20) + (set! (-> gp-0 params attack-id) a0-20) + ) + (set! (-> gp-0 params timeout) (seconds 4)) + (spawn-projectile v-scorp-shot (-> gp-0 params) *rigid-body-queue-manager* *default-dead-pool*) + (let ((v1-23 (get-field-spec-by-id (-> *part-id-table* 967) (sp-field-id spt-omega)))) + (if v1-23 + (set! (-> v1-23 initial-valuef) (+ -20480.0 (-> gp-0 gun-local-pos y))) + ) + ) + (set! (-> gp-0 mat fvec quad) (-> gp-0 gun-local-dir quad)) + (vector-cross! (the-as vector (-> gp-0 mat)) (-> gp-0 mat uvec) (-> gp-0 mat fvec)) + (vector+float*! (-> gp-0 mat trans) (-> gp-0 gun-local-pos) (-> gp-0 gun-local-dir) -12288.0) + (if (logtest? (-> *part-group-id-table* 227 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 227) + :duration 1 + :mat-joint (-> gp-0 mat) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 227) + :duration 1 + :mat-joint (-> gp-0 mat) + ) + ) + ) + (none) + ) + +(defmethod vehicle-method-88 ((this v-scorpion) (arg0 vehicle-controls)) + (let ((t9-0 (method-of-type wcar-base vehicle-method-88))) + (t9-0 this arg0) + ) + (wvehicle-method-199 this) + 0 + (none) + ) + +(defmethod vehicle-method-94 ((this v-scorpion)) + (let ((f0-0 (vector-length (-> this lin-acceleration)))) + (if (and (< 327680.0 f0-0) (not (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)))) + (activate! *camera-smush-control* (fmin 2048.0 (* 0.5 f0-0)) 60 210 1.0 0.9 (-> *display* camera-clock)) + ) + ) + ((method-of-type wcar-base vehicle-method-94) this) + (none) + ) + +(defmethod vehicle-method-79 ((this v-scorpion)) + (seek! (-> this gun-kick) 0.0 (* 32768.0 (seconds-per-frame))) + (new 'stack-no-clear 'vector) + (set! (-> this jmod-gun-kick transform trans z) (-> this gun-kick)) + (set! (-> this jmod-gun-tilt transform trans z) (-> this gun-kick)) + (quaternion-axis-angle! (-> this jmod-gun-tilt transform quat) 1.0 0.0 0.0 (-> this gun-pitch)) + (quaternion-axis-angle! (-> this jmod-gun-turn rotation) 0.0 1.0 0.0 (+ 32768.0 (-> this gun-yaw))) + 0 + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-0 2) -1638.4 -1638.4 1638.4 1638.4) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((v1-9 (-> this wheel s4-0))) + (-> v1-9 info) + (quaternion-set! (-> s5-0 0) 0.0 0.0 (-> v1-9 sin-susp-ang) (+ 1.0 (-> v1-9 cos-susp-ang))) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 1.0 0.0 (-> (&-> s5-0 0 data s4-0) 8)) + (let ((v1-14 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-14 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'wvehicle-physics-work))) + (let* ((v1-20 (-> s5-1 mat)) + (a3-4 (-> this node-list data 0 bone transform)) + (a0-15 (-> a3-4 rvec quad)) + (a1-6 (-> a3-4 uvec quad)) + (a2-6 (-> a3-4 fvec quad)) + (a3-5 (-> a3-4 trans quad)) + ) + (set! (-> v1-20 rvec quad) a0-15) + (set! (-> v1-20 uvec quad) a1-6) + (set! (-> v1-20 fvec quad) a2-6) + (set! (-> v1-20 trans quad) a3-5) + ) + (set! (-> s5-1 force quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) + (set! (-> s5-1 velocity quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) + (set! (-> s5-1 world-pos quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) + (set! (-> s5-1 world-normal quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) + (set-vector! (-> s5-1 local-pos) 27670.756 27670.756 28398.934 28398.934) + (dotimes (s4-1 4) + (let ((s3-0 (-> this wheel s4-1))) + (let ((v1-29 (-> s3-0 info))) + (set! (-> s5-1 ground-pos x) (+ -3276.8 (-> v1-29 susp-arm-length))) + (set! (-> s5-1 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) + (set! (-> s5-1 steering-axis quad) (-> v1-29 local-pos quad)) + ) + (+! (-> s5-1 steering-axis x) (* (-> s5-1 ground-pos x) (-> s3-0 cos-susp-ang))) + (+! (-> s5-1 steering-axis y) (* (-> s5-1 ground-pos x) (-> s3-0 sin-susp-ang))) + (set! (-> s5-1 p-body quad) (-> s5-1 steering-axis quad)) + (set! (-> s5-1 p-body x) (* (-> s5-1 p-body x) (-> s3-0 x-scale))) + (set! (-> s5-1 tmp x) (* (-> s5-1 tmp x) (-> s3-0 x-scale))) + (vector-! (-> s5-1 axis) (-> s5-1 p-body) (-> s5-1 tmp)) + (set! (-> s5-1 ground-pos z) (vector-length (-> s5-1 axis))) + (set! (-> s5-1 ground-pos y) + (- (-> s5-1 local-pos data s4-1) (* (atan (-> s5-1 axis x) (-> s5-1 axis y)) (-> s3-0 x-scale))) + ) + (let ((v1-40 (-> this jmod-shock-tops s4-1))) + (quaternion-axis-angle! (-> v1-40 rotation) 0.0 0.0 1.0 (-> s5-1 ground-pos y)) + ) + 0 + (let ((v1-44 (-> this jmod-shock-mids s4-1))) + (set! (-> v1-44 transform trans y) (* -0.5 (-> s5-1 ground-pos z) (-> s3-0 x-scale))) + ) + 0 + (let ((v1-48 (-> this jmod-shock-bots s4-1))) + (set! (-> v1-48 transform trans y) (* -1.0 (+ -2048.0 (* 0.5 (-> s5-1 ground-pos z))) (-> s3-0 x-scale))) + ) + ) + 0 + 0 + ) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this v-scorpion)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-scorpion" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-scorpion-constants*) + (set! (-> this rider-hand-joint-array 0) 3) + (init (-> this jmod-gun-turn) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-tilt) this (the-as uint 5) (joint-mod-base-flags attached trans quat)) + (init (-> this jmod-gun-kick) this (the-as uint 6) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 7) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 16) (joint-mod-base-flags attached)) + (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z -10240.0 :w 1.0) quad)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 9) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 17) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 20) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 10) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 18) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 13) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 21) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-bots)) + this + (the-as uint 11) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-bots 1) this (the-as uint 19) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-bots 2) this (the-as uint 14) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-bots 3) this (the-as uint 22) (joint-mod-base-flags attached trans)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-scorpion-wheel" (the-as (pointer level) #f))) + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-v-scorpion-wheel-blur" (the-as (pointer level) #f)) + ) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + (set! (-> this gun-aim-yaw) 0.0) + (set! (-> this gun-aim-yaw-vel) 0.0) + (set! (-> this gun-yaw) 0.0) + (set! (-> this gun-pitch) 0.0) + (set! (-> this shoot-delay) (the-as uint 30)) + (set! (-> this lock-turret) #f) + 0 + (none) + ) + +(defmethod rbody-event-handler ((this v-scorpion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('set-string-height) + (set-setting! 'string-min-height 'abs (-> arg3 param 0) 0) + (set-setting! 'string-max-height 'abs (-> arg3 param 0) 0) + #t + ) + (('draw-turret) + (if (-> arg3 param 0) + (setup-masks (-> this draw) 2 0) + (setup-masks (-> this draw) 0 2) + ) + ) + (('use-camera) + (if (-> arg3 param 0) + (vehicle-method-80 this) + (vehicle-method-81 this) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc index 30c1e24822..b4087d9f90 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc @@ -7,3 +7,115 @@ ;; DECOMP BEGINS +(deftype v-snake (wcar-snake-base) + () + ) + + +(defmethod vehicle-method-62 ((this v-snake)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z 9011.2 :w 4505.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -11878.4 :w 5734.4)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this v-snake)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 4 0) + (alloc-rbody-control! this *v-snake-constants*) + (set! (-> this shoot-delay) (the-as uint 18)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 17) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 19) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc index 5dadeff6cf..9a68a3744a 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc @@ -5,5 +5,527 @@ ;; name in dgo: wcar-toad ;; dgos: LPATK, LFACCAR, WASALL +(deftype wcar-toad-stack-var0 (structure) + ((params projectile-init-by-other-params :inline :offset 0) + (mat0 matrix :inline :offset 128) + (vec0 vector :inline :offset 256) + (vec1 vector :inline :offset 272) + (vec2 vector :inline :offset 288) + (vec3 vector :inline :offset 304) + (vec4 vector :inline :offset 320) + (vec5 vector :inline :offset 336) + (vec6 vector :inline :offset 368) + (vec7 vector :inline :offset 384) + (vec8 vector :inline :offset 416) + (vec9 vector :inline :offset 432) + (vec10 vector :inline :offset 448) + (vec11 vector :inline :offset 464) + (barrel-idx int8 :offset 480) + ) + ) + ;; DECOMP BEGINS +(deftype v-toad (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 2 :inline) + (jmod-shock-bots joint-mod-set-local 2 :inline) + ) + (:methods + (v-toad-method-203 (_type_ vehicle-wheel-state vehicle-wheel-info) none) + ) + ) + + +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod wvehicle-method-169 ((this v-toad)) + (sound-play "toad-shot-fire") + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((gp-1 (new 'stack-no-clear 'wcar-toad-stack-var0))) + (set! (-> gp-1 barrel-idx) (-> this i-barrel)) + (set! (-> gp-1 vec10 x) 61440.0) + (set! (-> gp-1 vec10 y) 204800.0) + (set! (-> gp-1 vec10 z) 409600.0) + (set! (-> gp-1 vec10 w) 163840.0) + (let* ((v1-9 (-> gp-1 mat0)) + (a3-1 (-> this rbody matrix)) + (a0-4 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-9 rvec quad) a0-4) + (set! (-> v1-9 uvec quad) a1-1) + (set! (-> v1-9 fvec quad) a2-1) + (set! (-> v1-9 trans quad) a3-2) + ) + (let ((v1-10 (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 7372.8 :z 6144.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 7372.8 :z 6144.0 :w 1.0) + ) + ) + ) + (vector-matrix*! (-> gp-1 vec0) (-> v1-10 (-> gp-1 barrel-idx)) (-> gp-1 mat0)) + ) + 0 + (vector-reset! (-> gp-1 vec4)) + (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) + (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) + (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) + (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) + (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> s4-1 length) (fill-actor-list-for-sphere + *actor-hash* + (-> gp-1 vec3) + (-> gp-1 vec9) + (-> gp-1 vec10 x) + (the-as (pointer collide-shape) (-> s4-1 data)) + (-> s4-1 allocated-length) + -1 + ) + ) + (let ((s4-2 (find-nearest-focusable + (the-as (array collide-shape) s4-1) + (-> gp-1 vec3) + (-> gp-1 vec10 z) + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> gp-1 vec1) + (the-as vector #f) + 8192.0 + ) + ) + ) + (when s4-2 + (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) + (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) + (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) + (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (vector-! (-> gp-1 vec5) (-> gp-1 vec7) (-> gp-1 vec2)) + (set! (-> gp-1 vec11 y) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) + (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) + (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) + (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + ) + ) + (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) + (set! (-> gp-1 vec4 y) (fmax (fmin (-> gp-1 vec4 y) (* 0.3638 (-> gp-1 vec10 y))) (* 0.0 (-> gp-1 vec10 y)))) + 0 + ) + ) + ) + (vector-rotate*! (-> gp-1 vec2) (-> gp-1 vec4) (-> gp-1 mat0)) + (vector+! (-> gp-1 vec2) (-> gp-1 vec2) (-> this rbody lin-velocity)) + (set! (-> gp-1 params ent) (-> this entity)) + (set! (-> gp-1 params charge) 1.0) + (set! (-> gp-1 params options) (projectile-options)) + (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) + (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (set! (-> gp-1 params notify-handle) (the-as handle #f)) + (set! (-> gp-1 params owner-handle) (process->handle this)) + (set! (-> gp-1 params target-handle) (the-as handle #f)) + (set! (-> gp-1 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-1 params ignore-handle) (process->handle this)) + (let* ((v1-60 *game-info*) + (a0-37 (+ (-> v1-60 attack-id) 1)) + ) + (set! (-> v1-60 attack-id) a0-37) + (set! (-> gp-1 params attack-id) a0-37) + ) + (set! (-> gp-1 params timeout) (seconds 4)) + (spawn-projectile v-toad-shot (-> gp-1 params) *rigid-body-queue-manager* *default-dead-pool*) + ) + (none) + ) + +(defmethod vehicle-method-88 ((this v-toad) (arg0 vehicle-controls)) + ((method-of-type wcar-base vehicle-method-88) this arg0) + 0 + (none) + ) + +(defmethod on-impact ((this v-toad) (arg0 rigid-body-impact)) + (when (and (logtest? (vehicle-flag vf56) (-> this v-flags)) (-> arg0 process)) + (let ((a0-2 (-> arg0 process))) + (if a0-2 + (send-event + a0-2 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker (process->handle this)) + ) + ) + ) + ) + ) + ) + ((method-of-type wcar-base on-impact) this arg0) + (none) + ) + +(defmethod vehicle-method-93 ((this v-toad)) + (let ((t9-0 (method-of-type wcar-base vehicle-method-93))) + (t9-0 this) + ) + (if (logtest? (vehicle-flag vf56) (-> this v-flags)) + (set! (-> this rbody lin-momentum y) (* -409600.0 (-> this info info mass))) + ) + 0 + (none) + ) + +(defmethod init-collision! ((this v-toad)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-6 prim-core action) (collide-action solid)) + (set! (-> a0-6 transform-index) 0) + ) + (let ((a0-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-8 prim-core action) (collide-action solid)) + (set! (-> a0-8 transform-index) 0) + ) + (let ((a0-10 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-10 prim-core action) (collide-action solid)) + (set! (-> a0-10 transform-index) 0) + ) + (let ((a0-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-12 prim-core action) (collide-action solid)) + (set! (-> a0-12 transform-index) 0) + ) + (let ((a0-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-14 prim-core action) (collide-action solid)) + (set! (-> a0-14 transform-index) 0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1168)))) + (set! (-> v1-21 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-21 transform-index) 0) + (set! (-> v1-21 nav-radius) 20480.0) + ) + (let ((a0-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 16)))) + (set! (-> a0-19 prim-core action) (collide-action solid)) + (set! (-> a0-19 transform-index) 0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action solid rideable)) + (set! (-> v1-25 transform-index) 3) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 28672.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (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 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this v-toad)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 11264.0 :y 2252.8 :z 20275.2 :w 5120.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -11264.0 :y 2252.8 :z 20275.2 :w 5120.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 12697.6 :y 3481.6 :z -12083.2 :w 6553.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -12697.6 :y 3481.6 :z -12083.2 :w 6553.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 4096.0 :z 14336.0 :w 6963.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 5324.8 :z 1228.8 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 5324.8 :z -10649.6 :w 6963.2)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod v-toad-method-203 ((this v-toad) (arg0 vehicle-wheel-state) (arg1 vehicle-wheel-info)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-physics-work))) + (set-vector! (-> gp-0 p-body) 1.0 0.0 0.0 1.0) + (set-vector! (-> gp-0 axis) 0.0 1.0 0.0 1.0) + (quaternion-copy! (the-as quaternion (-> gp-0 world-normal)) (-> this root quat)) + (let* ((v1-3 (-> gp-0 mat)) + (a3-0 (-> this rbody matrix)) + (a0-7 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-7) + (set! (-> v1-3 uvec quad) a1-2) + (set! (-> v1-3 fvec quad) a2-1) + (set! (-> v1-3 trans quad) a3-1) + ) + (set! (-> gp-0 wsphere y) (* (-> arg1 radius) (-> arg1 scale))) + (set! (-> gp-0 wsphere z) 13590.528) + (set! (-> gp-0 wsphere r) 0.0) + (set! (-> gp-0 friction-coef) + (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (* 0.5 (-> arg1 travel)) (-> gp-0 wsphere z))))) + ) + (set! (-> gp-0 steering-axis quad) (-> (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0) quad)) + (set-vector! + (-> gp-0 ground-pos) + 0.0 + (* -1.0 (- (sin (-> gp-0 friction-coef)) (sin (-> gp-0 wsphere r))) (-> gp-0 wsphere z)) + (* (- (cos (-> gp-0 friction-coef)) (cos (-> gp-0 wsphere r))) (-> gp-0 wsphere z)) + 1.0 + ) + (vector-normalize! (-> gp-0 ground-pos) 1.0) + (set! (-> gp-0 tmp quad) (-> gp-0 steering-axis quad)) + (+! (-> gp-0 tmp z) (* (-> gp-0 wsphere z) (cos (-> gp-0 wsphere r)))) + (+! (-> gp-0 tmp y) (* -1.0 (sin (-> gp-0 wsphere r)) (-> gp-0 wsphere z))) + (set! (-> gp-0 tmp y) (- (-> gp-0 tmp y) (-> gp-0 wsphere y))) + (set! (-> gp-0 tmp x) (* (-> gp-0 tmp x) (-> arg0 x-scale))) + (vector+float*! + (-> gp-0 tmp) + (-> gp-0 tmp) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (set! (-> arg0 probe-local-pos quad) (-> gp-0 tmp quad)) + (set! (-> arg0 probe-local-dir quad) (-> gp-0 ground-pos quad)) + (vector-matrix*! (-> gp-0 side-dir) (-> gp-0 tmp) (-> gp-0 mat)) + (vector-rotate*! (-> gp-0 forward-dir) (-> gp-0 ground-pos) (-> gp-0 mat)) + (set! (-> gp-0 wsphere x) + (- (+ (-> arg0 probe-local-pos y) + (-> gp-0 wsphere y) + (* (-> arg0 probe-local-dir y) (-> arg0 pos2) (-> arg1 travel)) + ) + (-> gp-0 steering-axis y) + ) + ) + (set! (-> arg0 sin-susp-ang) (fmax -1.0 (fmin 1.0 (/ (- (-> gp-0 wsphere x)) (-> gp-0 wsphere z))))) + (let ((f0-52 1.0) + (f1-16 (-> arg0 sin-susp-ang)) + ) + (set! (-> arg0 cos-susp-ang) (sqrtf (- f0-52 (* f1-16 f1-16)))) + ) + (quaternion-identity! (the-as quaternion (-> gp-0 local-pos))) + (set! (-> gp-0 local-pos z) (* (sin (-> arg1 camber)) (-> arg0 x-scale))) + (set! (-> gp-0 local-pos w) (cos (-> arg1 camber))) + (when (logtest? (-> arg1 flags) (vehicle-wheel-flag vwf5)) + (quaternion-set! + (the-as quaternion (-> gp-0 force)) + 0.0 + 0.0 + (* (-> arg0 sin-susp-ang) (-> arg0 x-scale)) + (+ 1.0 (-> arg0 cos-susp-ang)) + ) + (quaternion-normalize! (the-as quaternion (-> gp-0 force))) + (quaternion*! + (the-as quaternion (-> gp-0 local-pos)) + (the-as quaternion (-> gp-0 local-pos)) + (the-as quaternion (-> gp-0 force)) + ) + ) + (set! (-> gp-0 dir quad) (-> gp-0 steering-axis quad)) + (+! (-> gp-0 dir z) (* (-> gp-0 wsphere z) (-> arg0 cos-susp-ang))) + (+! (-> gp-0 dir y) (* -1.0 (-> arg0 sin-susp-ang) (-> gp-0 wsphere z))) + (set! (-> gp-0 dir x) (* (-> gp-0 dir x) (-> arg0 x-scale))) + (vector+float*! + (-> gp-0 dir) + (-> gp-0 dir) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (vector-matrix*! (-> gp-0 ground-normal-sum) (-> gp-0 dir) (-> gp-0 mat)) + (quaternion-vector-angle! (the-as quaternion (-> gp-0 world-pos)) (-> gp-0 axis) (-> arg0 steer-angle)) + (quaternion-vector-angle! (the-as quaternion (-> gp-0 velocity)) (-> gp-0 p-body) (-> arg0 angle)) + (quaternion*! + (the-as quaternion (-> gp-0 force)) + (the-as quaternion (-> gp-0 world-pos)) + (the-as quaternion (-> gp-0 local-pos)) + ) + (quaternion*! + (the-as quaternion (-> gp-0 force)) + (the-as quaternion (-> gp-0 force)) + (the-as quaternion (-> gp-0 velocity)) + ) + (quaternion*! (-> arg0 quat) (the-as quaternion (-> gp-0 world-normal)) (the-as quaternion (-> gp-0 force))) + (set! (-> arg0 trans quad) (-> gp-0 ground-normal-sum quad)) + ) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this v-toad)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-axis-angle! (-> s5-0 1) 1.0 0.0 0.0 -5355.7476) + (dotimes (s4-0 2) + (let ((v1-3 (-> this wheel s4-0))) + (-> v1-3 info) + (quaternion-set! (-> s5-0 0) (-> v1-3 sin-susp-ang) 0.0 0.0 (+ 1.0 (-> v1-3 cos-susp-ang))) + ) + (quaternion-normalize! (-> s5-0 0)) + (let ((v1-6 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-6 rotation) (-> s5-0 1) (-> s5-0 0)) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'quaternion 1)) + (s4-1 2) + ) + (while (< s4-1 4) + (let ((v1-13 (-> this wheel s4-1))) + (-> v1-13 info) + (quaternion-set! + (-> s5-1 0) + 0.0 + 0.0 + (* (-> v1-13 sin-susp-ang) (-> v1-13 x-scale)) + (+ 1.0 (-> v1-13 cos-susp-ang)) + ) + ) + (quaternion-normalize! (-> s5-1 0)) + (let ((v1-16 (-> this jmod-axles s4-1))) + (quaternion-copy! (-> v1-16 rotation) (-> s5-1 0)) + ) + 0 + (+! s4-1 1) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'wvehicle-physics-work))) + (let* ((v1-19 (-> s5-2 mat)) + (a3-3 (-> this node-list data 0 bone transform)) + (a0-12 (-> a3-3 rvec quad)) + (a1-5 (-> a3-3 uvec quad)) + (a2-4 (-> a3-3 fvec quad)) + (a3-4 (-> a3-3 trans quad)) + ) + (set! (-> v1-19 rvec quad) a0-12) + (set! (-> v1-19 uvec quad) a1-5) + (set! (-> v1-19 fvec quad) a2-4) + (set! (-> v1-19 trans quad) a3-4) + ) + (set! (-> s5-2 force quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) + (set! (-> s5-2 velocity quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) + (set-vector! (-> s5-2 local-pos) 32768.0 32768.0 0.0 0.0) + (dotimes (s4-2 2) + (let ((v1-26 (-> this wheel (+ s4-2 2)))) + (let ((a0-20 (-> v1-26 info))) + (set! (-> s5-2 ground-pos y) (+ -2048.0 (-> a0-20 susp-arm-length))) + (set! (-> s5-2 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-2 16) 64) (the-as int s5-2))))) + (set! (-> s5-2 steering-axis quad) (-> a0-20 local-pos quad)) + ) + (+! (-> s5-2 steering-axis x) (* (-> s5-2 ground-pos y) (-> v1-26 cos-susp-ang))) + (+! (-> s5-2 steering-axis y) (* (-> s5-2 ground-pos y) (-> v1-26 sin-susp-ang))) + (set! (-> s5-2 p-body quad) (-> s5-2 steering-axis quad)) + (set! (-> s5-2 p-body x) (* (-> s5-2 p-body x) (-> v1-26 x-scale))) + (set! (-> s5-2 tmp x) (* (-> s5-2 tmp x) (-> v1-26 x-scale))) + ) + (vector-! (-> s5-2 axis) (-> s5-2 p-body) (-> s5-2 tmp)) + (set! (-> s5-2 ground-pos x) (vector-length (-> s5-2 axis))) + (set! (-> s5-2 ground-pos z) (- (-> s5-2 local-pos data s4-2) (atan (-> s5-2 axis x) (-> s5-2 axis y)))) + (let ((v1-34 (-> this jmod-shock-tops s4-2))) + (quaternion-axis-angle! (-> v1-34 rotation) 0.0 0.0 1.0 (-> s5-2 ground-pos z)) + ) + 0 + (let ((v1-38 (-> this jmod-shock-bots s4-2))) + (set! (-> v1-38 transform trans y) (* -1.0 (+ -3686.4 (-> s5-2 ground-pos x)))) + ) + 0 + 0 + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch (function v-toad vehicle-wheel-state vehicle-wheel-info none) vs none. +(defmethod rigid-body-object-method-37 ((this v-toad)) + (let ((t9-0 (method-of-type wcar-base rigid-body-object-method-37))) + (t9-0 this) + ) + (set! (-> this info physics-model front-wheel callback) (method-of-object this v-toad-method-203)) + (none) + ) + +(defmethod init-rbody-control! ((this v-toad)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-toad-constants*) + (set! (-> this rider-hand-joint-array 0) 14) + (set! (-> this shoot-delay) (the-as uint 300)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 10) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 12) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-bots)) + this + (the-as uint 11) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-bots 1) this (the-as uint 13) (joint-mod-base-flags attached trans)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc index 860614140a..a965aebc7a 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc @@ -7,3 +7,264 @@ ;; DECOMP BEGINS +(deftype v-turtle (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 4 :inline) + (jmod-shock-mids joint-mod-set-local 4 :inline) + (jmod-antenna joint-mod-rotate-local 4 :inline) + (ant-tip-vel vector :inline) + (spring-pos vector :inline) + (spring-vel vector :inline) + ) + ) + + +(defmethod init-collision! ((this v-turtle)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (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 action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 16)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-22 prim-core action) (collide-action solid rideable)) + (set! (-> v1-22 transform-index) 3) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-24 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this v-turtle)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 7782.4 :y 1638.4 :z 7987.2 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -7782.4 :y 1638.4 :z 7987.2 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 7372.8 :y 4096.0 :z -8601.6 :w 3686.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -7372.8 :y 4096.0 :z -8601.6 :w 3686.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 4505.6 :z 4096.0 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 5324.8 :z -6553.6 :w 6144.0)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + (none) + ) + +(defmethod vehicle-method-79 ((this v-turtle)) + (local-vars (v1-33 float) (v1-47 float) (v1-52 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set-vector! (-> this root scale) 1.0 1.0 1.07 1.0) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-0 2) -3640.889 3640.889 3640.889 -3640.889) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((v1-6 (-> this wheel s4-0))) + (-> v1-6 info) + (let ((s3-0 (-> this jmod-axles s4-0))) + (quaternion-set! + (-> s5-0 0) + 0.0 + 0.0 + (* (-> v1-6 sin-susp-ang) (-> v1-6 x-scale)) + (+ 1.0 (-> v1-6 cos-susp-ang)) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 1.0 0.0 (-> (&-> s5-0 0 data s4-0) 8)) + (quaternion*! (-> s3-0 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'wvehicle-physics-work))) + (set! (-> s5-1 mat trans x) (seconds-per-frame)) + (vector-matrix*! (-> s5-1 mat uvec) (new 'static 'vector :y 20480.0 :z -8192.0 :w 1.0) (-> this rbody matrix)) + (rigid-body-control-method-23 (-> this rbody) (-> s5-1 mat uvec) (the-as vector (-> s5-1 mat))) + (vector-! (-> s5-1 mat fvec) (the-as vector (-> s5-1 mat)) (-> this ant-tip-vel)) + (set! (-> this ant-tip-vel quad) (-> s5-1 mat rvec quad)) + (vector-float*! (-> s5-1 mat fvec) (-> s5-1 mat fvec) (/ 1.0 (-> s5-1 mat trans x))) + (vector+float*! + (-> this spring-vel) + (-> this spring-vel) + (-> s5-1 mat fvec) + (* -0.00024414062 (-> s5-1 mat trans x)) + ) + (set! (-> s5-1 mat trans y) 500.0) + (set! (-> s5-1 mat trans z) 5.0) + (vector+float*! + (-> this spring-vel) + (-> this spring-vel) + (-> this spring-pos) + (* -1.0 (-> s5-1 mat trans x) (-> s5-1 mat trans y)) + ) + (vector-float*! + (-> this spring-vel) + (-> this spring-vel) + (fmax 0.0 (+ 1.0 (* -1.0 (-> s5-1 mat trans z) (-> s5-1 mat trans x)))) + ) + (vector+float*! (-> this spring-pos) (-> this spring-pos) (-> this spring-vel) (-> s5-1 mat trans x)) + ) + (set! (-> this spring-pos y) 0.0) + (.lvf vf1 (&-> (-> this spring-pos) 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-33 vf1) + (let ((f0-27 v1-33)) + (when (< 1.0 f0-27) + (vector-float*! (-> this spring-pos) (-> this spring-pos) (/ 1.0 (sqrtf f0-27))) + (vector-reset! (-> this spring-vel)) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'wvehicle-jmod-work))) + (quaternion-conjugate! (-> s5-2 quat1) (-> this root quat)) + (quaternion->matrix (-> s5-2 mat0) (-> s5-2 quat1)) + (set! (-> s5-2 float0) 8192.0) + (set! (-> s5-2 float2) (sin (* 0.5 (-> s5-2 float0)))) + (set! (-> s5-2 float1) (cos (* 0.5 (-> s5-2 float0)))) + (vector-rotate90-around-y! (-> s5-2 vec0) (-> this spring-pos)) + (vector-float*! (-> s5-2 vec0) (-> s5-2 vec0) (* -1.0 (-> s5-2 float2))) + (vector-rotate*! (-> s5-2 vec0) (-> s5-2 vec0) (-> s5-2 mat0)) + (set! (-> s5-2 quat0 x) (-> s5-2 vec0 x)) + (set! (-> s5-2 quat0 y) (-> s5-2 vec0 y)) + (set! (-> s5-2 quat0 z) (-> s5-2 vec0 z)) + (let ((f0-42 1.0)) + (.lvf vf1 (&-> (-> s5-2 vec0) 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-47 vf1) + (set! (-> s5-2 quat0 w) (sqrtf (- f0-42 v1-47))) + ) + (quaternion-copy! (-> this jmod-antenna 0 rotation) (-> s5-2 quat0)) + (vector-float*! (-> s5-2 vec0) (-> s5-2 vec0) 1.0) + (set! (-> s5-2 quat0 x) (-> s5-2 vec0 x)) + (set! (-> s5-2 quat0 y) (-> s5-2 vec0 y)) + (set! (-> s5-2 quat0 z) (-> s5-2 vec0 z)) + (let ((f0-49 1.0)) + (.lvf vf1 (&-> (-> s5-2 vec0) 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-52 vf1) + (set! (-> s5-2 quat0 w) (sqrtf (- f0-49 v1-52))) + ) + (quaternion-copy! (-> this jmod-antenna 1 rotation) (-> s5-2 quat0)) + (quaternion-copy! (-> this jmod-antenna 2 rotation) (-> s5-2 quat0)) + (quaternion-copy! (-> this jmod-antenna 3 rotation) (-> s5-2 quat0)) + ) + 0 + (none) + ) + ) + +(defmethod init-rbody-control! ((this v-turtle)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-turtle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-turtle-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-antenna)) + this + (the-as uint 9) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-antenna 1) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this jmod-antenna 2) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this jmod-antenna 3) this (the-as uint 12) (joint-mod-base-flags attached)) + (vector-reset! (-> this ant-tip-vel)) + (vector-reset! (-> this spring-pos)) + (vector-reset! (-> this spring-vel)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-turtle-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-turtle-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc index 2b9dd1a280..1687bfb201 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc @@ -7,3 +7,115 @@ ;; DECOMP BEGINS +(deftype v-x-ride (wcar-snake-base) + () + ) + + +(defmethod vehicle-method-62 ((this v-x-ride)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3317.76 :z 9011.2 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -14336.0 :w 6144.0)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this v-x-ride)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-x-ride" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 4 0) + (alloc-rbody-control! this *v-x-ride-constants*) + (set! (-> this shoot-delay) (the-as uint 18)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 8) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 17) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel-blur" (the-as (pointer level) #f))) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar.gc b/goal_src/jak3/levels/desert/wvehicle/wcar.gc index 5e34049d5d..3418643c4d 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar.gc @@ -5,5 +5,4256 @@ ;; name in dgo: wcar ;; dgos: LPATK, LFACCAR, WASALL +(deftype wcar-proj-init-by-other-params (structure) + ((params projectile-init-by-other-params :inline :offset 0) + (vec1 vector :inline :offset 32) + (mat0 matrix :inline :offset 128) + (mat1 matrix :inline :offset 192) + (vec0 vector 8 :inline :offset 256) + (barrel-idx int8 :offset 384) + ) + ) + +(deftype wcar-stack-type1 (structure) + ((vec0 vector 10 :inline :offset 0) + (vec1 vector 3 :inline :offset 176) + (float01 float :offset 252) + (float0 float :offset 256) + (float2 float :offset 260) + ) + ) + ;; DECOMP BEGINS +(define *v-turtle-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 3.0 + :inv-mass 0.33333334 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 819.2 :z -409.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3.5) (meters 2.5) (meters 5.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-turtle-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-turtle) + :engine (new 'static 'vehicle-engine-info + :max-torque 83886080.0 + :inertia 8192.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 4000.0 + :min-rpm 700.0 + :max-rpm 6000.0 + :peak-torque-rpm 3200.0 + :powerband-width-rpm 4000.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 4096.0 + :upshift-rpm 4500.0 + :downshift-rpm 2500.0 + :final-drive-ratio 9.0 + :gear-ratio-array (new 'static 'array float 8 -3.375 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 0.7 + :turbo-boost-duration (seconds 3.5) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4551.1113 + :tire-steering-speed-factor 34816.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.3 + :tire-friction-factor 1.0 + :tire-static-friction 1.516 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.98539996 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 40960.0 + :air-pitch-torque 81920.0 + :air-angular-damping 0.97 + :hop-turn-torque 225280.0 + :ground-torque-scale 0.45 + :ai-steering-factor 4.0 + :ai-throttle-factor 0.5 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 9011.2 :z -4915.2 :w 1.0) + (new 'static 'vector :x -20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :x 20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :y 12288.0 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "turt-scrape") + :glance-sound (static-sound-name "turt-glance") + :impact-sound (static-sound-name "turt-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "turt-flutter") + :water-sound (static-sound-name "turt-water") + :jump-sound (static-sound-name "turt-hop") + :turbo-sound (static-sound-name "turt-boost") + :bank-replace '((wasall1 wasturt)) + :idle-rpm 900.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 3000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "turt-start") + :stop-sound (static-sound-name "turt-stop") + :idle-sound (static-sound-name "turt-idle") + :engine-sound (static-sound-name "turt-steady") + :susp-creak-sound (static-sound-name "turt-bounce") + :susp-bottom-out-sound (static-sound-name "turt-bottom") + :susp-speed-threshold 81920.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 5120.0 :y 3276.8 :z -12697.6 :w 1.0) + (new 'static 'vector :x -5120.0 :y 3276.8 :z -12697.6 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 5242.88 :y 3399.68 :z -12288.0 :w 1.0) + (new 'static 'vector :x -5242.88 :y 3399.68 :z -12288.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 + (new 'static 'vector :x 0.4 :y 0.1 :z -1.0 :w 1.0) + (new 'static 'vector :x -0.4 :y 0.1 :z -1.0 :w 1.0) + ) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 5120.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -1024.0 :y 5120.0 :z -10240.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1843.2 :y 2867.2 :z 8601.6 :w 1.0) + (new 'static 'vector :x -1843.2 :y 2867.2 :z 8601.6 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 6758.4 :z -11264.0 :w 1.0) + (new 'static 'vector :x -2457.6 :y 6758.4 :z -11264.0 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.8333333 + :hit-points 29.997 + :inv-hit-points 0.033336665 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 4300.8 :y -491.52 :z 9420.8 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf4) + :inertia 4300800.0 + :radius 2334.72 + :susp-arm-length 2867.2 + :steer-arm-length 1638.4 + :scale 1.4 + :travel 2867.2 + :probe-y-offset -2048.0 + :width 2867.2 + :suspension-spring 0.6 + :suspension-damping 0.4 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 2048.0 + :tread-texture "tread-turtle" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 3891.2 :y 409.6 :z -10035.199 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2) + :inertia 4915200.0 + :radius 2334.72 + :susp-arm-length 3481.6 + :steer-arm-length 2048.0 + :scale 1.6 + :travel 3440.6401 + :probe-y-offset -1474.56 + :width 2867.2 + :suspension-spring 0.7 + :suspension-damping 0.4 + :forward-grip 1.15 + :side-grip 1.15 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 2457.6 + :tread-texture "tread-turtle" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 4341.76 + :settle-rot-x -546.13336 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :y 2007.04 :z 819.2 :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1228.8 :y 614.4 :z -368.64 :w 1.0) + (new 'static 'vector :x -1228.8 :y 614.4 :z -368.64 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-turtle) + ) + ) + +(define *v-snake-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 2.5) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-snake-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-snake) + :engine (new 'static 'vehicle-engine-info + :max-torque 167772160.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 14.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.75 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38912.0 + :tire-steering-speed-bias 36864.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 2.178 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 1.4157 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 737280.0 + :ground-torque-scale 0.55 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2048.0 :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "snake-scrape") + :glance-sound (static-sound-name "snake-glance") + :impact-sound (static-sound-name "snake-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "snake-flutter") + :water-sound (static-sound-name "snake-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "snake-idle") + :engine-sound (static-sound-name "snake-steady") + :susp-creak-sound (static-sound-name "snake-bounce") + :susp-bottom-out-sound (static-sound-name "snake-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 39.996 + :inv-hit-points 0.025002502 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.2 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-snake" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-snake" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-snake) + ) + ) + +(define *v-scorpion-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 24.0 + :inv-mass 0.041666668 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y -4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 8) (meters 4) (meters 8)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-scorpion-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-scorpion) + :engine (new 'static 'vehicle-engine-info + :max-torque 335544320.0 + :inertia 65536.0 + :drag 0.4 + :idle-rpm 500.0 + :clutch-min-rpm 800.0 + :clutch-max-rpm 5100.0 + :min-rpm 300.0 + :max-rpm 6500.0 + :peak-torque-rpm 3400.0 + :powerband-width-rpm 4180.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 16384.0 + :upshift-rpm 5000.0 + :downshift-rpm 1000.0 + :final-drive-ratio 30.0 + :gear-ratio-array (new 'static 'array float 8 -1.35 1.8225001 1.35 1.0 0.0 0.0 0.0 0.0) + :gear-count 4 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 0.5 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.2 + :player-turn-anim-min -0.2 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 2002.4889 + :tire-steering-speed-factor 40960.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.8 + :tire-friction-factor 1.0 + :tire-static-friction 1.0 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.65 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.4 + :rolling-resistance 0.16 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 3.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 512000.0 + :air-pitch-torque 1024000.0 + :air-angular-damping 0.98 + :hop-turn-torque 2580480.0 + :ground-torque-scale 0.75 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 6.5) + :string-max-height (meters 6.5) + :string-min-length (meters 10.049999) + :string-max-length (meters 13.125) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2867.2 :y 6144.0 :z 8601.6 :w 1.0) + (new 'static 'vector :x -40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :x 40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :y 30720.0 :z 40960.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "scorp-scrape") + :glance-sound (static-sound-name "scorp-glance") + :impact-sound (static-sound-name "scorp-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "scorp-flutter") + :water-sound (static-sound-name "scorp-water") + :jump-sound (static-sound-name "scorp-hop") + :turbo-sound (static-sound-name "scorp-boost") + :bank-replace '((wasall1 wasscorp)) + :idle-rpm 700.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 800.0 + :engine-rpm 2500.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "scorp-start") + :stop-sound (static-sound-name "scorp-stop") + :idle-sound (static-sound-name "scorp-idle") + :engine-sound (static-sound-name "scorp-steady") + :susp-creak-sound (static-sound-name "scorp-bounce") + :susp-bottom-out-sound (static-sound-name "scorp-bottom") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 4096.0 :z -7372.8 :w 1.0) + (new 'static 'vector :x -3686.4 :y 4096.0 :z -7372.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 4915.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 4915.2 :z -4096.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :y 1.0 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :z -1638.4 :w 1.0) + (new 'static 'vector :x -6144.0 :z -1638.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector :x -5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7577.6 :y -2048.0 :z -18022.4 :w 1.0) + (new 'static 'vector :x -7577.6 :y -2048.0 :z -18022.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 79.992 + :inv-hit-points 0.012501251 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 3686.4 :y -4096.0 :z 14336.0 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 12288.0 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7864.3203 + :probe-y-offset -4423.68 + :width 2048.0 + :suspension-spring 0.36 + :suspension-damping 0.2 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.81 + :probe-radius 4096.0 + :tread-texture "tread-scorpion" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 3686.4 :y -4096.0 :z -12492.8 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 12288.0 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7864.3203 + :probe-y-offset -4423.68 + :width 2048.0 + :suspension-spring 0.36 + :suspension-damping 0.2 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 4096.0 + :tread-texture "tread-scorpion" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 13598.72 + :settle-rot-x -163.84 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -2730.6667 + :gun-pitch-max 5461.3335 + :gun-z-offset 11059.2 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :attach-point-count 14 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -3072.0 :y 204.8 :z 12697.6 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 3072.0 :y 204.8 :z 12697.6 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x -1638.4 :y 6963.2 :z 13107.2 :w 1.0) + (new 'static 'vector :x -4300.8 :y 6963.2 :z 13107.2 :w 1.0) + ) + :attach-point-array (new 'static 'inline-array vehicle-attach-point 14 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z 7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y -1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y 1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 2048.0 :z -16384.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z -15155.2 :w 1.0) + :rot (new 'static 'vector :x -9102.223 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z 7281.778 :w 1.0) + ) + ) + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-scorpion) + ) + ) + +(define *v-toad-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 16.0 + :inv-mass 0.0625 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 819.2 :z 2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 4) (meters 10)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-toad-constants* + :flags #x386318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-toad) + :engine (new 'static 'vehicle-engine-info + :max-torque 117440510.0 + :inertia 8192.0 + :drag 0.4 + :idle-rpm 500.0 + :clutch-min-rpm 800.0 + :clutch-max-rpm 5100.0 + :min-rpm 300.0 + :max-rpm 6500.0 + :peak-torque-rpm 3400.0 + :powerband-width-rpm 4180.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 4096.0 + :upshift-rpm 5000.0 + :downshift-rpm 2000.0 + :final-drive-ratio 20.0 + :gear-ratio-array (new 'static 'array float 8 -1.8225001 2.4603753 1.8225001 1.35 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 60.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.8 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4551.1113 + :tire-steering-speed-factor 45056.0 + :tire-steering-speed-bias 36864.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.694 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 1.1011 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.3 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 2.0 + :jump-thrust-factor 2.4 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 151552.0 + :air-pitch-torque 307200.0 + :air-angular-damping 0.98 + :hop-turn-torque 614400.0 + :ground-torque-scale 0.4 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 3) + :string-max-height (meters 4.5) + :string-min-length (meters 6) + :string-max-length (meters 9) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :normal-max-angle-offset 21845.334 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2048.0 :y 10649.6 :z -4915.2 :w 1.0) + (new 'static 'vector :x -40960.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 40960.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 40960.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "toad-scrape") + :glance-sound (static-sound-name "toad-glance") + :impact-sound (static-sound-name "toad-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "toad-flutter") + :water-sound (static-sound-name "toad-water") + :jump-sound (static-sound-name "toad-hop") + :turbo-sound (static-sound-name "toad-boost") + :bank-replace '((wasall1 wastoad)) + :idle-rpm 900.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 700.0 + :engine-rpm 5300.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "toad-start") + :stop-sound (static-sound-name "toad-stop") + :idle-sound (static-sound-name "toad-idle") + :engine-sound (static-sound-name "toad-steady") + :susp-creak-sound (static-sound-name "toad-bounce") + :susp-bottom-out-sound (static-sound-name "toad-bottom") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :taillight-count 2 + :thruster-flame-width (meters 1) + :thruster-flame-length (meters 6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y 5447.68 :z -14336.0 :w 1.0) + (new 'static 'vector :y 5447.68 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y -1228.8 :z -5324.8 :w 1.0) + (new 'static 'vector :x -2457.6 :y -1228.8 :z -5324.8 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -1638.4 :w 1.0) + (new 'static 'vector :x -3072.0 :z -1638.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 9830.4 :z -8192.0 :w 1.0) + (new 'static 'vector :x -2457.6 :y 9830.4 :z -8192.0 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.6666667 + :hit-points 49.995 + :inv-hit-points 0.020002 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :y -3686.4 :z 19456.0 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf4) + :inertia 2048000.0 + :radius 4915.2 + :susp-arm-length 12288.0 + :steer-arm-length 2048.0 + :scale 1.0 + :travel 12288.0 + :width 4096.0 + :suspension-spring 0.3 + :suspension-damping 0.051 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.606 + :probe-radius 4096.0 + :tread-texture "tread-toad" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 2048.0 :y 819.2 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 4915.2 + :susp-arm-length 13516.8 + :scale 1.5 + :travel 8601.6 + :probe-y-offset -3686.4001 + :width 2867.2 + :suspension-spring 0.65 + :suspension-damping 0.1 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 4096.0 + :tread-texture "tread-toad" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 9338.88 + :settle-rot-x 91.022224 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2457.6 :y 3276.8 :z -1228.8 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1228.8 :y 942.08 :z -860.16 :w 1.0) + (new 'static 'vector :x -1433.6 :y 942.08 :z -860.16 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-toad) + ) + ) + +(define *v-fox-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-fox-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-fox) + :engine (new 'static 'vehicle-engine-info + :max-torque 218103800.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 11.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.32 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 491520.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "snake-scrape") + :glance-sound (static-sound-name "snake-glance") + :impact-sound (static-sound-name "snake-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "snake-flutter") + :water-sound (static-sound-name "snake-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "snake-idle") + :engine-sound (static-sound-name "snake-steady") + :susp-creak-sound (static-sound-name "snake-bounce") + :susp-bottom-out-sound (static-sound-name "snake-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 1) + :thruster-flame-length (meters 6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 33.329998 + :inv-hit-points 0.030003002 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 4915.2 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 0.83199996 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 4096.0 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-toad" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 4915.2 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.04 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-toad" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 1638.4 :z -5324.8 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-fox) + ) + ) + +(define *v-rhino-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 30.0 + :inv-mass 0.033333335 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y -4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 7) (meters 4) (meters 8)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-rhino-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-rhino) + :engine (new 'static 'vehicle-engine-info + :max-torque 335544320.0 + :inertia 65536.0 + :drag 0.4 + :idle-rpm 500.0 + :clutch-min-rpm 800.0 + :clutch-max-rpm 5100.0 + :min-rpm 300.0 + :max-rpm 6500.0 + :peak-torque-rpm 3400.0 + :powerband-width-rpm 4180.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 16384.0 + :upshift-rpm 5000.0 + :downshift-rpm 1000.0 + :final-drive-ratio 28.0 + :gear-ratio-array (new 'static 'array float 8 -1.35 2.4603753 1.8225001 1.35 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 4.0 + :turbo-boost-duration (seconds 0.25) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 2002.4889 + :tire-steering-speed-factor 51200.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.8 + :tire-friction-factor 1.0 + :tire-static-friction 0.9 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.585 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.4 + :rolling-resistance 0.16 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 3.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.125 + :player-weight 122880.0 + :air-roll-torque 512000.0 + :air-pitch-torque 1024000.0 + :air-angular-damping 0.98 + :hop-turn-torque 4300800.0 + :ground-torque-scale 0.37 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 5.655) + :string-max-height (meters 5.655) + :string-min-length (meters 10.049999) + :string-max-length (meters 13.125) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -4915.2 :y 14336.0 :z -8192.0 :w 1.0) + (new 'static 'vector :x -40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :x 40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :y 30720.0 :z 40960.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "rhino-scrape") + :glance-sound (static-sound-name "rhino-glance") + :impact-sound (static-sound-name "rhino-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :water-sound (static-sound-name "rhino-water") + :jump-sound (static-sound-name "rhino-hop") + :turbo-sound (static-sound-name "rhino-boost") + :bank-replace '((wasall1 wasrhino)) + :idle-rpm 500.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 800.0 + :engine-rpm 3785.0 + :engine-crossover-rpm 1400.0 + :start-sound (static-sound-name "rhino-start") + :stop-sound (static-sound-name "rhino-stop") + :idle-sound (static-sound-name "rhino-idle") + :engine-sound (static-sound-name "rhino-steady") + :susp-creak-sound (static-sound-name "rhino-bounce") + :susp-bottom-out-sound (static-sound-name "rhino-bottom") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 1.5) + :thruster-flame-length (meters 5) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4915.2 :y 2744.32 :z -19660.8 :w 1.0) + (new 'static 'vector :x -4915.2 :y 2744.32 :z -19660.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 4915.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 4915.2 :z -4096.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :y 1.0 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :z -1638.4 :w 1.0) + (new 'static 'vector :x -6144.0 :z -1638.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector :x -5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7577.6 :y -2048.0 :z -18022.4 :w 1.0) + (new 'static 'vector :x -7577.6 :y -2048.0 :z -18022.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 79.992 + :inv-hit-points 0.012501251 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 7372.8 :y -4096.0 :z 15769.6 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 7372.8 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7208.9604 + :probe-y-offset -5079.0396 + :width 1638.4 + :suspension-spring 0.55 + :suspension-damping 0.3 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.81 + :probe-radius 4505.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 7372.8 :y -4096.0 :z -12902.4 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 8192.0 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7208.9604 + :probe-y-offset -5079.0396 + :width 1638.4 + :suspension-spring 0.55 + :suspension-damping 0.3 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 4505.6 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 14663.68 + :settle-rot-x -163.84 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -21845.334 + :gun-yaw-max 21845.334 + :gun-pitch-min -5461.3335 + :gun-pitch-max 8192.0 + :gun-z-offset 6963.2 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :attach-point-count 14 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -4915.2 :y 4915.2 :z -4096.0 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 4915.2 :y 4915.2 :z -4096.0 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 614.4 :z -1024.0 :w 1.0) + (new 'static 'vector :x -1638.4 :y 614.4 :z -1024.0 :w 1.0) + ) + :attach-point-array (new 'static 'inline-array vehicle-attach-point 14 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z 7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y -1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y 1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 2048.0 :z -16384.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z -15155.2 :w 1.0) + :rot (new 'static 'vector :x -9102.223 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z 7281.778 :w 1.0) + ) + ) + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-rhino) + ) + ) + +(define *v-mirage-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 10.0 + :inv-mass 0.1 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5.5) (meters 3) (meters 7)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-mirage-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-mirage) + :engine (new 'static 'vehicle-engine-info + :max-torque 218103800.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 12.5 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 2.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 1392640.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2048.0 :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "mir-scrape") + :glance-sound (static-sound-name "mir-glance") + :impact-sound (static-sound-name "mir-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "mir-flutter") + :water-sound (static-sound-name "mir-water") + :jump-sound (static-sound-name "mir-hop") + :turbo-sound (static-sound-name "mir-boost") + :bank-replace '((wasall1 wasmir)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "mir-start") + :stop-sound (static-sound-name "mir-stop") + :idle-sound (static-sound-name "mir-idle") + :engine-sound (static-sound-name "mir-steady") + :susp-creak-sound (static-sound-name "mir-bounce") + :susp-bottom-out-sound (static-sound-name "mir-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.8 + :hit-points 46.662 + :inv-hit-points 0.021430716 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.1 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 0.75 :y 0.9 :z 1.05 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-mirage) + ) + ) + +(define *v-x-ride-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-x-ride-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-x-ride) + :engine (new 'static 'vehicle-engine-info + :max-torque 234881020.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 10.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.694 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 1.1011 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.3 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.6 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 491520.0 + :ground-torque-scale 0.75 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "snake-scrape") + :glance-sound (static-sound-name "snake-glance") + :impact-sound (static-sound-name "snake-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "snake-flutter") + :water-sound (static-sound-name "snake-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "snake-idle") + :engine-sound (static-sound-name "snake-steady") + :susp-creak-sound (static-sound-name "snake-bounce") + :susp-bottom-out-sound (static-sound-name "snake-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 1) + :thruster-flame-length (meters 6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 39.996 + :inv-hit-points 0.025002502 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.2 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-snake" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-snake" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 0.9 :y 1.1 :z 0.9 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 1638.4 :z -5324.8 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-x-ride) + ) + ) + +(define *v-marauder-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 2.5) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-marauder-constants* + :flags #x81310 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-marauder) + :engine (new 'static 'vehicle-engine-info + :max-torque 117440510.0 + :inertia 16384.0 + :drag 0.4 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 700.0 + :max-rpm 6500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 2000.0 + :final-drive-ratio 12.5 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1677721600.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 1392640.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6963.2 :z -6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "inter-scrape") + :glance-sound (static-sound-name "inter-glance") + :impact-sound (static-sound-name "inter-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "inter-flutter") + :water-sound (static-sound-name "inter-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "inter-idle") + :engine-sound (static-sound-name "inter-steady") + :susp-creak-sound (static-sound-name "inter-bounce") + :susp-bottom-out-sound (static-sound-name "inter-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 2.0 + :hit-points 30.0 + :inv-hit-points 0.033333335 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.2 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.8 + :probe-radius 2867.2 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5488.64 + :settle-rot-x 728.1778 + :shadow-bot-clip -32768.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(define *v-faccar-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 819.2 :z -409.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6.5) (meters 3) (meters 8)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-faccar-constants* + :flags #x287318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-faccar) + :engine (new 'static 'vehicle-engine-info + :max-torque 83886080.0 + :inertia 8192.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 4000.0 + :min-rpm 700.0 + :max-rpm 6000.0 + :peak-torque-rpm 3200.0 + :powerband-width-rpm 4000.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 4096.0 + :upshift-rpm 4500.0 + :downshift-rpm 2900.0 + :final-drive-ratio 9.0 + :gear-ratio-array (new 'static 'array float 8 -3.375 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 2.0 + :turbo-boost-duration (seconds 0.25) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4551.1113 + :tire-steering-speed-factor 34816.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.3 + :tire-friction-factor 1.0 + :tire-static-friction 1.516 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.98539996 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 2.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 40960.0 + :air-pitch-torque 81920.0 + :air-angular-damping 0.97 + :hop-turn-torque 1228800.0 + :ground-torque-scale 0.45 + :ai-steering-factor 4.0 + :ai-throttle-factor 0.5 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2457.6 :y 9011.2 :z -4915.2 :w 1.0) + (new 'static 'vector :x -20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :x 20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :y 12288.0 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "fac-scrape-mtl") + :glance-sound (static-sound-name "fac-glance") + :impact-sound (static-sound-name "fac-impact-hard") + :explode-sound (static-sound-name "fac-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "fac-flutter") + :water-sound (static-sound-name "fac-water") + :jump-sound (static-sound-name "fac-hop") + :turbo-sound (static-sound-name "fac-boost") + :bank-replace '((factory6 facveh)) + :idle-rpm 1400.0 + :idle-pitch-scale 0.25 + :idle-crossover-rpm 1500.0 + :engine-rpm 2500.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "fac-start") + :stop-sound (static-sound-name "fac-stop") + :idle-sound (static-sound-name "fac-idle") + :engine-sound (static-sound-name "fac-steady") + :susp-creak-sound (static-sound-name "fac-bounce") + :susp-bottom-out-sound (static-sound-name "fac-bottom") + :susp-speed-threshold 81920.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-hum") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 1843.2 :z -14336.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 1843.2 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 1843.2 :z -14336.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 1843.2 :z -14336.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 5120.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -1024.0 :y 5120.0 :z -10240.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x -2867.2 :y 6963.2 :z 11059.2 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 7987.2 :z -12083.2 :w 1.0) + (new 'static 'vector :x -1638.4 :y 7987.2 :z -12083.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.8333333 + :hit-points 29.997 + :inv-hit-points 0.033336665 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 4464.64 :y -655.36 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf4) + :inertia 4300800.0 + :radius 3481.6 + :susp-arm-length 4096.0 + :steer-arm-length 1638.4 + :scale 1.0 + :travel 2457.6 + :probe-y-offset -3276.8 + :width 4096.0 + :suspension-spring 0.4 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 1720.32 + :tread-texture "tread-scorpion" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 4444.16 :y -532.48 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2) + :inertia 4915200.0 + :radius 3481.6 + :susp-arm-length 4096.0 + :steer-arm-length 2048.0 + :scale 1.2 + :travel 2867.2 + :probe-y-offset -3276.8 + :width 4096.0 + :suspension-spring 0.7 + :suspension-damping 0.4 + :forward-grip 1.15 + :side-grip 1.15 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 2048.0 + :tread-texture "tread-scorpion" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5693.44 + :settle-rot-x -691.76886 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2457.6 :y 1187.84 :z -819.2 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1228.8 :y 614.4 :z -368.64 :w 1.0) + (new 'static 'vector :x -1228.8 :y 614.4 :z -368.64 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(define *v-catapult-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 32.0 + :inv-mass 0.03125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 12) (meters 8) (meters 25)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-catapult-constants* + :flags #x80010 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-catapult) + :engine (new 'static 'vehicle-engine-info + :max-torque 117440510.0 + :inertia 16384.0 + :drag 0.4 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 700.0 + :max-rpm 6500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 2000.0 + :final-drive-ratio 25.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1677721600.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 1392640.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 15) + :string-min-length (meters 5) + :string-max-length (meters 15.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6963.2 :z -6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "inter-scrape") + :glance-sound (static-sound-name "inter-glance") + :impact-sound (static-sound-name "inter-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "inter-load") + :water-sound (static-sound-name "inter-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "inter-idle") + :engine-sound (static-sound-name "inter-steady") + :susp-creak-sound (static-sound-name "inter-bounce") + :susp-bottom-out-sound (static-sound-name "inter-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.6666667 + :hit-points 80.0 + :inv-hit-points 0.0125 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 20480.0 :y -2048.0 :z 15687.68 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 9420.8 + :steer-arm-length 2457.6 + :scale 2.4 + :travel 9011.2 + :probe-y-offset -4096.0 + :width 4096.0 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.78 + :probe-radius 409.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 14336.0 :y -4096.0 :z -24166.4 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 10240.0 + :steer-arm-length 3276.8 + :scale 2.4 + :travel 8192.0 + :probe-y-offset -2867.2 + :width 4096.0 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5488.64 + :settle-rot-x 728.1778 + :shadow-bot-clip -32768.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(define *wcar-explosion-info* + (new 'static 'vehicle-explosion-info + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'wasall + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +(set! (-> *v-turtle-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-snake-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-scorpion-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-toad-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-fox-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-rhino-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-mirage-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-x-ride-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-marauder-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-faccar-constants* explosion) *wcar-explosion-info*) + +(set! (-> *v-catapult-constants* explosion) *wcar-explosion-info*) + +(deftype wcar-base (wvehicle) + ((rider-hand-joint-array int8 2) + ) + ) + + +(defmethod vehicle-method-113 ((this wcar-base) (arg0 vector) (arg1 int) (arg2 int)) + (vector-matrix*! + arg0 + (-> this info rider rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) + ) + 0 + (none) + ) + +(deftype wcar-snake-base (wcar-base) + ((local-gun-pos vector 2 :inline) + (jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 4 :inline) + (jmod-shock-mids joint-mod-set-local 4 :inline) + (jmod-guns joint-mod-set-local 2 :inline) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod wvehicle-method-169 ((this wcar-snake-base)) + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((s5-0 (new 'stack-no-clear 'wcar-proj-init-by-other-params))) + (set! (-> s5-0 barrel-idx) (-> this i-barrel)) + (set! (-> s5-0 vec0 7 x) 16384.0) + (set! (-> s5-0 vec0 7 y) 409600.0) + (set! (-> s5-0 vec0 7 w) 0.1736) + (set! (-> s5-0 vec0 7 z) 0.0) + (when (and (task-node-closed? (game-task-node desert-final-boss-introduction)) + (not (task-node-closed? (game-task-node desert-final-boss-resolution))) + ) + (set! (-> s5-0 vec0 7 x) 32768.0) + (set! (-> s5-0 vec0 7 w) 0.3419) + (set! (-> s5-0 vec0 7 z) -0.1736) + ) + (let* ((v1-13 (-> s5-0 mat0)) + (a3-0 (-> this rbody matrix)) + (a0-4 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-4) + (set! (-> v1-13 uvec quad) a1-0) + (set! (-> v1-13 fvec quad) a2-0) + (set! (-> v1-13 trans quad) a3-1) + ) + (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) + ) + (vector-matrix*! (the-as vector (-> s5-0 vec0)) (-> this local-gun-pos (-> s5-0 barrel-idx)) (-> s5-0 mat0)) + 0 + (set! (-> s5-0 vec0 2 quad) (-> (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) quad)) + (vector-rotate*! (-> s5-0 vec0 3) (-> s5-0 vec0 2) (-> s5-0 mat0)) + (vector-float*! (-> s5-0 vec0 4) (-> s5-0 vec0 3) (- (-> s5-0 vec0 7 y) (-> s5-0 vec0 7 x))) + (vector+float*! + (-> s5-0 vec0 1) + (the-as vector (-> s5-0 vec0)) + (-> s5-0 vec0 3) + (+ 16384.0 (-> s5-0 vec0 7 x)) + ) + (let ((s4-0 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> s4-0 length) (fill-actor-list-for-sphere + *actor-hash* + (-> s5-0 vec0 1) + (-> s5-0 vec0 4) + (-> s5-0 vec0 7 x) + (the-as (pointer collide-shape) (-> s4-0 data)) + (-> s4-0 allocated-length) + -1 + ) + ) + (let ((a0-14 (find-nearest-focusable + (the-as (array collide-shape) s4-0) + (-> s5-0 vec0 1) + (-> s5-0 vec0 7 y) + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> s5-0 vec0 3) + (the-as vector #f) + 2730.6667 + ) + ) + ) + (when a0-14 + (set! (-> s5-0 vec0 6 quad) (-> (get-trans a0-14 3) quad)) + (vector-! (-> s5-0 vec0 5) (-> s5-0 vec0 6) (the-as vector (-> s5-0 vec0))) + (matrix-transpose! (-> s5-0 mat1) (-> s5-0 mat0)) + (vector-matrix*! (-> s5-0 vec0 2) (-> s5-0 vec0 5) (-> s5-0 mat1)) + (set! (-> s5-0 vec0 2 x) 0.0) + (vector-normalize! (-> s5-0 vec0 2) 1.0) + (cond + ((< (-> s5-0 vec0 7 w) (-> s5-0 vec0 2 y)) + (set! (-> s5-0 vec0 2 y) (-> s5-0 vec0 7 w)) + (let ((f0-16 1.0) + (f1-3 (-> s5-0 vec0 7 w)) + ) + (set! (-> s5-0 vec0 2 z) (sqrtf (- f0-16 (* f1-3 f1-3)))) + ) + ) + ((< (-> s5-0 vec0 2 y) (-> s5-0 vec0 7 z)) + (set! (-> s5-0 vec0 2 y) (-> s5-0 vec0 7 z)) + (let ((f0-21 1.0) + (f1-7 (-> s5-0 vec0 7 z)) + ) + (set! (-> s5-0 vec0 2 z) (sqrtf (- f0-21 (* f1-7 f1-7)))) + ) + ) + ) + (if (< 0.0 (-> s5-0 vec0 2 z)) + (vector-rotate*! (-> s5-0 vec0 3) (-> s5-0 vec0 2) (-> s5-0 mat0)) + ) + ) + ) + ) + (vector-float*! (-> s5-0 vec0 4) (-> s5-0 vec0 3) (-> s5-0 vec0 7 y)) + (set! (-> s5-0 params ent) (-> this entity)) + (set! (-> s5-0 params charge) 1.0) + (set! (-> s5-0 params options) (projectile-options)) + (logclear! (-> s5-0 params options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 params pos quad) (-> s5-0 vec0 0 quad)) + (set! (-> s5-0 params vel quad) (-> s5-0 vec0 4 quad)) + (set! (-> s5-0 params notify-handle) (the-as handle #f)) + (set! (-> s5-0 params owner-handle) (process->handle this)) + (set! (-> s5-0 params target-handle) (the-as handle #f)) + (set! (-> s5-0 params target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 params ignore-handle) (process->handle this)) + (let* ((v1-58 *game-info*) + (a0-35 (+ (-> v1-58 attack-id) 1)) + ) + (set! (-> v1-58 attack-id) a0-35) + (set! (-> s5-0 params attack-id) a0-35) + ) + (set! (-> s5-0 params timeout) (seconds 4)) + (spawn-projectile v-snake-shot (-> s5-0 params) *rigid-body-queue-manager* *default-dead-pool*) + (let ((v1-63 (-> this jmod-guns (-> s5-0 barrel-idx)))) + (set! (-> v1-63 transform trans z) -3276.8) + ) + ) + (none) + ) + +(defmethod init-collision! ((this wcar-snake-base)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 80)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-22 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-22 transform-index) 0) + (set! (-> v1-22 nav-radius) 20480.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this wcar-snake-base)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3317.76 :z 9011.2 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -14336.0 :w 6144.0)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this wcar-snake-base)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-0 2) 1092.2667 1092.2667 0.0 0.0) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((s3-0 (-> this wheel s4-0))) + (-> s3-0 info) + (quaternion-set! + (-> s5-0 0) + 0.0 + 0.0 + (* (-> s3-0 sin-susp-ang) (-> s3-0 x-scale)) + (+ 1.0 (-> s3-0 cos-susp-ang)) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 0.0 (-> s3-0 x-scale) (-> (&-> s5-0 0 data s4-0) 8)) + ) + (let ((v1-10 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-10 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'wcar-stack-type1))) + (let* ((v1-16 (-> s5-1 vec0)) + (a3-2 (-> this node-list data 0 bone transform)) + (a0-9 (-> a3-2 rvec quad)) + (a1-3 (-> a3-2 uvec quad)) + (a2-3 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> v1-16 0 quad) a0-9) + (set! (-> v1-16 1 quad) a1-3) + (set! (-> v1-16 2 quad) a2-3) + (set! (-> v1-16 3 quad) a3-3) + ) + (set! (-> s5-1 vec0 4 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) + (set! (-> s5-1 vec0 5 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) + (set! (-> s5-1 vec0 6 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) + (set! (-> s5-1 vec0 7 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) + (set-vector! (-> s5-1 vec0 8) 25486.223 25486.223 29127.111 29127.111) + (dotimes (s4-1 4) + (let ((s3-1 (-> this wheel s4-1))) + (let ((v1-25 (-> s3-1 info))) + (set! (-> s5-1 float0) (+ -2048.0 (-> v1-25 susp-arm-length))) + (set! (-> s5-1 vec1 0 quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) + (set! (-> s5-1 vec0 9 quad) (-> v1-25 local-pos quad)) + ) + (+! (-> s5-1 vec0 9 x) (* (-> s5-1 float0) (-> s3-1 cos-susp-ang))) + (+! (-> s5-1 vec0 9 y) (* (-> s5-1 float0) (-> s3-1 sin-susp-ang))) + (set! (-> s5-1 vec1 1 quad) (-> s5-1 vec0 9 quad)) + (set! (-> s5-1 vec1 1 x) (* (-> s5-1 vec1 1 x) (-> s3-1 x-scale))) + (set! (-> s5-1 vec1 0 x) (* (-> s5-1 vec1 0 x) (-> s3-1 x-scale))) + (vector-! (-> s5-1 vec1 2) (-> s5-1 vec1 1) (the-as vector (-> s5-1 vec1))) + (set! (-> s5-1 float2) + (- (-> s5-1 vec0 8 data s4-1) (* (atan (-> s5-1 vec1 2 x) (-> s5-1 vec1 2 y)) (-> s3-1 x-scale))) + ) + (let ((v1-34 (-> this jmod-shock-tops s4-1))) + (quaternion-axis-angle! (-> v1-34 rotation) 0.0 0.0 1.0 (-> s5-1 float2)) + ) + 0 + (let ((v1-38 (-> this jmod-shock-mids s4-1))) + (set! (-> v1-38 transform trans y) (* -1.0 (+ -3276.8 (vector-length (-> s5-1 vec1 2))) (-> s3-1 x-scale))) + ) + ) + 0 + 0 + ) + ) + (let ((f30-1 (seconds-per-frame))) + (dotimes (s5-2 2) + (let ((s4-2 (-> this jmod-guns s5-2))) + (seek! (-> s4-2 transform trans z) 0.0 (* 32768.0 f30-1)) + ) + ) + ) + 0 + (none) + ) + +(defskelgroup skel-v-turtle turtle turtle-lod0-jg turtle-idle-ja + ((turtle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow turtle-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-v-turtle-wheel turtle turtle-wheel-lod0-jg turtle-wheel-idle-ja + ((turtle-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.75) + :shadow turtle-wheel-shadow-mg + ) + +(defskelgroup skel-v-turtle-wheel-blur turtle turtle-wheel-blur-lod0-jg turtle-wheel-blur-idle-ja + ((turtle-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.75) + :shadow turtle-wheel-blur-shadow-mg + ) + +(defskelgroup skel-v-snake snake snake-lod0-jg snake-idle-ja + ((snake-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow snake-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-v-snake-wheel snake snake-wheel-lod0-jg snake-wheel-idle-ja + ((snake-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-shadow-mg + ) + +(defskelgroup skel-v-snake-wheel-blur snake snake-wheel-blur-lod0-jg snake-wheel-blur-idle-ja + ((snake-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-blur-shadow-mg + ) + +(defskelgroup skel-v-scorpion scorpion scorpion-lod0-jg scorpion-idle-ja + ((scorpion-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + :shadow scorpion-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-v-scorpion-wheel scorpion scorpion-wheel-lod0-jg scorpion-wheel-idle-ja + ((scorpion-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.55) + :shadow scorpion-wheel-shadow-mg + ) + +(defskelgroup skel-v-scorpion-wheel-blur scorpion scorpion-wheel-blur-lod0-jg scorpion-wheel-blur-idle-ja + ((scorpion-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.55) + :shadow scorpion-wheel-blur-shadow-mg + ) + +(defskelgroup skel-v-toad toad toad-lod0-jg toad-idle-ja + ((toad-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + :shadow toad-shadow-mg + ) + +(defskelgroup skel-v-toad-wheel toad toad-wheel-lod0-jg toad-wheel-idle-ja + ((toad-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.44) + :shadow toad-wheel-shadow-mg + ) + +(defskelgroup skel-v-toad-wheel-blur toad toad-wheel-blur-lod0-jg toad-wheel-blur-idle-ja + ((toad-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.44) + :shadow toad-wheel-blur-shadow-mg + ) + +(defskelgroup skel-v-fox fox fox-lod0-jg fox-idle-ja + ((fox-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow fox-shadow-mg + ) + +(defskelgroup skel-v-fox-wheel fox fox-wheel-lod0-jg fox-wheel-idle-ja + ((fox-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-shadow-mg + ) + +(defskelgroup skel-v-fox-wheel-blur fox fox-wheel-blur-lod0-jg fox-wheel-blur-idle-ja + ((fox-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-blur-shadow-mg + ) + +(defskelgroup skel-v-rhino rhino rhino-lod0-jg rhino-idle-ja + ((rhino-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + :shadow rhino-shadow-mg + ) + +(defskelgroup skel-v-rhino-wheel rhino rhino-wheel-lod0-jg rhino-wheel-idle-ja + ((rhino-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.59) + :shadow rhino-wheel-shadow-mg + ) + +(defskelgroup skel-v-mirage snake snake-lod0-jg snake-idle-ja + ((snake-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow snake-shadow-mg + ) + +(defskelgroup skel-v-mirage-wheel snake snake-wheel-lod0-jg snake-wheel-idle-ja + ((snake-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-shadow-mg + ) + +(defskelgroup skel-v-mirage-wheel-blur snake snake-wheel-blur-lod0-jg snake-wheel-blur-idle-ja + ((snake-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-blur-shadow-mg + ) + +(defskelgroup skel-v-x-ride fox fox-lod0-jg fox-idle-ja + ((fox-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow fox-shadow-mg + ) + +(defskelgroup skel-v-x-ride-wheel fox fox-wheel-lod0-jg fox-wheel-idle-ja + ((fox-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-shadow-mg + ) + +(defskelgroup skel-v-x-ride-wheel-blur fox fox-wheel-blur-lod0-jg fox-wheel-blur-idle-ja + ((fox-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-blur-shadow-mg + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc index d9fda5faf0..187a3254f4 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc @@ -5,5 +5,1179 @@ ;; name in dgo: wvehicle-effects ;; dgos: LPATK, LFACCAR, WASALL +(define-extern *wheel-trail-info* light-trail-composition) + ;; DECOMP BEGINS +(deftype wvehicle-wheel-launcher-spec (structure) + ((mat matrix) + (particle-system sparticle-system) + (launcher sparticle-launcher) + (num-spec sp-field-init-spec) + (r-spec sp-field-init-spec) + (g-spec sp-field-init-spec) + (b-spec sp-field-init-spec) + (a-spec sp-field-init-spec) + (scale-x-spec sp-field-init-spec) + (scale-y-spec sp-field-init-spec) + (fade-a-spec sp-field-init-spec) + (ptr-birth-accum (pointer sparticle-launch-control)) + (i-birth-accum int8) + ) + :pack-me + ) + + +(deftype wvehicle-part-work (structure) + ((local-mat matrix :inline) + (world-mat matrix :inline) + (velocity vector :inline) + (side-dir vector :inline) + (up-dir vector :inline) + (forward-dir vector :inline) + (wheel-axis vector :inline) + (surface-pos vector :inline) + (part-vel vector :inline) + (pos-l vector :inline) + (pos-r vector :inline) + (offset vector :inline) + (zero-offset vector :inline) + (prev-pos vector :inline) + (surface-type uint8) + (wheel-rev-speed float) + (wheel-speed float) + (wheel-radius float) + (wheel-width float) + (part-num float) + (rand-val float) + (scale float) + (slip float) + (up-force float) + (alpha float) + (alpha-range float) + (vel-scale float) + (cur-time uint32) + (ups float) + (dirt-launcher wvehicle-wheel-launcher-spec :inline) + (dust-launcher wvehicle-wheel-launcher-spec :inline) + (spray-launcher wvehicle-wheel-launcher-spec :inline) + (ripple-launcher wvehicle-wheel-launcher-spec :inline) + (dummy-spec sp-field-init-spec :inline) + ) + ) + + +(if (or (zero? *wheel-trail-info*) (!= loading-level global)) + (set! *wheel-trail-info* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *wheel-trail-info* color-mode) (the-as uint 3)) + +(set! (-> *wheel-trail-info* color-repeat-dist) 73728.0) + +(set! (-> *wheel-trail-info* alpha-1-mode) (the-as uint 0)) + +(set! (-> *wheel-trail-info* alpha-2-mode) (the-as uint 6)) + +(set! (-> *wheel-trail-info* base-alpha) 0.1) + +(set! (-> *wheel-trail-info* alpha-repeat-dist) 12288.0) + +(set! (-> *wheel-trail-info* width-mode) (the-as uint 0)) + +(set! (-> *wheel-trail-info* base-width) 1.0) + +(set! (-> *wheel-trail-info* width-repeat-dist) 4096.0) + +(set! (-> *wheel-trail-info* uv-mode) (the-as uint 3)) + +(set! (-> *wheel-trail-info* uv-repeat-dist) 8192.0) + +(set! (-> *wheel-trail-info* lie-mode) (the-as uint 0)) + +(set! (-> *wheel-trail-info* max-age) (seconds 3)) + +(if #f + (set! (-> *wheel-trail-info* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *wheel-trail-info* tex-id) (the-as uint #x100300)) + ) + +(set! (-> *wheel-trail-info* width-curve) (the-as curve2d-piecewise *curve-unity*)) + +(set! (-> *wheel-trail-info* color-curve) (the-as curve-color-piecewise *trail-color-curve-white*)) + +(set! (-> *wheel-trail-info* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *wheel-trail-info* alpha-curve-2) #f) + +(set! (-> *wheel-trail-info* zbuffer?) #f) + +(set! (-> *wheel-trail-info* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *wheel-trail-info* use-tape-mode?) #f) + +(set! (-> *wheel-trail-info* blend-mode) (the-as uint 2)) + +(set! (-> *wheel-trail-info* frame-stagger) (the-as uint 1)) + +(deftype tire-trail-crumb (light-trail-breadcrumb) + ((offset vector :inline) + (uu float :overlay-at (-> offset data 3)) + ) + ) + + +(deftype tire-trail (light-trail) + () + (:methods + (tire-trail-method-22 (_type_) none) + (tire-trail-method-23 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch vector vs none. +(defmethod light-trail-method-18 ((this tire-trail) (arg0 light-trail-breadcrumb) (arg1 int) (arg2 vector) (arg3 vector)) + (set! (-> arg3 quad) (-> (&+ arg0 16) pos quad)) + (none) + ) + +(defmethod light-trail-method-9 ((this tire-trail) (arg0 light-trail-composition) (arg1 int)) + (set! (-> this crumb-size) (the-as uint 32)) + (call-parent-method this arg0 arg1) + (none) + ) + +(defmethod wvehicle-method-195 ((this wvehicle)) + ; TODO trail tracker stuff + ; (let ((s5-0 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + ; (set! (-> s5-0 tracked-obj) (process->handle this)) + ; (set! (-> s5-0 max-num-crumbs) 80) + ; (set! (-> s5-0 appearance) *wheel-trail-info*) + ; (dotimes (s4-0 (-> this info physics-model wheel-count)) + ; (when (not (handle->process (-> this wheel s4-0 tread-tracker))) + ; (set! (-> *wheel-trail-info* tex-id) (the-as uint (-> this wheel s4-0 info tread-tid))) + ; (set! (-> this wheel s4-0 tread-tracker) (process->handle (spawn-tire-trail-tracker this s5-0))) + ; ) + ; ) + ; ) + 0 + (none) + ) + +(defmethod wvehicle-method-196 ((this wvehicle)) + (dotimes (s5-0 (-> this info physics-model wheel-count)) + (send-event (handle->process (-> this wheel s5-0 tread-tracker)) 'die) + (set! (-> this wheel s5-0 tread-tracker) (the-as handle #f)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-189 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 wvehicle-part-work) (arg2 wvehicle-wheel-launcher-spec)) + (let ((s5-0 (-> arg2 mat))) + (let ((s3-0 (-> this info particle-common))) + (set! (-> s5-0 trans quad) (-> arg1 surface-pos quad)) + (set! (-> arg2 num-spec initial-valuef) (-> arg1 part-num)) + (set! (-> arg2 num-spec random-rangef) 0.0) + (set! (-> arg2 a-spec initial-valuef) (-> arg1 alpha)) + (set! (-> arg2 a-spec random-rangef) (-> arg1 alpha-range)) + (set! (-> arg2 scale-x-spec initial-valuef) (-> arg1 scale)) + (set! (-> arg2 scale-x-spec random-rangef) (* 0.5 (-> arg1 scale))) + (set! (-> arg2 scale-y-spec initial-valuef) (-> arg1 scale)) + (set! (-> arg2 scale-y-spec random-rangef) 0.0) + (rigid-body-control-method-23 (-> this rbody) (-> arg1 surface-pos) (-> arg1 velocity)) + (vector-float*! (-> arg1 velocity) (-> arg1 velocity) (-> arg1 vel-scale)) + (vector+float*! (-> arg1 velocity) (-> arg1 velocity) (-> arg1 forward-dir) (-> arg1 part-vel z)) + (vector+float*! (-> arg1 velocity) (-> arg1 velocity) (-> arg1 up-dir) (-> arg1 part-vel y)) + (vector+float*! (-> arg1 velocity) (-> arg1 velocity) (-> arg1 side-dir) (-> arg1 part-vel x)) + (let ((v1-21 (-> s3-0 part-vel)) + (a0-6 (-> arg1 velocity)) + (f0-13 300.0) + ) + (vector-float*! v1-21 a0-6 (/ 1.0 f0-13)) + ) + ) + (when (nonzero? (-> arg2 launcher)) + (let ((s4-1 (-> arg2 ptr-birth-accum))) + (set! (-> arg2 launcher birthaccum) (the-as float (-> s4-1 0))) + (launch-particles :system (-> arg2 particle-system) (-> arg2 launcher) s5-0 :origin-is-matrix #t) + (set! (-> s4-1 0) (the-as sparticle-launch-control (-> arg2 launcher birthaccum))) + (if (< 1.0 (the-as float (-> s4-1 0))) + (set! (-> s4-1 0) (the-as sparticle-launch-control 0.0)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-190 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 wvehicle-part-work)) + (when (not (-> arg1 dirt-launcher particle-system)) + (set! (-> arg1 dirt-launcher particle-system) *sp-particle-system-2d*) + (set! (-> arg1 dirt-launcher launcher) (-> *part-id-table* 954)) + (set! (-> arg1 dirt-launcher num-spec) (-> *part-id-table* 954 init-specs 2)) + (set! (-> arg1 dirt-launcher a-spec) (-> *part-id-table* 954 init-specs 11)) + (set! (-> arg1 dirt-launcher scale-x-spec) (-> *part-id-table* 954 init-specs 5)) + (set! (-> arg1 dirt-launcher scale-y-spec) (-> *part-id-table* 954 init-specs 7)) + (set! (-> arg1 dirt-launcher mat) (-> arg1 local-mat)) + (set! (-> arg1 dirt-launcher i-birth-accum) 0) + 0 + ) + (set! (-> arg1 dirt-launcher ptr-birth-accum) (-> arg0 part-birth-accum)) + (set! (-> arg1 part-vel x) (-> arg0 side-vel)) + (set! (-> arg1 part-vel y) (* 0.7 (+ (fabs (-> arg1 wheel-rev-speed)) (* 2048.0 (-> arg1 slip))))) + (set! (-> arg1 rand-val) (rand-vu-float-range -1.0 0.5)) + (set! (-> arg1 part-vel z) (* (-> arg1 rand-val) (-> arg1 wheel-rev-speed))) + (set! (-> arg1 part-num) (fmin 20.0 (* 0.1 (-> arg1 up-force) (+ 1.0 (-> arg1 slip))))) + (set! (-> arg1 scale) (* 983.04 (fmin 1.0 (* 0.125 (-> arg1 up-force) (+ 1.0 (-> arg1 slip)))))) + (set! (-> arg1 vel-scale) 1.0) + (set! (-> arg1 alpha) 128.0) + (set! (-> arg1 alpha-range) 0.0) + (if (< 0.5 (-> arg1 part-num)) + (wvehicle-method-189 this arg0 arg1 (-> arg1 dirt-launcher)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs symbol. +(defmethod wvehicle-method-191 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 wvehicle-part-work)) + (when (not (-> arg1 dust-launcher particle-system)) + (set! (-> arg1 dust-launcher particle-system) *sp-particle-system-2d*) + (set! (-> arg1 dust-launcher launcher) (-> *part-id-table* 964)) + (set! (-> arg1 dust-launcher num-spec) (-> *part-id-table* 964 init-specs 2)) + (set! (-> arg1 dust-launcher a-spec) (-> *part-id-table* 964 init-specs 9)) + (set! (-> arg1 dust-launcher scale-x-spec) (-> *part-id-table* 964 init-specs 3)) + (set! (-> arg1 dust-launcher scale-y-spec) (-> *part-id-table* 964 init-specs 5)) + (set! (-> arg1 dust-launcher mat) (-> arg1 local-mat)) + ) + (set! (-> arg1 dust-launcher i-birth-accum) 1) + (set! (-> arg1 dust-launcher ptr-birth-accum) (&-> arg0 part-birth-accum 1)) + (let* ((f0-0 (-> arg0 side-vel)) + (f0-2 (* f0-0 f0-0)) + (f1-0 (-> arg0 forward-vel)) + (f30-0 (sqrtf (+ f0-2 (* f1-0 f1-0)))) + ) + (vector-reset! (-> arg1 part-vel)) + (set! (-> arg1 rand-val) (rand-vu-float-range -1.0 1.0)) + (set! (-> arg1 part-vel y) 8192.0) + (set! (-> arg1 part-vel x) (* 4096.0 (-> arg1 rand-val))) + (set! (-> arg1 part-num) (fmin 1.0 (* 0.000016276043 (+ -40960.0 (fabs f30-0))))) + ) + (set! (-> arg1 scale) 8192.0) + (if (zero? (-> arg1 surface-type)) + (set! (-> arg1 part-num) (* 0.25 (-> arg1 part-num))) + ) + (set! (-> arg1 alpha) 32.0) + (set! (-> arg1 alpha-range) 32.0) + (set! (-> arg1 vel-scale) 0.0) + (if (< 0.05 (-> arg1 part-num)) + (wvehicle-method-189 this arg0 arg1 (-> arg1 dust-launcher)) + ) + (the-as symbol 0) + ) + +(defmethod wvehicle-method-192 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 wvehicle-part-work)) + (when (not (-> arg1 dust-launcher particle-system)) + (set! (-> arg1 dust-launcher particle-system) *sp-particle-system-2d*) + (set! (-> arg1 dust-launcher launcher) (-> *part-id-table* 964)) + (set! (-> arg1 dust-launcher num-spec) (-> *part-id-table* 964 init-specs 2)) + (set! (-> arg1 dust-launcher a-spec) (-> *part-id-table* 964 init-specs 9)) + (set! (-> arg1 dust-launcher scale-x-spec) (-> *part-id-table* 964 init-specs 3)) + (set! (-> arg1 dust-launcher scale-y-spec) (-> *part-id-table* 964 init-specs 5)) + (set! (-> arg1 dust-launcher mat) (-> arg1 local-mat)) + ) + (set! (-> arg1 dust-launcher i-birth-accum) 2) + (set! (-> arg1 dust-launcher ptr-birth-accum) (&-> arg0 part-birth-accum 2)) + (set! (-> arg1 part-vel x) (-> arg0 side-vel)) + (set! (-> arg1 part-vel y) 8192.0) + (set! (-> arg1 rand-val) (rand-vu-float-range -1.0 0.5)) + (set! (-> arg1 part-vel z) (* (-> arg1 rand-val) (-> arg1 wheel-rev-speed))) + (set! (-> arg1 rand-val) (* 0.5 (-> arg1 up-force) (-> arg1 slip))) + (set! (-> arg1 part-num) (fmin 0.4 (-> arg1 rand-val))) + (set! (-> arg1 alpha) (* 40.0 (fmin 1.0 (-> arg1 rand-val)))) + (set! (-> arg1 alpha-range) (* 0.25 (-> arg1 alpha))) + (set! (-> arg1 vel-scale) 0.75) + (set! (-> arg1 scale) 16384.0) + (if (< 0.05 (-> arg1 part-num)) + (wvehicle-method-189 this arg0 arg1 (-> arg1 dust-launcher)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-193 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 wvehicle-part-work)) + (when (not (-> arg1 spray-launcher particle-system)) + (set! (-> arg1 spray-launcher particle-system) *sp-particle-system-2d*) + (set! (-> arg1 spray-launcher launcher) (-> *part-id-table* 955)) + (set! (-> arg1 spray-launcher num-spec) (-> *part-id-table* 955 init-specs 2)) + (set! (-> arg1 spray-launcher r-spec) (-> *part-id-table* 955 init-specs 8)) + (set! (-> arg1 spray-launcher g-spec) (-> *part-id-table* 955 init-specs 9)) + (set! (-> arg1 spray-launcher b-spec) (-> *part-id-table* 955 init-specs 10)) + (set! (-> arg1 spray-launcher a-spec) (-> *part-id-table* 955 init-specs 11)) + (set! (-> arg1 spray-launcher scale-x-spec) (-> arg1 dummy-spec)) + (set! (-> arg1 spray-launcher scale-y-spec) (-> arg1 dummy-spec)) + (set! (-> arg1 spray-launcher mat) (-> arg1 local-mat)) + (set! (-> arg1 spray-launcher i-birth-accum) 2) + ) + (set! (-> arg1 spray-launcher ptr-birth-accum) (&-> arg0 part-birth-accum 2)) + (set! (-> arg1 part-vel x) (-> arg0 side-vel)) + (set! (-> arg1 part-vel y) + (* 0.75 (fmax (fmax (fabs (-> arg1 wheel-rev-speed)) (fabs (-> arg0 forward-vel))) (fabs (-> arg0 side-vel)))) + ) + (let ((f0-4 (fmin 1.0 (* 0.000008138021 (-> arg1 part-vel y))))) + (set! (-> this water-sound-envelope) (fmax (-> this water-sound-envelope) f0-4)) + ) + (set! (-> arg1 rand-val) (rand-vu-float-range -1.0 0.5)) + (set! (-> arg1 part-vel z) (* (-> arg1 rand-val) (-> arg1 wheel-rev-speed))) + (set! (-> arg1 part-num) (fmin 5.0 (* 0.000008138021 (-> arg1 part-vel y)))) + (set! (-> arg1 alpha-range) 0.0) + (set! (-> arg1 vel-scale) 1.0) + (set! (-> arg1 surface-pos y) (-> this water-height)) + (cond + ((logtest? (-> this water-flags) 128) + (let ((f0-16 (+ 1.0 (* -0.2222 (rand-vu))))) + (set! (-> arg1 spray-launcher r-spec initial-valuef) (* 105.0 f0-16)) + (set! (-> arg1 spray-launcher g-spec initial-valuef) (* 90.0 f0-16)) + (set! (-> arg1 spray-launcher b-spec initial-valuef) (* 60.0 f0-16)) + ) + (set! (-> arg1 alpha) 128.0) + ) + (else + (set! (-> arg1 spray-launcher r-spec initial-valuef) 255.0) + (set! (-> arg1 spray-launcher g-spec initial-valuef) 255.0) + (set! (-> arg1 spray-launcher b-spec initial-valuef) 255.0) + (set! (-> arg1 alpha) (* 102.4 (fmin 1.0 (* 0.0000040690106 (-> arg1 part-vel y))))) + ) + ) + (if (< 0.1 (-> arg1 part-num)) + (wvehicle-method-189 this arg0 arg1 (-> arg1 spray-launcher)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-194 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 wvehicle-part-work)) + (when (not (-> arg1 ripple-launcher particle-system)) + (set! (-> arg1 ripple-launcher particle-system) *sp-particle-system-3d*) + (set! (-> arg1 ripple-launcher launcher) (-> *part-id-table* 956)) + (set! (-> arg1 ripple-launcher num-spec) (-> *part-id-table* 956 init-specs 1)) + (set! (-> arg1 ripple-launcher r-spec) (-> *part-id-table* 956 init-specs 4)) + (set! (-> arg1 ripple-launcher g-spec) (-> *part-id-table* 956 init-specs 5)) + (set! (-> arg1 ripple-launcher b-spec) (-> *part-id-table* 956 init-specs 6)) + (set! (-> arg1 ripple-launcher a-spec) (-> *part-id-table* 956 init-specs 7)) + (set! (-> arg1 ripple-launcher scale-x-spec) (-> *part-id-table* 956 init-specs 2)) + (set! (-> arg1 ripple-launcher scale-y-spec) (-> *part-id-table* 956 init-specs 3)) + (set! (-> arg1 ripple-launcher fade-a-spec) (-> *part-id-table* 956 init-specs 10)) + (set! (-> arg1 ripple-launcher mat) (-> arg1 world-mat)) + (set! (-> arg1 ripple-launcher i-birth-accum) 3) + ) + (set! (-> arg1 ripple-launcher ptr-birth-accum) (&-> arg0 part-birth-accum 3)) + (let* ((f0-0 (-> arg0 forward-vel)) + (f0-2 (* f0-0 f0-0)) + (f1-0 (-> arg0 side-vel)) + ) + (set! (-> arg1 wheel-speed) (sqrtf (+ f0-2 (* f1-0 f1-0)))) + ) + (vector-reset! (-> arg1 part-vel)) + (set! (-> arg1 part-num) (fmax 0.1 (fmin 1.0 (* 0.0000048828124 (-> arg1 wheel-speed))))) + (set! (-> arg1 alpha) (* 32.0 (fmax 0.5 (-> arg1 part-num)))) + (set! (-> arg1 alpha-range) (-> arg1 alpha)) + (let* ((f0-10 -0.07111111) + (f0-11 (* 2.0 (fmax 0.5 (-> arg1 part-num)) f0-10)) + ) + (set! (-> arg1 ripple-launcher fade-a-spec initial-valuef) f0-11) + (set! (-> arg1 ripple-launcher fade-a-spec random-rangef) f0-11) + ) + (cond + ((logtest? (-> this water-flags) 128) + (let ((f0-14 (+ 2.0 (* 0.222 (rand-vu))))) + (set! (-> arg1 ripple-launcher r-spec initial-valuef) (* 45.0 f0-14)) + (set! (-> arg1 ripple-launcher g-spec initial-valuef) (* 30.0 f0-14)) + (set! (-> arg1 ripple-launcher b-spec initial-valuef) (* 20.0 f0-14)) + ) + ) + (else + (set! (-> arg1 ripple-launcher r-spec initial-valuef) 128.0) + (set! (-> arg1 ripple-launcher g-spec initial-valuef) 128.0) + (set! (-> arg1 ripple-launcher b-spec initial-valuef) 128.0) + ) + ) + (set! (-> arg1 scale) (-> arg1 wheel-radius)) + (set! (-> arg1 vel-scale) 0.0) + (set! (-> arg1 surface-pos y) (-> this water-height)) + (if #t + (wvehicle-method-189 this arg0 arg1 (-> arg1 ripple-launcher)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-200 ((this wvehicle) (arg0 vector) (arg1 wvehicle-part-work)) + (set! (-> arg1 ups) (seconds-per-frame)) + (set! (-> arg1 surface-pos quad) (-> arg0 quad)) + (set! (-> arg1 surface-pos y) (-> this water-height)) + (rigid-body-control-method-23 (-> this rbody) arg0 (-> arg1 velocity)) + (vector+float*! (-> arg1 prev-pos) arg0 (-> arg1 velocity) (* -1.0 (-> arg1 ups))) + (when (and (< (-> arg1 surface-pos y) (- (-> arg1 prev-pos y) (-> arg0 w))) (< (-> arg1 velocity y) -40960.0)) + (let ((s4-0 (new 'stack-no-clear 'wvehicle-physics-work))) + (set! (-> s4-0 mat uvec y) (* 0.0000000029802323 (fabs (-> arg1 velocity y)) (-> arg0 w))) + (set! (-> s4-0 mat uvec y) (fmin 4.0 (-> s4-0 mat uvec y))) + (vector-identity! (the-as vector (-> s4-0 mat))) + (vector-float*! (the-as vector (-> s4-0 mat)) (the-as vector (-> s4-0 mat)) (-> s4-0 mat uvec y)) + (matrix-scale! (-> arg1 world-mat) (the-as vector (-> s4-0 mat))) + (set! (-> arg1 world-mat trans quad) (-> arg1 surface-pos quad)) + (when (< (the-as uint 300) (- (-> arg1 cur-time) (-> this splash-time))) + (set! (-> this splash-time) (-> arg1 cur-time)) + (set! (-> s4-0 mat uvec x) (fmax 0.0 (fmin 1.0 (* 0.0000061035157 (fabs (-> arg1 velocity y)))))) + (sound-play-by-name + (static-sound-name "car-splash") + (new-sound-id) + (the int (* 1024.0 (-> s4-0 mat uvec x))) + 0 + 0 + (sound-group) + #t + ) + ) + ) + (if (logtest? (-> *part-group-id-table* 226 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 226) + :mat-joint (-> arg1 world-mat) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 226) + :mat-joint (-> arg1 world-mat) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-78 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle vehicle-method-78))) + (t9-0 this) + ) + (let ((s5-0 (new 'stack-no-clear 'wvehicle-part-work))) + (set! (-> s5-0 dirt-launcher particle-system) #f) + (set! (-> s5-0 dust-launcher particle-system) #f) + (set! (-> s5-0 spray-launcher particle-system) #f) + (set! (-> s5-0 ripple-launcher particle-system) #f) + (set! (-> s5-0 cur-time) (the-as uint (current-time))) + (let* ((v1-3 (-> s5-0 local-mat)) + (a3-0 (-> this rbody matrix)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-3) + (set! (-> v1-3 uvec quad) a1-0) + (set! (-> v1-3 fvec quad) a2-0) + (set! (-> v1-3 trans quad) a3-1) + ) + (matrix-identity! (-> s5-0 world-mat)) + (vector-reset! (-> s5-0 zero-offset)) + (let ((s4-0 (-> this info))) + (set! (-> s5-0 surface-type) (the-as uint 7)) + (when (logtest? (vehicle-flag player-driving net-player-driving ai-driving) (-> this v-flags)) + (dotimes (s3-0 (-> this info physics-model wheel-count)) + (let ((s2-0 (-> this wheel s3-0))) + (let ((s1-0 (-> s2-0 info))) + (when (logtest? (-> s2-0 flags) 2) + (set! (-> s5-0 surface-pos quad) (-> s2-0 surface-pos quad)) + (set! (-> s5-0 slip) (* 0.00024414062 (+ (fabs (-> s2-0 forward-slip-vel)) (fabs (-> s2-0 side-vel))))) + (set! (-> s5-0 up-force) (/ (-> s2-0 up-force) (* 0.25 (-> s4-0 extra gravity) (-> s4-0 info mass)))) + (set! (-> s5-0 wheel-radius) (* (-> s1-0 scale) (-> s1-0 radius))) + (set! (-> s5-0 wheel-width) (* (-> s1-0 scale) (-> s1-0 width))) + (set! (-> s5-0 wheel-rev-speed) (* (-> s2-0 rev) (-> s5-0 wheel-radius))) + (set! (-> s5-0 surface-type) (-> s2-0 surface surface-type)) + (if (< 0.0 (-> s2-0 sink-depth)) + (set! (-> s5-0 surface-type) (the-as uint 4)) + ) + (vector-rotate*! (-> s5-0 side-dir) (-> s2-0 local-axis) (-> s5-0 local-mat)) + (set! (-> s5-0 up-dir quad) (-> s2-0 ground-normal quad)) + (vector+float*! + (-> s5-0 side-dir) + (-> s5-0 side-dir) + (-> s5-0 up-dir) + (- (vector-dot (-> s5-0 side-dir) (-> s5-0 up-dir))) + ) + (vector-normalize! (-> s5-0 side-dir) 1.0) + (vector-cross! (-> s5-0 forward-dir) (-> s5-0 side-dir) (-> s5-0 up-dir)) + (vector-normalize! (-> s5-0 forward-dir) 1.0) + (let ((f0-14 (-> this camera-dist2)) + (f1-10 245760.0) + ) + (when (< f0-14 (* f1-10 f1-10)) + (let ((v1-29 (-> s5-0 surface-type))) + (cond + ((or (= v1-29 1) (= v1-29 2)) + (wvehicle-method-190 this s2-0 s5-0) + (wvehicle-method-191 this s2-0 s5-0) + (wvehicle-method-192 this s2-0 s5-0) + ) + ((zero? v1-29) + (wvehicle-method-191 this s2-0 s5-0) + ) + ((= v1-29 4) + (wvehicle-method-193 this s2-0 s5-0) + (wvehicle-method-194 this s2-0 s5-0) + ) + ) + ) + ) + ) + ) + (set! (-> *wheel-trail-info* tex-id) (the-as uint (-> s1-0 tread-tid))) + ) + (let ((s1-1 (handle->process (-> s2-0 tread-tracker)))) + (when s1-1 + (cond + ((logtest? (-> s2-0 flags) 2) + (set! (-> s5-0 surface-pos quad) (-> s2-0 surface-pos quad)) + (vector+float*! (-> s5-0 surface-pos) (-> s5-0 surface-pos) (-> s2-0 ground-normal) 204.8) + (vector-rotate*! (-> s5-0 wheel-axis) (-> s2-0 local-axis) (-> s5-0 local-mat)) + (vector+float*! + (-> s5-0 wheel-axis) + (-> s5-0 wheel-axis) + (-> s2-0 ground-normal) + (- (vector-dot (-> s5-0 wheel-axis) (-> s2-0 ground-normal))) + ) + (vector-normalize! (-> s5-0 wheel-axis) 1.0) + (vector-float*! (-> s5-0 offset) (-> s5-0 wheel-axis) (* 0.5 (-> s5-0 wheel-width))) + (vector+! (the-as vector (-> s2-0 trail-pos)) (-> s5-0 surface-pos) (-> s5-0 offset)) + (vector-! (-> s2-0 trail-pos 1) (-> s5-0 surface-pos) (-> s5-0 offset)) + ) + (else + (vector+! (-> s5-0 surface-pos) (the-as vector (-> s2-0 trail-pos)) (-> s2-0 trail-pos 1)) + (vector-float*! (-> s5-0 surface-pos) (-> s5-0 surface-pos) 0.5) + ) + ) + (cond + ((logtest? (-> s2-0 prev-flags) 2) + (cond + ((>= (- (-> s5-0 cur-time) (-> s2-0 tread-time)) (the-as uint 50)) + (set! (-> s2-0 tread-time) (-> s5-0 cur-time)) + (let* ((a0-42 (-> (the-as process-focusable s1-1) root)) + (t9-13 (method-of-object a0-42 y-angle)) + ) + (-> s5-0 surface-pos) + (-> s5-0 offset) + 0 + (t9-13 a0-42) + ) + ) + (else + (let* ((a0-43 (-> (the-as process-focusable s1-1) root)) + (t9-14 (method-of-object a0-43 global-y-angle-to-point)) + (a1-29 (-> s5-0 surface-pos)) + ) + (-> s5-0 offset) + 0 + (t9-14 a0-43 a1-29) + ) + ) + ) + (when (not (logtest? (-> s2-0 flags) 2)) + (+! (-> s5-0 surface-pos y) -2048.0) + (let* ((a0-44 (-> (the-as process-focusable s1-1) root)) + (t9-15 (method-of-object a0-44 y-angle)) + ) + (-> s5-0 surface-pos) + (-> s5-0 zero-offset) + 0 + (t9-15 a0-44) + ) + (set! (-> s2-0 tread-time) (+ (-> s5-0 cur-time) -50)) + ) + ) + (else + (when (logtest? (-> s2-0 flags) 2) + (set! (-> s2-0 tread-time) (-> s5-0 cur-time)) + (+! (-> s5-0 surface-pos y) -2048.0) + (let* ((a0-45 (-> (the-as process-focusable s1-1) root)) + (t9-16 (method-of-object a0-45 y-angle)) + ) + (-> s5-0 surface-pos) + (-> s5-0 zero-offset) + 0 + (t9-16 a0-45) + ) + (+! (-> s5-0 surface-pos y) 2048.0) + (let* ((a0-46 (-> (the-as process-focusable s1-1) root)) + (t9-17 (method-of-object a0-46 y-angle)) + ) + (-> s5-0 surface-pos) + (-> s5-0 offset) + 0 + (t9-17 a0-46) + ) + (set! (-> s2-0 tread-time) (+ (-> s5-0 cur-time) -50)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((f0-28 (-> this camera-dist2)) + (f1-17 245760.0) + ) + (when (< f0-28 (* f1-17 f1-17)) + (let ((s4-1 (-> this root root-prim)) + (s3-1 1) + ) + (when (< (-> this rbody position y) (+ (-> this water-height) (-> s4-1 local-sphere w))) + (when (zero? (-> s4-1 prim-core prim-type)) + (let ((v1-103 s4-1)) + (set! s4-1 (-> (the-as collide-shape-prim-group v1-103) child 0)) + (set! s3-1 (the-as int (-> v1-103 specific 0))) + ) + ) + (while (nonzero? s3-1) + (+! s3-1 -1) + (when (= (-> s4-1 prim-core prim-type) -1) + (let ((a1-33 (-> s4-1 prim-core))) + (if (< (- (-> a1-33 world-sphere y) (-> a1-33 world-sphere w)) (-> this water-height)) + (wvehicle-method-200 this (the-as vector a1-33) s5-0) + ) + ) + ) + (&+! s4-1 80) + ) + ) + ) + ) + ) + ) + (when (and (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + ) + (let ((s5-1 (new 'stack-no-clear 'wvehicle-draw-thruster-params))) + (let* ((v1-118 (-> s5-1 mat)) + (a3-9 (-> this node-list data 0 bone transform)) + (a0-54 (-> a3-9 rvec quad)) + (a1-35 (-> a3-9 uvec quad)) + (a2-20 (-> a3-9 fvec quad)) + (a3-10 (-> a3-9 trans quad)) + ) + (set! (-> v1-118 rvec quad) a0-54) + (set! (-> v1-118 uvec quad) a1-35) + (set! (-> v1-118 fvec quad) a2-20) + (set! (-> v1-118 trans quad) a3-10) + ) + (set! (-> s5-1 width) (-> this info particles thruster-flame-width)) + (set! (-> s5-1 length) (-> this info particles thruster-flame-length)) + (set! (-> s5-1 thrust) 1.0) + (set! (-> s5-1 fog-fade) (-> this fog-fade)) + (quaternion-rotate-local-z! (-> s5-1 quat) (-> this root quat) 5461.3335) + (dotimes (s4-2 2) + (vector-matrix*! (-> s5-1 trans) (-> this info particles thruster-local-pos s4-2) (-> s5-1 mat)) + (vehicle-draw-thruster (-> this info particle-common) (the-as vehicle-draw-thruster-params (-> s5-1 quat))) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-106 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle vehicle-method-106))) + (t9-0 this) + ) + (sound-stop (-> this engine1-sound-id)) + (sound-stop (-> this engine2-sound-id)) + (sound-stop (-> this engine3-sound-id)) + (set! (-> this eng1-vol) 0.0) + (set! (-> this eng2-vol) 0.0) + (set! (-> this eng3-vol) 0.0) + (set! (-> this engine1-sound-id) (new 'static 'sound-id)) + (set! (-> this engine2-sound-id) (new 'static 'sound-id)) + (set! (-> this engine3-sound-id) (new 'static 'sound-id)) + (dotimes (s5-0 4) + (let ((s4-0 (-> this tire-roll-loop-state s5-0))) + (sound-stop (-> s4-0 id)) + (set! (-> s4-0 vol) 0.0) + (set! (-> s4-0 id) (new 'static 'sound-id)) + ) + 0 + ) + (dotimes (s5-1 2) + (let ((s4-1 (-> this tire-slide-loop-state s5-1))) + (sound-stop (-> s4-1 id)) + (set! (-> s4-1 vol) 0.0) + (set! (-> s4-1 id) (new 'static 'sound-id)) + ) + 0 + ) + (set! (-> this water-sound-envelope) 0.0) + (sound-stop (-> this water-sound-id)) + (set! (-> this water-sound-id) (new 'static 'sound-id)) + (sound-stop (-> this turbo-sound-id)) + (set! (-> this turbo-sound-id) (new 'static 'sound-id)) + 0 + (none) + ) + +(defmethod vehicle-method-135 ((this wvehicle)) + (set! (-> this controls throttle) 1.0) + ((method-of-type vehicle vehicle-method-135) this) + (none) + ) + +(defmethod vehicle-method-136 ((this wvehicle)) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag ignition)) + (if (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (sound-play-by-name (-> this info sound stop-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + ) + (sound-stop (-> this engine1-sound-id)) + (sound-stop (-> this engine2-sound-id)) + (sound-stop (-> this engine3-sound-id)) + (sound-stop (-> this turbo-sound-id)) + (set! (-> this engine1-sound-id) (new 'static 'sound-id)) + (set! (-> this engine2-sound-id) (new 'static 'sound-id)) + (set! (-> this engine3-sound-id) (new 'static 'sound-id)) + (set! (-> this turbo-sound-id) (new 'static 'sound-id)) + 0 + ) + 0 + (none) + ) + +(deftype wvehicle-sound-loop-params (structure) + ((speed float) + (weight float) + ) + ) + + +(deftype wvehicle-sound-work (structure) + ((roll-basis-params wvehicle-sound-loop-params 4 :inline) + (slide-basis-params wvehicle-sound-loop-params 2 :inline) + ) + ) + +;; og:preserve-this added +(deftype wvehicle-stack-type7 (structure) + ((work wvehicle-sound-work :inline :offset 0) + (vec0 vector :inline :offset 96) + (float3 float :offset 116) + (float2 float :offset 120) + (float0 float :offset 124) + (vec1 vector :inline :offset 128) + (float1 float :offset 144) + ) + ) + +;; WARN: Return type mismatch number vs none. +(defmethod rigid-body-object-method-38 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle rigid-body-object-method-38))) + (t9-0 this) + ) + (let ((s5-0 (-> this info)) + (s4-1 (not (logtest? (vehicle-flag ai-driving) (-> this v-flags)))) + ) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (if (zero? (-> this engine1-sound-id)) + (set! (-> this engine1-sound-id) (new-sound-id)) + ) + (if (zero? (-> this engine2-sound-id)) + (set! (-> this engine2-sound-id) (new-sound-id)) + ) + (if (zero? (-> this engine3-sound-id)) + (set! (-> this engine3-sound-id) (new-sound-id)) + ) + (let ((s3-0 (new 'stack-no-clear 'wvehicle-stack-type5))) + (set! (-> s3-0 vec5 x) (seconds-per-frame)) + (seek! (-> this eng-pitch-variance) (-> this eng-pitch-variance-seek) (* 0.4 (-> s3-0 vec5 x))) + (if (= (-> this eng-pitch-variance) (-> this eng-pitch-variance-seek)) + (set! (-> this eng-pitch-variance-seek) (* 0.0 (+ -1.0 (rand-vu) (rand-vu)))) + ) + (seek! (-> this eng-vol-variance) (-> this eng-vol-variance-seek) (* 0.8 (-> s3-0 vec5 x))) + (if (= (-> this eng-vol-variance) (-> this eng-vol-variance-seek)) + (set! (-> this eng-vol-variance-seek) (* 0.0 (+ -1.0 (rand-vu) (rand-vu)))) + ) + (seek! (-> this eng-flutter-envelope) 0.0 (* 0.5 (-> s3-0 vec5 x))) + (seek! + (-> this sound-engine-rpm) + (-> this engine-rpm) + (* 3000.0 (+ 1.0 (* 10.0 (-> this clutch-grab))) (-> s3-0 vec5 x)) + ) + (set! (-> s3-0 vec3 z) (* (-> this sound-engine-rpm) (+ 1.0 (-> this eng-pitch-variance)))) + (set! (-> s3-0 vec3 y) 0.0) + (set! (-> s3-0 vec2 y) + (* (fmax + 0.5 + (fmin + 1.0 + (+ 0.7 + (/ (- (-> s3-0 vec3 z) (-> s5-0 engine idle-rpm)) (- (-> s5-0 engine max-rpm) (-> s5-0 engine idle-rpm))) + ) + ) + ) + (+ 1.0 (-> this eng-vol-variance)) + ) + ) + (set! (-> s3-0 vec2 z) (-> s5-0 sound idle-crossover-rpm)) + (set! (-> s3-0 vec2 w) (-> s5-0 sound engine-crossover-rpm)) + (set! (-> s3-0 vec3 x) + (fmax 0.0 (fmin 1.0 (/ (- (-> s3-0 vec3 z) (-> s3-0 vec2 z)) (- (-> s3-0 vec2 w) (-> s3-0 vec2 z))))) + ) + (set! (-> s3-0 vec0 x) (* (-> s3-0 vec2 y) (- 1.0 (-> s3-0 vec3 x)))) + (set! (-> s3-0 vec0 w) (* (-> s3-0 vec2 y) (-> s3-0 vec3 x) (- 1.0 (-> s3-0 vec3 y)))) + (set! (-> s3-0 vec1 z) (* (-> s3-0 vec2 y) (-> s3-0 vec3 x) (-> s3-0 vec3 y))) + (set! (-> s3-0 vec0 x) (cube-root (-> s3-0 vec0 x))) + (set! (-> s3-0 vec0 w) (cube-root (-> s3-0 vec0 w))) + (set! (-> s3-0 vec1 z) (cube-root (-> s3-0 vec1 z))) + (set! (-> s3-0 vec0 y) + (+ (-> this eng-pitch-offset) + (* (-> s5-0 sound idle-pitch-scale) (log2f (/ (-> s3-0 vec3 z) (-> s5-0 sound idle-rpm)))) + ) + ) + (set! (-> s3-0 vec1 x) + (+ (-> this eng-pitch-offset) + (* (-> s5-0 sound engine-pitch-scale) (log2f (/ (-> s3-0 vec3 z) (-> s5-0 sound engine-rpm)))) + ) + ) + (set! (-> s3-0 vec1 w) (-> s3-0 vec1 x)) + (set! (-> s3-0 vec4 quad) (-> this root trans quad)) + (let ((s2-0 (static-sound-spec "aaaabbbbccccddd" :group 1 :volume 0.0 :mask (pitch)))) + (logior! (-> s2-0 mask) (sound-mask trans unk2)) + (set! (-> s2-0 sound-name) (-> s5-0 sound idle-sound)) + (set! (-> s2-0 volume) (the int (* 1024.0 (-> s3-0 vec0 x)))) + (set! (-> s2-0 pitch-mod) (the int (* 1524.0 (-> s3-0 vec0 y)))) + (sound-play-by-spec s2-0 (-> this engine1-sound-id) (-> s3-0 vec4)) + (set! (-> s2-0 sound-name) (-> s5-0 sound engine-sound)) + (set! (-> s2-0 volume) (the int (* 1024.0 (-> s3-0 vec0 w)))) + (set! (-> s2-0 pitch-mod) (the int (* 1524.0 (-> s3-0 vec1 x)))) + (sound-play-by-spec s2-0 (-> this engine2-sound-id) (-> s3-0 vec4)) + ) + 0 + (when s4-1 + (cond + ((logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (if (zero? (-> this turbo-sound-id)) + (set! (-> this turbo-sound-id) (new-sound-id)) + ) + (sound-play-by-name + (-> s5-0 sound turbo-sound) + (-> this turbo-sound-id) + 1024 + 0 + 0 + (sound-group) + (-> s3-0 vec4) + ) + ) + (else + (when (nonzero? (-> this turbo-sound-id)) + (sound-stop (-> this turbo-sound-id)) + (set! (-> this turbo-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + ) + (when s4-1 + (let ((s3-1 (new 'stack-no-clear 'wvehicle-stack-type7))) + (set! (-> s3-1 float1) (seconds-per-frame)) + (set! (-> s3-1 vec0 quad) (-> this root trans quad)) + (dotimes (v1-59 4) + (let ((a0-26 (-> s3-1 work roll-basis-params v1-59))) + (set! (-> a0-26 speed) 0.0) + (set! (-> a0-26 weight) 0.0) + ) + ) + (dotimes (v1-62 2) + (let ((a0-30 (-> s3-1 work slide-basis-params v1-62))) + (set! (-> a0-30 speed) 0.0) + (set! (-> a0-30 weight) 0.0) + ) + ) + (dotimes (v1-65 4) + (let ((a0-35 (-> this wheel v1-65))) + (when (logtest? (-> a0-35 flags) 2) + (set! (-> s3-1 float3) (fabs (-> a0-35 forward-vel))) + (let* ((f0-85 (-> a0-35 side-vel)) + (f0-87 (* f0-85 f0-85)) + (f1-29 (-> a0-35 forward-slip-vel)) + ) + (set! (-> s3-1 float2) (sqrtf (+ f0-87 (* f1-29 f1-29)))) + ) + (let ((a0-36 (-> a0-35 surface))) + (dotimes (a1-12 4) + (let ((a2-9 (the-as structure (-> s3-1 work roll-basis-params a1-12))) + (f0-91 (* 0.25 (-> a0-36 tire-roll-mix a1-12))) + ) + (+! (-> (the-as vector a2-9) y) f0-91) + (+! (-> (the-as vector a2-9) x) (* f0-91 (-> s3-1 float3))) + ) + ) + (dotimes (a1-15 2) + (let ((a2-13 (the-as structure (-> s3-1 work slide-basis-params a1-15))) + (f0-95 (* 0.25 (-> a0-36 tire-slide-mix a1-15))) + ) + (+! (-> (the-as vector a2-13) y) f0-95) + (+! (-> (the-as vector a2-13) x) (* f0-95 (-> s3-1 float2))) + ) + ) + ) + ) + ) + ) + (set! (-> s3-1 vec1 x) 0.0) + (dotimes (s2-1 2) + (let ((v1-70 (the-as structure (-> s3-1 work slide-basis-params s2-1))) + (s0-0 (-> s5-0 sound tire-slide-sounds s2-1)) + (s1-0 (-> this tire-slide-loop-state s2-1)) + ) + (set! (-> s3-1 vec1 z) 0.0) + (when (< 0.0 (-> (the-as vector v1-70) y)) + (set! (-> s3-1 float2) (/ (-> (the-as vector v1-70) x) (-> (the-as vector v1-70) y))) + (set! (-> s3-1 vec1 z) + (* (-> (the-as vector v1-70) y) + (fmax 0.0 (fmin 1.0 (/ (- (-> s3-1 float2) (-> s0-0 min-speed)) (- (-> s0-0 max-speed) (-> s0-0 min-speed))))) + ) + ) + (set! (-> s3-1 vec1 w) + (fmax + (fmin + (+ (-> s0-0 pitch-offset) (* (-> s0-0 pitch-scale) (log2f (/ (-> s3-1 float2) (-> s0-0 speed))))) + (-> s0-0 max-pitch) + ) + (-> s0-0 min-pitch) + ) + ) + (+! (-> s3-1 vec1 x) (-> s3-1 vec1 z)) + (set! (-> s1-0 vol) (fmax (-> s3-1 vec1 z) (-> s1-0 vol))) + (set! (-> s1-0 pitch) (-> s3-1 vec1 w)) + ) + (seek! (-> s1-0 vol) (-> s3-1 vec1 z) (* 4.0 (-> s3-1 float1))) + ) + ) + (set! (-> s3-1 float0) (fmax 0.0 (- 1.0 (-> s3-1 vec1 x)))) + (dotimes (s2-2 4) + (let ((v1-80 (the-as structure (-> s3-1 work roll-basis-params s2-2))) + (s0-1 (-> s5-0 sound tire-roll-sounds s2-2)) + (s1-1 (-> this tire-roll-loop-state s2-2)) + ) + (set! (-> s3-1 vec1 z) 0.0) + (when (< 0.0 (-> (the-as vector v1-80) y)) + (set! (-> s3-1 vec1 y) (/ (-> (the-as vector v1-80) x) (-> (the-as vector v1-80) y))) + (set! (-> s3-1 vec1 z) + (* (-> (the-as vector v1-80) y) + (fmax + 0.0 + (fmin + 1.0 + (* (-> s3-1 float0) + (- (-> s3-1 vec1 y) (-> s0-1 min-speed)) + (/ 1.0 (- (-> s0-1 max-speed) (-> s0-1 min-speed))) + ) + ) + ) + ) + ) + (set! (-> s3-1 vec1 w) + (fmax + (fmin + (+ (-> s0-1 pitch-offset) (* (-> s0-1 pitch-scale) (log2f (/ (-> s3-1 vec1 y) (-> s0-1 speed))))) + (-> s0-1 max-pitch) + ) + (-> s0-1 min-pitch) + ) + ) + (set! (-> s1-1 vol) (fmax (-> s3-1 vec1 z) (-> s1-1 vol))) + (set! (-> s1-1 pitch) (-> s3-1 vec1 w)) + ) + (seek! (-> s1-1 vol) (-> s3-1 vec1 z) (* 4.0 (-> s3-1 float1))) + ) + ) + (dotimes (s2-3 4) + (let ((s0-2 (-> this tire-roll-loop-state s2-3)) + (s1-2 (-> s5-0 sound tire-roll-sounds s2-3)) + ) + (set! (-> s3-1 vec1 z) (-> s0-2 vol)) + (set! (-> s3-1 vec1 z) (cube-root (-> s3-1 vec1 z))) + (set! (-> s3-1 vec1 w) (-> s0-2 pitch)) + (cond + ((= s2-3 3) + (when (< 0.0 (-> s0-2 vol)) + (let ((v1-96 (the-as structure (-> s3-1 work roll-basis-params s2-3)))) + (when (< 0.0 (-> (the-as vector v1-96) y)) + (set! (-> s3-1 vec1 y) (/ (-> (the-as vector v1-96) x) (-> (the-as vector v1-96) y))) + (let ((f0-154 (/ 7720777.5 (* 14.0 (-> s3-1 vec1 y))))) + (when (>= (the-as uint (- (current-time) (the-as int (-> this knobby-time)))) (the-as uint (the int f0-154))) + (set! (-> this knobby-time) (the-as uint (current-time))) + (sound-play-by-name + (-> s1-2 sound) + (new-sound-id) + (the int (* 1024.0 (-> s3-1 vec1 z))) + (the int (* 1524.0 (-> s3-1 vec1 w))) + 0 + (sound-group) + (-> s3-1 vec0) + ) + ) + ) + ) + ) + ) + ) + ((< 0.0 (-> s3-1 vec1 z)) + (if (zero? (-> s0-2 id)) + (set! (-> s0-2 id) (new-sound-id)) + ) + (sound-play-by-name + (-> s1-2 sound) + (-> s0-2 id) + (the int (* 1024.0 (-> s3-1 vec1 z))) + (the int (* 1524.0 (-> s3-1 vec1 w))) + 0 + (sound-group) + (-> s3-1 vec0) + ) + ) + (else + (when (nonzero? (-> s0-2 id)) + (sound-stop (-> s0-2 id)) + (set! (-> s0-2 id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + (dotimes (s2-4 2) + (let ((s1-4 (-> this tire-slide-loop-state s2-4)) + (s0-4 (-> s5-0 sound tire-slide-sounds s2-4)) + ) + (set! (-> s3-1 vec1 z) (-> s1-4 vol)) + (set! (-> s3-1 vec1 z) (cube-root (-> s3-1 vec1 z))) + (cond + ((< 0.0 (-> s3-1 vec1 z)) + (if (zero? (-> s1-4 id)) + (set! (-> s1-4 id) (new-sound-id)) + ) + (sound-play-by-name + (-> s0-4 sound) + (-> s1-4 id) + (the int (* 1024.0 (-> s3-1 vec1 z))) + (the int (* 1524.0 (-> s1-4 pitch))) + 0 + (sound-group) + (-> s3-1 vec0) + ) + ) + (else + (when (nonzero? (-> s1-4 id)) + (sound-stop (-> s1-4 id)) + (set! (-> s1-4 id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + ) + ) + (when s4-1 + (let ((s3-2 (new 'stack-no-clear 'wvehicle-stack-type5))) + (set! (-> s3-2 vec0 quad) (-> this root trans quad)) + (set! (-> s3-2 vec1 x) 0.0) + (set! (-> s3-2 vec1 y) 0.0) + (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (dotimes (v1-135 4) + (let ((a0-76 (-> this wheel v1-135))) + (if (logtest? (-> a0-76 flags) 2) + (set! (-> s3-2 vec1 y) (fmax (-> s3-2 vec1 y) (- (-> a0-76 up-vel)))) + ) + ) + ) + ) + (set! (-> s3-2 vec1 x) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -409.6 (-> s3-2 vec1 y)))))) + (when (and (< 0.0 (-> s3-2 vec1 x)) + (>= (the-as uint (- (current-time) (the-as int (-> this susp-creak-time)))) (the-as uint 30)) + ) + (set! (-> this susp-creak-time) (the-as uint (current-time))) + (set! (-> s3-2 vec1 x) (cube-root (-> s3-2 vec1 x))) + (sound-play-by-name + (-> s5-0 sound susp-creak-sound) + (new-sound-id) + (the int (* 1024.0 (-> s3-2 vec1 x))) + 0 + 0 + (sound-group) + (-> s3-2 vec0) + ) + ) + (if (< (* 0.5 (-> s5-0 sound susp-speed-threshold)) (-> s3-2 vec1 y)) + (set! (-> this eng-flutter-envelope) 1.0) + ) + (when (< (-> s5-0 sound susp-speed-threshold) (-> s3-2 vec1 y)) + (set! (-> s3-2 vec1 x) + (fmax 0.0 (fmin 1.0 (* 0.000024414063 (- (-> s3-2 vec1 y) (-> s5-0 sound susp-speed-threshold))))) + ) + (set! (-> s3-2 vec1 x) (cube-root (-> s3-2 vec1 x))) + (sound-play-by-name + (-> s5-0 sound susp-bottom-out-sound) + (new-sound-id) + (the int (* 1024.0 (-> s3-2 vec1 x))) + 0 + 0 + (sound-group) + (-> s3-2 vec0) + ) + ) + ) + ) + (when s4-1 + (cond + ((< 0.0 (-> this water-sound-envelope)) + (if (zero? (-> this water-sound-id)) + (set! (-> this water-sound-id) (new-sound-id)) + ) + (let ((s4-2 (new 'stack-no-clear 'matrix))) + (set! (-> s4-2 rvec quad) (-> this root trans quad)) + (set! (-> s4-2 uvec x) (-> this water-sound-envelope)) + (set! (-> s4-2 uvec x) (cube-root (-> s4-2 uvec x))) + (sound-play-by-name + (-> s5-0 sound water-sound) + (-> this water-sound-id) + (the int (* 1024.0 (-> s4-2 uvec x))) + 0 + 0 + (sound-group) + (-> s4-2 rvec) + ) + ) + (seek! (-> this water-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) + ) + (else + (when (nonzero? (-> this water-sound-id)) + (sound-stop (-> this water-sound-id)) + (set! (-> this water-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc index a2d030f42c..be206590ec 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc @@ -5,5 +5,443 @@ ;; name in dgo: wvehicle-h ;; dgos: LPATK, LFACCAR, WASALL +;; added +(deftype wvehicle-draw-thruster-params (structure) + ((quat quaternion :inline :offset-assert 0) + (trans vector :inline :offset-assert 16) + (mat matrix :inline :offset 48) + (thrust float :offset 32) + (width float :offset 36) + (length float :offset 40) + (fog-fade float :offset 44) + ) + ) + +(deftype wvehicle-stack-type0 (structure) + ((float-arr float 4 :offset 0) + (vec00 vector :inline :offset 96) + (float03326 float :offset 16) + (float0335 float :offset 20) + (float032 float :offset 24) + (float03623423 float :offset 28) + (word00 uint32 :offset 28 :score 1) + (float00 float :offset 80) + (float01 float :offset 96) + (float000 float :offset 116) + (float8 float :offset 120) + (float02 float :offset 124) + (float03 float :offset 128) + (float04 float :offset 132) + (float05 float :offset 136) + (float06 float :offset 140) + (float07 float :offset 144) + ) + ) + +(deftype wvehicle-stack-type1 (structure) + ((vec00 vector :inline :offset 0) + (float00 float :offset 16) + (float01 float :offset 20) + (byte00 int8 :offset 24) + ) + ) + +(deftype wvehicle-stack-type2 (structure) + ((cquery collide-query :inline :offset 0) + (mat0 matrix :inline :offset 544) + (vec0 vector :inline :offset 592) + (vec1 vector :inline :offset 624) + (vec2 vector :inline :offset 640) + (vec3 vector :inline :offset 656) + (float0 float :offset 672) + ) + ) + +(deftype wvehicle-stack-type3 (structure) + ((vec0 vector :inline :offset 0) + (mat0 matrix :inline :offset 16) + (float0 float :offset 80) + ) + ) + +(deftype wvehicle-stack-type4 (structure) + ((byte0 int8 :offset 0) + (float0 float :offset 4) + (float1 float :offset 8) + (float2 float :offset 12) + ) + ) + +;; added +(deftype wvehicle-stack-type5 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (vec2 vector :inline :offset 32) + (vec3 vector :inline :offset 48) + (vec4 vector :inline :offset 64) + (vec5 vector :inline :offset 80) + (vec6 vector :inline :offset 96) + (vec7 vector :inline :offset 112) + (vec8 vector :inline :offset 128) + (vec9 vector :inline :offset 144) + ) + ) + +(deftype wvehicle-stack-type6 (structure) + ((mat0 matrix :inline :offset 0) + (quat0 quaternion :inline :offset 64) + (quat1 quaternion :inline :offset 80) + (quat2 quaternion :inline :offset 96) + (quat3 quaternion :inline :offset 112) + (quat4 quaternion :inline :offset 128) + (vec0 vector :inline :offset 144) + (vec1 vector :inline :offset 160) + (vec2 vector :inline :offset 176) + (vec3 vector :inline :offset 192) + (float0 float :offset 240) + ) + ) + +(deftype wvehicle-jmod-work (structure) + ((quat0 quaternion :inline :offset 0) + (quat1 quaternion :inline :offset 16) + (mat0 matrix :inline :offset 32) + (vec0 vector :inline :offset 96) + (float0 float :offset 112) + (float1 float :offset 116) + (float2 float :offset 120) + ) + ) + +;; +++vehicle-wheel-surface-flag +(defenum vehicle-wheel-surface-flag + :type uint8 + :bitfield #t + (moving) + ) +;; ---vehicle-wheel-surface-flag + + +(declare-type wvehicle-part-work structure) +(declare-type wvehicle-wheel-launcher-spec structure) +(declare-type vehicle-wheel-surface structure) +(define-extern *wvehicle-surfaces* (inline-array vehicle-wheel-surface)) + ;; DECOMP BEGINS +(deftype wvehicle-sound-loop-state (structure) + ((id sound-id) + (vol float) + (pitch float) + ) + :allow-misaligned + ) + + +(deftype vehicle-wheel-surface (structure) + ((flags vehicle-wheel-surface-flag) + (surface-type uint8) + (friction float) + (drag float) + (depth float) + (damage float) + (tire-roll-mix float 4) + (tire-roll-hum float :overlay-at (-> tire-roll-mix 0)) + (tire-roll-dirt float :overlay-at (-> tire-roll-mix 1)) + (tire-roll-sand float :overlay-at (-> tire-roll-mix 2)) + (tire-roll-knobby float :overlay-at (-> tire-roll-mix 3)) + (tire-slide-mix float 2) + (tire-slide-road float :overlay-at (-> tire-slide-mix 0)) + (tire-slide-dirt float :overlay-at (-> tire-slide-mix 1)) + ) + ) + + +(deftype vehicle-wheel-state (structure) + ((info vehicle-wheel-info) + (flags uint8) + (prev-flags uint8) + (handle handle) + (probe-local-pos vector :inline) + (probe-local-dir vector :inline) + (local-axis vector :inline) + (surface-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (trans vector :inline) + (quat quaternion :inline) + (trail-pos vector 2 :inline) + (surface vehicle-wheel-surface) + (pos float) + (pos2 float) + (inertia float) + (steer-angle float) + (angle float) + (rev float) + (x-scale float) + (torque float) + (braking-torque float) + (up-force float) + (drive-diff float) + (side-vel float) + (up-vel float) + (forward-vel float) + (forward-slip-vel float) + (friction-coef float) + (sink-depth float) + (sin-susp-ang float) + (cos-susp-ang float) + (part-birth-accum sparticle-launch-control 4) + (tread-time uint32) + (tread-tracker handle) + ) + ) + + +(deftype wvehicle-probe-work (structure) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (wheel-axis vector :inline) + (side-dir vector :inline) + (forward-dir vector :inline) + (velocity vector :inline) + (probe-uu float) + ) + ) + + +(deftype wvehicle-physics-work (structure) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (probe-dir vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal-sum vector :inline) + (ground-pos vector :inline) + (forward-dir vector :inline) + (side-dir vector :inline) + (wheel-axis vector :inline) + (wsphere sphere :inline) + (friction-coef float) + (wheel-radius float) + (side-force float) + (forward-force float) + (max-forward-tire-grip float) + (max-side-tire-grip float) + (inertia-eff float) + (ground-torque float) + (braking-torque float) + (total-torque float) + (limit-braking-torque float) + (max-braking-torque float) + (surface-drag float) + (water-y float) + (cur-time uint32) + (surface-type uint8) + (surface-depth float) + (material uint64) + (probe-work-array wvehicle-probe-work 4 :inline) + (cquery collide-query :inline) + ) + ) + + +(deftype wvehicle (vehicle) + ((race race-control :inline) + (target-status squad-target-status :inline) + (ai-controls vehicle-controls :inline) + (minimap connection-minimap) + (net basic) + (engine-rev float) + (engine-inertia float) + (engine-torque float) + (engine-max-torque float) + (engine-rpm float) + (sound-engine-rpm float) + (wheel-rev float) + (wheel-inertia float) + (wheel-torque float) + (wheel-braking-torque float) + (wheel-ground-torque float) + (clutch-grab float) + (gear-ratio float) + (final-drive-ratio float) + (total-gear-ratio float) + (inv-total-gear-ratio float) + (avg-drive-wheel-radius float) + (drive-wheel-inertia float) + (clutch-inertia float) + (idle-throttle float) + (susp-spring-control float) + (jump-control float) + (ai-min-speed float) + (ai-max-speed float) + (shortcut-speed-factor float) + (path-deviation float) + (turbo-supply float) + (turbo-ready float) + (ai-state uint8) + (return-ai-state uint8) + (i-barrel int8) + (shift-state uint8) + (gear-select int8) + (next-gear-select int8) + (shift-time uint32) + (impact rigid-body-impact :inline) + (wheel vehicle-wheel-state 4 :inline) + (gravity-dir vector :inline) + (ai-target-point vector :inline) + (surface-velocity vector :inline) + (turret-local-pos vector :inline) + (gun-local-pos vector :inline) + (gun-local-dir vector :inline) + (gun-aim-yaw float) + (gun-aim-yaw-vel float) + (gun-targ-yaw float) + (gun-targ-pitch float) + (gun-yaw float) + (gun-pitch float) + (gun-yaw-vel float) + (gun-pitch-vel float) + (gun-kick float) + (lock-turret basic) + (tire-roll-loop-state wvehicle-sound-loop-state 4 :inline) + (tire-slide-loop-state wvehicle-sound-loop-state 2 :inline) + (engine1-sound-id sound-id :offset 2472) + (engine2-sound-id sound-id) + (engine3-sound-id sound-id) + (damage-sound-id sound-id) + (water-sound-id sound-id) + (turbo-sound-id sound-id) + (shortcut-time uint32) + (overturned-time uint32) + (splash-time uint32) + (knobby-time uint32) + (susp-creak-time uint32) + (shoot-time uint32) + (shoot-delay uint32) + (jump-time uint32) + (ground-time uint32) + (ram-time uint32) + (attached-array handle 16) + (eng1-vol float) + (eng2-vol float) + (eng3-vol float) + (eng-pitch-variance float) + (eng-pitch-variance-seek float) + (eng-vol-variance float) + (eng-vol-variance-seek float) + (eng-pitch-offset float) + (eng-flutter-envelope float) + (water-sound-envelope float) + (other-proc handle) + (other-pos vector :inline) + ) + :allow-misaligned + (:state-methods + hostile + undefined0 + race-waiting + race-racing + race-finished + undefined1 + explode-into-nothing + sink + ) + (:methods + (wvehicle-method-160 (_type_ wvehicle-physics-work) none) + (spawn-wheels! (_type_ skeleton-group skeleton-group skeleton-group skeleton-group) none) + (wvehicle-method-162 (_type_ float) none) + (wvehicle-method-163 (_type_) none) + (wvehicle-method-164 (_type_ vehicle-wheel-state vehicle-wheel-info) none) + (wvehicle-method-165 (_type_) none) + (wvehicle-method-166 (_type_ float float) float) + (wvehicle-method-167 (_type_) none) + (wvehicle-method-168 (_type_) none) + (wvehicle-method-169 (_type_) none) + (wvehicle-method-170 (_type_) none) + (wvehicle-method-171 (_type_ vector int) none) + (wvehicle-method-172 (_type_ quaternion int) none) + (wvehicle-method-173 (_type_ vector) int) + (get-attached-by-idx (_type_ int) process-focusable) + (add-attached-at-idx (_type_ int process-focusable) none) + (remove-attached-from-arr (_type_ process-focusable) symbol) + (wvehicle-method-177 (_type_ vehicle-controls) none) + (wvehicle-method-178 (_type_) none) + (wvehicle-method-179 (_type_) none) + (wvehicle-method-180 (_type_ uint) none) + (wvehicle-method-181 (_type_) none) + (wvehicle-method-182 (_type_) none) + (wvehicle-method-183 (_type_) none) + (wvehicle-method-184 (_type_) none) + (wvehicle-method-185 (_type_) none) + (wvehicle-method-186 (_type_) none) + (wvehicle-method-187 (_type_) none) + (wvehicle-method-188 (_type_) none) + (wvehicle-method-189 (_type_ vehicle-wheel-state wvehicle-part-work wvehicle-wheel-launcher-spec) none) + (wvehicle-method-190 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-191 (_type_ vehicle-wheel-state wvehicle-part-work) symbol) + (wvehicle-method-192 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-193 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-194 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-195 (_type_) none) + (wvehicle-method-196 (_type_) none) + (wvehicle-method-197 (_type_) symbol) + (wvehicle-method-198 (_type_) none) + (wvehicle-method-199 (_type_) none) + (wvehicle-method-200 (_type_ vector wvehicle-part-work) none) + (wvehicle-method-201 (_type_) none) + (wvehicle-method-202 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch float vs degrees. +(defun rpm->radians-per-sec ((arg0 float)) + (the-as degrees (* 0.10471976 arg0)) + ) + +(defun radians-per-sec->rpm ((arg0 degrees)) + (* 9.549297 arg0) + ) + +(deftype wvehicle-ai-drop-off-params (structure) + ((dest vector :inline) + (proc process) + ) + ) + + +(defun wvehicle-surface-type-from-material ((arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (= v1-0 23) (= v1-0 6)) + 0 + ) + ((or (= v1-0 15) (zero? v1-0)) + 1 + ) + ((= v1-0 5) + 2 + ) + ((= v1-0 2) + 3 + ) + ((= v1-0 16) + 6 + ) + (else + 1 + ) + ) + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc index f89525ec9f..50c3032a42 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc @@ -7,3 +7,90 @@ ;; DECOMP BEGINS +(deftype hud-vehicle-turbo (hud) + ((tex-rim texture) + (tex-on texture) + (tex-off texture) + ) + ) + + +(defmethod draw ((this hud-vehicle-turbo)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (* -100.0 (-> this offset))) 336) + (let* ((f0-5 (the float (the int (-> *game-info* vehicle-turbo-ready)))) + (f0-7 (* 120.0 (fmax 0.33 f0-5))) + (v1-5 (-> *game-info* race-number-turbos)) + ) + (dotimes (a0-2 3) + (let ((a1-3 (-> this sprites a0-2))) + (cond + ((< a0-2 v1-5) + (set! (-> a1-3 tid) (the-as texture-id (-> this tex-on))) + (set! (-> a1-3 color w) (the int f0-7)) + ) + (else + (set! (-> a1-3 tid) (the-as texture-id (-> this tex-off))) + (set! (-> a1-3 color w) (the int (* 0.5 f0-7))) + ) + ) + ) + ) + ) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 32 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 32 0) + (dotimes (s5-0 3) + (set-as-offset-from! (-> this sprites (+ s5-0 3)) (the-as vector4w (-> this sprites s5-0)) 0 0) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-vehicle-turbo)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-vehicle-turbo)) + (vehicle-entity-hack 27) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action play) (-> this name) 81920.0 0) + ) + (set! (-> this tex-on) + (lookup-level-texture-by-name "hud-turbo-boost-on-01" (-> this level) (the-as (pointer texture-page) #f)) + ) + (set! (-> this tex-off) + (lookup-level-texture-by-name "hud-turbo-boost-off-01" (-> this level) (the-as (pointer texture-page) #f)) + ) + (set! (-> this tex-rim) + (lookup-level-texture-by-name "hud-turbo-boost-rim-01" (-> this level) (the-as (pointer texture-page) #f)) + ) + (logior! (-> this flags) (hud-flags show)) + (dotimes (v1-4 6) + (let ((a0-8 (-> this sprites v1-4))) + (set! (-> a0-8 scale-x) 1.0) + (set! (-> a0-8 scale-y) 1.0) + ) + ) + (dotimes (v1-7 3) + (let ((a0-13 (-> this sprites (+ v1-7 3)))) + (set! (-> a0-13 tid) (the-as texture-id (-> this tex-rim))) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch process vs hud-vehicle-turbo. +(defun hud-vehicle-turbo-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn hud-vehicle-turbo :init hud-init-by-other :name "hud-vehicle-turbo" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as hud-vehicle-turbo gp-0) + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc index e14ba522a9..1ea1101e49 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc @@ -7,3 +7,461 @@ ;; DECOMP BEGINS +(defpartgroup group-turbo-pickup + :id 231 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 998 :flags (sp6 sp7)) + (sp-item 999 :flags (sp6 sp7)) + (sp-item 1000 :flags (sp6 sp7)) + (sp-item 1001 :flags (sp7)) + (sp-item 1002 :flags (sp3) :binding 994) + (sp-item 994 :flags (sp2 sp3) :binding 995) + (sp-item 1002 :flags (sp3) :binding 996) + (sp-item 996 :flags (sp2 sp3) :binding 995) + (sp-item 1002 :flags (sp3) :binding 997) + (sp-item 997 :flags (sp2 sp3) :binding 995) + (sp-item 995 :flags (sp2)) + (sp-item 995 :flags (sp2)) + (sp-item 995 :flags (sp2)) + ) + ) + +(defpart 998 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 200.0 2.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 999 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 30.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1000 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 20.0 1.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1002 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 80.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 994 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:z (meters 2)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.10666667)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 996 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -2)) + (:z (meters 2)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.10666667)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 997 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.10666667)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 995 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:fade-r 6.4) + (:fade-g -6.4) + (:fade-b -6.4) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 1001 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.06 0.06) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.3)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:scalevel-y (meters -0.001) (meters 0.002)) + (:fade-a 0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 1003) + ) + ) + +(defpart 1003 + :init-specs ((:scalevel-y (meters -0.0013333333) (meters 0.002)) (:fade-a -0.42666668)) + ) + +(defpartgroup group-turbo-pickup-explode + :id 232 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 1006 :period (seconds 20) :length (seconds 0.3)) + (sp-item 1007 :flags (sp3) :binding 1004) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + ) + ) + +(defpart 1006 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.5) + (:scale-x (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 32.0) + (:b :copy g) + (:a 128.0) + (:scalevel-x (meters -0.16666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + ) + ) + +(defpart 1007 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.001)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:func 'sparticle-track-root) + ) + ) + +(defpart 1004 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 4.0) + (:y (meters -4) (meters 16)) + (:scale-x (meters 1.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 1 (meters 0.035555556)) + (:vel-z (meters 0.16666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:accel-z (meters -0.011333333)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +(defpart 1005 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.002)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334 -0.13333334) + (:accel-y (meters -0.00066666666)) + (:friction 0.6 0.3) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +(deftype turbo-pickup (process-drawable) + ((root collide-shape :override) + (available symbol) + (persistent symbol) + (birth-time time-frame) + (collector handle) + ) + (:state-methods + idle + die + ) + (:methods + (find-ground (_type_) symbol) + ) + ) + + +(defmethod find-ground ((this turbo-pickup)) + (let ((s4-0 #f)) + (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) + (set! (-> gp-0 vec0 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-reset! (-> gp-0 vec1)) + (set! (-> gp-0 vec1 y) 1.0) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-5 (-> gp-0 cquery))) + (set! (-> v1-5 radius) 1024.0) + (set! (-> v1-5 collide-with) (collide-spec backgnd)) + (set! (-> v1-5 ignore-process0) #f) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (let ((f0-6 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f0-6 0.0) + (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f0-6) + (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (+! (-> gp-0 vec0 y) 4915.2) + (set! s4-0 #t) + (format #t "turbo-pickup::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) + ) + s4-0 + ) + ) + +(defstate idle (turbo-pickup) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (when (-> self available) + (set! (-> self collector) (process->handle proc)) + (when (send-event proc 'turbo-pickup) + (set! (-> self available) #f) + (go-virtual die) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (spawn (-> self part) (-> self root trans)) + (if (and (not (-> self persistent)) (time-elapsed? (-> self birth-time) (seconds 10))) + (go-virtual die) + ) + 0 + ) + ) + +(defstate die (turbo-pickup) + :virtual #t + :code (behavior () + (set-time! (-> self state-time)) + (let* ((s5-0 (handle->process (-> self collector))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when gp-0 + (if (logtest? (-> *part-group-id-table* 232 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 232) + :target (the-as process-drawable gp-0) + :mat-joint (the-as object 0) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 232) + :target (the-as process-drawable gp-0) + :mat-joint (the-as object 0) + ) + ) + ) + ) + (let ((v1-35 (-> self root root-prim))) + (set! (-> v1-35 prim-core collide-as) (collide-spec)) + (set! (-> v1-35 prim-core collide-with) (collide-spec)) + ) + 0 + (when (nonzero? (-> self part)) + (kill-particles (-> self part)) + (set! (-> self part) (the-as sparticle-launch-control 0)) + 0 + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior turbo-pickup-init-by-other turbo-pickup ((arg0 vector) (arg1 symbol)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrate-using) (the-as penetrate -1)) + (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-4 prim-core collide-with) (collide-spec vehicle-sphere hit-by-others-list)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 14336.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-7 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (update-transforms (-> self root)) + (set! (-> self available) #t) + (set! (-> self persistent) arg1) + (set-time! (-> self birth-time)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 231) self)) + (set! (-> self collector) (the-as handle #f)) + (go-virtual idle) + (none) + ) + +;; WARN: Return type mismatch process vs turbo-pickup. +(defun race-turbo-pickup-spawn ((arg0 process) (arg1 vector)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn turbo-pickup arg1 #t :name "turbo-pickup" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as turbo-pickup gp-0) + ) + ) + +;; WARN: Return type mismatch process vs turbo-pickup. +(defbehavior turbo-pickup-spawn turbo-pickup ((arg0 process) (arg1 vector)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn turbo-pickup arg0 #f :name "turbo-pickup" :to *entity-pool*))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as turbo-pickup gp-0) + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc index c693e98527..d7f75e8247 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc @@ -5,5 +5,1233 @@ ;; name in dgo: wvehicle-part ;; dgos: LPATK, LFACCAR, WASALL +(define-extern *range-wv-wsplash-color* curve-color-fast) +(define-extern *range-wv-wsplash-alpha* curve2d-fast) +(define-extern *range-wv-wsplash-scale-x* curve2d-fast) +(define-extern *range-wv-wsplash-scale-y* curve2d-fast) +(define-extern *curve-wv-wsplash-alpha* curve2d-fast) +(define-extern *curve-wv-wsplash-scale-x* curve2d-fast) +(define-extern *curve-wv-wsplash-scale-y* curve2d-fast) +(define-extern *range-wv-splash-color* curve-color-fast) +(define-extern *range-wv-splash-alpha* curve2d-fast) +(define-extern *range-wv-splash-scale-x* curve2d-fast) +(define-extern *range-wv-splash-scale-y* curve2d-fast) +(define-extern *curve-wv-splash-alpha* curve2d-fast) +(define-extern *curve-wv-splash-scale-x* curve2d-fast) +(define-extern *curve-wv-splash-scale-y* curve2d-fast) +(define-extern *curve-toad-linear-up-red* curve2d-piecewise) +(define-extern *trail-color-curve-toad-grenade* curve-color-fast) +(define-extern *curve-grenade-linear-toad-trail* curve2d-fast) +(define-extern *toad-grenade-trail* light-trail-composition) + ;; DECOMP BEGINS +(def-mips2c sparticle-motion-blur-dirt (function sparticle-system sparticle-cpuinfo vector none)) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-buggy-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 200)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpart 953 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-buggy-rocks) + (:num 1.0) + (:x (meters 0) (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.01)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.001)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-buggy-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-buggy-rocks arg0 arg1 arg2) + (none) + ) + +(defpart 954 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-dbuggy-debris) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1)) + (:r 200.0) + (:g 200.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.033333335)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defun spt-birth-func-part-dbuggy-debris ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (birth-func-set-vel-2d arg0 arg1 arg2) + (spt-birth-func-brightness-buggy-rocks arg0 arg1 arg2) + (none) + ) + +(defpart 955 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 956 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.05) + (:scale-x (meters 0.5)) + (:scale-y (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.008333334) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-part-wv-water-splash + :id 226 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 957 :fade-after (meters 60) :flags (sp7) :period (seconds 10) :length (seconds 0.2)) + (sp-item 958 :fade-after (meters 60) :flags (sp7) :period (seconds 10) :length (seconds 0.067) :offset 125) + (sp-item 959 :fade-after (meters 60) :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 960 :fade-after (meters 60) :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.167) :offset 125) + ) + ) + +(defpart 957 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.016666668)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-wv-wsplash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 158.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wv-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wv-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 0.5 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wv-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wv-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wv-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wv-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 2.0 :z 0.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y -5.0000005 :z -1.6666666 :w 1.0) + ) + ) + ) + +(define *part-wv-water-splash-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.95) :lifetime-offset (seconds 0.1)) + ) + +(set! (-> *part-id-table* 957 init-specs 13 initial-valuef) + (the-as float *part-wv-water-splash-curve-settings*) + ) + +(set! (-> *part-wv-water-splash-curve-settings* color-start) *range-wv-wsplash-color*) + +(set! (-> *part-wv-water-splash-curve-settings* alpha-start) *range-wv-wsplash-alpha*) + +(set! (-> *part-wv-water-splash-curve-settings* scale-x-start) *range-wv-wsplash-scale-x*) + +(set! (-> *part-wv-water-splash-curve-settings* scale-y-start) *range-wv-wsplash-scale-y*) + +(set! (-> *part-wv-water-splash-curve-settings* r-scalar) #f) + +(set! (-> *part-wv-water-splash-curve-settings* g-scalar) #f) + +(set! (-> *part-wv-water-splash-curve-settings* b-scalar) #f) + +(set! (-> *part-wv-water-splash-curve-settings* a-scalar) *curve-wv-wsplash-alpha*) + +(set! (-> *part-wv-water-splash-curve-settings* scale-x-scalar) *curve-wv-wsplash-scale-x*) + +(set! (-> *part-wv-water-splash-curve-settings* scale-y-scalar) *curve-wv-wsplash-scale-y*) + +(defpart 958 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 2.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +(if #t + (set! *range-wv-splash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 110.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wv-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wv-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wv-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wv-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -3.3333333 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wv-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 0.15 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -2.8333333 :y -0.21428573 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wv-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 3.0 :z 2.0) + :one-over-x-deltas (new 'static 'vector :x 6.0 :y -5.0000005 :z -6.6666665 :w 1.0) + ) + ) + ) + +(define *part-wv-water-splash-center-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.8) :lifetime-offset (seconds 0.4)) + ) + +(set! (-> *part-id-table* 958 init-specs 11 initial-valuef) + (the-as float *part-wv-water-splash-center-curve-settings*) + ) + +(set! (-> *part-wv-water-splash-center-curve-settings* color-start) *range-wv-splash-color*) + +(set! (-> *part-wv-water-splash-center-curve-settings* alpha-start) *range-wv-splash-alpha*) + +(set! (-> *part-wv-water-splash-center-curve-settings* scale-x-start) *range-wv-splash-scale-x*) + +(set! (-> *part-wv-water-splash-center-curve-settings* scale-y-start) *range-wv-splash-scale-y*) + +(set! (-> *part-wv-water-splash-center-curve-settings* r-scalar) #f) + +(set! (-> *part-wv-water-splash-center-curve-settings* g-scalar) #f) + +(set! (-> *part-wv-water-splash-center-curve-settings* b-scalar) #f) + +(set! (-> *part-wv-water-splash-center-curve-settings* a-scalar) *curve-wv-splash-alpha*) + +(set! (-> *part-wv-water-splash-center-curve-settings* scale-x-scalar) *curve-wv-splash-scale-x*) + +(set! (-> *part-wv-water-splash-center-curve-settings* scale-y-scalar) *curve-wv-splash-scale-y*) + +(defpart 959 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.4) + (:scale-x (meters 2) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.01) (meters 0.0033333334)) + (:scalevel-y (meters 0.01) (meters 0.0033333334)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 960 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0) (meters 0.1)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.00033333333) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 961 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 5.0) + (:x (meters 0) (meters 1)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 set-conerot)) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 962 + :init-specs ((:texture (ripples level-default-sprite)) + (:num 0.5 1.0) + (:x (meters 1) (meters 5)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 963 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 2.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.026666667) (meters 0.026666667)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 set-conerot)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 964 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 0.4) + (:scale-x (meters 2)) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 2)) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 20.0) + (:vel-y (meters 0) (meters 0.013333334)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 965) + (:launchrot-x (degrees -90)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-x (degrees 30)) + (:rotate-z (degrees -20) (degrees 40)) + ) + ) + +(defpart 965 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-gun-scorp-shells + :id 227 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 966 :flags (sp7)) (sp-item 967 :flags (sp7))) + ) + +(defpart 966 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 32.0 16.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:friction 0.85 0.04) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -45) (degrees 10)) + (:conerot-y (degrees 85) (degrees 10)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.4)) + ) + ) + +(defpart 967 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 260) (degrees 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 20.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.06666667) (meters 0.026666667)) + (:rotvel-z (degrees -4.8) (degrees 2.4)) + (:accel-y (meters -0.008333334) (meters -0.0016666667)) + (:timer (seconds 1.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408700 #x408700 #x408800)) + (:func 'check-scorp-shell-level1) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 968) + (:conerot-x (degrees -40) (degrees 20)) + (:conerot-y (degrees 80) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 968 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 969) + ) + ) + +(defpart 969 + :init-specs ((:r 128.0) (:g 128.0) (:b 20.0) (:a 128.0)) + ) + +(defpart 970 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 20.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.026666667) (meters 0.016666668)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0026666666) (meters -0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408800 #x408900)) + (:func 'check-scorp-shell-level2) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 968) + (:conerot-x (degrees 0) (degrees 45)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 971 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.35)) + (:rot-z (degrees 30) (degrees 120)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 20.0) + (:a 128.0) + (:vel-x (meters 0) (meters 0.0033333334)) + (:vel-y (meters 0.016666668)) + (:vel-z (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408800 #x408800 #x408900)) + (:next-time (seconds 0.25)) + (:next-launcher 972) + (:conerot-x (degrees 30) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 972 + :init-specs ((:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:next-time (seconds 2) (seconds 0.997)) + (:next-launcher 973) + ) + ) + +(defpart 973 + :init-specs ((:fade-a -0.512)) + ) + +(defpart 974 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.0 1 2.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.03) (meters 0.005)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.01125) (degrees 0.0045)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -2.55 -2.55) + (:fade-b -8.0) + (:fade-a -0.64 -0.64) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.8 0.02) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 60) (degrees 20)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defun check-scorp-shell-level1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (set! (-> *part-id-table* 970 init-specs 10 initial-valuef) (-> gp-0 y)) + (launch-particles (-> *part-id-table* 970) gp-0) + (launch-particles (-> *part-id-table* 974) gp-0) + ) + ) + 0 + (none) + ) + +(defun check-scorp-shell-level2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 971) gp-0) + (launch-particles (-> *part-id-table* 974) gp-0) + ) + ) + 0 + (none) + ) + +(defpart 975 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-setup-beam) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y (meters 100) (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0) + (:fade-a 0.8) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x401000 #x401200)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.05)) + (:next-launcher 976) + ) + ) + +(defpart 976 + :init-specs ((:scalevel-x (meters 0.033333335)) + (:scalevel-y (meters -0.13333334)) + (:fade-r 0.85333335) + (:fade-g 0.85333335) + (:fade-b 0.85333335) + (:fade-a -0.21333334 -0.42666668) + (:accel-y (meters 0.000033333334)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 977) + ) + ) + +(defpart 977 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpart 978 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2) (meters 5)) + (:scale-y (meters 10) (meters 0.6)) + (:r 128.0) + (:g 110.0) + (:b 64.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r -3.2) + (:fade-g -3.2) + (:fade-b -6.4) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 979 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2) (meters 5)) + (:scale-y (meters 10) (meters 0.6)) + (:r 128.0) + (:g 110.0) + (:b 64.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r -3.2) + (:fade-g -3.2) + (:fade-b -6.4) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 980 + :init-specs ((:texture (gun-enemy-beam level-default-sprite)) + (:birth-func 'birth-func-setup-beam) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 981 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.075)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 982 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 16.0) + (:z (meters 0) (meters -2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:fade-g -3.2 -6.4) + (:fade-a -1.6 -6.4) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(when (or (zero? *curve-toad-linear-up-red*) (!= loading-level global)) + (set! *curve-toad-linear-up-red* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-toad-linear-up-red* 2 'loading-level (the-as int #f)) + ) + +(set! (-> *curve-toad-linear-up-red* pts data 0 first) 0.0) + +(set! (-> *curve-toad-linear-up-red* pts data 0 second) 0.3) + +(set! (-> *curve-toad-linear-up-red* pts data 1 first) 1.0) + +(set! (-> *curve-toad-linear-up-red* pts data 1 second) 1.0) + +(if #t + (set! *trail-color-curve-toad-grenade* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 0.3 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.25 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-grenade-linear-toad-trail* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.3 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 0.7 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if (or (zero? *toad-grenade-trail*) (!= loading-level global)) + (set! *toad-grenade-trail* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *toad-grenade-trail* color-mode) (the-as uint 0)) + +(set! (-> *toad-grenade-trail* color-repeat-dist) 40960.0) + +(set! (-> *toad-grenade-trail* alpha-1-mode) (the-as uint 0)) + +(set! (-> *toad-grenade-trail* alpha-2-mode) (the-as uint 1)) + +(set! (-> *toad-grenade-trail* base-alpha) 0.5) + +(set! (-> *toad-grenade-trail* alpha-repeat-dist) 6144.0) + +(set! (-> *toad-grenade-trail* width-mode) (the-as uint 2)) + +(set! (-> *toad-grenade-trail* base-width) 2048.0) + +(set! (-> *toad-grenade-trail* width-repeat-dist) 40960.0) + +(set! (-> *toad-grenade-trail* uv-mode) (the-as uint 0)) + +(set! (-> *toad-grenade-trail* uv-repeat-dist) 16384000.0) + +(set! (-> *toad-grenade-trail* lie-mode) (the-as uint 0)) + +(set! (-> *toad-grenade-trail* max-age) (seconds 0.5)) + +(if #f + (set! (-> *toad-grenade-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *toad-grenade-trail* tex-id) (the-as uint #x100300)) + ) + +(set! (-> *toad-grenade-trail* width-curve) (the-as curve2d-piecewise *curve-grenade-linear-toad-trail*)) + +(set! (-> *toad-grenade-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-toad-grenade*)) + +(set! (-> *toad-grenade-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *toad-grenade-trail* alpha-curve-2) *curve-toad-linear-up-red*) + +(set! (-> *toad-grenade-trail* zbuffer?) #f) + +(set! (-> *toad-grenade-trail* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *toad-grenade-trail* use-tape-mode?) #f) + +(set! (-> *toad-grenade-trail* blend-mode) (the-as uint 1)) + +(set! (-> *toad-grenade-trail* frame-stagger) (the-as uint 1)) + +(defpart 983 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0.25)) + (:scale-x (meters 18) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2 -0.2) + (:friction 0.85 0.04) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -45) (degrees 10)) + (:conerot-y (degrees 85) (degrees 10)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.4)) + ) + ) + +(defpartgroup group-gun-scorp-shot-hit + :id 228 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 984 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 985 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.017)) + (sp-item 986 :fade-after (meters 120) :falloff-to (meters 140) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 986 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.05) (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.06666667) (meters 0.33333334)) + (:fade-r -0.053333335) + (:fade-g -2.55) + (:fade-b -5.1) + (:fade-a -0.42666668 -0.42666668) + (:accel-y (meters -0.0013333333) (meters -0.001)) + (:friction 0.875) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 40)) + (:conerot-y (degrees 80) (degrees 40)) + (:conerot-z (degrees 80) (degrees 40)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +(defpart 985 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 32.0 32.0) + (:vel-z (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0013333333) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90) (degrees 20)) + (:conerot-y (degrees 90) (degrees 20)) + (:conerot-z (degrees 90) (degrees 20)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +(defpart 984 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-rico" :group 1)) + (:scale-x (meters 0.4) (meters 2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 230.0 25.0) + (:g 230.0 25.0) + (:b 230.0 25.0) + (:a 128.0) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.035)) + (:next-launcher 987) + ) + ) + +(defpart 987 + :init-specs ((:scalevel-x (meters 0.12) (meters 0.12)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-gun-scorp-shot-die + :id 229 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(defpartgroup group-toad-grenade-shot-explode + :id 230 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 988 :flags (sp3)) + (sp-item 989 :flags (sp3)) + (sp-item 990 :flags (sp3)) + (sp-item 991 :period (seconds 30) :length (seconds 0.167)) + (sp-item 992 :flags (sp3)) + ) + ) + +(defpart 988 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 989 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 990 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 255.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.6666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 991 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 10.0) + (:scale-x (meters -4) 2.0 (meters 8)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 20.0) + (:b 130.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.6666667)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 992 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 100.0) + (:x (meters 0) (meters 0.1)) + (:scale-x (meters -4) 2.0 (meters 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 255.0) + (:vel-y (meters 0.6666667) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:fade-g -1.7) + (:fade-b -1.7) + (:fade-a -0.85) + (:friction 0.83) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.25)) + (:next-launcher 993) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 993 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.33333334) + (:fade-b -0.6666667) + (:friction 0.99) + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc index 079f8f4be2..411929b3fb 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc @@ -7,3 +7,625 @@ ;; DECOMP BEGINS +(define *wvehicle-surfaces* + (new 'static 'inline-array vehicle-wheel-surface 7 + (new 'static 'vehicle-wheel-surface + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type #x1 + :friction 0.9 + :drag 1.0 + :depth 409.6 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.5 0.5 0.0 0.5) + :tire-slide-mix (new 'static 'array float 2 0.5 1.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type #x2 + :friction 0.85 + :drag 2.0 + :depth 1024.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.0 0.0 1.0 0.25) + :tire-slide-mix (new 'static 'array float 2 0.0 0.5) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type #x3 + :friction 0.5 + :drag 5.0 + :damage 1.0 + ) + (new 'static 'vehicle-wheel-surface :surface-type #x4 :friction 0.25 :drag 4.0 :depth 2048.0 :damage 1.0) + (new 'static 'vehicle-wheel-surface + :surface-type #x5 + :friction 0.1 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type #x6 + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + ) + ) + +(defmethod wvehicle-method-160 ((this wvehicle) (arg0 wvehicle-physics-work)) + (let ((v1-0 (-> this rbody))) + (mem-copy! (the-as pointer (-> arg0 mat)) (the-as pointer (-> v1-0 matrix)) 64) + ) + (logior! (-> this v-flags) (vehicle-flag in-air)) + (logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (vector-reset! (-> arg0 ground-normal-sum)) + (let ((v1-6 (-> arg0 cquery))) + (set! (-> v1-6 radius) 1.0) + (set! (-> v1-6 collide-with) (collide-spec + backgnd + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + ) + ) + (set! (-> v1-6 ignore-process0) #f) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + (countdown (s4-0 (-> this info physics-model wheel-count)) + (let* ((s3-0 (-> this wheel s4-0)) + (s1-0 (-> s3-0 info)) + (s2-0 (-> arg0 probe-work-array s4-0)) + ) + (vector-matrix*! (-> arg0 world-pos) (-> s3-0 probe-local-pos) (-> arg0 mat)) + (vector-rotate*! (-> arg0 probe-dir) (-> s3-0 probe-local-dir) (-> arg0 mat)) + (vector-rotate*! (-> s2-0 wheel-axis) (-> s3-0 local-axis) (-> arg0 mat)) + (vector-float*! (-> arg0 cquery move-dist) (-> arg0 probe-dir) (-> s1-0 travel)) + (set! (-> arg0 cquery radius) (-> s1-0 probe-radius)) + (vector-reset! (-> s3-0 ground-normal)) + (vector+float*! + (-> arg0 cquery start-pos) + (-> arg0 world-pos) + (-> arg0 probe-dir) + (- (-> arg0 cquery radius)) + ) + (logand! (-> s3-0 flags) -7) + (set! (-> s3-0 sink-depth) 0.0) + (set! (-> arg0 surface-depth) 0.0) + (set! (-> s2-0 probe-uu) (probe-using-line-sphere *collide-cache* (-> arg0 cquery))) + (cond + ((>= (-> s2-0 probe-uu) 0.0) + (set! (-> arg0 material) (the-as uint (-> arg0 cquery best-other-tri pat material))) + (let ((v1-26 (-> arg0 material))) + (set! (-> arg0 surface-type) (the-as uint (cond + ((or (= v1-26 23) (= v1-26 6)) + 0 + ) + ((or (= v1-26 15) (zero? v1-26)) + 1 + ) + ((= v1-26 5) + 2 + ) + ((= v1-26 2) + 3 + ) + ((= v1-26 16) + 6 + ) + (else + 1 + ) + ) + ) + ) + ) + (if (or (= (-> arg0 cquery best-other-tri pat mode) (pat-mode wall)) + (= (-> arg0 cquery best-other-tri pat event) (pat-event slippery)) + ) + (set! (-> arg0 surface-type) (the-as uint 5)) + ) + (set! (-> s3-0 surface) (-> *wvehicle-surfaces* (-> arg0 surface-type))) + (logclear! (-> this v-flags) (vehicle-flag in-air)) + (logior! (-> this v-flags) (vehicle-flag on-ground)) + (logior! (-> s3-0 flags) 2) + (set! (-> arg0 surface-depth) (-> s3-0 surface depth)) + (vector+float*! (-> arg0 tmp) (-> arg0 cquery start-pos) (-> arg0 cquery move-dist) (-> s2-0 probe-uu)) + (vector-! (-> s3-0 ground-normal) (-> arg0 tmp) (-> arg0 cquery best-other-tri intersect)) + (vector-normalize! (-> s3-0 ground-normal) 1.0) + (vector+! (-> arg0 ground-normal-sum) (-> arg0 ground-normal-sum) (-> s3-0 ground-normal)) + 0 + ) + (else + (set! (-> s2-0 probe-uu) 1.0) + (set! (-> s3-0 surface) #f) + ) + ) + (vector+float*! + (-> s3-0 surface-pos) + (-> arg0 world-pos) + (-> arg0 probe-dir) + (* (-> s1-0 travel) (-> s2-0 probe-uu)) + ) + (+! (-> s2-0 probe-uu) (/ (-> arg0 surface-depth) (-> s1-0 travel))) + (set! (-> s2-0 probe-uu) (fmax 0.0 (fmin 1.0 (-> s2-0 probe-uu)))) + (vector+float*! (-> s3-0 ground-pos) (-> s3-0 surface-pos) (-> arg0 probe-dir) (-> arg0 surface-depth)) + (set! (-> s3-0 sink-depth) (fmax 0.0 (- (-> this water-height) (-> s3-0 ground-pos y)))) + (set! (-> s3-0 pos) (-> s2-0 probe-uu)) + ) + 0 + ) + 0 + (none) + ) + +(defmethod vehicle-method-97 ((this wvehicle) (arg0 float) (arg1 vehicle-physics-work)) + (local-vars (sv-16 rigid-body-control)) + (set! sv-16 (-> this rbody)) + (dotimes (s3-0 (-> this info physics-model wheel-count)) + (let* ((s2-0 (-> this wheel s3-0)) + (s1-0 (-> s2-0 info)) + (f30-0 + (fmax + 0.0 + (- 1.0 (-> (the-as wvehicle-physics-work (+ (the-as uint arg1) (* 144 s3-0))) probe-work-array 0 probe-uu)) + ) + ) + ) + (if (>= (-> this info handling cos-ground-effect-angle) (vector-dot (-> s2-0 ground-normal) (-> arg1 mat uvec))) + (set! f30-0 0.0) + ) + (set! (-> s2-0 up-force) 0.0) + (when (< 0.0 f30-0) + (rigid-body-control-method-23 sv-16 (-> s2-0 ground-pos) (-> arg1 velocity)) + (let* ((f0-4 0.0) + (f1-9 (* 2.0 + (-> this info info mass) + (-> this info extra gravity) + f30-0 + (-> this susp-spring-control) + (-> s1-0 suspension-spring) + ) + ) + (f2-5 0.25) + (f3-0 arg0) + (f0-5 (fmax f0-4 (+ f1-9 (* f2-5 + (/ 1.0 f3-0) + (-> this info info mass) + (-> s1-0 suspension-damping) + (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> s2-0 ground-normal)))) + ) + ) + ) + ) + ) + (set! (-> s2-0 up-force) f0-5) + (vector-float*! (-> arg1 force) (-> s2-0 ground-normal) f0-5) + ) + (apply-impact! sv-16 (-> s2-0 ground-pos) (-> arg1 force)) + ) + ) + ) + (dotimes (s3-1 (-> this info physics-model wheel-count)) + (let* ((s2-1 (-> this wheel s3-1)) + (s1-1 (-> s2-1 info)) + ) + (set! (-> arg1 probe-work-array 0 world-normal y) (* (-> s1-1 scale) (-> s1-1 radius))) + (set! (-> arg1 probe-work-array 0 ground-normal x) 1.0) + (when (< 0.0 (-> s2-1 up-force)) + (rigid-body-control-method-23 sv-16 (-> s2-1 ground-pos) (-> arg1 velocity)) + (if (logtest? (-> s2-1 surface flags) (vehicle-wheel-surface-flag moving)) + (vector-! (-> arg1 velocity) (-> arg1 velocity) (-> this surface-velocity)) + ) + (let ((s0-0 (the-as object (+ (+ (* 144 s3-1) 416) (the-as int arg1))))) + (set! (-> arg1 probe-work-array 0 local-normal quad) (-> (the-as wvehicle-physics-work s0-0) force quad)) + (vector+float*! + (-> (the-as wvehicle-physics-work s0-0) velocity) + (-> arg1 probe-work-array 0 local-normal) + (-> s2-1 ground-normal) + (- (vector-dot (-> arg1 probe-work-array 0 local-normal) (-> s2-1 ground-normal))) + ) + (vector-normalize! (the-as vector (+ (the-as int s0-0) 80)) 1.0) + (vector-cross! + (the-as vector (+ (the-as int s0-0) 96)) + (-> arg1 probe-work-array 0 local-normal) + (-> s2-1 ground-normal) + ) + (vector-normalize! (-> (the-as wvehicle-physics-work s0-0) world-pos) 1.0) + (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) + (-> (the-as wvehicle-physics-work s0-0) world-pos quad) + ) + (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) + (-> (the-as wvehicle-physics-work s0-0) velocity quad) + ) + (set! (-> (the-as wvehicle-physics-work s0-0) world-normal quad) + (-> (the-as wvehicle-physics-work arg1) velocity quad) + ) + ) + (set! (-> s2-1 side-vel) + (vector-dot + (-> (the-as wvehicle-physics-work arg1) velocity) + (-> (the-as wvehicle-physics-work arg1) side-dir) + ) + ) + (set! (-> s2-1 forward-vel) (vector-dot (-> arg1 velocity) (the-as vector (&-> arg1 impulse)))) + (set! (-> s2-1 up-vel) (vector-dot (-> arg1 velocity) (-> s2-1 ground-normal))) + (set! (-> s2-1 forward-slip-vel) + (+ (-> s2-1 forward-vel) (* -1.0 (-> arg1 probe-work-array 0 world-normal y) (-> s2-1 rev))) + ) + (let* ((f0-21 (-> s2-1 side-vel)) + (f0-23 (* f0-21 f0-21)) + (f1-16 (-> s2-1 forward-slip-vel)) + (f0-25 (sqrtf (+ f0-23 (* f1-16 f1-16)))) + ) + (set! (-> s2-1 friction-coef) + (* (smooth-interp + (-> this info handling tire-static-friction) + (-> this info handling tire-dynamic-friction) + f0-25 + (-> this info handling tire-static-friction-speed) + (-> this info handling tire-dynamic-friction-speed) + ) + (-> s2-1 surface friction) + ) + ) + ) + (set! (-> arg1 probe-work-array 0 ground-normal x) (-> s2-1 surface drag)) + ) + (set! (-> arg1 probe-work-array 0 ground-pos y) (-> s2-1 torque)) + (when (< 0.0 (-> s2-1 up-force)) + (let ((f0-36 + (* (-> s2-1 up-force) + (-> s2-1 friction-coef) + (-> s1-1 forward-grip) + (-> arg1 probe-work-array 0 world-normal y) + ) + ) + (f1-29 + (/ (* 0.5 (-> s2-1 inertia) (-> s2-1 forward-slip-vel)) (* arg0 (-> arg1 probe-work-array 0 world-normal y))) + ) + ) + (if (logtest? (-> s1-1 flags) (vehicle-wheel-flag vwf0)) + (set! f1-29 (* f1-29 (/ 1.0 (the float (-> this info physics-model drive-wheel-count))))) + ) + (set! (-> arg1 probe-work-array 0 probe-pos w) (fmax (fmin f1-29 f0-36) (- f0-36))) + ) + (+! (-> arg1 probe-work-array 0 ground-pos y) (-> arg1 probe-work-array 0 probe-pos w)) + ) + (set! (-> arg1 probe-work-array 0 ground-pos z) + (- (* -0.25 (/ 1.0 arg0) (-> s2-1 rev) (-> s2-1 inertia)) (-> arg1 probe-work-array 0 ground-pos y)) + ) + (set! (-> arg1 probe-work-array 0 ground-pos w) (fabs (-> s2-1 braking-torque))) + (set! (-> arg1 probe-work-array 0 ground-pos x) + (fmax + (fmin (-> arg1 probe-work-array 0 ground-pos z) (-> arg1 probe-work-array 0 ground-pos w)) + (- (-> arg1 probe-work-array 0 ground-pos w)) + ) + ) + (+! (-> arg1 probe-work-array 0 ground-pos y) (-> arg1 probe-work-array 0 ground-pos x)) + (let ((f0-57 (* -1.0 + (-> s2-1 rev) + (-> s2-1 inertia) + (-> arg1 probe-work-array 0 ground-normal x) + (-> this info handling rolling-resistance) + ) + ) + ) + (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (set! f0-57 (* 0.05 f0-57)) + ) + (+! (-> arg1 probe-work-array 0 ground-pos y) f0-57) + ) + (cond + ((logtest? (-> s1-1 flags) (vehicle-wheel-flag vwf0)) + (+! (-> this wheel-torque) (-> arg1 probe-work-array 0 ground-pos y)) + ) + (else + (let ((f0-61 (-> s2-1 rev)) + (f1-49 (* (-> arg1 probe-work-array 0 ground-pos y) arg0)) + (f2-20 (-> s2-1 inertia)) + ) + (set! (-> s2-1 rev) (+ f0-61 (* f1-49 (/ 1.0 f2-20)))) + ) + (set! (-> s2-1 rev) (fmax -125.6637 (fmin 125.6637 (-> s2-1 rev)))) + ) + ) + ) + 0 + ) + (let ((f0-65 (-> this wheel-rev)) + (f1-54 (* arg0 (-> this wheel-torque))) + (f2-25 (-> this wheel-inertia)) + ) + (set! (-> this wheel-rev) (+ f0-65 (* f1-54 (/ 1.0 f2-25)))) + ) + (set! (-> this wheel-rev) (fmax -125.6637 (fmin 125.6637 (-> this wheel-rev)))) + (dotimes (v1-110 (-> this info physics-model wheel-count)) + (let ((a0-28 (-> this wheel v1-110))) + (if (logtest? (-> a0-28 info flags) (vehicle-wheel-flag vwf0)) + (set! (-> a0-28 rev) (* (-> this wheel-rev) (-> a0-28 drive-diff))) + ) + ) + ) + (let* ((f0-71 (-> this info engine inertia)) + (f1-59 (-> this clutch-grab)) + (f2-29 (-> this clutch-inertia)) + (f3-12 (-> this gear-ratio)) + (f3-14 (/ 1.0 f3-12)) + (f3-16 (* f3-14 f3-14)) + (f4-5 (-> this info transmission inertia)) + (f5-0 (-> this final-drive-ratio)) + (f5-2 (/ 1.0 f5-0)) + ) + (set! (-> arg1 probe-work-array 0 probe-pos z) + (+ f0-71 (* f1-59 (+ f2-29 (* f3-16 (+ f4-5 (* f5-2 f5-2 (-> this drive-wheel-inertia))))))) + ) + ) + (let* ((f3-18 (- (* (- (fmax 0.0 (* (-> this total-gear-ratio) (-> this wheel-rev))) (-> this engine-rev)) + (-> arg1 probe-work-array 0 probe-pos z) + (/ 1.0 arg0) + ) + (-> this engine-torque) + ) + ) + (f0-78 (-> this engine-rev)) + (f1-69 (* arg0 (+ (-> this engine-torque) (* f3-18 (-> this clutch-grab))))) + (f2-35 (-> arg1 probe-work-array 0 probe-pos z)) + ) + (set! (-> this engine-rev) (+ f0-78 (* f1-69 (/ 1.0 f2-35)))) + ) + (let* ((f0-80 (-> this engine-rev)) + (f1-71 (-> this info engine max-rpm)) + (f0-81 (fmin f0-80 (* 0.10471976 f1-71))) + (f1-74 (-> this info engine min-rpm)) + ) + (set! (-> this engine-rev) (fmax f0-81 (* 0.10471976 f1-74))) + ) + (dotimes (s3-2 (-> this info physics-model wheel-count)) + (let* ((s1-2 (-> this wheel s3-2)) + (s2-2 (-> s1-2 info)) + ) + (when (< 0.0 (-> s1-2 up-force)) + (set! (-> arg1 probe-work-array 0 world-normal y) (* (-> s2-2 scale) (-> s2-2 radius))) + (let ((v1-138 (-> (the-as wvehicle-physics-work arg1) probe-work-array s3-2))) + (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) (-> v1-138 forward-dir quad)) + (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) (-> v1-138 side-dir quad)) + (set! (-> (the-as wvehicle-physics-work arg1) velocity quad) (-> v1-138 velocity quad)) + ) + (set! (-> (the-as wvehicle-physics-work arg1) ground-pos quad) (-> s1-2 ground-pos quad)) + (vector-! + (-> (the-as wvehicle-physics-work arg1) p-body) + (-> (the-as wvehicle-physics-work arg1) ground-pos) + (-> sv-16 position) + ) + (vector-cross! (-> arg1 normal) (-> arg1 tmp) (the-as vector (-> arg1 probe-work-array))) + (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) + (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) + (set! (-> arg1 probe-work-array 0 world-normal z) + (/ (* -0.5 (-> s1-2 side-vel)) + (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (-> arg1 probe-work-array)) (-> arg1 normal)))) + ) + ) + (set! (-> arg1 probe-work-array 0 world-normal w) 0.0) + (set! (-> s1-2 forward-slip-vel) + (+ (-> s1-2 forward-vel) (* -1.0 (-> arg1 probe-work-array 0 world-normal y) (-> s1-2 rev))) + ) + (vector-cross! (-> arg1 normal) (-> arg1 tmp) (the-as vector (&-> arg1 impulse))) + (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) + (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) + (let ((f0-94 + (/ (* -0.25 (-> s1-2 forward-slip-vel)) + (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (&-> arg1 impulse)) (-> arg1 normal)))) + ) + ) + ) + (+! (-> arg1 probe-work-array 0 world-normal w) f0-94) + ) + (set! (-> arg1 probe-work-array 0 probe-pos y) + (* (-> s1-2 friction-coef) (-> s1-2 up-force) (-> s2-2 side-grip)) + ) + (set! (-> arg1 probe-work-array 0 probe-pos x) + (* (-> s1-2 friction-coef) (-> s1-2 up-force) (-> s2-2 forward-grip)) + ) + (let* ((f0-103 (/ (-> arg1 probe-work-array 0 world-normal z) (-> arg1 probe-work-array 0 probe-pos y))) + (f0-105 (* f0-103 f0-103)) + (f1-95 (/ (-> arg1 probe-work-array 0 world-normal w) (-> arg1 probe-work-array 0 probe-pos x))) + (f0-106 (+ f0-105 (* f1-95 f1-95))) + ) + (when (< 1.0 f0-106) + (let ((f0-108 (/ 1.0 (sqrtf f0-106)))) + (set! (-> arg1 probe-work-array 0 world-normal z) (* (-> arg1 probe-work-array 0 world-normal z) f0-108)) + (set! (-> arg1 probe-work-array 0 world-normal w) (* (-> arg1 probe-work-array 0 world-normal w) f0-108)) + ) + ) + ) + (vector-float*! + (-> arg1 force) + (the-as vector (-> arg1 probe-work-array)) + (-> arg1 probe-work-array 0 world-normal z) + ) + (vector+float*! + (-> arg1 force) + (-> arg1 force) + (the-as vector (&-> arg1 impulse)) + (-> arg1 probe-work-array 0 world-normal w) + ) + (let ((f0-114 + (* (vector-dot (-> arg1 tmp) (-> arg1 mat uvec)) (+ -1.0 (-> this info handling ground-torque-scale))) + ) + ) + (vector+float*! (-> arg1 ground-normal) (-> arg1 ground-normal) (-> arg1 mat uvec) f0-114) + ) + (apply-impact! sv-16 (-> arg1 ground-normal) (-> arg1 force)) + 0 + ) + ) + ) + 0 + (none) + ) + +(defmethod apply-gravity! ((this wvehicle) (arg0 float)) + (local-vars (v1-51 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (wvehicle-method-162 this arg0) + (wvehicle-method-163 this) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-physics-work)) + (s5-0 (-> this rbody)) + (s4-0 (-> this info)) + ) + (set! (-> gp-0 cur-time) (the-as uint (current-time))) + (cond + ((logtest? (-> this v-flags) (vehicle-flag dead)) + (vector-reset! (-> gp-0 ground-normal-sum)) + ) + (else + (wvehicle-method-160 this gp-0) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force y) (* 2.0 (-> s4-0 info mass) (-> s4-0 extra gravity) (-> this jump-control))) + (add-force! s5-0 (-> gp-0 force)) + (vehicle-method-97 this arg0 (the-as vehicle-physics-work gp-0)) + ) + ) + (when (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (let ((f0-6 (* (-> this turbo-boost-factor) (-> s4-0 info mass) (-> s4-0 extra gravity)))) + (vector-float*! (-> gp-0 force) (-> gp-0 mat fvec) f0-6) + ) + (add-force! s5-0 (-> gp-0 force)) + ) + (when (logtest? (-> this v-flags) (vehicle-flag in-air)) + (let* ((v1-29 (-> this rbody ang-momentum)) + (a0-10 (-> this rbody ang-momentum)) + (f3-0 (-> s4-0 handling air-angular-damping)) + (f2-0 arg0) + (f0-7 0.0) + (f1-5 1.0) + (f2-1 (* -1.0 (- 1.0 f3-0) f2-0)) + (f3-3 0.016666668) + ) + (vector-float*! v1-29 a0-10 (fmax f0-7 (+ f1-5 (* f2-1 (/ 1.0 f3-3))))) + ) + (let* ((v1-31 (-> s5-0 lin-velocity)) + (f0-13 (+ (* (-> v1-31 x) (-> v1-31 x)) (* (-> v1-31 z) (-> v1-31 z)))) + (f1-10 40960.0) + ) + (cond + ((< f0-13 (* f1-10 f1-10)) + (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (+! (-> gp-0 local-pos z) 4096.0) + (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force x) (* (-> s4-0 handling hop-turn-torque) (-> this controls steering))) + (set! (-> gp-0 force y) (* -1.0 (-> this controls lean-z) (-> s4-0 handling air-pitch-torque))) + (vector-rotate*! (-> gp-0 force) (-> gp-0 force) (-> gp-0 mat)) + (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) + ) + (else + (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (+! (-> gp-0 local-pos y) 4096.0) + (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force x) (* (-> s4-0 handling air-roll-torque) (-> this controls steering))) + (set! (-> gp-0 force z) (* (-> s4-0 handling air-pitch-torque) (-> this controls lean-z))) + (vector-rotate*! (-> gp-0 force) (-> gp-0 force) (-> gp-0 mat)) + (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) + ) + ) + ) + ) + (when (not (logtest? (vehicle-flag gun-dark-2-zero-g) (-> this v-flags))) + (let ((f0-27 0.0)) + (.lvf vf1 (&-> (-> gp-0 ground-normal-sum) 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-51 vf1) + (if (= f0-27 v1-51) + (set! (-> gp-0 ground-normal-sum y) 1.0) + ) + ) + (+! (-> gp-0 ground-normal-sum y) 6.0) + (vector-normalize! (-> gp-0 ground-normal-sum) 1.0) + (vector-float*! (-> this gravity-dir) (-> gp-0 ground-normal-sum) -1.0) + (vector-float*! (-> gp-0 force) (-> this gravity-dir) (* (-> s4-0 extra gravity) (-> s4-0 info mass))) + (add-force! s5-0 (-> gp-0 force)) + ) + (rigid-body-object-method-53 this arg0) + (vehicle-method-96 this arg0) + (countdown (s1-0 (-> s4-0 physics-model wheel-count)) + (let* ((a1-25 (-> this wheel s1-0)) + (v1-69 (-> a1-25 info)) + ) + (set! (-> gp-0 wsphere quad) (-> a1-25 trans quad)) + (set! (-> gp-0 wsphere r) (* (-> v1-69 scale) (-> v1-69 radius))) + ) + (vehicle-method-95 this (-> gp-0 wsphere) arg0) + 0 + ) + (let ((f0-38 (* -0.000012207031 (vector-length (-> s5-0 lin-velocity)) (-> s4-0 handling drag-force-factor)))) + (vector-float*! (-> gp-0 force) (-> s5-0 lin-velocity) f0-38) + ) + (add-force! s5-0 (-> gp-0 force)) + (when (or (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (and (< (-> s5-0 matrix uvec y) 0.0) (< (- (-> gp-0 cur-time) (-> this impact-time)) (the-as uint 10))) + ) + ) + (logtest? (vehicle-flag overturned) (-> this v-flags)) + ) + (vector-reset! (-> gp-0 local-pos)) + (set! (-> gp-0 local-pos y) -6144.0) + (when (logtest? (vehicle-flag overturned) (-> this v-flags)) + (let ((f0-42 (* 0.0033333334 (the float (- (current-time) (the-as int (-> this overturned-time))))))) + (set! (-> gp-0 local-pos y) (* (+ -32768.0 (* -16384.0 f0-42)) + (-> s4-0 handling roll-control-factor) + (fmax 0.1 (- (-> s5-0 matrix uvec y))) + ) + ) + ) + ) + (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force y) (* -0.5 (-> s4-0 extra gravity) (-> s4-0 info mass))) + (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) + ) + ) + 0 + (none) + ) + ) + +(defmethod apply-gravity ((this wvehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) + +(defmethod apply-gravity1 ((this wvehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc index 985b062dee..d9bbe553bf 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc @@ -7,3 +7,409 @@ ;; DECOMP BEGINS +(defstate idle (wvehicle) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (go-virtual waiting) + ) + ) + +(defstate player-control (wvehicle) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type vehicle player-control) enter))) + (if t9-0 + (t9-0) + ) + ) + (send-event *vehicle-manager* 'extra-bank (-> self info sound bank-replace)) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (logclear! (-> arg0 prim-core collide-as) (collide-spec camera-blocker)) + (none) + ) + ) + (wvehicle-method-195 self) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type vehicle player-control) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self sound-engine-rpm) 0.0) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (logior! (-> arg0 prim-core collide-as) (collide-spec camera-blocker)) + (none) + ) + ) + ) + ) + +(defstate crash (wvehicle) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type vehicle crash) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-virtual explode) + ) + :code sleep-code + ) + +(defstate explode (wvehicle) + :virtual #t + :enter (behavior () + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((t9-0 (-> (method-of-type vehicle explode) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (dotimes (s5-0 (-> self info physics-model wheel-count)) + (let ((s4-0 (-> self wheel s5-0))) + (cond + ((or (not (logtest? (-> self info flags) #x4000)) (< (rand-vu) 0.6)) + (rigid-body-control-method-23 (-> self rbody) (-> s4-0 trans) (-> gp-0 rvec)) + (vector-! (-> gp-0 uvec) (-> s4-0 trans) (-> self rbody position)) + (vector+float*! (-> gp-0 rvec) (-> gp-0 rvec) (-> gp-0 uvec) 6.0) + (+! (-> gp-0 rvec y) 81920.0) + (send-event (handle->process (-> s4-0 handle)) 'explode (-> gp-0 rvec)) + (set! (-> s4-0 handle) (the-as handle #f)) + ) + (else + (send-event (handle->process (-> s4-0 handle)) 'explode #f) + ) + ) + ) + ) + ) + (if (not (logtest? (-> self info flags) #x4000)) + (go-virtual explode-into-nothing) + ) + (let ((a0-14 (-> self draw color-mult))) + (vector-float*! (the-as vector a0-14) (the-as vector a0-14) 0.25) + ) + (impulse-handler self) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + (gp-1 (-> self rbody)) + ) + (set! (-> gp-1 linear-damping) 0.99) + (set! (-> gp-1 angular-damping) 0.97) + (vector-reset! s4-1) + (set! (-> s4-1 y) (* 122880.0 (-> self info info mass))) + (dotimes (s3-0 3) + (set! (-> s5-1 data s3-0) (* 12288.0 (+ -1.0 (* 2.0 (rand-vu))))) + ) + (vector+! s5-1 s5-1 (-> gp-1 position)) + (apply-impact! gp-1 s5-1 s4-1) + (rigid-body-control-method-12 gp-1 1.0) + (init-velocities! gp-1) + ) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-2 spawn-quat)) + (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) + (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) + (set! (-> gp-2 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-2 damage) 2.0) + (set! (-> gp-2 damage-scale) 1.0) + (set! (-> gp-2 vehicle-damage-factor) 1.0) + (set! (-> gp-2 vehicle-impulse-factor) 1.0) + (set! (-> gp-2 ignore-proc) (process->handle #f)) + (explosion-spawn gp-2 (the-as process-drawable *default-pool*)) + ) + (let ((gp-3 (-> self info explosion))) + (when gp-3 + (set! (-> gp-3 skel) + (the-as skeleton-group (art-group-get-by-name *level* (-> gp-3 skel-name) (the-as (pointer level) #f))) + ) + (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> s5-2 duration) (seconds 4)) + (set! (-> s5-2 gravity) -327680.0) + (set! (-> s5-2 rot-speed) 10.2) + (set-vector! (-> s5-2 fountain-rand-transv-lo) -81920.0 61440.0 -81920.0 1.0) + (set-vector! (-> s5-2 fountain-rand-transv-hi) 81920.0 131072.0 81920.0 1.0) + (let ((v1-100 + (process-spawn joint-exploder (-> gp-3 skel) (-> gp-3 anim) s5-2 gp-3 :name "joint-exploder" :to self :unk 0) + ) + ) + (when v1-100 + (let ((v1-103 (-> (the-as process-drawable (-> v1-100 0)) draw))) + (if v1-103 + (.svf (&-> (-> v1-103 color-mult) quad) vf0) + ) + ) + ) + ) + ) + ) + ) + (if (and (logtest? (vehicle-flag unique) (-> self v-flags)) + (not (logtest? (vehicle-flag player-killed) (-> self v-flags))) + (-> *setting-control* user-current unique-vehicle-mission-critical) + ) + (fail-mission) + ) + ) + ) + ) + +(defstate explode-into-nothing (wvehicle) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self v-flags) (the-as vehicle-flag (logclear (-> self v-flags) (vehicle-flag rammed-target)))) + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) 4096.0) + (set! (-> gp-0 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-0 group) (-> *part-group-id-table* (-> self info explosion-part))) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 2.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 (the-as process-drawable *default-pool*)) + ) + (logior! (-> self focus-status) (focus-status disable inactive)) + (disable-physics! self) + (rigid-body-object-method-43 self) + ) + :code sleep-code + :post (behavior () + (when (and (not (logtest? (vehicle-flag rammed-target) (-> self v-flags))) + (time-elapsed? (-> self state-time) (seconds 0.035)) + ) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag rammed-target) (-> self v-flags)))) + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 0))) + (a2-1 (-> self info debris)) + ) + (when a2-1 + (set! (-> a1-1 duration) (seconds 5)) + (set! (-> a1-1 hit-xz-reaction) 0.95) + (set! (-> a1-1 hit-y-reaction) 0.6) + (set! (-> a1-1 gravity) -163840.0) + (set! (-> a1-1 scale-rand-lo) 2.0) + (set! (-> a1-1 scale-rand-hi) (* 2.0 (-> a1-1 scale-rand-lo))) + (set! (-> a1-1 rot-speed) 1000.0) + (vector+! + (-> a1-1 fountain-rand-transv-lo) + (-> self root transv) + (new 'static 'vector :x -81920.0 :y 61440.0 :z -81920.0 :w 1.0) + ) + (vector+! + (-> a1-1 fountain-rand-transv-hi) + (-> self root transv) + (new 'static 'vector :x 81920.0 :y 131072.0 :z 81920.0 :w 1.0) + ) + (debris-spawn self a1-1 a2-1 (the-as process-drawable #f)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (if (not (-> self child)) + (go-virtual die) + ) + ) + ) + +(defstate waiting (wvehicle) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :exit (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +(defstate hostile (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (wvehicle-method-195 self) + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 10) (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> self control-hook) + (the-as (function vehicle vehicle-controls) (method-of-object self control-hook-ai)) + ) + (set! (-> self ai-state) (the-as uint 1)) + (logior! (-> self v-flags) (vehicle-flag ai-driving ignition)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self v-flags) (vehicle-flag ai-driving ignition)) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (wvehicle-method-168 self) + ) + ) + +(defstate sink (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-method-116 self 'drown-death) + (set! (-> self crash-level) 3) + (set! (-> self force-level) 3) + (logior! (-> self focus-status) (focus-status dead)) + (logclear! (-> self v-flags) (vehicle-flag persistent player-driving net-player-driving)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag dead lights-dead) (-> self v-flags)))) + (vehicle-method-126 self) + (sound-play "car-bubbles") + (vehicle-method-106 self) + (vehicle-method-136 self) + (vehicle-method-100 self) + (let ((v1-21 (-> self rbody))) + (set! (-> v1-21 linear-damping) 0.95) + (set! (-> v1-21 angular-damping) 0.25) + ) + (if (and (logtest? (vehicle-flag unique) (-> self v-flags)) + (not (logtest? (vehicle-flag player-killed) (-> self v-flags))) + (-> *setting-control* user-current unique-vehicle-mission-critical) + ) + (fail-mission) + ) + ) + :code sleep-code + :post (behavior () + (let ((v1-1 (-> self draw color-mult))) + (let ((f0-1 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) + (set-vector! v1-1 f0-1 f0-1 f0-1 1.0) + ) + (dotimes (a0-6 (-> self info physics-model wheel-count)) + (let ((a1-6 (handle->process (-> self wheel a0-6 handle)))) + (if a1-6 + (set! (-> (the-as process-drawable a1-6) draw color-mult quad) (-> v1-1 quad)) + ) + ) + ) + ) + (vehicle-explode-post) + ) + ) + +(defstate race-waiting (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (wvehicle-method-195 self) + (vehicle-method-140 self) + (logior! (-> self v-flags) (vehicle-flag ignition)) + ) + :code sleep-code + :post (behavior () + (vector-reset! (-> self target-acceleration)) + (logclear! (-> self v-flags) (vehicle-flag player-impulse-force player-contact-force)) + (let ((v1-3 (-> self rbody))) + (set! (-> v1-3 force quad) (the-as uint128 0)) + (set! (-> v1-3 torque quad) (the-as uint128 0)) + ) + 0 + (reset-momentum! (-> self rbody)) + (rigid-body-object-method-30 self) + (vehicle-method-115 self) + ) + ) + +(defstate race-racing (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self v-flags) (vehicle-flag riding ai-driving ignition)) + (set! (-> self controls throttle) 0.0) + (set! (-> self controls brake) 0.0) + (set! (-> self controls steering) 0.0) + (set! (-> self control-hook) + (the-as (function vehicle vehicle-controls) (method-of-object self wvehicle-method-177)) + ) + ) + :exit (behavior () + (logclear! (-> self v-flags) (vehicle-flag waiting-for-player)) + (let ((v1-3 (find-prim-by-id-logtest (-> self root) (the-as uint 32)))) + (when v1-3 + (set! (-> v1-3 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (wvehicle-method-182 self) + ) + ) + +(defstate race-finished (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self v-flags) (vehicle-flag persistent riding nav-spheres)) + (set! (-> self controls throttle) 0.0) + (set! (-> self controls brake) 0.0) + (set! (-> self controls steering) 0.0) + ) + :trans #f + :code sleep-code + :post (behavior () + (wvehicle-method-185 self) + ) + ) + +(defstate die (wvehicle) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc index 80a93b4f36..218cfd8373 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc @@ -7,3 +7,958 @@ ;; DECOMP BEGINS +(defmethod wvehicle-method-167 ((this wvehicle)) + (let* ((v1-0 (-> this info)) + (f0-1 (* (-> v1-0 engine drag) (-> v1-0 engine idle-rpm))) + (f1-2 (* (-> v1-0 engine peak-torque-rpm) (+ 1.0 (-> v1-0 engine drag)))) + (f2-2 1.0) + (f3-3 (/ (- (-> v1-0 engine idle-rpm) (-> v1-0 engine peak-torque-rpm)) (-> v1-0 engine powerband-width-rpm))) + ) + (set! (-> this idle-throttle) (/ f0-1 (* f1-2 (- f2-2 (* f3-3 f3-3))))) + ) + (set! (-> this idle-throttle) (fmax 0.0 (fmin 1.0 (-> this idle-throttle)))) + 0 + (none) + ) + +(defmethod rigid-body-object-method-37 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle rigid-body-object-method-37))) + (t9-0 this) + ) + (set! (-> this wheel 0 info) (-> this info physics-model front-wheel)) + (set! (-> this wheel 1 info) (-> this info physics-model front-wheel)) + (set! (-> this wheel 2 info) (-> this info physics-model rear-wheel)) + (set! (-> this wheel 3 info) (-> this info physics-model rear-wheel)) + (dotimes (s5-0 (-> this info physics-model wheel-count)) + (let ((s4-0 (-> this wheel s5-0 info))) + (set! (-> s4-0 tread-tid) (lookup-texture-id-by-name (-> s4-0 tread-texture) (the-as string #f))) + ) + ) + (set! (-> this info physics-model front-wheel callback) (method-of-object this wvehicle-method-164)) + (set! (-> this info physics-model rear-wheel callback) (method-of-object this wvehicle-method-164)) + (let ((v1-22 (-> this draw shadow-ctrl))) + (set! (-> v1-22 settings shadow-dir w) (-> this info setup shadow-locus-dist)) + (set! (-> v1-22 settings top-plane w) 0.0) + (set! (-> v1-22 settings bot-plane w) (- (-> this info setup shadow-bot-clip))) + ) + (wvehicle-method-167 this) + (none) + ) + +(defun have-earned-vehicle-v-type? ((arg0 int)) + (case arg0 + ((12) + (let ((v1-2 (-> *game-info* vehicles))) + (logtest? v1-2 (game-vehicles v-turtle)) + ) + ) + ((13) + (let ((v1-5 (-> *game-info* vehicles))) + (logtest? v1-5 (game-vehicles v-snake)) + ) + ) + ((14) + (let ((v1-8 (-> *game-info* vehicles))) + (logtest? v1-8 (game-vehicles v-scorpion)) + ) + ) + ((15) + (let ((v1-11 (-> *game-info* vehicles))) + (logtest? v1-11 (game-vehicles v-toad)) + ) + ) + ((16) + (let ((v1-14 (-> *game-info* vehicles))) + (logtest? v1-14 (game-vehicles v-fox)) + ) + ) + ((17) + (let ((v1-17 (-> *game-info* vehicles))) + (logtest? v1-17 (game-vehicles v-rhino)) + ) + ) + ((18) + (let ((v1-20 (-> *game-info* vehicles))) + (logtest? v1-20 (game-vehicles v-mirage)) + ) + ) + ((19) + (let ((v1-23 (-> *game-info* vehicles))) + (logtest? v1-23 (game-vehicles v-x-ride)) + ) + ) + ((21) + #t + ) + (else + #f + ) + ) + ) + +(defun have-vehicle-v-type? ((arg0 int)) + (case arg0 + ((12) + (let ((v1-2 (-> *game-info* vehicles))) + (let ((a0-3 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-3) + (set! v1-2 (logand v1-2 a0-3)) + ) + ) + (logtest? v1-2 (game-vehicles v-turtle)) + ) + ) + ((13) + (let ((v1-5 (-> *game-info* vehicles))) + (let ((a0-6 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-6) + (set! v1-5 (logand v1-5 a0-6)) + ) + ) + (logtest? v1-5 (game-vehicles v-snake)) + ) + ) + ((14) + (let ((v1-8 (-> *game-info* vehicles))) + (let ((a0-9 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-9) + (set! v1-8 (logand v1-8 a0-9)) + ) + ) + (logtest? v1-8 (game-vehicles v-scorpion)) + ) + ) + ((15) + (let ((v1-11 (-> *game-info* vehicles))) + (let ((a0-12 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-12) + (set! v1-11 (logand v1-11 a0-12)) + ) + ) + (logtest? v1-11 (game-vehicles v-toad)) + ) + ) + ((16) + (let ((v1-14 (-> *game-info* vehicles))) + (let ((a0-15 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-15) + (set! v1-14 (logand v1-14 a0-15)) + ) + ) + (logtest? v1-14 (game-vehicles v-fox)) + ) + ) + ((17) + (let ((v1-17 (-> *game-info* vehicles))) + (let ((a0-18 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-18) + (set! v1-17 (logand v1-17 a0-18)) + ) + ) + (logtest? v1-17 (game-vehicles v-rhino)) + ) + ) + ((18) + (let ((v1-20 (-> *game-info* vehicles))) + (let ((a0-21 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-21) + (set! v1-20 (logand v1-20 a0-21)) + ) + ) + (logtest? v1-20 (game-vehicles v-mirage)) + ) + ) + ((19) + (let ((v1-23 (-> *game-info* vehicles))) + (let ((a0-24 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-24) + (set! v1-23 (logand v1-23 a0-24)) + ) + ) + (logtest? v1-23 (game-vehicles v-x-ride)) + ) + ) + ((21) + #t + ) + (else + #f + ) + ) + ) + +(defmethod vehicle-method-146 ((this wvehicle) (arg0 vector)) + (with-pp + (vector-float*! (-> this surface-velocity) arg0 (-> pp clock frames-per-second)) + 0 + (none) + ) + ) + +(defmethod rigid-body-object-method-54 ((this wvehicle)) + ((method-of-type vehicle rigid-body-object-method-54) this) + 0 + (none) + ) + +(defmethod vehicle-method-128 ((this wvehicle)) + (have-vehicle-v-type? (the-as int (-> this info vehicle-type))) + ) + +(defmethod vehicle-method-144 ((this wvehicle)) + (send-event *vehicle-manager* 'extra-bank (-> this info sound bank-replace)) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 22 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + 1.0 + (let* ((v1-9 (-> *setting-control* user-default language)) + (f30-0 (cond + ((= v1-9 (language-enum korean)) + 1.3 + ) + ((= v1-9 (language-enum russian)) + 1.3 + ) + (else + 1.0 + ) + ) + ) + ) + (let ((v1-11 gp-0)) + (set! (-> v1-11 width) (the float 350)) + ) + (let ((v1-12 gp-0)) + (set! (-> v1-12 height) (the float 80)) + ) + (let ((v1-13 gp-0)) + (set! (-> v1-13 scale) (* 0.7 f30-0)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text + (lookup-text! *common-text* (text-id text-0779) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + (let ((a1-4 (-> this info name-text))) + (when (nonzero? a1-4) + (let ((a0-11 gp-0)) + (set! (-> a0-11 color) (font-color cyan)) + ) + (+! (-> gp-0 origin y) (the float (the int (* 30.0 f30-0)))) + (let ((v1-20 gp-0)) + (set! (-> v1-20 scale) (* 0.6 f30-0)) + ) + (print-game-text (lookup-text! *common-text* a1-4 #f) gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-145 ((this wvehicle)) + (when (not (have-earned-vehicle-v-type? (the-as int (-> this info vehicle-type)))) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 22 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + 1.0 + (let* ((v1-5 (-> *setting-control* user-default language)) + (f30-0 (cond + ((= v1-5 (language-enum korean)) + 1.3 + ) + ((= v1-5 (language-enum russian)) + 1.3 + ) + (else + 1.0 + ) + ) + ) + ) + (let ((v1-7 gp-0)) + (set! (-> v1-7 width) (the float 350)) + ) + (let ((v1-8 gp-0)) + (set! (-> v1-8 height) (the float 80)) + ) + (let ((v1-9 gp-0)) + (set! (-> v1-9 scale) (* 0.7 f30-0)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (let ((a1-1 (-> this info name-text))) + (when (nonzero? a1-1) + (let ((a0-8 gp-0)) + (set! (-> a0-8 color) (font-color cyan)) + ) + (let ((v1-14 gp-0)) + (set! (-> v1-14 scale) (* 0.6 f30-0)) + ) + (print-game-text (lookup-text! *common-text* a1-1 #f) gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + (+! (-> gp-0 origin y) (the float (the int (* 30.0 f30-0)))) + ) + (let ((a0-12 gp-0)) + (set! (-> a0-12 color) (font-color default)) + ) + (print-game-text + (lookup-text! *common-text* (text-id text-0887) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-170 ((this wvehicle)) + (-> this info rider attach-point-count) + (none) + ) + +(defmethod wvehicle-method-171 ((this wvehicle) (arg0 vector) (arg1 int)) + (vector-matrix*! arg0 (the-as vector (-> this info rider attach-point-array arg1)) (-> this rbody matrix)) + 0 + (none) + ) + +(defmethod wvehicle-method-172 ((this wvehicle) (arg0 quaternion) (arg1 int)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-zxy! (-> gp-0 0) (-> this info rider attach-point-array arg1 rot)) + (quaternion*! arg0 (the-as quaternion (-> this rbody rot)) (-> gp-0 0)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-173 ((this wvehicle) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type1))) + (set! (-> gp-0 float00) (the-as float #x7f800000)) + (set! (-> gp-0 byte00) -1) + (dotimes (s3-0 (-> this info rider attach-point-count)) + (let ((s2-0 (handle->process (-> this attached-array s3-0)))) + (when (not (if (type? s2-0 process-focusable) + s2-0 + ) + ) + (wvehicle-method-171 this (-> gp-0 vec00) s3-0) + (set! (-> gp-0 float01) (vector-vector-distance-squared arg0 (-> gp-0 vec00))) + (when (< (-> gp-0 float01) (-> gp-0 float00)) + (set! (-> gp-0 float00) (-> gp-0 float01)) + (set! (-> gp-0 byte00) s3-0) + ) + ) + ) + ) + (-> gp-0 byte00) + ) + ) + +;; WARN: Return type mismatch process vs process-focusable. +(defmethod get-attached-by-idx ((this wvehicle) (arg0 int)) + (let ((gp-0 (handle->process (-> this attached-array arg0)))) + (the-as process-focusable (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + ) + +(defmethod add-attached-at-idx ((this wvehicle) (arg0 int) (arg1 process-focusable)) + (if arg1 + (set! (-> this attached-array arg0) (process->handle arg1)) + ) + 0 + (none) + ) + +(defmethod remove-attached-from-arr ((this wvehicle) (arg0 process-focusable)) + (let ((v1-2 (process->handle arg0))) + (dotimes (a1-4 (-> this info rider attach-point-count)) + (if (= v1-2 (-> this attached-array a1-4)) + (set! (-> this attached-array a1-4) (the-as handle #f)) + ) + ) + ) + #f + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod vehicle-method-142 ((this wvehicle)) + (reset-momentum! (-> this rbody)) + (set! (-> this wheel-rev) 0.0) + (dotimes (v1-2 (-> this info physics-model wheel-count)) + (let ((a0-5 (-> this wheel v1-2))) + (set! (-> a0-5 rev) 0.0) + (set! (-> a0-5 up-vel) 0.0) + (set! (-> a0-5 side-vel) 0.0) + (set! (-> a0-5 forward-vel) 0.0) + (set! (-> a0-5 forward-slip-vel) 0.0) + ) + ) + (none) + ) + +(defmethod apply-momentum! ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle apply-momentum!))) + (t9-0 this) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag particles joints) (-> this v-flags)))) + (none) + ) + +(defmethod disable-physics! ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle disable-physics!))) + (t9-0 this) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag particles joints) (-> this v-flags)))) + (none) + ) + +(defmethod vehicle-method-124 ((this wvehicle)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + ((method-of-type vehicle vehicle-method-124) this) + (none) + ) + +(defmethod wvehicle-method-169 ((this wvehicle)) + 0 + (none) + ) + +(defmethod vehicle-method-64 ((this wvehicle)) + (when (and (not (logtest? (vehicle-flag turbo-boost) (-> this v-flags))) (>= (-> this turbo-supply) 1.0)) + (cond + ((< (-> this turbo-supply) 1.0) + (if (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf2))) + (sound-play "turbo-dud") + ) + ) + ((< (-> this turbo-ready) 1.0) + (if (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf2))) + (sound-play "turbo-out") + ) + ) + (else + (set! (-> this turbo-ready) 0.0) + (+! (-> this turbo-supply) -1.0) + (set! (-> this turbo-boost-time) (the-as uint (current-time))) + (set! (-> this turbo-boost-factor) (-> this info handling turbo-boost-factor)) + (set! (-> this turbo-boost-duration) (-> this info handling turbo-boost-duration)) + (logior! (-> this v-flags) (vehicle-flag turbo-boost)) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-143 ((this wvehicle) (arg0 process)) + (set! (-> this target-status handle) (process->handle arg0)) + (set! (-> this ai-state) (the-as uint 1)) + (go (method-of-object this hostile)) + ) + +(defmethod vehicle-method-132 ((this wvehicle) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((3) + (set! (-> this target-status handle) (-> arg0 handle)) + (go (method-of-object this hostile)) + ) + ((10) + (let* ((a0-3 this) + (t9-1 (method-of-object a0-3 wvehicle-method-197)) + ) + (-> arg0 id) + (cond + ((t9-1 a0-3) + (cond + ((logtest? (-> arg0 flags) (traffic-spawn-flags tsf1)) + (logior! (-> this v-flags) (vehicle-flag riding ai-driving)) + (go (method-of-object this race-waiting)) + ) + (else + (logior! (-> this v-flags) (vehicle-flag waiting-for-player)) + (logior! (-> this focus-status) (focus-status grabbed)) + (go (method-of-object this waiting)) + ) + ) + ) + (else + (go (method-of-object this die)) + ) + ) + ) + ) + ((13) + (go (method-of-object this undefined1)) + ) + (else + ((method-of-type vehicle vehicle-method-132) this arg0) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-102 ((this wvehicle)) + (logtest? (vehicle-flag disturbed player-driving in-pursuit) (-> this v-flags)) + ) + +(defmethod vehicle-method-103 ((this wvehicle)) + (local-vars (v1-8 float) (v1-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) + (let* ((f0-0 (-> this camera-dist2)) + (f1-0 0.000024414063) + (f0-1 (* f0-0 (* f1-0 f1-0))) + ) + (.lvf vf1 (&-> (-> this rbody ang-velocity) 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-8 vf1) + (when (and (< v1-8 f0-1) (begin + (.lvf vf1 (&-> (-> this rbody lin-velocity) 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-13 vf1) + (let ((f1-4 v1-13) + (f2-0 614.4) + ) + (< f1-4 (* f0-1 (* f2-0 f2-0))) + ) + ) + ) + (logclear! (-> this v-flags) (vehicle-flag disturbed)) + (vehicle-method-142 this) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod spawn-wheels! ((this wvehicle) (arg0 skeleton-group) (arg1 skeleton-group) (arg2 skeleton-group) (arg3 skeleton-group)) + (local-vars (sv-96 vehicle-wheel-state)) + (let ((s1-0 (new 'stack-no-clear 'vehicle-wheel-init-params))) + (set! (-> s1-0 position quad) (-> this root trans quad)) + (quaternion-identity! (-> s1-0 rotation)) + (vector-identity! (-> s1-0 scale)) + (set! (-> s1-0 skel) arg0) + (set! (-> s1-0 skel-blur) arg1) + (set! (-> s1-0 level) (the-as symbol (-> this level))) + (set! (-> s1-0 radius) 4096.0) + (set! (-> s1-0 collision-mesh-index) -1) + (&-> s1-0 skel) + (dotimes (s0-0 (-> this info physics-model wheel-count)) + (cond + ((and arg2 (>= s0-0 2)) + (set! (-> s1-0 skel) arg2) + (set! (-> s1-0 skel-blur) arg3) + ) + (else + (set! (-> s1-0 skel) arg0) + (set! (-> s1-0 skel-blur) arg1) + ) + ) + (set! sv-96 (-> this wheel s0-0)) + (set! (-> s1-0 radius) (* 1.3 (-> sv-96 info scale) (-> sv-96 info radius))) + (vector-identity! (-> s1-0 scale)) + (set! (-> s1-0 scale x) (-> sv-96 x-scale)) + (vector-float*! (-> s1-0 scale) (-> s1-0 scale) (-> sv-96 info scale)) + (if (logtest? (-> this info flags) #x4000) + (set! (-> s1-0 collision-mesh-index) (if (>= (-> sv-96 x-scale) 0.0) + 0 + 1 + ) + ) + ) + (set! (-> sv-96 handle) + (process->handle (vehicle-wheel-spawn this (the-as vehicle-wheel-init-params (&-> s1-0 skel)))) + ) + (set! (-> sv-96 pos) (-> sv-96 info settle-pos)) + (set! (-> sv-96 pos2) (-> sv-96 pos)) + ) + ) + (wvehicle-method-165 this) + (vehicle-method-79 this) + 0 + (none) + ) + +(defmethod vehicle-method-82 ((this wvehicle)) + (call-parent-method this) + (set-setting! 'rapid-tracking #f 0.0 0) + (let ((v1-2 (process->ppointer this))) + (persist-with-delay + *setting-control* + 'butt-handle + (seconds 1.5) + 'butt-handle + (the-as symbol v1-2) + 32768.0 + (-> v1-2 0 pid) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-83 ((this wvehicle)) + (call-parent-method this) + (logclear! (-> this draw status) (draw-control-status force-vu1)) + 0 + (none) + ) + +(defmethod vehicle-method-148 ((this wvehicle)) + (send-event *target* 'draw #t) + 0 + (none) + ) + +(defmethod vehicle-method-147 ((this wvehicle)) + (send-event *target* 'draw #f) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this wvehicle)) + (let ((v0-0 0)) + (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) + (set! v0-0 (logior v0-0 40)) + ) + (if (logtest? (vehicle-flag dead ignore-damage ignore-impulse) (-> this v-flags)) + (set! v0-0 0) + ) + (the-as search-info-flag v0-0) + ) + ) + +(defmethod vehicle-method-149 ((this wvehicle)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type2))) + (set! (-> gp-0 float0) 4096.0) + (quaternion->matrix (-> gp-0 mat0) (-> this root quat)) + (set! (-> gp-0 mat0 trans quad) (-> this root trans quad)) + (set! (-> gp-0 vec3 quad) (-> gp-0 mat0 fvec quad)) + (set! (-> gp-0 vec1 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec1 quad)) + (+! (-> gp-0 cquery start-pos y) 4096.0) + (vector-reset! (-> gp-0 vec2)) + (set! (-> gp-0 vec2 y) 1.0) + (vector-z-quaternion! (-> gp-0 vec3) (-> this root quat)) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-11 (-> gp-0 cquery))) + (set! (-> v1-11 radius) (-> gp-0 float0)) + (set! (-> v1-11 collide-with) (collide-spec backgnd)) + (set! (-> v1-11 ignore-process0) #f) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f30-0 0.0) + (vector+float*! (-> gp-0 vec1) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) + (set! (-> gp-0 vec1 y) (- (-> gp-0 vec1 y) (-> gp-0 float0))) + (let* ((v1-19 (-> gp-0 cquery best-other-tri pat material)) + (a0-22 (cond + ((or (= v1-19 (pat-material stone)) (= v1-19 (pat-material wood))) + 0 + ) + ((or (= v1-19 (pat-material dirt)) (= v1-19 (pat-material unknown))) + 1 + ) + ((= v1-19 (pat-material sand)) + 2 + ) + ((= v1-19 (pat-material quicksand)) + 3 + ) + ((= v1-19 (pat-material metal)) + 6 + ) + (else + 1 + ) + ) + ) + (v1-21 (-> *wvehicle-surfaces* (the-as uint a0-22))) + ) + (set! (-> gp-0 vec1 y) (- (-> gp-0 vec1 y) (-> v1-21 depth))) + ) + (set! (-> gp-0 vec2 quad) (-> gp-0 cquery best-other-tri normal quad)) + (when (< (-> gp-0 vec2 y) (cos 3640.889)) + (vector-reset! (-> gp-0 vec2)) + (set! (-> gp-0 vec2 y) 1.0) + ) + (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + 0 + ) + (if (< f30-0 0.0) + 0 + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec3) (-> gp-0 vec2)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-198 ((this wvehicle)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-physics-work))) + (set! (-> gp-0 ground-pos z) (seconds-per-frame)) + (let ((v1-2 (-> this info setup))) + (set! (-> gp-0 ground-pos y) (fmax (fmin (-> this gun-aim-yaw) (-> v1-2 gun-yaw-max)) (-> v1-2 gun-yaw-min))) + ) + (let* ((v1-4 (-> gp-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-4 rvec quad) a0-3) + (set! (-> v1-4 uvec quad) a1-0) + (set! (-> v1-4 fvec quad) a2-0) + (set! (-> v1-4 trans quad) a3-1) + ) + (set! (-> gp-0 tmp quad) (-> this turret-local-pos quad)) + (set-vector! (-> gp-0 probe-dir) (sin (-> gp-0 ground-pos y)) 0.0 (cos (-> gp-0 ground-pos y)) 1.0) + (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) 204800.0) + (vector-matrix*! (-> gp-0 local-pos) (-> gp-0 tmp) (-> gp-0 mat)) + (set! (-> this gun-targ-pitch) 0.0) + (set! (-> this gun-targ-yaw) (-> gp-0 ground-pos y)) + (vector-matrix*! (-> gp-0 p-body) (-> gp-0 steering-axis) (-> gp-0 mat)) + (set! (-> gp-0 p-body w) 163840.0) + (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> gp-0 ground-normal-sum x) (the-as float (fill-actor-list-for-box + *actor-hash* + (the-as bounding-box (-> gp-0 p-body)) + (the-as (pointer collide-shape) (-> s4-1 data)) + (-> s4-1 allocated-length) + ) + ) + ) + (set! (-> s4-1 length) (the-as int (-> gp-0 ground-normal-sum x))) + (let ((a0-14 (find-nearest-focusable + (the-as (array collide-shape) s4-1) + (-> gp-0 p-body) + 655360.0 + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> gp-0 mat fvec) + (-> gp-0 local-pos) + 27306.666 + ) + ) + ) + (when a0-14 + (vector-! (-> gp-0 axis) (get-trans a0-14 3) (-> gp-0 local-pos)) + (matrix-transpose! (the-as matrix (-> gp-0 force)) (-> gp-0 mat)) + (vector-matrix*! (-> gp-0 dir) (-> gp-0 axis) (the-as matrix (-> gp-0 force))) + (vector-normalize! (-> gp-0 dir) 1.0) + (set! (-> this gun-targ-yaw) (atan (-> gp-0 dir x) (-> gp-0 dir z))) + (set! (-> this gun-targ-pitch) (asin (-> gp-0 dir y))) + 0 + ) + ) + ) + (let ((s4-4 (-> this info setup))) + (set! (-> this gun-targ-yaw) (fmax (fmin (-> this gun-targ-yaw) (-> s4-4 gun-yaw-max)) (-> s4-4 gun-yaw-min))) + (set! (-> this gun-targ-pitch) + (fmax (fmin (-> this gun-targ-pitch) (-> s4-4 gun-pitch-max)) (-> s4-4 gun-pitch-min)) + ) + (if (>= (-> s4-4 gun-yaw-max) 65536.0) + (set! (-> this gun-yaw) + (deg-seek + (-> this gun-yaw) + (-> this gun-targ-yaw) + (* 10.0 (fabs (deg- (-> this gun-yaw) (-> this gun-targ-yaw))) (-> gp-0 ground-pos z)) + ) + ) + (+! (-> this gun-yaw) + (* (- (-> this gun-targ-yaw) (-> this gun-yaw)) (fmin 1.0 (* 10.0 (-> gp-0 ground-pos z)))) + ) + ) + (+! (-> this gun-pitch) + (* (- (-> this gun-targ-pitch) (-> this gun-pitch)) (fmin 1.0 (* 10.0 (-> gp-0 ground-pos z)))) + ) + (set! (-> gp-0 ground-normal-sum y) (sin (-> this gun-yaw))) + (set! (-> gp-0 ground-normal-sum z) (cos (-> this gun-yaw))) + (set! (-> gp-0 ground-normal-sum w) (sin (-> this gun-pitch))) + (set! (-> gp-0 ground-pos x) (cos (-> this gun-pitch))) + (set-vector! + (-> gp-0 probe-dir) + (* (-> gp-0 ground-pos x) (-> gp-0 ground-normal-sum y)) + (-> gp-0 ground-normal-sum w) + (* (-> gp-0 ground-pos x) (-> gp-0 ground-normal-sum z)) + 1.0 + ) + (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) (-> s4-4 gun-z-offset)) + ) + (set! (-> this gun-local-dir quad) (-> gp-0 probe-dir quad)) + (set! (-> this gun-local-pos quad) (-> gp-0 steering-axis quad)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-199 ((this wvehicle)) + (let ((s5-0 (new 'stack-no-clear 'wvehicle-stack-type3))) + (set! (-> s5-0 float0) (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec))) + (if (and (cpad-hold? 0 square) (< (-> s5-0 float0) -20480.0)) + (set! (-> this lock-turret) (the-as basic #t)) + ) + (if (or (< 0.0 (-> s5-0 float0)) + (or (< 0.25 (fabs (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 1.0))) + (logtest? (vehicle-flag camera-look-mode) (-> this v-flags)) + ) + ) + (set! (-> this lock-turret) #f) + ) + (cond + ((-> this lock-turret) + (set! (-> this gun-aim-yaw) 0.0) + ) + (else + (matrix-transpose! (-> s5-0 mat0) (-> this rbody matrix)) + (matrix*! (-> s5-0 mat0) (camera-matrix) (-> s5-0 mat0)) + (set! (-> s5-0 vec0 quad) (-> s5-0 mat0 fvec quad)) + (set! (-> this gun-aim-yaw) (atan (-> s5-0 vec0 x) (-> s5-0 vec0 z))) + ) + ) + ) + 0 + (wvehicle-method-198 this) + (none) + ) + +(defmethod wvehicle-method-201 ((this wvehicle)) + 0 + (none) + ) + +(defmethod wvehicle-method-202 ((this wvehicle)) + 0 + (none) + ) + +(deftype kill-player-process (process) + ((player handle) + (mode symbol) + ) + (:state-methods + idle + die + ) + ) + + +(defstate idle (kill-player-process) + :virtual #t + :trans (behavior () + (let* ((s5-0 (handle->process (-> self player))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (not gp-0) + (go-virtual die) + ) + (if (focus-test? (the-as process-focusable gp-0) dead) + (go-virtual die) + ) + (when (not (focus-test? (the-as process-focusable gp-0) grabbed)) + (if (send-event + gp-0 + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode (-> self mode)) + ) + ) + ) + (go-virtual die) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate die (kill-player-process) + :virtual #t + :code (behavior () + '() + ) + ) + +(defbehavior kill-player-process-init-by-other kill-player-process ((arg0 process) (arg1 symbol)) + (set! (-> self player) (process->handle arg0)) + (set! (-> self mode) arg1) + (go-virtual idle) + ) + +;; WARN: Return type mismatch process vs kill-player-process. +(defun kill-player-process-spawn ((arg0 process) (arg1 process) (arg2 symbol)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn kill-player-process arg0 arg2 :name "kill-player-process" :to arg1))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as kill-player-process gp-0) + ) + ) + +(defmethod vehicle-method-116 ((this wvehicle) (arg0 symbol)) + (dotimes (s4-0 (-> this info rider seat-count)) + (let* ((s3-0 (handle->process (-> this rider-array s4-0))) + (a1-3 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (and a1-3 (logtest? (-> a1-3 mask) (process-mask target))) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag player-killed) (-> this v-flags)))) + (kill-player-process-spawn a1-3 a1-3 arg0) + ) + ) + (put-rider-in-seat this s4-0 (the-as process #f)) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc index f4b64216e6..19c00be67d 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc @@ -7,3 +7,436 @@ ;; DECOMP BEGINS +(deftype vehicle-wheel-init-params (structure) + ((skel skeleton-group) + (skel-blur skeleton-group) + (level symbol) + (radius float) + (collision-mesh-index int8) + (position vector :inline) + (rotation quaternion :inline) + (scale vector :inline) + ) + ) + + +(define *vehicle-wheel-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.5 + :friction-factor 0.5 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2) (meters 3) (meters 3)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 50) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*vehicle-wheel-constants* + ) + ) + +(deftype vehicle-wheel (rigid-body-object) + ((collision-enable? symbol) + (normal-look lod-set :inline) + (blur-look lod-set :inline) + ) + (:state-methods + explode + fade-out + die + ) + (:methods + (init-collision! (_type_ vehicle-wheel-init-params) none :replace) + ) + ) + + +(defmethod init-collision! ((this vehicle-wheel) (arg0 vehicle-wheel-init-params)) + (cond + ((< (-> arg0 collision-mesh-index) 0) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-0 penetrate-using) (penetrate vehicle)) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 0) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-8) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-11 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + ) + (else + (let ((s4-1 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-1 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-1 reaction) cshape-reaction-default) + (set! (-> s4-1 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-1 penetrate-using) (penetrate vehicle)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 2) 0))) + (set! (-> s4-1 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + (set! (-> s4-1 root-prim) s3-0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s4-1 (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid)) + (set! (-> v1-24 transform-index) 0) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + ) + (let ((v1-26 + (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint (-> arg0 collision-mesh-index)) (the-as uint 0)) + ) + ) + (set! (-> v1-26 prim-core action) (collide-action solid rideable)) + (set! (-> v1-26 transform-index) 3) + (set-vector! (-> v1-26 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + ) + (set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w))) + (let ((v1-29 (-> s4-1 root-prim))) + (set! (-> s4-1 backup-collide-as) (-> v1-29 prim-core collide-as)) + (set! (-> s4-1 backup-collide-with) (-> v1-29 prim-core collide-with)) + ) + (set! (-> this root) s4-1) + ) + ) + ) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere-no-probe)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh-no-block-use)) + ) + ((zero? v1-0) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh-no-block-use vehicle-sphere-no-probe)) + ) + ) + ) + (none) + ) + ) + 0 + (none) + ) + +(defmethod init-rbody-control! ((this vehicle-wheel)) + (alloc-rbody-control! this *vehicle-wheel-constants*) + (logior! (-> this rbody flags) (rigid-body-flag enable-collision)) + (set! (-> this root max-iteration-count) (the-as uint 3)) + (set! (-> this max-time-step) 0.033333335) + (set! (-> this draw shadow-ctrl) + (new 'process 'shadow-control -43008.0 -2048.0 69632.0 (the-as vector #f) (shadow-flags) 245760.0) + ) + (set! (-> this focus-status) + (the-as focus-status (logior (focus-status gun-no-target) (-> this focus-status))) + ) + 0 + (none) + ) + +(defmethod rigid-body-object-method-30 ((this vehicle-wheel)) + (ja-post) + (if (logtest? (-> this rbody flags) (rigid-body-flag enable-collision)) + (update-transforms (-> this root)) + ) + 0 + (none) + ) + +(defmethod rbody-post ((this vehicle-wheel)) + (let ((v1-0 (new 'stack-no-clear 'rigid-body-move-work))) + (set! (-> v1-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-float*! (-> v1-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) + (let ((a0-4 (-> v1-0 cquery))) + (set! (-> a0-4 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> a0-4 collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> a0-4 ignore-process0) this) + (set! (-> a0-4 ignore-process1) #f) + (set! (-> a0-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + (set! (-> a0-4 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* (-> v1-0 cquery)) + ) + (if *display-collide-cache* + (debug-draw *collide-cache*) + ) + (rigid-body-object-method-32 this) + (rigid-body-object-method-38 this) + (update-rbody-transform! (-> this rbody) (the-as collide-shape-moving (-> this root))) + (rigid-body-object-method-30 this) + 0 + (none) + ) + +(defstate idle (vehicle-wheel) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-2 object)) + (case message + (('explode) + (lods-assign! (-> self draw) (-> self normal-look)) + (let ((a0-4 (-> self draw color-mult))) + (vector-float*! (the-as vector a0-4) (the-as vector a0-4) 0.25) + ) + (set! (-> self rbody position quad) (-> self root trans quad)) + (quaternion-copy! (the-as quaternion (-> self rbody rot)) (-> self root quat)) + (let ((v1-10 (-> block param 0))) + (when v1-10 + (vector-float*! (-> self rbody lin-momentum) (the-as vector v1-10) (-> self info info mass)) + (go-virtual explode) + ) + ) + ) + (('enable-collision) + (set! v0-2 (logior (-> self rbody flags) (rigid-body-flag enable-collision))) + (set! (-> self rbody flags) (the-as rigid-body-flag v0-2)) + v0-2 + ) + (('disable-collision) + (set! v0-2 (logclear (-> self rbody flags) (rigid-body-flag enable-collision))) + (set! (-> self rbody flags) (the-as rigid-body-flag v0-2)) + v0-2 + ) + (('hide) + (set! v0-2 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-2)) + v0-2 + ) + (('unhide) + (set! v0-2 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-2)) + v0-2 + ) + ) + ) + :enter (behavior () + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) (collide-spec)) + (set! (-> arg0 prim-core collide-as) (collide-spec)) + 0 + ) + ((or (= v1-0 1) (zero? v1-0)) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh-no-block-use)) + ) + ) + ) + (none) + ) + ) + ) + :trans #f + :post (behavior () + (rigid-body-object-method-30 self) + ) + ) + +(defstate explode (vehicle-wheel) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + #t + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self rbody flags) (rigid-body-flag enable-physics)) + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((or (= v1-0 -1) (zero? v1-0)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere-no-probe)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec)) + (set! (-> arg0 prim-core collide-as) (collide-spec)) + 0 + ) + ) + ) + (none) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (rbody-post self) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-virtual fade-out) + ) + ) + ) + +(defstate fade-out (vehicle-wheel) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self draw status) (draw-control-status force-fade)) + ) + :code sleep-code + :post (behavior () + (set! (-> self draw force-fade) + (the-as + uint + (the int (fmax 0.0 (- 128.0 (* 0.42666668 (the float (- (current-time) (-> self state-time))))))) + ) + ) + (if (< (-> self draw force-fade) (the-as uint 2)) + (go-virtual die) + ) + (rbody-post self) + ) + ) + +(defstate die (vehicle-wheel) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +(defbehavior vehicle-wheel-init-by-other vehicle-wheel ((arg0 vehicle-wheel-init-params)) + (logior! (-> self mask) (process-mask vehicle)) + (init-collision! self arg0) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (set! (-> self root scale quad) (-> arg0 scale quad)) + (set! (-> self level) (the-as level (-> arg0 level))) + (initialize-skeleton self (-> arg0 skel) (the-as pair 0)) + (setup-lods! (-> self normal-look) (-> arg0 skel) (-> self draw art-group) (-> self entity)) + (setup-lods! (-> self blur-look) (-> arg0 skel-blur) (-> self draw art-group) (-> self entity)) + (set! (-> self normal-look lod 0 dist) 819200.0) + (set! (-> self blur-look lod 0 dist) 819200.0) + (set! (-> self draw lod-set lod 0 dist) 819200.0) + (let ((f0-6 (fmax (fmax (fabs (-> arg0 scale x)) (fabs (-> arg0 scale y))) (fabs (-> arg0 scale z))))) + (set! (-> self draw bounds w) (* (-> arg0 skel bounds w) f0-6)) + (set! (-> self draw longest-edge) (* (-> arg0 skel longest-edge) f0-6)) + ) + (init-rbody-control! self) + (go-virtual idle) + ) + +;; WARN: Return type mismatch process vs vehicle-wheel. +(defun vehicle-wheel-spawn ((arg0 process) (arg1 vehicle-wheel-init-params)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* vehicle-wheel #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "vehicle-wheel" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-wheel-init-by-other arg1) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as vehicle-wheel gp-0) + ) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc index 79f5686336..40430ced67 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc @@ -7,3 +7,1294 @@ ;; DECOMP BEGINS +(defmethod wvehicle-method-166 ((this wvehicle) (arg0 float) (arg1 float)) + (let* ((v1-0 (-> this info)) + (f0-0 (-> this engine-max-torque)) + (f1-3 (* (+ 1.0 (-> v1-0 engine drag)) + (if (< arg0 (-> v1-0 engine max-rpm)) + 1.0 + 0.0 + ) + (fmax (-> this idle-throttle) arg1) + ) + ) + (f2-5 0.2) + (f3-2 1.0) + (f4-2 (/ (- arg0 (-> v1-0 engine peak-torque-rpm)) (-> v1-0 engine powerband-width-rpm))) + ) + (* f0-0 (+ (* f1-3 (fmax f2-5 (- f3-2 (* f4-2 f4-2)))) + (* -1.0 (/ arg0 (-> v1-0 engine peak-torque-rpm)) (-> v1-0 engine drag)) + ) + ) + ) + ) + +(defmethod wvehicle-method-164 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 vehicle-wheel-info)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type6))) + (set-vector! (-> gp-0 vec0) 1.0 0.0 0.0 1.0) + (set-vector! (-> gp-0 vec1) 0.0 1.0 0.0 1.0) + (quaternion-copy! (-> gp-0 quat3) (-> this root quat)) + (let* ((v1-3 (-> gp-0 mat0)) + (a3-0 (-> this rbody matrix)) + (a0-7 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-7) + (set! (-> v1-3 uvec quad) a1-2) + (set! (-> v1-3 fvec quad) a2-1) + (set! (-> v1-3 trans quad) a3-1) + ) + (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (+! (-> gp-0 vec2 x) (-> arg1 susp-arm-length)) + (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) + (+! (-> gp-0 vec2 y) (-> arg1 probe-y-offset)) + (vector+float*! + (-> arg0 probe-local-pos) + (-> gp-0 vec2) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (set! (-> gp-0 float0) + (+ (-> arg1 probe-y-offset) (* (-> arg1 radius) (-> arg1 scale)) (* -1.0 (-> arg0 pos2) (-> arg1 travel))) + ) + (set! (-> arg0 sin-susp-ang) (fmax -1.0 (fmin 1.0 (/ (-> gp-0 float0) (-> arg1 susp-arm-length))))) + (let ((f0-21 1.0) + (f1-11 (-> arg0 sin-susp-ang)) + ) + (set! (-> arg0 cos-susp-ang) (sqrtf (- f0-21 (* f1-11 f1-11)))) + ) + (quaternion-identity! (-> gp-0 quat4)) + (set! (-> gp-0 quat4 z) (* (sin (-> arg1 camber)) (-> arg0 x-scale))) + (set! (-> gp-0 quat4 w) (cos (-> arg1 camber))) + (when (logtest? (-> arg1 flags) (vehicle-wheel-flag vwf5)) + (quaternion-set! + (-> gp-0 quat0) + 0.0 + 0.0 + (* (-> arg0 sin-susp-ang) (-> arg0 x-scale)) + (+ 1.0 (-> arg0 cos-susp-ang)) + ) + (quaternion-normalize! (-> gp-0 quat0)) + (quaternion*! (-> gp-0 quat4) (-> gp-0 quat4) (-> gp-0 quat0)) + ) + (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (+! (-> gp-0 vec2 x) (* (-> arg1 susp-arm-length) (-> arg0 cos-susp-ang))) + (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) + (+! (-> gp-0 vec2 y) (-> gp-0 float0)) + (vector+float*! + (-> gp-0 vec2) + (-> gp-0 vec2) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (vector-matrix*! (-> gp-0 vec3) (-> gp-0 vec2) (-> gp-0 mat0)) + (quaternion-vector-angle! (-> gp-0 quat2) (-> gp-0 vec1) (-> arg0 steer-angle)) + (quaternion-vector-angle! (-> gp-0 quat1) (-> gp-0 vec0) (-> arg0 angle)) + (quaternion*! (-> gp-0 quat0) (-> gp-0 quat2) (-> gp-0 quat4)) + (quaternion*! (-> gp-0 quat0) (-> gp-0 quat0) (-> gp-0 quat1)) + (quaternion*! (-> arg0 quat) (-> gp-0 quat3) (-> gp-0 quat0)) + (set! (-> arg0 trans quad) (-> gp-0 vec3 quad)) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-165 ((this wvehicle)) + (let ((s5-0 (new 'stack-no-clear 'vehicle-controls))) + (set! (-> s5-0 steering) (seconds-per-frame)) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let* ((a1-0 (-> this wheel s4-0)) + (a2-0 (-> a1-0 info)) + ) + (let* ((f0-1 (-> a1-0 pos2)) + (f1-1 (- (-> a1-0 pos) (-> a1-0 pos2))) + (f2-1 1.0) + (f3-0 (-> s5-0 steering)) + (f4-0 (-> a1-0 forward-vel)) + (f4-2 (* f4-0 f4-0)) + (f5-0 (-> a1-0 up-vel)) + (f4-3 (+ f4-2 (* f5-0 f5-0))) + (f5-3 8192.0) + (f3-1 (* f3-0 (fmin f4-3 (* f5-3 f5-3)))) + (f4-5 15.0) + (f5-6 8192.0) + ) + (set! (-> a1-0 pos2) (+ f0-1 (* f1-1 (fmin f2-1 (* f3-1 (/ f4-5 (* f5-6 f5-6))))))) + ) + (set! (-> a1-0 angle) + (the float (sar (shl (the int (+ (-> a1-0 angle) (* 10430.379 (-> a1-0 rev) (-> s5-0 steering)))) 48) 48)) + ) + ((-> a2-0 callback) this a1-0 a2-0) + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (let ((a2-1 (-> this draw shadow-ctrl settings))) + (vector+float*! (-> s5-1 rvec) (-> a2-1 center) (-> a2-1 shadow-dir) (-> a2-1 shadow-dir w)) + ) + 0 + (dotimes (s4-1 (-> this info physics-model wheel-count)) + (let ((s3-0 (-> this wheel s4-1))) + (-> s3-0 info) + (let ((s2-0 (handle->process (-> s3-0 handle)))) + (cond + (s2-0 + (let ((s1-0 (-> (the-as process-focusable s2-0) draw shadow-ctrl settings))) + (vector-! (-> s5-1 uvec) (-> s5-1 rvec) (-> s1-0 center)) + (vector-normalize! (-> s5-1 uvec) 1.0) + (mem-copy! (the-as pointer s1-0) (the-as pointer (-> this draw shadow-ctrl settings)) 80) + (set! (-> s5-1 uvec w) (-> s1-0 shadow-dir w)) + (set! (-> s1-0 shadow-dir quad) (-> s5-1 uvec quad)) + ) + (let ((v1-39 (-> (the-as process-focusable s2-0) root))) + (set! (-> v1-39 trans quad) (-> s3-0 trans quad)) + (quaternion-copy! (-> v1-39 quat) (-> s3-0 quat)) + ) + (logand! (-> s3-0 flags) -9) + (cond + ((< 11.780972 (fabs (-> s3-0 rev))) + (when (not (logtest? (-> s3-0 flags) 1)) + (logior! (-> s3-0 flags) 1) + (lods-assign! (-> (the-as process-focusable s2-0) draw) (the-as lod-set (&-> s2-0 stack 216))) + ) + ) + (else + (when (logtest? (-> s3-0 flags) 1) + (logand! (-> s3-0 flags) -2) + (lods-assign! (-> (the-as process-focusable s2-0) draw) (the-as lod-set (&-> s2-0 stack 164))) + ) + ) + ) + ) + (else + (logior! (-> s3-0 flags) 8) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod clear-impulse-force-flag! ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle clear-impulse-force-flag!))) + (t9-0 this) + ) + (when (logtest? (vehicle-flag waiting-for-player) (-> this v-flags)) + (let ((s5-0 (-> this root))) + (when (and (logtest? (-> this v-flags) (vehicle-flag player-touching)) + (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + ) + (pull-riders! s5-0) + (cond + ((logtest? (do-push-aways s5-0) (collide-spec jak)) + (+! (-> this overlap-player-counter) 1) + (when (< (the-as uint 60) (-> this overlap-player-counter)) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1000.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'smush)) + ) + ) + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + (else + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + (none) + ) + +(defmethod vehicle-method-77 ((this wvehicle)) + (local-vars (a0-19 float) (a0-23 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (if (-> this nav) + (logior! (-> this nav flags) (nav-control-flag output-sphere-hash)) + ) + (if (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) + (vehicle-method-142 this) + ) + (if (logtest? (-> this v-flags) (vehicle-flag in-air)) + (set! (-> this ground-time) (the-as uint (current-time))) + ) + (let ((v1-16 (-> this rbody))) + (cond + ((logtest? (vehicle-flag overturned) (-> this v-flags)) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag in-air))) (< 0.0 (-> v1-16 matrix uvec y))) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag overturned)))) + ) + ) + (else + (when (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (-> v1-16 matrix uvec y) 0.0) + (let ((a0-18 (-> v1-16 lin-velocity)) + (f1-2 16384.0) + ) + (.lvf vf1 (&-> a0-18 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 a0-19 vf1) + (< a0-19 (* f1-2 f1-2)) + ) + (let ((a0-22 (-> v1-16 ang-velocity)) + (f1-5 4.0) + ) + (.lvf vf1 (&-> a0-22 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 a0-23 vf1) + (< a0-23 (* f1-5 f1-5)) + ) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag overturned) (-> this v-flags)))) + (set! (-> this overturned-time) (the-as uint (current-time))) + ) + ) + ) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (+ 8192.0 (-> v1-16 position y)) (-> this water-height)) + ) + (go (method-of-object this sink)) + ) + ) + (when (logtest? (vehicle-flag player-driving net-player-driving) (-> this v-flags)) + (when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf1)) + (>= (the-as uint (- (current-time) (the-as int (-> this shoot-time)))) (-> this shoot-delay)) + ) + (set! (-> this shoot-time) (the-as uint (current-time))) + (wvehicle-method-169 this) + ) + ) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (let ((v1-39 *game-info*)) + (set! (-> v1-39 health-bar-vehicle) (-> this hit-points)) + (set! (-> v1-39 race-number-turbos) (the int (-> this turbo-supply))) + (set! (-> v1-39 vehicle-turbo-ready) (-> this turbo-ready)) + ) + (new 'stack-no-clear 'vector) + (dotimes (s5-0 (-> this info rider attach-point-count)) + (let* ((s3-0 (handle->process (-> this attached-array s5-0))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (and s4-0 (focus-test? (the-as process-focusable s4-0) pilot-riding)) + (wvehicle-method-171 this (-> (the-as process-focusable s4-0) root trans) s5-0) + (wvehicle-method-172 this (-> (the-as process-focusable s4-0) root quat) s5-0) + ) + ) + ) + 0 + ) + ((method-of-type vehicle vehicle-method-77) this) + (none) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod rigid-body-object-method-30 ((this wvehicle)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag sounds)))) + (let ((f0-0 (-> this player-dist2)) + (f1-0 245760.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds) (-> this v-flags)))) + ) + ) + (let ((v1-8 (new 'stack-no-clear 'matrix))) + (set! (-> v1-8 fvec x) (seconds-per-frame)) + (set! (-> v1-8 uvec quad) (-> this draw color-emissive quad)) + (set! (-> v1-8 uvec x) (fmax 0.0 (+ (-> v1-8 uvec x) (* -2.0 (-> v1-8 fvec x))))) + (set! (-> this draw color-emissive quad) (-> v1-8 uvec quad)) + ) + (let ((t9-0 (method-of-type vehicle rigid-body-object-method-30))) + (t9-0 this) + ) + (wvehicle-method-165 this) + (vector-reset! (-> this surface-velocity)) + (dotimes (v1-15 (-> this info physics-model wheel-count)) + (let ((a0-13 (-> this wheel v1-15))) + (set! (-> a0-13 prev-flags) (-> a0-13 flags)) + ) + ) + (none) + ) + +(defmethod wvehicle-method-162 ((this wvehicle) (arg0 float)) + (let ((s5-0 (-> this info))) + (let ((s4-0 (new 'stack-no-clear 'wvehicle-physics-work))) + (let ((f0-0 (-> this engine-rev))) + (set! (-> s4-0 mat uvec x) (* 9.549297 f0-0)) + ) + (set! (-> s4-0 mat uvec z) 1.0) + (if (or (= 0.0 (-> this controls throttle)) + (and (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (= (-> this gear-select) (+ (-> s5-0 transmission gear-count) -1)) + (< (-> s5-0 transmission upshift-rpm) (-> s4-0 mat uvec x)) + ) + ) + (set! (-> s4-0 mat uvec z) 0.0) + ) + (set! (-> this engine-rpm) (-> s4-0 mat uvec x)) + (set! (-> s4-0 mat uvec w) (the-as float (current-time))) + (vector-! (the-as vector (-> s4-0 mat)) (-> this rbody lin-velocity) (-> this surface-velocity)) + (when (not (logtest? (-> this v-flags) (vehicle-flag in-air))) + (let ((f0-12 (* (/ (fmax 0.0 (vector-dot (the-as vector (-> s4-0 mat)) (-> this rbody matrix fvec))) + (-> this avg-drive-wheel-radius) + ) + (-> this gear-ratio) + (-> this final-drive-ratio) + ) + ) + ) + (set! (-> s4-0 mat uvec y) (* 9.549297 f0-12)) + ) + (cond + ((logtest? (vehicle-flag reverse-gear) (-> this v-flags)) + (set! (-> this next-gear-select) 0) + 0 + ) + ((and (zero? (-> this gear-select)) (not (logtest? (vehicle-flag reverse-gear) (-> this v-flags)))) + (set! (-> this next-gear-select) 1) + ) + ((and (< (-> s5-0 transmission upshift-rpm) (-> s4-0 mat uvec y)) + (and (< (-> this gear-select) (+ (-> s5-0 transmission gear-count) -1)) + (> (-> this gear-select) 0) + (= (-> this clutch-grab) 1.0) + (< 0.5 (-> this controls throttle)) + ) + ) + (set! (-> this next-gear-select) (+ (-> this gear-select) 1)) + ) + ((and (< (-> s4-0 mat uvec y) (-> s5-0 transmission downshift-rpm)) (< 1 (-> this gear-select))) + (set! (-> this next-gear-select) (+ (-> this gear-select) -1)) + ) + ) + ) + (let ((v1-47 (-> this shift-state))) + (cond + ((zero? v1-47) + (cond + ((>= 1 (-> this gear-select)) + (cond + ((or (< (-> s4-0 mat uvec x) (-> s5-0 engine clutch-min-rpm)) (= (-> this controls throttle) 0.0)) + (seek! (-> this clutch-grab) 0.0 (* 16.0 arg0)) + ) + ((or (< (-> s5-0 engine clutch-max-rpm) (-> s4-0 mat uvec x)) + (and (< 0.0 (-> this clutch-grab)) (< (-> s5-0 engine peak-torque-rpm) (-> s4-0 mat uvec x))) + ) + (seek! (-> this clutch-grab) (-> s4-0 mat uvec z) (* 3.0 arg0)) + ) + (else + (seek! (-> this clutch-grab) 0.0 (* 3.0 arg0)) + ) + ) + ) + (else + (seek! (-> this clutch-grab) (-> s4-0 mat uvec z) (* 8.0 arg0)) + ) + ) + (when (!= (-> this next-gear-select) (-> this gear-select)) + (set! (-> this shift-state) (the-as uint 1)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ((= v1-47 1) + (seek! (-> this clutch-grab) 0.0 (* 16.0 arg0)) + (when (= (-> this clutch-grab) 0.0) + (set! (-> this shift-state) (the-as uint 2)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ((= v1-47 2) + (set! (-> this gear-select) (-> this next-gear-select)) + (when (< (the-as uint 15) (- (the-as uint (-> s4-0 mat uvec w)) (the-as uint (-> this shift-time)))) + (set! (-> this shift-state) (the-as uint 3)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ((= v1-47 3) + (seek! (-> this clutch-grab) (-> s4-0 mat uvec z) (* 8.0 arg0)) + (when (!= (-> this next-gear-select) (-> this gear-select)) + (set! (-> this shift-state) (the-as uint 1)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + (when (= (-> this clutch-grab) (-> s4-0 mat uvec z)) + (set! (-> this shift-state) (the-as uint 0)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ) + ) + ) + (set! (-> this gear-ratio) (-> s5-0 transmission gear-ratio-array (-> this gear-select))) + (set! (-> this final-drive-ratio) (-> s5-0 transmission final-drive-ratio)) + (set! (-> this total-gear-ratio) (* (-> this final-drive-ratio) (-> this gear-ratio))) + (set! (-> this inv-total-gear-ratio) (/ 1.0 (-> this total-gear-ratio))) + (set! (-> this engine-max-torque) (-> s5-0 engine max-torque)) + (set! (-> this clutch-inertia) (* 0.0 (-> s5-0 transmission inertia))) + ) + 0 + (none) + ) + +(defmethod wvehicle-method-163 ((this wvehicle)) + (let ((s5-0 (-> this info)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-0 rvec z) (-> this controls throttle)) + (set! (-> s4-0 uvec x) (vector-dot (the-as vector (-> this rbody matrix)) (-> this rbody ang-velocity))) + (set! (-> s4-0 rvec w) (-> this rbody matrix fvec y)) + (set! (-> s4-0 uvec y) (+ (-> s4-0 rvec w) (* -1.0 (-> s4-0 uvec x)))) + (if (and (< (cos 12743.111) (-> s4-0 rvec w)) + (< (-> s4-0 uvec x) -0.1) + (and (< 1.0 (-> s4-0 uvec y)) + (not (logtest? (-> this wheel 0 flags) 2)) + (not (logtest? (-> this wheel 1 flags) 2)) + (logtest? (-> this wheel 2 flags) 2) + (logtest? (-> this wheel 3 flags) 2) + ) + ) + (set! (-> s4-0 rvec z) 0.0) + ) + (set! (-> this engine-torque) (wvehicle-method-166 this (-> this engine-rpm) (-> s4-0 rvec z))) + (let ((f0-13 0.0)) + (dotimes (v1-23 (-> s5-0 physics-model wheel-count)) + (let ((a0-9 (-> this wheel v1-23 info))) + (if (logtest? (-> a0-9 flags) (vehicle-wheel-flag vwf0)) + (+! f0-13 (-> a0-9 inertia)) + ) + ) + ) + (set! (-> this drive-wheel-inertia) f0-13) + (let* ((f1-6 (-> this final-drive-ratio)) + (f1-8 (* f1-6 f1-6)) + (f2-1 (-> s5-0 transmission inertia)) + (f3-0 (-> this gear-ratio)) + ) + (set! (-> this wheel-inertia) + (+ f0-13 + (* f1-8 + (+ f2-1 (* f3-0 f3-0 (+ (-> this clutch-inertia) (* (-> s5-0 engine inertia) (-> this clutch-grab))))) + ) + ) + ) + ) + ) + (set! (-> s4-0 rvec x) (* (/ 1.0 (the float (-> s5-0 physics-model drive-wheel-count))) + (-> this engine-torque) + (-> this clutch-grab) + (-> this total-gear-ratio) + ) + ) + (set! (-> this wheel-torque) 0.0) + (set! (-> this wheel-braking-torque) 0.0) + (set! (-> this wheel-ground-torque) 0.0) + (dotimes (v1-31 (-> s5-0 physics-model wheel-count)) + (let* ((a0-14 (-> this wheel v1-31)) + (a1-5 (-> a0-14 info)) + ) + (set! (-> a0-14 torque) 0.0) + (set! (-> a0-14 braking-torque) 0.0) + (set! (-> a0-14 inertia) (-> a1-5 inertia)) + (let ((f0-26 0.0)) + (if (logtest? (-> a1-5 flags) (vehicle-wheel-flag vwf1)) + (+! f0-26 (-> this controls brake)) + ) + (if (logtest? (-> a1-5 flags) (vehicle-wheel-flag vwf2)) + (+! f0-26 (-> this controls handbrake)) + ) + (+! (-> a0-14 braking-torque) (* (fmin 1.0 f0-26) (-> a1-5 max-brake-torque) (-> s5-0 handling brake-factor))) + ) + (+! (-> this wheel-braking-torque) (-> a0-14 braking-torque)) + (when (logtest? (-> a1-5 flags) (vehicle-wheel-flag vwf0)) + (set! (-> a0-14 inertia) (-> this wheel-inertia)) + (set! (-> a0-14 torque) (-> s4-0 rvec x)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-92 ((this wvehicle) (arg0 vehicle-controls)) + (seek! (-> this controls steering) (-> arg0 steering) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 lean-z) (* 8.0 (seconds-per-frame))) + (set! (-> this controls handbrake) (-> arg0 handbrake)) + (let ((f0-11 (-> arg0 throttle)) + (f30-0 (-> arg0 brake)) + ) + (set! f30-0 + (cond + ((< 0.0 f0-11) + (logclear! (-> this v-flags) (vehicle-flag reverse-gear)) + (if (< (-> this wheel-rev) -1.5) + (set! f30-0 1.0) + ) + f30-0 + ) + ((< 0.0 f30-0) + (cond + ((logtest? (vehicle-flag reverse-gear) (-> this v-flags)) + (set! f0-11 f30-0) + 0.0 + ) + (else + (let ((v1-13 (new 'stack-no-clear 'vector))) + (vector-! (the-as vector (&-> v1-13 x)) (-> this rbody lin-velocity) (-> this surface-velocity)) + (if (< (vector-dot (the-as vector (&-> v1-13 x)) (-> this rbody matrix fvec)) 40960.0) + (logior! (-> this v-flags) (vehicle-flag reverse-gear)) + ) + ) + f30-0 + ) + ) + ) + (else + (logclear! (-> this v-flags) (vehicle-flag reverse-gear)) + f30-0 + ) + ) + ) + (case (-> this shift-state) + ((1 2) + (set! f0-11 0.0) + ) + ) + (seek! (-> this controls throttle) f0-11 (* 8.0 (seconds-per-frame))) + (+! (-> this controls brake) (* (- f30-0 (-> this controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) + ) + (set! (-> this controls prev-flags) (-> this controls flags)) + (set! (-> this controls flags) (-> arg0 flags)) + 0 + (none) + ) + +(defmethod vehicle-method-88 ((this wvehicle) (arg0 vehicle-controls)) + (set! (-> arg0 steering) (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 lean-z) (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 throttle) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6))))) + (set! (-> arg0 brake) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 7))))) + (set! (-> arg0 handbrake) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 5))))) + (cond + ((-> *setting-control* user-current jump) + (if (cpad-hold? 0 l1) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf0)) + ) + ) + (else + (logclear! (-> this controls flags) (vehicle-controls-flag vcf0)) + (logclear! (-> this controls prev-flags) (vehicle-controls-flag vcf0)) + ) + ) + (if (and (cpad-hold? 0 r1) (-> *setting-control* user-current gun)) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf1)) + ) + (if (and (cpad-hold? 0 r2) (-> *setting-control* user-current turbo)) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf2)) + ) + (if (cpad-pressed? 0 r3) + (set! (-> this v-flags) (the-as vehicle-flag (logxor (shl #x8000 16) (the-as int (-> this v-flags))))) + ) + (if (not (-> *setting-control* user-current allow-look-around)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag camera-inside-view)))) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag camera-look-mode)))) + (if (logtest? (vehicle-flag camera-inside-view) (-> this v-flags)) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag camera-look-mode) (-> this v-flags)))) + ) + (if (cpad-pressed? 0 l2) + (set! (-> this cam-view) 1) + ) + (cond + ((cpad-hold? 0 l2) + (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 -1.0)) + (f0-8 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 -1.0)) + ) + (cond + ((< (fabs f0-8) (fabs f30-0)) + (cond + ((< f30-0 -0.5) + (set! (-> this cam-view) 3) + ) + ((< 0.5 f30-0) + (set! (-> this cam-view) 2) + ) + ) + ) + (else + (cond + ((< 0.5 f0-8) + (set! (-> this cam-view) 0) + 0 + ) + ((< f0-8 -0.5) + (set! (-> this cam-view) 1) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this cam-view) 0) + 0 + ) + ) + (if (nonzero? (-> this cam-view)) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag camera-look-mode) (-> this v-flags)))) + ) + 0 + (none) + ) + +(defmethod vehicle-method-94 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle vehicle-method-94))) + (t9-0 this) + ) + (set-setting! 'string-camera-floor 'abs (+ 12288.0 (-> this water-height)) 0) + (cond + ((logtest? (vehicle-flag reverse-gear) (-> this v-flags)) + (let ((v1-6 (process->ppointer this))) + (set-setting! 'butt-handle v1-6 32768.0 (-> v1-6 0 pid)) + ) + ) + (else + (remove-setting! 'butt-handle) + ) + ) + (let ((f0-2 (vector-vector-distance-squared (-> this draw origin) (math-camera-pos))) + (f1-1 (-> this draw origin w)) + ) + (if (< f0-2 (* f1-1 f1-1)) + (logclear! (-> this draw status) (draw-control-status force-vu1)) + (logior! (-> this draw status) (draw-control-status force-vu1)) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-93 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle vehicle-method-93))) + (t9-0 this) + ) + (let ((s4-0 (-> this info)) + (s5-0 (new 'stack-no-clear 'inline-array 'matrix 2)) + ) + (set! (-> s5-0 0 trans z) (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec))) + (set! (-> s5-0 0 trans w) (vector-dot (-> this rbody lin-velocity) (the-as vector (-> this rbody matrix)))) + (set! (-> s5-0 0 trans y) (/ (* 2.0 (fabs (-> s5-0 0 trans w))) (fmax 409.6 (-> s5-0 0 trans z)))) + (set! (-> s5-0 0 trans x) + (/ (-> s4-0 handling tire-steering-speed-factor) + (fmax 409.6 (- (-> s5-0 0 trans z) (-> s4-0 handling tire-steering-speed-bias))) + ) + ) + (set! (-> s5-0 0 fvec y) (fmin 1.0 (fmax (-> s5-0 0 trans y) (-> s5-0 0 trans x)))) + (set! (-> s5-0 0 fvec x) (* (-> this controls steering) (-> s5-0 0 fvec y))) + (set! (-> s5-0 0 fvec z) (* (-> this info handling tire-steering-angle) (-> s5-0 0 fvec x))) + (set! (-> s5-0 0 fvec w) + (* (-> s5-0 0 fvec z) (+ 1.0 (* (-> this info handling ackermann-factor) (fabs (-> s5-0 0 fvec x))))) + ) + (set! (-> s5-0 1 uvec y) + (* 2.0 + (+ (-> s4-0 physics-model rear-wheel local-pos x) + (-> s4-0 physics-model rear-wheel susp-arm-length) + (-> s4-0 physics-model rear-wheel steer-arm-length) + ) + ) + ) + (set! (-> s5-0 1 uvec z) + (- (-> s4-0 physics-model front-wheel local-pos z) (-> s4-0 physics-model rear-wheel local-pos z)) + ) + (set! (-> s5-0 1 uvec w) 0.0) + (when (< 18.204445 (fabs (-> s5-0 0 fvec z))) + (cond + ((logtest? (-> s4-0 physics-model rear-wheel flags) (vehicle-wheel-flag vwf4)) + (set! (-> s5-0 1 rvec w) (/ (* 0.5 (-> s5-0 1 uvec z)) (sin (fabs (-> s5-0 0 fvec z))))) + (let ((f0-32 + (- (* (-> s5-0 1 rvec w) (cos (fabs (-> s5-0 0 fvec z)))) + (* 2.0 (+ (-> s4-0 physics-model rear-wheel local-pos x) (-> s4-0 physics-model rear-wheel susp-arm-length))) + ) + ) + (f1-22 (* 0.5 (-> s5-0 1 uvec z))) + ) + (set! (-> s5-0 1 rvec z) (sqrtf (+ (* f1-22 f1-22) (* f0-32 f0-32)))) + ) + (+! (-> s5-0 1 rvec w) (-> s4-0 physics-model rear-wheel steer-arm-length)) + (set! (-> s5-0 1 rvec z) (- (-> s5-0 1 rvec z) (-> s4-0 physics-model rear-wheel steer-arm-length))) + ) + (else + (set! (-> s5-0 1 rvec w) (/ (-> s5-0 1 uvec z) (tan (fabs (-> s5-0 0 fvec z))))) + (set! (-> s5-0 1 rvec w) + (- (-> s5-0 1 rvec w) + (+ (-> s4-0 physics-model front-wheel local-pos x) + (-> s4-0 physics-model front-wheel susp-arm-length) + (* -0.5 (-> s5-0 1 uvec y)) + ) + ) + ) + (set! (-> s5-0 1 rvec z) (- (-> s5-0 1 rvec w) (-> s5-0 1 uvec y))) + ) + ) + (set! (-> s5-0 1 uvec w) + (/ (- (-> s5-0 1 rvec w) (-> s5-0 1 rvec z)) (+ (-> s5-0 1 rvec w) (-> s5-0 1 rvec z))) + ) + ) + (set! (-> s5-0 1 rvec x) (- 1.0 (-> s5-0 1 uvec w))) + (set! (-> s5-0 1 rvec y) (+ 1.0 (-> s5-0 1 uvec w))) + (cond + ((< (-> s5-0 0 fvec z) 0.0) + (set! (-> s5-0 0 rvec x) (-> s5-0 0 fvec z)) + (set! (-> s5-0 0 rvec y) (-> s5-0 0 fvec w)) + (set! (-> s5-0 0 uvec x) (-> s5-0 1 rvec y)) + (set! (-> s5-0 0 uvec y) (-> s5-0 1 rvec x)) + ) + (else + (set! (-> s5-0 0 rvec x) (-> s5-0 0 fvec w)) + (set! (-> s5-0 0 rvec y) (-> s5-0 0 fvec z)) + (set! (-> s5-0 0 uvec x) (-> s5-0 1 rvec x)) + (set! (-> s5-0 0 uvec y) (-> s5-0 1 rvec y)) + ) + ) + (dotimes (s4-1 (-> this info physics-model wheel-count)) + (let* ((s3-0 (-> this wheel s4-1)) + (s2-0 (-> s3-0 info)) + ) + (if (logtest? (-> s2-0 flags) (vehicle-wheel-flag vwf4)) + (set! (-> s3-0 steer-angle) (* (-> (&-> s5-0 0 rvec data (logand s4-1 1)) 0) (sign (-> s2-0 local-pos z)))) + ) + (if (logtest? (-> s2-0 flags) (vehicle-wheel-flag vwf0)) + (set! (-> s3-0 drive-diff) (-> (&-> s5-0 0 rvec data (logand s4-1 1)) 4)) + ) + ) + ) + ) + (dotimes (s5-1 (-> this info physics-model wheel-count)) + (let ((s3-1 (-> this wheel s5-1))) + (set-vector! (-> s3-1 local-axis) (cos (-> s3-1 steer-angle)) 0.0 (- (sin (-> s3-1 steer-angle))) 1.0) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'wvehicle-physics-work))) + (set! (-> s5-2 mat rvec x) (the-as float (current-time))) + (cond + ((logtest? (-> this info flags) 4096) + (when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)) + (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0))) + (< (the-as uint 45) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this jump-time)))) + (< (the-as uint 45) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this ground-time)))) + ) + (let ((v1-77 0)) + (dotimes (a0-15 4) + (let ((a1-5 (-> this wheel a0-15))) + (if (and (logtest? (-> a1-5 flags) 2) (< 0.0 (-> a1-5 up-force))) + (+! v1-77 1) + ) + ) + ) + (when (>= v1-77 2) + (let ((v1-79 (new 'stack-no-clear 'matrix))) + (vector-float*! (-> v1-79 rvec) (-> this rbody matrix uvec) (* 0.3 + (-> this rbody matrix uvec y) + (-> this info info mass) + (-> this info extra gravity) + (-> this info handling jump-thrust-factor) + ) + ) + (add-force! (-> this rbody) (-> v1-79 rvec)) + ) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + (set! (-> this jump-time) (the-as uint (-> s5-2 mat rvec x))) + (sound-play-by-name (-> this info sound jump-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + ) + ) + ) + ) + ((logtest? (-> this controls flags) (vehicle-controls-flag vcf0)) + (set! (-> this susp-spring-control) 0.5) + (set! (-> this jump-control) 0.0) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.05)) + ) + (if (and (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0))) + (logtest? (-> this v-flags) (vehicle-flag on-ground)) + ) + (sound-play "toad-prehop") + ) + ) + (else + (set! (-> this susp-spring-control) 1.0) + (when (and (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0)) + (< (the-as uint 300) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this jump-time)))) + (< (the-as uint 45) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this ground-time)))) + ) + 0 + (when (>= (-> this rbody matrix uvec y) 0.707) + (set! (-> this jump-time) (the-as uint (-> s5-2 mat rvec x))) + (set! (-> this jump-control) (-> this info handling jump-thrust-factor)) + (sound-play-by-name (-> this info sound jump-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + ) + ) + (if (< (the-as uint 60) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this jump-time)))) + (set! (-> this jump-control) 0.0) + ) + ) + ) + ) + (if (not (logtest? (vehicle-flag turbo-boost) (-> this v-flags))) + (set! (-> this turbo-ready) (fmin 1.0 (+ (-> this turbo-ready) (* 0.5 (seconds-per-frame))))) + ) + (if (logtest? (-> this controls flags) (vehicle-controls-flag vcf2)) + (vehicle-method-64 this) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod alloc-rbody-control! ((this wvehicle) (arg0 rigid-body-object-constants)) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (vector-y-quaternion! (the-as vector (-> s4-0 0)) (-> this root quat)) + (vector+float*! + (-> this root trans) + (-> this root trans) + (the-as vector (-> s4-0 0)) + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-height) + ) + (quaternion-axis-angle! + (-> s4-0 1) + 1.0 + 0.0 + 0.0 + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-rot-x) + ) + (quaternion*! (-> this root quat) (-> this root quat) (-> s4-0 1)) + ) + (let ((t9-3 (method-of-type vehicle alloc-rbody-control!))) + (t9-3 this (the-as rigid-body-vehicle-constants arg0)) + ) + (iterate-prims (-> this root) (lambda ((arg0 collide-shape-prim)) + (logior! (-> arg0 prim-core collide-as) (collide-spec camera-blocker)) + (none) + ) + ) + (set! (-> this control-hook) #f) + (set! (-> this ai-min-speed) 61440.0) + (set! (-> this ai-max-speed) 102400.0) + (set! (-> this minimap) #f) + (set! (-> this clutch-grab) 0.0) + (set! (-> this gear-select) 1) + (set! (-> this shoot-delay) (the-as uint 60)) + (wvehicle-method-167 this) + (set! (-> this info physics-model wheel-count) 4) + (set! (-> this susp-spring-control) 1.0) + (set! (-> this jump-control) 0.0) + (set! (-> this turbo-ready) 1.0) + (set! (-> this net) #f) + (let ((v1-19 (new 'stack-no-clear 'wvehicle-stack-type4))) + (set! (-> v1-19 float2) (vector-dot (-> this root transv) (-> this rbody matrix fvec))) + (set! (-> v1-19 byte0) 0) + (set! (-> v1-19 float0) 0.0) + (dotimes (a0-14 (-> this info physics-model wheel-count)) + (let ((a1-11 (-> this wheel a0-14))) + (let ((a2-2 (-> a1-11 info))) + (set! (-> a1-11 x-scale) (if (= (logand a0-14 1) 1) + -1.0 + 1.0 + ) + ) + (set! (-> a1-11 surface) #f) + (set! (-> v1-19 float1) (* (-> a2-2 radius) (-> a2-2 scale))) + (set! (-> a1-11 rev) (/ (-> v1-19 float2) (-> v1-19 float1))) + (when (logtest? (-> a2-2 flags) (vehicle-wheel-flag vwf0)) + (+! (-> v1-19 byte0) 1) + (+! (-> v1-19 float0) (-> v1-19 float1)) + (set! (-> a1-11 drive-diff) 1.0) + ) + (set! (-> a1-11 handle) (the-as handle #f)) + (set! (-> a1-11 tread-tracker) (the-as handle #f)) + (set! (-> a1-11 inertia) (-> a2-2 inertia)) + ) + (set! (-> a1-11 probe-local-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) + (set! (-> a1-11 local-axis quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + ) + ) + (set! (-> (the-as rigid-body-vehicle-constants arg0) physics-model drive-wheel-count) (-> v1-19 byte0)) + (set! (-> this avg-drive-wheel-radius) (/ (-> v1-19 float0) (the float (-> v1-19 byte0)))) + (set! (-> this wheel-rev) (/ (-> v1-19 float2) (-> this avg-drive-wheel-radius))) + (when (< 0.0 (-> v1-19 float2)) + (set! (-> this gear-select) (+ (-> (the-as rigid-body-vehicle-constants arg0) transmission gear-count) -1)) + (let ((f0-25 (-> (the-as rigid-body-vehicle-constants arg0) engine idle-rpm))) + (set! (-> this engine-rev) (* 0.10471976 f0-25)) + ) + ) + ) + (dotimes (v1-26 (-> this info rider attach-point-count)) + (set! (-> this attached-array v1-26) (the-as handle #f)) + ) + (vector-reset! (-> this surface-velocity)) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set! (-> this draw lod-set lod 2 dist) 1236992.0) + (set! (-> this gun-aim-yaw) 0.0) + (set! (-> this gun-aim-yaw-vel) 0.0) + (set! (-> this gun-yaw) 0.0) + (set! (-> this gun-pitch) 0.0) + (set! (-> this shoot-delay) (the-as uint 30)) + (set! (-> this lock-turret) #f) + (none) + ) + +(defmethod vehicle-method-134 ((this wvehicle)) + (if (focus-test? this grabbed) + (go (method-of-object this race-waiting)) + (go (method-of-object this player-control)) + ) + 0 + (none) + ) + +(defmethod on-impact ((this wvehicle) (arg0 rigid-body-impact)) + (mem-copy! (the-as pointer (-> this impact)) (the-as pointer arg0) 64) + ((method-of-type vehicle on-impact) this arg0) + (none) + ) + +;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 59. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod rbody-event-handler ((this wvehicle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('test-ready) + (and (and (-> this next-state) (= (-> this next-state name) 'race-waiting)) + (logtest? (-> this v-flags) (vehicle-flag riding)) + ) + ) + (('repair) + (let ((f0-0 (the-as float (-> arg3 param 0))) + (f1-0 (-> this hit-points)) + ) + (if (< 0.0 f1-0) + (set! (-> this hit-points) (fmin 1.0 (+ f1-0 f0-0))) + ) + ) + ) + (('touched) + (when (zero? (-> (the-as process-drawable arg0) rbody)) + (let* ((s5-0 arg0) + (v1-10 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when (and v1-10 + (logtest? (-> v1-10 mask) (process-mask target)) + (logtest? (vehicle-flag waiting-for-player) (-> this v-flags)) + (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + ) + (logior! (-> this v-flags) (vehicle-flag player-touching)) + (set! v0-0 (current-time)) + (set! (-> this player-touch-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + (('begin-race) + (-> arg3 param 0) + (wvehicle-method-197 this) + (logclear! (-> this focus-status) (focus-status grabbed)) + (when (and (-> this next-state) (= (-> this next-state name) 'race-waiting)) + (cond + ((logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag player-grabbed)) + (go (method-of-object this player-control)) + ) + (else + (go (method-of-object this race-racing)) + ) + ) + ) + ) + (('turbo-pickup) + (when (< (-> this turbo-supply) 3.0) + (sound-play "turbo-pickup") + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (sound-play "turbo-pickup") + ) + (+! (-> this turbo-supply) 1.0) + (set! (-> this turbo-supply) (fmin 3.0 (-> this turbo-supply))) + (let ((v1-47 (-> this draw color-emissive))) + (set! (-> v1-47 x) 2.0) + ) + ) + #t + ) + (('race-decision-point) + (when (logtest? (vehicle-flag ai-driving) (-> this v-flags)) + (let* ((v1-51 (the-as race-decision-point (-> arg3 param 0))) + (a0-25 (-> v1-51 decision-type)) + ) + (cond + ((zero? a0-25) + (cond + ((and (nonzero? (-> v1-51 shortcuts)) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) + (< 0.1 (- (+ (-> this race state target-pos) (-> this race racer-state target-pos-offset)) + (-> this race racer-state pos) + ) + ) + ) + (wvehicle-method-180 this (-> v1-51 shortcuts)) + (set! (-> this shortcut-time) (the-as uint (current-time))) + (set! (-> this shortcut-speed-factor) 1.0) + ) + (else + (wvehicle-method-180 this (-> v1-51 safe-paths)) + (set! (-> this shortcut-speed-factor) 0.0) + ) + ) + ) + ((= a0-25 1) + (when (and (>= (-> this turbo-supply) 1.0) + (< (-> this path-deviation) 1.0) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) + ) + (apply-momentum! this) + (vehicle-method-64 this) + ) + ) + ) + ) + ) + ) + (('hide) + (logior! (-> this draw status) (draw-control-status no-draw)) + (dotimes (s5-3 (-> this info physics-model wheel-count)) + (send-event (handle->process (-> this wheel s5-3 handle)) 'hide) + ) + (let ((gp-1 (-> this child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'hide) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + #f + ) + (('unhide) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (dotimes (s5-4 (-> this info physics-model wheel-count)) + (send-event (handle->process (-> this wheel s5-4 handle)) 'unhide) + ) + (let ((gp-2 (-> this child))) + (while gp-2 + (send-event (ppointer->process gp-2) 'unhide) + (set! gp-2 (-> gp-2 0 brother)) + ) + ) + #f + ) + (('race-pass) + (send-event (the-as process-tree (vehicle-method-68 this)) 'race-pass) + ) + (('race-got-passed) + (send-event (the-as process-tree (vehicle-method-68 this)) 'race-got-passed) + ) + (('race-finished) + (-> arg3 param 0) + (cond + ((logtest? (vehicle-flag player-driving) (-> this v-flags)) + (set! (-> this damage-factor) 0.0) + (set! v0-0 (method-of-object this wvehicle-method-177)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-0)) + v0-0 + ) + (else + (go (method-of-object this race-finished)) + ) + ) + ) + (('race-deactivate) + (set! (-> this damage-factor) (-> this info damage inv-hit-points)) + (set! (-> this race path) #f) + (cond + ((logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag player-grabbed)) + (set! v0-0 (method-of-object this control-hook-player)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-0)) + v0-0 + ) + (else + (go (method-of-object this die)) + ) + ) + ) + (('set-control-hook-race-ai) + (set! v0-0 (method-of-object this wvehicle-method-177)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-0)) + v0-0 + ) + (('ai-set-target-speed) + (let ((f0-18 (the-as float (-> arg3 param 0)))) + (set! (-> this ai-min-speed) f0-18) + (set! (-> this ai-max-speed) f0-18) + f0-18 + ) + ) + (('ai-set-target-process) + (let* ((s5-7 (-> arg3 param 0)) + (a0-77 (if (type? s5-7 process-drawable) + s5-7 + ) + ) + ) + (cond + ((the-as uint a0-77) + (set! v0-0 (process->handle (the-as uint a0-77))) + (set! (-> this target-status handle) (the-as handle v0-0)) + v0-0 + ) + (else + (set! (-> this target-status handle) (the-as handle #f)) + #f + ) + ) + ) + ) + (('ai-set-target-position) + (let ((v1-138 (the-as object (-> arg3 param 0)))) + (set! (-> this ai-state) (the-as uint 2)) + (set! v0-0 (-> this ai-target-point)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-138) quad)) + ) + v0-0 + ) + (('ai-set-mode) + (set! v0-0 (-> arg3 param 0)) + (set! (-> this ai-state) (the-as uint v0-0)) + v0-0 + ) + (('ai-drop-off) + (let ((v1-140 (the-as object (-> arg3 param 0)))) + (set! (-> this other-pos quad) (-> (the-as wvehicle-ai-drop-off-params v1-140) dest quad)) + (set! (-> this other-proc) (process->handle (-> (the-as wvehicle-ai-drop-off-params v1-140) proc))) + ) + (set! v0-0 (logior (vehicle-flag vf53) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + v0-0 + ) + (('ai-ignore-nav-mesh) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (vehicle-flag vf52) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> this v-flags) (vehicle-flag vf52))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + ) + ) + v0-0 + ) + (('ai-set-inaccuracy-factor) + (let* ((a0-95 this) + (t9-23 (method-of-object a0-95 wvehicle-method-202)) + ) + (-> arg3 param 0) + (t9-23 a0-95) + ) + ) + (('ai-set-attack-delay-factor) + (let* ((a0-97 this) + (t9-24 (method-of-object a0-97 wvehicle-method-201)) + ) + (-> arg3 param 0) + (t9-24 a0-97) + ) + ) + (('go-player-control) + (go (method-of-object this player-control)) + ) + (('set-rigid-body-info) + (set! (-> this info) (the-as rigid-body-vehicle-constants (-> arg3 param 0))) + (rigid-body-object-method-37 this) + ) + (('no-pickup) + (set! v0-0 (logior (vehicle-flag vf55) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + v0-0 + ) + (else + ((method-of-type vehicle rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod vehicle-method-119 ((this wvehicle)) + (cond + ((and (logtest? (-> this v-flags) (vehicle-flag player-grabbed)) (-> this race path)) + (wvehicle-method-185 this) + ) + (else + (let ((t9-1 (method-of-type vehicle vehicle-method-119))) + (t9-1 this) + ) + ) + ) + (if (logtest? (game-secrets unlimited-turbos) (-> *game-info* secrets)) + (set! (-> this turbo-supply) 3.0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-118 ((this wvehicle)) + (when (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) + (if (handle->process (-> this wheel 0 tread-tracker)) + (wvehicle-method-196 this) + ) + ) + (cond + ((have-vehicle-v-type? (the-as int (-> this info vehicle-type))) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 133) (the-as int #f) (the-as vector #t) 0)) + ) + ) + (else + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + ) + ) + ((method-of-type vehicle vehicle-method-118) this) + (none) + ) diff --git a/goal_src/jak3/levels/forest/forest-obs-h.gc b/goal_src/jak3/levels/forest/forest-obs-h.gc index 1729a4eb65..2e85d74bf3 100644 --- a/goal_src/jak3/levels/forest/forest-obs-h.gc +++ b/goal_src/jak3/levels/forest/forest-obs-h.gc @@ -7,3 +7,37 @@ ;; DECOMP BEGINS +(deftype shaker (structure) + ((axis vector :inline) + (start-time time-frame) + (decay-time float) + (amplitude float) + (freq float) + (y-decay-time float) + (y-amplitude float) + (y-freq float) + (shake float) + (y-shake float) + ) + (:methods + (shaker-method-9 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod shaker-method-9 ((this shaker)) + (let ((s5-0 (- (current-time) (-> this start-time)))) + (set! (-> this shake) (* (-> this amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this freq)))) + ) + ) + (set! (-> this y-shake) (* (-> this y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this y-freq)))) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/mine/gekko.gc b/goal_src/jak3/levels/mine/gekko.gc index e826bea9d5..ce7400ec98 100644 --- a/goal_src/jak3/levels/mine/gekko.gc +++ b/goal_src/jak3/levels/mine/gekko.gc @@ -5,5 +5,2949 @@ ;; name in dgo: gekko ;; dgos: MIA +;; +++gekko-flag +(defenum gekko-flag + :type uint16 + :bitfield #t + (update-foot-position?) + (follow-terrain) + (update-tilt) + (on-wall?) + (falling-off-wall?) + ) +;; ---gekko-flag + + ;; DECOMP BEGINS +(defskelgroup skel-gekko gekko gekko-lod0-jg -1 + ((gekko-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow gekko-shadow-mg + :origin-joint-index 16 + ) + +(deftype gekko-foot-info (structure) + ((ground-pos vector :inline) + (ground-normal vector :inline) + (foot-transform transformq :inline) + (leg-ik joint-mod-ik) + ) + ) + + +(deftype gekko-ik-setup (structure) + ((elbow-index int32) + (hand-index int32) + (effector-index int32) + (hand-dist float) + ) + ) + + +(define *gekko-ik-setup* + (new 'static 'inline-array gekko-ik-setup 4 + (new 'static 'gekko-ik-setup :elbow-index 9 :hand-index 10 :effector-index 10 :hand-dist 1224.704) + (new 'static 'gekko-ik-setup :elbow-index 13 :hand-index 14 :effector-index 14 :hand-dist 1224.704) + (new 'static 'gekko-ik-setup :elbow-index 19 :hand-index 20 :effector-index 20 :hand-dist 1638.4) + (new 'static 'gekko-ik-setup :elbow-index 29 :hand-index 30 :effector-index 30 :hand-dist 1638.4) + ) + ) + +(define *gekko-foot-offset* + (the-as (array gekko-foot-info) (new 'static 'boxed-array :type vector + (new 'static 'vector :x 2281.472 :z 2424.832 :w 1.0) + (new 'static 'vector :x -2281.472 :z 2424.832 :w 1.0) + (new 'static 'vector :x 2301.952 :z -2424.832 :w 1.0) + (new 'static 'vector :x -2301.952 :z -2424.832 :w 1.0) + ) + ) + ) + +(deftype gekko-shadow-spot (structure) + ((position vector :inline) + (normal vector :inline) + (valid? symbol) + (pat uint32) + ) + ) + + +(deftype gekko (nav-enemy) + ((shadow-spot gekko-shadow-spot :inline) + (foot gekko-foot-info 4 :inline) + (rot-matrix matrix :inline) + (gspot-normal vector :inline) + (tilt-quat quaternion :inline) + (dest-to-me-dir vector :inline) + (turn-face-point vector :inline) + (flags gekko-flag) + (attack-time time-frame) + (last-turn-time time-frame) + (fade float) + (rot-mult float) + (move-speed float) + (move-decel float) + (turn-next-state (state gekko)) + (path-wall path-control) + (scared-timer time-frame) + (scale float) + (probe-len float) + ) + (:state-methods + active-wall + hostile-wall + turn-wall + attack-wall + knocked-wall + jump-off-wall + jump-off-wall-falling + jump-off-wall-recover + pre-attack + attack + turn + turn-quick + ) + (:methods + (gekko-method-202 (_type_) none) + (gekko-method-203 (_type_) none) + (gekko-method-204 (_type_) none) + (gekko-method-205 (_type_) none) + (gekko-method-206 (_type_) none) + (gekko-method-207 (_type_) none) + (gekko-method-208 (_type_) none) + ) + ) + + +(define *fact-info-gekko-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 140) :pickup-type 9) + ) + +(define *gekko-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 5 + :param1 5 + :param2 '((new 'static 'bfloat :data 0.5) (new 'static 'bfloat :data 0.5)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 4 + :hostile-anim 14 + :hit-anim 3 + :knocked-anim 23 + :knocked-land-anim 18 + :die-anim 32 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim 33 + :jump-in-air-anim 34 + :jump-land-anim 35 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 16 + :sound-hit (static-sound-name "gekko-get-hit") + :sound-die (static-sound-name "gekko-die") + :notice-distance (meters 80) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 7) + :attack-shove-up (meters 4) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 0.5 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp -1.0 + :knocked-soft-vxz-lo 113049.6 + :knocked-soft-vxz-hi 149094.4 + :knocked-soft-vy-lo 122880.0 + :knocked-soft-vy-hi 163840.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x -0.9169 :y -0.314 :z 0.2441 :w 2358.841) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd jak obstacle player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z -0.0145 :w 18690.63) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0109 :z 0.0086 :w 14092.443) + :axial-slop 426.98523 + :max-angle 1820.4445 + :coll-rad 2079.5393 + :hit-sound (static-sound-name "gekko-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0177 :w 29970.05) + :geo-tform (new 'static 'vector :x 0.9998 :z 0.0088 :w 32808.543) + :axial-slop 426.98523 + :max-angle 1456.3556 + :coll-rad 1224.2944 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0185 :w 31347.709) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0016 :z 0.0092 :w 28653.906) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1338.9824 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0186 :w 6233.548) + :geo-tform (new 'static 'vector :x -0.9994 :y -0.0202 :z -0.0091 :w 8968.311) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1183.3344 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2363 :y -0.0265 :z -0.971 :w 16298.385) + :geo-tform (new 'static 'vector :x 0.7523 :y 0.6222 :z -0.2161 :w 22609.957) + :axial-slop 426.98523 + :max-angle 3640.889 + :coll-rad 1150.5664 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9842 :y 0.081 :z 0.1544 :w 6309.4785) + :geo-tform (new 'static 'vector :x -0.6984 :y 0.5454 :z 0.4627 :w 18388.328) + :axial-slop 426.98523 + :max-angle 4619.2505 + :coll-rad 1282.4576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3794 :y -0.0126 :z 0.925 :w 14670.799) + :geo-tform (new 'static 'vector :x -0.2831 :y 0.9394 :z 0.1922 :w 13051.641) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1127.2192 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3743 :y -0.0189 :z 0.9269 :w 4210.943) + :geo-tform (new 'static 'vector :x 0.8507 :y -0.4889 :z -0.1902 :w 19701.232) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 1333.248 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.3447 :y 0.1703 :z 0.9229 :w 16305.849) + :geo-tform (new 'static 'vector :x 0.7264 :y -0.5892 :z 0.3528 :w 20835.006) + :axial-slop 426.98523 + :max-angle 3640.889 + :coll-rad 1124.352 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9835 :y -0.1776 :z 0.0185 :w 3334.3625) + :geo-tform (new 'static 'vector :x -0.6955 :y -0.5474 :z -0.4643 :w 18426.193) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1088.3073 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3701 :y 0.0165 :z -0.9283 :w 14670.671) + :geo-tform (new 'static 'vector :x -0.2795 :y -0.9402 :z -0.1922 :w 13170.697) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1053.4912 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3607 :y 0.023 :z -0.932 :w 4213.7646) + :geo-tform (new 'static 'vector :x -0.8814 :y -0.119 :z 0.456 :w 16534.57) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 1327.104 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.9993 :y -0.005 :z -0.0354 :w 5877.141) + :geo-tform (new 'static 'vector :x -0.9998 :y -0.0126 :z -0.0087 :w 12748.154) + :axial-slop 426.98523 + :max-angle 1367.4814 + :coll-rad 1144.832 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9994 :z -0.0227 :w 17.585493) + :geo-tform (new 'static 'vector :x -0.9998 :y -0.0126 :z -0.0087 :w 12762.499) + :axial-slop 426.98523 + :max-angle 1537.784 + :coll-rad 1164.0833 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.514 :y 0.0096 :z -0.8572 :w 14720.624) + :geo-tform (new 'static 'vector :x -0.9145 :y -0.3788 :z 0.1386 :w 11441.111) + :axial-slop 426.98523 + :max-angle 2730.6667 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9968 :y 0.0073 :z 0.075 :w 8037.281) + :geo-tform (new 'static 'vector :x 0.7911 :y -0.1717 :z 0.5867 :w 14446.993) + :axial-slop 426.98523 + :max-angle 3665.7927 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7222 :y 0.0125 :z 0.6908 :w 14193.806) + :geo-tform (new 'static 'vector :x -0.9861 :y -0.1063 :z -0.1272 :w 19499.127) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9636 :y 0.0018 :z -0.2657 :w 19342.15) + :geo-tform (new 'static 'vector :x 0.3582 :y -0.8755 :z -0.3234 :w 7445.891) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9163 :y -0.0016 :z -0.3995 :w 3475.2285) + :geo-tform (new 'static 'vector :x -0.8003 :y -0.5296 :z -0.2795 :w 11328.59) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1264.8448 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.9998 :y 0.0016 :z 0.0099 :w 1182.9977) + :geo-tform (new 'static 'vector :x 0.9958 :y -0.0876 :z 0.0087 :w 2150.4365) + :axial-slop 426.98523 + :max-angle 1456.3556 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :y -0.0055 :z 0.0172 :w 2143.81) + :geo-tform (new 'static 'vector :x -0.0003 :y -1.0 :w 177.23846) + :axial-slop 426.98523 + :max-angle 2002.4889 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4534 :y -0.8907 :z -0.0071 :w 14.345102) + :geo-tform (new 'static 'vector :y -1.0 :w 167.15321) + :axial-slop 426.98523 + :max-angle 2730.6667 + :coll-rad 638.5664 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0309) + :geo-tform (new 'static 'vector :x -0.0002 :y -1.0 :w 167.15321) + :axial-slop 426.98523 + :max-angle 3458.8445 + :coll-rad 526.7456 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0309) + :geo-tform (new 'static 'vector :x -0.0003 :y -0.9998 :w 167.15321) + :axial-slop 426.98523 + :max-angle 4187.0225 + :coll-rad 355.5328 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.5197 :y 0.0089 :z 0.8538 :w 14715.818) + :geo-tform (new 'static 'vector :x -0.921 :y 0.3571 :z -0.1527 :w 11310.513) + :axial-slop 426.98523 + :max-angle 3640.889 + :coll-rad 935.936 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9975 :y 0.0082 :z -0.0651 :w 8052.2993) + :geo-tform (new 'static 'vector :x 0.8026 :y 0.1536 :z -0.5763 :w 14394.364) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7269 :y 0.0057 :z -0.6861 :w 14192.44) + :geo-tform (new 'static 'vector :x -0.9887 :y 0.0952 :z 0.1121 :w 19467.068) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9719 :y -0.0073 :z 0.2335 :w 19440.309) + :geo-tform (new 'static 'vector :x 0.3657 :y 0.866 :z 0.3398 :w 7188.9897) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9024 :y 0.0007 :z 0.4302 :w 3461.2112) + :geo-tform (new 'static 'vector :x -0.8144 :y 0.5124 :z 0.2716 :w 11174.926) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1215.2832 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.6151 :y -0.6097 :z -0.4993 :w 12937.025) + :geo-tform (new 'static 'vector :x -0.0868 :y -0.921 :z -0.3792 :w 8346.01) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 650.4448 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.921 :y 0.1397 :z -0.3634 :w 2869.6938) + :geo-tform (new 'static 'vector :x -0.319 :y -0.9406 :z -0.1124 :w 8966.345) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 489.8816 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.7723 :y 0.6006 :z -0.2057 :w 11225.279) + :geo-tform (new 'static 'vector :x 0.0707 :y 0.9922 :z -0.0988 :w 20417.65) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 575.0784 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3531 :y -0.0993 :z -0.9298 :w 2126.9346) + :geo-tform (new 'static 'vector :y 0.9937 :z 0.1082 :w 35917.625) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 545.9968 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.9417 :y 0.2245 :z 0.2487 :w 15554.733) + :geo-tform (new 'static 'vector :x 0.07 :y 0.9965 :z 0.0389 :w 36169.848) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 541.4912 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3319 :y -0.0751 :z -0.9401 :w 1665.7977) + :geo-tform (new 'static 'vector :x 0.3686 :y 0.9253 :z -0.0855 :w 33224.6) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 489.0624 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.9477 :y -0.2105 :z -0.239 :w 14735.951) + :geo-tform (new 'static 'vector :x 0.477 :y 0.0276 :z 0.8779 :w 34298.176) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 596.7872 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1272 :y 0.0794 :z 0.9883 :w 1645.9913) + :geo-tform (new 'static 'vector :x 0.5577 :y 0.3476 :z 0.7531 :w 36094.316) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 496.4352 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.7784 :y -0.6029 :z 0.1728 :w 8814.884) + :geo-tform (new 'static 'vector :x -0.3 :y 0.025 :z 0.9532 :w 34750.32) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 620.9536 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5386 :y 0.0881 :z 0.8378 :w 2062.2178) + :geo-tform (new 'static 'vector :x -0.2608 :y -0.1063 :z 0.9592 :w 33021.97) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 600.064 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint 14 + :pre-tform (new 'static 'vector :x -0.6597 :y 0.605 :z 0.4453 :w 10974.531) + :geo-tform (new 'static 'vector :x 0.8782 :y 0.1516 :z -0.4526 :w 32356.781) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 614.4 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9724 :y -0.131 :z 0.1908 :w 2849.3416) + :geo-tform (new 'static 'vector :x 0.8708 :y 0.0597 :z -0.4875 :w 30132.617) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 458.752 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 14) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 60) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 30) + :maximum-rotation-rate (degrees 450) + :notice-nav-radius (meters 40) + :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! (-> *gekko-nav-enemy-info* fact-defaults) *fact-info-gekko-defaults*) + +(defmethod init-enemy-collision! ((this gekko)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle 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 4915.2 0.0 12288.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-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.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 enemy)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3276.8) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core action) (collide-action solid deadly)) + (set! (-> v1-19 transform-index) 6) + (set-vector! (-> v1-19 local-sphere) 0.0 -819.2 1638.4 1638.4) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 16) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 1638.4) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 24) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 1228.8) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core action) (collide-action solid deadly)) + (set! (-> v1-25 transform-index) 10) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 1228.8) + ) + (set-vector! + (-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere) + 0.0 + 4096.0 + 0.0 + 8192.0 + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-29 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-29 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-29 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defstate idle (gekko) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy idle) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (logclear! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + ) + ) + ) + +(defstate active-wall (gekko) + :virtual #t + :enter (behavior () + ((-> (method-of-type nav-enemy active) enter)) + (let ((v1-3 (-> self draw shadow-ctrl))) + (logclear! (-> v1-3 settings flags) (shadow-flags disable-draw)) + ) + 0 + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + ) + :trans (-> (method-of-type nav-enemy active) trans) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! gekko-wall-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate notice (gekko) + :virtual #t + :enter (behavior () + (set! (-> self attack-time) (+ (current-time) (seconds -3.5))) + (set! (-> self last-turn-time) (+ (current-time) (seconds -100))) + (if (logtest? (-> self flags) (gekko-flag on-wall?)) + (gekko-method-206 self) + (go-virtual hostile) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior hostile-wall-trans gekko () + (local-vars (gp-2 vector) (f0-0 float)) + (if (rnd-chance? self 0.75) + (sound-play "gekko-slither") + ) + (cond + ((and (time-elapsed? (-> self attack-time) (seconds 3)) + (and (get-focus! self) + (begin + (set! gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + (set! f0-0 (vector-length gp-2)) + (< f0-0 163840.0) + ) + (or (< 20480.0 f0-0) (not (logtest? (-> self flags) (gekko-flag on-wall?)))) + (< (vector-dot + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) gp-2 1.0) + ) + (cos 30.0) + ) + ) + ) + (gekko-method-207 self) + ) + ((or (< (vector-vector-planar-distance (-> self root trans) (-> self move-dest) (-> self rot-matrix uvec)) 8192.0) + (or (< (vector-dot + (-> self dest-to-me-dir) + (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self move-dest)) + ) + 0.0 + ) + (time-elapsed? (-> self state-time) (seconds 5)) + ) + ) + (gekko-method-206 self) + ) + ((and (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 61440.0) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (and (closest-point-on-mesh (-> self nav) gp-3 (-> self focus-pos) (the-as nav-poly #f)) + (< (vector-vector-xz-distance gp-3 (-> self focus-pos)) 409.6) + ) + ) + ) + (go-virtual jump-off-wall) + ) + ) + (none) + ) + +(defstate hostile-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (set-time! (-> self state-time)) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + (set-look-at-mode! self 2) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.017)) + (let ((f30-0 (/ 1.0 (-> self scale)))) + (until #f + (hostile-wall-trans) + (ja-no-eval :group! gekko-wall-run0-a-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (hostile-wall-trans) + (ja-no-eval :group! gekko-wall-run0-b-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((gp-0 (-> self root))) + (vector-normalize-copy! + (-> gp-0 transv) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat)) + 40960.0 + ) + (vector-v++! (-> gp-0 trans) (-> gp-0 transv)) + ) + (nav-enemy-simple-post) + ) + ) + +(defstate turn-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + ) + :exit (behavior () + (set-time! (-> self last-turn-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (when (!= (-> self turn-next-state) (method-of-type gekko attack-wall)) + (set-look-at-mode! self 1) + (let* ((v1-7 (ja-group)) + (gp-0 (if (and v1-7 (= v1-7 gekko-wall-run0-a-ja)) + 25 + 24 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (dotimes (s5-0 (if (time-elapsed? (-> self last-turn-time) (seconds 1)) + 1 + 6 + ) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + ) + ) + (set-look-at-mode! self 2) + (let* ((f0-8 (vector-dot + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (vector-negate! (new 'stack-no-clear 'vector) (-> self dest-to-me-dir)) + ) + (-> self rot-matrix uvec) + ) + ) + (gp-3 (if (< f0-8 0.0) + 8 + 9 + ) + ) + ) + (set! (-> self rot-mult) (if (< f0-8 0.0) + 1.0 + -1.0 + ) + ) + (let ((v1-47 self)) + (set! (-> v1-47 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-47 enemy-flags)))) + ) + 0 + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (if (rnd-chance? self 0.75) + (sound-play "gekko-slither") + ) + (ja-channel-push! 1 (seconds 0.017)) + (ja-no-eval :group! (-> self draw art-group data gp-3) :num! (loop!) :frame-num 0.0) + ) + (until (enemy-method-104 self (-> self turn-face-point) 910.2222) + (suspend) + (ja :num! (loop!)) + ) + (go (-> self turn-next-state)) + ) + :post (behavior () + (let ((a0-0 self)) + (if (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (quaternion-rotate-local-y! + (-> self root quat) + (-> self root quat) + (* -81920.0 (seconds-per-frame) (-> self rot-mult)) + ) + ) + ) + (vector-float*! (-> self root transv) (-> self root transv) 0.6) + (vector-v++! (-> self root trans) (-> self root transv)) + (nav-enemy-simple-post) + ) + ) + +(defstate attack-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + (set-look-at-mode! self 1) + ) + :exit (behavior () + (set-time! (-> self attack-time)) + ) + :code (behavior () + (let* ((v1-2 (ja-group)) + (gp-0 (if (and v1-2 (= v1-2 gekko-wall-run0-a-ja)) + 25 + 24 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((s5-0 (current-time)) + (s4-0 150) + (f30-0 0.5) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? s5-0 s4-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gekko-lod0-jg head))) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 quad) (-> self focus-pos quad)) + (set! (-> s4-1 y) (- (-> s4-1 y) (* 4096.0 (rnd-float-range self 0.0 10.0)))) + (sound-play "gekko-shot") + (spawn-metalhead-projectile (the-as metalhead-shot self) s5-1 s4-1 532480.0) + ) + (logclear! (-> self flags) (gekko-flag update-foot-position?)) + (ja-channel-push! 1 1) + (ja-no-eval :group! gekko-wall-shoot0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.06)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (dotimes (s5-2 2) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + ) + (gekko-method-206 self) + ) + :post (behavior () + (seek! (-> self fade) 1.0 (seconds-per-frame)) + (set! (-> self draw force-fade) (the-as uint (the int (-> self fade)))) + (nav-enemy-simple-post) + ) + ) + +(defstate knocked-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy knocked) enter)) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position? falling-off-wall?)) + (set! (-> self probe-len) 18432.0) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self flags) (gekko-flag falling-off-wall?)) + ) + :trans (behavior () + ((-> (method-of-type nav-enemy knocked) trans)) + (let ((a1-1 (quaternion-from-two-vectors-max-angle! + (new 'stack-no-clear 'quaternion) + (-> self rot-matrix uvec) + *y-vector* + (* 49152.0 (seconds-per-frame)) + ) + ) + (v1-4 (-> self root)) + ) + (quaternion*! (-> v1-4 quat) a1-1 (-> v1-4 quat)) + ) + ) + :code (-> (method-of-type nav-enemy knocked) code) + :post (behavior () + ((the-as (function none) (-> (method-of-type nav-enemy knocked) post))) + 0 + ) + ) + +(defstate jump-off-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (stop-look-at! self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self mask) (process-mask actor-pause)) + (let* ((v1-8 *game-info*) + (a0-4 (+ (-> v1-8 attack-id) 1)) + ) + (set! (-> v1-8 attack-id) a0-4) + (set! (-> self attack-id) a0-4) + ) + (set! (-> self root penetrate-using) (penetrate lunge vehicle knocked)) + (logclear! (-> self root status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> self root root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-20 (-> self root dynam gravity-normal))) + (set! (-> self root local-normal quad) (-> v1-20 quad)) + (set! (-> self root surface-normal quad) (-> v1-20 quad)) + (set! (-> self root poly-normal quad) (-> v1-20 quad)) + ) + (set! (-> self root coverage) 0.0) + (set! (-> self root touch-angle) 0.0) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (enemy-method-50 self 3) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (set! (-> self probe-len) 18432.0) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gekko-jump-to-ground-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual jump-off-wall-falling) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate jump-off-wall-falling (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans)))) + (set! (-> v1-1 y) 0.0) + (vector-float*! (-> self root transv) v1-1 1.5) + ) + (set-time! (-> self state-time)) + ) + :trans #f + :code (behavior () + (local-vars (s4-0 collide-shape-moving)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gekko-jump-to-ground-in-air-ja :num! (seek!)) + (let ((gp-0 0) + (s5-0 0) + ) + (until (or (>= gp-0 3) + (and (logtest? (-> s4-0 status) (collide-status on-ground)) (>= 16384.0 (-> s4-0 transv y))) + (and (>= s5-0 3) + (let ((f0-7 40.96)) + (>= (* f0-7 f0-7) (vector-vector-distance-squared (-> s4-0 trans-old) (-> s4-0 trans-old-old))) + ) + (let ((f0-10 40.96)) + (>= (* f0-10 f0-10) (vector-vector-distance-squared (-> s4-0 trans-old-old) (-> s4-0 trans-old-old-old))) + ) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 2)) + (go-die self) + ) + (if (logtest? (-> self root status) (collide-status on-surface)) + (+! gp-0 1) + ) + (suspend) + (ja :num! (seek!)) + (+! s5-0 1) + (set! s4-0 (-> self root)) + ) + ) + (go-virtual jump-off-wall-recover) + ) + :post (behavior () + (let ((a1-1 (quaternion-from-two-vectors-max-angle! + (new 'stack-no-clear 'quaternion) + (-> self rot-matrix uvec) + *y-vector* + (* 49152.0 (seconds-per-frame)) + ) + ) + (v1-2 (-> self root)) + ) + (quaternion*! (-> v1-2 quat) a1-1 (-> v1-2 quat)) + ) + (nav-enemy-falling-post) + ) + ) + +(defstate jump-off-wall-recover (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (gekko-method-208 self) + (set! (-> self root penetrate-using) (penetrate)) + 0 + ) + :exit (behavior () + (local-vars (v1-9 enemy-flag) (v1-11 enemy-flag) (v1-13 enemy-flag)) + (enemy-method-50 self 0) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-8 (-> self enemy-flags))) + (if (logtest? v1-8 (enemy-flag vulnerable-backup)) + (set! v1-9 (logior v1-8 (enemy-flag vulnerable))) + (set! v1-9 (logclear v1-8 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-9) + (let ((v1-10 (-> self enemy-flags))) + (if (logtest? v1-10 (enemy-flag attackable-backup)) + (set! v1-11 (logior v1-10 (enemy-flag attackable))) + (set! v1-11 (logclear v1-10 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-11) + (let ((v1-12 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-12) + (set! v1-13 (logior (enemy-flag trackable) v1-12)) + (set! v1-13 (logclear v1-12 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-13) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) (within-gspot-range? self)) + (go-die self) + ) + ) + :code (behavior () + (ja-channel-set! 1) + (ja-no-eval :group! gekko-jump-to-ground-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (gp-0 2) + (ja-no-eval :group! gekko-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-best-state self) + ) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate active (gekko) + :virtual #t + :enter (behavior () + (if (logtest? (-> self flags) (gekko-flag on-wall?)) + (go-virtual active-wall) + ) + (let ((t9-1 (-> (method-of-type nav-enemy active) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (until #f + (let* ((f30-1 (* 0.5 (rnd-float-range self 0.9 1.1))) + (v1-5 (ja-group)) + (s5-0 (if (and v1-5 (= v1-5 gekko-run0-a-ja)) + 25 + 24 + ) + ) + (s4-0 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (nav-enemy-method-164 self) + (let ((a1-2 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-2 target-pos quad)) + ) + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-13 nav callback-info) *null-nav-callback-info*) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (s3-0 s4-0) + (ja-no-eval :group! (-> self draw art-group data s5-0) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (logclear! (-> self flags) (gekko-flag update-foot-position?)) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (when (not (enemy-method-104 self gp-0 8192.0)) + (let ((v1-48 self)) + (set! (-> v1-48 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-48 enemy-flags)))) + ) + 0 + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (ja-channel-push! 1 (seconds 0.06)) + (let ((a0-26 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (v1-54 (vector-! (new 'stack-no-clear 'vector) gp-0 (-> self root trans))) + (f30-2 0.5) + (f28-0 1.0) + ) + (cond + ((< 0.0 (vector-dot a0-26 v1-54)) + (ja-no-eval :group! gekko-turn-left0-ja :num! (loop! f30-2) :frame-num 0.0) + ) + (else + (ja-no-eval :group! gekko-turn-right0-ja :num! (loop! f30-2) :frame-num 0.0) + (set! f28-0 (* -1.0 f28-0)) + ) + ) + (until (enemy-method-104 self gp-0 6371.5557) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* -81920.0 (seconds-per-frame) f28-0)) + (suspend) + (ja :num! (loop! f30-2)) + ) + ) + ) + ) + (let* ((v1-86 (ja-group)) + (gp-1 (if (and v1-86 (= v1-86 gekko-idle0-ja)) + 14 + 15 + ) + ) + (v1-91 (ja-group)) + (s5-1 (if (and v1-91 (= v1-91 gekko-idle0-ja)) + 15 + 14 + ) + ) + (s4-1 (set-reaction-time! self (seconds 0.017) (seconds 0.027))) + ) + (let ((v1-95 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-95 enemy-flags))) + (set! (-> v1-95 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-95 enemy-flags)))) + ) + (set! (-> v1-95 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-95 enemy-flags)))) + (set! (-> v1-95 nav callback-info) (-> v1-95 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-3 (/ 0.5 (-> self scale)))) + (dotimes (s3-1 s4-1) + (ja-no-eval :group! (-> self draw art-group data gp-1) :num! (seek! max f30-3) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-3)) + ) + (ja-no-eval :group! (-> self draw art-group data s5-1) :num! (seek! max f30-3) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-3)) + ) + ) + ) + ) + ) + #f + ) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior gekko-stare-code gekko () + (let* ((f30-1 (* 0.5 (rnd-float-range self 0.9 1.1))) + (v1-5 (ja-group)) + (gp-0 (if (and v1-5 (= v1-5 gekko-run0-a-ja)) + 25 + 24 + ) + ) + ) + (until #f + (cond + ((enemy-method-104 self (-> self focus-pos) 8192.0) + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-14 (ja-group))) + (if (not (and v1-14 (= v1-14 (-> self draw art-group data gp-0)))) + (ja-channel-push! 1 (seconds 0.12)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (logclear! (-> self flags) (gekko-flag update-foot-position?)) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ((or (enemy-method-104 self (-> self focus-pos) 30947.555) (rnd-chance? self 0.3)) + (let ((v1-50 self)) + (set! (-> v1-50 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-50 enemy-flags)))) + ) + 0 + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (ja-channel-push! 1 (seconds 0.06)) + (let ((a0-28 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (v1-56 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + (f28-0 0.5) + ) + (if (< 0.0 (vector-dot a0-28 v1-56)) + (ja-no-eval :group! gekko-turn-left0-ja :num! (loop! f28-0) :frame-num 0.0) + (ja-no-eval :group! gekko-turn-right0-ja :num! (loop! f28-0) :frame-num 0.0) + ) + (until (enemy-method-104 self (-> self focus-pos) 6371.5557) + (suspend) + (ja :num! (loop! f28-0)) + ) + ) + ) + (else + (go-virtual turn-quick) + ) + ) + ) + ) + #f + (none) + ) + +(defstate stare (gekko) + :virtual #t + :code gekko-stare-code + ) + +(defstate flee (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy flee) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.015)) + (until #f + (let ((f30-0 (/ (rnd-float-range self 0.9 1.1) (-> self scale)))) + (ja-no-eval :group! gekko-run0-a-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! gekko-run0-b-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate hostile (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (until #f + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! gekko-run0-a-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (gekko-method-203 self) + (ja-no-eval :group! gekko-run0-b-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (gekko-method-203 self) + ) + #f + ) + :post (behavior () + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self focus-pos))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 y) 0.0) + (vector-xz-normalize! s4-1 24576.0) + (vector+! gp-0 (-> self focus-pos) s4-1) + (set! (-> s5-0 quad) (-> gp-0 quad)) + (closest-point-on-mesh (-> self nav) s5-0 gp-0 (the-as nav-poly #f)) + (set! (-> self move-dest quad) (-> s5-0 quad)) + ) + (let ((v1-8 (-> self nav state))) + (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + ) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +(defstate pre-attack (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self move-speed) (vector-length (-> self root transv))) + (set! (-> self move-decel) (fmax 163840.0 (* 0.00012207031 (-> self move-speed) (-> self move-speed)))) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.3)) + (cond + ((and (get-focus! self) + (enemy-method-104 self (-> self focus-pos) 8192.0) + (let ((f0-0 (vector-vector-distance (-> self root trans) (-> self focus-pos)))) + (< f0-0 40960.0) + (and (< 4096.0 f0-0) (gekko-method-204 self)) + ) + ) + (go-virtual attack) + ) + (else + (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 0.8 2.1))))) + (go-best-state self) + ) + ) + ) + ) + :code gekko-stare-code + :post (behavior () + (seek! (-> self move-speed) 0.0 (* (-> self move-decel) (seconds-per-frame))) + (vector-normalize-copy! + (-> self root transv) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (-> self move-speed) + ) + (vector+! (-> self move-dest) (-> self root trans) (-> self root transv)) + (vector-v++! (-> self root trans) (-> self root transv)) + (nav-enemy-face-focus-post) + ) + ) + +(defstate attack (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (logclear! (-> self flags) (gekko-flag update-foot-position? update-tilt)) + (set-look-at-mode! self 1) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-14 (-> self root root-prim))) + (let ((a0-4 (-> (the-as collide-shape-prim-group v1-14) child 6))) + (set! (-> a0-4 prim-core collide-as) (collide-spec enemy)) + (+! (-> a0-4 local-sphere w) 3276.8) + ) + (+! (-> v1-14 local-sphere w) 6144.0) + ) + (let ((v1-16 self)) + (set! (-> v1-16 enemy-flags) (the-as enemy-flag (logclear (-> v1-16 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-16 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-16 (-> self root root-prim))) + (let ((a0-3 (-> (the-as collide-shape-prim-group v1-16) child 6))) + (set! (-> a0-3 prim-core collide-as) (collide-spec)) + (+! (-> a0-3 local-sphere w) -3276.8) + ) + (+! (-> v1-16 local-sphere w) -6144.0) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gekko-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-24 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-24 enemy-flags))) + (set! (-> v1-24 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-24 enemy-flags)))) + ) + (set! (-> v1-24 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-24 enemy-flags)))) + (set! (-> v1-24 nav callback-info) (-> v1-24 enemy-info callback-info)) + ) + 0 + (let ((gp-0 (-> self nav))) + (set! (-> gp-0 target-speed) (lerp-scale + 24576.0 + 110592.0 + (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) + 4096.0 + 24576.0 + ) + ) + ) + 0 + (ja-no-eval :group! gekko-attack0-mid-ja :num! (seek! max (/ 1.0 (-> self scale))) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (/ 1.0 (-> self scale)))) + ) + (nav-enemy-method-177 self) + (let ((v1-55 self)) + (set! (-> v1-55 enemy-flags) (the-as enemy-flag (logclear (-> v1-55 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-55 nav callback-info) *null-nav-callback-info*) + ) + 0 + (set-time! (-> self attack-time)) + (ja-no-eval :group! gekko-attack0-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post nav-enemy-chase-post + ) + +(defstate turn (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (logclear! (-> self flags) (gekko-flag follow-terrain)) + ) + :trans (behavior () + (if (enemy-method-104 self (-> self focus-pos) 2730.6667) + (go-best-state self) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (let ((a0-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (v1-2 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + (f30-0 (/ 1.0 (-> self scale))) + ) + (cond + ((< 0.0 (vector-dot a0-2 v1-2)) + (ja-no-eval :group! gekko-turn-left0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! gekko-turn-right0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + #f + ) + :post nav-enemy-face-focus-post + ) + +(defstate turn-quick (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gekko-turn-hop0-ja :num! (seek! max (/ 1.0 (-> self scale))) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* 98304.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max (/ 1.0 (-> self scale)))) + ) + (ja-no-eval :group! gekko-turn-hop0-land-ja :num! (seek! max (/ 1.0 (-> self scale))) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (/ 1.0 (-> self scale)))) + ) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +(defstate jump (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position? falling-off-wall?)) + ) + ) + +(defstate knocked (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (set! (-> self probe-len) 18432.0) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (set-vector! + (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll gravity-target) + 0.0 + -1.5 + 0.0 + 1.0 + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + 0 + ) + ) + +(defstate knocked-recover (gekko) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) exit))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + ) + :code (behavior () + (gekko-method-208 self) + (ja-channel-push! 1 (seconds 0.4)) + (ja-no-eval :group! gekko-run0-a-ja :num! (seek!) :frame-num 0.0) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.4)) + (suspend) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + +;; WARN: Return type mismatch matrix vs none. +(defun gekko-foot-rot-handler ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (-> arg0 param2))) + (cspace<-transformq! arg0 (the-as transformq (&-> (the-as gekko v1-0) pool))) + ) + (none) + ) + +(defun gekko-postbind ((arg0 draw-control) (arg1 cspace-array)) + (local-vars + (sv-560 float) + (sv-640 vector) + (sv-688 float) + (sv-692 vector) + (sv-696 vector) + (sv-976 cspace) + (sv-980 gekko-foot-info) + (sv-984 vector) + (sv-988 vector) + (sv-992 (function vector vector vector vector float)) + (sv-1008 vector) + (sv-1024 vector) + (sv-1040 vector) + (sv-1056 joint-mod-ik) + (sv-1072 vector) + (sv-1088 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as gekko (-> arg0 process)))) + (let ((s3-0 (-> gp-0 root))) + (let ((s2-0 (new 'stack-no-clear 'collide-query)) + (f30-0 (-> gp-0 probe-len)) + ) + (set! sv-560 (the-as float 2048.0)) + (quaternion->matrix (-> gp-0 rot-matrix) (-> gp-0 root quat)) + (let ((v1-2 1) + (a0-2 (new 'stack-no-clear 'inline-array 'vector 1)) + ) + (set! (-> a0-2 0 quad) (-> s3-0 trans quad)) + (set! (-> a0-2 0 w) + (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* 0.25 f30-0 f30-0)))) + ) + (let ((a1-6 s2-0)) + (set! (-> a1-6 best-dist) (the-as float a0-2)) + (set! (-> a1-6 best-other-prim) (the-as collide-shape-prim v1-2)) + (set! (-> a1-6 collide-with) (collide-spec backgnd)) + (set! (-> a1-6 ignore-process0) gp-0) + (set! (-> a1-6 ignore-process1) #f) + (set! (-> a1-6 ignore-pat) (-> gp-0 root pat-ignore-mask)) + (set! (-> a1-6 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> a1-6 action-mask) (collide-action solid)) + ) + ) + (fill-using-spheres *collide-cache* s2-0) + (dotimes (s1-0 4) + (let ((s0-0 (-> gp-0 foot s1-0))) + (set! sv-1056 (-> s0-0 leg-ik)) + (set! sv-1008 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg1 data (-> *gekko-ik-setup* s1-0 hand-index))) + ) + (let ((v0-3 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg1 data (-> *gekko-ik-setup* s1-0 effector-index))) + ) + ) + (set! sv-640 (vector-! (new 'stack-no-clear 'vector) v0-3 sv-1008)) + ) + (let ((v1-28 (if (logtest? (-> gp-0 flags) (gekko-flag on-wall?)) + (-> gp-0 rot-matrix uvec) + *y-vector* + ) + ) + ) + (vector+float*! (-> s2-0 start-pos) sv-1008 v1-28 (* 0.5 f30-0)) + (vector-float*! (-> s2-0 move-dist) v1-28 (- f30-0)) + ) + (let ((v1-29 s2-0)) + (set! (-> v1-29 radius) sv-560) + (set! (-> v1-29 collide-with) (collide-spec backgnd)) + (set! (-> v1-29 ignore-process0) #f) + (set! (-> v1-29 ignore-process1) #f) + (set! (-> v1-29 ignore-pat) (-> gp-0 root pat-ignore-mask)) + (set! (-> v1-29 action-mask) (collide-action solid)) + ) + (set! sv-688 (probe-using-line-sphere *collide-cache* s2-0)) + (set! sv-692 (new 'stack-no-clear 'vector)) + (set! sv-696 (new 'stack-no-clear 'vector)) + (cond + ((>= sv-688 0.0) + (let ((v0-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s2-0 move-dist) 1.0))) + (vector+float*! sv-692 (-> s2-0 start-pos) (-> s2-0 move-dist) sv-688) + (vector-! sv-696 sv-692 (-> s2-0 best-other-tri intersect)) + (vector+float*! sv-692 sv-692 v0-5 (-> s2-0 radius)) + ) + (vector-normalize! sv-696 1.0) + ) + (else + (set! (-> sv-692 quad) (-> sv-1008 quad)) + (set! (-> sv-692 y) (-> gp-0 root gspot-pos y)) + (set! (-> sv-696 quad) (-> gp-0 rot-matrix uvec quad)) + ) + ) + (if (logtest? (-> gp-0 flags) (gekko-flag on-wall?)) + (set! (-> s0-0 ground-normal quad) (-> sv-696 quad)) + (set! (-> s0-0 ground-normal quad) (-> *y-vector* quad)) + ) + (when (logtest? (-> gp-0 flags) (gekko-flag update-foot-position?)) + (set! sv-992 intersect-ray-plane) + (let* ((a1-22 (vector-negate! (new 'stack-no-clear 'vector) (-> gp-0 rot-matrix uvec))) + (a2-4 (-> gp-0 root trans)) + (a3-1 (-> gp-0 rot-matrix uvec)) + (f0-13 (sv-992 sv-1008 a1-22 a2-4 a3-1)) + ) + (vector+float*! sv-692 sv-692 (-> s0-0 ground-normal) f0-13) + ) + (vector+! sv-692 sv-692 sv-640) + ) + 0.0 + (let ((f28-0 (* 2457.6 (-> gp-0 scale))) + (v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> gp-0 node-list data 3))) + ) + (set! sv-1024 (new 'stack-no-clear 'vector)) + (set! sv-1040 (new 'stack-no-clear 'vector)) + (vector+float*! v0-9 v0-9 (-> gp-0 rot-matrix uvec) 3072.0) + (let ((f28-1 (+ 3072.0 f28-0))) + (when (< (vector-line-distance-point! + sv-692 + v0-9 + (vector+! (new 'stack-no-clear 'vector) v0-9 (-> gp-0 rot-matrix fvec)) + sv-1024 + ) + f28-1 + ) + (vector-! sv-1040 sv-692 sv-1024) + (vector-normalize! sv-1040 f28-1) + (let ((v1-64 sv-692)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-1024 quad)) + (.lvf vf5 (&-> sv-1040 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-64 quad) vf6) + ) + 0 + ) + ) + ) + (vector-seek! + (-> s0-0 ground-pos) + sv-692 + (* (fmax 61440.0 (* 1.2 (vector-length (-> s3-0 transv)))) (seconds-per-frame)) + ) + (let ((t9-13 (method-of-object sv-1056 set-ik-target!)) + (a1-33 (-> s0-0 ground-pos)) + ) + (t9-13 sv-1056 a1-33) + ) + ) + ) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (vector-reset! s2-1) + (vector-reset! s1-1) + (dotimes (s0-1 4) + (vector+! s2-1 s2-1 (the-as vector (-> gp-0 foot s0-1))) + (when (> s0-1 0) + (set! sv-1072 + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> gp-0 foot s0-1)) (the-as vector (-> gp-0 foot))) + 1.0 + ) + ) + (set! sv-1088 (new 'stack-no-clear 'vector)) + (let ((v1-83 (-> gp-0 rot-matrix uvec)) + (a0-46 sv-1072) + ) + (.lvf vf1 (&-> v1-83 quad)) + (.lvf vf2 (&-> a0-46 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-1088 quad) vf3) + (vector-normalize! sv-1088 1.0) + (let ((a1-41 s1-1) + (v1-85 s1-1) + (a0-48 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> sv-1072 quad)) + (.lvf vf2 (&-> sv-1088 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> a0-48 quad) vf3) + (vector+! a1-41 v1-85 a0-48) + ) + ) + ) + (vector-float*! s2-1 s2-1 0.25) + (vector-normalize-copy! (-> gp-0 gspot-normal) s1-1 1.0) + ) + (when (logtest? (-> gp-0 flags) (gekko-flag follow-terrain)) + (set! (-> gp-0 root gspot-pos quad) (-> s2-1 quad)) + (let ((a2-15 (vector-! (new 'stack-no-clear 'vector) s2-1 (-> s3-0 trans)))) + (vector+float*! + (-> s3-0 trans) + (-> s3-0 trans) + (-> gp-0 rot-matrix uvec) + (* 0.9 (vector-dot a2-15 (-> gp-0 rot-matrix uvec))) + ) + ) + ) + ) + (when (logtest? (-> gp-0 flags) (gekko-flag update-tilt)) + (let ((s2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (a2-18 (quaternion-from-two-vectors-max-angle-partial! + (new 'stack-no-clear 'quaternion) + (-> gp-0 rot-matrix uvec) + (-> gp-0 gspot-normal) + 21845.334 + (* 8.0 (seconds-per-frame)) + ) + ) + (s1-2 (new 'stack-no-clear 'vector)) + ) + (quaternion-slerp! (-> gp-0 tilt-quat) (-> gp-0 tilt-quat) a2-18 1.0) + (vector-orient-by-quat! s1-2 (-> gp-0 rot-matrix uvec) (-> gp-0 tilt-quat)) + (forward-up-nopitch->quaternion (-> s3-0 quat) s2-2 s1-2) + ) + ) + ) + (dotimes (s3-1 4) + (set! sv-976 (-> arg1 data (-> *gekko-ik-setup* s3-1 effector-index))) + (set! sv-980 (the-as gekko-foot-info (+ (the-as uint (-> gp-0 foot 0 foot-transform)) (* 96 s3-1)))) + (set! sv-984 (new 'stack-no-clear 'vector)) + (set! sv-988 (new 'stack-no-clear 'vector)) + (quaternion-from-two-vectors! + (the-as quaternion sv-988) + (-> gp-0 rot-matrix uvec) + (the-as vector (+ (the-as uint (-> gp-0 foot 0 ground-normal)) (* 96 s3-1))) + ) + (vector<-cspace! (-> sv-980 ground-pos) sv-976) + (matrix->quaternion (the-as quaternion sv-984) (-> sv-976 bone transform)) + (quaternion*! + (the-as quaternion (-> sv-980 ground-normal)) + (the-as quaternion sv-988) + (the-as quaternion sv-984) + ) + ) + (logclear! (-> gp-0 skel status) (joint-control-status no-joint-callbacks)) + (draw-control-method-14 arg0 arg1 (-> gp-0 skel)) + (logior! (-> gp-0 skel status) (joint-control-status no-joint-callbacks)) + ) + 0 + 0 + (none) + ) + ) + +(defun gekko-postbind-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control)) + (gekko-postbind arg0 arg1) + (none) + ) + +(defmethod gekko-method-203 ((this gekko)) + ((-> (method-of-type nav-enemy hostile) trans)) + (when (< (vector-vector-xz-distance (-> this root trans) (-> this move-dest)) 8192.0) + (let* ((s5-0 (-> this focus-pos)) + (v1-6 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> this root trans))) + (f30-0 (sqrtf (+ (* (-> v1-6 x) (-> v1-6 x)) (* (-> v1-6 z) (-> v1-6 z))))) + ) + (cond + ((and (get-focus! this) (and (and (< f30-0 32768.0) (< 16384.0 f30-0)) (enemy-method-104 this s5-0 6371.5557))) + (go (method-of-object this pre-attack)) + ) + ((< 32768.0 f30-0) + (cond + ((not (enemy-method-104 this s5-0 29127.111)) + (go (method-of-object this turn-quick)) + ) + ((not (enemy-method-104 this s5-0 6371.5557)) + (go (method-of-object this turn)) + ) + ) + ) + ) + ) + (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 1.3 2.25))))) + (go-best-state this) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod gekko-method-204 ((this gekko)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this root trans quad)) + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) + ) + (when (and s4-0 (< (vector-vector-xz-distance s5-0 s3-0) 4096.0)) + (let* ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) s5-0)) + (f30-0 (vector-length s3-2)) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (vector-float*! s3-2 s3-2 (/ (* 8192.0 (-> this scale)) f30-0)) + (clamp-vector-to-mesh-no-gaps (-> this nav) s5-0 s4-0 s3-2 s2-0) + (not (-> s2-0 found-boundary)) + ) + ) + ) + ) + (none) + ) + +(defmethod is-pfoc-in-mesh? ((this gekko) (arg0 process-focusable) (arg1 vector)) + (if (and arg0 (not arg1)) + (set! arg1 (get-trans arg0 1)) + ) + (when arg1 + (let* ((f0-0 (-> arg1 y)) + (v1-4 (-> this root)) + (f1-0 (-> v1-4 trans y)) + (a0-2 (-> this fact)) + ) + (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) + (let* ((f30-0 (if (logtest? (-> this flags) (gekko-flag on-wall?)) + (-> this enemy-info notice-nav-radius) + 8192.0 + ) + ) + (f0-2 f30-0) + ) + (or (>= (* f0-2 f0-2) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) + (is-in-mesh? (-> this nav) arg1 f30-0) + ) + ) + ) + ) + ) + ) + +(defmethod enemy-method-109 ((this gekko)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) + ) + (do-navigation-to-destination s3-0 (-> gp-0 trans)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ) + (else + (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) + (let ((f0-0 16384.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (-> gp-0 trans))) + ) + (and (and (-> this next-state) (= (-> this next-state name) 'knocked-recover)) + (< (-> gp-0 trans y) (+ -8192.0 (-> s5-0 y))) + (< (+ 12288.0 (-> s5-0 y)) (-> gp-0 trans y)) + ) + ) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +;; WARN: Return type mismatch object vs none. +(defmethod gekko-method-206 ((this gekko)) + (set-look-at-mode! this 2) + (gekko-method-205 this) + (set! (-> this turn-next-state) (method-of-type gekko hostile-wall)) + (go (method-of-object this turn-wall)) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod gekko-method-207 ((this gekko)) + (set-look-at-mode! this 1) + (set! (-> this turn-face-point quad) (-> this focus-pos quad)) + (set! (-> this turn-next-state) (method-of-type gekko attack-wall)) + (go (method-of-object this turn-wall)) + (none) + ) + +(defmethod get-focus! ((this gekko)) + (let* ((t9-0 (method-of-type nav-enemy get-focus!)) + (v0-0 (t9-0 this)) + ) + (cond + ((and v0-0 + (or (logtest? (-> this flags) (gekko-flag on-wall?)) (time-elapsed? (-> this attack-time) (seconds 3))) + ) + (empty) + v0-0 + ) + (else + (the-as process-focusable #f) + ) + ) + ) + ) + +(defmethod gekko-method-205 ((this gekko)) + (cond + ((zero? (-> this path-wall)) + (go process-drawable-art-error "no path-wall") + ) + (else + (let ((s5-0 (-> this path-wall curve num-cverts))) + (if (<= s5-0 0) + (go process-drawable-art-error "no path-wall") + ) + (let ((s2-0 (rnd-int this s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s3-0 s5-0) + (get-point-in-path! (-> this path-wall) s4-0 (the float s2-0) 'interp) + (if (< 8192.0 (vector-vector-xz-distance s4-0 (-> this root trans))) + (goto cfg-11) + ) + (set! s2-0 (mod (+ s2-0 1) s5-0)) + ) + (label cfg-11) + (set! (-> this move-dest quad) (-> s4-0 quad)) + (set! (-> this turn-face-point quad) (-> s4-0 quad)) + ) + ) + (vector-! (-> this dest-to-me-dir) (-> this root trans) (-> this move-dest)) + ) + ) + 0 + (none) + ) + +;; WARN: disable def twice: 33. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod enemy-method-108 ((this gekko) (arg0 process-focusable)) + (or (< (current-time) (-> this scared-timer)) + (let ((v1-4 (handle->process (-> this focus handle)))) + (if v1-4 + (and (or (focus-test? (the-as process-focusable v1-4) disable dead ignore grabbed) + (and (not (logtest? (-> this flags) (gekko-flag on-wall?))) + (not (time-elapsed? (-> this attack-time) (seconds 3))) + ) + ) + (< (vector-vector-distance (-> this focus-pos) (-> this root trans)) 49152.0) + ) + #f + ) + ) + ) + ) + +(defmethod knocked-anim ((this gekko) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 0) + (cond + ((logtest? (-> this flags) (gekko-flag falling-off-wall?)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 29))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 29)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 29)) num-func-seek!) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this gekko) (arg0 enemy-knocked-info)) + (let ((v1-2 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-2 (= v1-2 (-> this draw art-group data 23))) + (let ((v1-7 (-> this skel root-channel 0))) + (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> v1-7 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> v1-7 param 1) (-> arg0 anim-speed)) + (set! (-> v1-7 frame-num) 0.0) + (joint-control-channel-group! v1-7 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + ((= (-> this hit-points) 0.0) + (let ((v1-11 (-> this skel root-channel 0))) + (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) + (set! (-> v1-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 31)) frames num-frames) -1)) + ) + (set! (-> v1-11 param 1) (-> arg0 anim-speed)) + (set! (-> v1-11 frame-num) 0.0) + (joint-control-channel-group! v1-11 (the-as art-joint-anim (-> this draw art-group data 31)) num-func-seek!) + ) + ) + (else + (let ((v1-15 (-> this skel root-channel 0))) + (set! (-> v1-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + (set! (-> v1-15 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) + ) + (set! (-> v1-15 param 1) (-> arg0 anim-speed)) + (set! (-> v1-15 frame-num) 0.0) + (joint-control-channel-group! v1-15 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod go-hostile ((this gekko)) + (if (logtest? (-> this flags) (gekko-flag on-wall?)) + (gekko-method-206 this) + (go (method-of-object this hostile)) + ) + ) + +(defmethod get-knockback-dir! ((this gekko) (arg0 vector)) + (local-vars (v1-2 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (.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-2 vf1) + (when (= v1-2 0.0) + (vector-z-quaternion! arg0 (-> this root quat)) + (vector-negate-in-place! arg0) + ) + (vector-flatten! arg0 arg0 (-> this rot-matrix uvec)) + (vector-normalize! arg0 1.0) + ) + ) + +;; WARN: Return type mismatch vector vs object. +(defmethod knocked-handler ((this gekko) (arg0 vector)) + (get-knockback-dir! this arg0) + (let ((s4-0 (-> this enemy-info)) + (f28-0 0.0) + (f30-0 0.0) + ) + (let ((v1-2 (-> this incoming knocked-type))) + (set! f30-0 (cond + ((= v1-2 (knocked-type explode-or-darkjak)) + (let ((f30-1 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-hard-vxz-lo) (-> s4-0 knocked-hard-vxz-hi) f30-1)) + (lerp (-> s4-0 knocked-hard-vy-lo) (-> s4-0 knocked-hard-vy-hi) f30-1) + ) + ) + ((= v1-2 (knocked-type mech-punch)) + (let ((f30-2 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-medium-vxz-lo) (-> s4-0 knocked-medium-vxz-hi) f30-2)) + (lerp (-> s4-0 knocked-medium-vy-lo) (-> s4-0 knocked-medium-vy-hi) f30-2) + ) + ) + ((= v1-2 (knocked-type dark-shot)) + (let ((f30-3 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-huge-vxz-lo) (-> s4-0 knocked-huge-vxz-hi) f30-3)) + (lerp (-> s4-0 knocked-huge-vy-lo) (-> s4-0 knocked-huge-vy-hi) f30-3) + ) + ) + ((= v1-2 (knocked-type yellow-shot)) + (vector-rotate90-around-y! arg0 arg0) + (let ((v1-12 (new 'stack-no-clear 'vector))) + (vector-! v1-12 (-> this incoming attacker-pos) (-> this root trans)) + (set! (-> v1-12 y) 0.0) + (if (< 0.0 (vector-dot v1-12 arg0)) + (vector-negate! arg0 arg0) + ) + ) + (let ((f30-4 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-yellow-vxz-lo) (-> s4-0 knocked-yellow-vxz-hi) f30-4)) + (lerp (-> s4-0 knocked-yellow-vy-lo) (-> s4-0 knocked-yellow-vy-hi) f30-4) + ) + ) + ((= v1-2 (knocked-type red-shot)) + (let* ((f1-2 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) + (f0-18 1.0) + (f2-0 61440.0) + (f1-3 (fmin f1-2 (* f2-0 f2-0))) + (f2-3 61440.0) + (f30-6 (* (- f0-18 (/ f1-3 (* f2-3 f2-3))) (rnd-float-range this 0.8 1.0))) + ) + (set! f28-0 (lerp (-> s4-0 knocked-red-vxz-lo) (-> s4-0 knocked-red-vxz-hi) f30-6)) + (lerp (-> s4-0 knocked-red-vy-lo) (-> s4-0 knocked-red-vy-hi) f30-6) + ) + ) + ((= v1-2 (knocked-type blue-shot)) + (let* ((f1-5 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) + (f0-24 1.0) + (f2-6 122880.0) + (f1-6 (fmin f1-5 (* f2-6 f2-6))) + (f2-9 122880.0) + (f26-0 (* (- f0-24 (/ f1-6 (* f2-9 f2-9))) (rnd-float-range this 0.8 1.0))) + ) + (set! f28-0 (lerp (-> s4-0 knocked-blue-vxz-lo) (-> s4-0 knocked-blue-vxz-hi) f26-0)) + (cond + ((>= (the-as uint 4) (-> this incoming blue-juggle-count)) + (lerp (-> s4-0 knocked-blue-vy-lo) (-> s4-0 knocked-blue-vy-hi) f26-0) + ) + (else + (if (zero? (rnd-int this 3)) + (set! f30-0 40960.0) + ) + f30-0 + ) + ) + ) + ) + ((= v1-2 (knocked-type vehicle)) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + f30-0 + ) + (else + (let ((f30-7 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-soft-vxz-lo) (-> s4-0 knocked-soft-vxz-hi) f30-7)) + (lerp (-> s4-0 knocked-soft-vy-lo) (-> s4-0 knocked-soft-vy-hi) f30-7) + ) + ) + ) + ) + ) + (vector-float*! arg0 arg0 f28-0) + (vector-flatten! arg0 arg0 (-> this rot-matrix uvec)) + (vector+float*! arg0 arg0 (-> this rot-matrix uvec) f30-0) + ) + ) + +(defmethod enemy-method-103 ((this gekko) (arg0 vector) (arg1 float)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-flatten! s4-0 s4-0 (-> this rot-matrix uvec)) + (vector-normalize! s4-0 1.0) + (vector-flatten! s5-0 s5-0 (-> this rot-matrix uvec)) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s4-0 s5-0) (cos arg1)) + ) + ) + +(defmethod ragdoll-settled? ((this gekko)) + (local-vars (v1-18 gekko-shadow-spot)) + (let ((s5-0 (handle->process (-> this ragdoll-proc)))) + (or (not s5-0) + (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) + (and (time-elapsed? (-> this state-time) (seconds 2)) + (< (vector-length (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-joints 0 velocity)) + (* 49152.0 (seconds-per-frame)) + ) + (< (cos (* 16384.0 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) + (begin (set! v1-18 (-> this shadow-spot)) (< (- (-> this root trans y) (-> v1-18 position y)) 6144.0)) + (>= (fabs (vector-dot (-> v1-18 normal) *y-vector*)) + (-> *pat-mode-info* (shr (shl (-> v1-18 pat) 54) 61) wall-angle) + ) + ) + ) + ) + ) + ) + +(defmethod gekko-method-208 ((this gekko)) + (dotimes (s5-0 4) + (let ((s4-0 (-> this foot s5-0)) + (s3-0 (-> *gekko-ik-setup* s5-0)) + ) + (set! (-> s4-0 ground-normal quad) (-> this rot-matrix uvec quad)) + (vector<-cspace! (-> s4-0 ground-pos) (-> this node-list data (-> s3-0 hand-index))) + (vector+float*! (-> s4-0 ground-pos) (-> s4-0 ground-pos) (-> s4-0 ground-normal) (-> s3-0 hand-dist)) + ) + ) + 0 + (none) + ) + +(defmethod send-attack ((this gekko) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (sound-play "gekko-impact") + ((method-of-type nav-enemy send-attack) this arg0 arg1 arg2) + ) + +(defmethod enemy-common-post ((this gekko)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (if a0-2 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + ) + ) + (if (and (nonzero? (-> this path-wall)) (not (logtest? (-> this path-wall flags) (path-control-flag not-found)))) + (debug-draw (-> this path-wall)) + ) + (gekko-method-202 this) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +(defmethod gekko-method-202 ((this gekko)) + (cond + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + ) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this rot-matrix uvec))) + (f30-0 81920.0) + ) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) + (let ((v1-10 s4-0)) + (set! (-> v1-10 radius) 3276.8) + (set! (-> v1-10 collide-with) (collide-spec backgnd)) + (set! (-> v1-10 ignore-process0) this) + (set! (-> v1-10 ignore-process1) #f) + (set! (-> v1-10 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-10 action-mask) (collide-action solid)) + ) + (let ((f28-0 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f28-0 0.0) + (let ((v1-14 (-> this draw shadow-ctrl))) + (logclear! (-> v1-14 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> this shadow-spot valid?) #t) + (let ((s3-0 (-> s4-0 best-other-tri))) + (let ((v1-18 (vector+float*! (new 'stack-no-clear 'vector) (-> s4-0 start-pos) (-> s4-0 move-dist) f28-0))) + (set! (-> this shadow-spot position quad) (-> s3-0 intersect quad)) + (vector-! (-> this shadow-spot normal) v1-18 (-> s3-0 intersect)) + ) + (vector-normalize! (-> this shadow-spot normal) 1.0) + (set! (-> this shadow-spot pat) (the-as uint (-> s3-0 pat))) + ) + (let ((a1-10 (-> this root trans)) + (f0-3 (* f28-0 f30-0)) + ) + (shadow-control-method-14 + (-> this draw shadow-ctrl) + a1-10 + s5-0 + (fmax 32768.0 (* 409600.0 f28-0)) + (+ -12288.0 f0-3) + (+ 12288.0 f0-3) + ) + ) + ) + (else + (let ((v1-29 (-> this draw shadow-ctrl))) + (logior! (-> v1-29 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> this shadow-spot valid?) #f) + ) + ) + ) + ) + ) + (else + (let ((v1-33 (-> this draw shadow-ctrl))) + (logior! (-> v1-33 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> this shadow-spot valid?) #f) + ) + ) + 0 + (none) + ) + +(defmethod enemy-method-50 ((this gekko) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (zero? v1-0) (= v1-0 2)) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) + (a0-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 7)) + ) + (set! (-> v1-4 prim-core action) (collide-action)) + (set! (-> a0-4 prim-core action) (collide-action)) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> a0-4 prim-core collide-as) (collide-spec)) + ) + 0 + ) + ((= v1-0 1) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0))) + (set! (-> v1-8 prim-core action) (collide-action solid deadly)) + (set! (-> v1-8 prim-core collide-as) (collide-spec enemy)) + ) + ) + ((= v1-0 3) + (let ((v1-12 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) + (a0-9 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 7)) + ) + (set! (-> v1-12 prim-core action) (collide-action solid deadly)) + (set! (-> a0-9 prim-core action) (collide-action solid deadly)) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> a0-9 prim-core collide-as) (collide-spec enemy)) + ) + ) + ) + ) + (none) + ) + +(defmethod event-handler ((this gekko) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (logtest? (-> this flags) (gekko-flag on-wall?)) + (go (method-of-object this knocked-wall)) + (go (method-of-object this knocked)) + ) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod coin-flip? ((this gekko)) + #f + ) + +(defmethod relocate ((this gekko) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this foot v1-0 leg-ik)) + (&+! (-> this foot v1-0 leg-ik) offset) + ) + ) + (if (nonzero? (-> this path-wall)) + (&+! (-> this path-wall) offset) + ) + (call-parent-method this offset) + ) + +(defmethod init-enemy! ((this gekko)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gekko" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *gekko-nav-enemy-info*) + (set! (-> this scale) (rnd-float-range this 1.15 1.35)) + (let ((f0-1 (-> this scale))) + (set-vector! (-> this root scale) f0-1 f0-1 f0-1 1.0) + ) + (let ((v1-9 (-> this neck))) + (set! (-> v1-9 up) (the-as uint 1)) + (set! (-> v1-9 nose) (the-as uint 2)) + (set! (-> v1-9 ear) (the-as uint 0)) + (set! (-> v1-9 max-dist) 167936.0) + (set-vector! (-> v1-9 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-9 ignore-angle) 16384.0) + ) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this path-wall) (new 'process 'path-control this 'wall 0.0 (the-as entity #f) #t)) + (if (nonzero? (-> this path-wall)) + (logior! (-> this path-wall flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (dotimes (s5-1 4) + (let ((s4-1 (-> this foot s5-1))) + (set! (-> s4-1 leg-ik) + (new 'process 'joint-mod-ik this (-> *gekko-ik-setup* s5-1 elbow-index) (-> *gekko-ik-setup* s5-1 hand-dist)) + ) + (set! (-> s4-1 leg-ik user-float) (the float s5-1)) + (set! (-> s4-1 leg-ik elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> s4-1 leg-ik elbow-rotation-axis) (the-as uint 0)) + (let ((a0-18 (-> this node-list data (-> *gekko-ik-setup* s5-1 effector-index)))) + (set! (-> a0-18 param0) gekko-foot-rot-handler) + (set! (-> a0-18 param1) this) + (set! (-> a0-18 param2) (the-as basic s4-1)) + ) + (set! (-> s4-1 foot-transform scale quad) (-> *identity-vector* quad)) + ) + ) + (logior! (-> this foot 2 leg-ik flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this foot 3 leg-ik flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this foot 0 leg-ik flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this foot 1 leg-ik flags) (joint-mod-ik-flags elbow-rot-neg)) + (set! (-> this skel postbind-function) gekko-postbind-callback) + (logior! (-> this skel status) (joint-control-status no-joint-callbacks)) + (quaternion-rotate-local-y! + (-> this root quat) + (-> this root quat) + (* 182.04445 (rnd-float-range this 170.0 190.0)) + ) + (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) + (set! (-> this scared-timer) 0) + (set! (-> this root pause-adjust-distance) 368640.0) + (let ((s5-3 (new 'stack-no-clear 'vector)) + (s4-3 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (dotimes (s3-1 4) + (vector-orient-by-quat! s5-3 (the-as vector (-> *gekko-foot-offset* s3-1)) (-> this root quat)) + (vector+float*! (the-as vector (-> this foot s3-1)) (-> this root trans) s5-3 (-> this scale)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this foot 0 ground-normal)) (* 96 s3-1)))) + (-> s4-3 quad) + ) + ) + ) + (logior! (-> this flags) (gekko-flag update-foot-position? follow-terrain update-tilt on-wall?)) + (set! (-> this probe-len) 24576.0) + 0 + (none) + ) + +(defmethod within-gspot-range? ((this gekko)) + (let ((s5-0 (-> this root)) + (a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 #t) + ) + (when (find-ground + s5-0 + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + (let ((f0-1 (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)))) + (if (and (>= f0-1 -4096.0) (>= 8192.0 f0-1)) + (set! gp-0 #f) + ) + ) + ) + gp-0 + ) + ) + +(deftype gecko (gekko) + () + ) diff --git a/goal_src/jak3/levels/mine/manta.gc b/goal_src/jak3/levels/mine/manta.gc index 4e42bc8955..43c6f30212 100644 --- a/goal_src/jak3/levels/mine/manta.gc +++ b/goal_src/jak3/levels/mine/manta.gc @@ -5,5 +5,1962 @@ ;; name in dgo: manta ;; dgos: MIA +;; +++manta-flags +(defenum manta-flags + :type uint16 + :bitfield #t + (mf0 0) + (mf1 1) + ) +;; ---manta-flags + + ;; DECOMP BEGINS +(deftype manta (nav-enemy) + ((info rigid-body-object-constants) + (move-matrix matrix :inline) + (curve-matrix matrix :inline) + (move-vel vector :inline) + (move-u float) + (move-du float) + (move-force float) + (flags manta-flags) + (go-enable symbol) + (orbit-speed float) + (max-time-step float) + (gravity float) + (landed-pos vector :inline) + (dest-pos vector :inline) + (attack-pos vector :inline) + (up-dir vector :inline) + (forward-dir vector :inline) + (knocked-force vector :inline) + (knocked-force-mult float) + (default-y-offset float) + (y-offset float) + (last-attack-time time-frame) + (attack-y-offset float) + (attack-path-blocked-time time-frame) + (track-timer time-frame) + (angle-to-player float) + (offset-difference float) + (sound-volume float) + (restart-fly-anims symbol) + (fly-anim-speed float) + (hit-ground-count uint32) + (fade-level float) + (pad uint8 8) + ) + (:state-methods + land-approach + land + notice-to-fly + attack + attack-end + ) + (:methods + (manta-method-195 (_type_) none) + (manta-method-196 (_type_) symbol) + (manta-method-197 (_type_) none) + (manta-method-198 (_type_) none) + (manta-method-199 (_type_) none) + (manta-method-200 (_type_) none) + (manta-method-201 (_type_ float) none) + (do-impact (_type_) none) + (manta-method-203 (_type_ float) none) + (manta-method-204 (_type_) none) + (update-target-pos! (_type_) none) + (manta-method-206 (_type_) none) + (alloc-rbody! (_type_ rigid-body-object-constants) none) + (manta-method-208 (_type_) none) + ) + ) + + +(define *manta-rigid-body-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.5 + :inv-mass 0.6666667 + :linear-damping 0.97 + :angular-damping 0.94 + :bounce-factor 0.75 + :friction-factor 0.99 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2.5) (meters 5) (meters 2.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 20) + :idle-distance (meters 200) + :attack-force-scale 2.0 + ) + :name '*manta-rigid-body-constants* + ) + ) + +(defskelgroup skel-manta manta manta-lod0-jg manta-idle0-ja + ((manta-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow manta-shadow-mg + :shadow-joint-index 3 + ) + +(define *fact-info-manta-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +(define *manta-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #t + :idle-anim-script #f + :idle-anim 3 + :notice-anim 5 + :hostile-anim 8 + :hit-anim 13 + :knocked-anim 13 + :knocked-land-anim 13 + :die-anim 19 + :die-falling-anim 17 + :victory-anim 3 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 3 + :sound-hit (static-sound-name "manta-impact") + :notice-distance (meters 60) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 15) + :default-hit-points 3.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.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 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 10) + :shadow-min-y (meters -40) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 8 + :turn-anim -1 + :run-anim -1 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 0.2) + :run-turning-acceleration (meters 8) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 0.1) + :walk-turning-acceleration (meters 4) + :maximum-rotation-rate (degrees 1440) + :notice-nav-radius (meters 3) + :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! (-> *manta-nav-enemy-info* fact-defaults) *fact-info-manta-defaults*) + +(defmethod init-enemy-collision! ((this manta)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action semi-solid deadly)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13107.2) + (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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-13 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 0.0 2048.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set-vector! (-> v1-15 local-sphere) 0.0 -4096.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 enemy)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3481.6) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid)) + (set! (-> v1-19 transform-index) 6) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 10) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 12) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 6144.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defbehavior manta-hostile-post manta () + (update-target-pos! self) + (let* ((s4-0 (-> self root)) + (s3-0 (-> self focus-pos)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 trans) s3-0)) + ) + (set! (-> gp-1 y) 0.0) + (vector-xz-normalize! gp-1 1.0) + (vector-rotate-y! gp-1 gp-1 (* (-> self orbit-speed) (seconds-per-frame))) + (vector-xz-normalize! gp-1 81920.0) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> s4-0 trans quad)) + (let ((s5-0 (-> self dest-pos))) + (closest-point-on-mesh (-> self nav) s2-0 (-> s4-0 trans) (the-as nav-poly #f)) + (cond + ((< (vector-vector-xz-distance (-> s4-0 trans) s2-0) 4096.0) + (vector+! s5-0 s3-0 gp-1) + (closest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f)) + ) + (else + (vector+! + s5-0 + (-> s4-0 trans) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-0 trans)) 32768.0) + ) + ) + ) + (let ((v1-15 (-> self nav state))) + (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-15 target-pos quad) (-> s5-0 quad)) + ) + ) + ) + 0 + (let ((s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-1 -1.0) + (set! (-> self angle-to-player) (acos (vector-dot s5-1 gp-1))) + ) + ) + 0 + (set! (-> self dest-pos y) (+ (-> self root gspot-pos y) (-> self y-offset))) + (set! (-> self offset-difference) (- (-> self dest-pos y) (-> self root trans y))) + (vector-! (-> self forward-dir) (-> self focus-pos) (-> self root trans)) + (vector-normalize! (-> self forward-dir) 1.0) + (set! (-> self up-dir quad) (-> *y-vector* quad)) + (manta-method-200 self) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-travel-post) + (none) + ) + +(defbehavior manta-attack-post manta () + (update-target-pos! self) + (set! (-> self offset-difference) (- (-> self root trans y) (-> self attack-pos y))) + (if (time-elapsed? (-> self attack-path-blocked-time) (seconds 1)) + (manta-method-195 self) + ) + (when (logtest? (enemy-flag ef37) (-> self enemy-flags)) + (let ((s2-0 (-> self curve-matrix)) + (f0-2 (-> self move-u)) + (a1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (a0-4 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) 4096.0) + (set! (-> s5-0 w) 1.0) + (set-vector! a1-0 (* f0-2 f0-2 f0-2) (* f0-2 f0-2) f0-2 1.0) + (set-vector! s3-0 (* 3.0 f0-2 f0-2) (* 2.0 f0-2) 1.0 0.0) + (vector-matrix*! a0-4 a1-0 s2-0) + (vector-matrix*! s4-0 s3-0 s2-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (let ((f0-6 4.0)) + (vector-float*! gp-0 s4-0 f0-6) + ) + (vector-orient-by-quat! s3-1 s5-0 (-> self root quat)) + (vector+! s3-1 s3-1 (-> self root trans)) + (apply-impact! (-> self rbody) s3-1 gp-0) + ) + ) + (seek! (-> self move-u) 1.0 (* (-> self move-du) (seconds-per-frame))) + ) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-simple-post) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior manta-fly-code manta () + (cond + ((-> self restart-fly-anims) + (ja-channel-push! 3 (seconds 0.2)) + (ja :group! manta-flap-ja) + (let ((v1-6 (-> self skel root-channel 1))) + (let ((f0-0 0.0)) + (set! (-> v1-6 frame-interp 1) f0-0) + (set! (-> v1-6 frame-interp 0) f0-0) + ) + (set! (-> v1-6 frame-group) (the-as art-joint-anim manta-flap-fast-ja)) + ) + (let ((v1-9 (-> self skel root-channel 2))) + (let ((f0-1 0.0)) + (set! (-> v1-9 frame-interp 1) f0-1) + (set! (-> v1-9 frame-interp 0) f0-1) + ) + (set! (-> v1-9 frame-group) (the-as art-joint-anim manta-flap-back-ja)) + ) + (set! (-> self restart-fly-anims) #f) + ) + (else + (ja :group! manta-flap-ja) + (let ((v1-16 (-> self skel root-channel 1))) + (let ((f0-2 0.0)) + (set! (-> v1-16 frame-interp 1) f0-2) + (set! (-> v1-16 frame-interp 0) f0-2) + ) + (set! (-> v1-16 frame-group) (the-as art-joint-anim manta-flap-fast-ja)) + ) + (let ((v1-19 (-> self skel root-channel 2))) + (let ((f0-3 0.0)) + (set! (-> v1-19 frame-interp 1) f0-3) + (set! (-> v1-19 frame-interp 0) f0-3) + ) + (set! (-> v1-19 frame-group) (the-as art-joint-anim manta-flap-back-ja)) + ) + ) + ) + (until #f + (until (ja-done? 0) + (set! (-> self go-enable) #t) + (suspend) + (set! (-> self go-enable) #f) + (let ((a0-19 (-> self skel root-channel 0))) + (let ((f0-4 1.0)) + (set! (-> a0-19 frame-interp 1) f0-4) + (set! (-> a0-19 frame-interp 0) f0-4) + ) + (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group frames num-frames) -1))) + (set! (-> a0-19 param 1) (-> self fly-anim-speed)) + (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) + ) + (let* ((f30-0 (lerp-scale 0.0 1.0 (-> self fly-anim-speed) 1.0 1.5)) + (gp-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0)) + (f28-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) gp-0)) + ) + (let ((a0-23 (-> self skel root-channel 1))) + (let ((f0-11 (fmax 0.0 (* f28-0 f30-0)))) + (set! (-> a0-23 frame-interp 1) f0-11) + (set! (-> a0-23 frame-interp 0) f0-11) + ) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) + ) + (let ((a0-24 (-> self skel root-channel 2))) + (let ((f0-14 (fmax 0.0 (* (- 1.0 f28-0) f30-0)))) + (set! (-> a0-24 frame-interp 1) f0-14) + (set! (-> a0-24 frame-interp 0) f0-14) + ) + (set! (-> a0-24 param 0) 0.0) + (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-chan) + ) + ) + ) + (if (rnd-chance? self 0.5) + (ja-no-eval :group! manta-flap-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (ja-no-eval :group! manta-flap1-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + ) + ) + #f + (none) + ) + +(defstate idle (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy idle) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self draw shadow-ctrl))) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) + ) + 0 + (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (set! (-> self landed-pos quad) (-> self root trans quad)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (let ((v1-1 (-> self draw shadow-ctrl))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 1 (the-as int (-> self focus aware)))) + (go-virtual ambush) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (let ((s5-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (f28-0 (rnd-float-range self 0.5 0.3)) + (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (f30-0 (rnd-float-range self 0.5 0.3)) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! manta-idle0-ja :num! (seek! max f28-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f28-0)) + ) + ) + (dotimes (s5-1 gp-0) + (ja-no-eval :group! manta-idle1-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set-time! (-> self last-draw-time)) + ) + (update-focus self) + (ja-post) + ) + ) + +(defstate land-approach (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (set! (-> self dest-pos y) (+ 8192.0 (-> self default-y-offset) (-> self landed-pos y))) + (let ((a0-7 (-> self nav state)) + (v1-9 (-> self dest-pos)) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-9 quad)) + ) + 0 + (set! (-> self go-enable) #t) + (let ((v1-13 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-13 enemy-flags))) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-13 enemy-flags)))) + ) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-13 enemy-flags)))) + (set! (-> v1-13 nav callback-info) (-> v1-13 enemy-info callback-info)) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) 24576.0) + ) + 0 + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (and (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 8192.0) (-> self go-enable)) + (go-virtual land) + ) + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 1 (the-as int (-> self focus aware)))) + (go-virtual notice) + ) + (seek! (-> self fly-anim-speed) 1.0 (seconds-per-frame)) + (vector-! (-> self forward-dir) (-> self dest-pos) (-> self root trans)) + (vector-normalize! (-> self forward-dir) 1.0) + 0 + ) + :code manta-fly-code + :post (behavior () + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-travel-post) + ) + ) + +(defstate land (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (manta-flags mf0)) + (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (set! (-> self dest-pos y) (+ (-> self landed-pos y) (-> self default-y-offset))) + (set! (-> self restart-fly-anims) #t) + ) + :exit (behavior () + (manta-method-206 self) + ) + :trans (behavior () + (seek! (-> self fly-anim-speed) 1.0 (seconds-per-frame)) + (vector-! (-> self forward-dir) (-> self dest-pos) (-> self root trans)) + (vector-normalize! (-> self forward-dir) 1.0) + 0 + ) + :code (behavior () + (ja-no-eval :num! (seek! max (-> self fly-anim-speed))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 0) + (while (< 2048.0 (vector-vector-distance (-> self root trans) (-> self landed-pos))) + (ja-no-eval :group! manta-flap-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self fly-anim-speed))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! manta-land-ja :num! (seek! max 0.8) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.8)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! manta-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual dormant-aware) + ) + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 0.0) + (set! (-> a1-0 y) -819.2) + (set! (-> a1-0 z) 0.0) + (set! (-> a1-0 w) 1.0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! gp-0 (-> self landed-pos) (-> self root trans)) + (vector-float*! gp-0 gp-0 2.0) + (vector-orient-by-quat! s5-0 a1-0 (-> self root quat)) + (vector+! s5-0 s5-0 (-> self root trans)) + (apply-impact! (-> self rbody) s5-0 gp-0) + ) + ) + (vector-seek! (-> self dest-pos) (-> self landed-pos) (* 8192.0 (seconds-per-frame))) + (nav-enemy-simple-post) + ) + ) + +(defstate active (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self orbit-speed) (* 182.04445 (rnd-float-range self 0.5 2.0))) + (let ((v1-13 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-13 enemy-flags))) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-13 enemy-flags)))) + ) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-13 enemy-flags)))) + (set! (-> v1-13 nav callback-info) (-> v1-13 enemy-info callback-info)) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) 49152.0) + ) + 0 + ) + :code manta-fly-code + :post manta-hostile-post + ) + +(defstate ambush (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy ambush) enter))) + (if t9-0 + (t9-0) + ) + ) + (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (set! (-> self landed-pos quad) (-> self root trans quad)) + (manta-method-206 self) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) (the-as uint 0)) + (set! (-> self fade-level) 0.0) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 1.0 1.5))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! manta-alert-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual notice-to-fly) + ) + :post (behavior () + (seek! (-> self fade-level) 128.0 (* 196.0 (seconds-per-frame))) + (set! (-> self draw force-fade) (the-as uint (the int (-> self fade-level)))) + (nav-enemy-simple-post) + ) + ) + +(defstate notice-to-fly (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (set! (-> self fly-anim-speed) 1.5) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self dest-pos quad) (-> self root trans quad)) + (set! (-> self dest-pos y) (+ (-> self root gspot-pos y) (-> self y-offset))) + ) + :exit (behavior () + (set-time! (-> self last-attack-time)) + (set! (-> self restart-fly-anims) #t) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! manta-alert-to-fly-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (cond + ((< 15.0 (ja-frame-num 0)) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-simple-post) + ) + (else + (nav-enemy-simple-post) + ) + ) + (suspend) + (ja :num! (seek! max (-> self fly-anim-speed))) + ) + (ja-channel-push! 1 (seconds 0.075)) + (dotimes (gp-0 5) + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (seek! (-> self fly-anim-speed) 1.2 (* 0.5 (seconds-per-frame))) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-simple-post) + (suspend) + (ja :num! (seek! max (-> self fly-anim-speed))) + ) + ) + (go-virtual hostile) + ) + ) + +(defstate stare (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self orbit-speed) (* 182.04445 (rnd-float-range self 0.5 2.0))) + (let ((v1-13 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-13 enemy-flags))) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-13 enemy-flags)))) + ) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-13 enemy-flags)))) + (set! (-> v1-13 nav callback-info) (-> v1-13 enemy-info callback-info)) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) 49152.0) + ) + 0 + ) + :code manta-fly-code + :post manta-hostile-post + ) + +(defstate hostile (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self orbit-speed) (* 182.04445 (rnd-float-range self 0.8 2.4))) + (set! (-> self go-enable) #t) + (let ((v1-14 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-14 enemy-flags))) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-14 enemy-flags)))) + ) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-14 enemy-flags)))) + (set! (-> v1-14 nav callback-info) (-> v1-14 enemy-info callback-info)) + ) + 0 + (let ((v1-17 (-> self nav))) + (set! (-> v1-17 target-speed) 49152.0) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (-> self go-enable) (< (fabs (- (-> self focus-pos y) (-> self root gspot-pos y))) 16384.0)) + (if (and (time-elapsed? (-> self last-attack-time) (seconds 3)) + (< (fabs (-> self angle-to-player)) 6371.5557) + (< (-> self offset-difference) 12288.0) + (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 28672.0) + (< (vector-vector-distance (-> self root trans) (-> self focus-pos)) 110592.0) + (< (vector-length (-> self root transv)) 16384.0) + (let ((f0-10 (- (-> self root trans y) (-> self focus-pos y)))) + (and (and (< f0-10 24576.0) (< 0.0 f0-10)) (get-focus! self)) + ) + ) + (go-virtual attack) + ) + (if (and (time-elapsed? (-> self last-attack-time) (seconds 1)) + (< (fabs (-> self angle-to-player)) 8192.0) + (< (current-time) (+ (-> self track-timer) (seconds 0.5))) + (< (-> self offset-difference) 12288.0) + (< -4096.0 (-> self root transv y)) + ) + (go-virtual attack) + ) + ) + ) + :code manta-fly-code + :post manta-hostile-post + ) + +(defstate attack (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-177 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self state-time)) + (set-look-at-mode! self 1) + (let ((f30-0 1.13)) + (cond + ((and (get-focus! self) (manta-method-197 self)) + (set! (-> self attack-y-offset) (+ (- 4096.0 (-> self root trans y)) (-> self focus-pos y))) + (logior! (-> self flags) (manta-flags mf1)) + ) + (else + (set! (-> self attack-y-offset) 14336.0) + ) + ) + (let* ((f0-4 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (f0-7 (/ (fmin 69632.0 (/ f0-4 f30-0)) f30-0)) + ) + (set! (-> self move-force) (* (-> self info info mass) f0-7)) + ) + (set! (-> self move-u) 0.0) + (set! (-> self move-du) (* 0.94 f30-0)) + ) + (set! (-> self attack-pos quad) (-> self focus-pos quad)) + (set! (-> self y-offset) (+ 24576.0 (-> self default-y-offset))) + (set! (-> self move-matrix rvec quad) (-> self root trans quad)) + (manta-method-195 self) + (dotimes (gp-0 (-> self actor-group-count)) + (let ((s5-0 (-> self actor-group gp-0))) + (dotimes (s4-0 (-> s5-0 length)) + (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) 'attacking) + (let ((t9-6 send-event-function) + (v1-38 (-> s5-0 data s4-0 actor)) + ) + (t9-6 + (if v1-38 + (-> v1-38 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (logclear! (-> self flags) (manta-flags mf1)) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (>= 2 (the-as int (-> self focus aware)))) + (go-stare self) + ) + (if (and (logtest? (-> self flags) (manta-flags mf1)) + (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 36864.0) + (< (fabs (- (-> self root trans y) (-> self focus-pos y))) 7782.4) + ) + (go-virtual attack-end) + ) + ) + :code (behavior () + (let ((f28-0 (-> self fly-anim-speed)) + (f30-0 1.5) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max f28-0) :frame-num 0.0) + (until (ja-done? 0) + (set! f28-0 (seek f28-0 f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max f28-0)) + ) + (if (logtest? (-> self flags) (manta-flags mf1)) + (sound-play "manta-attack") + ) + (let ((v1-29 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-29 enemy-flags))) + (set! (-> v1-29 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-29 enemy-flags)))) + ) + (set! (-> v1-29 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-29 enemy-flags)))) + (set! (-> v1-29 nav callback-info) (-> v1-29 enemy-info callback-info)) + ) + 0 + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max f28-0) :frame-num 0.0) + (until (ja-done? 0) + (set! f28-0 (seek f28-0 f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max f28-0)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! manta-attack-start-ja :num! (seek! max 1.2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.2)) + ) + (ja-no-eval :group! manta-glide-end-ja :num! (seek! max 1.1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.1)) + ) + (set! (-> self restart-fly-anims) #t) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (set-time! (-> self last-attack-time)) + (go-virtual hostile) + ) + :post manta-attack-post + ) + +(defstate attack-end (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((a0-0 (-> self root root-prim))) + (set! (-> (the-as collide-shape-prim-group a0-0) child 1 prim-core action) (collide-action deadly)) + ) + (sound-play "manta-hit-jak") + ) + :exit (behavior () + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action) + (collide-action) + ) + 0 + (set! (-> self restart-fly-anims) #t) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (set-time! (-> self last-attack-time)) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (>= 2 (the-as int (-> self focus aware)))) + (go-stare self) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 1.0)) + (ja-no-eval :group! manta-attack-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual hostile) + ) + :post manta-attack-post + ) + +(defstate knocked (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self rbody flags) (rigid-body-flag enable-collision)) + (manta-method-206 self) + (set! (-> self restart-fly-anims) #t) + (set! (-> self gravity) 327680.0) + (set! (-> self hit-ground-count) (the-as uint 0)) + (set! (-> self knocked-force-mult) 1.0) + (knocked-handler self (-> self knocked-force)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self gravity) 81920.0) + ) + :trans (behavior () + (set-time! (-> self attack-path-blocked-time)) + (cond + ((!= (-> self hit-points) 0.0) + (if (and (zero? (-> self fated-time)) + (>= (-> self knocked-force-mult) 0.0) + (or (time-elapsed? (-> self state-time) (seconds 0.8)) + (and (< (-> self root trans y) (+ 8192.0 (-> self default-y-offset) (-> self root gspot-pos y))) + (< (-> self root transv y) 0.0) + ) + ) + ) + (go-virtual knocked-recover) + ) + ) + (else + (if (and (< (-> self root trans y) (+ -40960.0 (-> self default-y-offset) (-> self root gspot-pos y))) + (< (-> self root transv y) 0.0) + ) + (go-die self) + ) + ) + ) + ) + :post (behavior () + (seek! (-> self sound-volume) 0.0 (* 0.5 (seconds-per-frame))) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) (* 4096.0 (rnd-float-range self -0.3 0.3))) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* 4096.0 (rnd-float-range self -0.2 0.2))) + (set! (-> s5-0 w) 1.0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (f30-2 4.0) + ) + (vector-float*! gp-0 (-> self knocked-force) (* 2.0 (-> self knocked-force-mult) f30-2 f30-2)) + (vector-orient-by-quat! s4-0 s5-0 (-> self root quat)) + (vector+! s4-0 s4-0 (-> self root trans)) + (apply-impact! (-> self rbody) s4-0 gp-0) + (seek! (-> self knocked-force-mult) 0.0 (* f30-2 (seconds-per-frame))) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-9 start-pos quad) (-> self rbody position quad)) + (vector-float*! (-> a1-9 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) + (let ((v1-21 a1-9)) + (set! (-> v1-21 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) + (set! (-> v1-21 collide-with) (collide-spec backgnd jak bot obstacle player-list)) + (set! (-> v1-21 ignore-process0) self) + (set! (-> v1-21 ignore-process1) #f) + (set! (-> v1-21 ignore-pat) (-> self root pat-ignore-mask)) + (set! (-> v1-21 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* a1-9) + ) + (manta-method-203 self 0.0) + (nav-enemy-simple-post) + ) + ) + +(defstate knocked-recover (manta) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self rbody flags) (rigid-body-flag enable-collision)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (gp-0 2) + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-0 start-pos quad) (-> self rbody position quad)) + (vector-float*! (-> a1-0 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) + (let ((v1-3 a1-0)) + (set! (-> v1-3 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) + (set! (-> v1-3 collide-with) (collide-spec backgnd jak bot obstacle player-list)) + (set! (-> v1-3 ignore-process0) self) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) (-> self root pat-ignore-mask)) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* a1-0) + ) + (manta-method-203 self 0.0) + (nav-enemy-simple-post) + ) + ) + +(defmethod go-best-state ((this manta)) + (let ((s5-0 (-> this focus aware))) + (cond + ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + (go-hostile this) + ) + ((<= (the-as int s5-0) 0) + (go (method-of-object this land-approach)) + ) + ((>= 1 (the-as int s5-0)) + (go (method-of-object this land-approach)) + ) + ((= s5-0 (enemy-aware ea4)) + (go-flee this) + ) + (else + (go-stare this) + ) + ) + ) + ) + +(defmethod manta-method-195 ((this manta)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (the-as vector (-> this move-matrix))))) + (set! (-> s5-1 y) (-> this attack-y-offset)) + (vector-normalize! s5-1 (-> this move-force)) + (set! (-> this move-matrix fvec quad) (-> s5-1 quad)) + (vector+! (-> this move-matrix uvec) (the-as vector (-> this move-matrix)) s5-1) + ) + (vector-! (-> this move-matrix trans) (-> this focus-pos) (-> this move-matrix uvec)) + (vector-normalize! (-> this move-matrix trans) 24576.0) + (set! (-> this move-matrix trans y) (* -0.5 (-> this move-matrix trans y))) + (matrix*! (-> this curve-matrix) *hermite-matrix* (-> this move-matrix)) + 0 + (none) + ) + +(defmethod manta-method-196 ((this manta)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this root trans quad)) + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) + ) + (when (and s4-0 (< (vector-vector-xz-distance s5-0 s3-0) 4096.0)) + (let ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) s5-0))) + (vector-length s3-2) + (let ((s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info))) + (vector-float*! s3-2 s3-2 1.3) + (clamp-vector-to-mesh-no-gaps (-> this nav) s5-0 s4-0 s3-2 s2-0) + (if (-> s2-0 found-boundary) + #f + #t + ) + ) + ) + ) + ) + ) + ) + +(defmethod get-focus! ((this manta)) + (let* ((t9-0 (method-of-type nav-enemy get-focus!)) + (v0-0 (t9-0 this)) + ) + (cond + ((and v0-0 (time-elapsed? (-> this attack-path-blocked-time) (seconds 1))) + (empty) + v0-0 + ) + (else + (the-as process-focusable #f) + ) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod manta-method-197 ((this manta)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) + (let ((gp-0 (camera-matrix))) + (camera-pos) + (let* ((s4-0 (-> this focus-pos)) + (gp-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> gp-0 fvec) 1.0)) + (v1-6 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s4-0) 1.0)) + ) + (< 0.0 (vector-dot gp-1 v1-6)) + ) + ) + ) + (none) + ) + +(defmethod within-gspot-range? ((this manta)) + #f + ) + +(defmethod enemy-method-88 ((this manta) (arg0 enemy-knocked-info)) + (let ((v1-0 (-> this root))) + (or (>= (-> arg0 on-surface-count) 3) + (>= (-> this hit-ground-count) (the-as uint 1)) + (and (logtest? (-> v1-0 status) (collide-status on-ground)) (>= 16384.0 (-> v1-0 transv y))) + ) + ) + ) + +(defmethod manta-method-198 ((this manta)) + (let ((a1-0 (-> this info name))) + (when (nonzero? a1-0) + (set! (-> this info) (the-as rigid-body-object-constants (-> a1-0 value))) + (set! (-> this rbody info) (-> this info info)) + ) + ) + (rigid-body-info-method-9 (-> this info info)) + 0 + (none) + ) + +(defmethod manta-method-199 ((this manta)) + 0 + (none) + ) + +(defmethod manta-method-200 ((this manta)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (-> this root root-prim prim-core)) + ) + (set! (-> s3-0 quad) (-> s5-0 world-sphere quad)) + (set! (-> s3-0 w) (-> s5-0 world-sphere w)) + (let ((s4-0 544)) + (set! *actor-list-length* 0) + (if (logtest? s4-0 512) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (the-as bounding-box s3-0) *actor-list* 256)) + ) + (when (logtest? s4-0 1024) + (let ((a0-4 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-14 (-> a0-4 next0))) + (while (!= a0-4 (-> *collide-player-list* alive-list-end)) + (let* ((a0-5 (-> (the-as connection a0-4) param1)) + (a1-1 (-> (the-as collide-shape a0-5) 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 s3-0) + ) + (.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-1 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-1 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-5)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-4 v1-14) + *collide-player-list* + (set! v1-14 (-> v1-14 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 256) + (let ((a0-7 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-22 (-> a0-7 next0))) + (while (!= a0-7 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-8 (-> (the-as connection a0-7) param1)) + (a1-13 (-> (the-as collide-shape a0-8) 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 s3-0) + ) + (.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-2 a2-12) + (f1-5 (+ (-> a1-14 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-2 (* f1-5 f1-5)) + (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-22) + *collide-hit-by-player-list* + (set! v1-22 (-> v1-22 next0)) + ) + ) + ) + ) + (dotimes (s3-1 *actor-list-length*) + (let ((v1-27 (-> *actor-list* s3-1))) + (when (logtest? (the-as collide-spec s4-0) (-> v1-27 root-prim prim-core collide-as)) + (when (!= v1-27 (-> this root)) + (let* ((s2-1 + (vector-! (new 'stack-no-clear 'vector) (the-as vector s5-0) (the-as vector (-> v1-27 root-prim prim-core))) + ) + (f0-3 (vector-length s2-1)) + ) + (when (< 40.96 f0-3) + (let ((f0-6 (lerp-scale 131072.0 0.0 f0-3 2048.0 (* 1.5 (-> s5-0 world-sphere w))))) + (vector-normalize! s2-1 f0-6) + ) + (add-force! (-> this rbody) s2-1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod manta-method-201 ((this manta) (arg0 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'matrix 2))) + (set! (-> gp-0 0 rvec quad) (-> this move-vel quad)) + (vector-normalize! + (the-as vector (-> gp-0 0)) + (vector-vector-distance (-> this dest-pos) (-> this root trans)) + ) + (let ((v1-2 (-> gp-0 1))) + (set! (-> v1-2 rvec x) 0.0) + (set! (-> v1-2 rvec y) 0.0) + (set! (-> v1-2 rvec z) 4096.0) + (set! (-> v1-2 rvec w) 1.0) + ) + (set-vector! (-> gp-0 1 uvec) 0.0 16384.0 0.0 1.0) + (set! (-> gp-0 0 uvec quad) (-> gp-0 0 rvec quad)) + (set! (-> gp-0 0 uvec y) 0.0) + (let* ((v1-5 (-> gp-0 0)) + (f30-0 (sqrtf (+ (* (-> v1-5 rvec x) (-> v1-5 rvec x)) (* (-> v1-5 rvec z) (-> v1-5 rvec z))))) + (f0-13 (lerp-scale 0.0 49152.0 f30-0 4096.0 61440.0)) + (f0-15 (/ (* (-> this info info mass) f0-13 f0-13) (* 2.0 f30-0))) + ) + (vector-normalize! (-> gp-0 0 uvec) (fmin arg0 f0-15)) + ) + (set! (-> this fly-anim-speed) (lerp-scale 1.0 1.5 (vector-length (-> gp-0 0 uvec)) 0.0 32768.0)) + (if (and (< (vector-dot (-> gp-0 0 uvec) (-> this forward-dir)) 0.0) + (let ((v1-15 (-> gp-0 0))) + (< (sqrtf (+ (* (-> v1-15 rvec x) (-> v1-15 rvec x)) (* (-> v1-15 rvec z) (-> v1-15 rvec z)))) 131072.0) + ) + ) + (set! (-> gp-0 1 rvec z) (* -1.0 (-> gp-0 1 rvec z))) + ) + (vector-float*! (-> gp-0 0 fvec) (-> gp-0 0 uvec) 4.0) + (vector-float*! (-> gp-0 0 trans) (-> gp-0 0 uvec) 0.5) + (vector-orient-by-quat! (-> gp-0 1 fvec) (the-as vector (-> gp-0 1)) (-> this root quat)) + (vector+! (-> gp-0 1 fvec) (-> gp-0 1 fvec) (-> this root trans)) + (apply-impact! (-> this rbody) (-> gp-0 1 fvec) (-> gp-0 0 fvec)) + (vector-orient-by-quat! (-> gp-0 1 fvec) (-> gp-0 1 uvec) (-> this root quat)) + (vector+! (-> gp-0 1 fvec) (-> gp-0 1 fvec) (-> this root trans)) + (apply-impact! (-> this rbody) (-> gp-0 1 fvec) (-> gp-0 0 trans)) + (when (logtest? (-> this flags) (manta-flags mf0)) + (let* ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans))) + (t9-9 lerp-scale) + (a0-27 32768.0) + (a1-16 0.0) + (v1-36 (-> gp-0 0)) + (f30-1 (t9-9 + a0-27 + a1-16 + (sqrtf (+ (* (-> v1-36 rvec x) (-> v1-36 rvec x)) (* (-> v1-36 rvec z) (-> v1-36 rvec z)))) + 4096.0 + 61440.0 + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 x) 0.0) + (set! (-> s3-1 y) 0.0) + (set! (-> s3-1 z) 10240.0) + (set! (-> s3-1 w) 1.0) + (let ((f30-2 + (* f30-1 + (lerp-scale + 0.5 + 1.0 + (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) (-> this forward-dir)) + 1.0 + -1.0 + ) + ) + ) + ) + (vector-orient-by-quat! (-> gp-0 1 fvec) s3-1 (-> this root quat)) + (vector+! (-> gp-0 1 fvec) (-> gp-0 1 fvec) (-> this root trans)) + (apply-impact! + (-> this rbody) + (-> gp-0 1 fvec) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 f30-2) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod do-impact ((this manta)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f0-1 (* (-> this rbody info mass) (-> this gravity))) + (f1-2 (fmax 0.0 (fmin 1.0 (/ (- (-> this dest-pos y) (-> this root trans y)) (-> this y-offset))))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 x) 0.0) + (set! (-> s4-0 y) 12288.0) + (set! (-> s4-0 z) 0.0) + (set! (-> s4-0 w) 1.0) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-reset! gp-0) + (set! (-> gp-0 y) (fmax 0.0 (fmin 450560.0 (* 4.0 f0-1 f1-2)))) + (set! (-> this fly-anim-speed) (fmax (lerp-scale 1.0 1.5 f1-2 0.35 0.6) (-> this fly-anim-speed))) + (vector-orient-by-quat! s3-0 s4-0 (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) + (apply-impact! (-> this rbody) s3-0 gp-0) + ) + ) + 0 + (none) + ) + +(defmethod manta-method-203 ((this manta) (arg0 float)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 x) 0.0) + (set! (-> v1-0 y) arg0) + (set! (-> v1-0 z) 0.0) + (set! (-> v1-0 w) 1.0) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-reset! gp-0) + (set! (-> gp-0 y) (* -1.0 (-> this gravity) (-> this rbody info mass))) + (vector-orient-by-quat! s4-0 v1-0 (-> this root quat)) + (vector+! s4-0 s4-0 (-> this root trans)) + (apply-impact! (-> this rbody) s4-0 gp-0) + ) + ) + 0 + (none) + ) + +(defmethod manta-method-204 ((this manta)) + (rigid-body-control-method-10 + (-> this rbody) + (the-as rigid-body-object this) + (seconds-per-frame) + (-> this max-time-step) + ) + 0 + (none) + ) + +(defmethod nav-enemy-method-161 ((this manta) (arg0 nav-control)) + (let ((a2-0 (-> arg0 state))) + (set! (-> this move-vel quad) (-> a2-0 velocity quad)) + ) + (manta-method-201 this 201326600.0) + (none) + ) + +(defmethod normalize-heading! ((this manta) (arg0 nav-control)) + 0 + (none) + ) + +(defmethod manta-method-208 ((this manta)) + (cond + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + ) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) + (f30-0 81920.0) + ) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) + (let ((v1-12 s4-0)) + (set! (-> v1-12 radius) 3276.8) + (set! (-> v1-12 collide-with) (collide-spec backgnd)) + (set! (-> v1-12 ignore-process0) this) + (set! (-> v1-12 ignore-process1) #f) + (set! (-> v1-12 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-12 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f0-1 0.0) + (let ((v1-16 (-> this draw shadow-ctrl))) + (logclear! (-> v1-16 settings flags) (shadow-flags disable-draw)) + ) + 0 + (-> s4-0 best-other-tri intersect) + (let ((a1-3 (-> this root trans))) + (-> a1-3 y) + (let ((f1-2 (* f0-1 f30-0))) + (shadow-control-method-14 + (-> this draw shadow-ctrl) + a1-3 + gp-0 + (fmax 32768.0 (* 409600.0 f0-1)) + (+ -12288.0 f1-2) + (+ 12288.0 f1-2) + ) + ) + ) + ) + (else + (let ((v1-28 (-> this draw shadow-ctrl))) + (logior! (-> v1-28 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + ) + ) + (else + (let ((v1-31 (-> this draw shadow-ctrl))) + (logior! (-> v1-31 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + 0 + (none) + ) + +(defmethod enemy-common-post ((this manta)) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (set-ground-pat! + this + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + ) + ) + (else + (let ((s5-0 (-> this nav)) + (s3-0 (-> this root trans)) + (s4-0 (new 'stack 'nav-find-poly-parms)) + ) + (vector-! (-> s4-0 point) s3-0 (the-as vector (-> s5-0 state mesh bounds))) + (set! (-> s4-0 y-threshold) (-> s5-0 nearest-y-threshold)) + (set! (-> s4-0 ignore) (the-as uint 2)) + (nav-mesh-method-46 (-> s5-0 state mesh) (the-as nav-poly s4-0)) + (let ((v1-16 (-> s4-0 poly))) + (if v1-16 + (set! (-> this root gspot-pos y) (+ (-> v1-16 vertex0 y) (-> this nav state mesh bounds y))) + ) + ) + ) + ) + ) + (manta-method-204 this) + (update-rbody-transform! (-> this rbody) (-> this root)) + (manta-method-208 this) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; WARN: disable def twice: 150. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 100. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this manta) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 object)) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + ) + (('impact-impulse) + (let ((v1-27 (-> arg3 param 0))) + (when (and (< 0.8 (vector-dot (the-as vector (+ v1-27 16)) *y-vector*)) + (< (vector-dot (the-as vector (+ v1-27 16)) (the-as vector (+ v1-27 32))) -0.8) + ) + (set! v0-4 (+ (-> this hit-ground-count) 1)) + (set! (-> this hit-ground-count) (the-as uint v0-4)) + v0-4 + ) + ) + ) + (('tracked) + (set! v0-4 (current-time)) + (set! (-> this track-timer) (the-as time-frame v0-4)) + v0-4 + ) + (('cue-chase 'trigger) + (if (and (-> this next-state) (let ((v1-37 (-> this next-state name))) + (or (= v1-37 'idle) (= v1-37 'dormant-aware) (= v1-37 'dormant)) + ) + ) + (go (method-of-object this ambush)) + ) + ) + (('attacking) + (when (and (!= arg0 this) (time-elapsed? (-> this last-attack-time) (seconds 1))) + (set! v0-4 (+ (current-time) (seconds -1))) + (set! (-> this last-attack-time) (the-as time-frame v0-4)) + v0-4 + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod update-target-pos! ((this manta)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (cond + (a0-2 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (if (not (manta-method-196 this)) + (set-time! (-> this attack-path-blocked-time)) + ) + ) + (else + (set! (-> this focus-pos quad) (-> (target-pos 0) quad)) + (set! (-> this dest-pos quad) (-> this root trans quad)) + ) + ) + ) + (none) + ) + +(defmethod enemy-method-50 ((this manta) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-2 (-> this root root-prim))) + (let ((a0-1 v1-2)) + (set! (-> a0-1 prim-core action) (collide-action solid deadly)) + (set! (-> a0-1 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) + ) + (let ((v1-4 (-> (the-as collide-shape-prim-group v1-2) child 0))) + (set! (-> v1-4 prim-core action) (collide-action solid deadly)) + (set! (-> v1-4 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) + (set! (-> v1-4 local-sphere w) 6144.0) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (let ((v1-8 (-> this root root-prim))) + (let ((a0-5 v1-8)) + (set! (-> a0-5 prim-core action) (collide-action semi-solid deadly)) + (set! (-> a0-5 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + ) + (let ((v1-10 (-> (the-as collide-shape-prim-group v1-8) child 0))) + (set! (-> v1-10 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-10 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-10 local-sphere w) 2048.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod knocked-anim-handler ((this manta) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (let ((s5-0 (ja-done? 0))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + ) + (when (and s5-0 (= (-> this hit-points) 0.0)) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (set! (-> a0-4 frame-num) 8.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +(defmethod knocked-anim ((this manta) (arg0 enemy-knocked-info)) + (cond + ((= (-> this hit-points) 0.0) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> arg0 anim-speed) 0.5) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + #t + ) + ((let ((v1-15 (-> this incoming knocked-type))) + (= v1-15 (knocked-type blue-shot)) + ) + (ja-channel-push! 1 0) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) + (set! (-> a0-7 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) + ) + (set! (-> a0-7 param 1) (-> arg0 anim-speed)) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) + ) + #t + ) + ) + ) + +(defmethod knocked-land-anim ((this manta) (arg0 enemy-knocked-info)) + (set! (-> arg0 anim-speed) 0.5) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + #t + ) + +(defmethod manta-method-206 ((this manta)) + (rigid-body-control-method-28 (-> this rbody) (-> this root trans) (-> this root quat)) + (let ((v1-4 (-> this rbody))) + (set! (-> v1-4 force quad) (the-as uint128 0)) + (set! (-> v1-4 torque quad) (the-as uint128 0)) + ) + 0 + (reset-momentum! (-> this rbody)) + 0 + (none) + ) + +(defmethod alloc-rbody! ((this manta) (arg0 rigid-body-object-constants)) + (set! (-> this info) arg0) + (set! (-> this rbody) (new 'process 'rigid-body-control this)) + (update-transforms (-> this root)) + (init! + (-> this rbody) + (-> this info info) + (-> this root trans) + (-> this root quat) + (the-as (function rigid-body-object float) (method-of-object this manta-method-199)) + ) + (manta-method-198 this) + (set! (-> this max-time-step) (-> arg0 extra max-time-step)) + (set! (-> this root max-iteration-count) (the-as uint 4)) + 0 + (none) + ) + +(defmethod init-enemy! ((this manta)) + (local-vars (sv-16 res-tag)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-manta" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *manta-nav-enemy-info*) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) + ) + (alloc-rbody! this *manta-rigid-body-constants*) + (set! (-> this flags) (manta-flags)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing use-momentum)) + (let ((v1-13 (-> this neck))) + (set! (-> v1-13 up) (the-as uint 1)) + (set! (-> v1-13 nose) (the-as uint 2)) + (set! (-> v1-13 ear) (the-as uint 0)) + (set-vector! (-> v1-13 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-13 ignore-angle) 30947.555) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-16)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this default-y-offset) (res-lump-float (-> this entity) 'y-offset :default 32768.0)) + (set! (-> this root dynam gravity y) 81920.0) + (set! (-> this root dynam gravity-length) 81920.0) + (set! (-> this root dynam gravity-max) 81920.0) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (set! (-> this go-enable) #t) + (set! (-> this up-dir quad) (-> *y-vector* quad)) + (set! (-> this forward-dir quad) (-> *z-vector* quad)) + (set! (-> this last-attack-time) 0) + (set! (-> this attack-path-blocked-time) 0) + (set! (-> this track-timer) 0) + (set! (-> this gravity) 81920.0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/mine/mine-mood.gc b/goal_src/jak3/levels/mine/mine-mood.gc index 7311065a00..4df3df34dc 100644 --- a/goal_src/jak3/levels/mine/mine-mood.gc +++ b/goal_src/jak3/levels/mine/mine-mood.gc @@ -7,3 +7,167 @@ ;; DECOMP BEGINS +(defun init-mood-minea ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 1))) + (let ((a1-0 (-> v1-0 dir0))) + (set! (-> a1-0 direction x) 0.0) + (set! (-> a1-0 direction y) 1.0) + (set! (-> a1-0 direction z) 0.0) + (set! (-> a1-0 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 dir0 extra x) 0.25) + (set! (-> v1-0 dir1 extra x) 0.0) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 0.25) + ) + (let ((v1-2 (-> arg0 light-group 2))) + (let ((a1-5 (-> v1-2 dir0))) + (set! (-> a1-5 direction x) 0.0) + (set! (-> a1-5 direction y) 1.0) + (set! (-> a1-5 direction z) 0.0) + (set! (-> a1-5 direction w) 0.0) + ) + (set-vector! (-> v1-2 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-2 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-2 dir0 extra x) 0.75) + (set! (-> v1-2 dir1 extra x) 0.0) + (set! (-> v1-2 dir2 extra x) 0.0) + (set! (-> v1-2 ambi extra x) 0.25) + ) + (let ((v1-4 (-> arg0 light-group 3))) + (let ((a0-1 (-> v1-4 dir0))) + (set! (-> a0-1 direction x) -0.2357) + (set! (-> a0-1 direction y) 0.9428) + (set! (-> a0-1 direction z) -0.2357) + (set! (-> a0-1 direction w) 0.0) + ) + (set-vector! (-> v1-4 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-4 ambi color) 0.3 0.25 0.4 1.0) + (set! (-> v1-4 dir0 extra x) 0.75) + (set! (-> v1-4 dir1 extra x) 0.0) + (set! (-> v1-4 dir2 extra x) 0.0) + (set! (-> v1-4 ambi extra x) 0.5) + ) + ) + +(defbehavior update-mood-minea time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (set! (-> arg0 times 0 w) 1.0) + ) + 0 + (none) + ) + +(deftype mineb-light-state (structure) + ((current float) + (target float) + ) + ) + + +(deftype mineb-states (structure) + ((lights mineb-light-state 3 :inline) + ) + ) + + +;; WARN: Return type mismatch symbol vs float. +(defun init-mood-mineb ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (dotimes (a0-1 3) + (set! (-> (&+ v1-0 (* a0-1 16)) 0) (the-as uint 0.0)) + (set! (-> (&+ v1-0 (* a0-1 16)) 1) (the-as uint 0.0)) + ) + ) + (the-as float #f) + ) + +(defbehavior update-mood-mineb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (let ((v1-0 (-> arg0 light-group))) + (set! (-> v1-0 0 dir0 extra x) 0.8) + (set! (-> v1-0 0 ambi extra x) 0.8) + ) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (-> arg0 state))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) (the-as float (-> gp-0 0))) + (set! (-> arg0 times 2 w) (the-as float (-> gp-0 4))) + (set! (-> arg0 times 3 w) (the-as float (-> gp-0 8))) + (when (not (paused?)) + (dotimes (s5-1 3) + (set! (-> (&+ gp-0 (* s5-1 16)) 0) + (the-as + uint + (seek (the-as float (-> (&+ gp-0 (* s5-1 16)) 0)) (the-as float (-> (&+ gp-0 (* s5-1 16)) 1)) 0.05) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun set-mineb-lights! ((arg0 int) (arg1 float)) + (let ((v1-1 (level-get *level* 'mineb))) + (when (and v1-1 (= (-> v1-1 status) 'active)) + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> (&+ v1-2 (* arg0 16)) 1) (the-as uint arg1)) + (if (= arg1 0.0) + (set! (-> (&+ v1-2 (* arg0 16)) 0) (the-as uint arg1)) + ) + ) + ) + ) + (none) + ) + +(deftype minec-states (structure) + ((light light-state :inline) + (electricity electricity-state :inline) + ) + ) + + +(defun init-mood-minec ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state)) + (f0-0 0.0) + ) + (set! (-> v1-0 3) (the-as uint f0-0)) + f0-0 + ) + ) + +(defbehavior update-mood-minec time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (-> arg0 state))) + (set! (-> arg0 times 6 w) 1.0) + (update-mood-light arg0 5 0 -1.0 0.0 arg1 0.0 2.0) + (cond + ((!= (the-as float (-> s4-1 3)) 0.0) + (update-mood-electricity arg0 7 8 1.2 1.7) + ) + ((or (>= arg1 18.0) (>= 6.0 arg1)) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/mine/mine-obs-h.gc b/goal_src/jak3/levels/mine/mine-obs-h.gc index 97fdecd22c..52842468b6 100644 --- a/goal_src/jak3/levels/mine/mine-obs-h.gc +++ b/goal_src/jak3/levels/mine/mine-obs-h.gc @@ -7,3 +7,4 @@ ;; DECOMP BEGINS +;; empty! \ No newline at end of file diff --git a/goal_src/jak3/levels/mine/mine-obs.gc b/goal_src/jak3/levels/mine/mine-obs.gc index 918b27e8b4..7e485a5071 100644 --- a/goal_src/jak3/levels/mine/mine-obs.gc +++ b/goal_src/jak3/levels/mine/mine-obs.gc @@ -7,3 +7,2123 @@ ;; DECOMP BEGINS +(defun mineb-activate () + (local-vars (sv-16 res-tag)) + (let ((a0-1 (entity-by-name "minb-part-1"))) + (when a0-1 + (let ((gp-0 (the-as (pointer actor-group) #f)) + (s5-0 0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data a0-1 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! gp-0 v1-2) + (set! s5-0 (the-as int (-> sv-16 elt-count))) + ) + ) + (when (> s5-0 0) + (dotimes (s5-1 (-> gp-0 0 length)) + (let ((a0-7 (-> gp-0 0 data s5-1 actor))) + (if a0-7 + (toggle-status (the-as entity-actor a0-7) (entity-perm-status subtask-complete) #t) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype rat-light-manager (process) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + ) + (:methods + (rat-light-manager-method-15 (_type_ int int symbol) none) + (rat-light-manager-method-16 (_type_ int symbol) none) + ) + ) + + +(defstate idle (rat-light-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('enter) + (rat-light-manager-method-16 self (command-get-int (-> block param 0) 0) #t) + ) + (('exit) + (rat-light-manager-method-16 self (command-get-int (-> block param 0) 0) #f) + ) + ) + ) + :code sleep-code + ) + +(defmethod run-logic? ((this rat-light-manager)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod rat-light-manager-method-15 ((this rat-light-manager) (arg0 int) (arg1 int) (arg2 symbol)) + (let ((v1-5 (-> this actor-group 0 data arg0 actor extra perm))) + (logior! (-> v1-5 status) (entity-perm-status bit-5)) + (set! (-> v1-5 user-object 0) (if arg2 + 1 + 0 + ) + ) + (if arg2 + (set-mineb-lights! arg1 (if (logtest? (-> v1-5 status) (entity-perm-status subtask-complete)) + 1.0 + 0.0 + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod rat-light-manager-method-16 ((this rat-light-manager) (arg0 int) (arg1 symbol)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (if arg1 + (rat-light-manager-method-15 this 0 0 #t) + ) + ) + ((= v1-0 1) + (if arg1 + (rat-light-manager-method-15 this 1 1 #t) + ) + ) + ((= v1-0 2) + (if arg1 + (rat-light-manager-method-15 this 2 2 #t) + ) + ) + ((= v1-0 3) + (cond + (arg1 + (rat-light-manager-method-15 this 0 0 #f) + (rat-light-manager-method-15 this 3 0 #t) + ) + (else + (rat-light-manager-method-15 this 0 0 #t) + (rat-light-manager-method-15 this 3 0 #f) + ) + ) + ) + ((= v1-0 4) + (cond + (arg1 + (rat-light-manager-method-15 this 1 1 #f) + (rat-light-manager-method-15 this 4 1 #t) + ) + (else + (rat-light-manager-method-15 this 1 1 #t) + (rat-light-manager-method-15 this 4 1 #f) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this rat-light-manager) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (dotimes (s5-0 5) + (rat-light-manager-method-16 this s5-0 #f) + ) + (go (method-of-object this idle)) + ) + +(deftype min-rat-engine (process-drawable) + ((root collide-shape-moving :override) + (init-quat quaternion :inline) + (force-pos vector :inline) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (rot-speed float) + (ang-momentum float) + (rat-timer time-frame) + (notify-actor entity-actor) + (sound-id sound-id) + (rat-sound-id sound-id) + (rat-wheel-sound-id sound-id) + (light-index uint32) + (light-target float) + (wheel-angle float) + (wheel-sound-volume float) + (last-turn-time time-frame) + (rat-count uint32) + ) + (:state-methods + inactive + active + running + shutdown + ) + (:methods + (min-rat-engine-method-24 (_type_) none) + (min-rat-engine-method-25 (_type_) none) + (min-rat-engine-method-26 (_type_ float float float float) symbol) + (min-rat-engine-method-27 (_type_ process focus) none) + (min-rat-engine-method-28 (_type_) none) + ) + ) + + +(defskelgroup skel-min-rat-engine min-rat-engine min-rat-engine-lod0-jg min-rat-engine-idle-ja + ((min-rat-engine-lod0-mg (meters 20)) (min-rat-engine-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 3 11) + :origin-joint-index 5 + ) + +;; WARN: Return type mismatch collide-shape vs none. +(defmethod min-rat-engine-method-24 ((this min-rat-engine)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 9011.2 30720.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) -13516.8 6553.6 -16384.0 9830.4) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) -1638.4 13926.4 -13926.4 22118.4) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 13516.8 40960.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> this root) (the-as collide-shape-moving s5-0)) + ) + (none) + ) + +(defbehavior min-rat-engine-handler min-rat-engine ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('ridden) + (min-rat-engine-method-27 self arg0 (the-as focus (-> arg3 param 0))) + ) + (('inside?) + (if (min-rat-engine-method-26 self (the-as float arg0) 25395.2 21299.2 8192.0) + #t + ) + ) + (('near?) + (if (min-rat-engine-method-26 self (the-as float arg0) 30720.0 24780.8 32768.0) + #t + ) + ) + (('wait-pos) + (let ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node min-rat-engine-lod0-jg ratrotation))) + (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self init-quat))) + ) + (vector+float*! (the-as vector (-> arg3 param 0)) s5-0 v1-7 32768.0) + ) + ) + (('run-dir) + (vector-normalize! + (vector-cross! + (the-as vector (-> arg3 param 0)) + *y-vector* + (vector-z-quaternion! (the-as vector (-> arg3 param 0)) (-> self root quat)) + ) + 1.0 + ) + ) + (('run-pos) + (let* ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node min-rat-engine-lod0-jg ratrotation))) + (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self init-quat))) + (s5-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self init-quat))) + (s3-2 (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> arg3 param 0)) s2-0) + s1-0 + ) + ) + (gp-0 (the-as object (-> arg3 param 1))) + ) + (let ((f30-0 2.0)) + (vector+float*! (the-as vector gp-0) s2-0 s1-0 12288.0) + (+! (-> s3-2 y) -8192.0) + (vector-normalize! s3-2 20480.0) + (vector+! (the-as vector gp-0) (the-as vector gp-0) s3-2) + (vector+float*! + (the-as vector gp-0) + (the-as vector gp-0) + s5-2 + (* 4096.0 + (+ 0.3 + (* 1.5 (sin (* 65536.0 (/ (the float (mod (current-time) (the int (* 300.0 f30-0)))) (* 300.0 f30-0))))) + ) + ) + ) + ) + gp-0 + ) + ) + (('run-up) + (let* ((a0-28 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node min-rat-engine-lod0-jg ratrotation))) + (a1-26 (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> arg3 param 0)) a0-28) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + ) + ) + ) + (vector-normalize-copy! (the-as vector (-> arg3 param 1)) a1-26 -1.0) + ) + ) + ) + ) + +(defbehavior min-rat-engine-post min-rat-engine () + (let ((v1-2 (-> self entity extra perm))) + (when (logtest? (-> v1-2 status) (entity-perm-status bit-5)) + (if (= (-> v1-2 user-object 0) 1) + (set-mineb-lights! (the-as int (-> self light-index)) (-> self light-target)) + ) + ) + ) + (min-rat-engine-method-28 self) + (min-rat-engine-method-25 self) + (rider-post) + (none) + ) + +(defstate inactive (min-rat-engine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual running) + ) + (('turn) + (go-virtual running) + ) + (('claim-wheel?) + (let ((v1-6 (+ (-> self rat-count) 1))) + (set! (-> self rat-count) v1-6) + (= v1-6 1) + ) + ) + (else + (min-rat-engine-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self force-pos quad) (-> self root trans quad)) + ) + :trans (behavior () + (if (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 204800.0) + (go-virtual active) + ) + ) + :code sleep-code + :post (behavior () + (min-rat-engine-method-28 self) + (if (< 0.0 (-> self ang-momentum)) + (ja-post) + ) + ) + ) + +(defstate active (min-rat-engine) + :virtual #t + :event (-> (method-of-type min-rat-engine inactive) event) + :trans (behavior () + (set! (-> self force-pos quad) (-> self root trans quad)) + (rider-trans) + (if (< 245760.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) + (go-virtual inactive) + ) + ) + :code (behavior () + (sleep-code) + ) + :post (behavior () + (min-rat-engine-post) + ) + ) + +(defstate running (min-rat-engine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('turn) + (let ((f0-0 2.0)) + (seek! + (-> self ang-momentum) + (* 8192.0 + (+ -91.68 + (* 16.68 (sin (* 65536.0 (/ (the float (mod (current-time) (the int (* 300.0 f0-0)))) (* 300.0 f0-0))))) + ) + ) + (* 409600.0 (seconds-per-frame)) + ) + ) + (let ((v0-2 (the-as object (current-time)))) + (set! (-> self last-turn-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('running?) + #t + ) + (else + (min-rat-engine-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self rot-speed) 0.0) + (set-time! (-> self state-time)) + (set-time! (-> self last-turn-time)) + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-10 (-> self notify-actor)) + ) + (t9-0 + (if v1-10 + (-> v1-10 extra process) + ) + a1-0 + ) + ) + ) + (dotimes (gp-0 (+ (-> self actor-group-count) -1)) + (let ((s5-0 (-> self actor-group gp-0))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-19 (-> s5-0 data s4-0 actor)) + ) + (t9-1 + (if v1-19 + (-> v1-19 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + ) + (let ((v1-32 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-32 prim-core action) (collide-action solid)) + (set! (-> v1-32 prim-core collide-as) (collide-spec obstacle camera-blocker)) + ) + (sound-play "rat-wheel-raise") + (set! (-> self wheel-sound-volume) 0.0) + ) + :trans (behavior () + (rider-trans) + (if (time-elapsed? (-> self last-turn-time) (seconds 0.5)) + (go-virtual shutdown) + ) + ) + :code (behavior () + (ja-no-eval :group! min-rat-engine-raise-ja :num! (seek! max 0.04) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.04)) + ) + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status bit-13)))) + (if (res-lump-struct (-> self entity) 'camera-name structure) + (process-spawn + external-camera-controller + (-> self entity) + 1200 + #f + :name "external-camera-controller" + :to *entity-pool* + ) + ) + (process-entity-status! self (entity-perm-status bit-13) #t) + ) + (let ((gp-1 (+ (-> self actor-group-count) -1))) + (dotimes (s5-0 (-> self actor-group gp-1 length)) + (toggle-status + (the-as entity-actor (-> self actor-group gp-1 data s5-0 actor)) + (entity-perm-status subtask-complete) + #f + ) + ) + ) + (until #f + (ja-no-eval :group! min-rat-engine-spin-ja :num! (seek! max 0.4) :frame-num 0.0) + (until (ja-done? 0) + (seek! (-> self light-target) 1.0 (seconds-per-frame)) + (let ((gp-2 (-> self actor-group (+ (-> self actor-group-count) -1)))) + (dotimes (s5-1 (-> gp-2 length)) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) (process->ppointer self)) + (set! (-> a1-10 num-params) 0) + (set! (-> a1-10 message) 'start) + (let ((t9-11 send-event-function) + (v1-70 (-> gp-2 data s5-1 actor)) + ) + (t9-11 + (if v1-70 + (-> v1-70 extra process) + ) + a1-10 + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.4)) + ) + ) + #f + ) + :post (behavior () + (sound-play "rat-whl-squeak" :id (-> self rat-sound-id)) + (sound-play-by-name + (static-sound-name "rat-wheel-gear") + (-> self rat-wheel-sound-id) + (the int (* 1024.0 (-> self wheel-sound-volume))) + 0 + 0 + (sound-group) + #t + ) + (seek! (-> self wheel-sound-volume) 1.0 (* 2.0 (seconds-per-frame))) + (min-rat-engine-post) + ) + ) + +(defstate shutdown (min-rat-engine) + :virtual #t + :event min-rat-engine-handler + :enter (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-3 prim-core action) (collide-action)) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + ) + 0 + ) + :trans rider-trans + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! min-rat-engine-lower-ja :num! (seek! max 0.03) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.03)) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (go-virtual inactive) + ) + :post (behavior () + (seek! (-> self wheel-sound-volume) 1.0 (* 2.0 (seconds-per-frame))) + (min-rat-engine-post) + ) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod min-rat-engine-method-25 ((this min-rat-engine)) + (if (!= (-> this ang-momentum) 0.0) + (sound-play-by-name + (static-sound-name "rat-wheel-loop") + (-> this sound-id) + (the int (* 1024.0 (lerp-scale 0.0 1.0 (fabs (-> this ang-momentum)) 0.0 409600.0))) + (the int (* 1524.0 (lerp-scale -1.0 0.0 (fabs (-> this ang-momentum)) 0.0 409600.0))) + 0 + (sound-group) + #t + ) + ) + (none) + ) + +(defmethod min-rat-engine-method-27 ((this min-rat-engine) (arg0 process) (arg1 focus)) + (when (= arg0 this) + (let ((a2-1 (handle->process (-> arg1 handle)))) + (if a2-1 + (set! (-> this force-pos quad) (-> (the-as process-focusable a2-1) root trans quad)) + ) + ) + ) + 0 + (none) + ) + +(defmethod min-rat-engine-method-28 ((this min-rat-engine)) + (let ((a0-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this init-quat))) + (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> this force-pos) (-> this root trans))) + ) + (+! (-> this ang-momentum) (* 10.0 (seconds-per-frame) (- (vector-dot a0-2 v1-1)))) + ) + (set! (-> this wheel-angle) + (the float + (sar + (shl + (the int (+ (-> this wheel-angle) (* 182.04445 (seconds-per-frame) (* 0.00024414062 (-> this ang-momentum))))) + 48 + ) + 48 + ) + ) + ) + (set! (-> this ang-momentum) (* 0.99 (-> this ang-momentum))) + 0 + (none) + ) + +(defmethod min-rat-engine-method-26 ((this min-rat-engine) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (with-pp + (let ((v1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-0 from) (process->ppointer pp)) + (set! (-> v1-0 num-params) 1) + (set! (-> v1-0 message) 'trans) + (set! (-> v1-0 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let ((s2-0 (send-event-function (the-as process-tree arg0) v1-0))) + (when s2-0 + (let* ((s1-0 (-> this root trans)) + (a2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (a1-4 (vector-! (new 'stack-no-clear 'vector) (the-as vector s2-0) s1-0)) + (f30-0 (vector-dot a1-4 a2-2)) + (s3-1 (vector-flatten! (new 'stack-no-clear 'vector) a1-4 a2-2)) + ) + (and (< 0.0 f30-0) + (< f30-0 arg1) + (< (vector-length s3-1) arg2) + (< (cos arg3) (fabs (vector-dot s3-1 (vector-negate! (new 'stack-no-clear 'vector) *y-vector*)))) + ) + ) + ) + ) + ) + ) + ) + +(defmethod deactivate ((this min-rat-engine)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this sound-id)) + (sound-stop (-> this rat-sound-id)) + (sound-stop (-> this rat-wheel-sound-id)) + (call-parent-method this) + (none) + ) + +(defun joint-mod-rat-engine-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (-> arg0 param1))) + (quaternion-rotate-z! (-> arg1 quat) (-> arg1 quat) (-> (the-as min-rat-engine v1-0) wheel-angle)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(defmethod init-from-entity! ((this min-rat-engine) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (min-rat-engine-method-24 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-rat-engine" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (set! (-> this notify-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-14 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-14 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-14)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (let ((a0-10 (-> this node-list data 6))) + (set! (-> a0-10 param0) joint-mod-rat-engine-callback) + (set! (-> a0-10 param1) this) + ) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this rat-sound-id) (new-sound-id)) + (set! (-> this rat-wheel-sound-id) (new-sound-id)) + (set! (-> this light-index) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) + (set! (-> this light-target) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + 1.0 + 0.0 + ) + ) + (set! (-> this wheel-angle) 0.0) + (set! (-> this rat-count) (the-as uint 0)) + (set! (-> this ang-momentum) 0.0) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (go (method-of-object this inactive)) + ) + +(deftype min-crane (process-drawable) + () + (:state-methods + idle + ) + (:methods + (min-crane-method-21 (_type_) none) + ) + ) + + +(defskelgroup skel-min-crane min-crane min-crane-lod0-jg min-crane-idle-ja + ((min-crane-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 12) + :origin-joint-index 3 + ) + +(defstate idle (min-crane) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod min-crane-method-21 ((this min-crane)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 9) 0))) + (set! (-> s5-0 total-prims) (the-as uint 10)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 82.7392 -16090.727 1494.6304 47322.727) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 8350.516 3842.048 -22282.24 10069.197) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 6) + (set-vector! (-> v1-10 local-sphere) 8350.516 3842.048 -1823.9489 10069.197) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 5) + (set-vector! (-> v1-12 local-sphere) 8362.394 -8660.173 -23385.293 18361.959) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 5) + (set-vector! (-> v1-14 local-sphere) 8362.394 -8660.173 -2926.592 18361.959) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 9) + (set-vector! (-> v1-16 local-sphere) -8350.516 -3841.2288 22282.24 10069.197) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 9) + (set-vector! (-> v1-18 local-sphere) -8350.516 -3841.2288 1823.9489 10069.197) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 8) + (set-vector! (-> v1-20 local-sphere) -8362.394 8660.173 23385.293 18361.959) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-22 prim-core action) (collide-action solid)) + (set! (-> v1-22 transform-index) 8) + (set-vector! (-> v1-22 local-sphere) -8362.394 8660.173 2926.592 18361.959) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-24 prim-core action) (collide-action solid)) + (set! (-> v1-24 transform-index) 4) + (set-vector! (-> v1-24 local-sphere) 0.0 -4455.629 0.0 23633.51) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this min-crane) (arg0 entity-actor)) + (min-crane-method-21 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-crane" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +(deftype min-target-sign (mine-platform-base) + ((off-part sparticle-launch-control) + (on-part sparticle-launch-control) + (track-pos vector :inline) + (alt-actor entity-actor) + (touched-train? symbol) + ) + (:state-methods + dormant + idle + lowering + idle-down + ) + (:methods + (spawn-on-off-part (_type_ symbol) object) + ) + ) + + +(defskelgroup skel-min-target-sign min-target-sign min-target-sign-lod0-jg min-target-sign-idle-ja + ((min-target-sign-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 3 22) + ) + +;; WARN: Return type mismatch symbol vs object. +(defbehavior target-sign-event-handler min-target-sign ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('down?) + (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete)) + ) + ) + ) + +(defstate dormant (min-target-sign) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :enter (behavior () + (setup-masks (-> self draw) 4 10) + ) + :trans (behavior () + (if (task-node-open? (game-task-node mine-blow-resolution)) + (go-virtual idle) + ) + ) + :code sleep-code + ) + +(defstate idle (min-target-sign) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (-> block param 1) + (let ((gp-0 (the-as touching-shapes-entry (-> block param 0)))) + (cond + (gp-0 + (let ((s5-0 (-> gp-0 head))) + (while s5-0 + (let ((v1-5 (get-touched-prim s5-0 (-> self root) gp-0))) + (when (= (-> v1-5 prim-id) #x7400e700) + (sound-play "target-hit") + (go-virtual lowering) + ) + ) + (set! s5-0 (-> s5-0 next)) + ) + ) + #f + ) + (else + (sound-play "target-hit") + (go-virtual lowering) + ) + ) + ) + ) + (('hit) + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + (go-virtual lowering) + ) + (else + (target-sign-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self mask) (process-mask enemy)) + (setup-masks (-> self draw) 8 6) + ) + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (spawn-on-off-part self #f) + ) + :code transform-and-sleep-code + ) + +(defstate lowering (min-target-sign) + :virtual #t + :parent (min-target-sign plat-base-state) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (when (send-event proc 'go-explode) + (let ((v0-1 (the-as object #t))) + (set! (-> self touched-train?) (the-as symbol v0-1)) + v0-1 + ) + ) + ) + (else + (target-sign-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (setup-masks (-> self draw) 2 12) + ) + :trans (behavior () + (when (>= 2.75 (ja-frame-num 0)) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-0) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-0 0)) + (ja-no-eval :group! min-target-sign-trackdown-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((f30-0 (ja-frame-num 0)) + (s5-0 (ja-num-frames 0)) + ) + (when (and (< 2.75 f30-0) + (not (-> self touched-train?)) + (not (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'rail-down) + (let ((t9-4 send-event-function) + (v1-27 (-> self alt-actor)) + ) + (t9-4 + (if v1-27 + (-> v1-27 extra process) + ) + a1-2 + ) + ) + ) + ) + (when (< gp-0 (the int f30-0)) + (if (= (the int f30-0) (+ s5-0 -13)) + (sound-play "track-fall") + ) + ) + ) + (set! gp-0 (the int (ja-frame-num 0))) + (spawn-on-off-part self #t) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual idle-down) + ) + ) + +(defstate idle-down (min-target-sign) + :virtual #t + :parent (min-target-sign plat-base-state) + :event target-sign-event-handler + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (spawn-on-off-part self #t) + ) + :code (behavior () + (ja :group! min-target-sign-idleb-ja :num! none :frame-num 0.0) + (transform-and-sleep-code) + ) + ) + +(defmethod spawn-on-off-part ((this min-target-sign) (arg0 symbol)) + (spawn + (if arg0 + (-> this on-part) + (-> this off-part) + ) + (-> this node-list data 15 bone transform trans) + ) + (spawn + (if arg0 + (-> this on-part) + (-> this off-part) + ) + (-> this node-list data 16 bone transform trans) + ) + ) + +;; WARN: Return type mismatch mine-platform-base vs min-target-sign. +(defmethod relocate ((this min-target-sign) (offset int)) + (if (nonzero? (-> this off-part)) + (&+! (-> this off-part) offset) + ) + (if (nonzero? (-> this on-part)) + (&+! (-> this on-part) offset) + ) + (the-as min-target-sign ((method-of-type mine-platform-base relocate) this offset)) + ) + +(defmethod deactivate ((this min-target-sign)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this off-part)) + (kill-particles (-> this off-part)) + ) + (if (nonzero? (-> this on-part)) + (kill-particles (-> this on-part)) + ) + ((method-of-type mine-platform-base deactivate) this) + (none) + ) + +(defmethod get-skel ((this min-target-sign)) + (art-group-get-by-name *level* "skel-min-target-sign" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init-collision! ((this min-target-sign)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak obstacle hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 14) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 24576.0 69632.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-11 prim-core action) (collide-action)) + (set! (-> v1-11 transform-index) 14) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 49152.0 32768.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> v1-13 transform-index) 14) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 38912.0 53248.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 -20480.0 4096.0 24576.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint #x7400e700)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-17 prim-core action) (collide-action)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 10240.0 -23756.8 1228.8 10240.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint #x7400e700)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-19 prim-core action) (collide-action)) + (set! (-> v1-19 transform-index) 3) + (set-vector! (-> v1-19 local-sphere) -10240.0 -23756.8 1228.8 10240.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-22 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this root event-self) 'touched) + (none) + ) + +;; WARN: Return type mismatch structure vs vector. +(defmethod get-trans ((this min-target-sign) (arg0 int)) + "Get the `trans` for this process." + (the-as vector (cond + ((= arg0 3) + (let* ((s4-0 (-> this root)) + (gp-0 (-> s4-0 root-prim)) + ) + (if (< 0.0 (vector-dot + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> s4-0 trans)) + (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) + ) + ) + (-> (the-as collide-shape-prim-group gp-0) child 3 prim-core) + (-> (the-as collide-shape-prim-group gp-0) child 4 prim-core) + ) + ) + ) + (else + ((method-of-type process-focusable get-trans) this arg0) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this min-target-sign)) + (let ((v0-0 0)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (set! v0-0 (logior v0-0 40)) + ) + (the-as search-info-flag v0-0) + ) + ) + +(defmethod init-from-entity! ((this min-target-sign) (arg0 entity-actor)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this off-part) (create-launch-control (-> *part-group-id-table* 598) this)) + (set! (-> this on-part) (create-launch-control (-> *part-group-id-table* 599) this)) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this touched-train?) #f) + (let ((v1-11 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution)))) + (when (and v1-11 (< (the-as uint 2) (-> v1-11 death-count))) + (let ((f0-1 (/ 1.0 (- 1.0 (* 0.04 (the float (max 0 (min 5 (the-as int (+ (-> v1-11 death-count) -2))))))))) + (v1-15 (the-as collide-shape-prim-group (-> this root root-prim))) + ) + (set! (-> v1-15 child 3 local-sphere w) (* (-> v1-15 child 3 local-sphere w) f0-1)) + (set! (-> v1-15 child 4 local-sphere w) (* (-> v1-15 child 4 local-sphere w) f0-1)) + ) + ) + ) + (cond + ((or (task-node-closed? (game-task-node mine-blow-resolution)) + (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + ) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) + (set! (-> a0-23 frame-num) 0.0) + (joint-control-channel-group-eval! + a0-23 + (the-as art-joint-anim (-> this draw art-group data 5)) + num-func-none + ) + ) + (ja-post) + (go (method-of-object this idle-down)) + ) + ((task-node-open? (game-task-node mine-blow-resolution)) + (let ((a0-25 (-> this skel root-channel 0))) + (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-25 frame-num) 1.0) + (joint-control-channel-group-eval! + a0-25 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-none + ) + ) + (ja-post) + (go (method-of-object this idle)) + ) + (else + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + (set! (-> a0-26 frame-num) 0.0) + (joint-control-channel-group-eval! + a0-26 + (the-as art-joint-anim (-> this draw art-group data 2)) + num-func-none + ) + ) + (ja-post) + (go (method-of-object this dormant)) + ) + ) + ) + +(deftype min-bomb-elevator (elevator) + ((alt-actor entity-actor) + (bomb-train-offset float) + (wheel-angle float) + ) + ) + + +(defskelgroup skel-min-bomb-elevator min-bomb-elevator min-bomb-elevator-lod0-jg min-bomb-elevator-idle-ja + ((min-bomb-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +(defstate waiting (min-bomb-elevator) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('ridden) + (process-grab? *target* #f) + ) + ) + ((-> (method-of-type elevator waiting) event) proc argc message block) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator waiting) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (when (task-node-closed? (game-task-node mine-blow-elevator)) + (send-event self 'jump-to 'top) + (go-virtual dormant) + ) + ) + ) + +(defstate running (min-bomb-elevator) + :virtual #t + :enter (behavior () + (set-setting! 'music #f 0.0 0) + (let ((t9-1 (-> (method-of-type elevator running) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator running) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (let* ((a0-0 (-> self alt-actor)) + (v1-4 (if a0-0 + (-> a0-0 extra process) + ) + ) + ) + (if v1-4 + (set! (-> (the-as process-drawable v1-4) root trans y) (+ (-> self root trans y) (-> self bomb-train-offset))) + ) + ) + ) + ) + +(defstate arrived (min-bomb-elevator) + :virtual #t + :enter (behavior () + (remove-setting! 'music) + (let ((t9-1 (-> (method-of-type elevator arrived) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 3))) + (set! (-> a1-0 2) 'mine6) + (set! (-> a1-0 1) 'mine5) + (set! (-> a1-0 0) 'mine4) + (want-sound-banks *load-state* a1-0) + ) + (go-virtual dormant) + ) + ) + +(defun min-bomb-elevator-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as min-bomb-elevator (-> arg0 param1)))) + (when (and (-> v1-0 next-state) (= (-> v1-0 next-state name) 'running)) + (set! (-> v1-0 wheel-angle) + (the float + (sar (shl (the int (+ (-> v1-0 wheel-angle) (* -0.52040726 (seconds-per-frame) (-> v1-0 speed)))) 48) 48) + ) + ) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> v1-0 wheel-angle)) + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + 0 + (none) + ) + +(defmethod get-art-group ((this min-bomb-elevator)) + (art-group-get-by-name *level* "skel-min-bomb-elevator" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-bomb-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 11) 0))) + (set! (-> s5-0 total-prims) (the-as uint 12)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 204800.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 61.0304 4443.7505 -46.6944 153172.38) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 30.72 13204.275 -46.6944 137356.9) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) -7494.0415 18259.148 -1234.1248 130382.234) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 3) + (set-vector! (-> v1-19 local-sphere) 13039.616 18259.148 -1234.1248 130382.234) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-21 prim-core action) (collide-action solid rideable)) + (set! (-> v1-21 transform-index) 3) + (set-vector! (-> v1-21 local-sphere) -51408.895 58564.61 -18715.443 124619.984) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 51921.305 58564.61 -18715.443 124619.984) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-25 prim-core action) (collide-action solid rideable)) + (set! (-> v1-25 transform-index) 3) + (set-vector! (-> v1-25 local-sphere) 56478.926 37066.344 -122880.0 32969.113) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-27 prim-core action) (collide-action solid rideable)) + (set! (-> v1-27 transform-index) 3) + (set-vector! (-> v1-27 local-sphere) -56412.98 37066.344 -122880.0 32969.113) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-29 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-29 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-29 prim-core action) (collide-action solid rideable)) + (set! (-> v1-29 transform-index) 3) + (set-vector! (-> v1-29 local-sphere) -78.2336 100379.03 -123167.945 81738.14) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 9) (the-as uint 0)))) + (set! (-> v1-31 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-31 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-31 prim-core action) (collide-action solid rideable)) + (set! (-> v1-31 transform-index) 3) + (set-vector! (-> v1-31 local-sphere) -78.2336 39539.918 -123167.945 50748.62) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 10) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-34 prim-core action) (collide-action solid)) + (set! (-> v1-34 transform-index) 3) + (set-vector! (-> v1-34 local-sphere) 0.0 0.0 0.0 204800.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-37 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-37 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-37 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this min-bomb-elevator)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (if (-> this alt-actor) + (set! (-> this bomb-train-offset) (- (-> this alt-actor extra trans y) (-> this entity extra trans y))) + ) + (let ((v1-9 (-> this skel root-channel 0))) + (set! (-> v1-9 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (ja-post) + (let ((a0-7 (-> this node-list data 4))) + (set! (-> a0-7 param0) min-bomb-elevator-callback) + (set! (-> a0-7 param1) this) + (set! (-> a0-7 param2) (the-as basic 0)) + ) + (set! (-> this sound-running-loop) (static-sound-spec "mine-elev-start" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "mine-elev-stop" :group 1)) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-arrived-or-waiting ((this min-bomb-elevator)) + (if (task-node-closed? (game-task-node mine-blow-introduction)) + (go (method-of-object this waiting)) + ) + (go (method-of-object this dormant)) + (none) + ) + +(deftype min-elev-doors (process-drawable) + () + (:state-methods + idle + open + opened + ) + (:methods + (min-elev-doors-method-23 (_type_) none) + ) + ) + + +(defskelgroup skel-min-elev-doors min-elev-doors min-elev-doors-lod0-jg min-elev-doors-idle-ja + ((min-elev-doors-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +(defstate idle (min-elev-doors) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual open) + ) + (('open?) + #f + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post transform-post + ) + +(defstate open (min-elev-doors) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open?) + #t + ) + ) + ) + :code (behavior () + (sound-play "mine-door") + (ja-no-eval :group! min-elev-doors-open-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual opened) + ) + :post transform-post + ) + +(defstate opened (min-elev-doors) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open?) + #t + ) + ) + ) + :code (behavior () + (ja-channel-set! 1) + (ja :group! min-elev-doors-open-ja :num! (identity (the float (ja-num-frames 0)))) + (transform-post) + (sleep-code) + ) + ) + +(defmethod min-elev-doors-method-23 ((this min-elev-doors)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 409600.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 -40960.0 184320.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 40960.0 184320.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this min-elev-doors) (arg0 entity-actor)) + (min-elev-doors-method-23 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-elev-doors" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (task-node-open? (game-task-node mine-blow-resolution)) + ) + (go (method-of-object this opened)) + ) + (go (method-of-object this idle)) + ) + +(deftype min-crane-switch (basebutton) + ((rog handle) + ) + ) + + +(defskelgroup skel-min-crane-switch min-crane-switch min-crane-switch-lod0-jg min-crane-switch-idle-ja + ((min-crane-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate down-idle (min-crane-switch) + :virtual #t + :code (behavior () + (sound-play "floor-switch") + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.5)) + (suspend) + ) + ) + (when (not (task-node-closed? (game-task-node mine-blow-introduction))) + (let ((a1-1 (new 'stack-no-clear 'array 'symbol 3))) + (set! (-> a1-1 2) 'mine6) + (set! (-> a1-1 1) 'mine5) + (set! (-> a1-1 0) 'mine10) + (want-sound-banks *load-state* a1-1) + ) + (suspend) + (process-spawn scene-player :init scene-player-init "mine-train-intro" #t #f :name "scene-player") + ) + (sleep-code) + ) + ) + +(defstate up-idle (min-crane-switch) + :virtual #t + :exit (behavior () + (send-event (handle->process (-> self rog)) 'leave) + (let ((t9-1 (-> (method-of-type basebutton up-idle) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type basebutton up-idle) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (or (task-node-closed? (game-task-node mine-explore-armor)) + (and (kiosk?) (task-node-open? (game-task-node mine-explore-armor))) + ) + (= (-> self rog) #f) + ) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags taf8)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (set! (-> self rog) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + ) + ) + +(defmethod init-collision! ((this min-crane-switch)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 3686.4 1843.2 5324.8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-skel-and-ja! ((this min-crane-switch)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-crane-switch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> this draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (set! (-> this anim-speed) 2.0) + (set! (-> this rog) (the-as handle #f)) + (transform-post) + (none) + ) + +(defmethod prepare-trigger-event! ((this min-crane-switch)) + (logior! (-> this button-status) (button-status button-status-3)) + 0 + (none) + ) + +(deftype min-door (process-drawable) + () + (:state-methods + idle + exploded + ) + (:methods + (min-door-method-22 (_type_) none) + (min-door-method-23 (_type_) none) + ) + ) + + +(defskelgroup skel-min-door min-door min-door-lod0-jg min-door-idle-ja + ((min-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +(defskelgroup skel-min-door-break min-door-break min-door-break-lod0-jg min-door-break-idle-ja + ((min-door-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + :origin-joint-index 3 + ) + +(defstate idle (min-door) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('subtask-complete) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + ) + ) + :code (behavior () + (ja :group! (ja-group) :num! min) + (transform-and-sleep) + ) + ) + +(defstate exploded (min-door) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (transform-and-sleep) + ) + ) + +(defmethod min-door-method-22 ((this min-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 143360.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 143360.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod min-door-method-23 ((this min-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 163840.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 38912.0 0.0 102400.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) -71680.0 -51200.0 71680.0 40960.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) -61440.0 -51200.0 0.0 61440.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 40960.0 -40960.0 20480.0 81920.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this min-door) (arg0 entity-actor)) + (cond + ((or (task-node-closed? (game-task-node mine-blow-resolution)) + (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + ) + (min-door-method-23 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-door-break" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this exploded)) + ) + (else + (min-door-method-22 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + ) + ) + +(deftype min-elec-gate (elec-gate) + () + ) + + +(defmethod elec-gate-method-30 ((this min-elec-gate) (arg0 float)) + (let ((v1-1 (level-get *level* 'minec))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 3) (the-as uint arg0)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-initial-state ((this min-elec-gate)) + (if (task-node-closed? (game-task-node mine-blow-elevator)) + ((method-of-type elec-gate go-initial-state) this) + (go (method-of-object this idle)) + ) + 0 + ) + +(deftype min-boss-elev (elevator) + ((going-down? symbol) + (sound-rotating-loop sound-spec) + ) + ) + + +(defskelgroup skel-min-boss-elev min-boss-elev min-boss-elev-lod0-jg min-boss-elev-idle-ja + ((min-boss-elev-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(defstate dormant (min-boss-elev) + :virtual #t + :enter (behavior () + (quaternion-copy! (-> self root quat) (-> self entity quat)) + ) + ) + +(defstate running (min-boss-elev) + :virtual #t + :post (behavior () + (let ((gp-0 (-> self root quat)) + (s5-0 (-> self entity quat)) + ) + (quaternion-pseudo-seek gp-0 gp-0 s5-0 0.005) + (if (nonzero? (-> self sound-rotating-loop)) + (sound-play-by-spec (-> self sound-rotating-loop) (-> self sound-id) (-> self root trans)) + ) + (cond + ((< 0.9999976 (fabs (-> (quaternion*! + (new 'stack-no-clear 'quaternion) + (quaternion-inverse! (new 'stack-no-clear 'quaternion) gp-0) + s5-0 + ) + w + ) + ) + ) + (when (not (-> self going-down?)) + (set! (-> self going-down?) #t) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new-sound-id)) + ) + (let ((t9-6 (-> (method-of-type elevator running) post))) + (if t9-6 + ((the-as (function none) t9-6)) + ) + ) + ) + (else + (move-post) + ) + ) + ) + ) + ) + +(defmethod get-art-group ((this min-boss-elev)) + (art-group-get-by-name *level* "skel-min-boss-elev" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-boss-elev)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 61440.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! (-> this root) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this min-boss-elev)) + (set! (-> this bounce-scale) 0.0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) -11468.8) + (set! (-> this going-down?) #f) + (set! (-> this sound-running-loop) (static-sound-spec "boss-elev" :group 1)) + (set! (-> this sound-rotating-loop) (static-sound-spec "platform-turn" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "boss-elev-end" :group 1)) + (none) + ) + +(defskelgroup skel-min-airlock-door min-airlock-door min-airlock-door-lod0-jg min-airlock-door-idle-ja + ((min-airlock-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + ) + +(deftype min-airlock-door (com-airlock) + () + ) + + +(defmethod init-from-entity! ((this min-airlock-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 40960.0 0.0 102400.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 51200.0 40960.0 0.0 61440.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -51200.0 40960.0 0.0 61440.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-airlock-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this open-frame) 30.0) + (set! (-> this sound-open) (static-sound-spec "mine-door2" :group 1)) + (set! (-> this sound-close) (static-sound-spec "mine-door2" :group 1)) + (go (method-of-object this close) #t) + ) + +(deftype mine-music-manager (task-manager) + () + ) + + +(defmethod set-time-limit ((this mine-music-manager)) + ((method-of-type task-manager set-time-limit) this) + (set-setting! 'music 'minexplr 0.0 0) + (none) + ) diff --git a/goal_src/jak3/levels/mine/mine-part.gc b/goal_src/jak3/levels/mine/mine-part.gc index 5e7be111af..a8d1cd544e 100644 --- a/goal_src/jak3/levels/mine/mine-part.gc +++ b/goal_src/jak3/levels/mine/mine-part.gc @@ -7,3 +7,1670 @@ ;; DECOMP BEGINS +(defpartgroup group-minb-light-glow + :id 597 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2310 :fade-after (meters 120) :flags (sp6)) + (sp-item 2311 :fade-after (meters 120) :flags (sp6)) + (sp-item 2312 :fade-after (meters 120) :flags (sp6)) + ) + ) + +(defpart 2310 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 70.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 2311 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 30.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 2312 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 2.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-min-target-sign-off + :id 598 + :bounds (static-bspherem 0 0 0 2.5) + :parts ((sp-item 2313 :flags (sp6))) + ) + +(defpart 2313 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0) + (:b 16.0) + (:a 28.0 2.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-min-target-sign-on + :id 599 + :bounds (static-bspherem 0 0 0 2.5) + :parts ((sp-item 2314 :flags (sp6))) + ) + +(defpart 2314 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 16.0) + (:b 255.0) + (:a 28.0 2.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2315 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.1)) + (:r 120.0 5.0) + (:g 120.0 5.0) + (:b 80.0 5.0) + (:a 128.0) + (:vel-z (meters -0.016666668) (meters -0.083333336)) + (:scalevel-x (meters -0.00066666666)) + (:rotvel-z (degrees -0.6666667) (degrees 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667) (meters -0.00033333333)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x408b00 #x40a200 #x40a600 #x40aa00)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -40) (degrees 80)) + (:conerot-y (degrees -40) (degrees 80)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2316 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.4) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 70.0) + (:b 50.0) + (:a 40.0 40.0) + (:vel-z (meters -0.033333335) (meters -0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.94) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees -40) (degrees 80)) + (:conerot-y (degrees -40) (degrees 80)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-minc-round-light-glow-always-on + :id 600 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2317 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2318 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2319 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2320 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2321 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2322 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2323 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2324 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2325 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2326 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2327 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2328 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2329 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + ) + ) + +(defpartgroup group-minc-round-light-glow + :id 601 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2317 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2318 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2319 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2320 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2321 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2322 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2323 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2324 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2325 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2326 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2327 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2328 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2329 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + ) + ) + +(defpart 2317 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.1)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2318 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 1.55)) + (:y (meters -0.05)) + (:z (meters -1.1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2319 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:y (meters -1.7)) + (:z (meters -1.15)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2320 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -2)) + (:y (meters 0.1)) + (:z (meters -1.13)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2321 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.1)) + (:y (meters 1.7)) + (:z (meters -1.05)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2322 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 1.2)) + (:y (meters 1.2)) + (:z (meters -1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2323 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -1.25)) + (:y (meters 1.1)) + (:z (meters -1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2324 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -1.4)) + (:y (meters -1.1)) + (:z (meters -1.1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2325 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 1.05)) + (:y (meters -1.3)) + (:z (meters -1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2326 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2327 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 45)) + ) + ) + +(defpart 2328 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees -45)) + ) + ) + +(defpart 2329 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +(defpartgroup group-minc-t-light-glow-always-on + :id 602 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2330 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2331 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2332 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2333 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2334 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2335 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2336 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2337 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2338 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2339 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2340 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2341 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2342 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2343 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2344 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2345 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2346 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2347 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2348 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2349 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2350 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2351 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2352 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2353 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2354 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + ) + ) + +(defpartgroup group-minc-t-light-glow + :id 603 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2330 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2331 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2332 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2333 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2334 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2335 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2336 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2337 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2338 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2339 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2340 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2341 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2342 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2343 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2344 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2345 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2346 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2347 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2348 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2349 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2350 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2351 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2352 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2353 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2354 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + ) + ) + +(defpart 2330 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 3)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2331 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 0)) + (:scale-x (meters 3)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2332 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters -0.78)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2333 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters -0.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2334 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters -0.2)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2335 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2336 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2337 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2338 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2339 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2340 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2341 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2342 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2343 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2344 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2345 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2346 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2347 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2348 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2349 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2350 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2351 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2352 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2353 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2354 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpartgroup group-bomb-train-explode + :id 604 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 80) + :parts ((sp-item 2355 :flags (sp3) :period (seconds 30) :length (seconds 0.035)) + (sp-item 2356 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2357 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2358 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2359 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2360 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + ) + ) + +(defpart 2355 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 60)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:fade-a -0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2361 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2362 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.6666667) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2356 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.1)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-explo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-bomb-train-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2356 init-specs 14 initial-valuef) + (the-as float *part-bomb-train-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* color-start) *range-explo-dust-color*) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* alpha-start) *range-explo-dust-alpha*) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-x-start) *range-explo-dust-scale-x*) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-y-start) *range-explo-dust-scale-y*) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* a-scalar) *curve-explo-dust-alpha*) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-x-scalar) *curve-explo-dust-scale-x*) + +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-y-scalar) *curve-explo-dust-scale-y*) + +(defpart 2358 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.85) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2359 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -4) (meters 8)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-bomb-train-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2359 init-specs 16 initial-valuef) + (the-as float *part-bomb-train-explosion-texture-curve-settings*) + ) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* color-start) *range-explo-color*) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* alpha-start) *range-explo-alpha*) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-x-start) *range-explo-scale-x*) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-y-start) *range-explo-scale-y*) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* a-scalar) *curve-explo-alpha*) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-x-scalar) *curve-explo-scale-x*) + +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-y-scalar) *curve-explo-scale-y*) + +(defpart 2357 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -2)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2360 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-b -1.7066667) + (:fade-a -1.7066667) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpartgroup group-bomb-train-sparks + :id 605 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2363 :flags (sp7)) (sp-item 2364 :flags (sp7))) + ) + +(defpart 2363 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 2364 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5 0.5) + (:scale-x (meters 0.05) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.64) + (:fade-b -2.56) + (:fade-a -1.28 -1.28) + (:accel-y (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-bomb-train-smoke + :id 606 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2365 :flags (sp7))) + ) + +(defpart 2365 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28 1.28) + (:accel-y (meters 0.0016666667)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 2366) + ) + ) + +(defpart 2366 + :init-specs ((:fade-a -0.23272727 -0.23272727)) + ) + +(defpartgroup group-bomb-train-light + :id 607 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2367 :flags (sp7))) + ) + +(defpart 2367 + :init-specs ((:texture (glow level-default-sprite)) + (:num 4.0) + (:scale-x (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 200.0) + (:b 128.0) + (:a 32.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +(defpartgroup group-min-elec-gate + :id 608 + :bounds (static-bspherem 0 -3.5 0 4) + :parts ((sp-item 2368 :fade-after (meters 160) :flags (sp6) :period (seconds 0.1) :length (seconds 0.05)) + (sp-item 2369 :fade-after (meters 160) :flags (sp6)) + ) + ) + +(defpart 2369 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 2.0) + (:y (meters -1.2) 6 (meters -1)) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 3.6) (meters 0.1)) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2368 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/mine/mine-platforms.gc b/goal_src/jak3/levels/mine/mine-platforms.gc index e3ac3ac485..c355fde553 100644 --- a/goal_src/jak3/levels/mine/mine-platforms.gc +++ b/goal_src/jak3/levels/mine/mine-platforms.gc @@ -5,5 +5,1987 @@ ;; name in dgo: mine-platforms ;; dgos: MIA +(define-extern *drill-loop-mid-curve* curve2d-piecewise) + ;; DECOMP BEGINS +(deftype mine-platform-base (base-plat) + () + (:state-methods + plat-base-state + ) + (:methods + (get-skel (_type_) art-group) + (alloc-path! (_type_ entity) none) + ) + ) + + +(defstate plat-base-state (mine-platform-base) + :virtual #t + :event plat-event + :trans plat-trans + :code sleep-code + :post plat-post + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod alloc-path! ((this mine-platform-base) (arg0 entity)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (not (logtest? (-> this path flags) (path-control-flag not-found))) + (none) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this mine-platform-base) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (init-bounce-params! this) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-6 param 0) 1.0) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! + a0-6 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + ) + +(deftype min-moving-plat-spooler (process-drawable) + ((spool-sound sound-id) + ) + (:state-methods + active + ) + (:methods + (queue-drill-sound (_type_) none) + ) + ) + + +(defbehavior min-moving-plat-spooler-init-by-other min-moving-plat-spooler ((arg0 vector)) + (stack-size-set! (-> self main-thread) 32) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self spool-sound) (new-sound-id)) + (set! (-> self root trans quad) (-> arg0 quad)) + (queue-drill-sound self) + (go-virtual active) + ) + +;; WARN: Return type mismatch gui-connection vs none. +(defmethod queue-drill-sound ((this min-moving-plat-spooler)) + (remove-process *gui-control* this (gui-channel guard)) + (set! (-> this spool-sound) + (add-process *gui-control* this (gui-channel guard) (gui-action queue) "lng-dril" -99.0 0) + ) + (sound-params-set! + *gui-control* + (-> this spool-sound) + #t + 35 + 70 + 9 + (-> *setting-control* user-current sfx-volume) + ) + (none) + ) + +(defmethod deactivate ((this min-moving-plat-spooler)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set-action! + *gui-control* + (gui-action stop) + (-> this spool-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (call-parent-method this) + (none) + ) + +(defstate active (min-moving-plat-spooler) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('play-sound) + (set-action! + *gui-control* + (gui-action play) + (-> self spool-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (('queue-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self spool-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (queue-drill-sound self) + ) + ) + ) + :trans (behavior () + (case (get-status *gui-control* (-> self spool-sound)) + (((gui-status active)) + (when *sound-player-enable* + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (-> self spool-sound)) + (set! (-> v1-3 params volume) (the int (* 1024.0 (-> *setting-control* user-current sfx-volume)))) + (set! (-> v1-3 params mask) (the-as uint 1)) + (-> v1-3 id) + ) + ) + ) + ) + ) + :code sleep-code + ) + +(deftype min-moving-plat (mine-platform-base) + ((animation-speed float) + (sync sync-linear :inline) + (min-frame-num float) + (max-frame-num float) + (sound-drill-spool uint32) + (sound-loop uint32) + (sound-bit uint32) + (sound-gear uint32) + (last-frame float) + (spooler handle) + (sync-offset float) + ) + (:state-methods + idle + active + ) + ) + + +(defskelgroup skel-min-moving-plat min-moving-plat min-moving-plat-lod0-jg min-moving-plat-idle-ja + ((min-moving-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 24) + ) + +(defmethod init-collision! ((this min-moving-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 98304.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 5) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 43008.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 12288.0 81920.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 43008.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-skel ((this min-moving-plat)) + (art-group-get-by-name *level* "skel-min-moving-plat" (the-as (pointer level) #f)) + ) + +(defmethod init-from-entity! ((this min-moving-plat) (arg0 entity-actor)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-1 0)) + (if #f + (set! v1-1 (logior v1-1 1)) + ) + (set! (-> a1-2 sync-type) 'sync-linear) + (set! (-> a1-2 sync-flags) (the-as sync-flags v1-1)) + ) + (set! (-> a1-2 entity) arg0) + (set! (-> a1-2 period) (the-as uint 3000)) + (set! (-> a1-2 percent) 0.0) + (initialize! (-> this sync) a1-2) + ) + (let ((f0-1 (res-lump-float (-> this entity) 'scale :default 1.0))) + (set! (-> this root scale x) f0-1) + (set! (-> this root scale y) f0-1) + (set! (-> this root scale z) f0-1) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (ja-channel-push! 1 0) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-1 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + (set! (-> s5-1 frame-num) 0.0) + ) + (sync-now! (-> this sync) 0.6) + (let ((f0-5 (* (get-norm! (-> this sync) 0) (the float (ja-num-frames 0)))) + (v1-24 (-> this skel root-channel 0)) + ) + (set! (-> v1-24 num-func) num-func-identity) + (set! (-> v1-24 frame-num) f0-5) + ) + (ja-post) + (set! (-> this sound-drill-spool) (the-as uint (new-sound-id))) + (set! (-> this sound-loop) (the-as uint (new-sound-id))) + (set! (-> this sound-bit) (the-as uint (new-sound-id))) + (set! (-> this sound-gear) (the-as uint (new-sound-id))) + (set! (-> this spooler) (the-as handle #f)) + (when (string= (-> this name) "min-moving-plat-2") + (let ((s5-2 (get-process *default-dead-pool* min-moving-plat-spooler #x4000 1))) + (set! (-> this spooler) + (process->handle + (-> (when s5-2 + (let ((t9-15 (method-of-type min-moving-plat-spooler activate))) + (t9-15 (the-as min-moving-plat-spooler s5-2) this "min-moving-plat-spooler" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 min-moving-plat-spooler-init-by-other (-> this root trans)) + (-> s5-2 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this active)) + ) + (go (method-of-object this idle)) + ) + +(defmethod deactivate ((this min-moving-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (the-as sound-id (-> this sound-loop))) + (sound-stop (the-as sound-id (-> this sound-bit))) + (sound-stop (the-as sound-id (-> this sound-gear))) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> this sound-drill-spool)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ((method-of-type mine-platform-base deactivate) this) + (none) + ) + +(defstate idle (min-moving-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (sync-now! (-> self sync) 0.6) + (go-virtual active) + ) + ) + (plat-event proc argc message block) + ) + :trans plat-trans + :code sleep-code + :post plat-post + ) + +(when (or (zero? *drill-loop-mid-curve*) (!= loading-level global)) + (set! *drill-loop-mid-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *drill-loop-mid-curve* 3 'loading-level (the-as int #t)) + ) + +(set! (-> *drill-loop-mid-curve* pts data 0 first) 0.0) + +(set! (-> *drill-loop-mid-curve* pts data 0 second) 0.0) + +(set! (-> *drill-loop-mid-curve* pts data 1 first) 0.5) + +(set! (-> *drill-loop-mid-curve* pts data 1 second) 1.0) + +(set! (-> *drill-loop-mid-curve* pts data 2 first) 1.0) + +(set! (-> *drill-loop-mid-curve* pts data 2 second) 0.0) + +(defstate active (min-moving-plat) + :virtual #t + :event plat-event + :trans (behavior () + (sound-play "mine-drill-bit" :id (the-as sound-id (-> self sound-bit))) + (let ((f30-0 (ja-frame-num 0))) + (cond + ((and (< 15.0 f30-0) (< f30-0 28.0)) + (let ((f0-3 (* 0.07692308 (+ -15.0 f30-0)))) + 0.0 + 0.0 + (let* ((f26-0 (curve2d-method-9 *drill-loop-mid-curve* f0-3 3)) + (f28-0 (lerp -0.5 0.25 f26-0)) + ) + (sound-play-by-name + (static-sound-name "mine-drill-loop") + (the-as sound-id (-> self sound-loop)) + (the int (* 1024.0 f26-0)) + 0 + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "mine-drill-gear") + (the-as sound-id (-> self sound-gear)) + (the int (* 1024.0 f26-0)) + (the int (* 1524.0 f28-0)) + 0 + (sound-group) + #t + ) + ) + ) + ) + ((< f30-0 46.0) + (let ((f0-15 (* 0.055555556 (+ -28.0 f30-0)))) + 0.0 + 0.0 + (let* ((f26-1 (curve2d-method-9 *drill-loop-mid-curve* f0-15 3)) + (f28-1 (lerp -0.5 0.25 f26-1)) + ) + (sound-play-by-name + (static-sound-name "mine-drill-loop") + (the-as sound-id (-> self sound-loop)) + (the int (* 1024.0 f26-1)) + 0 + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "mine-drill-gear") + (the-as sound-id (-> self sound-gear)) + (the int (* 1024.0 f26-1)) + (the int (* 1524.0 f28-1)) + 0 + (sound-group) + #t + ) + ) + ) + ) + (else + (sound-play "mine-drill-loop" :id (the-as sound-id (-> self sound-loop)) :vol 0) + (sound-play "mine-drill-gear" :id (the-as sound-id (-> self sound-gear)) :vol 0) + ) + ) + (if (or (and (< (-> self last-frame) 50.0) (>= f30-0 50.0)) (and (< (-> self last-frame) 8.75) (>= f30-0 8.75))) + (sound-play "drill-arm-snap") + ) + (if (and (< (-> self last-frame) 50.0) (>= f30-0 50.0)) + (send-event (handle->process (-> self spooler)) 'play-sound) + ) + (if (and (< (-> self last-frame) 12.0) (>= f30-0 12.0)) + (send-event (handle->process (-> self spooler)) 'queue-sound) + ) + (set! (-> self last-frame) f30-0) + ) + (plat-trans) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s4-0 #t) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! min-moving-plat-idle-ja :num! min) + (sync-now! (-> self sync) 0.6) + (until #f + (let ((f30-1 (* (get-norm! (-> self sync) 0) (the float (ja-num-frames 0))))) + (let ((a0-8 (-> self skel root-channel 0))) + (set! (-> a0-8 param 0) f30-1) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (cond + ((or (< 55.0 f30-1) (< f30-1 5.0)) + (if s4-0 + (set! s4-0 #f) + ) + (let ((s3-1 (new 'stack-no-clear 'matrix))) + (vector+float*! (-> s3-1 trans) (-> self root trans) *up-vector* (* 40960.0 (-> self root scale x))) + (vector+float*! (-> s3-1 trans) (-> s3-1 trans) gp-1 (* 106496.0 (-> self root scale x))) + (vector+float*! (-> s3-1 trans) (-> s3-1 trans) s5-0 (* -8192.0 (-> self root scale x))) + (vector-float*! (-> s3-1 fvec) gp-1 1.0) + (set! (-> s3-1 uvec quad) (-> *up-vector* quad)) + (set! (-> s3-1 rvec quad) (-> s5-0 quad)) + (launch-particles (-> *part-id-table* 2316) s3-1 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 2315) s3-1 :origin-is-matrix #t) + ) + ) + (else + (set! s4-0 #t) + ) + ) + ) + (suspend) + ) + ) + #f + ) + :post plat-post + ) + +(deftype min-rotating-plat (mine-platform-base) + ((animation-speed float) + (sync sync-linear :inline) + (sound-loop-id sound-id) + ) + (:state-methods + idle + active + ) + ) + + +(defskelgroup skel-min-rotating-plat min-rotating-plat min-rotating-plat-lod0-jg min-rotating-plat-idle-ja + ((min-rotating-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 24) + ) + +(defmethod init-collision! ((this min-rotating-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 12288.0 81920.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 43008.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 5) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 43008.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-skel ((this min-rotating-plat)) + (art-group-get-by-name *level* "skel-min-rotating-plat" (the-as (pointer level) #f)) + ) + +(defmethod init-from-entity! ((this min-rotating-plat) (arg0 entity-actor)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (set! (-> this bounce-scale) 0.0) + (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-1 0)) + (if #f + (set! v1-1 (logior v1-1 1)) + ) + (set! (-> a1-2 sync-type) 'sync-linear) + (set! (-> a1-2 sync-flags) (the-as sync-flags v1-1)) + ) + (set! (-> a1-2 entity) arg0) + (set! (-> a1-2 period) (the-as uint 4500)) + (set! (-> a1-2 percent) 0.0) + (initialize! (-> this sync) a1-2) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (ja-channel-push! 1 0) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-1 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + (set! (-> s5-1 frame-num) 0.0) + ) + (sync-now! (-> this sync) 0.0) + (let ((f0-5 (* (get-norm! (-> this sync) 0) (the float (ja-num-frames 0)))) + (a0-12 (-> this skel root-channel 0)) + ) + (set! (-> a0-12 param 0) f0-5) + (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (ja-post) + (set! (-> this sound-loop-id) (new-sound-id)) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this active)) + ) + (go (method-of-object this idle)) + ) + +(defstate idle (min-rotating-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual active) + ) + ) + (plat-event proc argc message block) + ) + :trans plat-trans + :code sleep-code + :post plat-post + ) + +(defstate active (min-rotating-plat) + :virtual #t + :event plat-event + :exit (behavior () + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + ) + :trans plat-trans + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! min-rotating-plat-idle-ja :num! min) + (sync-now! (-> self sync) 0.0) + (until #f + (let ((f0-3 (* (get-norm! (-> self sync) 0) (the float (ja-num-frames 0)))) + (a0-6 (-> self skel root-channel 0)) + ) + (set! (-> a0-6 param 0) f0-3) + (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (if (nonzero? (-> self sound-loop-id)) + (sound-play "min-rotate-plat" :id (-> self sound-loop-id)) + ) + (suspend) + ) + #f + ) + :post plat-post + ) + +(deftype min-falling-elevator (elevator) + ((wheel-angle float) + (stop-sound symbol) + (pad uint8 4) + ) + (:state-methods + unstable + falling + resetting + ) + ) + + +(defskelgroup skel-min-falling-elevator min-falling-elevator min-falling-elevator-lod0-jg min-falling-elevator-idle-ja + ((min-falling-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 5 10) + ) + +(defun min-falling-elevator-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as min-falling-elevator (-> arg0 param1)))) + (when (and (-> v1-0 next-state) (= (-> v1-0 next-state name) 'running)) + (set! (-> v1-0 wheel-angle) + (the float + (sar (shl (the int (+ (-> v1-0 wheel-angle) (* -4.956458 (seconds-per-frame) (-> v1-0 speed)))) 48) 48) + ) + ) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> v1-0 wheel-angle)) + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch cspace vs none. +(defmethod base-plat-method-34 ((this min-falling-elevator)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "min-fall-elev" :group 1)) + (set! (-> this stop-sound) #f) + (let ((v1-3 (-> this skel root-channel 0))) + (set! (-> v1-3 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (ja-post) + (let ((v0-1 (-> this node-list data 4))) + (set! (-> v0-1 param0) min-falling-elevator-callback) + (set! (-> v0-1 param1) this) + (set! (-> v0-1 param2) (the-as basic 0)) + ) + (none) + ) + +(defmethod init-collision! ((this min-falling-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 20480.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 20480.0 40960.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-art-group ((this min-falling-elevator)) + (art-group-get-by-name *level* "skel-min-falling-elevator" (the-as (pointer level) #f)) + ) + +(defstate running (min-falling-elevator) + :virtual #t + :enter (behavior () + (if (task-node-closed? (game-task-node mine-blow-resolution)) + (go-virtual dormant) + ) + (let ((t9-2 (-> (method-of-type elevator running) enter))) + (if t9-2 + (t9-2) + ) + ) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "mfal-end" -99.0 0) + ) + (set! (-> self stop-sound) #t) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator running) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (if (not (send-event self 'query 'player-standing-on?)) + (send-event self 'use-camera #f) + ) + ) + ) + +(defstate arrived (min-falling-elevator) + :virtual #t + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator arrived) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'player-standing-on?)) + (cond + ((and (send-event-function self a1-0) (!= (-> self prev-state name) 'resetting)) + (go-virtual unstable) + ) + (else + (send-event self 'use-camera #f) + (if (-> self stop-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + ) + ) + ) + ) + +(defstate unstable (min-falling-elevator) + :virtual #t + :parent (min-falling-elevator dormant) + :event elevator-event + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 2)) + (go-virtual falling) + ) + (if (not (send-event self 'query 'player-standing-on?)) + (send-event self 'use-camera #f) + ) + (let ((v1-18 (-> self state parent))) + (when v1-18 + (let ((t9-3 (-> v1-18 trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + ) + :code (behavior () + (when (-> self stop-sound) + (set! (-> self stop-sound) #f) + (sound-params-set! *gui-control* (-> self sound-id) #t -1 -1 -1 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (ja-no-eval :group! min-falling-elevator-start-unstable-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! min-falling-elevator-unstable-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +(defstate falling (min-falling-elevator) + :virtual #t + :parent (min-falling-elevator dormant) + :event elevator-event + :enter (behavior () + (send-event self 'use-camera #f) + (set-time! (-> self state-time)) + ) + :code (behavior () + (ja-no-eval :group! min-falling-elevator-drop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + (go-virtual resetting) + ) + :post transform-post + ) + +(defstate resetting (min-falling-elevator) + :virtual #t + :parent (min-falling-elevator dormant) + :event elevator-event + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (sound-play "falling-step-up") + (ja-no-eval :group! min-falling-elevator-reset-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + (go-virtual arrived) + ) + ) + +(deftype min-falling-step (mine-platform-base) + ((should-fall symbol) + (actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + lowering + lowered + ) + ) + + +(defskelgroup skel-min-falling-step min-falling-step min-falling-step-lod0-jg min-falling-step-idle-ja + ((min-falling-step-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 4 20) + :origin-joint-index 4 + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this min-falling-step)) + (let ((v0-0 0)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'idle)) + (set! v0-0 (logior v0-0 32)) + ) + ((and (-> this next-state) (= (-> this next-state name) 'lowering)) + (set! v0-0 (logior v0-0 1)) + ) + ) + (the-as search-info-flag v0-0) + ) + ) + +(defmethod get-trans ((this min-falling-step) (arg0 int)) + "Get the `trans` for this process." + (cond + ((= arg0 3) + (let ((a2-0 (-> this node-list data 4 bone transform)) + (gp-0 (new 'static 'vector)) + ) + (set-vector! gp-0 0.0 0.0 24576.0 1.0) + (vector-matrix*! gp-0 gp-0 a2-0) + (set! (-> gp-0 w) 16384.0) + gp-0 + ) + ) + (else + ((method-of-type process-focusable get-trans) this arg0) + ) + ) + ) + +(defmethod init-collision! ((this min-falling-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 4) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 16384.0 81920.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-skel ((this min-falling-step)) + (art-group-get-by-name *level* "skel-min-falling-step" (the-as (pointer level) #f)) + ) + +(defstate idle (min-falling-step) + :virtual #t + :parent (min-falling-step plat-base-state) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (go-virtual lowering) + ) + (else + (plat-event proc argc message block) + ) + ) + ) + :trans (behavior () + (let ((v1-1 (-> self state parent))) + (when v1-1 + (let ((t9-0 (-> v1-1 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 min-falling-step-idle-ja))) + (ja-channel-push! 1 0) + ) + ) + (until #f + (ja-no-eval :group! min-falling-step-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +(defstate lowering (min-falling-step) + :virtual #t + :parent (min-falling-step plat-base-state) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) + ) + :code (behavior () + (dotimes (gp-0 (-> self actor-group-count)) + (let ((s5-0 (-> self actor-group gp-0))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'cue-chase) + (let ((t9-0 send-event-function) + (v1-6 (-> s5-0 data s4-0 actor)) + ) + (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 0) + (sound-play "fall-step-hinge") + (let ((gp-2 0)) + (ja-no-eval :group! min-falling-step-falling-a-ja :num! (seek! max 0.6) :frame-num 0.0) + (until (ja-done? 0) + (let ((f30-0 (ja-frame-num 0)) + (v1-31 (ja-num-frames 0)) + ) + (when (< gp-2 (the int f30-0)) + (if (= (the int f30-0) (+ v1-31 -17)) + (sound-play "falling-step") + ) + ) + ) + (set! gp-2 (the int (ja-frame-num 0))) + (suspend) + (ja :num! (seek! max 0.6)) + ) + ) + (go-virtual lowered) + ) + ) + +(defstate lowered (min-falling-step) + :virtual #t + :parent (min-falling-step plat-base-state) + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (ja :group! min-falling-step-falling-a-ja :num! max) + (transform-post) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this min-falling-step) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (set! (-> this bounce-scale) 204.8) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this lowered)) + (go (method-of-object this idle)) + ) + ) + +(deftype min-elev-track (elevator) + () + ) + + +(defskelgroup skel-min-elev-track min-elev-track min-elev-track-lod0-jg min-elev-track-idle-ja + ((min-elev-track-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 4 8) + ) + +(defmethod get-art-group ((this min-elev-track)) + (art-group-get-by-name *level* "skel-min-elev-track" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape vs none. +(defmethod init-collision! ((this min-elev-track)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 -8192.0 16384.0 28672.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 -8192.0 16384.0 28672.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +(defmethod start-bounce! ((this min-elev-track)) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this min-elev-track)) + (set! (-> this sound-running-loop) (static-sound-spec "min-elev-track" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "min-elev-end" :group 1)) + (none) + ) + +(deftype min-folding-plat (process-drawable) + ((root collide-shape-moving :override) + (stop-sound symbol) + (sound-id sound-id) + ) + (:state-methods + idle + extend + extended + ) + (:methods + (set-bounds! (_type_) none) + ) + ) + + +(defskelgroup skel-min-folding-plat min-folding-plat min-folding-plat-lod0-jg min-folding-plat-idle-ja + ((min-folding-plat-lod0-mg (meters 20)) (min-folding-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 4 10) + :origin-joint-index 5 + ) + +(defstate idle (min-folding-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual extend) + ) + ) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (ja-channel-set! 1) + (ja-no-eval :group! min-folding-plat-idle-ja :num! zero) + (transform-post) + (sleep-code) + ) + ) + +(defstate extend (min-folding-plat) + :virtual #t + :enter (behavior () + (set! (-> self stop-sound) #t) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "minbridg" -99.0 0) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set-bounds! self) + ) + :exit (behavior () + (if (-> self stop-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + :trans rider-trans + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + (suspend) + ) + ) + (when (-> self stop-sound) + (set! (-> self stop-sound) #f) + (sound-params-set! *gui-control* (-> self sound-id) #t -1 -1 -1 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (ja-no-eval :group! min-folding-plat-extend-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (go-virtual extended) + ) + :post rider-post + ) + +(defstate extended (min-folding-plat) + :virtual #t + :code (behavior () + (set-bounds! self) + (ja-no-eval :group! min-folding-plat-extend-ja + :num! (identity (the float (+ (-> (the-as art-joint-anim min-folding-plat-extend-ja) frames num-frames) -1))) + ) + (transform-post) + (sleep-code) + ) + ) + +(defmethod set-bounds! ((this min-folding-plat)) + (set! (-> this root root-prim local-sphere w) 69632.0) + (set! (-> this draw bounds w) 71680.0) + 0 + (none) + ) + +(defmethod init-from-entity! ((this min-folding-plat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 5) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 16384.0 32768.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 8192.0 32768.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 5) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 8192.0 32768.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 7) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 8192.0 32768.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-22 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this stop-sound) #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-folding-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this extended)) + (go (method-of-object this idle)) + ) + ) + +(deftype min-ramp (process-drawable) + ((angle degrees) + (play-anim? symbol) + (play-ramp-sound? symbol) + (stop-ramp-sound symbol) + (ramp-sound sound-id) + ) + (:state-methods + idle + rotating + rotated + ) + ) + + +(defskelgroup skel-min-ramp min-ramp min-ramp-lod0-jg min-ramp-idle-ja + ((min-ramp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 2 5.5) + :origin-joint-index 4 + ) + +(defstate idle (min-ramp) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual rotating) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! min-ramp-idle-ja :num! zero) + (transform-post) + (sleep-code) + ) + ) + +(defstate rotating (min-ramp) + :virtual #t + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (when (-> self play-ramp-sound?) + (set! (-> self stop-ramp-sound) #t) + (set! (-> self ramp-sound) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "min-ramp" -99.0 0) + ) + ) + ) + :exit (behavior () + (if (and (-> self play-ramp-sound?) (-> self stop-ramp-sound)) + (set-action! + *gui-control* + (gui-action stop) + (-> self ramp-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + :trans (behavior () + (when (-> self play-anim?) + (when (time-elapsed? (-> self state-time) (seconds 0.75)) + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer self)) + (set! (-> gp-0 num-params) 0) + (set! (-> gp-0 message) 'trigger) + (let ((s5-0 send-event-function) + (v1-7 (entity-actor-lookup (-> self entity) 'alt-actor 0)) + ) + (s5-0 + (if v1-7 + (-> v1-7 extra process) + ) + gp-0 + ) + ) + ) + ) + (if (= (-> self angle) 0.0) + (go-virtual rotated) + ) + (set! (-> self angle) + (seek-ease (-> self angle) 0.0 (* 8192.0 (seconds-per-frame)) 3640.889 (* 2048.0 (seconds-per-frame))) + ) + (rider-trans) + ) + ) + :code (behavior () + (when (-> self play-ramp-sound?) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (suspend) + ) + ) + (until (= (get-status *gui-control* (-> self ramp-sound)) (gui-status ready)) + (suspend) + ) + (when (-> self stop-ramp-sound) + (set! (-> self stop-ramp-sound) #f) + (sound-params-set! *gui-control* (-> self ramp-sound) #t -1 150 2 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self ramp-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self play-anim?) #t) + (sleep-code) + ) + :post rider-post + ) + +(defstate rotated (min-ramp) + :virtual #t + :code (behavior () + (set! (-> self angle) 0.0) + (transform-post) + (sleep-code) + ) + ) + +(defun min-ramp-callback ((arg0 cspace) (arg1 transformq)) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> (the-as min-ramp (-> arg0 param1)) angle)) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defmethod init-from-entity! ((this min-ramp) (arg0 entity-actor)) + (local-vars (s5-3 symbol)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 4) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 8192.0 20480.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-ramp" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this play-anim?) #f) + (let* ((s5-2 #t) + (a0-10 (-> this entity)) + (v1-18 (the-as uint128 ((method-of-object a0-10 get-property-value) + a0-10 + 'play-sound + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (cmove-#f-zero s5-3 v1-18 s5-2) + ) + (set! (-> this play-ramp-sound?) s5-3) + (set! (-> this ramp-sound) (new-sound-id)) + (set! (-> this stop-ramp-sound) #f) + (set! (-> this angle) 8192.0) + (let ((a0-11 (-> this node-list data 4))) + (set! (-> a0-11 param0) min-ramp-callback) + (set! (-> a0-11 param1) this) + (set! (-> a0-11 param2) (the-as basic 0)) + ) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this rotated)) + ) + (go (method-of-object this idle)) + ) + +(deftype min-bridge (process-drawable) + ((stop-bridge-sound symbol) + (bridge-sound sound-id) + ) + (:state-methods + idle + extend + extended + ) + (:methods + (init-collision! (_type_) none) + ) + ) + + +(defskelgroup skel-min-bridge min-bridge min-bridge-lod0-jg min-bridge-idle-ja + ((min-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 10 25) + :origin-joint-index 3 + ) + +(defstate idle (min-bridge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual extend) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! min-bridge-idle-ja :num! zero) + (transform-post) + (sleep-code) + ) + ) + +(defstate extend (min-bridge) + :virtual #t + :enter (behavior () + (set! (-> self stop-bridge-sound) #t) + (set! (-> self bridge-sound) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "minbridg" -99.0 0) + ) + ) + :exit (behavior () + (if (-> self stop-bridge-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self bridge-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + :trans rider-trans + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + (suspend) + ) + ) + (when (-> self stop-bridge-sound) + (set! (-> self stop-bridge-sound) #f) + (sound-params-set! *gui-control* (-> self bridge-sound) #t -1 150 2 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self bridge-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (ja-no-eval :group! min-bridge-move-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (go-virtual extended) + ) + :post rider-post + ) + +(defstate extended (min-bridge) + :virtual #t + :code (behavior () + (ja-no-eval :group! min-bridge-move-ja + :num! (identity (the float (+ (-> (the-as art-joint-anim min-bridge-move-ja) frames num-frames) -1))) + ) + (transform-post) + (sleep-code) + ) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-bridge)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 61440.0 122880.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 5) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 8) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action solid rideable)) + (set! (-> v1-21 transform-index) 6) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-24 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +(defmethod init-from-entity! ((this min-bridge) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-bridge" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this bridge-sound) (new-sound-id)) + (set! (-> this stop-bridge-sound) #f) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this extended)) + ) + (go (method-of-object this idle)) + ) + +(deftype min-plat-updown (base-plat) + ((sync sync-eased :inline) + (path-pos float) + ) + (:state-methods + idle + active + ) + (:methods + (get-skel (_type_) art-group) + ) + ) + + +(defstate idle (min-plat-updown) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code sleep-code + :post ja-post + ) + +(defstate active (min-plat-updown) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post plat-post + ) + +;; WARN: Return type mismatch object vs none. +(defmethod base-plat-method-34 ((this min-plat-updown)) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((> (-> this sync period) 0) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this idle)) + ) + ) + (none) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this min-plat-updown) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-5 param 0) 1.0) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! + a0-5 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-24 0)) + (if (not (logtest? (-> this fact options) (actor-option loop))) + (set! v1-24 (logior v1-24 1)) + ) + (set! (-> a1-6 sync-type) 'sync-eased) + (set! (-> a1-6 sync-flags) (the-as sync-flags v1-24)) + ) + (set! (-> a1-6 period) (the-as uint 1500)) + (set! (-> a1-6 entity) arg0) + (set! (-> a1-6 percent) 0.0) + (set! (-> a1-6 ease-in) 0.15) + (set! (-> a1-6 ease-out) 0.15) + (set! (-> a1-6 pause-in) 0.1) + (set! (-> a1-6 pause-out) 0.0) + (initialize! (-> this sync) a1-6) + ) + (base-plat-method-34 this) + ) + +(deftype min-moving-step (min-plat-updown) + ((holding? basic) + ) + (:state-methods + dormant + ) + ) + + +(defskelgroup skel-min-moving-step min-moving-step min-moving-step-lod0-jg min-moving-step-idle-ja + ((min-moving-step-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 3 8) + ) + +(defstate dormant (min-moving-step) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code (behavior () + (set! (-> self path-pos) 0.0) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + (sleep-code) + ) + ) + +(defstate active (min-moving-step) + :virtual #t + :trans (behavior () + (if (and (not (-> self holding?)) (or (= (-> self path-pos) 0.0) (= (-> self path-pos) 1.0))) + (set! (-> self holding?) (the-as basic #t)) + ) + (when (and (and (< 0.0 (-> self path-pos)) (< (-> self path-pos) 1.0)) (-> self holding?)) + (set! (-> self holding?) #f) + (sound-play "min-moving-step") + ) + (let ((t9-2 (-> (method-of-type min-plat-updown active) trans))) + (if t9-2 + (t9-2) + ) + ) + ) + ) + +(defmethod get-skel ((this min-moving-step)) + (art-group-get-by-name *level* "skel-min-moving-step" (the-as (pointer level) #f)) + ) + +(defmethod init-collision! ((this min-moving-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 12288.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod base-plat-method-34 ((this min-moving-step)) + (set! (-> this holding?) #f) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((and (or (task-node-open? (game-task-node mine-blow-resolution)) + (task-node-closed? (game-task-node mine-blow-resolution)) + ) + (> (-> this sync period) 0) + ) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this dormant)) + ) + ) + (none) + ) + +(deftype min-elevator (elevator) + () + ) + + +(defskelgroup skel-min-elevator min-elevator min-elevator-lod0-jg min-elevator-idle-ja + ((min-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 3 + ) + +(defstate running (min-elevator) + :virtual #t + :enter (behavior () + (setup-masks (-> self draw) 3 0) + (let ((t9-1 (-> (method-of-type elevator running) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :exit (behavior () + (setup-masks (-> self draw) 1 2) + (let ((t9-1 (-> (method-of-type elevator running) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +(defmethod get-art-group ((this min-elevator)) + (art-group-get-by-name *level* "skel-min-elevator" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +(defmethod base-plat-method-34 ((this min-elevator)) + (setup-masks (-> this draw) 1 2) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "min-elevator" :group 1)) + (set! (-> this draw light-index) (the-as uint 2)) + (none) + ) diff --git a/goal_src/jak3/levels/mine/mine-scenes.gc b/goal_src/jak3/levels/mine/mine-scenes.gc index 5216f661ca..7f613b310a 100644 --- a/goal_src/jak3/levels/mine/mine-scenes.gc +++ b/goal_src/jak3/levels/mine/mine-scenes.gc @@ -5,5 +5,1498 @@ ;; name in dgo: mine-scenes ;; dgos: MIA +(define-extern *range-explo-door-dust-color* curve-color-fast) +(define-extern *range-explo-door-dust-alpha* curve2d-fast) +(define-extern *range-explo-door-dust-scale-x* curve2d-fast) +(define-extern *range-explo-door-dust-scale-y* curve2d-fast) +(define-extern *curve-explo-door-dust-alpha* curve2d-fast) +(define-extern *curve-explo-door-dust-scale-x* curve2d-fast) +(define-extern *curve-explo-door-dust-scale-y* curve2d-fast) +(define-extern *part-bomb-door-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-explo-door-color* curve-color-fast) +(define-extern *range-explo-door-alpha* curve2d-fast) +(define-extern *range-explo-door-scale-x* curve2d-fast) +(define-extern *range-explo-door-scale-y* curve2d-fast) +(define-extern *curve-explo-door-alpha* curve2d-fast) +(define-extern *curve-explo-door-scale-x* curve2d-fast) +(define-extern *curve-explo-door-scale-y* curve2d-fast) +(define-extern *part-bomb-door-explosion-texture-curve-settings* particle-curve-settings) + ;; DECOMP BEGINS +(defskelgroup skel-leggings-fma leggings-fma leggings-fma-lod0-jg leggings-fma-idle-ja + ((leggings-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-min-elevator-movie min-elevator min-elevator-lod0-jg min-elevator-idle-ja + ((min-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 3 + ) + +(defpartgroup group-min-door-explode + :id 609 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2370 :flags (sp3) :period (seconds 30) :length (seconds 0.035)) + (sp-item 2371 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2372 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2373 :period (seconds 30) :length (seconds 0.667)) + (sp-item 2374 :period (seconds 30) :length (seconds 0.667)) + (sp-item 2375 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + ) + ) + +(defpart 2370 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 60)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2371 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.1)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-explo-door-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 90.0 :y 90.0 :z 90.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-door-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-door-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-door-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-door-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -2.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-door-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-door-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-bomb-door-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 4) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2371 init-specs 14 initial-valuef) + (the-as float *part-bomb-door-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* color-start) *range-explo-door-dust-color*) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* alpha-start) *range-explo-door-dust-alpha*) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-x-start) *range-explo-door-dust-scale-x*) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-y-start) *range-explo-door-dust-scale-y*) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* a-scalar) *curve-explo-door-dust-alpha*) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-x-scalar) *curve-explo-door-dust-scale-x*) + +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-y-scalar) *curve-explo-door-dust-scale-y*) + +(defpart 2373 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.85 0.05) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2374 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:x (meters -4) (meters 8)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-explo-door-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-door-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-door-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-door-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-door-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-door-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.9 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.125 :y 0.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-door-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.9 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.125 :y 0.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-bomb-door-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2374 init-specs 16 initial-valuef) + (the-as float *part-bomb-door-explosion-texture-curve-settings*) + ) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* color-start) *range-explo-door-color*) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* alpha-start) *range-explo-door-alpha*) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-x-start) *range-explo-door-scale-x*) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-y-start) *range-explo-door-scale-y*) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* a-scalar) *curve-explo-door-alpha*) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-x-scalar) *curve-explo-door-scale-x*) + +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-y-scalar) *curve-explo-door-scale-y*) + +(defpart 2372 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -2)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2375 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-b -1.7066667) + (:fade-a -1.7066667) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2376 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 16.0 10.0) + (:y (meters -2.5)) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0)) + (:scale-y (meters 3.4) (meters 0.6)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.32) + (:friction 0.94) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 2377) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 90)) + (:conerot-radius (meters 0) (meters 8)) + ) + ) + +(defpart 2377 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 2378)) + ) + +(defpart 2378 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2379) + ) + ) + +(defpart 2379 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2) + (:fade-g -0.7111111) + (:fade-b -0.2) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 2380) + ) + ) + +(defpart 2380 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +(defpart 2381 + :init-specs ((:texture (specs level-default-sprite)) + (:num 6.0 8.0) + (:x (meters 0.25)) + (:y (meters -2.5)) + (:scale-x (meters 3) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.06666667) (meters 0.4)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00033333333) (meters -0.0023333333)) + (:friction 0.88 0.02) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2382) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 90)) + (:conerot-radius (meters 3) (meters 5)) + ) + ) + +(defpart 2382 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2383) + ) + ) + +(defpart 2383 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-b -0.5543478) (:fade-a -0.10666667 -0.10666667)) + ) + +(defpart 2384 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 4.0 8.0) + (:x (meters 0) (meters 0.6)) + (:y (meters -2.5)) + (:scale-x (meters 8.5) (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.2)) + (:scalevel-x (meters 0.033333335) (meters 0.086666666)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.89) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2385) + (:conerot-x (degrees -1440) (degrees 2880)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 2385 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2386) + ) + ) + +(defpart 2386 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +(defpart 2387 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 9.0) + (:y (meters -2.5)) + (:scale-x (meters 4) (meters 8)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.4)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defpartgroup group-min-door-trailer + :id 610 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2388 :flags (sp7) :period (seconds 30) :length (seconds 0.5))) + ) + +(defpart 2388 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.28) + (:fade-b -2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 2389) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2389 + :init-specs ((:fade-g 0.0) (:fade-b 0.0)) + ) + +(load-scene (new 'static 'scene + :name "catacombs-travel-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-140" + :art-group "scenecamera" + :anim "catacombs-travel-res" + :parts 6 + :command-list '((0 (fadein (frame-time-30 10)) (send-event "pecker-ingame-1" 'die)) + (620 (fadeout (frame-time-30 10))) + (10000 (task-close! "mine-explore-introduction")) + ) + :cut-list '(40 122 255 301 440 491) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x3a0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-ingame" + :level 'minea + :art-group "skel-pecker-ingame" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "minec-start" + :end-point "minec-intro" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "mine-amb-mov") + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "mine-explore-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf8) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-195" + :art-group "scenecamera" + :anim "mine-explore-res" + :parts 3 + :command-list '((0 (fadein (frame-time-30 10)) (kill "leggings-2")) + (140 (send-event "jakc-highres" 'segment 32 0)) + (290 (fadeout (frame-time-30 10))) + (10000 + (send-event self 'user-data-set! (task-closed? "mine-explore-resolution")) + (task-close! "mine-explore-resolution") + ) + ) + :cut-list '(80 140) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(140) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #xa0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "leggings-fma" + :level 'minea + :art-group "skel-leggings-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mineb-elevator-room" + :end-point "mineb-after-armor" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :scene-task #x72 + :on-running '(sound-play-loop "mine-amb-mov") + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup005")) + ) + ) + +(load-scene (new 'static 'scene + :name "mine-train-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-109" + :art-group "scenecamera" + :anim "mine-train-intro" + :parts 3 + :command-list '((0 (kill "min-crane-8") (kill "min-bomb-train-1")) + (335 (fadeout (frame-time-30 15))) + (10000 (task-close! "mine-blow-introduction") (send-event "min-bomb-elevator-1" 'trigger)) + ) + :cut-list '(95 208) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x3a0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-crane" + :level 'mineb + :art-group "skel-min-crane" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-bomb-train" + :level 'minea + :art-group "skel-min-bomb-train" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mineb-elevator-room" + :end-point "mineb-on-elevator" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "comb-exit" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-171" + :art-group "scenecamera" + :anim "comb-exit" + :parts 6 + :command-list '((0 + (kill "comb-elevator-1") + (kill "min-elevator-7") + (send-event "pecker-ingame-2" 'die) + (send-event "min-elevator-movie" 'segment 1 2) + (want-display 'minea 'display) + ) + (105 (send-event "min-elevator-movie" 'segment 3)) + (155 (want-load 'minea 'minec)) + (526 (want-display 'minec 'display)) + (609 (send-event "min-elevator-movie" 'segment 1 2)) + (10000 (restore "comb-elevator-1") (restore "min-elevator-7") (save) (task-close! "comb-travel-resolution")) + ) + :cut-list '(155 526 571) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((145 575)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-elevator-movie" + :level 'minea + :art-group "skel-min-elevator-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x2 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-ingame" + :level 'minea + :art-group "skel-pecker-ingame" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "combn-start" + :end-point "minec-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "tunnel-amb-mov") + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "mine-train-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-113" + :art-group "scenecamera" + :anim "mine-train-res" + :parts 2 + :command-list '((0 + (send-event "min-door-1" 'subtask-complete) + (kill "min-door-1") + (kill "manta-1") + (kill "manta-3") + (kill "manta-4") + (part-tracker + "group-bomb-train-sparks" + entity + "min-bomb-train" + joint + "sparks" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-smoke" + entity + "min-bomb-train" + joint + "sparks1" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-sparks" + entity + "min-bomb-train" + joint + "sparks2" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-smoke" + entity + "min-bomb-train" + joint + "sparks3" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-sparks" + entity + "min-bomb-train" + joint + "sparks4" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-light" + entity + "min-bomb-train" + joint + "light" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-light" + entity + "min-bomb-train" + joint + "light1" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-light" + entity + "min-bomb-train" + joint + "light2" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (78 + (part-tracker + "group-min-door-explode" + entity + "min-bomb-train" + joint + "main" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (send-event "min-bomb-train-3" 'doors-exploded) + ) + (80 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "h" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "i" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "k" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "l" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "n" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "o" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "s" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "t" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "u" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "v" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "x" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "y" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ad" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ag" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (81 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "m" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "w" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "z" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (82 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "g" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "zz" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (83 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "d" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (88 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "aa" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (93 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ab" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (95 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "f" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ac" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (98 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "e" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (10000 (kill "min-boss-elev-1") (task-close! "mine-blow-resolution")) + ) + :cut-list '(95 208) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-door-break" + :level 'minec + :art-group "skel-min-door-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-bomb-train" + :level 'minea + :art-group "skel-min-bomb-train" + :prefix "" + :draw-frames '((min 88)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "minec-train" + :end-point "minec-resolution" + :borrow '() + :sfx-volume 1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(deftype leggings (process-drawable) + ((alt-actor entity-actor) + ) + (:state-methods + idle + die + ) + ) + + +(defskelgroup skel-leggings leggings leggings-lod0-jg leggings-idle-ja + ((leggings-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defstate idle (leggings) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +(defstate die (leggings) + :virtual #t + :code (behavior () + (suspend) + 0 + ) + ) + +(defmethod init-from-entity! ((this leggings) (arg0 entity-actor)) + (when (task-node-closed? (game-task-node mine-explore-resolution)) + (cleanup-for-death this) + (return #f) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-leggings" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (if (or (kiosk?) (demo?)) + (go (method-of-object this die)) + (go (method-of-object this idle)) + ) + ) diff --git a/goal_src/jak3/levels/mine/mine-train.gc b/goal_src/jak3/levels/mine/mine-train.gc index 8f0b7654ef..e3404eb0b1 100644 --- a/goal_src/jak3/levels/mine/mine-train.gc +++ b/goal_src/jak3/levels/mine/mine-train.gc @@ -7,3 +7,927 @@ ;; DECOMP BEGINS +(define *min-bomb-train-times* + (new 'static 'boxed-array :type float 12.0 15.0 27.0 33.0 55.0 59.0 90.0 92.0 106.0 127.0 131.0 143.0 146.0) + ) + +(deftype min-bomb-train (process-focusable) + ((path-pos float) + (path-length float) + (speed float) + (fall-travel-time float) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (wheel-angle degrees) + (sound-loop-id sound-id) + (attack-id uint32) + (spark-part sparticle-launch-control) + (smoke-part sparticle-launch-control) + (light-part sparticle-launch-control) + (doors-exploded? symbol) + (taskman handle) + (current-rail uint8) + (suck-level float) + (minimap (array connection-minimap)) + ) + (:state-methods + idle + wait + active + explode + fall + die + explode-doors + ) + (:methods + (alloc-path! (_type_) symbol) + (init-collision! (_type_) none) + (get-path-progress (_type_ float float) float) + (update-task-manager (_type_) object) + (spawn-debris (_type_) none) + (explode-sound (_type_) none) + ) + ) + + +(defskelgroup skel-min-bomb-train min-bomb-train min-bomb-train-lod0-jg min-bomb-train-idle-ja + ((min-bomb-train-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 18) + :shadow min-bomb-train-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-min-bomb-train-debris-a min-bomb-train-debris min-bomb-train-debris-a-lod0-jg -1 + ((min-bomb-train-debris-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-min-bomb-train-debris-b min-bomb-train-debris min-bomb-train-debris-b-lod0-jg -1 + ((min-bomb-train-debris-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-min-bomb-train-debris-c min-bomb-train-debris min-bomb-train-debris-c-lod0-jg -1 + ((min-bomb-train-debris-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-min-bomb-train-debris-d min-bomb-train-debris min-bomb-train-debris-d-lod0-jg -1 + ((min-bomb-train-debris-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(define *min-bomb-train-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-min-bomb-train-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-min-bomb-train-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-min-bomb-train-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-min-bomb-train-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-min-bomb-train-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-c") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "train-pieces") + ) + ) + +(defmethod init-collision! ((this min-bomb-train)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 4096.0 28672.0 12288.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 12288.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod spawn-debris ((this min-bomb-train)) + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 0)))) + (set! (-> a1-1 scale-rand-lo) 1.0) + (set! (-> a1-1 scale-rand-hi) 1.5) + (set-vector! (-> a1-1 fountain-rand-transv-lo) -327680.0 163840.0 -327680.0 1.0) + (set-vector! (-> a1-1 fountain-rand-transv-hi) 327680.0 163840.0 327680.0 1.0) + (debris-spawn this a1-1 *min-bomb-train-debris-params* (the-as process-drawable #f)) + ) + 0 + (none) + ) + +(defmethod explode-sound ((this min-bomb-train)) + (set-setting! 'music #f 0.0 0) + (sound-play "train-explode") + 0 + (none) + ) + +(defstate idle (min-bomb-train) + :virtual #t + :trans (behavior () + (if (and (task-node-open? (game-task-node mine-blow-resolution)) + (not (logtest? (-> self path flags) (path-control-flag not-found))) + ) + (go-virtual active) + ) + (when (task-node-closed? (game-task-node mine-blow-resolution)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate wait (min-bomb-train) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :trans (behavior () + (if (or (task-open? (the-as string ((method-of-type res-lump get-property-struct) + (-> self entity) + 'task-name + 'interp + -1000000000.0 + "mine-blow-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (task-node-open? (game-task-node mine-blow-resolution)) + ) + (go-virtual idle) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate active (min-bomb-train) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let ((s4-0 (the-as object (-> block param 0))) + (s3-0 (if (= message 'attack) + (-> block param 1) + #f + ) + ) + (s2-0 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1)) + ) + (when (the-as touching-shapes-entry s4-0) + (let ((s1-0 (-> (the-as touching-shapes-entry s4-0) head))) + (while s1-0 + (when (= (get-touched-prim s1-0 (-> self root) (the-as touching-shapes-entry s4-0)) s2-0) + (let ((s4-1 (if (type? proc process-focusable) + (the-as process-focusable proc) + ) + ) + ) + (when (and s4-1 + (= (-> s4-1 type) target) + (or (not (the-as uint s3-0)) + (not (logtest? (penetrate dark-bomb dark-smack) (-> (the-as attack-info s3-0) penetrate-using))) + ) + ) + (let ((v1-14 (-> self root root-prim))) + (set! (-> v1-14 prim-core collide-as) (collide-spec)) + (set! (-> v1-14 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event + s4-1 + 'attack-invinc + (the-as touching-shapes-entry (-> block param 0)) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (-> self attack-id)) + (damage 1000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'smush) + (vector (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (angle 'back) + ) + ) + ) + ) + ) + (return #f) + ) + (set! s1-0 (-> s1-0 next)) + ) + ) + #f + ) + ) + ) + (('rail-down) + (when (>= (-> self actor-group-count) 3) + (dotimes (s5-2 (-> self actor-group 3 length)) + (let ((s4-2 (-> self actor-group 3 data s5-2 actor))) + (cond + ((and s4-2 (not (logtest? (-> s4-2 extra perm status) (entity-perm-status subtask-complete)))) + (let* ((s4-3 (handle->process (-> self taskman))) + (v1-42 (if (type? s4-3 task-manager) + s4-3 + ) + ) + ) + (when v1-42 + (set! (-> self current-rail) (the-as uint s5-2)) + (let ((f0-3 (-> *min-bomb-train-times* s5-2))) + (if (< 0.0 (-> self suck-level)) + (set! f0-3 (* f0-3 (/ 1.0 (-> self suck-level)))) + ) + (set! (-> (the-as task-manager v1-42) time-limit) (the-as time-frame (the int (* 300.0 f0-3)))) + ) + (return #t) + ) + ) + ) + ((= s4-2 (-> proc entity)) + (when (and (nonzero? (-> self minimap s5-2)) *minimap*) + (kill-callback (-> *minimap* engine) (-> self minimap s5-2)) + (set! (-> self minimap s5-2) + (add-icon! *minimap* self (the-as uint 155) (the-as int #f) (-> s4-2 extra trans) 0) + ) + ) + ) + ) + ) + ) + #f + ) + ) + (('go-explode) + (go-virtual explode) + ) + (('go-explode-doors) + (go-virtual explode-doors) + ) + ) + ) + :enter (behavior () + (set-setting! 'music 'mineblow 0.0 0) + (when (not (handle->process (-> self taskman))) + (let ((v1-8 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution)))) + (set! (-> self taskman) (if (-> v1-8 manager) + (-> v1-8 manager manager) + (the-as handle #f) + ) + ) + ) + ) + (let ((v1-13 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution)))) + (if (and v1-13 (< (the-as uint 2) (-> v1-13 death-count))) + (set! (-> self suck-level) + (- 1.0 (* 0.04 (the float (max 0 (min 5 (the-as int (+ (-> v1-13 death-count) -2))))))) + ) + ) + ) + (add-icon! *minimap* self (the-as uint 129) (the-as int #f) (the-as vector #t) 0) + 0 + ) + :trans (behavior () + (if (not (task-node-open? (game-task-node mine-blow-resolution))) + (go-virtual idle) + ) + (set! (-> self path-pos) (get-path-progress self (-> self path-pos) (* (-> self speed) (seconds-per-frame)))) + (spawn-from-cspace (-> self spark-part) (joint-node min-bomb-train-lod0-jg sparks)) + (spawn-from-cspace (-> self smoke-part) (joint-node min-bomb-train-lod0-jg sparks1)) + (spawn-from-cspace (-> self spark-part) (joint-node min-bomb-train-lod0-jg sparks2)) + (spawn-from-cspace (-> self smoke-part) (joint-node min-bomb-train-lod0-jg sparks3)) + (spawn-from-cspace (-> self spark-part) (joint-node min-bomb-train-lod0-jg sparks4)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light1)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light2)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light3)) + (if (nonzero? (-> self sound-loop-id)) + (sound-play-by-name + (static-sound-name "bomb-train") + (-> self sound-loop-id) + 1024 + (the int (* 1524.0 (lerp-scale -0.25 0.0 (-> self speed) 28672.0 57344.0))) + 0 + (sound-group) + #t + ) + ) + (let ((f1-1 (* 28672.0 ((method-of-type res-lump get-property-value-float) + (-> self entity) + 'speed + 'interp + (-> self path-pos) + 1.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (f0-10 1.0) + ) + (when (< 0.0 (-> self suck-level)) + (set! f0-10 (-> self suck-level)) + (set! f1-1 (* f1-1 f0-10)) + ) + (let ((f0-14 (seek (-> self speed) f1-1 (* 7168.0 (seconds-per-frame) (* f0-10 f0-10))))) + (set! (-> self speed) f0-14) + (set! (-> self speed) f0-14) + ) + ) + 0 + (update-task-manager self) + ) + :code (behavior () + (local-vars (v1-8 process)) + (let* ((s5-0 (handle->process (-> self taskman))) + (gp-0 (if (type? s5-0 task-manager) + (the-as task-manager s5-0) + ) + ) + ) + (when gp-0 + (logior! (-> gp-0 info mask) (task-manager-mask time-limit)) + (until v1-8 + (suspend) + (set! v1-8 (handle->process (-> gp-0 hud-timer))) + ) + (let ((f0-0 (-> *min-bomb-train-times* 0))) + (if (< 0.0 (-> self suck-level)) + (set! f0-0 (* f0-0 (/ 1.0 (-> self suck-level)))) + ) + (set! (-> gp-0 time-limit) (the-as time-frame (the int (* 300.0 f0-0)))) + ) + ) + ) + (sleep-code) + ) + :post transform-post + ) + +(defstate die (min-bomb-train) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (send-event (handle->process (-> self taskman)) 'fail) + ) + ) + +(defstate fall (min-bomb-train) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-explode) + (go-virtual explode) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self root transv quad) (the-as uint128 0)) + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + (set! (-> self fall-travel-time) (/ 2764800.0 (-> self speed))) + ) + :trans (behavior () + (cond + ((not (time-elapsed? (-> self state-time) (the int (-> self fall-travel-time)))) + (set! (-> self path-pos) + (path-control-method-26 (-> self path) (-> self path-pos) (* (-> self speed) (seconds-per-frame))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + ) + (else + (let ((gp-0 (displacement-between-points-at-percent-normalized! + (-> self path) + (new 'stack-no-clear 'vector) + (-> self path-pos) + ) + ) + ) + (vector-normalize! gp-0 (-> self speed)) + (set! (-> self root transv y) (- (-> self root transv y) (* 3.3333333 (seconds-per-frame) (-> self speed)))) + (+! (-> gp-0 y) (-> self root transv y)) + (vector+float*! (-> self root trans) (-> self root trans) gp-0 (seconds-per-frame)) + ) + ) + ) + (let ((a1-6 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-vector-angle! gp-1 a1-6 (* 0.26666668 (seconds-per-frame) (-> self speed))) + (quaternion*! (-> self root quat) gp-1 (-> self root quat)) + ) + (quaternion-normalize! (-> self root quat)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (when (type? (-> self root) collide-shape) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (transform-post) + (spawn-debris self) + (explode-sound self) + (cond + ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + ) + (activate! *camera-smush-control* 819.2 36 210 0.5 1.0 (-> self clock)) + (activate! *camera-smush-control-horizontal* 3276.8 24 210 0.5 1.0 (-> self clock)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + :post transform-post + ) + +(defstate explode (min-bomb-train) + :virtual #t + :enter (behavior () + (set-setting! 'allow-progress #f 0.0 0) + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + ) + :code (behavior () + (when (type? (-> self root) collide-shape) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (transform-post) + (spawn-debris self) + (explode-sound self) + (cond + ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + ) + (activate! *camera-smush-control* 819.2 36 210 0.5 1.0 (-> self clock)) + (activate! *camera-smush-control-horizontal* 3276.8 24 210 0.5 1.0 (-> self clock)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + ) + +(defstate explode-doors (min-bomb-train) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('doors-exploded) + (let ((v0-0 #t)) + (set! (-> self doors-exploded?) v0-0) + v0-0 + ) + ) + ) + ) + :exit (behavior () + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + ) + :trans (behavior () + (if (nonzero? (-> self sound-loop-id)) + (sound-play "bomb-train" :id (-> self sound-loop-id)) + ) + ) + :code (behavior () + (when (type? (-> self root) collide-shape) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (transform-post) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) 1.0 'interp) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'complete) + (let ((t9-3 send-event-function) + (v1-14 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution))) + ) + (t9-3 + (handle->process (if (-> v1-14 manager) + (-> v1-14 manager manager) + (the-as handle #f) + ) + ) + a1-2 + ) + ) + ) + (until (-> self doors-exploded?) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; WARN: Return type mismatch process-focusable vs min-bomb-train. +(defmethod relocate ((this min-bomb-train) (offset int)) + (if (nonzero? (-> this minimap)) + (&+! (-> this minimap) offset) + ) + (if (nonzero? (-> this spark-part)) + (&+! (-> this spark-part) offset) + ) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this light-part)) + (&+! (-> this light-part) offset) + ) + (the-as min-bomb-train ((method-of-type process-focusable relocate) this offset)) + ) + +(defmethod alloc-path! ((this min-bomb-train)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (not (logtest? (-> this path flags) (path-control-flag not-found))) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod update-task-manager ((this min-bomb-train)) + (if (or (< (-> this actor-group-count) 3) (not (handle->process (-> this taskman)))) + (return (the-as object 0)) + ) + (let ((s4-0 0) + (s5-0 #t) + ) + (let ((v1-10 (-> this actor-group 3 data (-> this current-rail) actor))) + (when v1-10 + (dotimes (a0-9 2) + (let ((f28-0 (if (zero? a0-9) + 94208.0 + 40960.0 + ) + ) + (s3-0 (if (zero? a0-9) + (method-of-object this fall) + (method-of-object this explode) + ) + ) + ) + (dotimes (a1-4 (-> this actor-group a0-9 length)) + (let ((a2-4 (-> this actor-group a0-9 data a1-4 actor))) + (when (and a2-4 (= v1-10 a2-4) (not (logtest? (-> a2-4 extra perm status) (entity-perm-status subtask-complete)))) + (set! s5-0 #f) + 0.0 + (let* ((s2-0 (-> a2-4 extra trans)) + (f1-0 (path-control-method-23 (-> this path) s2-0)) + (f30-0 (* (-> this path-length) (- f1-0 (-> this path-pos)))) + ) + (when (and (< f30-0 f28-0) (< (vector-vector-distance (-> this root trans) s2-0) f28-0)) + (let ((v1-19 (handle->process (-> this taskman)))) + (when (and v1-19 (handle->process (-> (the-as task-manager v1-19) hud-timer))) + (logclear! (-> (the-as task-manager v1-19) info mask) (task-manager-mask time-limit)) + (send-event (handle->process (-> (the-as task-manager v1-19) hud-timer)) 'hide-and-die) + ) + ) + (go s3-0) + ) + (cond + ((and (< s4-0 3) (< f30-0 163840.0)) + (set! s4-0 3) + ) + ((and (< s4-0 2) (< f30-0 286720.0)) + (set! s4-0 2) + ) + ((and (< s4-0 1) (< f30-0 409600.0)) + (set! s4-0 1) + ) + ) + ) + #t + (goto cfg-81) + ) + ) + ) + ) + ) + ) + ) + (label cfg-81) + (let ((v1-42 (handle->process (-> this taskman)))) + (if (and v1-42 (handle->process (-> (the-as task-manager v1-42) hud-timer))) + (send-event (handle->process (-> (the-as task-manager v1-42) hud-timer)) 'alert s4-0) + ) + ) + (let ((a0-48 (-> this actor-group 2 data 0 actor))) + (if (and a0-48 s5-0 (logtest? (-> a0-48 extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this explode-doors)) + ) + ) + ) + 0 + ) + +(defmethod get-path-progress ((this min-bomb-train) (arg0 float) (arg1 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when (nonzero? (-> this path)) + (/ 28672.0 (-> this path-length)) + 0.0 + 0.0 + (let ((f30-0 (path-control-method-26 (-> this path) arg0 arg1))) + (let ((f28-0 (path-control-method-26 (-> this path) arg0 -28672.0)) + (f26-0 (path-control-method-26 (-> this path) arg0 28672.0)) + (s5-1 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) f30-0 'interp)) + ) + (let ((s4-0 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) f28-0 'interp)) + (a2-6 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) f26-0 'interp)) + (v1-11 (new 'stack-no-clear 'vector)) + (a1-7 (new 'stack-no-clear 'matrix)) + ) + (let ((a0-7 (new 'stack-no-clear 'vector))) + (set! (-> a0-7 quad) (-> *up-vector* quad)) + (vector-! v1-11 a2-6 s4-0) + (let ((a2-7 v1-11)) + (let ((f0-4 1.0)) + (.lvf vf1 (&-> a2-7 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a3-8 f0-4)) + (.mov vf3 a3-8) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a2-7 quad) vf1) + ) + (let ((a2-8 a1-7)) + (set! (-> a2-8 fvec quad) (-> v1-11 quad)) + (set! (-> a2-8 uvec quad) (-> a0-7 quad)) + (vector-cross! (-> a2-8 rvec) (-> a2-8 uvec) v1-11) + ) + ) + (matrix->quaternion (-> this root quat) a1-7) + ) + (set! (-> this root trans quad) (-> s5-1 quad)) + ) + f30-0 + ) + ) + ) + ) + +(defun min-bomb-train-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as min-bomb-train (-> arg0 param1)))) + (when (and (-> v1-0 next-state) (= (-> v1-0 next-state name) 'active)) + (set! (-> v1-0 wheel-angle) + (the float + (sar (shl (the int (+ (-> v1-0 wheel-angle) (* -8.439792 (seconds-per-frame) (-> v1-0 speed)))) 48) 48) + ) + ) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> v1-0 wheel-angle)) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defmethod deactivate ((this min-bomb-train)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-loop-id)) + (sound-stop (-> this sound-loop-id)) + ) + (if (nonzero? (-> this spark-part)) + (kill-particles (-> this spark-part)) + ) + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this light-part)) + (kill-particles (-> this light-part)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +(defmethod run-logic? ((this min-bomb-train)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod init-from-entity! ((this min-bomb-train) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (when (task-node-closed? (game-task-node mine-blow-resolution)) + (cleanup-for-death this) + (return #f) + ) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-bomb-train" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (not (alloc-path! this)) + (go (method-of-object this idle)) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-9 param 0) 1.0) + (set! (-> a0-9 frame-num) 0.0) + (joint-control-channel-group! + a0-9 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (let ((a0-10 (-> this node-list data 13))) + (set! (-> a0-10 param0) min-bomb-train-callback) + (set! (-> a0-10 param1) this) + (set! (-> a0-10 param2) (the-as basic 0)) + ) + (let ((a0-11 (-> this node-list data 14))) + (set! (-> a0-11 param0) min-bomb-train-callback) + (set! (-> a0-11 param1) this) + (set! (-> a0-11 param2) (the-as basic 0)) + ) + (let ((a0-12 (-> this node-list data 15))) + (set! (-> a0-12 param0) min-bomb-train-callback) + (set! (-> a0-12 param1) this) + (set! (-> a0-12 param2) (the-as basic 0)) + ) + (let ((a0-13 (-> this node-list data 16))) + (set! (-> a0-13 param0) min-bomb-train-callback) + (set! (-> a0-13 param1) this) + (set! (-> a0-13 param2) (the-as basic 0)) + ) + (set! (-> this speed) 0.0) + (if (nonzero? (-> this path)) + (set! (-> this path-length) (total-distance (-> this path))) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-44 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-44 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-44)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (when (>= (-> this actor-group-count) 3) + (let ((s5-1 (-> this actor-group 3 length))) + (set! (-> this minimap) (new 'process 'boxed-array connection-minimap s5-1)) + (dotimes (s4-1 s5-1) + (let ((v1-57 (-> this actor-group 3 data s4-1 actor))) + (if v1-57 + (set! (-> this minimap s4-1) + (add-icon! *minimap* this (the-as uint 154) (the-as int #f) (-> v1-57 extra trans) 0) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this sound-loop-id) (new-sound-id)) + (let* ((v1-64 *game-info*) + (a0-24 (+ (-> v1-64 attack-id) 1)) + ) + (set! (-> v1-64 attack-id) a0-24) + (set! (-> this attack-id) a0-24) + ) + (set! (-> this spark-part) (create-launch-control (-> *part-group-id-table* 605) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 606) this)) + (set! (-> this light-part) (create-launch-control (-> *part-group-id-table* 607) this)) + (set! (-> this doors-exploded?) #f) + (set! (-> this taskman) (the-as handle #f)) + (when (not (task-open? (the-as string ((method-of-type res-lump get-property-struct) + (-> this entity) + 'task-name + 'interp + -1000000000.0 + "mine-blow-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this wait)) + ) + (if (task-node-open? (game-task-node mine-explore-resolution)) + (go (method-of-object this idle)) + ) + (go (method-of-object this active)) + ) diff --git a/goal_src/jak3/levels/mine/mined-mood.gc b/goal_src/jak3/levels/mine/mined-mood.gc index 79b57a384a..8424237dbb 100644 --- a/goal_src/jak3/levels/mine/mined-mood.gc +++ b/goal_src/jak3/levels/mine/mined-mood.gc @@ -7,3 +7,72 @@ ;; DECOMP BEGINS +(deftype mined-states (structure) + ((filter vector 2 :inline) + (light light-sphere 2) + ) + ) + + +(defun set-mined-filter-light! ((arg0 string) (arg1 light-hash) (arg2 vector) (arg3 light-sphere)) + (cond + ((and arg3 (nonzero? arg3)) + (let ((v1-1 (-> arg3 color))) + (set! (-> v1-1 x) (-> arg2 x)) + (set! (-> v1-1 y) (-> arg2 y)) + (set! (-> v1-1 z) (-> arg2 z)) + ) + (set! (-> arg3 brightness) (-> arg2 w)) + arg3 + ) + (else + (lookup-light-sphere-by-name arg0 arg1) + ) + ) + ) + +(defun init-mood-mined ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 1))) + (set-vector! (-> v1-0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 dir0 extra x) 0.0) + (set! (-> v1-0 dir1 extra x) 0.0) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 1.0) + ) + ) + +(defbehavior update-mood-mined time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((s5-0 (the-as mined-states (-> arg0 state)))) + (let ((s4-1 (-> *level* level arg2 bsp light-hash))) + (set! (-> s5-0 light 0) + (set-mined-filter-light! "light-3802" s4-1 (the-as vector (-> s5-0 filter)) (-> s5-0 light 0)) + ) + (set! (-> s5-0 light 1) (set-mined-filter-light! "light-3803" s4-1 (-> s5-0 filter 1) (-> s5-0 light 1))) + ) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 quad) (-> s5-0 filter 0 quad)) + (set! (-> arg0 times 2 quad) (-> s5-0 filter 1 quad)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defun set-mined-filter! ((arg0 vector) (arg1 int)) + (let ((v1-1 (level-get *level* 'mined))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as mined-states v1-2) filter arg1 quad) (-> arg0 quad)) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/mine/mined-texture.gc b/goal_src/jak3/levels/mine/mined-texture.gc index b3a335a0ec..12bc2a6014 100644 --- a/goal_src/jak3/levels/mine/mined-texture.gc +++ b/goal_src/jak3/levels/mine/mined-texture.gc @@ -7,3 +7,7 @@ ;; DECOMP BEGINS +;; stub +(defun set-mined-pillar-texture! ((arg0 float)) + (none) + ) \ No newline at end of file diff --git a/goal_src/jak3/levels/mine/monster-frog.gc b/goal_src/jak3/levels/mine/monster-frog.gc index c692ac280c..2b2ec1ad70 100644 --- a/goal_src/jak3/levels/mine/monster-frog.gc +++ b/goal_src/jak3/levels/mine/monster-frog.gc @@ -7,3 +7,951 @@ ;; DECOMP BEGINS +(defskelgroup skel-monster-frog monster-frog monster-frog-lod0-jg monster-frog-idle0-ja + ((monster-frog-lod0-mg (meters 20)) (monster-frog-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow monster-frog-shadow-mg + :origin-joint-index 12 + ) + +(deftype monster-frog (nav-enemy) + () + (:state-methods + (attack vector) + attack-recover + turn + ) + ) + + +(define *fact-info-monster-frog-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +(define *monster-frog-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 5 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 2 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 2 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 8 + :hostile-anim 18 + :hit-anim 30 + :knocked-anim 30 + :knocked-land-anim 31 + :die-anim 4 + :die-falling-anim 4 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-die (static-sound-name "frog-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 2.87) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 4551.1113 + :knocked-soft-vxz-lo 75776.0 + :knocked-soft-vxz-hi 75776.0 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 81920.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 79872.0 + :knocked-hard-vxz-hi 79872.0 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 75776.0 + :knocked-yellow-vxz-hi 75776.0 + :knocked-yellow-vy-lo 81920.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 73728.0 + :knocked-red-vxz-hi 73728.0 + :knocked-red-vy-lo 96256.0 + :knocked-red-vy-hi 96256.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 16 + :turn-anim 16 + :run-anim 18 + :taunt-anim -1 + :run-travel-speed (meters 18) + :run-acceleration (meters 10) + :run-turning-acceleration (meters 80) + :walk-travel-speed (meters 11.44) + :walk-acceleration (meters 5) + :walk-turning-acceleration (meters 20) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 1.5) + :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! (-> *monster-frog-nav-enemy-info* fact-defaults) *fact-info-monster-frog-defaults*) + +;; WARN: new jak 2 until loop case, check carefully +(defbehavior monster-frog-hop-slow-code monster-frog () + (until #f + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (cond + ((zero? (rnd-int self 4)) + (let ((v1-7 (ja-group))) + (if (not (and v1-7 (= v1-7 monster-frog-idle0-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let ((v1-38 (ja-group))) + (if (not (and v1-38 (= v1-38 monster-frog-idle1-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (let ((v1-71 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-71 enemy-flags))) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-71 enemy-flags)))) + ) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-71 enemy-flags)))) + (set! (-> v1-71 nav callback-info) (-> v1-71 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.035)) + (let ((v1-74 self)) + (set! (-> v1-74 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-74 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-78 (-> self nav))) + (set! (-> v1-78 target-speed) (* 1.4 (-> self enemy-info walk-travel-speed))) + ) + 0 + (let ((v1-80 self)) + (set! (-> v1-80 enemy-flags) (the-as enemy-flag (logclear (-> v1-80 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek! max 1.4) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.4)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek! max 1.4) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.4)) + ) + ) + #f + ) + +;; WARN: new jak 2 until loop case, check carefully +(defbehavior monster-frog-hop-fast-code monster-frog () + (until #f + (nav-enemy-method-177 self) + (ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + +(defstate ambush (monster-frog) + :virtual #t + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let ((v1-12 (-> self root root-prim))) + (set! (-> v1-12 prim-core collide-as) (collide-spec)) + (set! (-> v1-12 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (update-focus self) + (let ((a0-2 (handle->process (-> self focus handle)))) + (when a0-2 + (let* ((gp-0 (-> self root)) + (s3-0 + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> gp-0 trans)) + 1.0 + ) + ) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-0 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-0 quat) (-> gp-0 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (ja-no-eval :group! monster-frog-popup0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-37 (-> self root root-prim))) + (set! (-> v1-37 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-37 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +(defstate notice (monster-frog) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (new 'stack-no-clear 'vector) + (ja-no-eval :group! monster-frog-notice0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! monster-frog-notice0-jump-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-7 (handle->process (-> self focus handle)))) + (if a0-7 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-7) 0) + (* 98304.0 f30-0) + (seconds 0.02) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! monster-frog-notice0-land-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +(defstate active (monster-frog) + :virtual #t + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (nav-enemy-method-176 self) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (when (enemy-method-134 self 0.2) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (let ((v1-57 self)) + (set! (-> v1-57 enemy-flags) (the-as enemy-flag (logclear (-> v1-57 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-57 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-121 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-121 enemy-flags))) + (set! (-> v1-121 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-121 enemy-flags)))) + ) + (set! (-> v1-121 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-121 enemy-flags)))) + (set! (-> v1-121 nav callback-info) (-> v1-121 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-176 self) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + ) + +(defstate pacing (monster-frog) + :virtual #t + :code monster-frog-hop-slow-code + ) + +(defstate circling (monster-frog) + :virtual #t + :code monster-frog-hop-slow-code + ) + +(defstate stare (monster-frog) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy 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 ef38)))) + ) + 0 + ) + ) + +(defstate hostile (monster-frog) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag alert)) + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) + (go-stare self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + (when (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags))) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-stare self) + ) + ) + ) + ) + :code (behavior () + (until #f + (let* ((gp-0 (handle->process (-> self focus handle))) + (a0-4 (if (type? gp-0 process-focusable) + (the-as process-focusable gp-0) + ) + ) + ) + (cond + (a0-4 + (let* ((s5-0 (get-trans a0-4 0)) + (a1-4 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self root trans))) + (f30-0 (vector-length a1-4)) + (gp-1 (-> self enemy-info)) + ) + (let ((a1-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-4 1.0))) + (if (not (enemy-method-103 self a1-5 6371.5557)) + (go-virtual turn) + ) + ) + (if (< f30-0 32768.0) + (go-virtual attack s5-0) + ) + (let* ((f28-0 (fmax 0.0 (fmin 1.0 (* 0.000034877234 (+ -32768.0 f30-0))))) + (f26-0 (lerp 0.5 1.0 f28-0)) + (f30-1 (lerp 0.0 1.0 f28-0)) + (f28-1 (lerp 1.4 1.0 f28-0)) + ) + (let ((v1-21 (-> self nav))) + (set! (-> v1-21 target-speed) (/ (* f26-0 (-> gp-1 run-travel-speed)) f28-1)) + ) + 0 + (let ((v1-23 (-> self nav))) + (set! (-> v1-23 acceleration) (-> gp-1 run-acceleration)) + ) + 0 + (let ((v1-25 (-> self nav))) + (set! (-> v1-25 turning-acceleration) (-> gp-1 run-turning-acceleration)) + ) + 0 + (ja-channel-push! 2 (seconds 0.01)) + (ja-no-eval :group! monster-frog-hop-small-start-ja :num! (seek! max f28-1) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! monster-frog-hop-slow-start-ja + :num! (chan 0) + :frame-interp0 f30-1 + :frame-interp1 f30-1 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f28-1)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-1 :frame-interp1 f30-1) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-small-end-ja :num! (seek! max f28-1) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! monster-frog-hop-slow-end-ja + :num! (chan 0) + :frame-interp0 f30-1 + :frame-interp1 f30-1 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f28-1)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-1 :frame-interp1 f30-1) + ) + ) + ) + ) + (else + (suspend) + 0 + ) + ) + ) + ) + #f + ) + ) + +(defstate turn (monster-frog) + :virtual #t + :event enemy-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-0 enemy-flags)))) + ) + 0 + (ja-no-eval :group! monster-frog-rotate-left-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-26 self)) + (set! (-> v1-26 enemy-flags) (the-as enemy-flag (logclear (-> v1-26 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (ja-no-eval :group! monster-frog-rotate-left-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (let ((a0-4 (handle->process (-> self focus handle)))) + (if a0-4 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-4) 0) + 81920.0 + (seconds 0.02) + ) + ) + ) + ) + ) + (nav-enemy-simple-post) + ) + ) + +(defstate attack (monster-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior ((arg0 vector)) + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-9 *game-info*) + (a1-15 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a1-15) + (set! (-> self attack-id) a1-15) + ) + (let* ((gp-0 (-> self root trans)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) arg0 gp-0)) + ) + (let ((f0-0 (vector-length s5-1))) + (vector-normalize! s5-1 (fmin f0-0 (-> self enemy-info run-travel-speed))) + ) + (let ((a0-3 (-> self nav state)) + (v1-17 (vector+! (new 'stack-no-clear 'vector) gp-0 s5-1)) + ) + (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-3 target-pos quad) (-> v1-17 quad)) + ) + ) + 0 + ) + :exit (behavior () + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior ((arg0 vector)) + (ja-channel-push! 1 (seconds 0.04)) + (nav-enemy-method-177 self) + (ja-no-eval :group! monster-frog-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (go-virtual attack-recover) + ) + :post nav-enemy-travel-post + ) + +(defstate attack-recover (monster-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :code (behavior () + (ja-no-eval :group! monster-frog-attack0-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (cond + ((zero? (rnd-int self 4)) + (let ((v1-28 (ja-group))) + (if (not (and v1-28 (= v1-28 monster-frog-idle0-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let ((v1-59 (ja-group))) + (if (not (and v1-59 (= v1-59 monster-frog-idle1-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +(defmethod knocked-anim ((this monster-frog) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 0) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) + ) + #t + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 0) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) 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 (-> this draw art-group data 22)) num-func-seek!) + ) + #t + ) + (else + (cond + ((= (-> this incoming knocked-type) (knocked-type none)) + (ja-channel-push! 1 0) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + (set! (-> a0-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) + ) + (set! (-> a0-8 param 1) (-> arg0 anim-speed)) + (set! (-> a0-8 frame-num) 0.0) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 0) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 32))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 32)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 32)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +(defmethod knocked-land-anim ((this monster-frog) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) + ) + #t + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) 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 (-> this draw art-group data 23)) num-func-seek!) + ) + #t + ) + (else + (cond + ((= (-> this incoming knocked-type) (knocked-type none)) + (ja-channel-push! 1 0) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) + (set! (-> a0-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 31)) frames num-frames) -1)) + ) + (set! (-> a0-8 param 1) (-> arg0 anim-speed)) + (set! (-> a0-8 frame-num) 0.0) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 31)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 0) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +(defmethod enemy-common-post ((this monster-frog)) + (water-control-method-10 (-> this water)) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +(defmethod init-enemy-collision! ((this monster-frog)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 8192.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 1638.4 3276.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set! (-> v1-15 transform-index) 5) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 2048.0 2662.4) + ) + (set! (-> s5-0 nav-radius) 4915.2) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this monster-frog)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-monster-frog" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *monster-frog-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) + (set! (-> this water flags) + (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) + ) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this water wake-size) 6144.0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/mine/prebot-extras.gc b/goal_src/jak3/levels/mine/prebot-extras.gc index d1b3a27788..04f135a938 100644 --- a/goal_src/jak3/levels/mine/prebot-extras.gc +++ b/goal_src/jak3/levels/mine/prebot-extras.gc @@ -7,3 +7,1299 @@ ;; DECOMP BEGINS +(deftype cav-break-bridge (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (cav-break-bridge) + :virtual #t + :enter (behavior () + (transform-post) + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this cav-break-bridge) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 4) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 21.7088 769.2288 5129.8306 14745.19) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) -10593.075 -778.24 26691.584 37455.87) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-break-bridge" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (when (task-node-closed? (game-task-node mine-boss-introduction)) + (cleanup-for-death this) + (deactivate this) + ) + (go (method-of-object this idle)) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this cav-railblocker)) + (the-as search-info-flag (if (-> this trackable) + 24 + 1 + ) + ) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod cav-railblocker-method-30 ((this cav-railblocker) (arg0 symbol)) + (when (>= (- (current-time) (-> this red-tip-change-time)) 0) + (set! (-> this alt-red-tip-on) (not (-> this alt-red-tip-on))) + (let* ((f30-0 37.5) + (v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-9 (the-as number (logior #x3f800000 v1-8))) + ) + (set! (-> this red-tip-change-time) + (the-as time-frame (+ (the int (* f30-0 (+ -1.0 (the-as float v1-9)))) 150 (current-time))) + ) + ) + (set! arg0 #t) + ) + (when arg0 + (remove-from-process *part-engine* this) + (if (-> this alt-red-tip-on) + (add-connection *part-engine* this 5 this 4490 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 6 this 4490 (new 'static 'vector :w 819200.0)) + ) + (add-connection *part-engine* this 7 this 4489 (new 'static 'vector :w 819200.0)) + ) + (none) + ) + +(defstate idle (cav-railblocker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (or (not (-> self notify-on-die)) (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) 'railblocker-hittable?) + (set! (-> a1-1 param 0) (the-as uint #t)) + (let ((t9-0 send-event-function) + (v1-7 (-> self notify-on-die)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-1 + ) + ) + ) + ) + (let ((f0-0 1.0) + (v1-11 (the-as attack-info (-> block param 1))) + ) + (when (and (or (not (logtest? (-> v1-11 mask) (attack-mask id))) (!= (-> self incoming-attack-id) (-> v1-11 id))) + (!= (-> self hit-points) 0.0) + ) + (if (logtest? (-> v1-11 mask) (attack-mask id)) + (set! (-> self incoming-attack-id) (-> v1-11 id)) + ) + (if (logtest? (attack-mask damage) (-> v1-11 mask)) + (set! f0-0 (-> v1-11 damage)) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! f0-0 (* 0.6666667 f0-0)) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f0-0))) + (cond + ((= (-> self hit-points) 0.0) + (go-virtual fall) + ) + ((< (-> self hit-points) 5.0) + (setup-masks (-> self draw) 8 22) + ) + ((< (-> self hit-points) 10.0) + (setup-masks (-> self draw) 6 24) + ) + (else + (setup-masks (-> self draw) 0 12) + ) + ) + ) + ) + ) + #t + ) + ) + ) + :enter (behavior () + (transform-post) + (cav-railblocker-method-30 self #t) + ) + :trans (behavior () + (set! (-> self trackable) + (the-as symbol (or (not (-> self notify-on-die)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'railblocker-hittable?) + (set! (-> a1-0 param 0) (the-as uint #f)) + (let ((t9-0 send-event-function) + (v1-5 (-> self notify-on-die)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + ) + (cav-railblocker-method-30 self #f) + ) + :code sleep-code + ) + +(defstate fall (cav-railblocker) + :virtual #t + :enter (behavior () + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cav-railblocker-explode" (the-as (pointer level) #f)) + 5 + gp-0 + *cav-railblocker-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 218)) + (set! (-> gp-1 collide-with) (collide-spec)) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (the-as process-drawable *default-pool*)) + ) + (set-time! (-> self state-time)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-22 (-> self root root-prim))) + (set! (-> v1-22 prim-core collide-as) (collide-spec)) + (set! (-> v1-22 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :trans (behavior () + (when (+ (current-time) -1) + (ja-channel-set! 0) + (ja-post) + ) + (let ((gp-0 (res-lump-value (-> self entity) 'animation-select uint128 :time -1000000000.0))) + (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) 'blocker-died) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-3 send-event-function) + (v1-9 (-> self notify-on-die)) + ) + (t9-3 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'blocker-died) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-4 send-event-function) + (v1-15 (-> self notify-on-die-2)) + ) + (t9-4 + (if v1-15 + (-> v1-15 extra process) + ) + a1-2 + ) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this cav-railblocker) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set-vector! (-> v1-2 local-sphere) 0.0 8192.0 0.0 12288.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-railblocker" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this incoming-attack-id) (the-as uint 0)) + (set! (-> this hit-points) 10.0) + (set! (-> this trackable) #t) + (set! (-> this notify-on-die) #f) + (set! (-> this notify-on-die-2) #f) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-17 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-17 (nonzero? (-> sv-16 elt-count))) + (let ((v1-18 (-> v1-17 0))) + (if (> (-> v1-18 length) 0) + (set! (-> this notify-on-die) (-> v1-18 data 0 actor)) + ) + (if (< 1 (-> v1-18 length)) + (set! (-> this notify-on-die-2) (-> v1-18 data 1 actor)) + ) + ) + ) + ) + (set! (-> this red-tip-change-time) 0) + (set! (-> this alt-red-tip-on) #f) + (setup-masks (-> this draw) 0 12) + (when (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (cleanup-for-death this) + (deactivate this) + ) + (go (method-of-object this idle)) + ) + +(defstate idle (cav-minecar) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('blocker-died) + (cleanup-for-death self) + (deactivate self) + ) + ) + ) + :enter (behavior () + (transform-post) + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this cav-minecar) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set-vector! (-> v1-2 local-sphere) 0.0 8192.0 0.0 4096.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-minecar" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 10)) + (when (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (cleanup-for-death this) + (deactivate this) + ) + (go (method-of-object this idle)) + ) + +(defstate idle (prebot-sword) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-1 object)) + (case message + (('touch 'bonk 'attack) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'attack) + (set! (-> a1-3 param 0) (the-as uint #f)) + (set! (-> a1-3 param 1) + (the-as uint (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + (if (and (send-event-function proc a1-3) (= proc *target*)) + (sound-play "sword-hit-jak" :position (-> (the-as process-drawable proc) root trans)) + ) + ) + ) + (('scale) + (set! (-> self blade-scale target) (the-as float (-> block param 0))) + ) + (('use-pos-pitch) + (set! v0-1 (-> block param 0)) + (set! (-> self use-pos-pitch) (the-as symbol v0-1)) + v0-1 + ) + (('whoosh-lead) + (set! (-> self whoosh-lead) (the-as float (-> block param 0))) + (set! v0-1 #t) + (set! (-> self allow-whoosh) (the-as symbol v0-1)) + v0-1 + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + (update! (-> self blade-scale) 0.0) + (set-vector! (-> self blade-jm scale) 1.0 (-> self blade-scale value) 1.0 1.0) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-sword-lod0-jg blade))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (vector-float*! gp-0 gp-0 0.5) + (vector+float*! + gp-0 + gp-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-sword-lod0-jg tip)) + 0.5 + ) + (vector-! s5-0 gp-0 (-> self prev-position)) + (set! (-> self prev-position quad) (-> gp-0 quad)) + (let ((v1-13 s5-0)) + (.lvf vf1 (&-> s5-0 quad)) + (let ((f0-7 (-> self 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 (&-> v1-13 quad) vf1) + ) + (let ((f30-1 (fabs (- (-> gp-0 x) (-> (target-pos 0) x))))) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) + (set! (-> self sword-sound-playing) #t) + (let* ((s2-0 (new 'stack-no-clear 'vector)) + (v1-19 gp-0) + (a0-19 (-> self parent)) + (s2-1 (vector-! s2-0 v1-19 (-> (the-as prebot (if a0-19 + (the-as prebot (-> a0-19 0 self)) + ) + ) + entity + extra + trans + ) + ) + ) + (s3-2 (vector-! (new 'stack-no-clear 'vector) gp-0 (target-pos 0))) + (f28-0 (doppler-pitch-shift gp-0 s5-0)) + (s4-3 (if (-> self alternate-sound) + (static-sound-spec "boss-sword-2" :group 1 :volume 0.0 :mask (pitch reg0)) + (static-sound-spec "boss-sword" :group 1 :volume 0.0 :mask (pitch reg0)) + ) + ) + ) + 1.0 + (let ((f26-0 (lerp-scale + 0.0 + 1.0 + f30-1 + (if (< f30-1 (-> self old-target-dist)) + 40960.0 + 20480.0 + ) + 0.0 + ) + ) + ) + (let ((f0-13 (* 0.002 f28-0))) + (fmin 0.1 f0-13) + ) + (let ((f28-4 (+ 0.0 + (lerp-scale 0.0 0.1 (-> s2-1 y) 20480.0 122880.0) + (lerp-scale 0.0 0.1 (-> s5-0 y) 204800.0 1024000.0) + (lerp-scale 0.0 -0.2 (-> s5-0 y) -204800.0 -1024000.0) + ) + ) + ) + (when (-> self use-pos-pitch) + (+! f28-4 (* 0.2 f26-0)) + (when (and (-> self allow-whoosh) (< (fabs (-> s3-2 x)) (-> self whoosh-lead))) + (set! (-> self allow-whoosh) #f) + (sound-play "sword-whoosh-by" :position gp-0) + ) + ) + (seek! (-> self current-volume) (lerp-scale 1.0 1.5 (vector-length s5-0) 204800.0 1024000.0) 0.02) + (set! (-> s4-3 volume) (the int (* 1024.0 (-> self current-volume)))) + (set! (-> s4-3 pitch-mod) (the int (* 1524.0 f28-4))) + ) + ) + (sound-play-by-spec s4-3 (-> self sword-sound) gp-0) + ) + ) + (set! (-> self old-target-dist) f30-1) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + ) + ) + +(defmethod relocate ((this prebot-sword) (offset int)) + (if (nonzero? (-> this blade-jm)) + (&+! (-> this blade-jm) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this prebot-sword)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this sword-sound-playing) + (sound-stop (-> this sword-sound)) + ) + ((method-of-type process-focusable deactivate) (the-as process-focusable this)) + (none) + ) + +(deftype prebot-shockwave-joint-position (structure) + ((joint-index int8) + (position vector :inline) + ) + ) + + +(defstate idle (prebot-shockwave) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'bonk) + (if (= proc *target*) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (ja :num! (seek!)) + (if (ja-done? 0) + (deactivate self) + ) + (let ((gp-0 (new 'stack-no-clear 'collide-query)) + (s4-0 (new 'stack-no-clear 'bounding-box)) + (s5-0 + (new 'static 'boxed-array :type prebot-shockwave-joint-position + (new 'static 'prebot-shockwave-joint-position :joint-index 33) + (new 'static 'prebot-shockwave-joint-position :joint-index 15) + (new 'static 'prebot-shockwave-joint-position :joint-index 29) + (new 'static 'prebot-shockwave-joint-position :joint-index 13) + (new 'static 'prebot-shockwave-joint-position :joint-index 27) + (new 'static 'prebot-shockwave-joint-position :joint-index 11) + (new 'static 'prebot-shockwave-joint-position :joint-index 25) + (new 'static 'prebot-shockwave-joint-position :joint-index 19) + (new 'static 'prebot-shockwave-joint-position :joint-index 31) + (new 'static 'prebot-shockwave-joint-position :joint-index 17) + (new 'static 'prebot-shockwave-joint-position :joint-index 36) + ) + ) + ) + (vector<-cspace! (-> s4-0 min) (-> self node-list data (-> s5-0 (+ (-> s5-0 length) -1) joint-index))) + (set! (-> s4-0 max quad) (-> s4-0 min quad)) + (set! (-> s5-0 (+ (-> s5-0 length) -1) position quad) (-> s4-0 min quad)) + (dotimes (s3-0 (+ (-> s5-0 length) -1)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (vector<-cspace! (-> s5-0 s3-0 position) (-> self node-list data (-> s5-0 s3-0 joint-index))) + (vector+! s2-0 (-> s5-0 s3-0 position) (new 'static 'vector :x 2048.0 :y 2048.0 :z 2048.0)) + (set! (-> s4-0 max x) (fmax (-> s2-0 x) (-> s4-0 max x))) + (set! (-> s4-0 max y) (fmax (-> s2-0 y) (-> s4-0 max y))) + (set! (-> s4-0 max z) (fmax (-> s2-0 z) (-> s4-0 max z))) + (vector-! s2-0 (-> s5-0 s3-0 position) (new 'static 'vector :x 2048.0 :y 2048.0 :z 2048.0)) + (set! (-> s4-0 min x) (fmin (-> s2-0 x) (-> s4-0 min x))) + (set! (-> s4-0 min y) (fmin (-> s2-0 y) (-> s4-0 min y))) + (set! (-> s4-0 min z) (fmin (-> s2-0 z) (-> s4-0 min z))) + ) + ) + (set! (-> gp-0 collide-with) (collide-spec jak player-list)) + (set! (-> gp-0 ignore-process0) #f) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> gp-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer s4-0) 32) + (fill-using-bounding-box *collide-cache* gp-0) + (dotimes (s4-1 (+ (-> s5-0 length) -1)) + (set! (-> gp-0 start-pos quad) (-> s5-0 s4-1 position quad)) + (vector-! (-> gp-0 move-dist) (-> s5-0 (+ s4-1 1) position) (-> gp-0 start-pos)) + (let ((v1-52 gp-0)) + (set! (-> v1-52 radius) 2048.0) + (set! (-> v1-52 collide-with) (collide-spec jak player-list)) + (set! (-> v1-52 ignore-process0) #f) + (set! (-> v1-52 ignore-process1) #f) + (set! (-> v1-52 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-52 action-mask) (collide-action solid)) + ) + (if (>= (probe-using-line-sphere *collide-cache* gp-0) 0.0) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + ) + ) + +(deftype prebot-gun-shot (projectile) + ((whoosh-sound uint32) + ) + ) + + +(defmethod projectile-method-40 ((this prebot-gun-shot)) + 256 + ) + +(defmethod setup-collision! ((this prebot-gun-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-projectile) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec + backgnd + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 3072.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this prebot-gun-shot)) + (set! (-> this attack-mode) 'eco-dark) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1335) this)) + (set! (-> this sound-id) (new-sound-id)) + ((method-of-type projectile init-proj-settings!) this) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this prebot-gun-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "launch-bomb" :position (-> this root trans)) + (set! (-> this whoosh-sound) (the-as uint (sound-play "bomb-whoosh" :position (-> this root trans)))) + ) + ((= v1-0 (projectile-options po0)) + (sound-stop (the-as sound-id (-> this whoosh-sound))) + (sound-play "bomb-explode" :position (-> this root trans)) + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-16 (static-sound-spec "blue-trail" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-16 volume) 1024) + (set! (-> a0-16 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-16 (-> this sound-id) (-> this root trans)) + ) + ) + ) + ) + (none) + ) + +(defstate moving (prebot-gun-shot) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type projectile moving) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (logtest? (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + no-touch + blocked + on-water + impact-surface + touch-background + stuck + touch-ceiling-sticky + glance + probe-hit + ) + (-> self root status) + ) + (go-impact! self) + ) + ) + ) + +(defstate impact (prebot-gun-shot) + :virtual #t + :code (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) 8192.0) + (set! (-> gp-0 scale) 1.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 1343)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-0 damage) 2.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 (the-as process-drawable (ppointer->process (-> self parent)))) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (let ((gp-1 (current-time))) + (while (or (-> self child) (not (time-elapsed? gp-1 (seconds 10)))) + (suspend) + ) + ) + (deactivate self) + ) + ) + +(defstate idle (prebot-gun) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fire) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> gp-0 ent) (-> self entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-gun-lod0-jg gunTip)) quad) + ) + (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> self node-list data 7 bone transform uvec) + (* 4096.0 (-> self clock frames-per-second)) + ) + quad + ) + ) + (set! (-> gp-0 notify-handle) (the-as handle #f)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-18 *game-info*) + (a0-10 (+ (-> v1-18 attack-id) 1)) + ) + (set! (-> v1-18 attack-id) a0-10) + (set! (-> gp-0 attack-id) a0-10) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (spawn-projectile prebot-gun-shot gp-0 (ppointer->process (-> self parent)) *default-dead-pool*) + ) + (if (logtest? (-> *part-group-id-table* 1334 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> self node-list data 7 bone transform) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> self node-list data 7 bone transform) + ) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defmethod relocate ((this prebot-tentacle) (offset int)) + (if (nonzero? (-> this aim-jm)) + (&+! (-> this aim-jm) offset) + ) + (if (nonzero? (-> this half-aim-jm)) + (&+! (-> this half-aim-jm) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this prebot-tentacle)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this laser-sound-playing) + (sound-stop (-> this laser-sound)) + ) + (call-parent-method this) + (none) + ) + +(defstate idle (prebot-tentacle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('look-at) + (cond + ((-> block param 0) + (let ((s5-0 (-> block param 0))) + (blend-on! (-> self aim-jm) (seconds 0.25) 1.0 #f) + (set-target! (-> self aim-jm) (the-as vector s5-0)) + (blend-on! (-> self half-aim-jm) (seconds 0.25) 0.5 #f) + (set-target! (-> self half-aim-jm) (the-as vector s5-0)) + ) + ) + (else + (blend-to-off! (-> self aim-jm) (seconds 0.25) #f) + (blend-to-off! (-> self half-aim-jm) (seconds 0.25) #f) + ) + ) + (cond + ((-> block param 1) + (let ((t2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-tentacle-lod0-jg gun)))) + (sound-play "prebot-laser" :id (-> self laser-sound) :position t2-0) + ) + (let ((v0-0 #t)) + (set! (-> self laser-sound-playing) v0-0) + v0-0 + ) + ) + ((-> self laser-sound-playing) + (sound-stop (-> self laser-sound)) + (set! (-> self laser-sound-playing) #f) + #f + ) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(define *prebot-eco-pillar-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-cav-molten-pil-debris-a") + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-cav-molten-pil-debris-b" + :offset (new 'static 'vector :y -4096.0 :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-cav-molten-pil-debris-c" + :offset (new 'static 'vector :y -20480.0 :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-cav-molten-pil-debris-d" + :offset (new 'static 'vector :y -36864.0 :w 1.0) + ) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defmethod relocate ((this prebot-eco-pillar) (offset int)) + (if (nonzero? (-> this heat-part)) + (&+! (-> this heat-part) offset) + ) + (if (nonzero? (-> this cool-part)) + (&+! (-> this cool-part) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this prebot-eco-pillar)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this heat-part)) + (kill-particles (-> this heat-part)) + ) + (if (nonzero? (-> this cool-part)) + (kill-particles (-> this cool-part)) + ) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch symbol vs object. +(defbehavior prebot-eco-pillar-handler prebot-eco-pillar ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touch 'bonk) + (when (and (= arg0 *target*) (-> self hot)) + (if (send-event + *target* + 'attack-or-shove + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + (send-event (ppointer->process (-> self parent)) 'touched-hot-pillar) + ) + ) + #t + ) + (('vulnerable) + (let ((v0-2 #t)) + (set! (-> self vulnerable) v0-2) + v0-2 + ) + ) + (('attack) + (when (and (-> self vulnerable) (type? arg0 prebot-gun-shot)) + (let ((a1-12 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-12 hit-xz-reaction) 0.95) + (set! (-> a1-12 hit-y-reaction) 0.6) + (set! (-> a1-12 fountain-rand-transv-lo quad) (-> self root trans quad)) + (+! (-> a1-12 fountain-rand-transv-lo z) 4096.0) + (debris-spawn + (the-as process-drawable (ppointer->process (-> self parent))) + a1-12 + *prebot-eco-pillar-debris-params* + self + ) + ) + (sound-play "columns-break" :position (-> self root trans)) + (cond + ((logtest? (-> *part-group-id-table* 1344 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1344)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1344)) + ) + ) + (go-virtual wait-to-die) + ) + #f + ) + ) + ) + +(defstate wait-to-die (prebot-eco-pillar) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (+ (current-time) -1) + (deactivate self) + ) + ) + :code sleep-code + ) + +(defstate idle (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :code sleep-code + :post (behavior () + (do-push-aways (-> self root)) + ) + ) + +(defstate cool-down (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self hot) #f) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual idle) + ) + (let ((f30-0 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 0.0 300.0))) + (let ((f28-0 (lerp-scale 1.0 0.0 f30-0 0.5 1.0))) + (set-mined-pillar-texture! f30-0) + (set-vector! (-> self draw color-emissive) f28-0 f28-0 f28-0 1.0) + ) + (set-vector! (-> self draw color-mult) f30-0 f30-0 f30-0 1.0) + ) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self root trans quad)) + (set! (-> a1-2 y) (-> self start-y)) + (spawn (-> self cool-part) a1-2) + ) + ) + :code sleep-code + :post (behavior () + (do-push-aways (-> self root)) + ) + ) + +(defstate wait-to-cool (prebot-eco-pillar) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('cool-down) + (go-virtual cool-down) + ) + (else + (prebot-eco-pillar-handler proc argc message block) + ) + ) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 y) (-> self start-y)) + (spawn (-> self part) a1-0) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate grow (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* 819.2 37 600 1.0 1.1 (-> *display* camera-clock)) + (sound-play "columns-raise" :position (-> self root trans)) + ) + :exit (behavior () + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* 819.2 37 300 1.0 1.1 (-> *display* camera-clock)) + ) + :trans (behavior () + (set! (-> self root trans y) (lerp-scale + (+ 4300.8 (-> self start-y)) + (-> self end-y) + (the float (- (current-time) (-> self state-time))) + 0.0 + 75.0 + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.25)) + (go-virtual wait-to-cool) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> self root trans quad)) + (set! (-> a1-1 y) (-> self start-y)) + (spawn (-> self part) a1-1) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate heat-up (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :enter (behavior () + (ja :num-func num-func-identity :frame-num max) + (set-time! (-> self state-time)) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + ) + :exit (behavior () + (set! (-> self hot) #t) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (set! (-> self hot) #t) + ) + (if (time-elapsed? (-> self state-time) (seconds 5)) + (go-virtual grow) + ) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 y) (-> self start-y)) + (spawn (-> self heat-part) a1-0) + ) + (set! (-> self root trans y) (lerp-scale + (-> self start-y) + (+ 4300.8 (-> self start-y)) + (the float (- (current-time) (-> self state-time))) + 0.0 + 300.0 + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(deftype cav-exit-door (process-drawable) + ((initial-y float) + ) + (:state-methods + idle + rise + ) + ) + + +(defstate rise (cav-exit-door) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (sound-play "mb-door-open") + ) + :trans (behavior () + (set! (-> self root trans y) + (+ (-> self initial-y) (lerp-scale 0.0 32768.0 (the float (- (current-time) (-> self state-time))) 0.0 300.0)) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (sound-play "mb-door-hit") + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + :post transform-post + ) + +(defstate idle (cav-exit-door) + :virtual #t + :enter (behavior () + (transform-post) + ) + :trans (behavior () + (let ((f0-0 (vector-vector-distance-squared (-> self root trans) (target-pos 0))) + (f1-0 16384.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (go-virtual rise) + ) + ) + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this cav-exit-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 74.1376 13979.238 -22.528 20222.771) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-exit-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this initial-y) (-> this root trans y)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/mine/prebot-part.gc b/goal_src/jak3/levels/mine/prebot-part.gc index ae9cf82e1b..e84bcee9f0 100644 --- a/goal_src/jak3/levels/mine/prebot-part.gc +++ b/goal_src/jak3/levels/mine/prebot-part.gc @@ -5,5 +5,1600 @@ ;; name in dgo: prebot-part ;; dgos: MINED +(define-extern *range-mine-boss-stuck-flame-color* curve-color-fast) +(define-extern *range-mine-boss-stuck-flame-alpha* curve2d-fast) +(define-extern *range-mine-boss-stuck-flame-scale-x* curve2d-fast) +(define-extern *range-mine-boss-stuck-flame-scale-y* curve2d-fast) +(define-extern *r-curve-mine-boss-stuck-flame* curve2d-fast) +(define-extern *g-curve-mine-boss-stuck-flame* curve2d-fast) +(define-extern *b-curve-mine-boss-stuck-flame* curve2d-fast) +(define-extern *curve-mine-boss-stuck-flame-alpha* curve2d-fast) +(define-extern *curve-mine-boss-stuck-flame-scale-x* curve2d-fast) +(define-extern *curve-mine-boss-stuck-flame-scale-y* curve2d-fast) +(define-extern *part-prebot-stuck-flame-curve-settings* particle-curve-settings) +(define-extern *range-mine-boss-explo-color* curve-color-fast) +(define-extern *range-mine-boss-explo-alpha* curve2d-fast) +(define-extern *range-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *range-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *curve-mine-boss-explo-alpha* curve2d-fast) +(define-extern *curve-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *curve-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *part-prebot-chasm-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *range-final-mine-boss-explo-color* curve-color-fast) +(define-extern *range-final-mine-boss-explo-alpha* curve2d-fast) +(define-extern *range-final-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *range-final-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *curve-final-mine-boss-explo-alpha* curve2d-fast) +(define-extern *curve-final-mine-boss-explo-scale-x* curve2d-fast) +(define-extern *curve-final-mine-boss-explo-scale-y* curve2d-fast) +(define-extern *part-final-prebot-chasm-explosion-texture-curve-settings* particle-curve-settings) + ;; DECOMP BEGINS +;; WARN: Return type mismatch float vs none. +(defun birth-func-pillar-rocks-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg1 omega) (-> arg2 launchrot y)) + (none) + ) + +(defun spt-func-pillar-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 4464) s4-0) + ) + ) + (none) + ) + +(defun spt-func-pillar-rocks-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 4465) s4-0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defun spt-func-pillar-rocks-bounce3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (cond + ((or (< (-> arg1 omega) (-> arg2 launchrot y)) (< 0.0 (-> arg1 vel-sxvel y))) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + ) + (else + (set! (-> arg1 acc x) 0.0) + (set! (-> arg1 acc y) 0.0) + (set! (-> arg1 acc z) 0.0) + (set! (-> arg1 vel-sxvel x) (* 0.7 (-> arg1 vel-sxvel x))) + (set! (-> arg1 vel-sxvel z) (* 0.7 (-> arg1 vel-sxvel z))) + (set! (-> arg2 launchrot y) (-> arg1 omega)) + ) + ) + (none) + ) + +(defpartgroup group-prebot-launch-critter + :id 1334 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4466 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4467 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4468 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 4466 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.10666667)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4467 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 48.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees 70) (degrees 40)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4468 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 9011.25)) + (:scalevel-x (meters 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.4) + (:timer (seconds 0.15)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4469 + :init-specs ((:texture (pal-lightning-red level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 80.0 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 4470 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 80.0 20.0) + (:b 128.0 64.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4471 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 1) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 100.0) + (:a 200.0 55.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-prebot-gun-shot-trail + :id 1335 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4472 :flags (sp6)) + (sp-item 4473 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 4474 :flags (sp6)) + (sp-item 4475 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +(defpart 4472 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4475 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 6.0) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 30.0 30.0) + (:g :copy r) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:fade-a -0.42666668) + (:accel-y (meters -0.000033333334) (meters -0.000016666667)) + (:friction 0.96 0.01) + (:timer (seconds 0.5) (seconds 3.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.017) (seconds 0.497)) + (:next-launcher 4476) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4476 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4477)) + ) + +(defpart 4477 + :init-specs ((:r 30.0 30.0) (:g :copy r) (:b 255.0) (:next-time (seconds 0.017) (seconds 0.497)) (:next-launcher 4476)) + ) + +(defpart 4474 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + (:next-time (seconds 0.035)) + (:next-launcher 4478) + ) + ) + +(defpart 4478 + :init-specs ((:scale-x (meters 2.5)) (:scale-y :copy scale-x) (:r 0.0) (:g 0.0) (:b 255.0) (:a 16.0) (:fade-a -1.6)) + ) + +(defpart 4473 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 3.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.005) (meters 0.008333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.2) + (:fade-g 3.2) + (:fade-b -3.2) + (:fade-a -0.10666667 -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x400000 #x405c00)) + (:next-time (seconds 0.135)) + (:next-launcher 4479) + ) + ) + +(defpart 4479 + :init-specs ((:r 128.0) (:g 128.0) (:b 128.0) (:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpartgroup group-prebot-eco-pillar-heat-up + :id 1336 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4480) (sp-item 4481) (sp-item 4482 :flags (is-3d sp7))) + ) + +(defpart 4480 + :init-specs ((:texture (lava-drop-01 mined-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 1) (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:rotvel-z (degrees -2) (degrees 4)) + (:accel-y (meters -0.0023333333)) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 -1384120320 -1384120064 -1384119808 -1384119552)) + (:func 'check-drop-group-center) + (:next-time (seconds 0.167) (seconds 0.165)) + (:next-launcher 4483) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4483 + :init-specs ((:fade-r -1.275) (:fade-g -0.7) (:fade-b 0.05)) + ) + +(defpart 4481 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0023333333)) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:func 'check-drop-group-center) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4482 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.1) + (:y (meters 1)) + (:scale-x (meters 10) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 0.0) + (:fade-a 1.7066667) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.25)) + (:next-launcher 4484) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4484 + :init-specs ((:fade-a -1.7066667)) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-eco-pillar-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 160)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 60)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 100)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-eco-pillar-rocks2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 100)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 60)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 80)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-eco-pillar-rocks3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 70)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 40)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpartgroup group-prebot-eco-pillar-grow + :id 1337 + :duration (seconds 0.017) + :linger-duration (seconds 10) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4485) + (sp-item 4486 :flags (is-3d sp3 sp7)) + (sp-item 4487 :period (seconds 20) :length (seconds 0.167)) + ) + ) + +(defpart 4485 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.3) + (:x (meters 1) (meters 1)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g 0.14166667) + (:fade-b 0.20833333) + (:fade-a -0.053333335) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.95 0.01) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4486 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 11)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 128.0) + (:fade-a -0.08533333) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4487 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-rocks) + (:num 3.0) + (:x (meters 1) (meters 0.5)) + (:y (meters 0.5)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.023333333) (meters 0.06666667)) + (:rotvel-z (degrees -1) (degrees 2)) + (:fade-r -0.33333334) + (:fade-g -0.33333334) + (:fade-b -0.33333334) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-prebot-eco-pillar-rocks) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-prebot-eco-pillar-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-pillar-rocks-bounce arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-eco-pillar-rocks arg0 arg1 arg2) + (none) + ) + +(defun spt-func-part-prebot-eco-pillar-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-pillar-rocks-bounce1 arg0 arg1 arg2) + (none) + ) + +(defpart 4464 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-rocks-bounce1) + (:num 0.5) + (:scale-x (meters 0.3) (meters 1) :store) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1) (degrees 2)) + (:fade-r -0.33333334) + (:fade-g -0.33333334) + (:fade-b -0.33333334) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x40ae00 + #x40ad00 + #x40ac00 + #x40ab00 + #x40aa00 + #x40a900 + #x40a800 + #x40a700 + #x40a600 + #x40a500 + #x40a400 + #x40a300 + #x40a200 + #x40a100 + #x408c00 + #x408b00 + ) + ) + (:func 'spt-func-part-prebot-eco-pillar-rocks-bounce1) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-prebot-eco-pillar-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-pillar-rocks-bounce arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-eco-pillar-rocks2 arg0 arg1 arg2) + (none) + ) + +(defun spt-func-part-prebot-eco-pillar-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-pillar-rocks-bounce2 arg0 arg1 arg2) + (none) + ) + +(defpart 4465 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-rocks-bounce2) + (:num 0.5) + (:scale-x '*sp-temp*) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.01) (meters 0.016666668)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.33333334) + (:fade-g -0.33333334) + (:fade-b -0.33333334) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-pillar-rocks-bounce3) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-prebot-eco-pillar-rocks-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-pillar-rocks-bounce arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-eco-pillar-rocks3 arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-prebot-eco-pillar-cool-down + :id 1338 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4488)) + ) + +(defpart 4488 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.3) + (:x (meters 1) (meters 1)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 0.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.0016666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g 0.14166667) + (:fade-b 0.20833333) + (:fade-a -0.026666667) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.95 0.01) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4489 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 1)) + (:rot-x (degrees 22.725)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 150.0) + (:b 60.0) + (:a 100.0 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4490 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees -4) (degrees 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 64.0 16.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-prebot-stuck-flame + :id 1339 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4491)) + ) + +(defpart 4491 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:friction 0.99 0.01) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-mine-boss-stuck-flame-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mine-boss-stuck-flame-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mine-boss-stuck-flame-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 6.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x -3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mine-boss-stuck-flame-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 6.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x -3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-mine-boss-stuck-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-mine-boss-stuck-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.5 :w 0.3) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :y -5.0000005 :z -0.3333333 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-mine-boss-stuck-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mine-boss-stuck-flame-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mine-boss-stuck-flame-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mine-boss-stuck-flame-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-prebot-stuck-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.4) + :flags (particle-curve-flags pcf1) + ) + ) + +(set! (-> *part-id-table* 4491 init-specs 13 initial-valuef) + (the-as float *part-prebot-stuck-flame-curve-settings*) + ) + +(set! (-> *part-prebot-stuck-flame-curve-settings* color-start) *range-mine-boss-stuck-flame-color*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* alpha-start) *range-mine-boss-stuck-flame-alpha*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-x-start) *range-mine-boss-stuck-flame-scale-x*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-y-start) *range-mine-boss-stuck-flame-scale-y*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* r-scalar) *r-curve-mine-boss-stuck-flame*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* g-scalar) *g-curve-mine-boss-stuck-flame*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* b-scalar) *b-curve-mine-boss-stuck-flame*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* a-scalar) *curve-mine-boss-stuck-flame-alpha*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-x-scalar) *curve-mine-boss-stuck-flame-scale-x*) + +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-y-scalar) *curve-mine-boss-stuck-flame-scale-y*) + +(defpartgroup group-prebot-chasm-explosion + :id 1340 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4492 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4493 :period (seconds 30) :length (seconds 1)) + (sp-item 4494 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4495 :period (seconds 30) :length (seconds 0.5)) + (sp-item 4496 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +(defpart 4494 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 450)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.56) + (:fade-b -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4492 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 150)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.14222223) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4493 + :init-specs ((:texture (middot level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.00225)) + (:vel-y (meters 0.33333334) (meters 1.6666666)) + (:fade-g -0.128) + (:fade-b -0.42666668) + (:friction 0.95) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 4497) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees -20) (degrees 40)) + ) + ) + +(defpart 4497 + :init-specs ((:omega (degrees 0.0225)) (:friction 0.97)) + ) + +(defpart 4495 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 5) (meters 5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 1) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y (meters 0.06666667) (meters 0.06666667)) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4496 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.6666667) (meters 0.33333334)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-mine-boss-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-prebot-chasm-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.3) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4496 init-specs 16 initial-valuef) + (the-as float *part-prebot-chasm-explosion-texture-curve-settings*) + ) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* color-start) *range-mine-boss-explo-color*) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* alpha-start) *range-mine-boss-explo-alpha*) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-x-start) *range-mine-boss-explo-scale-x*) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-y-start) *range-mine-boss-explo-scale-y*) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* a-scalar) *curve-mine-boss-explo-alpha*) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-x-scalar) + *curve-mine-boss-explo-scale-x* + ) + +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-y-scalar) + *curve-mine-boss-explo-scale-y* + ) + +(defpartgroup group-final-prebot-chasm-explosion + :id 1341 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4498 :flags (sp3) :period (seconds 10) :length (seconds 0.017)) + (sp-item 4499 :flags (sp3) :period (seconds 10) :length (seconds 0.017)) + (sp-item 4500 :period (seconds 10) :length (seconds 0.085)) + (sp-item 4501 :period (seconds 10) :length (seconds 1)) + (sp-item 4502 :period (seconds 10) :length (seconds 1)) + ) + ) + +(defpart 4498 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 450)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.56) + (:fade-b -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4499 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 120)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.14222223) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4500 + :init-specs ((:texture (middot level-default-sprite)) + (:num 50.0) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.06666667) (meters 0.33333334)) + (:fade-g -1.28) + (:fade-b -2.56) + (:friction 0.9) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -130) (degrees 260)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4501 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.2) (meters 0.16666667)) + (:scalevel-x (meters 0.006666667) (meters 0.016666668)) + (:scalevel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4502 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 3.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.16666667)) + (:friction 0.85 0.05) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-final-mine-boss-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-final-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-final-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 15.0 :z 16.0 :w 17.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-final-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 15.0 :z 16.0 :w 17.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-final-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-final-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-final-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-final-prebot-chasm-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4502 init-specs 16 initial-valuef) + (the-as float *part-final-prebot-chasm-explosion-texture-curve-settings*) + ) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* color-start) + *range-final-mine-boss-explo-color* + ) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* alpha-start) + *range-final-mine-boss-explo-alpha* + ) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-x-start) + *range-final-mine-boss-explo-scale-x* + ) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-y-start) + *range-final-mine-boss-explo-scale-y* + ) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* a-scalar) + *curve-final-mine-boss-explo-alpha* + ) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-x-scalar) + *curve-final-mine-boss-explo-scale-x* + ) + +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-y-scalar) + *curve-final-mine-boss-explo-scale-y* + ) + +(defpartgroup group-prebot-chasm-explosion-comets + :id 1342 + :flags (sp0) + :bounds (static-bspherem 0 0 0 600) + :parts ((sp-item 4504 :flags (sp3) :binding 4503) + (sp-item 4504 :flags (sp3) :binding 4503) + (sp-item 4504 :flags (sp3) :binding 4503) + (sp-item 4503 :flags (sp2)) + (sp-item 4503 :flags (sp2)) + (sp-item 4503 :flags (sp2)) + ) + ) + +(defpart 4504 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 30)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 1.0) + (:vel-y (meters 0.53333336) (meters 0.06666667)) + (:scalevel-x (meters -0.083333336)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.1 -0.1) + (:fade-b -0.05 -0.05) + (:accel-y (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 6.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405c00 #x406500 #x400000 #x400700)) + (:conerot-x (degrees 10) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4503 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.2) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0) + (:g 60.0 20.0) + (:b 20.0 10.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.1 -0.1) + (:fade-b -0.05 -0.05) + (:fade-a -0.016666668 -0.1) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-prebot-gun-shot-explosion + :id 1343 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4505 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4506 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4507 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4508 :period (seconds 30) :length (seconds 0.335)) + ) + ) + +(defpart 4505 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4506 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.4) + (:fade-g -0.4) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4507 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 60.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4508 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g :copy r) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.26666668) + (:fade-g -0.26666668) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.85) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-pillar-shatter-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 90)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 40)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpartgroup group-prebot-pillar-shatter + :id 1344 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4509 :period (seconds 20) :length (seconds 0.035))) + ) + +(defpart 4509 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-shatter) + (:num 30.0) + (:x (meters 0) (meters 1)) + (:y (meters 0) (meters -10)) + (:scale-x (meters 0.1) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.023333333) (meters 0.06666667)) + (:scalevel-x (meters 0) (meters 0.06666667)) + (:rotvel-z (degrees -2) (degrees 4)) + (:scalevel-y (meters 0) (meters 0.06666667)) + (:fade-r -0.06666667) + (:fade-g -0.06666667) + (:fade-b -0.06666667) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-prebot-eco-pillar-shatter) + (:next-time (seconds 0.017)) + (:next-launcher 4510) + (:conerot-x (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4510 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0))) + ) + +(defun spt-birth-func-part-prebot-eco-pillar-shatter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-pillar-shatter-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defun spt-func-part-prebot-eco-pillar-shatter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (none) + ) diff --git a/goal_src/jak3/levels/mine/prebot-setup.gc b/goal_src/jak3/levels/mine/prebot-setup.gc index f1acce1523..42c47138b2 100644 --- a/goal_src/jak3/levels/mine/prebot-setup.gc +++ b/goal_src/jak3/levels/mine/prebot-setup.gc @@ -5,5 +5,1098 @@ ;; name in dgo: prebot-setup ;; dgos: MINED + +;; +++prebot-flag +(defenum prebot-flag + :type uint32 + :bitfield #t + (pf0 0) + (pf1 1) + (pf2 2) + (pf3 3) + (pf4 4) + (pf5 5) + (pf6 6) + (pf7 7) + (pf8 8) + ) +;; ---prebot-flag + + +(declare-type prebot process-focusable) +(define-extern *prebot-sword-color-curve* curve-color-piecewise) +(define-extern *prebot-sword-white-red-curve* curve-color-piecewise) +(define-extern *prebot-sword-width-curve* curve2d-fast) +(define-extern *prebot-sword-color-array* light-trail-composition) +(define-extern prebot-neck-callback (function cspace transformq none :behavior prebot)) +(define-extern prebot-light-pulse-off (function none :behavior prebot)) +(define-extern prebot-go-next-stage (function object :behavior prebot)) + + ;; DECOMP BEGINS +(defskelgroup skel-prebot-camera prebot-camera prebot-camera-lod0-jg -1 + ((prebot-camera-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defskelgroup skel-cav-exit-door cav-exit-door cav-exit-door-lod0-jg cav-exit-door-idle-ja + ((cav-exit-door-lod0-mg (meters 20)) (cav-exit-door-lod1-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +(defskelgroup skel-cav-break-bridge cav-break-bridge cav-break-bridge-lod0-jg cav-break-bridge-idle-ja + ((cav-break-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -20 0 50) + :origin-joint-index 3 + ) + +(defskelgroup skel-cav-molten-pil cav-pillar cav-pillar-lod0-jg cav-pillar-idle-ja + ((cav-pillar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-cav-molten-pil-b cav-pillar cav-pillar-b-lod0-jg cav-pillar-b-idle-ja + ((cav-pillar-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-cav-molten-pil-c cav-pillar cav-pillar-c-lod0-jg cav-pillar-c-idle-ja + ((cav-pillar-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-cav-molten-pil-d cav-pillar cav-pillar-d-lod0-jg cav-pillar-d-idle-ja + ((cav-pillar-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-cav-molten-pil-debris-a cav-pillar cav-pillar-debris-a-lod0-jg cav-pillar-debris-a-idle-ja + ((cav-pillar-debris-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-cav-molten-pil-debris-b cav-pillar cav-pillar-debris-b-lod0-jg cav-pillar-debris-b-idle-ja + ((cav-pillar-debris-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-cav-molten-pil-debris-c cav-pillar cav-pillar-debris-c-lod0-jg cav-pillar-debris-c-idle-ja + ((cav-pillar-debris-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-cav-molten-pil-debris-d cav-pillar cav-pillar-debris-d-lod0-jg cav-pillar-debris-d-idle-ja + ((cav-pillar-debris-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defskelgroup skel-cav-railblocker cav-railblocker cav-railblocker-lod0-jg cav-railblocker-idle-ja + ((cav-railblocker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-cav-railblocker-explode cav-railblocker cav-railblocker-explode-lod0-jg cav-railblocker-explode-idle-ja + ((cav-railblocker-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(define *cav-railblocker-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defskelgroup skel-cav-minecar min-bomb-train min-bomb-train-lod0-jg min-bomb-train-idle-ja + ((min-bomb-train-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-prebot-tentacle prebot-tentacle prebot-tentacle-lod0-jg prebot-tentacle-idle-ja + ((prebot-tentacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-prebot-shockwave prebot-shockwave prebot-shockwave-lod0-jg prebot-shockwave-shockwave-ja + ((prebot-shockwave-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 62) + :origin-joint-index 3 + ) + +(defskelgroup skel-prebot-sword prebot 80 prebot-sword-shadow-mg + ((prebot-sword-lod0-jg (meters 999999))) + :bounds (static-spherem 0 20 0 20) + :origin-joint-index 4 + ) + +(defskelgroup skel-prebot-gun prebot prebot-sword-r-swords-horizontal-L2R-complete-ja prebot-gun-shadow-mg + ((prebot-gun-lod0-jg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-prebot prebot prebot-lod0-jg prebot-idle-ja + ((prebot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 13.5) + :shadow prebot-shadow-mg + :origin-joint-index 3 + ) + +(deftype prebot-eco-pillar-launch-spec (structure) + ((offset vector) + (height float) + (style int8) + ) + ) + + +(deftype prebot-eco-pillar (process-drawable) + ((root collide-shape-moving :override) + (vulnerable symbol) + (hot symbol) + (start-y float) + (end-y float) + (heat-part sparticle-launch-control) + (cool-part sparticle-launch-control) + ) + (:state-methods + wait-to-die + heat-up + grow + cool-down + wait-to-cool + idle + ) + ) + + +(deftype cav-railblocker (process-focusable) + ((incoming-attack-id uint32) + (hit-points float) + (notify-on-die entity) + (notify-on-die-2 entity) + (trackable symbol) + (red-tip-change-time time-frame) + (alt-red-tip-on symbol) + ) + (:state-methods + idle + fall + ) + (:methods + (cav-railblocker-method-30 (_type_ symbol) none) + ) + ) + + +(deftype cav-minecar (process-drawable) + () + (:state-methods + idle + ) + ) + + +(deftype prebot-sword (process-drawable) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string) + (blade-scale cam-float-seeker :inline) + (blade-jm joint-mod) + (sword-sound sound-id) + (sword-sound-playing symbol) + (prev-position vector :inline) + (use-pos-pitch symbol) + (old-target-dist float) + (alternate-sound sound-spec) + (whoosh-lead float) + (allow-whoosh symbol) + (current-volume float) + ) + (:state-methods + idle + ) + ) + + +(deftype prebot-shockwave (process-drawable) + () + (:state-methods + idle + ) + ) + + +(deftype prebot-gun (process-drawable) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string) + ) + (:state-methods + idle + ) + ) + + +(deftype prebot-tentacle (process-drawable) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string) + (aim-jm joint-mod-polar-look-at) + (half-aim-jm joint-mod-polar-look-at) + (laser-sound sound-id) + (laser-sound-playing symbol) + ) + (:state-methods + idle + ) + ) + + +(deftype prebot-ammo-tracker (structure) + ((handle handle) + (where vector :inline) + (birth-next-time symbol) + (timer time-frame) + ) + ) + + +(deftype prebot (process-focusable) + ((critters handle 28) + (critters-to-launch int8) + (gun handle) + (swords handle 2) + (tentacles handle 5) + (beam-projectile handle) + (pillars handle 5) + (original-position vector :inline) + (position cam-vector-seeker :inline) + (stage int8) + (stage-hit-points float) + (last-attack-id uint32) + (neck-angle cam-float-seeker :inline) + (no-collision-timer time-frame) + (num-attacks uint8) + (shoulder-aim-jm joint-mod-polar-look-at) + (shot-extra-y float) + (shot-extra-xz float) + (which-movie int8) + (light-flash cam-vector-seeker :inline) + (light-pulse oscillating-vector :inline) + (light-pulse-flicker delayed-rand-vector :inline) + (laugh-played symbol) + (grunt-played symbol) + (trythis-played symbol) + (laugh-timer time-frame) + (blocker handle) + (flags prebot-flag) + (pillar-hint-timer time-frame) + (minecar-hint-timer time-frame) + (ammo prebot-ammo-tracker 20 :inline) + ) + (:state-methods + beaten + play-fma + play-hit-movie + destroy-pillars + watch-pillars + create-pillars + activate-tentacles + watch-critters + launch-critters + sweep-done + sweep + slam-done + slam + pre-slam + jump-to-hover + hidden + test + ) + (:methods + (prebot-method-45 (_type_) none) + (prebot-method-46 (_type_) none) + ) + ) + + +(defbehavior prebot-eco-pillar-init-by-other prebot-eco-pillar ((arg0 vector) (arg1 prebot-eco-pillar-launch-spec)) + (let ((v1-0 (-> arg1 style))) + (cond + ((zero? v1-0) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-7) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-10 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> self root) s4-0) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 1) + (let ((s4-2 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-2 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-2 reaction) cshape-reaction-default) + (set! (-> s4-2 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 3) + (set-vector! (-> v1-21 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-2 total-prims) (the-as uint 1)) + (set! (-> s4-2 root-prim) v1-21) + ) + (set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w))) + (let ((v1-24 (-> s4-2 root-prim))) + (set! (-> s4-2 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s4-2 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> self root) s4-2) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 2) + (let ((s4-4 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-4 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-4 reaction) cshape-reaction-default) + (set! (-> s4-4 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-35 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-35 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 3) + (set-vector! (-> v1-35 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-4 total-prims) (the-as uint 1)) + (set! (-> s4-4 root-prim) v1-35) + ) + (set! (-> s4-4 nav-radius) (* 0.75 (-> s4-4 root-prim local-sphere w))) + (let ((v1-38 (-> s4-4 root-prim))) + (set! (-> s4-4 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s4-4 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> self root) s4-4) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (else + (let ((s4-6 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-6 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-6 reaction) cshape-reaction-default) + (set! (-> s4-6 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-49 (new 'process 'collide-shape-prim-mesh s4-6 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-49 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-49 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-49 prim-core action) (collide-action solid)) + (set! (-> v1-49 transform-index) 3) + (set-vector! (-> v1-49 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-6 total-prims) (the-as uint 1)) + (set! (-> s4-6 root-prim) v1-49) + ) + (set! (-> s4-6 nav-radius) (* 0.75 (-> s4-6 root-prim local-sphere w))) + (let ((v1-52 (-> s4-6 root-prim))) + (set! (-> s4-6 backup-collide-as) (-> v1-52 prim-core collide-as)) + (set! (-> s4-6 backup-collide-with) (-> v1-52 prim-core collide-with)) + ) + (set! (-> self root) s4-6) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil-d" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ) + ) + (set! (-> self root event-self) 'touched) + (let ((s4-8 (new 'stack-no-clear 'vector))) + (let* ((s3-4 sincos!) + (s2-0 s4-8) + (f30-0 -16384.0) + (f28-0 32768.0) + (v1-61 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-62 (the-as number (logior #x3f800000 v1-61))) + ) + (s3-4 s2-0 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-62))))) + ) + (quaternion-set! (-> self root quat) 0.0 (-> s4-8 x) 0.0 (-> s4-8 y)) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self start-y) (-> self root trans y)) + (set! (-> self end-y) (+ (-> arg0 y) (-> arg1 height))) + (set! (-> self vulnerable) #f) + (set! (-> self hot) #f) + (set! (-> self heat-part) (create-launch-control (-> *part-group-id-table* 1336) self)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1337) self)) + (set! (-> self cool-part) (create-launch-control (-> *part-group-id-table* 1338) self)) + (go-virtual heat-up) + ) + +(when (or (zero? *prebot-sword-color-curve*) (!= loading-level global)) + (set! *prebot-sword-color-curve* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *prebot-sword-color-curve* 2 'loading-level (the-as uint #t)) + ) + +(set! (-> *prebot-sword-color-curve* pts data 0 first) 0.0) + +(set! (-> *prebot-sword-color-curve* pts data 0 second x) 1.0) + +(set! (-> *prebot-sword-color-curve* pts data 0 second y) 0.0) + +(set! (-> *prebot-sword-color-curve* pts data 0 second z) 0.0) + +(set! (-> *prebot-sword-color-curve* pts data 0 second w) 1.0) + +(set! (-> *prebot-sword-color-curve* pts data 1 first) 1.0) + +(set! (-> *prebot-sword-color-curve* pts data 1 second x) 1.0) + +(set! (-> *prebot-sword-color-curve* pts data 1 second y) 1.0) + +(set! (-> *prebot-sword-color-curve* pts data 1 second z) 0.0) + +(set! (-> *prebot-sword-color-curve* pts data 1 second w) 1.0) + +(when (or (zero? *prebot-sword-white-red-curve*) (!= loading-level global)) + (set! *prebot-sword-white-red-curve* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *prebot-sword-white-red-curve* 3 'loading-level (the-as uint #t)) + ) + +(set! (-> *prebot-sword-white-red-curve* pts data 0 first) 0.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 0 second x) 1.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 0 second y) 0.3125) + +(set! (-> *prebot-sword-white-red-curve* pts data 0 second z) 0.3125) + +(set! (-> *prebot-sword-white-red-curve* pts data 0 second w) 1.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 1 first) 0.5) + +(set! (-> *prebot-sword-white-red-curve* pts data 1 second x) 1.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 1 second y) 0.078125) + +(set! (-> *prebot-sword-white-red-curve* pts data 1 second z) 0.078125) + +(set! (-> *prebot-sword-white-red-curve* pts data 1 second w) 1.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 2 first) 1.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 2 second x) 1.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 2 second y) 0.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 2 second z) 0.0) + +(set! (-> *prebot-sword-white-red-curve* pts data 2 second w) 1.0) + +(if #t + (set! *prebot-sword-width-curve* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if (or (zero? *prebot-sword-color-array*) (!= loading-level global)) + (set! *prebot-sword-color-array* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *prebot-sword-color-array* color-mode) (the-as uint 0)) + +(set! (-> *prebot-sword-color-array* color-repeat-dist) 4096.0) + +(set! (-> *prebot-sword-color-array* alpha-1-mode) (the-as uint 0)) + +(set! (-> *prebot-sword-color-array* alpha-2-mode) (the-as uint 6)) + +(set! (-> *prebot-sword-color-array* base-alpha) 1.0) + +(set! (-> *prebot-sword-color-array* alpha-repeat-dist) 4096.0) + +(set! (-> *prebot-sword-color-array* width-mode) (the-as uint 0)) + +(set! (-> *prebot-sword-color-array* base-width) 1.0) + +(set! (-> *prebot-sword-color-array* width-repeat-dist) 4096.0) + +(set! (-> *prebot-sword-color-array* uv-mode) (the-as uint 3)) + +(set! (-> *prebot-sword-color-array* uv-repeat-dist) 40960.0) + +(set! (-> *prebot-sword-color-array* lie-mode) (the-as uint 0)) + +(set! (-> *prebot-sword-color-array* max-age) (seconds 0.3)) + +(if #f + (set! (-> *prebot-sword-color-array* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *prebot-sword-color-array* tex-id) (the-as uint #x100300)) + ) + +(set! (-> *prebot-sword-color-array* width-curve) (the-as curve2d-piecewise *prebot-sword-width-curve*)) + +(set! (-> *prebot-sword-color-array* color-curve) *prebot-sword-white-red-curve*) + +(set! (-> *prebot-sword-color-array* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *prebot-sword-color-array* alpha-curve-2) #f) + +(set! (-> *prebot-sword-color-array* zbuffer?) #t) + +(set! (-> *prebot-sword-color-array* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *prebot-sword-color-array* use-tape-mode?) #t) + +(set! (-> *prebot-sword-color-array* blend-mode) (the-as uint 1)) + +(set! (-> *prebot-sword-color-array* frame-stagger) (the-as uint 1)) + +(defbehavior prebot-sword-init-by-other prebot-sword ((arg0 string) (arg1 vector) (arg2 basic) (arg3 sound-spec)) + (let ((s2-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s2-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s2-0 reaction) cshape-reaction-default) + (set! (-> s2-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 4) + (set-vector! (-> v1-6 local-sphere) 0.0 45056.0 0.0 49152.0) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-6) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-9 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s2-0 event-self) 'touched) + (set! (-> self root) s2-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self prev-position quad) (-> arg1 quad)) + (set! (-> self old-target-dist) 204800.0) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-sword" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-21 (-> self parent))) + (set! (-> self draw light-index) (-> (the-as prebot (if v1-21 + (the-as prebot (-> v1-21 0 self)) + ) + ) + draw + light-index + ) + ) + ) + (logior! (-> self mask) (process-mask enemy)) + (let ((v1-28 (-> self node-list data))) + (set! (-> v1-28 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-28 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-28 0 param2) arg2) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (let ((s5-1 (new 'stack-no-clear 'weapon-trail-tracker-spawn-params))) + (set! (-> s5-1 tracked-obj) (process->handle self)) + (set! (-> s5-1 max-num-crumbs) 200) + (set! (-> s5-1 joint0) 3) + (set! (-> s5-1 joint1) 5) + (set! (-> s5-1 appearance) *prebot-sword-color-array*) + (set! (-> *prebot-sword-color-array* tex-id) + (the-as uint (lookup-texture-id-by-name "sword-trail-low" (the-as string #f))) + ) + (let* ((v1-43 (estimate-light-trail-mem-usage + (the-as uint (-> s5-1 max-num-crumbs)) + (the-as uint (= (-> s5-1 appearance lie-mode) 3)) + ) + ) + (s4-2 (get-process *default-dead-pool* weapon-trail-tracker (+ v1-43 8192) 1)) + (s5-2 (-> (when s4-2 + (let ((t9-8 (method-of-type process activate))) + (t9-8 s4-2 (ppointer->process (-> self parent)) "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-2 weapon-trail-tracker-init-by-other s5-1) + (-> s4-2 ppointer) + ) + 0 + ) + ) + (s3-2 (-> (level-get *level* 'mined) draw-index)) + (s4-3 (vu1-bucket-map s3-2 4 (merc-mode mercneric2))) + (v1-50 (vu1-bucket-map s3-2 4 (merc-mode mm5))) + ) + (set! (-> (the-as weapon-trail-tracker s5-2) trail strip bucket) s4-3) + (set! (-> (the-as weapon-trail-tracker s5-2) trail strip sink) (the-as uint v1-50)) + ) + ) + (init (-> self blade-scale) 1.0 0.03 0.2 0.9) + (set! (-> self blade-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 4)) + (set! (-> self blade-jm track-mode) (track-mode no-trans no-rotate)) + (set-vector! (-> self blade-jm scale) 1.0 1.0 1.0 1.0) + (set! (-> self sword-sound) (new-sound-id)) + (set! (-> self sword-sound-playing) #f) + (set! (-> self use-pos-pitch) #f) + (set! (-> self alternate-sound) arg3) + (set! (-> self allow-whoosh) #f) + (set! (-> self whoosh-lead) 20480.0) + (set! (-> self current-volume) 1.0) + (go-virtual idle) + ) + +(defbehavior prebot-shockwave-init-by-other prebot-shockwave ((arg0 vector) (arg1 quaternion)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-shockwave" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +(defbehavior prebot-gun-init-by-other prebot-gun ((arg0 string) (arg1 vector)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 -32768.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-16 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-gun" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-26 (-> self parent))) + (set! (-> self draw light-index) (-> (the-as prebot (if v1-26 + (the-as prebot (-> v1-26 0 self)) + ) + ) + draw + light-index + ) + ) + ) + (logior! (-> self mask) (process-mask enemy)) + (let ((v1-33 (-> self node-list data))) + (set! (-> v1-33 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-33 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-33 0 param2) (the-as basic 44)) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +(defbehavior prebot-tentacle-init-by-other prebot-tentacle ((arg0 string) (arg1 vector) (arg2 int)) + (let ((s3-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s3-0 reaction) cshape-reaction-default) + (set! (-> s3-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s2-0 (new 'process 'collide-shape-prim-group s3-0 (the-as uint 1) 0))) + (set! (-> s3-0 total-prims) (the-as uint 2)) + (set! (-> s2-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s2-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s2-0 prim-core action) (collide-action solid)) + (set! (-> s2-0 transform-index) 4) + (set-vector! (-> s2-0 local-sphere) 0.0 -32768.0 0.0 49152.0) + (set! (-> s3-0 root-prim) s2-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) + (let ((v1-16 (-> s3-0 root-prim))) + (set! (-> s3-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s3-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> s3-0 event-self) 'touched) + (set! (-> self root) s3-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-tentacle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-26 (-> self parent))) + (set! (-> self draw light-index) (-> (the-as prebot (if v1-26 + (the-as prebot (-> v1-26 0 self)) + ) + ) + draw + light-index + ) + ) + ) + (logior! (-> self mask) (process-mask enemy)) + (let ((v1-33 (-> self node-list data))) + (set! (-> v1-33 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-33 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-33 0 param2) (the-as basic arg2)) + ) + (set! (-> self aim-jm) (new 'process 'joint-mod-polar-look-at)) + (initialize (-> self aim-jm) self 13) + (set! (-> self aim-jm ear) 2) + (set! (-> self aim-jm up) 0) + (set! (-> self aim-jm nose) 1) + (set! (-> self half-aim-jm) (new 'process 'joint-mod-polar-look-at)) + (initialize (-> self half-aim-jm) self 12) + (set! (-> self half-aim-jm ear) 2) + (set! (-> self half-aim-jm up) 0) + (set! (-> self half-aim-jm nose) 1) + (set! (-> self laser-sound) (new-sound-id)) + (set! (-> self laser-sound-playing) #f) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +(defmethod init-from-entity! ((this prebot) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 18) 0))) + (set! (-> s4-0 total-prims) (the-as uint 19)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 8) + (set-vector! (-> s3-0 local-sphere) 0.0 -20480.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 10) + (set-vector! (-> v1-13 local-sphere) 0.0 2957.7217 3380.8384 20891.238) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 15) + (set-vector! (-> v1-15 local-sphere) 0.0 7224.115 0.0 16506.88) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 13) + (set-vector! (-> v1-17 local-sphere) 423.5264 3772.0063 0.0 10656.973) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 12) + (set-vector! (-> v1-19 local-sphere) -0.4096 0.0 0.0 11988.992) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 31) + (set-vector! (-> v1-21 local-sphere) 0.0 7223.7056 0.0 16506.88) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 29) + (set-vector! (-> v1-23 local-sphere) -423.5264 3772.0063 0.0 10656.973) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 28) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 11988.992) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-27 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 8) + (set-vector! (-> v1-27 local-sphere) 0.0 1914.0608 1339.392 24913.51) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-29 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-29 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 5) + (set-vector! (-> v1-29 local-sphere) 0.0 0.0 0.0 13063.373) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 9) (the-as uint 0)))) + (set! (-> v1-31 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-31 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 56) + (set-vector! (-> v1-31 local-sphere) 791.3472 14204.108 -1401.6512 12302.336) + ) + (let ((v1-33 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 10) (the-as uint 0)))) + (set! (-> v1-33 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-33 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-33 prim-core action) (collide-action solid)) + (set! (-> v1-33 transform-index) 57) + (set-vector! (-> v1-33 local-sphere) 120.0128 13062.144 1252.1472 11315.609) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 11) (the-as uint 0)))) + (set! (-> v1-35 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-35 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 54) + (set-vector! (-> v1-35 local-sphere) 557.056 12469.043 1004.3392 23741.234) + ) + (let ((v1-37 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 12) (the-as uint 0)))) + (set! (-> v1-37 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-37 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-37 prim-core action) (collide-action solid)) + (set! (-> v1-37 transform-index) 52) + (set-vector! (-> v1-37 local-sphere) 1070.2848 7083.6226 264.6016 14952.857) + ) + (let ((v1-39 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 13) (the-as uint 0)))) + (set! (-> v1-39 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-39 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-39 prim-core action) (collide-action solid)) + (set! (-> v1-39 transform-index) 63) + (set-vector! (-> v1-39 local-sphere) -790.528 14204.519 -1401.6512 12301.927) + ) + (let ((v1-41 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 14) (the-as uint 0)))) + (set! (-> v1-41 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-41 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-41 prim-core action) (collide-action solid)) + (set! (-> v1-41 transform-index) 64) + (set-vector! (-> v1-41 local-sphere) -120.4224 13062.963 1252.5568 11315.2) + ) + (let ((v1-43 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 15) (the-as uint 0)))) + (set! (-> v1-43 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-43 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-43 prim-core action) (collide-action solid)) + (set! (-> v1-43 transform-index) 61) + (set-vector! (-> v1-43 local-sphere) -556.6464 12469.453 1004.3392 23741.645) + ) + (let ((v1-45 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 16) (the-as uint 0)))) + (set! (-> v1-45 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-45 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-45 prim-core action) (collide-action solid)) + (set! (-> v1-45 transform-index) 59) + (set-vector! (-> v1-45 local-sphere) -1069.8752 7083.6226 264.192 14952.448) + ) + (let ((v1-47 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 17) (the-as uint 0)))) + (set! (-> v1-47 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-47 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-47 prim-core action) (collide-action solid)) + (set! (-> v1-47 transform-index) 50) + (set-vector! (-> v1-47 local-sphere) 0.0 -3032.2688 430.08 11688.755) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-50 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-50 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-50 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (set! (-> this root pause-adjust-distance) 409600.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this original-position quad) (-> this root trans quad)) + (init (-> this position) (-> this original-position) 0.004096 2048.0 0.125) + (set! (-> this draw light-index) (the-as uint 10)) + (dotimes (v1-64 28) + (set! (-> this critters v1-64) (the-as handle #f)) + ) + (set! (-> this gun) (the-as handle #f)) + (dotimes (v1-67 2) + (set! (-> this swords v1-67) (the-as handle #f)) + ) + (dotimes (v1-70 5) + (set! (-> this tentacles v1-70) (the-as handle #f)) + ) + (set! (-> this beam-projectile) (the-as handle #f)) + (dotimes (v1-73 5) + (set! (-> this pillars v1-73) (the-as handle #f)) + ) + (set! (-> this last-attack-id) (the-as uint 0)) + (let ((a0-133 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) + (if a0-133 + (change-to a0-133 this) + ) + ) + (init (-> this neck-angle) 0.0 0.01 0.1 0.9) + (let ((a0-135 (-> this node-list data 9))) + (set! (-> a0-135 param0) prebot-neck-callback) + ) + (prebot-method-45 this) + (set! (-> this shoulder-aim-jm) (new 'process 'joint-mod-polar-look-at)) + (initialize (-> this shoulder-aim-jm) this 28) + (set! (-> this shoulder-aim-jm ear) 2) + (set! (-> this shoulder-aim-jm up) 0) + (set! (-> this shoulder-aim-jm nose) 1) + (let ((v1-92 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-92 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-92 prim-core collide-with)) + ) + (set! (-> this no-collision-timer) 0) + (init (-> this light-flash) (the-as vector #f) 0.01 0.1 0.9) + (set-params! (-> this light-pulse) (the-as vector #f) 0.01 0.1 0.9) + (prebot-light-pulse-off) + (set-params! (-> this light-pulse-flicker) 15 120 0.1 0.1) + (set! (-> this laugh-timer) 0) + (set! (-> this blocker) (the-as handle #f)) + (let ((v1-102 (-> this entity extra perm))) + (logior! (-> v1-102 status) (entity-perm-status bit-5)) + (set! (-> this flags) (the-as prebot-flag (-> v1-102 user-object 0))) + ) + (dotimes (v1-104 20) + (set! (-> this ammo v1-104 handle) (the-as handle #f)) + (set! (-> this ammo v1-104 birth-next-time) #f) + ) + (prebot-go-next-stage) + ) diff --git a/goal_src/jak3/levels/mine/prebot-states.gc b/goal_src/jak3/levels/mine/prebot-states.gc index b568327377..fc0e581337 100644 --- a/goal_src/jak3/levels/mine/prebot-states.gc +++ b/goal_src/jak3/levels/mine/prebot-states.gc @@ -7,3 +7,2523 @@ ;; DECOMP BEGINS +(defbehavior prebot-neck-callback prebot ((arg0 cspace) (arg1 transformq)) + (cspace<-parented-transformq-joint! arg0 arg1) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) arg0)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 bone transform fvec) 1.0)) + (s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 bone transform uvec) 1.0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) s4-0)) + (f28-0 (vector-normalize-ret-len! s3-1 1.0)) + ) + (vector-flatten! s3-1 s3-1 s5-0) + (vector-normalize! s3-1 1.0) + (let ((s4-1 self)) + (let ((f30-0 (vector-dot s3-1 s2-0))) + (cond + ((or (< 163840.0 f28-0) + (and (< 143360.0 f28-0) (= (fabs (-> s4-1 neck-angle target)) 0.0)) + (< f30-0 (cos 15473.777)) + (and (< f30-0 (cos 8192.0)) (= (fabs (-> s4-1 neck-angle target)) 0.0)) + (not (-> arg0 param1)) + ) + (set! (-> s4-1 neck-angle target) 0.0) + ) + (else + (set! (-> s4-1 neck-angle target) (fmin 1.0 (* 0.00012207031 (acos f30-0)))) + (if (< (vector-dot s3-1 (the-as vector (-> arg0 bone transform))) 0.0) + (set! (-> s4-1 neck-angle target) (- (-> s4-1 neck-angle target))) + ) + ) + ) + ) + (update! (-> s4-1 neck-angle) 0.0) + (let ((a1-9 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s5-0 (* 8192.0 (-> s4-1 neck-angle value)))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> arg0 bone transform trans quad)) + (vector-reset! (-> arg0 bone transform trans)) + (matrix*! (-> arg0 bone transform) a1-9 (-> arg0 bone transform)) + (set! (-> arg0 bone transform trans quad) (-> s5-1 quad)) + ) + ) + ) + 0 + (none) + ) + +(defbehavior prebot-light-pulse-off prebot () + (set! (-> self light-pulse target quad) (the-as uint128 0)) + (set! (-> self light-pulse value quad) (the-as uint128 0)) + (set! (-> self light-pulse vel quad) (the-as uint128 0)) + 0 + (none) + ) + +(defbehavior prebot-light-pulse-on prebot ((arg0 float) (arg1 float) (arg2 float)) + (let ((v0-0 (-> self light-pulse target))) + (set! (-> v0-0 x) arg0) + (set! (-> v0-0 y) arg1) + (set! (-> v0-0 z) arg2) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + +(defbehavior prebot-light-flash prebot ((arg0 float) (arg1 float) (arg2 float)) + (local-vars (v1-1 float) (a3-2 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) arg0) + (set! (-> v1-0 y) arg1) + (set! (-> v1-0 z) arg2) + (set! (-> v1-0 w) 1.0) + (.lvf vf1 (&-> (-> self light-flash value) 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 a3-2 vf1) + (let ((f0-4 a3-2)) + (.lvf vf1 (&-> v1-0 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-1 vf1) + (when (< f0-4 v1-1) + (set-vector! (-> self light-flash value) arg0 arg1 arg2 1.0) + (let ((v0-0 (-> self light-flash vel))) + (set! (-> v0-0 quad) (the-as uint128 0)) + v0-0 + ) + ) + ) + ) + ) + ) + +(defbehavior prebot-prespool prebot () + (case (-> self stage) + ((1) + (script-eval '(want-anim "prebot-hit-a")) + ) + ((2) + (script-eval '(want-anim "prebot-hit-b")) + ) + (else + (script-eval '(want-anim "mine-boss-res")) + ) + ) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior prebot-common prebot () + (dotimes (gp-0 20) + (cond + ((handle->process (-> self ammo gp-0 handle)) + (if (and (nonzero? (-> self ammo gp-0 timer)) (time-elapsed? (-> self ammo gp-0 timer) (seconds 20))) + (send-event (handle->process (-> self ammo gp-0 handle)) 'die) + ) + ) + ((-> self ammo gp-0 birth-next-time) + (set! (-> self ammo gp-0 birth-next-time) #f) + (set-time! (-> self ammo gp-0 timer)) + (let ((a0-16 (new 'static 'fact-info))) + (set-vector! (new 'stack-no-clear 'vector) 0.0 57001.605 0.0 1.0) + (set! (-> a0-16 options) (actor-option fade-out fall no-distance-check-fadeout)) + (set! (-> a0-16 fade-time) (seconds 10)) + (set! (-> a0-16 pickup-spawn-amount) 1.0) + (set! (-> a0-16 pickup-type) (pickup-type ammo-random)) + (set! (-> a0-16 pickup-amount) 10.0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self root trans quad)) + (set! (-> self root trans quad) + (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 gp-0)))) + ) + (set! (-> a0-16 process) self) + (set! (-> self ammo gp-0 handle) + (ppointer->handle (drop-pickup a0-16 #t *entity-pool* (the-as fact-info #f) 0 #t)) + ) + (set! (-> self root trans quad) (-> s5-0 quad)) + ) + ) + ) + ) + ) + (update! (-> self light-flash) (the-as vector #f)) + (when (!= (-> self light-pulse target w) 0.0) + (update-with-delay! (-> self light-pulse-flicker)) + (update! (-> self light-pulse) (-> self light-pulse-flicker value)) + ) + (let ((a0-27 (new 'stack-no-clear 'vector))) + (vector+! a0-27 (-> self light-flash value) (the-as vector (-> self light-pulse))) + (set! (-> a0-27 x) (fmax 0.0 (-> a0-27 x))) + (set! (-> a0-27 y) (fmax 0.0 (-> a0-27 y))) + (set! (-> a0-27 z) (fmax 0.0 (-> a0-27 z))) + (set! (-> a0-27 w) 1.0) + (set-mined-filter! a0-27 0) + ) + (set! (-> *game-info* counter) (the float (-> self stage))) + (prebot-prespool) + (update! (-> self position) (the-as vector #f)) + (set! (-> self root trans quad) (-> self position value quad)) + (let* ((f0-17 (* 54.613335 (the float (current-time)))) + (f0-18 (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0))) + ) + (+! (-> self root trans y) (* 2048.0 (cos f0-18))) + ) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'watch-critters)) + (remove-setting! 'point-of-interest) + ) + (else + (let ((t0-1 (new 'static 'vector))) + (set! (-> t0-1 quad) (-> self root trans quad)) + (+! (-> t0-1 y) 16384.0) + (set-setting! 'point-of-interest 'abs t0-1 0) + ) + ) + ) + ) + +(defmethod deactivate ((this prebot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set-mined-filter! *zero-vector* 0) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch process-focusable vs prebot. +(defmethod relocate ((this prebot) (offset int)) + (if (nonzero? (-> this shoulder-aim-jm)) + (&+! (-> this shoulder-aim-jm) offset) + ) + (the-as prebot ((method-of-type process-focusable relocate) this offset)) + ) + +;; WARN: Return type mismatch int vs object. +(defbehavior prebot-go-next-stage prebot () + (local-vars (v1-4 (pointer actor-group)) (sv-16 res-tag)) + (cond + ((not (task-node-closed? (game-task-node mine-boss-introduction))) + (set! (-> self stage) 0) + 0 + ) + ((task-node-closed? (game-task-node mine-boss-resolution)) + (set! (-> self stage) 4) + ) + ((begin + (set! (-> self stage) 1) + (set! sv-16 (new 'static 'res-tag)) + (set! v1-4 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16))) + (and v1-4 (nonzero? (-> sv-16 elt-count))) + ) + (let ((v1-5 (-> v1-4 0))) + (dotimes (a0-5 (-> v1-5 length)) + (let ((a1-7 (-> v1-5 data a0-5 actor))) + (when a1-7 + (if (logtest? (-> a1-7 extra perm status) (entity-perm-status subtask-complete)) + (+! (-> self stage) 1) + ) + ) + ) + ) + ) + ) + (else + (format #t "ERROR: could not find actor-group for ~S~%" (-> self name)) + ) + ) + (set! (-> self stage-hit-points) 1.0) + (remove-setting! 'entity-name) + (when (and (< (-> self stage) 4) (not (handle->process (-> self blocker)))) + (let ((gp-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (set! (-> gp-0 0 quad) (-> self entity extra trans quad)) + (+! (-> gp-0 0 x) 163840.0) + (+! (-> gp-0 0 y) -81920.0) + (+! (-> gp-0 0 z) 4096.0) + (set! (-> gp-0 1 quad) (-> self entity extra trans quad)) + (+! (-> gp-0 1 x) -163840.0) + (+! (-> gp-0 1 y) -81920.0) + (+! (-> gp-0 1 z) 4096.0) + (set! (-> self blocker) + (ppointer->handle (process-spawn blocking-plane gp-0 #x48c80000 :name "blocking-plane" :to self)) + ) + ) + (send-event (handle->process (-> self blocker)) 'collide-as #x4000000) + ) + (let ((v1-39 (-> self stage))) + (cond + ((zero? v1-39) + (go-virtual hidden) + ) + ((= v1-39 1) + (set-setting! 'entity-name "camera-308" 0.0 0) + (set! (-> self laugh-played) #f) + (go-virtual jump-to-hover) + ) + ((or (= v1-39 2) (= v1-39 3)) + (set-setting! 'entity-name "camera-308" 0.0 0) + (set! (-> self laugh-played) #f) + (go-virtual pre-slam) + ) + (else + (go-virtual beaten) + ) + ) + ) + 0 + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this prebot)) + (the-as search-info-flag 0) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod prebot-method-45 ((this prebot)) + (set! (-> this node-list data 9 param1) (the-as basic #t)) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod prebot-method-46 ((this prebot)) + (set! (-> this node-list data 9 param1) #f) + (none) + ) + +(defbehavior prebot-handler prebot ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('touched-hot-pillar) + (when (not (logtest? (-> self flags) (prebot-flag pf0))) + (logior! (-> self flags) (prebot-flag pf0)) + (let ((v1-7 (-> self entity extra perm))) + (logior! (-> v1-7 status) (entity-perm-status bit-5)) + (set! (-> v1-7 user-object 0) (-> self flags)) + ) + (talker-spawn-func (-> *talker-speech* 331) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (('shot-hit) + (if (line-in-view-frustum? (the-as vector (-> arg3 param 0)) (the-as vector (-> arg3 param 0))) + (prebot-light-flash 0.0 0.4 1.0) + ) + ) + (('skip 'blocker-died) + (if (= arg2 'blocker-died) + (prebot-light-flash 1.0 0.4 0.0) + ) + (set! (-> self which-movie) (the-as int (-> arg3 param 0))) + (go-virtual play-hit-movie) + ) + (('railblocker-hittable?) + (when (-> arg3 param 0) + (set! (-> self minecar-hint-timer) 0) + 0 + ) + (and (and (-> self next-state) (let ((v1-21 (-> self next-state name))) + (or (= v1-21 'watch-pillars) (= v1-21 'destroy-pillars)) + ) + ) + (< (+ 32358.4 (-> self entity extra trans y)) (-> (target-pos 0) y)) + ) + ) + (('attack) + (when (>= (+ (current-time) (seconds -5.1)) (-> self laugh-timer)) + (set-time! (-> self laugh-timer)) + (sound-play "prebot-laugh" :position (-> self root trans)) + ) + #t + ) + (('start-critter) + (dotimes (v1-34 28) + (when (not (handle->process (-> self critters v1-34))) + (set! (-> self critters v1-34) (process->handle arg0)) + (set! v0-0 #f) + (goto cfg-50) + ) + ) + (set! v0-0 #f) + (label cfg-50) + v0-0 + ) + (('eco-creature-died) + (dotimes (v1-38 20) + (when (and (not (-> self ammo v1-38 birth-next-time)) (not (handle->process (-> self ammo v1-38 handle)))) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 v1-38)))) + (-> (the-as vector (-> arg3 param 0)) quad) + ) + (set! (-> self ammo v1-38 birth-next-time) #t) + (return 0) + ) + ) + #f + ) + ) + ) + +(defstate beaten (prebot) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (ja-post) + (let ((a0-2 (handle->process (-> self blocker)))) + (if a0-2 + (deactivate a0-2) + ) + ) + (remove-setting! 'point-of-interest) + ) + :exit (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! prebot-idle-ja :num! min) + ) + :code sleep-code + ) + +(defstate play-fma (prebot) + :virtual #t + :enter (behavior () + (set-blackout-frames (seconds 0.007)) + (set-time! (-> self state-time)) + (case (-> self stage) + ((1) + (process-spawn scene-player :init scene-player-init "prebot-hit-a" #t #f :name "scene-player") + ) + ((2) + (process-spawn scene-player :init scene-player-init "prebot-hit-b" #t #f :name "scene-player") + ) + (else + (let* ((v1-13 (-> *game-info* sub-task-list (game-task-node mine-boss-resolution))) + (v1-15 (if (-> v1-13 manager) + (-> v1-13 manager manager) + (the-as handle #f) + ) + ) + ) + (send-event (handle->process v1-15) 'complete) + ) + ) + ) + (deactivate self) + ) + :trans (behavior () + (remove-setting! 'point-of-interest) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (deactivate self) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate play-hit-movie (prebot) + :virtual #t + :enter (behavior () + (kill-by-type eco-pill *active-pool*) + (kill-by-type ammo-collectable *active-pool*) + (prebot-light-pulse-off) + ) + :exit (behavior () + (process-release? *target*) + ) + :trans (behavior () + (remove-setting! 'point-of-interest) + (prebot-prespool) + (set-letterbox-frames (seconds 0.007)) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (or (= v1-4 prebot-mine-boss-train-1-ja) + (= v1-4 prebot-mine-boss-train-2-ja) + (= v1-4 prebot-mine-boss-train-3-ja) + ) + ) + (process-grab? *target* #f) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self root trans quad) (-> self entity extra trans quad)) + (process-release? *target*) + (go-virtual play-fma) + ) + ) + (else + (let ((gp-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) + (let ((v1-19 (the-as entity-actor (entity-by-name "scene-stage-133")))) + (when v1-19 + (set! (-> self root trans quad) (-> v1-19 extra trans quad)) + (quaternion-copy! gp-0 (-> v1-19 quat)) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-20 (-> self which-movie))) + (cond + ((zero? v1-20) + (ja :group! prebot-mine-boss-train-1-ja :num! min) + ) + ((= v1-20 1) + (ja :group! prebot-mine-boss-train-2-ja :num! min) + ) + (else + (ja :group! prebot-mine-boss-train-3-ja :num! min) + ) + ) + ) + (process-grab? *target* #f) + (let ((s5-3 (process-spawn + manipy + :init manipy-init + (-> self root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-cav-minecar" (the-as (pointer level) #f)) + #f + 0 + :name "cav-minecar" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-3 + (send-event (ppointer->process s5-3) 'anim-mode 'clone-anim) + (send-event (ppointer->process s5-3) 'clone-copy-trans #f) + (send-event (ppointer->process s5-3) 'rot-quat gp-0) + ) + ) + (let ((s5-5 (process-spawn + manipy + :init manipy-init + (-> self root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-prebot-camera" (the-as (pointer level) #f)) + #f + 0 + :name "prebot-camera" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-5 + (send-event (ppointer->process s5-5) 'anim-mode 'clone-anim) + (send-event (ppointer->process s5-5) 'clone-copy-trans #f) + (send-event (ppointer->process s5-5) 'rot-quat gp-0) + (let ((v1-83 + (process-spawn othercam (ppointer->process s5-5) 4 #f #f :name "othercam" :to (ppointer->process s5-5)) + ) + ) + (if v1-83 + (send-event (ppointer->process v1-83) 'mask 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defbehavior prebot-set-cam-slave-fov prebot ((arg0 float)) + (let ((v1-1 (-> *camera* slave))) + (if v1-1 + (set! (-> v1-1 0 fov) arg0) + ) + ) + ) + +(defstate destroy-pillars (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set! (-> self state-time) 0) + (set! (-> self num-attacks) (the-as uint 0)) + (set-setting! 'entity-name "camera-312" 0.0 0) + (dotimes (gp-0 5) + (send-event (handle->process (-> self pillars gp-0)) 'vulnerable) + ) + ) + :exit (behavior () + (prebot-set-cam-slave-fov 11650.845) + (set-setting! 'entity-name "camera-308" 0.0 0) + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + ) + :trans (behavior () + (if (= (get-aspect-ratio) 'aspect16x9) + (prebot-set-cam-slave-fov 13653.333) + (prebot-set-cam-slave-fov 11650.845) + ) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (= v1-4 prebot-gun-stow-again-ja)) + (ja :num! (seek!)) + (when (and (= (-> self stage) 1) (not (-> self laugh-played)) (>= (ja-aframe-num 0) 280.0)) + (set-time! (-> self laugh-timer)) + (set! (-> self laugh-played) #t) + (sound-play "prebot-laugh" :position (-> self root trans)) + ) + (when (ja-done? 0) + (let ((a0-14 (handle->process (-> self gun)))) + (if a0-14 + (deactivate a0-14) + ) + ) + (go-virtual slam) + ) + ) + ((let ((v1-39 (ja-group))) + (and v1-39 (= v1-39 prebot-gun-fire-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + (set-time! (-> self state-time)) + ) + ) + ((let ((v1-60 (ja-group))) + (and v1-60 (= v1-60 prebot-gun-target-ja)) + ) + (ja :num! (loop!)) + (while (and (< (-> self num-attacks) (the-as uint 4)) + (not (handle->process (-> self pillars (-> self num-attacks)))) + ) + (+! (-> self num-attacks) 1) + ) + (let ((gp-3 (handle->process (-> self pillars (-> self num-attacks))))) + (when gp-3 + (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) + (let ((a1-10 (new 'stack-no-clear 'vector))) + (set! (-> a1-10 quad) (-> (the-as process-drawable gp-3) root trans quad)) + (+! (-> a1-10 y) -14336.0) + (set-target! (-> self shoulder-aim-jm) a1-10) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set-time! (-> self state-time)) + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((and (>= (-> self num-attacks) (the-as uint 4)) + (not (handle->process (-> self pillars (-> self num-attacks)))) + ) + (ja :group! prebot-gun-stow-again-ja :num! min) + (set! (-> self laugh-played) #f) + ) + (else + (ja :group! prebot-gun-fire-ja :num! min) + (send-event (handle->process (-> self gun)) 'fire) + (prebot-light-flash 1.0 0.4 0.0) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; WARN: Return type mismatch float vs object. +(defbehavior prebot-setup-shot-offsets prebot () + (let* ((f30-0 -2048.0) + (f28-0 12288.0) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> self shot-extra-y) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) + ) + (let* ((f30-1 12288.0) + (f28-1 8192.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (set! (-> self shot-extra-xz) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-10))))) + ) + (let* ((v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (if (< (+ -1.0 (the-as float v1-14)) 0.5) + (set! (-> self shot-extra-xz) (- (-> self shot-extra-xz))) + ) + ) + ) + +(defstate watch-pillars (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (cond + ((and (logtest? (-> self flags) (prebot-flag pf1)) (logtest? (-> self flags) (prebot-flag pf2))) + (set! (-> self pillar-hint-timer) 0) + 0 + ) + (else + (set-time! (-> self pillar-hint-timer)) + ) + ) + (set-time! (-> self minecar-hint-timer)) + (case (-> self stage) + ((1) + (set! (-> self num-attacks) (the-as uint 20)) + ) + ((2) + (set! (-> self num-attacks) (the-as uint 15)) + ) + (else + (set! (-> self num-attacks) (the-as uint 10)) + ) + ) + (prebot-setup-shot-offsets) + (set-setting! 'entity-name "camera-312" 0.0 0) + ) + :exit (behavior () + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + (prebot-set-cam-slave-fov 11650.845) + (set-setting! 'entity-name "camera-308" 0.0 0) + ) + :trans (behavior () + (when (send-event self 'railblocker-hittable? #f) + (set! (-> self pillar-hint-timer) 0) + 0 + ) + (when (nonzero? (-> self pillar-hint-timer)) + (set! (-> self minecar-hint-timer) (+ (current-time) (seconds -4))) + (when (time-elapsed? (-> self pillar-hint-timer) (seconds 10)) + (set! (-> self pillar-hint-timer) 0) + (cond + ((not (logtest? (-> self flags) (prebot-flag pf1))) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf1)) + ) + ((not (logtest? (-> self flags) (prebot-flag pf2))) + (talker-spawn-func (-> *talker-speech* 330) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf2)) + ) + ) + (let ((v1-28 (-> self entity extra perm))) + (logior! (-> v1-28 status) (entity-perm-status bit-5)) + (set! (-> v1-28 user-object 0) (-> self flags)) + ) + ) + ) + (when (and (nonzero? (-> self minecar-hint-timer)) (time-elapsed? (-> self minecar-hint-timer) (seconds 10))) + (set! (-> self minecar-hint-timer) 0) + (cond + ((< 1 (-> self stage)) + (when (not (logtest? (-> self flags) (prebot-flag pf6))) + (talker-spawn-func (-> *talker-speech* 333) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf6)) + ) + ) + ((not (logtest? (-> self flags) (prebot-flag pf3))) + (talker-spawn-func (-> *talker-speech* 327) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf3)) + ) + ((not (logtest? (-> self flags) (prebot-flag pf4))) + (talker-spawn-func (-> *talker-speech* 329) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf4)) + ) + ((not (logtest? (-> self flags) (prebot-flag pf5))) + (talker-spawn-func (-> *talker-speech* 332) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf5)) + ) + ) + (let ((v1-63 (-> self entity extra perm))) + (logior! (-> v1-63 status) (entity-perm-status bit-5)) + (set! (-> v1-63 user-object 0) (-> self flags)) + ) + ) + (if (= (get-aspect-ratio) 'aspect16x9) + (prebot-set-cam-slave-fov 13653.333) + (prebot-set-cam-slave-fov 11650.845) + ) + (let ((v1-68 (ja-group))) + (cond + ((and v1-68 (= v1-68 prebot-gun-from-tentacle-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + (set-time! (-> self state-time)) + (prebot-setup-shot-offsets) + ) + ) + ((let ((v1-90 (ja-group))) + (and v1-90 (= v1-90 prebot-gun-fire-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (if (>= (the-as uint 1) (-> self num-attacks)) + (go-virtual destroy-pillars) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + (set-time! (-> self state-time)) + (prebot-setup-shot-offsets) + ) + ) + ((let ((v1-117 (ja-group))) + (and v1-117 (= v1-117 prebot-gun-target-ja)) + ) + (ja :num! (loop!)) + (cond + ((time-elapsed? (-> self state-time) (seconds 1)) + (send-event (handle->process (-> self gun)) 'fire) + (prebot-light-flash 1.0 0.4 0.0) + (+! (-> self num-attacks) -1) + (set-time! (-> self state-time)) + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! prebot-gun-fire-ja :num! min) + ) + (else + (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) + (let ((gp-10 (new 'stack-no-clear 'vector))) + (set! (-> gp-10 quad) (-> (target-pos 0) quad)) + (let ((s5-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-lod0-jg shoulderL)))) + (+! (-> gp-10 y) (-> self shot-extra-y)) + (set! (-> s5-6 y) (-> s5-6 x)) + (set! (-> s5-6 x) (-> s5-6 z)) + (set! (-> s5-6 z) (- (-> s5-6 y))) + (set! (-> s5-6 y) 0.0) + (vector-normalize! s5-6 (-> self shot-extra-xz)) + (vector+! gp-10 gp-10 s5-6) + ) + (set-target! (-> self shoulder-aim-jm) gp-10) + ) + ) + ) + ) + ((let ((v1-154 (ja-group))) + (and v1-154 (= v1-154 prebot-tentacle-stow-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-from-tentacle-ja :num! min) + (set! (-> self gun) + (ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self)) + ) + (setup-masks (-> self draw) 0 0) + (dotimes (gp-13 5) + (let ((a0-81 (handle->process (-> self tentacles gp-13)))) + (if a0-81 + (deactivate a0-81) + ) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-tentacle-stow-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior prebot-fire-tentacle prebot ((arg0 handle) (arg1 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self root trans quad)) + (let ((v1-2 (handle->process arg0))) + (if v1-2 + (vector<-cspace! s5-0 (-> (the-as prebot-tentacle v1-2) node-list data 14)) + ) + ) + (let ((a2-0 (new 'stack-no-clear 'vector))) + (vector-! a2-0 arg1 s5-0) + (set! (-> *part-id-table* 4469 init-specs 4 initial-valuef) (vector-length a2-0)) + (draw-beam (-> *part-id-table* 4469) s5-0 a2-0 #f) + ) + (launch-particles (-> *part-id-table* 4470) s5-0) + ) + (launch-particles (-> *part-id-table* 4471) arg1) + ) + +(defstate create-pillars (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self num-attacks) (the-as uint 0)) + (set-setting! 'entity-name "camera-309" 0.0 0) + (set-mined-pillar-texture! 0.0) + ) + :exit (behavior () + (set-setting! 'entity-name "camera-312" 0.0 0) + (set-mined-pillar-texture! 1.0) + (let ((a0-3 (handle->process (-> self beam-projectile)))) + (when a0-3 + (deactivate a0-3) + (set! (-> self beam-projectile) (the-as handle #f)) + ) + ) + ) + :trans (behavior () + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (v1-0 (-> self stage)) + (gp-0 (cond + ((= v1-0 1) + (new 'static 'boxed-array :type prebot-eco-pillar-launch-spec + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 40960.0 :z 163840.0 :w 1.0) + :height 12288.0 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 20480.0 :z 204800.0 :w 1.0) + :height 22528.0 + :style 1 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -20480.0 :z 204800.0 :w 1.0) + :height 32768.0 + :style 2 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :z 184320.0 :w 1.0) + :height 43008.0 + :style 3 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -40960.0 :z 163840.0 :w 1.0) + :height 53248.0 + ) + ) + ) + ((= v1-0 2) + (new 'static 'boxed-array :type prebot-eco-pillar-launch-spec + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 12288.0 :z 184320.0 :w 1.0) + :height 12288.0 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -40960.0 :z 204800.0 :w 1.0) + :height 22528.0 + :style 1 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -32768.0 :z 163840.0 :w 1.0) + :height 32768.0 + :style 2 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :z 131072.0 :w 1.0) + :height 43008.0 + :style 3 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 49152.0 :z 143360.0 :w 1.0) + :height 53248.0 + ) + ) + ) + (else + (new 'static 'boxed-array :type prebot-eco-pillar-launch-spec + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -73728.0 :z 163840.0 :w 1.0) + :height 12288.0 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -40960.0 :z 204800.0 :w 1.0) + :height 22528.0 + :style 1 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -20480.0 :z 163840.0 :w 1.0) + :height 32768.0 + :style 2 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 24576.0 :z 163840.0 :w 1.0) + :height 43008.0 + :style 3 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 8192.0 :z 204800.0 :w 1.0) + :height 53248.0 + ) + ) + ) + ) + ) + ) + (let ((f30-0 0.0)) + (set! (-> self num-attacks) (the-as uint 0)) + (dotimes (s3-0 (min 5 (-> gp-0 length))) + (vector+! s5-0 (-> gp-0 s3-0 offset) (-> self original-position)) + (set! (-> s4-0 quad) (-> s5-0 quad)) + (+! (-> s4-0 x) + (* 4096.0 (cos (* 1747.6267 (the float (+ (* 30 s3-0) (- (current-time) (-> self state-time))))))) + ) + (cond + ((not (time-elapsed? (-> self state-time) (+ (* 240 s3-0) 75))) + (send-event (handle->process (-> self tentacles s3-0)) 'look-at s5-0 #f) + ) + ((not (handle->process (-> self pillars s3-0))) + (let ((v1-27 (process-spawn prebot-eco-pillar s5-0 (-> gp-0 s3-0) :name "prebot-eco-pillar" :to self))) + (if v1-27 + (set! (-> self pillars s3-0) (ppointer->handle v1-27)) + ) + ) + (send-event (handle->process (-> self tentacles s3-0)) 'look-at s5-0 #t) + ) + (else + (set! f30-0 (cond + ((not (time-elapsed? (-> self state-time) (+ (* 240 s3-0) 1575))) + (prebot-fire-tentacle (-> self tentacles s3-0) s4-0) + (+ 1.0 f30-0) + ) + (else + (send-event (handle->process (-> self tentacles s3-0)) 'look-at #f #f) + f30-0 + ) + ) + ) + ) + ) + (let ((v1-63 (handle->process (-> self pillars s3-0)))) + (when v1-63 + (if (and (-> v1-63 next-state) (= (-> v1-63 next-state name) 'wait-to-cool)) + (+! (-> self num-attacks) 1) + ) + ) + ) + ) + (if (= f30-0 0.0) + (prebot-light-pulse-off) + (prebot-light-pulse-on (+ 0.2 (* 0.1 f30-0)) (+ 0.1 (* 0.04 f30-0)) 0.0) + ) + ) + (when (>= (-> self num-attacks) (the-as uint (min 5 (-> gp-0 length)))) + (dotimes (s5-1 (min 5 (-> gp-0 length))) + (send-event (handle->process (-> self pillars s5-1)) 'cool-down) + ) + (sound-play "pillar-cool") + (go-virtual watch-pillars) + ) + ) + (ja :num! (loop!)) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate activate-tentacles (prebot) + :virtual #t + :event prebot-handler + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-tentacle-launch-ja)) + (ja :num! (seek!)) + (when (and (not (-> self grunt-played)) (or (and (= (-> self stage) 1) (>= (ja-aframe-num 0) 165.0)) + (and (= (-> self stage) 2) (>= (ja-aframe-num 0) 167.0)) + (and (= (-> self stage) 3) (>= (ja-aframe-num 0) 178.0)) + ) + ) + (set! (-> self grunt-played) #t) + (case (-> self stage) + ((1) + (sound-play "prebot-grunts" :position (-> self root trans)) + ) + ((2) + (sound-play "prebot-trythis" :position (-> self root trans)) + ) + ((3) + (sound-play "prebot-greeting" :position (-> self root trans)) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-hatch-hover-ja :num! min) + (go-virtual create-pillars) + ) + ) + (else + (let ((v1-53 (ja-group))) + (cond + ((and v1-53 (= v1-53 prebot-tentacle-launch-pre-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self tentacles 0) + (ppointer->handle + (process-spawn prebot-tentacle "a-" (-> self root trans) 47 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 1) + (ppointer->handle + (process-spawn prebot-tentacle "b-" (-> self root trans) 48 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 2) + (ppointer->handle + (process-spawn prebot-tentacle "c-" (-> self root trans) 49 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 3) + (ppointer->handle + (process-spawn prebot-tentacle "d-" (-> self root trans) 45 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 4) + (ppointer->handle + (process-spawn prebot-tentacle "e-" (-> self root trans) 46 :name "prebot-tentacle" :to self) + ) + ) + (ja-channel-push! 1 0) + (ja :group! prebot-tentacle-launch-ja :num! min) + (set! (-> self grunt-played) #f) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-tentacle-launch-pre-ja :num! min) + (setup-masks (-> self draw) 0 0) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate watch-critters (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-idle-ja)) + (ja :num! (loop!)) + (dotimes (gp-0 28) + (let ((a0-6 (handle->process (-> self critters gp-0)))) + (when a0-6 + (if (or (time-elapsed? (-> self state-time) (seconds 45)) + (< (-> (the-as process-drawable a0-6) root trans y) (+ -40960.0 (-> self entity extra trans y))) + ) + (send-event a0-6 'instant-death) + (goto cfg-26) + ) + ) + ) + ) + (go-virtual activate-tentacles) + (label cfg-26) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-idle-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; WARN: Return type mismatch int vs object. +(defbehavior prebot-launch-critter prebot () + (cond + ((zero? (-> self nav)) + (format #t "ERROR: ~s nav mesh not found~%" (-> self name)) + (set! (-> self critters-to-launch) 0) + 0 + ) + (else + (let ((s4-0 (new 'stack-no-clear 'enemy-init-by-other-params)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (handle->process (-> self gun)))) + (cond + (s3-0 + (vector<-cspace! gp-0 (-> (the-as process-drawable s3-0) node-list data 7)) + (if (logtest? (-> *part-group-id-table* 1334 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> (the-as process-drawable s3-0) node-list data 7 bone transform) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> (the-as process-drawable s3-0) node-list data 7 bone transform) + ) + ) + ) + (else + (vector<-cspace! gp-0 (joint-node prebot-lod0-jg head)) + ) + ) + ) + (set! (-> s5-0 quad) (-> self nav state mesh bounds quad)) + (case (-> self stage) + ((1) + (+! (-> s5-0 x) 61440.0) + (set! (-> s5-0 x) (- (-> s5-0 x) (* 32768.0 (the float (-> self critters-to-launch))))) + ) + (else + (+! (-> s5-0 x) 61440.0) + (set! (-> s5-0 x) (- (-> s5-0 x) (* 28672.0 (the float (-> self critters-to-launch))))) + ) + ) + (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (quaternion-copy! (-> s4-0 quat) (-> self root quat)) + (set! (-> s4-0 entity) (-> self entity)) + (set! (-> s4-0 directed?) #f) + (set! (-> s4-0 no-initial-move-to-ground?) #f) + (set! (-> s4-0 art-level) #f) + (let ((v1-53 (process-spawn + prebot-large-eco-creature + :init enemy-init-by-other + self + s4-0 + :name "prebot-large-eco-creature" + :to self + ) + ) + ) + (when v1-53 + (send-event (ppointer->process v1-53) 'set-dest gp-0 s5-0 #x46c00000 #x44160000) + (+! (-> self critters-to-launch) -1) + (prebot-light-flash 1.0 0.4 0.0) + (sound-play "launch-cav-eco" :position gp-0) + (the-as int (sound-play "launch-whoosh" :position gp-0)) + ) + ) + ) + ) + ) + ) + +(defstate launch-critters (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (case (-> self stage) + ((1) + (set! (-> self critters-to-launch) 2) + ) + (else + (set! (-> self critters-to-launch) 3) + ) + ) + ) + :exit (behavior () + (sound-play "boss-win-vox" :position (-> self root trans)) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-gun-stow-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((a0-7 (handle->process (-> self gun)))) + (if a0-7 + (deactivate a0-7) + ) + ) + (go-virtual watch-critters) + ) + ) + (else + (let ((v1-25 (ja-group))) + (cond + ((and v1-25 (= v1-25 prebot-gun-launch-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (cond + ((= (-> self critters-to-launch) 1) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-stow-ja :num! min) + ) + (else + (ja :num-func num-func-identity :frame-num 0.0) + ) + ) + (prebot-launch-critter) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-launch-ja :num! min) + (prebot-launch-critter) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate sweep-done (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set! (-> self position target quad) (-> self original-position quad)) + (set! (-> self position target y) (-> self original-position y)) + ) + :exit (behavior () + (dotimes (gp-0 2) + (let ((a0-1 (handle->process (-> self swords gp-0)))) + (if a0-1 + (deactivate a0-1) + ) + ) + ) + (prebot-light-pulse-off) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-swords-horizontal-R2L-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-12 (ja-group))) + (and v1-12 (= v1-12 prebot-sword-R-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-22 (ja-group))) + (and v1-22 (= v1-22 prebot-sword-R-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-complete-ja :num! min) + ) + ((let ((v1-32 (ja-group))) + (and v1-32 (= v1-32 prebot-swords-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-42 (ja-group))) + (and v1-42 (= v1-42 prebot-sword-L-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-52 (ja-group))) + (and v1-52 (= v1-52 prebot-sword-L-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-complete-ja :num! min) + ) + ((let ((v1-62 (ja-group))) + (and v1-62 (or (= v1-62 prebot-sword-R-horizontal-L2R-complete-ja) + (= v1-62 prebot-sword-R-horizontal-R2L-complete-ja) + (= v1-62 prebot-sword-L-horizontal-L2R-complete-ja) + (= v1-62 prebot-sword-L-horizontal-R2L-complete-ja) + (= v1-62 prebot-swords-horizontal-L2R-complete-ja) + (= v1-62 prebot-swords-horizontal-R2L-complete-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (dotimes (gp-6 2) + (let ((a0-58 (handle->process (-> self swords gp-6)))) + (if a0-58 + (deactivate a0-58) + ) + ) + ) + (setup-masks (-> self draw) 28 0) + (prebot-light-pulse-off) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-from-sword-R-ja :num! min) + (set! (-> self gun) + (ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self)) + ) + ) + ) + (else + (let ((v1-99 (ja-group))) + (cond + ((and v1-99 (= v1-99 prebot-gun-from-sword-R-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-aim-ja :num! min) + ) + ) + (else + (let ((f0-14 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-0 1024.0) + ) + (if (< f0-14 (* f1-0 f1-0)) + (go-virtual launch-critters) + ) + ) + (ja :num! (loop!)) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate sweep (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (prebot-method-46 self) + (case (-> self stage) + ((1) + (set! (-> self num-attacks) (the-as uint 2)) + (set! (-> self position max-vel) 1638.4) + ) + ((2) + (set! (-> self num-attacks) (the-as uint 3)) + (set! (-> self position max-vel) 2048.0) + ) + (else + (set! (-> self num-attacks) (the-as uint 3)) + (set! (-> self position max-vel) 2457.6) + ) + ) + (set! (-> self position accel) 409.6) + (set! (-> self position max-partial) 0.99) + (dotimes (gp-0 2) + (send-event (handle->process (-> self swords gp-0)) 'whoosh-lead (* 15.0 (-> self position max-vel))) + (send-event (handle->process (-> self swords gp-0)) 'use-pos-pitch #t) + ) + ) + :exit (behavior () + (prebot-method-45 self) + (set! (-> self position accel) 0.004096) + (set! (-> self position max-vel) 2048.0) + (set! (-> self position max-partial) 0.125) + (dotimes (gp-0 2) + (send-event (handle->process (-> self swords gp-0)) 'scale #x3f800000) + (send-event (handle->process (-> self swords gp-0)) 'use-pos-pitch #f) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-swords-horizontal-R2L-strike-ja)) + (ja :num! (seek!)) + (cond + ((>= (ja-aframe-num 0) 195.0) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + ) + ((>= (ja-aframe-num 0) 190.0) + (dotimes (gp-0 2) + (send-event (handle->process (-> self swords gp-0)) 'scale #x3ff33333) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-hold-ja :num! min) + ) + ) + ((let ((v1-39 (ja-group))) + (and v1-39 (= v1-39 prebot-swords-horizontal-L2R-strike-ja)) + ) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 231.0) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (dotimes (gp-2 2) + (send-event (handle->process (-> self swords gp-2)) 'scale #x3ff33333) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-L2R-hold-ja :num! min) + ) + ) + ((let ((v1-73 (ja-group))) + (and v1-73 (= v1-73 prebot-sword-R-horizontal-R2L-strike-ja)) + ) + (ja :num! (seek!)) + (cond + ((>= (ja-aframe-num 0) 252.0) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + ) + ((>= (ja-aframe-num 0) 248.0) + (dotimes (gp-4 2) + (send-event (handle->process (-> self swords gp-4)) 'scale #x3ff33333) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-hold-ja :num! min) + ) + ) + ((let ((v1-110 (ja-group))) + (and v1-110 (= v1-110 prebot-sword-R-horizontal-L2R-strike-ja)) + ) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 207.0) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (dotimes (gp-6 2) + (send-event (handle->process (-> self swords gp-6)) 'scale #x3ff33333) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-hold-ja :num! min) + ) + ) + ((let ((v1-144 (ja-group))) + (and v1-144 (= v1-144 prebot-sword-L-horizontal-R2L-strike-ja)) + ) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 207.0) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + (dotimes (gp-8 2) + (send-event (handle->process (-> self swords gp-8)) 'scale #x3ff33333) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-hold-ja :num! min) + ) + ) + ((let ((v1-178 (ja-group))) + (and v1-178 (= v1-178 prebot-sword-L-horizontal-L2R-strike-ja)) + ) + (ja :num! (seek!)) + (cond + ((>= (ja-aframe-num 0) 252.0) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + ) + ((>= (ja-aframe-num 0) 248.0) + (dotimes (gp-10 2) + (send-event (handle->process (-> self swords gp-10)) 'scale #x3ff33333) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-hold-ja :num! min) + ) + ) + ((let ((v1-215 (ja-group))) + (and v1-215 (or (= v1-215 prebot-sword-R-horizontal-R2L-hold-ja) + (= v1-215 prebot-sword-R-horizontal-L2R-hold-ja) + (= v1-215 prebot-sword-L-horizontal-R2L-hold-ja) + (= v1-215 prebot-sword-L-horizontal-L2R-hold-ja) + (= v1-215 prebot-swords-horizontal-R2L-hold-ja) + (= v1-215 prebot-swords-horizontal-L2R-hold-ja) + ) + ) + ) + (ja :num! (loop!)) + (dotimes (gp-12 2) + (send-event (handle->process (-> self swords gp-12)) 'scale #x3ff33333) + ) + (let ((f0-46 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-15 1024.0) + ) + (when (< f0-46 (* f1-15 f1-15)) + (dotimes (gp-13 2) + (send-event (handle->process (-> self swords gp-13)) 'scale #x3f800000) + ) + (+! (-> self num-attacks) -1) + (if (<= (-> self num-attacks) 0) + (go-virtual sweep-done) + ) + (let ((v1-258 (ja-group))) + (cond + ((and v1-258 (= v1-258 prebot-swords-horizontal-R2L-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-return-ja :num! min) + (set! (-> self position target y) (+ -34816.0 (-> self original-position y))) + ) + ((let ((v1-270 (ja-group))) + (and v1-270 (= v1-270 prebot-swords-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-L2R-return-ja :num! min) + (set! (-> self position target y) (+ -34816.0 (-> self original-position y))) + ) + ((let ((v1-282 (ja-group))) + (and v1-282 (= v1-282 prebot-sword-R-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + ((let ((v1-294 (ja-group))) + (and v1-294 (= v1-294 prebot-sword-R-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + (else + (let ((v1-306 (ja-group))) + (cond + ((and v1-306 (= v1-306 prebot-sword-L-horizontal-R2L-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-325 (ja-group))) + (and v1-325 (or (= v1-325 prebot-sword-R-horizontal-R2L-return-ja) + (= v1-325 prebot-sword-L-horizontal-R2L-return-ja) + (= v1-325 prebot-swords-horizontal-R2L-return-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (dotimes (gp-20 2) + (send-event (handle->process (-> self swords gp-20)) 'whoosh-lead (* 15.0 (-> self position max-vel))) + ) + (let ((v1-352 (ja-group))) + (cond + ((and v1-352 (= v1-352 prebot-swords-horizontal-R2L-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-L2R-strike-ja :num! min) + ) + (else + (let ((v1-362 (ja-group))) + (cond + ((and v1-362 (= v1-362 prebot-sword-R-horizontal-R2L-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-377 (ja-group))) + (and v1-377 (or (= v1-377 prebot-sword-R-horizontal-L2R-return-ja) + (= v1-377 prebot-sword-L-horizontal-L2R-return-ja) + (= v1-377 prebot-swords-horizontal-L2R-return-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (dotimes (gp-24 2) + (send-event (handle->process (-> self swords gp-24)) 'whoosh-lead (* 15.0 (-> self position max-vel))) + ) + (let ((v1-404 (ja-group))) + (cond + ((and v1-404 (= v1-404 prebot-swords-horizontal-L2R-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-strike-ja :num! min) + ) + (else + (let ((v1-414 (ja-group))) + (cond + ((and v1-414 (= v1-414 prebot-sword-R-horizontal-L2R-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate slam-done (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (case (-> self stage) + ((1) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + ((2) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + (else + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (set! (-> self position target y) (+ -34816.0 (-> self original-position y))) + ) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 prebot-sword-R-strike2pose-ja) + (= v1-2 prebot-sword-L-strike2pose-ja) + (= v1-2 prebot-swords-strike2pose-ja) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self trythis-played) #f) + (let ((v1-16 (ja-group))) + (cond + ((and v1-16 (= v1-16 prebot-swords-strike2pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-pose-ja :num! min) + ) + (else + (let ((v1-26 (ja-group))) + (cond + ((and v1-26 (= v1-26 prebot-sword-R-strike2pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-pose-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-pose-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-41 (ja-group))) + (and v1-41 + (or (= v1-41 prebot-sword-R-pose-ja) (= v1-41 prebot-sword-L-pose-ja) (= v1-41 prebot-swords-pose-ja)) + ) + ) + (ja :num! (seek!)) + (when (and (not (-> self trythis-played)) (or (and (= (-> self stage) 1) + (let ((v1-59 (ja-group))) + (and v1-59 (= v1-59 prebot-sword-R-pose-ja)) + ) + (>= (ja-aframe-num 0) 162.0) + ) + (and (= (-> self stage) 2) + (let ((v1-68 (ja-group))) + (and v1-68 (= v1-68 prebot-sword-L-pose-ja)) + ) + (>= (ja-aframe-num 0) 156.0) + ) + (and (= (-> self stage) 3) + (let ((v1-76 (ja-group))) + (and v1-76 (= v1-76 prebot-swords-pose-ja)) + ) + (>= (ja-aframe-num 0) 166.0) + ) + ) + ) + (set! (-> self trythis-played) #t) + (case (-> self stage) + ((1) + (sound-play "prebot-trythis" :position (-> self root trans)) + ) + ((2) + (sound-play "prebot-grunts" :position (-> self root trans)) + ) + ((2) + (sound-play "prebot-harumph" :position (-> self root trans)) + ) + ) + ) + (when (ja-done? 0) + (let ((v1-99 (ja-group))) + (cond + ((and v1-99 (= v1-99 prebot-swords-pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-pre-ja :num! min) + ) + (else + (let ((v1-109 (ja-group))) + (cond + ((and v1-109 (= v1-109 prebot-sword-R-pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-pre-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-pre-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (let ((v1-124 (ja-group))) + (cond + ((and v1-124 (or (= v1-124 prebot-sword-R-horizontal-L2R-pre-ja) + (= v1-124 prebot-sword-L-horizontal-R2L-pre-ja) + (= v1-124 prebot-swords-horizontal-R2L-pre-ja) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((v1-138 (ja-group))) + (cond + ((and v1-138 (= v1-138 prebot-swords-horizontal-R2L-pre-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-strike-ja :num! min) + ) + (else + (let ((v1-148 (ja-group))) + (cond + ((and v1-148 (= v1-148 prebot-sword-R-horizontal-L2R-pre-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + (go-virtual sweep) + ) + ) + ((let ((v1-166 (ja-group))) + (and v1-166 (= v1-166 prebot-swords-L-vertical-strike-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-strike2pose-ja :num! min) + ) + (else + (let ((v1-176 (ja-group))) + (cond + ((and v1-176 (= v1-176 prebot-sword-R-vertical-strike-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-strike2pose-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-strike2pose-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; WARN: Return type mismatch int vs object. +(defbehavior prebot-spawn-shockwave prebot () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s5-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) + ;; og:preserve-this unused lambda? + ;; L162 + (let* ((v1-6 (ja-group)) + (v1-13 (handle->process (-> self swords (if (and v1-6 (= v1-6 prebot-swords-R-vertical-strike-ja)) + 1 + 0 + ) + ) + ) + ) + ) + (when v1-13 + (vector<-cspace! gp-0 (-> (the-as process-drawable v1-13) node-list data 5)) + (+! (-> gp-0 z) -90112.0) + (set! (-> gp-0 y) (+ 4096.0 (-> self original-position y))) + ) + ) + (quaternion-set! s5-0 0.0 1.0 0.0 0.0) + (process-spawn prebot-shockwave gp-0 s5-0 :name "prebot-shockwave" :to self) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* 819.2 37 300 1.0 1.1 (-> *display* camera-clock)) + (prebot-light-flash 1.0 0.0 0.0) + (sound-play "shockwave" :position gp-0) + (sound-play "sword-hit" :position gp-0) + ) + 0 + ) + +(defstate slam (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set! (-> self position target x) (-> self original-position x)) + (set! (-> self position target y) (+ 6144.0 (-> self original-position y))) + (set! (-> self position target z) (+ 61440.0 (-> self original-position z))) + (case (-> self stage) + ((1) + (set! (-> self num-attacks) (the-as uint 2)) + ) + ((2) + (set! (-> self num-attacks) (the-as uint 3)) + ) + (else + (set! (-> self num-attacks) (the-as uint 4)) + ) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-sword-grab-both-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-swords-vertical-pre-ja :num! min) + (setup-masks (-> self draw) 0 24) + (prebot-light-pulse-on 0.7 0.2 0.0) + (set! (-> self swords 0) + (ppointer->handle + (process-spawn prebot-sword "sword-l-" (-> self root trans) 43 #f :name "prebot-sword" :to self) + ) + ) + (set! (-> self swords 1) + (ppointer->handle + (process-spawn prebot-sword "sword-r-" (-> self root trans) 27 #t :name "prebot-sword" :to self) + ) + ) + ) + ) + (else + (let ((v1-35 (ja-group))) + (cond + ((and v1-35 (= v1-35 prebot-sword-grab-AR-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-pre-ja :num! min) + (setup-masks (-> self draw) 0 4) + (prebot-light-pulse-on 0.7 0.2 0.0) + (set! (-> self swords 0) + (ppointer->handle + (process-spawn prebot-sword "sword-" (-> self root trans) 27 #f :name "prebot-sword" :to self) + ) + ) + ) + ) + ((let ((v1-62 (ja-group))) + (and v1-62 (= v1-62 prebot-sword-grab-AL-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-L-vertical-pre-ja :num! min) + (setup-masks (-> self draw) 0 2) + (prebot-light-pulse-on 0.7 0.2 0.0) + (set! (-> self swords 0) + (ppointer->handle + (process-spawn prebot-sword "sword-" (-> self root trans) 43 #f :name "prebot-sword" :to self) + ) + ) + ) + ) + ((not (handle->process (-> self swords 0))) + (case (-> self stage) + ((1) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-grab-AR-ja :num! min) + ) + ((2) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-grab-AL-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-grab-both-ja :num! min) + ) + ) + ) + ((let ((v1-108 (ja-group))) + (and v1-108 (or (= v1-108 prebot-sword-R-vertical-pre-ja) + (= v1-108 prebot-sword-L-vertical-pre-ja) + (= v1-108 prebot-swords-vertical-pre-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((f0-18 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-0 1024.0) + ) + (cond + ((< f0-18 (* f1-0 f1-0)) + (let ((v1-124 (ja-group))) + (cond + ((and v1-124 (= v1-124 prebot-swords-vertical-pre-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-swords-R-vertical-strike-ja :num! min) + ) + (else + (let ((v1-134 (ja-group))) + (cond + ((and v1-134 (= v1-134 prebot-sword-R-vertical-pre-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-L-vertical-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-149 (ja-group))) + (and v1-149 (= v1-149 prebot-swords-vertical-pre-ja)) + ) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-swords-vertical-hold-ja :num! min) + ) + (else + (let ((v1-159 (ja-group))) + (cond + ((and v1-159 (= v1-159 prebot-sword-R-vertical-pre-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-hold-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-hold-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-174 (ja-group))) + (and (and v1-174 (or (= v1-174 prebot-sword-R-vertical-hold-ja) + (= v1-174 prebot-sword-L-vertical-hold-ja) + (= v1-174 prebot-swords-vertical-hold-ja) + ) + ) + (let ((f0-25 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-3 1024.0) + ) + (< f0-25 (* f1-3 f1-3)) + ) + ) + ) + (let ((v1-182 (ja-group))) + (cond + ((and v1-182 (= v1-182 prebot-swords-vertical-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-R-vertical-strike-ja :num! min) + ) + (else + (let ((v1-192 (ja-group))) + (cond + ((and v1-192 (= v1-192 prebot-sword-R-vertical-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-vertical-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-vertical-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-207 (ja-group))) + (and v1-207 (or (= v1-207 prebot-sword-R-vertical-strike-ja) + (= v1-207 prebot-sword-L-vertical-strike-ja) + (= v1-207 prebot-swords-L-vertical-strike-ja) + (= v1-207 prebot-swords-R-vertical-strike-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (prebot-spawn-shockwave) + (+! (-> self num-attacks) -1) + (cond + ((zero? (-> self num-attacks)) + (go-virtual slam-done) + ) + ((let ((v1-227 (ja-group))) + (and v1-227 (= v1-227 prebot-swords-R-vertical-strike-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-R-vertical-between-ja :num! min) + ) + ((let ((v1-237 (ja-group))) + (and v1-237 (= v1-237 prebot-swords-L-vertical-strike-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-L-vertical-between-ja :num! min) + ) + (else + (let ((v1-247 (ja-group))) + (cond + ((and v1-247 (= v1-247 prebot-sword-R-vertical-strike-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-vertical-between-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-vertical-between-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-262 (ja-group))) + (and v1-262 (or (= v1-262 prebot-sword-R-vertical-between-ja) + (= v1-262 prebot-sword-L-vertical-between-ja) + (= v1-262 prebot-swords-R-vertical-between-ja) + (= v1-262 prebot-swords-L-vertical-between-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((v1-276 (ja-group))) + (cond + ((and v1-276 (= v1-276 prebot-swords-R-vertical-between-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-L-vertical-strike-ja :num! min) + ) + ((let ((v1-286 (ja-group))) + (and v1-286 (= v1-286 prebot-swords-L-vertical-between-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-R-vertical-strike-ja :num! min) + ) + (else + (let ((v1-296 (ja-group))) + (cond + ((and v1-296 (= v1-296 prebot-sword-R-vertical-between-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-vertical-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-vertical-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate pre-slam (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self laugh-played) #f) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-idle-ja)) + (ja :num! (loop!)) + (when (and (not (-> self laugh-played)) (or (and (= (-> self stage) 1) (>= (ja-aframe-num 0) 3.0)) + (and (= (-> self stage) 2) (>= (ja-aframe-num 0) 4.0)) + (and (= (-> self stage) 3) (>= (ja-aframe-num 0) 5.0)) + ) + ) + (set-time! (-> self laugh-timer)) + (set! (-> self laugh-played) #t) + (sound-play "prebot-laugh" :position (-> self root trans)) + ) + (if (or (-> self laugh-played) (time-elapsed? (-> self state-time) (seconds 0.25))) + (go-virtual slam) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-idle-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate jump-to-hover (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status bit-13)))) + (talker-spawn-func (-> *talker-speech* 326) *entity-pool* (target-pos 0) (the-as region #f)) + (process-entity-status! self (entity-perm-status bit-13) #t) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-jump-to-hover-ja)) + (ja :num! (seek!)) + (if (or (ja-done? 0) (< -40.0 (ja-aframe-num 0))) + (go-virtual pre-slam) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-jump-to-hover-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate hidden (prebot) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (remove-setting! 'point-of-interest) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (task-node-closed? (game-task-node mine-boss-introduction)) + (prebot-go-next-stage) + ) + (set-time! (-> self state-time)) + ) + ) + :code sleep-code + ) + +(defstate test (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (cond + ((zero? (-> self nav)) + (format #t "ERROR: ~s nav mesh not found~%" (-> self name)) + ) + (else + (let ((gp-0 (new 'stack-no-clear 'enemy-init-by-other-params))) + (let ((v1-4 (new 'stack-no-clear 'vector))) + (set! (-> v1-4 quad) (-> self nav state mesh bounds quad)) + (set! (-> gp-0 trans quad) (-> v1-4 quad)) + ) + (quaternion-copy! (-> gp-0 quat) (-> self root quat)) + (set! (-> gp-0 entity) (-> self entity)) + (set! (-> gp-0 directed?) #f) + (set! (-> gp-0 no-initial-move-to-ground?) #f) + (set! (-> gp-0 art-level) #f) + (process-spawn + prebot-large-eco-creature + :init enemy-init-by-other + self + gp-0 + :name "prebot-large-eco-creature" + :to self + ) + ) + ) + ) + (ja-channel-push! 1 0) + (ja :group! prebot-idle-ja :num! min) + (set! (-> self position target z) (+ -61440.0 (-> self original-position z))) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (cpad-pressed? 1 x)) + (go-virtual test) + ) + (ja :num! (loop!)) + (show-maya-skeleton self -1 #x45800000) + (let ((gp-0 (handle->process (-> self gun)))) + (cond + ((>= (ja-aframe-num 0) 60.0) + (if (not gp-0) + (set! (-> self gun) + (ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self)) + ) + ) + ) + (gp-0 + (deactivate gp-0) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defmethod draw ((this hud-prebot)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 130.0 (-> this offset)))) + 150 + ) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) -9 70) + (case (-> this values 0 current) + ((1) + (set! (-> this sprites 4 scale-x) 6.0) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ((2) + (set! (-> this sprites 4 scale-x) 4.0) + (set! (-> this sprites 4 color x) 128) + (set! (-> this sprites 4 color y) 128) + (set! (-> this sprites 4 color z) 0) + 0 + ) + (else + (set! (-> this sprites 4 scale-x) 2.0) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) -8 68) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) -51 68) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -12 68) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-prebot)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-prebot)) + (set! (-> this level) (level-get *level* 'mined)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-caveboss-01 mined-minimap))) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 4 tid) (the-as texture-id (get-texture hud-caveboss-health-01 mined-minimap))) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 0.5) + (set! (-> this sprites 4 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 3 tid) (the-as texture-id (get-texture hud-small-frame-01 mined-minimap))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 flags) (hud-sprite-flags hsf0 hsf2)) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-small-frame-01 mined-minimap))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set! (-> this sprites 2 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-small-frame-02 mined-minimap))) + (set! (-> this sprites 1 scale-x) 10.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set! (-> this sprites 1 flags) (hud-sprite-flags hsf2)) + 0 + (none) + ) + +(deftype task-manager-prebot (task-manager) + ((manager-entity entity) + (check-timer time-frame) + ) + ) + + +(defstate active (task-manager-prebot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self check-timer) 0) + 0 + ) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod task-manager-method-26 ((this task-manager-prebot)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (and (not (-> this manager-entity)) (time-elapsed? (-> this check-timer) (seconds 0.1))) + (let* ((a0-3 "prebot-2") + (v1-6 (entity-by-name a0-3)) + ) + (when v1-6 + (set! (-> this manager-entity) v1-6) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-prebot :init hud-init-by-other :name "hud-prebot" :to this)) + ) + ) + ) + (set-time! (-> this check-timer)) + ) + (none) + ) + +(defmethod set-time-limit ((this task-manager-prebot)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this manager-entity) #f) + (set-setting! 'music 'mineboss 0.0 0) + (none) + ) diff --git a/goal_src/jak3/levels/mine/rat.gc b/goal_src/jak3/levels/mine/rat.gc index 6c8d984d50..7c4a954c9b 100644 --- a/goal_src/jak3/levels/mine/rat.gc +++ b/goal_src/jak3/levels/mine/rat.gc @@ -7,3 +7,2034 @@ ;; DECOMP BEGINS +(defskelgroup skel-rat rat rat-lod0-jg -1 + ((rat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow rat-shadow-mg + :origin-joint-index 18 + ) + +(deftype rat (nav-enemy) + ((init-quat quaternion :inline) + (roll-transform transformq :inline) + (face-dir vector :inline) + (flee-focus-pos vector :inline) + (wheel-actor entity-actor) + (permanently-scared symbol) + (slide-sound-id uint32) + (scared-timer time-frame) + (scared-interval time-frame) + (return-to-nav-mesh? symbol) + ) + (:state-methods + wait-by-wheel-seek + wait-by-wheel-wait + active-turn + attack + flee-stare + undefined + running-in-wheel + wheel-die + ) + ) + + +(define *fact-info-rat-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +(define *rat-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 7 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 0.75) (new 'static 'bfloat :data 1.5)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 2 + :param1 5 + :param2 '((new 'static 'bfloat :data 0.75) (new 'static 'bfloat :data 1.5)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 6 + :notice-anim 5 + :hostile-anim 11 + :hit-anim 6 + :knocked-anim 16 + :knocked-land-anim 17 + :die-anim 24 + :die-falling-anim 24 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 6 + :sound-hit (static-sound-name "rat-squeal") + :sound-die (static-sound-name "rat-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 49152.0 + :knocked-soft-vxz-hi 77824.0 + :knocked-soft-vy-lo 65536.0 + :knocked-soft-vy-hi 102400.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9898 :y 0.0756 :z 0.1191 :w 16871.352) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd obstacle hit-by-others-list pusher) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9975 :y 0.0623 :z -0.0291 :w 23209.137) + :geo-tform (new 'static 'vector :x 1.0 :w 12952.898) + :axial-slop 1800.5653 + :max-angle 3301.7039 + :coll-rad 2231.0913 + :hit-sound (static-sound-name "rat-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0004 :w 32758.518) + :geo-tform (new 'static 'vector :x 1.0 :z 0.0004 :w 32768.02) + :axial-slop 1800.5653 + :max-angle 3299.4827 + :coll-rad 1563.4432 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7428 :y -0.0498 :z 0.6675 :w 33924.785) + :geo-tform (new 'static 'vector :x 0.6487 :y 0.4895 :z 0.5825 :w 43181.707) + :axial-slop 1800.5653 + :max-angle 4193.594 + :coll-rad 1294.7456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1409 :y -0.1438 :z 0.9794 :w 5063.1294) + :geo-tform (new 'static 'vector :x 0.7137 :y 0.3672 :z 0.5963 :w 41407.32) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1197.6704 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4227 :y 0.5005 :z 0.7554 :w 43021.234) + :geo-tform (new 'static 'vector :x -0.48 :y -0.8771 :z 0.0154 :w 16837.107) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 6 + :pre-tform (new 'static 'vector :x -0.4637 :y -0.5607 :z 0.6859 :w 24477.533) + :geo-tform (new 'static 'vector :x -0.5132 :y -0.0929 :z 0.8532 :w 39898.88) + :axial-slop 1800.5653 + :max-angle 4806.5015 + :coll-rad 991.6416 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5308 :y -0.0302 :z -0.8469 :w 9008.215) + :geo-tform (new 'static 'vector :x 0.8575 :y 0.4582 :z -0.2339 :w 23058.24) + :axial-slop 1800.5653 + :max-angle 3692.2073 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9113 :y 0.3345 :z -0.2396 :w 9324.316) + :geo-tform (new 'static 'vector :x -0.6075 :y 0.6787 :z 0.4125 :w 11790.964) + :axial-slop 1800.5653 + :max-angle 3223.1514 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5485 :y 0.0296 :z 0.8355 :w 8436.723) + :geo-tform (new 'static 'vector :x -0.5367 :y 0.8135 :z 0.2236 :w 9872.307) + :axial-slop 1800.5653 + :max-angle 2035.4388 + :coll-rad 697.5488 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7012 :y -0.0152 :z 0.7127 :w 6800.543) + :geo-tform (new 'static 'vector :x 0.7478 :y -0.0492 :z 0.662 :w 16398.764) + :axial-slop 1800.5653 + :max-angle 3487.4438 + :coll-rad 556.2368 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4697 :y 0.169 :z 0.8664 :w 9123.412) + :geo-tform (new 'static 'vector :x 0.8284 :y -0.482 :z 0.2849 :w 23692.027) + :axial-slop 1800.5653 + :max-angle 3475.6653 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8702 :y -0.3516 :z 0.3448 :w 9364.0205) + :geo-tform (new 'static 'vector :x -0.5482 :y -0.7233 :z -0.4196 :w 12565.746) + :axial-slop 1800.5653 + :max-angle 3745.783 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5319 :y -0.3084 :z -0.7885 :w 8845.867) + :geo-tform (new 'static 'vector :x -0.6153 :y -0.7608 :z -0.2061 :w 8654.2295) + :axial-slop 1800.5653 + :max-angle 2274.791 + :coll-rad 757.76 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8155 :y -0.1199 :z -0.5661 :w 6821.0957) + :geo-tform (new 'static 'vector :x 0.7005 :y 0.2295 :z -0.6757 :w 16967.252) + :axial-slop 1800.5653 + :max-angle 3639.3962 + :coll-rad 397.7216 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.9985 :y -0.0463 :z 0.0288 :w 11897.897) + :geo-tform (new 'static 'vector :x -0.997 :y 0.0705 :z 0.0292 :w 8203.996) + :axial-slop 1800.5653 + :max-angle 3417.666 + :coll-rad 1127.2192 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3436 :y -0.9382 :z 0.0401 :w 1372.5969) + :geo-tform (new 'static 'vector :x -0.984 :y 0.1534 :z 0.0897 :w 11190.399) + :axial-slop 1800.5653 + :max-angle 3380.966 + :coll-rad 1597.8496 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3309 :y 0.0632 :z -0.9415 :w 15700.951) + :geo-tform (new 'static 'vector :x 0.7557 :y 0.568 :z 0.3258 :w 34107.156) + :axial-slop 1800.5653 + :max-angle 3795.7178 + :coll-rad 1286.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9673 :y -0.2207 :z 0.1243 :w 10359.821) + :geo-tform (new 'static 'vector :x 0.7738 :y -0.299 :z 0.5583 :w 23514.645) + :axial-slop 1800.5653 + :max-angle 3626.18 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.4253 :y -0.0324 :z 0.9044 :w 21694.164) + :geo-tform (new 'static 'vector :x -0.816 :y -0.3366 :z -0.4697 :w 21449.367) + :axial-slop 1800.5653 + :max-angle 3774.4185 + :coll-rad 591.4624 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5431 :y -0.0261 :z -0.8392 :w 19577.861) + :geo-tform (new 'static 'vector :x 0.4968 :y -0.8225 :z 0.2766 :w 11542.782) + :axial-slop 1800.5653 + :max-angle 2293.8694 + :coll-rad 626.2784 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5367 :y 0.0778 :z 0.8401 :w 6345.687) + :geo-tform (new 'static 'vector :x -0.62 :y -0.7018 :z -0.3505 :w 13527.996) + :axial-slop 1800.5653 + :max-angle 2710.7876 + :coll-rad 445.2352 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 18 + :pre-tform (new 'static 'vector :x 0.9719 :y -0.1118 :z -0.2067 :w 4947.2944) + :geo-tform (new 'static 'vector :x 0.9852 :y 0.1266 :z -0.1151 :w 13674.414) + :axial-slop 1800.5653 + :max-angle 1986.9968 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3961 :y -0.884 :z -0.248 :w 1440.9546) + :geo-tform (new 'static 'vector :x -0.4417 :y 0.8968 :z 0.0222 :w 3241.5017) + :axial-slop 1800.5653 + :max-angle 2815.7542 + :coll-rad 791.3472 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7521 :y -0.6312 :z 0.1891 :w 1846.6588) + :geo-tform (new 'static 'vector :x 0.1732 :y 0.9842 :z -0.0343 :w 4142.276) + :axial-slop 1800.5653 + :max-angle 3795.7178 + :coll-rad 760.2176 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5148 :y -0.8218 :z -0.2441 :w 1278.8622) + :geo-tform (new 'static 'vector :x 0.0427 :y 0.999 :z -0.0107 :w 5133.7627) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 575.0784 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1457 :y -0.9851 :z -0.0908 :w 1308.1167) + :geo-tform (new 'static 'vector :x -0.0891 :y 0.9956 :z 0.0283 :w 6443.0444) + :axial-slop 1800.5653 + :max-angle 5359.261 + :coll-rad 513.2288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint 18 + :pre-tform (new 'static 'vector :x -0.084 :y 0.0546 :z 0.9949 :w 15687.553) + :geo-tform (new 'static 'vector :x 0.7291 :y -0.57 :z -0.3786 :w 33257.48) + :axial-slop 1800.5653 + :max-angle 3678.281 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7243 :y 0.6445 :z -0.2448 :w 13605.893) + :geo-tform (new 'static 'vector :x 0.9233 :y 0.1682 :z -0.345 :w 22198.062) + :axial-slop 1800.5653 + :max-angle 3652.5945 + :coll-rad 931.0208 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8853 :y 0.1044 :z -0.4529 :w 21871.893) + :geo-tform (new 'static 'vector :x -0.9877 :y 0.0861 :z 0.1303 :w 19674.363) + :axial-slop 1800.5653 + :max-angle 3709.101 + :coll-rad 675.4304 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9484 :y -0.0508 :z 0.3126 :w 19602.928) + :geo-tform (new 'static 'vector :x 0.8427 :y 0.5037 :z -0.1896 :w 7369.013) + :axial-slop 1800.5653 + :max-angle 3767.8103 + :coll-rad 740.5568 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8652 :y -0.2236 :z -0.4486 :w 6495.9824) + :geo-tform (new 'static 'vector :x -0.854 :y 0.4607 :z 0.2416 :w 10556.411) + :axial-slop 1800.5653 + :max-angle 2548.5496 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 0.5956 :y -0.5418 :z 0.5929 :w 18988.164) + :geo-tform (new 'static 'vector :x -0.75 :y -0.6581 :z -0.0655 :w 2752.0388) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1277.1328 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint 7 + :pre-tform (new 'static 'vector :x -0.8792 :y 0.2318 :z -0.4161 :w 7033.5786) + :geo-tform (new 'static 'vector :x -0.0562 :y -0.9874 :z -0.1475 :w 16494.428) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 744.2432 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 8 + :pre-tform (new 'static 'vector :x -0.5619 :y -0.0979 :z 0.8213 :w 6875.181) + :geo-tform (new 'static 'vector :x -0.5163 :y -0.1113 :z 0.8491 :w 33034.82) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 645.5296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 0.8388 :y -0.5396 :z -0.0716 :w 22881.477) + :geo-tform (new 'static 'vector :x -0.0691 :y 0.6797 :z 0.7301 :w 12063.759) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 0.2823 :y -0.5464 :z 0.7884 :w 23099.492) + :geo-tform (new 'static 'vector :x 0.9118 :y -0.3801 :z 0.1549 :w 29933.094) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.7122 :y 0.0482 :z 0.7002 :w 7344.5103) + :geo-tform (new 'static 'vector :x 0.5743 :y 0.7856 :z -0.2297 :w 9826.541) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1135.8208 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.755 :y 0.3048 :z -0.5805 :w 6001.295) + :geo-tform (new 'static 'vector :x 0.9264 :y 0.104 :z 0.3618 :w 38196.477) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1147.6992 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 10 + :turn-anim -1 + :run-anim 11 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 60) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 2) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *rat-nav-enemy-info* fact-defaults) *fact-info-rat-defaults*) + +(defmethod init-enemy-collision! ((this rat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle 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 4915.2 0.0 10240.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v1-13 local-sphere) 0.0 819.2 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-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 4956.16 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 1228.8 3276.8) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-19 transform-index) 34) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 1228.8 2048.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-21 transform-index) 18) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-23 transform-index) 25) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 1638.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior rat-run-code rat () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! rat-run0-ja + :num! (seek! max (lerp-scale 0.5 1.333 (vector-length (-> self root transv)) 0.0 32768.0)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (lerp-scale 0.5 1.333 (vector-length (-> self root transv)) 0.0 32768.0))) + ) + ) + #f + (none) + ) + +(defbehavior rat-falling-post rat () + (nav-enemy-falling-post) + (none) + ) + +(defstate idle (rat) + :virtual #t + :enter (behavior () + (if (enemy-method-109 self) + (go-virtual die) + ) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +(defstate ambush (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy ambush) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-8 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logclear (-> v1-11 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-time! (-> self state-time)) + (logclear! (-> self enemy-flags) (enemy-flag alert)) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((a0-8 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector+float*! gp-0 (-> self root trans) a0-8 32768.0) + ) + (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) + ) + (set! (-> self root gspot-pos quad) (-> gp-0 quad)) + ) + (sound-play "rat-spawner") + ) + :exit (behavior () + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (let* ((v1-2 (- (current-time) (-> self state-time))) + (f0-1 (fmin 1.0 (* 0.0016666667 (the float v1-2)))) + ) + (set-vector! (-> self draw color-mult) f0-1 f0-1 f0-1 1.0) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! rat-pipe-jump0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! rat-pipe-jump0-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0) + (cond + ((>= (-> self root gspot-pos y) (-> self root trans y)) + (set! (-> self root trans y) (-> self root gspot-pos y)) + ) + (else + (vector-v++! + (-> self root transv) + (compute-acc-due-to-gravity (-> self root) (new 'stack-no-clear 'vector) (-> self enemy-info slip-factor)) + ) + (vector-v++! (-> self root trans) (-> self root transv)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate active (rat) + :virtual #t + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (set-look-at-mode! self 2) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (f0-1 (* 4096.0 (rnd-float-range self 8.0 20.0))) + ) + (vector+float*! (-> self move-dest) (-> self root trans) gp-0 f0-1) + ) + (closest-point-on-mesh (-> self nav) (-> self move-dest) (-> self move-dest) (the-as nav-poly #f)) + (let ((a0-22 (-> self nav state)) + (v1-18 (-> self move-dest)) + ) + (logclear! (-> a0-22 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-22 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-22 target-pos quad) (-> v1-18 quad)) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (if (< (vector-vector-distance (-> self root trans) (-> self move-dest)) 8192.0) + (go-virtual active-turn) + ) + (ja-no-eval :group! rat-walk0-ja + :num! (seek! max (lerp-scale 0.0 1.0 (vector-length (-> self root transv)) 0.0 12288.0)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (lerp-scale 0.0 1.0 (vector-length (-> self root transv)) 0.0 12288.0))) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-travel-post) + ) + ) + +(defstate active-turn (rat) + :virtual #t + :parent (rat active) + :enter (behavior () + (local-vars (v1-20 symbol)) + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (set-look-at-mode! self 2) + (let ((gp-0 (-> self root trans))) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (until v1-20 + (+! f30-0 (* 182.04445 (rnd-float-range self 42.0 198.0))) + (vector-rotate-around-y! s4-0 s5-0 f30-0) + (vector+float*! s3-0 gp-0 s4-0 24576.0) + (closest-point-on-mesh (-> self nav) s2-0 s3-0 (the-as nav-poly #f)) + (set! v1-20 (or (>= 2048.0 (vector-vector-distance s2-0 s3-0)) (>= f30-0 65536.0))) + ) + (vector-rotate-around-y! (-> self face-dir) s5-0 f30-0) + ) + (vector+float*! (-> self move-dest) gp-0 (-> self face-dir) 24576.0) + ) + ) + :trans (behavior () + (let ((a0-0 (method-of-type nav-enemy active))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (if (enemy-method-103 self (-> self face-dir) 1820.4445) + (go-virtual active) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (until #f + (cond + ((< 0.0 (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle (-> self face-dir)))) + (ja-no-eval :group! rat-turn-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! rat-turn-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (seek-toward-heading-vec! + (-> self root) + (-> self face-dir) + (* 0.5 (-> self nav max-rotation-rate)) + (seconds 0.02) + ) + (nav-enemy-simple-post) + ) + ) + +(defstate notice (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (stop-look-at! self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (ja-no-eval :group! rat-walk-to-sit-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (seek-to-point-toward-point! + (-> self root) + (-> self focus-pos) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (ja-no-eval :group! rat-sit-to-alert-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (ja-no-eval :group! rat-sit-alert-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-no-eval :group! rat-sit-to-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + ) + +(defstate wait-by-wheel-seek (rat) + :virtual #t + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 8192.0) + (go-virtual wait-by-wheel-wait) + ) + ) + ) + :code rat-run-code + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'wait-pos) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-3 (-> self wheel-actor)) + ) + (if (not (t9-0 + (if v1-3 + (-> v1-3 extra process) + ) + a1-0 + ) + ) + (set! (-> gp-0 quad) (-> self wheel-actor extra trans quad)) + ) + ) + ) + (closest-point-on-mesh (-> self nav) (-> self move-dest) gp-0 (the-as nav-poly #f)) + ) + (let ((a0-7 (-> self nav state)) + (v1-11 (-> self move-dest)) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-11 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +(defstate wait-by-wheel-wait (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (nav-enemy-method-178 self) + (vector-reset! (-> self root transv)) + (set-look-at-mode! self 1) + ) + :code (behavior () + (until #f + (when (not (enemy-method-105 self 4551.1113 #t)) + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! rat-turn-left-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop!)) + ) + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-23 (ja-group))) + (if (not (and v1-23 (= v1-23 rat-idle-stand-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-stare-post + ) + +(defstate hostile (rat) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (and (< (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)) 20480.0) (get-focus! self)) + ) + (go-virtual attack) + ) + ) + :code rat-run-code + ) + +(defstate attack (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self scared-timer)) + (set! (-> self scared-interval) (seconds 3)) + ) + :exit (behavior () + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! rat-run0-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + (go-best-state self) + ) + :post nav-enemy-chase-post + ) + +(defstate flee (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy flee) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-look-at-mode! self 2) + ) + :code rat-run-code + ) + +(defstate flee-stare (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self flee-focus-pos quad) (-> self focus-pos quad)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 1)) + (if (and (handle->process (-> self focus handle)) + (< 12288.0 (vector-vector-distance (-> self flee-focus-pos) (-> self focus-pos))) + ) + (go-virtual flee) + ) + ) + ) + :code (behavior () + (until #f + (when (not (enemy-method-105 self 4551.1113 #t)) + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! rat-turn-left-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop!)) + ) + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-23 (ja-group))) + (if (not (and v1-23 (= v1-23 rat-idle-stand-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-face-focus-post + ) + +(defstate stare (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-look-at-mode! self 1) + ) + :code (behavior () + (until #f + (when (not (enemy-method-105 self 4551.1113 #t)) + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! rat-turn-left-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop!)) + ) + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-23 (ja-group))) + (if (not (and v1-23 (= v1-23 rat-idle-stand-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +(defstate knocked (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (if (nonzero? (-> self slide-sound-id)) + (sound-stop (the-as sound-id (-> self slide-sound-id))) + ) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate knocked-recover (rat) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self return-to-nav-mesh?) #t) + ) + :trans #f + :code (behavior () + (cond + ((handle->process (-> self ragdoll-proc)) + (vector-reset! (-> self root transv)) + (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (ja-channel-push! 1 0) + (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) + (let ((gp-0 (-> (the-as ragdoll-proc (-> self ragdoll-proc process 0)) ragdoll))) + (enable-ragdoll! gp-0 self) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> gp-0 ragdoll-joints))) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'inside?) + (let ((t9-5 send-event-function) + (v1-31 (-> self wheel-actor)) + ) + (when (t9-5 + (if v1-31 + (-> v1-31 extra process) + ) + a1-6 + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'claim-wheel?) + (let ((t9-6 send-event-function) + (v1-37 (-> self wheel-actor)) + ) + (if (t9-6 + (if v1-37 + (-> v1-37 extra process) + ) + a1-7 + ) + (go-virtual running-in-wheel) + (go-virtual die) + ) + ) + ) + ) + ) + ) + (let ((f30-0 0.12)) + (ja-channel-push! 1 (the-as time-frame (the int (* 300.0 f30-0)))) + (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-1 (new 'stack-no-clear 'quaternion)) + (f28-0 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 0.0 (* 300.0 f30-0))) + ) + (forward-up-nopitch->quaternion + gp-1 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + *y-vector* + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 f28-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! rat-on-back-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-virtual flee) + ) + ) + :post rat-falling-post + ) + +(defstate running-in-wheel (rat) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logclear! (-> self enemy-flags) (enemy-flag trackable)) + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (let ((gp-0 (-> self parent 0 child))) + (while gp-0 + (if (!= gp-0 self) + (send-event (ppointer->process gp-0) 'scared) + ) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (let ((v1-18 (-> self root root-prim))) + (logclear! (-> v1-18 prim-core action) (collide-action can-ride)) + (dotimes (a0-6 (the-as int (-> v1-18 specific 0))) + (logclear! (-> (the-as collide-shape-prim-group v1-18) child a0-6 prim-core action) (collide-action can-ride)) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self wheel-actor))) + (if (not (if v1-0 + (-> v1-0 extra process) + ) + ) + (go empty-state) + ) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 8)) + (< 204800.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + ) + (go-virtual wheel-die) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 2.0)) + (until #f + (ja-no-eval :group! rat-run-wheel0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'turn) + (let* ((t9-6 send-event-function) + (v1-41 (-> self wheel-actor)) + (a0-6 (if v1-41 + (-> v1-41 extra process) + ) + ) + ) + (t9-6 a0-6 a1-5) + ) + ) + (set! f30-0 (seek f30-0 1.5 (* 0.1 (seconds-per-frame)))) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'run-dir) + (set! (-> a1-0 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let* ((t9-0 send-event-function) + (v1-4 (-> self wheel-actor)) + (a1-1 (t9-0 + (if v1-4 + (-> v1-4 extra process) + ) + a1-0 + ) + ) + ) + (seek-toward-heading-vec! (-> self root) (the-as vector a1-1) (-> self nav max-rotation-rate) (seconds 0.02)) + ) + ) + (let ((gp-0 (-> self root)) + (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) 'run-pos) + (set! (-> a1-2 param 0) (the-as uint (-> gp-0 trans))) + (set! (-> a1-2 param 1) (the-as uint (new 'stack-no-clear 'vector))) + (let* ((t9-2 send-event-function) + (v1-14 (-> self wheel-actor)) + (s5-0 (t9-2 + (if v1-14 + (-> v1-14 extra process) + ) + a1-2 + ) + ) + (a1-3 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'run-up) + (set! (-> a1-3 param 0) (the-as uint (-> gp-0 trans))) + (set! (-> a1-3 param 1) (the-as uint (new 'stack-no-clear 'vector))) + (let* ((t9-3 send-event-function) + (v1-21 (-> self wheel-actor)) + (s4-0 (t9-3 + (if v1-21 + (-> v1-21 extra process) + ) + a1-3 + ) + ) + ) + (vector-seek! (-> gp-0 trans) (the-as vector s5-0) (* 10240.0 (seconds-per-frame))) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (forward-up-nopitch->quaternion + s5-1 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat)) + (the-as vector s4-0) + ) + (quaternion-slerp! (-> gp-0 quat) (-> gp-0 quat) s5-1 (* 4.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (transform-post) + ) + ) + +(defstate wheel-die (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> self enemy-flags) (enemy-flag attackable attackable-backup)) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> self focus-status) (focus-status dead)) + (if (-> self skel effect) + (logior! (-> self skel effect flags) (effect-control-flag ecf1)) + ) + (stop-look-at! self) + (let ((v1-24 (-> self root root-prim))) + (set! (-> v1-24 prim-core collide-as) (collide-spec)) + (set! (-> v1-24 prim-core collide-with) (collide-spec)) + ) + 0 + (set-time! (-> self state-time)) + (send-event (ppointer->process (-> self parent)) 'die) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! rat-run-wheel0-die-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event self 'death-end) + (cleanup-for-death self) + ) + :post nav-enemy-simple-post + ) + +;; WARN: Return type mismatch vector vs none. +(defun rat-joint-mod-roll ((arg0 cspace) (arg1 transformq)) + (let ((gp-0 (-> arg0 param1))) + (cspace<-parented-transformq-joint! arg0 arg1) + (vector+! + (-> arg0 bone transform trans) + (-> arg0 bone transform trans) + (the-as vector (-> (the-as rat gp-0) roll-transform)) + ) + ) + (none) + ) + +(defmethod enemy-method-108 ((this rat) (arg0 process-focusable)) + (or (not (time-elapsed? (-> this scared-timer) (-> this scared-interval))) (-> this permanently-scared)) + ) + +(defmethod enemy-method-109 ((this rat)) + (with-pp + (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) 'near?) + (let ((t9-0 send-event-function) + (v1-2 (-> this wheel-actor)) + ) + (when (not (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + (let ((s5-0 (-> this root)) + (gp-0 (new 'stack-no-clear 'vector)) + (v1-6 (-> this nav state)) + ) + (new 'stack-no-clear 'vector) + (or (not (closest-point-on-mesh (-> v1-6 nav) gp-0 (-> s5-0 trans) (the-as nav-poly #f))) + (< 24576.0 (vector-vector-xz-distance (-> s5-0 trans) gp-0)) + (< (-> s5-0 trans y) (+ -16384.0 (-> gp-0 y))) + ) + ) + ) + ) + ) + ) + ) + +(defmethod within-gspot-range? ((this rat)) + (with-pp + (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) 'near?) + (let ((t9-0 send-event-function) + (v1-2 (-> this wheel-actor)) + ) + (if (not (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ((method-of-type nav-enemy within-gspot-range?) this) + ) + ) + ) + ) + ) + +(defmethod ragdoll-settled? ((this rat)) + (with-pp + (and (or (time-elapsed? (-> this state-time) (seconds 3)) (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) 'inside?) + (let ((t9-0 send-event-function) + (v1-6 (-> this wheel-actor)) + ) + (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-0 + ) + ) + ) + ) + (call-parent-method this) + ) + ) + ) + +;; WARN: Return type mismatch float vs object. +(defmethod knocked-handler ((this rat) (arg0 vector)) + (get-knockback-dir! this arg0) + (let ((f30-0 (rnd-float-range this 0.9 1.0))) + (let ((f0-0 0.0) + (f1-0 98304.0) + ) + (vector-float*! arg0 arg0 (lerp f0-0 f1-0 f30-0)) + ) + (set! (-> arg0 y) (lerp 0.0 73728.0 f30-0)) + ) + ) + +(defmethod enemy-method-63 ((this rat) (arg0 float)) + (if (= (-> this hit-points) (-> this enemy-info default-hit-points)) + 1.0 + 0.0 + ) + ) + +;; WARN: Return type mismatch int vs knocked-type. +(defmethod penetrate->knocked-type ((this rat) (arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + 3 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + (else + 0 + ) + ) + ) + ) + +(defmethod go-hostile ((this rat)) + (if (logtest? (-> this fact enemy-options) (enemy-option user8)) + (go (method-of-object this wait-by-wheel-seek)) + (go (method-of-object this hostile)) + ) + ) + +(defmethod coin-flip? ((this rat)) + #f + ) + +(defmethod enemy-common-post ((this rat)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (if a0-2 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + ) + ) + (when (-> this return-to-nav-mesh?) + (format *stdebug* "~s ~d off nav-mesh~%" (-> this name) (-> this pid)) + (when (enemy-method-109 this) + (set! (-> this return-to-nav-mesh?) #f) + (go-die this) + ) + (let ((s5-2 (new 'stack-no-clear 'vector)) + (s4-0 (-> this root)) + ) + (if (and (closest-point-on-mesh (-> this nav state nav) s5-2 (-> s4-0 trans) (the-as nav-poly #f)) + (< (vector-vector-xz-distance (-> s4-0 trans) s5-2) 409.6) + (< (fabs (- (-> s4-0 trans y) (-> s5-2 y))) 8192.0) + ) + (set! (-> this return-to-nav-mesh?) #f) + ) + ) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +(defmethod enemy-method-50 ((this rat) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-8 prim-core action) (collide-action)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this rat)) + (the-as search-info-flag 8) + ) + +(defmethod event-handler ((this rat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-5 object)) + (case arg2 + (('hit 'hit-knocked 'hit-flinch) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + #t + ) + (('rat?) + #t + ) + (('scared) + (set! v0-5 #t) + (set! (-> this permanently-scared) (the-as symbol v0-5)) + v0-5 + ) + (('trans) + (set! v0-5 (-> arg3 param 0)) + (set! (-> (the-as vector v0-5) quad) (-> this root trans quad)) + v0-5 + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod deactivate ((this rat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this slide-sound-id)) + (sound-stop (the-as sound-id (-> this slide-sound-id))) + ) + (call-parent-method this) + (none) + ) + +(defmethod init-enemy! ((this rat)) + (with-pp + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-rat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *rat-nav-enemy-info*) + (let ((v1-5 (-> this neck))) + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-5 ignore-angle) 30947.555) + ) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this slide-sound-id) (the-as uint (new-sound-id))) + (set! (-> this wheel-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (.svf (&-> (-> this roll-transform) trans quad) vf0) + (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) 'running?) + (let ((t9-6 send-event-function) + (v1-11 (-> this wheel-actor)) + ) + (set! (-> this permanently-scared) (the-as symbol (t9-6 + (if v1-11 + (-> v1-11 extra process) + ) + a1-8 + ) + ) + ) + ) + ) + (set! (-> this scared-timer) 0) + (set! (-> this scared-interval) 0) + (set! (-> this return-to-nav-mesh?) #f) + 0 + (none) + ) + ) + ) + +(deftype rat-spawner (process) + ((rats-spawned uint32) + (wheel-entity entity-actor) + (state-time time-frame) + (active? symbol) + (rats-to-spawn uint32) + (actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + die + ) + ) + + +(defstate idle (rat-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + (('child-die) + (let ((v0-0 (the-as object (max 0 (the-as int (+ (-> self rats-spawned) -1)))))) + (set! (-> self rats-spawned) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self active?) #f) + ) + :code sleep-code + :post (behavior () + (local-vars (v1-19 symbol) (v1-37 symbol)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.5)) + (< (-> self rats-spawned) (-> self rats-to-spawn)) + (or (-> self active?) (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 163840.0)) + ) + (set! (-> self active?) #t) + (if (logtest? (-> self wheel-entity extra perm status) (entity-perm-status subtask-complete)) + (go-virtual die) + ) + (dotimes (v1-18 (-> self actor-group-count)) + (dotimes (a0-6 (-> self actor-group v1-18 length)) + (let ((a1-4 (-> self actor-group v1-18 data a0-6 actor))) + (when (if a1-4 + (-> a1-4 extra process) + ) + (set! v1-19 #f) + (goto cfg-23) + ) + ) + ) + ) + (set! v1-19 #t) + (label cfg-23) + (when (and v1-19 + (begin + (let ((gp-1 (-> self entity extra trans)) + (s5-1 (-> self child)) + ) + (while s5-1 + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 1) + (set! (-> a1-11 message) 'trans) + (set! (-> a1-11 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let ((s4-0 (the-as vector (send-event-function (ppointer->process s5-1) a1-11)))) + (when (and s4-0 (< (vector-vector-xz-distance gp-1 s4-0) 40960.0) (< (fabs (- (-> s4-0 y) (-> gp-1 y))) 16384.0)) + (set! v1-37 #t) + (goto cfg-44) + ) + ) + ) + (set! s5-1 (-> s5-1 0 brother)) + ) + ) + (set! v1-37 #f) + (label cfg-44) + (not v1-37) + ) + ) + (let ((s5-2 (-> self entity)) + (gp-2 (new 'stack-no-clear 'enemy-init-by-other-params)) + ) + (set! (-> gp-2 trans quad) (-> s5-2 extra trans quad)) + (quaternion-copy! (-> gp-2 quat) (-> s5-2 quat)) + (set! (-> gp-2 entity) s5-2) + (set! (-> gp-2 directed?) #f) + (set! (-> gp-2 no-initial-move-to-ground?) #f) + (set! (-> gp-2 art-level) #f) + (let ((s5-3 (get-process *default-dead-pool* rat #x4000 1))) + (if (ppointer->handle (when s5-3 + (let ((t9-7 (method-of-type process activate))) + (t9-7 s5-3 self "rat" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-3 enemy-init-by-other self gp-2) + (-> s5-3 ppointer) + ) + ) + (+! (-> self rats-spawned) 1) + ) + ) + ) + ) + (set-time! (-> self state-time)) + ) + ) + ) + +(defstate die (rat-spawner) + :virtual #t + :enter (behavior () + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (while (-> self child) + (suspend) + ) + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +(defmethod init-from-entity! ((this rat-spawner) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! (-> this wheel-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this rats-spawned) (the-as uint 0)) + (set! (-> this rats-to-spawn) + (res-lump-value (-> this entity) 'extra-id uint :default (the-as uint128 1) :time -1000000000.0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-2)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (if (logtest? (-> arg0 extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this die)) + (go (method-of-object this idle)) + ) + ) diff --git a/goal_src/jak3/levels/sewer/jump-pad.gc b/goal_src/jak3/levels/sewer/jump-pad.gc index c98b6b4254..2996542cc3 100644 --- a/goal_src/jak3/levels/sewer/jump-pad.gc +++ b/goal_src/jak3/levels/sewer/jump-pad.gc @@ -7,3 +7,147 @@ ;; DECOMP BEGINS +(deftype jump-pad (bouncer) + ((fan-quat quaternion :inline) + (rot-vel float) + (fan-loop-sound-id sound-id) + (fan-loop-sound sound-spec) + (jump-sound sound-spec) + ) + (:methods + (get-skel (_type_) art-group) + (get-fan-joint-idx (_type_) int) + (init-sounds (_type_) none) + ) + ) + + +(defstate idle (jump-pad) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual fire) + ) + (('attack) + (let ((v1-3 (the-as object (-> block param 1))) + (a0-3 (-> block param 0)) + (a2-1 0) + ) + 0.0 + (let ((f30-0 (-> self spring-height))) + (cond + ((= (-> (the-as attack-info v1-3) mode) 'flop) + (set! a2-1 1) + ) + ((= (-> (the-as attack-info v1-3) mode) 'board) + (set! a2-1 9) + ) + ) + (when (and (nonzero? a2-1) (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry a0-3) + (-> self root) + (the-as uint a2-1) + ) + (send-event proc 'jump f30-0 f30-0 (-> self mods)) + ) + ) + (sound-play "trampoline") + (go-virtual fire) + #f + ) + ) + ) + ) + (else + ((-> (method-of-type bouncer idle) event) proc argc message block) + ) + ) + ) + :trans (behavior () + (seek! (-> self rot-vel) 10922.667 (* 21845.334 (seconds-per-frame))) + ) + :code (behavior () + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) + (transform-post) + (sleep-code) + ) + :post (behavior () + (when (-> self fan-loop-sound) + (set! (-> self fan-loop-sound pitch-mod) + (the int (* 1524.0 (lerp-scale -0.9 0.6 (-> self rot-vel) 10922.667 87381.336))) + ) + (sound-play-by-spec (-> self fan-loop-sound) (-> self fan-loop-sound-id) (-> self root trans)) + ) + (ja-post) + ) + ) + +(defstate fire (jump-pad) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (seek! (-> self rot-vel) 87381.336 (* 87381.336 (seconds-per-frame))) + ) + :code (behavior () + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + (if (-> self jump-sound) + (sound-play-by-spec (-> self jump-sound) (new-sound-id) (the-as vector #t)) + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + (go-virtual idle) + ) + :post (behavior () + (when (-> self fan-loop-sound) + (set! (-> self fan-loop-sound pitch-mod) + (the int (* 1524.0 (lerp-scale -0.9 0.6 (-> self rot-vel) 10922.667 87381.336))) + ) + (sound-play-by-spec (-> self fan-loop-sound) (-> self fan-loop-sound-id) (-> self root trans)) + ) + (let ((t9-2 (-> (method-of-type bouncer fire) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +(defun jump-pad-joint-fan ((arg0 cspace) (arg1 quaternion)) + (let ((gp-0 (-> arg0 param1))) + (quaternion-rotate-local-y! + (-> (the-as jump-pad gp-0) fan-quat) + (-> (the-as jump-pad gp-0) fan-quat) + (* (-> (the-as jump-pad gp-0) rot-vel) (seconds-per-frame)) + ) + (quaternion-copy! (&+ arg1 16) (-> (the-as jump-pad gp-0) fan-quat)) + ) + (cspace<-parented-transformq-joint! arg0 (the-as transformq arg1)) + 0 + (none) + ) + +(defmethod bouncer-method-23 ((this jump-pad)) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (quaternion-copy! (-> this fan-quat) (-> this root quat)) + (let ((a0-6 (-> this node-list data (get-fan-joint-idx this)))) + (set! (-> a0-6 param0) (the-as (function cspace transformq none) jump-pad-joint-fan)) + (set! (-> a0-6 param1) this) + (set! (-> a0-6 param2) (the-as basic 0)) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this jump-pad) (arg0 entity-actor)) + (set! (-> this fan-loop-sound) #f) + (set! (-> this jump-sound) #f) + (init-sounds this) + (if (-> this fan-loop-sound) + (set! (-> this fan-loop-sound-id) (new-sound-id)) + ) + (call-parent-method this arg0) + ) diff --git a/goal_src/jak3/levels/sewer/kg-hopper.gc b/goal_src/jak3/levels/sewer/kg-hopper.gc index 5a7f1ede39..45c915d87d 100644 --- a/goal_src/jak3/levels/sewer/kg-hopper.gc +++ b/goal_src/jak3/levels/sewer/kg-hopper.gc @@ -7,3 +7,1091 @@ ;; DECOMP BEGINS +(deftype kg-hopper (nav-enemy) + ((speed-y float) + (accel-y float) + (next-jump-time int32) + (path-intro path-control) + (can-go-knocked? symbol) + (land-anim-index int32) + (step-num int32) + (best-point vector :inline) + (best-score float) + (origin vector :inline) + (direction vector :inline) + (jump-dist float) + (side float) + (jump-start-anim uint32) + (jump-air-anim uint32) + (jump-land-anim uint32) + (jump-height-min float) + (jump-anim-start-frame float) + (minimap connection-minimap) + ) + (:state-methods + explode + ) + (:methods + (kg-hopper-method-191 (_type_) symbol) + (kg-hopper-method-192 () none) + (get-skel (_type_) art-group) + ) + ) + + +(defskelgroup skel-kg-hopper kg-hopper kg-hopper-lod0-jg kg-hopper-idle-ja + ((kg-hopper-lod0-mg (meters 20)) (kg-hopper-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 3.5) + :shadow kg-hopper-shadow-mg + ) + +(define *kg-hopper-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-kg-debris-d") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +(deftype kg-hopper-anim-info (structure) + ((hit-anim-index int32) + (land-anim-index int32) + ) + :pack-me + ) + + +(deftype kg-hopper-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (yellow-hit-anim kg-hopper-anim-info 3 :inline) + (blue-hit-anim kg-hopper-anim-info 3 :inline) + ) + ) + + +(define *kg-hopper-global-info* (new 'static 'kg-hopper-global-info + :yellow-hit-anim (new 'static 'inline-array kg-hopper-anim-info 3 + (new 'static 'kg-hopper-anim-info :hit-anim-index 25 :land-anim-index 26) + (new 'static 'kg-hopper-anim-info :hit-anim-index 27 :land-anim-index 28) + (new 'static 'kg-hopper-anim-info :hit-anim-index 29 :land-anim-index 30) + ) + :blue-hit-anim (new 'static 'inline-array kg-hopper-anim-info 3 + (new 'static 'kg-hopper-anim-info :hit-anim-index 21 :land-anim-index 24) + (new 'static 'kg-hopper-anim-info :hit-anim-index 22 :land-anim-index 24) + (new 'static 'kg-hopper-anim-info :hit-anim-index 23 :land-anim-index 24) + ) + ) + ) + +(defmethod knocked-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let* ((a2-0 (ash 1 (-> *kg-hopper-global-info* prev-blue-hit))) + (v1-3 (enemy-method-131 this 3 a2-0)) + (a1-5 (-> this draw art-group data (-> *kg-hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) + ) + (set! (-> *kg-hopper-global-info* prev-blue-hit) v1-3) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim a1-5)) + (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim a1-5) frames num-frames) -1))) + (set! (-> a0-12 param 1) 1.0) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! a0-12 (the-as art-joint-anim a1-5) num-func-seek!) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let* ((a2-2 (ash 1 (-> *kg-hopper-global-info* prev-yellow-hit))) + (v1-13 (enemy-method-131 this 3 a2-2)) + (a1-11 (-> this draw art-group data (-> *kg-hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) + ) + (set! (-> this land-anim-index) (-> *kg-hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) + (set! (-> *kg-hopper-global-info* prev-yellow-hit) v1-13) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11)) + (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) + (set! (-> a0-27 param 1) (-> arg0 anim-speed)) + (set! (-> a0-27 frame-num) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim a1-11) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index)))) + (set! (-> a0-3 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) frames num-frames) -1) + ) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! + a0-3 + (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) + num-func-seek! + ) + ) + #t + ) + ) + ) + +(define *kg-hopper-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 5 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 5 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 5 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 7 + :hostile-anim 4 + :hit-anim 4 + :knocked-anim 25 + :knocked-land-anim 26 + :die-anim 19 + :die-falling-anim 20 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "kg-impact") + :sound-die (static-sound-name "kg-explo") + :notice-distance (meters 40) + :notice-distance-delta (meters 40) + :proximity-notice-distance (meters 4) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 4551.1113 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim 9 + :run-anim 13 + :taunt-anim -1 + :run-travel-speed (meters 1) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 1) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 2) + :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! (-> *kg-hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod go-die ((this kg-hopper)) + (go (method-of-object this explode)) + ) + +(defstate explode (kg-hopper) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "kg-explo") + ) + :code (behavior () + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-1 hit-xz-reaction) 0.95) + (set! (-> a1-1 hit-y-reaction) 0.6) + (set! (-> a1-1 scale-rand-lo) 0.5) + (set! (-> a1-1 scale-rand-hi) 1.2) + (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (debris-spawn self a1-1 *kg-hopper-debris-params* (the-as process-drawable #f)) + ) + (let ((v1-8 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-hopper-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 221)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 221)) + ) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defmethod event-handler ((this kg-hopper) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (= (-> this hit-points) 0.0) + (go (method-of-object this explode)) + (go (method-of-object this knocked)) + ) + #t + ) + (('death-start) + (set! (-> this draw death-timer) (the-as uint 0)) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod jump-anim-handler ((this kg-hopper) (arg0 int) (arg1 enemy-jump-info)) + (when (= (-> this jump-why) 2) + (cond + ((zero? arg0) + (logior! (-> this focus-status) (focus-status touch-water under-water)) + ) + (else + (when (focus-test? this touch-water) + (let ((s3-0 (new 'stack-no-clear 'water-info))) + (water-info-init! (-> this root) s3-0 (collide-action solid semi-solid)) + (let ((v1-7 #f)) + (cond + ((not (logtest? (water-flag touch-water) (-> s3-0 flags))) + (if (focus-test? this under-water) + (set! v1-7 #t) + ) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) + ) + ((focus-test? this under-water) + (let ((f0-1 (+ 11264.0 (-> this root trans y)))) + (if (< (-> s3-0 trans y) f0-1) + (set! v1-7 #t) + ) + ) + ) + ) + (when v1-7 + (logclear! (-> this focus-status) (focus-status under-water)) + (let ((v1-10 (new 'stack-no-clear 'vector))) + (set! (-> v1-10 quad) (-> this root trans quad)) + (when (logtest? (water-flag touch-water) (-> s3-0 flags)) + (set! (-> v1-10 y) (-> s3-0 trans y)) + (cond + ((logtest? (-> *part-group-id-table* 192 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 192)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 192)) + ) + ) + (sound-play "splash-out") + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((method-of-type nav-enemy jump-anim-handler) this arg0 arg1) + ) + +(defmethod jump-wind-up-anim ((this kg-hopper) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +(defmethod jump-in-air-anim ((this kg-hopper) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +(defmethod jump-land-anim ((this kg-hopper) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.075)) + (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +(defstate jump (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self draw shadow-ctrl))) + (logclear! (-> v1-5 settings flags) (shadow-flags shdf03)) + (let ((a0-2 v1-5)) + (set! (-> a0-2 settings top-plane w) (- 4096.0)) + ) + 0 + (set! (-> v1-5 settings bot-plane w) (- -4096.0)) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self draw shadow-ctrl))) + (logior! (-> v1-5 settings flags) (shadow-flags shdf03)) + (let ((a0-2 v1-5)) + (set! (-> a0-2 settings bot-plane w) (- (+ (- -4096.0 (-> self root trans y)) (-> self root gspot-pos y)))) + ) + 0 + (set! (-> v1-5 settings top-plane w) (- (+ (- 8192.0 (-> self root trans y)) (-> self root gspot-pos y)))) + ) + 0 + ) + ) + +(defmethod kg-hopper-method-191 ((this kg-hopper)) + (local-vars (sv-752 collide-query)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (+! (-> this step-num) -1) + (cond + ((>= (-> this step-num) 0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-rotate-around-y! + s3-0 + (-> this direction) + (* 182.04445 (the float (+ (* (-> this step-num) 16) -135))) + ) + (let ((a1-1 s5-0)) + (let ((v1-7 (-> this origin))) + (let ((a0-2 s3-0)) + (let ((a2-1 (-> this jump-dist))) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-7 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-1 quad) vf6) + ) + (let ((v1-8 (-> this nav)) + (a0-3 s5-0) + (a1-2 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-2 vertex)) a0-3 (the-as vector (-> v1-8 state mesh bounds))) + (set! (-> a1-2 vertex1 x) (-> v1-8 nearest-y-threshold)) + (set! (-> a1-2 data 20) (the-as uint 2)) + (let ((s4-0 (nav-mesh-method-45 (-> v1-8 state mesh) a1-2))) + (when s4-0 + (let ((f30-0 (vector-dot s3-0 (-> this direction)))) + (new 'stack-no-clear 'vector) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 quad) (-> s5-0 quad)) + (set! (-> a1-3 w) 6144.0) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x10006c)) + (when (< (-> this best-score) f30-0) + (set! (-> this best-score) f30-0) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! sv-752 (new 'stack-no-clear 'collide-query)) + (let ((s3-1 (new 'stack 'collide-query))) + (let ((s0-0 (-> this nav)) + (s1-0 s2-0) + ) + (let* ((v1-21 s5-0) + (a0-10 (-> s0-0 state mesh)) + (t9-4 (method-of-object a0-10 project-point-onto-plane-of-poly-local)) + (a2-5 s1-0) + (t0-1 (vector-! (new 'stack-no-clear 'vector) v1-21 (the-as vector (-> s0-0 state mesh bounds)))) + ) + (t9-4 a0-10 s4-0 a2-5 (the-as vector sv-752) t0-1) + ) + (vector+! s1-0 s1-0 (the-as vector (-> s0-0 state mesh bounds))) + ) + 0 + (set! (-> s5-0 y) (-> s2-0 y)) + (if (enemy-above-ground? this s3-1 s5-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> s5-0 y) (-> s3-1 best-other-tri intersect y)) + ) + ) + ) + (set! (-> this best-point quad) (-> s5-0 quad)) + ) + ) + ) + ) + ) + ) + ) + ) + #t + ) + (else + #f + ) + ) + ) + ) + +(defstate stare (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-184 self) + ) + ) + +(define *kg-hopper-next-jump-time* (the-as time-frame 0)) + +(defstate hostile (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-182 self) + (nav-enemy-method-183 self) + (set! (-> self speed-y) 0.0) + (set! (-> self accel-y) 0.0) + (set! (-> self next-jump-time) (the-as int (+ (current-time) (set-reaction-time! self 0 (seconds 0.4))))) + (set! (-> self step-num) 0) + (set! (-> self best-score) -2.0) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (< *kg-hopper-next-jump-time* (current-time)) + (let ((gp-0 (handle->process (-> self focus handle)))) + (when gp-0 + (let ((s4-1 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) + ) + ) + 0.0 + (let ((s5-0 (rnd-int self 2))) + (set! (-> self direction y) 0.0) + (let* ((v1-12 s4-1) + (f30-0 (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) + ) + (set! (-> self step-num) 16) + (set! (-> self direction quad) (-> s4-1 quad)) + 0.0 + (let ((s4-2 (new 'stack-no-clear 'vector)) + (f28-0 (if (zero? s5-0) + (rnd-float-range self 4096.0 8192.0) + (rnd-float-range self 8192.0 (fmin 40960.0 (fmax 16384.0 (* 0.5 f30-0)))) + ) + ) + ) + (vector-rotate90-around-y! s4-2 (-> self direction)) + (vector-normalize! (-> self direction) 1.0) + (if (< (+ -2048.0 f30-0) f28-0) + (set! f28-0 (+ -2048.0 f30-0)) + ) + (if (< f28-0 6144.0) + (set! s5-0 0) + ) + (set! (-> self jump-dist) f28-0) + ) + ) + (set! (-> self best-score) -2.0) + (set! (-> self origin quad) (-> self root trans quad)) + ;; og:preserve-this + ;; (b! #t cfg-17) + (until (not (kg-hopper-method-191 self)) + (empty) + ) + (when (!= (-> self best-score) -2.0) + (let* ((s4-4 (vector-! (new 'stack-no-clear 'vector) (-> self best-point) (-> self root trans))) + (f30-1 (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle s4-4))) + ) + (cond + ((< (vector-vector-xz-distance (-> self best-point) (get-trans (the-as process-focusable gp-0) 0)) 8192.0) + (when (get-focus! self) + (cond + ((zero? s5-0) + (set! (-> self jump-start-anim) (the-as uint 34)) + (set! (-> self jump-air-anim) (the-as uint 35)) + (set! (-> self jump-land-anim) (the-as uint 36)) + (set! (-> self jump-height-min) 4096.0) + (set! (-> self jump-anim-start-frame) 2.0) + ) + (else + (if (< 2730.6667 (fabs f30-1)) + (set! (-> self jump-start-anim) (the-as uint (if (< 0.0 f30-1) + 11 + 12 + ) + ) + ) + (set! (-> self jump-start-anim) (the-as uint 10)) + ) + (cond + ((zero? (rnd-int self 2)) + (set! (-> self jump-air-anim) (the-as uint 15)) + (set! (-> self jump-land-anim) (the-as uint 16)) + (set! (-> self jump-height-min) 12288.0) + (set! (-> self jump-anim-start-frame) 8.0) + ) + (else + (set! (-> self jump-air-anim) (the-as uint 17)) + (set! (-> self jump-land-anim) (the-as uint 18)) + (set! (-> self jump-height-min) 12288.0) + (set! (-> self jump-anim-start-frame) 8.0) + ) + ) + ) + ) + (set! *kg-hopper-next-jump-time* (+ (current-time) (set-reaction-time! self (seconds 0.015) (seconds 0.075)))) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 0 (-> self best-point)) + ) + ) + (else + (cond + ((zero? s5-0) + (set! (-> self jump-start-anim) (the-as uint 31)) + (set! (-> self jump-air-anim) (the-as uint 32)) + (set! (-> self jump-land-anim) (the-as uint 33)) + (set! (-> self jump-height-min) 4096.0) + (set! (-> self jump-anim-start-frame) 2.0) + ) + (else + (if (< 2730.6667 (fabs f30-1)) + (set! (-> self jump-start-anim) (the-as uint (if (< 0.0 f30-1) + 11 + 12 + ) + ) + ) + (set! (-> self jump-start-anim) (the-as uint 10)) + ) + (set! (-> self jump-air-anim) (the-as uint 13)) + (set! (-> self jump-land-anim) (the-as uint 14)) + (set! (-> self jump-height-min) 12288.0) + (set! (-> self jump-anim-start-frame) 8.0) + ) + ) + (set! *kg-hopper-next-jump-time* (+ (current-time) (set-reaction-time! self (seconds 0.015) (seconds 0.075)))) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 0 (-> self best-point)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :post nav-enemy-simple-post + ) + +(defstate active (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (nav-enemy-method-164 self) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (let ((a2-0 (-> self nav state))) + (set! (-> v1-2 quad) (-> a2-0 target-pos quad)) + ) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 2 v1-2) + ) + ) + :post nav-enemy-simple-post + ) + +(defstate notice (kg-hopper) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (if (zero? (rnd-int self 2)) + (ja :group! kg-hopper-notice-ja) + (ja :group! kg-hopper-notice-alt-ja) + ) + (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-4 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-4 travel quad)) + ) + (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +(defstate ambush (kg-hopper) + :virtual #t + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let ((v1-12 (-> self root root-prim))) + (set! (-> self root backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> self root backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (let ((v1-15 (-> self root root-prim))) + (set! (-> v1-15 prim-core collide-as) (collide-spec)) + (set! (-> v1-15 prim-core collide-with) (collide-spec)) + ) + 0 + (when (handle->process (-> self focus handle)) + (let ((gp-1 (-> self root)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + (get-point-in-path! (-> self path-intro) s5-0 0.0 'exact) + (+! (-> s5-0 y) -16384.0) + (get-point-in-path! (-> self path-intro) s4-0 1.0 'exact) + (let ((f0-3 (deg-diff + (quaternion-y-angle (-> gp-1 quat)) + (vector-y-angle (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0) 1.0)) + ) + ) + ) + (quaternion-rotate-y! (-> gp-1 quat) (-> gp-1 quat) f0-3) + ) + ) + (set! (-> gp-1 trans quad) (-> s5-0 quad)) + ) + ) + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (new 'stack 'collide-query))) + (get-point-in-path! (-> self path-intro) gp-0 1.0 'exact) + (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) + ) + ) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 2 gp-0) + ) + (go-virtual hostile) + ) + ) + +(defmethod on-dying ((this kg-hopper)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + (call-parent-method this) + (none) + ) + +(defmethod relocate ((this kg-hopper) (offset int)) + (if (nonzero? (-> this path-intro)) + (&+! (-> this path-intro) offset) + ) + (call-parent-method this offset) + ) + +(defmethod init-enemy-collision! ((this kg-hopper)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> s4-0 transform-index) 12) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 9216.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 3686.4 0.0 3686.4) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action deadly)) + (set! (-> v1-16 transform-index) 5) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 819.2 3276.8) + ) + (set! (-> s5-0 nav-radius) 4096.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod get-skel ((this kg-hopper)) + (art-group-get-by-name *level* "skel-kg-hopper" (the-as (pointer level) #f)) + ) + +(defmethod init-enemy! ((this kg-hopper)) + (stack-size-set! (-> this main-thread) 256) + (logior! (-> this mask) (process-mask kg-robot)) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-defaults! this *kg-hopper-nav-enemy-info*) + (set! (-> this can-go-knocked?) #t) + (let ((v1-11 (-> this neck))) + (set! (-> v1-11 up) (the-as uint 1)) + (set! (-> v1-11 nose) (the-as uint 2)) + (set! (-> v1-11 ear) (the-as uint 0)) + (set-vector! (-> v1-11 twist-max) 10922.667 12743.111 0.0 1.0) + (set! (-> v1-11 ignore-angle) 18204.445) + ) + (set! (-> this jump-start-anim) (the-as uint 10)) + (set! (-> this jump-air-anim) (the-as uint 13)) + (set! (-> this jump-land-anim) (the-as uint 14)) + (set! (-> this jump-height-min) 12288.0) + (set! (-> this jump-anim-start-frame) 8.0) + (set! (-> this land-anim-index) 26) + (set! (-> this side) (rnd-float-range this -1.5 1.5)) + (when (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (if (-> this path-intro) + (logior! (-> this path-intro flags) (path-control-flag display draw-line draw-point draw-text)) + ) + ) + (logior! (-> this nav flags) (nav-control-flag output-sphere-hash)) + (let ((v1-32 (-> this nav))) + (set! (-> v1-32 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 327680.0) + (let ((v1-37 (-> this nav))) + (set! (-> v1-37 nav-cull-radius) 61440.0) + ) + 0 + (set! (-> this fact pickup-type) (pickup-type ammo-light-random)) + (set! (-> this fact pickup-amount) 5.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/sewer/neo-grenadier.gc b/goal_src/jak3/levels/sewer/neo-grenadier.gc index db25b5589e..19740a1327 100644 --- a/goal_src/jak3/levels/sewer/neo-grenadier.gc +++ b/goal_src/jak3/levels/sewer/neo-grenadier.gc @@ -5,5 +5,1401 @@ ;; name in dgo: neo-grenadier ;; dgos: SEA +;; +++grenadier-status-flag +(defenum grenadier-status-flag + :type uint64 + :bitfield #t + (gsf0 0) + (gsf1 1) + (gsf2 2) + (gsf3 3) + ) +;; ---grenadier-status-flag + + ;; DECOMP BEGINS +(defpartgroup group-neo-grenadier-drip + :id 1523 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5001 :fade-after (meters 140) :falloff-to (meters 140))) + ) + +(defpart 5002 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.6) (meters 0.2)) + (:scale-y (meters 0.4) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:scalevel-x (meters -0.0026666666) (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.73333335) + (:fade-g -3.4) + (:fade-b -0.73333335) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.25)) + (:next-launcher 882) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.35)) + ) + ) + +(defskelgroup skel-neo-grenadier neo-grenadier neo-grenadier-lod0-jg -1 + ((neo-grenadier-lod0-mg (meters 20)) + (neo-grenadier-lod1-mg (meters 40)) + (neo-grenadier-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 5) + :shadow neo-grenadier-shadow-mg + :origin-joint-index 4 + ) + +(deftype bank-info (structure) + ((circle sphere :inline) + (tangent-pos vector :inline) + (final-pos vector :inline) + (final-dir vector :inline) + ) + ) + + +(deftype neo-grenadier (nav-enemy) + ((shot-trajectory trajectory :inline) + (hostile-path path-control) + (bank bank-info :inline) + (joint joint-mod-blend-world) + (heading symbol) + (move-pos vector :inline) + (move-angle float) + (status-flags grenadier-status-flag) + (suppress-knockaside-timer time-frame) + ) + (:state-methods + attack + backup + spin-kick + ) + (:methods + (neo-grenadier-method-193 (_type_) none) + (set-bank-info! (_type_ vector) none) + (neo-grenadier-method-195 (_type_) none) + ) + ) + + +(define *fact-info-neo-grenadier-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +(define *neo-grenadier-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #t + :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 'inline-array idle-control-frame 17 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 4 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 4 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 4 + :param1 8 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 11 + :hostile-anim 13 + :hit-anim 23 + :knocked-anim 31 + :knocked-land-anim 32 + :die-anim 33 + :die-falling-anim 34 + :victory-anim 22 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 24 + :look-at-joint 24 + :bullseye-joint 18 + :sound-hit (static-sound-name "grenadier-hit") + :sound-die (static-sound-name "grenadier-die") + :notice-distance (meters 80) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 14.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 0.18204445 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 24 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 1802.24 :z 286.72 :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 9 + :turn-anim -1 + :run-anim 13 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 80) + :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! (-> *neo-grenadier-nav-enemy-info* fact-defaults) *fact-info-neo-grenadier-defaults*) + +(defmethod event-handler ((this neo-grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit-knocked) + (when (= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (if (and (not (time-elapsed? (-> this suppress-knockaside-timer) (seconds 0.6))) + (and (-> this next-state) (= (-> this next-state name) 'attack)) + (!= (-> this hit-points) 0.0) + ) + (return #t) + ) + (logior! (-> this status-flags) (grenadier-status-flag gsf0)) + (set-time! (-> this suppress-knockaside-timer)) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('notify) + (cond + ((and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) + (let ((v1-22 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-22 from) (process->ppointer arg0)) + (set! (-> v1-22 num-params) arg1) + (set! (-> v1-22 message) 'victory) + (set! (-> v1-22 param 0) (-> arg3 param 0)) + (set! (-> v1-22 param 1) (-> arg3 param 1)) + (set! (-> v1-22 param 2) (-> arg3 param 2)) + (set! (-> v1-22 param 3) (-> arg3 param 3)) + (set! (-> v1-22 param 4) (-> arg3 param 4)) + (set! (-> v1-22 param 5) (-> arg3 param 5)) + (send-event-function this v1-22) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defun pos-rotate-y<-vector+vector ((arg0 vector) (arg1 vector)) + (let ((f0-0 (rotate-y<-vector+vector arg0 arg1))) + (if (< f0-0 0.0) + (+ 65536.0 f0-0) + f0-0 + ) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod set-bank-info! ((this neo-grenadier) (arg0 vector)) + (closest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) + (set! (-> this bank final-pos quad) (-> arg0 quad)) + (set! (-> this bank tangent-pos quad) (-> arg0 quad)) + (set! (-> this move-pos quad) (-> this bank tangent-pos quad)) + (none) + ) + +(defmethod neo-grenadier-method-193 ((this neo-grenadier)) + (let ((s5-0 (handle->process (-> this focus handle)))) + (when s5-0 + (cond + ((-> this hostile-path) + (let* ((s4-0 (-> this hostile-path)) + (f30-0 (path-control-method-23 s4-0 (get-trans (the-as process-focusable s5-0) 0))) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> this heading) (not (-> this heading))) + (let* ((f0-0 (rand-vu-float-range 0.2 0.45)) + (f0-1 (if (-> this heading) + (+ f30-0 f0-0) + (- f30-0 f0-0) + ) + ) + ) + (if (< f0-1 0.0) + (set! f0-1 (+ 1.0 f0-1)) + ) + (if (< 1.0 f0-1) + (set! f0-1 (+ -1.0 f0-1)) + ) + (get-point-at-percent-along-path! s4-0 s3-1 f0-1 'interp) + ) + (set-bank-info! this s3-1) + ) + ) + (else + (let* ((s4-1 (-> this root)) + (a0-10 (get-trans (the-as process-focusable s5-0) 0)) + (v1-27 (vector-! (new 'stack-no-clear 'vector) a0-10 (-> s4-1 trans))) + ) + (vector-length v1-27) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> this heading) (not (-> this heading))) + (if (-> this heading) + (set-vector! s3-2 (-> v1-27 z) (-> v1-27 y) (- (-> v1-27 x)) 1.0) + (set-vector! s3-2 (- (-> v1-27 z)) (-> v1-27 y) (-> v1-27 x) 1.0) + ) + (vector-normalize! s3-2 (* 4096.0 (rand-vu-float-range 14.0 18.0))) + (set-bank-info! this (vector+! s2-1 (-> s4-1 trans) s3-2)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate active (neo-grenadier) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let* ((f30-0 (rnd-float-range self 0.9 1.1)) + (a0-2 '((neo-grenadier-patrol-ja) (neo-grenadier-patrol1-ja))) + (gp-0 ((method-of-type (rtype-of a0-2) length) a0-2)) + (s5-0 (new 'static 'array uint64 2 #x9 #xa)) + (s4-0 (-> (the-as (pointer int32) (+ (* (rnd-int self gp-0) 8) (the-as int s5-0))))) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data s4-0) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (when (enemy-method-134 self 0.2) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (nav-enemy-method-182 self) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (nav-enemy-method-181 self) + (ja-no-eval :num! (loop!)) + (set! s4-0 (-> (the-as (pointer int32) (+ (* (rnd-int self gp-0) 8) (the-as int s5-0))))) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data s4-0) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + ) + +(defstate notice (neo-grenadier) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (vector-reset! (-> self root transv)) + ) + ) + +(defstate hostile (neo-grenadier) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (neo-grenadier-method-193 self) + (set-look-at-mode! self 2) + (logclear! (-> self status-flags) (grenadier-status-flag gsf0)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let* ((s5-0 (get-trans (the-as process-focusable a0-1) 0)) + (gp-0 (-> self root trans)) + (f30-0 (vector-vector-distance gp-0 s5-0)) + ) + (cond + ((and (< f30-0 12288.0) (get-focus! self)) + (go-virtual spin-kick) + ) + ((< f30-0 40960.0) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> self root trans quad)) + (new 'stack-no-clear 'vector) + (vector-normalize! s3-1 49152.0) + (closest-point-on-mesh (-> self nav) s4-0 (vector+! s4-0 s5-0 s3-1) (the-as nav-poly #f)) + (when (< 32768.0 (vector-vector-distance gp-0 s4-0)) + (set! (-> self move-pos quad) (-> s4-0 quad)) + (let ((a0-11 (-> self nav state)) + (v1-32 (-> self move-pos)) + ) + (logclear! (-> a0-11 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-11 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-11 target-pos quad) (-> v1-32 quad)) + ) + 0 + (go-virtual backup) + ) + ) + ) + ) + ) + ) + ) + (when (or (time-elapsed? (-> self state-time) (rand-vu-int-range (seconds 3) (seconds 9))) + (>= 8192.0 (vector-vector-xz-distance (-> self root trans) (-> self bank final-pos))) + ) + (if (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + (go-virtual attack) + (go-stare self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let* ((a0-1 '((neo-grenadier-run-ja) (neo-grenadier-run1-ja))) + (a1-3 ((method-of-type (rtype-of a0-1) length) a0-1)) + (gp-0 (new 'static 'array uint64 2 #xd #xe)) + (gp-1 + (-> self draw art-group data (-> (the-as (pointer int32) (+ (* (rnd-int self a1-3) 8) (the-as int gp-0))))) + ) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (until #f + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((gp-0 (-> self bank))) + (if (< (vector-vector-xz-distance (-> self root trans) (-> gp-0 tangent-pos)) 9830.4) + (set! (-> self move-pos quad) (-> gp-0 final-pos quad)) + ) + ) + (let ((a0-3 (-> self nav state)) + (v1-5 (-> self move-pos)) + ) + (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-3 target-pos quad) (-> v1-5 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate backup (neo-grenadier) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + ) + :trans (behavior () + (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-pos)))) + (if (or (>= 12288.0 f0-0) (time-elapsed? (-> self state-time) (seconds 6))) + (go-hostile self) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! neo-grenadier-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate spin-kick (neo-grenadier) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (nav-enemy-method-183 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-8 *game-info*) + (a0-3 (+ (-> v1-8 attack-id) 1)) + ) + (set! (-> v1-8 attack-id) a0-3) + (set! (-> self attack-id) a0-3) + ) + (let ((v1-12 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-12 prim-core action) (collide-action deadly)) + (set! (-> v1-12 local-sphere w) 7372.8) + ) + ) + :exit (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-3 prim-core action) (collide-action)) + (set! (-> v1-3 local-sphere w) 4096.0) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.135)) + (ja-no-eval :group! neo-grenadier-spin-kick-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + :post (behavior () + (when (nav-enemy-method-186 self) + (let ((a0-2 (handle->process (-> self focus handle)))) + (if a0-2 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-2) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + (nav-enemy-simple-post) + ) + ) + +(defmethod knocked-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type none)) + (let ((s4-1 (-> this + draw + art-group + data + (cond + ((= (-> this hit-points) 0.0) + (-> this enemy-info knocked-anim) + ) + ((= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> this root transv quad)) + (let* ((s3-0 quaternion-rotate-y-to-vector!) + (s2-0 (new 'stack-no-clear 'quaternion)) + (s1-0 (-> this root quat)) + (a1-3 (get-knockback-dir! this (new 'stack-no-clear 'vector))) + (s3-1 (s3-0 s2-0 s1-0 (the-as quaternion (vector-negate! a1-3 a1-3)) 32768.0)) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector-inv-orient-by-quat! s4-0 s4-0 s3-1) + ) + (if (< 0.0 (-> s4-0 x)) + 24 + 25 + ) + ) + ) + (else + (-> this enemy-info knocked-anim) + ) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-12 param 1) (-> arg0 anim-speed)) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! a0-12 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + #t + ) + (((knocked-type blue-shot)) + (let* ((a0-14 '((neo-grenadier-blue-hit0-ja) (neo-grenadier-blue-hit1-ja) (neo-grenadier-blue-hit2-ja))) + (a1-11 ((method-of-type (rtype-of a0-14) length) a0-14)) + (s5-1 (new 'static 'array uint64 3 #x1b #x1c #x1d)) + (s4-2 (new 'static 'array int32 4 0 0 0 0)) + (a2-3 (ash 1 (-> s4-2 0))) + (v1-23 (enemy-method-131 this a1-11 a2-3)) + (s5-2 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-23 8) (the-as int s5-1)))))) + ) + (set! (-> s4-2 0) v1-23) + (let ((v1-26 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-26 (= v1-26 (-> this draw art-group data 30))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.067)) + ) + ) + (let ((a0-29 (-> this skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim s5-2)) + (set! (-> a0-29 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) + (set! (-> a0-29 param 1) 1.0) + (set! (-> a0-29 frame-num) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim s5-2) num-func-seek!) + ) + ) + #t + ) + (else + ((method-of-type nav-enemy knocked-anim) this arg0) + ) + ) + ) + +(defmethod knocked-land-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 30))) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + #t + ) + ((or (= (-> this incoming knocked-type) (knocked-type yellow-shot)) (zero? (-> this incoming knocked-type))) + #f + ) + ((< 0.0 (-> this hit-points)) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-9 (-> this skel root-channel 0)) + ) + (set! (-> a0-9 frame-group) (the-as art-joint-anim a1-4)) + (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim a1-4) frames num-frames) -1))) + (set! (-> a0-9 param 1) (-> arg0 anim-speed)) + (set! (-> a0-9 frame-num) 0.0) + (joint-control-channel-group! a0-9 (the-as art-joint-anim a1-4) num-func-seek!) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) (-> arg0 anim-speed)) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) + ) + #t + ) + ) + ) + +(defstate attack (neo-grenadier) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('event-attack) + (let ((s4-0 (handle->process (-> self focus handle)))) + (when s4-0 + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node neo-grenadier-lod0-jg bomb)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s4-0) 0) gp-0))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (let ((f0-0 (vector-length s5-1))) + 0.0 + (let ((f0-1 (fmin 245760.0 f0-0))) + (vector-normalize! s5-1 f0-1) + ) + ) + (vector+! s4-1 gp-0 s5-1) + (let ((f0-2 122880.0)) + (setup-from-to-xz-vel! (-> self shot-trajectory) gp-0 s4-1 f0-2 -102400.0) + ) + ) + (set! (-> s5-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-normalize! s5-1 1638.4) + (vector+! gp-0 gp-0 s5-1) + ) + (let ((a1-9 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-9 ent) (-> self entity)) + (set! (-> a1-9 charge) 1.0) + (set! (-> a1-9 options) (projectile-options)) + (logclear! (-> a1-9 options) (projectile-options po14 po15 po16)) + (set! (-> a1-9 pos quad) (-> gp-0 quad)) + (set! (-> a1-9 vel quad) (-> self shot-trajectory initial-velocity quad)) + (set! (-> a1-9 notify-handle) (process->handle self)) + (set! (-> a1-9 owner-handle) (the-as handle #f)) + (set! (-> a1-9 target-handle) (the-as handle #f)) + (set! (-> a1-9 target-pos quad) (the-as uint128 0)) + (set! (-> a1-9 ignore-handle) (process->handle self)) + (let* ((v1-30 *game-info*) + (a0-28 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-28) + (set! (-> a1-9 attack-id) a0-28) + ) + (set! (-> a1-9 timeout) (seconds 4)) + (let ((v1-32 (-> (spawn-projectile metalhead-grenade-shot a1-9 self *default-dead-pool*) 0)) + (v0-0 (the-as object 'neo-grenadier-shot)) + ) + (set! (-> (the-as metalhead-grenade-shot v1-32) attack-mode) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((v1-1 (-> self nav state)) + (a0-1 (-> self root trans)) + ) + (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + ) + 0 + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-10 *game-info*) + (a0-6 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-6) + (set! (-> self attack-id) a0-6) + ) + (set-look-at-mode! self 1) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> 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)) + ) + (logclear! (-> self status-flags) (grenadier-status-flag gsf1)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (let ((f28-0 (vector-length (-> self root transv)))) + (ja-channel-push! 1 (seconds 0.2)) + (when (< 4096.0 f28-0) + (let* ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> self root transv) 0.3)) + (a2-2 (vector+! (new 'stack-no-clear 'vector) (-> self root trans) v1-8)) + ) + (set! (-> self move-pos quad) (-> self root trans quad)) + (closest-point-on-mesh (-> self nav) (-> self move-pos) a2-2 (the-as nav-poly #f)) + ) + (let ((a0-10 (-> self nav state)) + (v1-13 (-> self move-pos)) + ) + (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-10 target-pos quad) (-> v1-13 quad)) + ) + 0 + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logior! (-> self status-flags) (grenadier-status-flag gsf1)) + (ja-no-eval :group! neo-grenadier-run-to-throw-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-channel-push! 1 (seconds 0.067)) + (logclear! (-> self status-flags) (grenadier-status-flag gsf1)) + (if (logtest? (enemy-flag ef44) (-> 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)) + ) + ) + ) + (nav-enemy-method-182 self) + (cond + ((logtest? (-> self status-flags) (grenadier-status-flag gsf0)) + (ja-channel-push! 1 (seconds 0.135)) + (ja-no-eval :group! neo-grenadier-throw-quick-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (logclear! (-> self status-flags) (grenadier-status-flag gsf0)) + ) + (else + (when (not (enemy-method-105 self 1820.4445 #t)) + (nav-enemy-method-183 self) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! neo-grenadier-throw-turn-in-place-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 910.2222 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75)) + ) + (nav-enemy-method-184 self) + ) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-44 (handle->process (-> self focus handle)))) + (when a0-44 + (let ((f0-14 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-44) 0)))) + (cond + ((< 102400.0 f0-14) + (ja-no-eval :group! neo-grenadier-throw-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! neo-grenadier-throw1-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (go-hostile self) + ) + :post (behavior () + (when (nav-enemy-method-186 self) + (let ((a0-2 (handle->process (-> self focus handle)))) + (if a0-2 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-2) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + (nav-enemy-travel-post) + ) + ) + +(defstate hit (neo-grenadier) + :virtual #t + :code (behavior () + (local-vars (v1-10 int) (v1-44 enemy-flag) (v1-46 enemy-flag) (v1-48 enemy-flag)) + (let ((gp-0 (get-knockback-dir! self (new 'stack-no-clear 'vector)))) + 0 + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + gp-0 + (meters 6) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (add-debug-quaternion #t (bucket-id debug-no-zbuf1) (-> self root trans) (-> self root quat)) + (let ((f0-0 (quaternion-vector-y-angle (-> self root quat) gp-0))) + (cond + ((and (< -8192.0 f0-0) (>= 8192.0 f0-0)) + (set! v1-10 26) + ) + ((and (< 8192.0 f0-0) (>= 24576.0 f0-0)) + (set! v1-10 24) + ) + ((and (< -24576.0 f0-0) (>= -8192.0 f0-0)) + (set! v1-10 25) + ) + (else + (set! v1-10 23) + ) + ) + ) + ) + (let ((gp-1 (-> self draw art-group data v1-10))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-1 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-43 (-> self enemy-flags))) + (if (logtest? v1-43 (enemy-flag vulnerable-backup)) + (set! v1-44 (logior v1-43 (enemy-flag vulnerable))) + (set! v1-44 (logclear v1-43 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-44) + (let ((v1-45 (-> self enemy-flags))) + (if (logtest? v1-45 (enemy-flag attackable-backup)) + (set! v1-46 (logior v1-45 (enemy-flag attackable))) + (set! v1-46 (logclear v1-45 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-46) + (let ((v1-47 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-47) + (set! v1-48 (logior (enemy-flag trackable) v1-47)) + (set! v1-48 (logclear v1-47 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-48) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (cond + ((= (-> self focus aware) (enemy-aware ea3)) + (if (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + (go-virtual attack) + ) + (go-hostile self) + ) + (else + (go-stare self) + ) + ) + ) + ) + +(defmethod go-hostile ((this neo-grenadier)) + (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) + (and (logtest? (-> this status-flags) (grenadier-status-flag gsf0)) + (handle->process (-> this focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (go (method-of-object this attack)) + ) + ((method-of-type nav-enemy go-hostile) this) + ) + +(defstate victory (neo-grenadier) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (cond + ((zero? (rand-vu-int-range 0 1)) + (ja-no-eval :group! neo-grenadier-victory-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! neo-grenadier-notice-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (go-best-state self) + ) + ) + +(defmethod normalize-heading! ((this neo-grenadier) (arg0 nav-control)) + (local-vars (a0-4 int) (a0-6 int)) + (when (not (logtest? (-> this status-flags) (grenadier-status-flag gsf1))) + (let ((v1-3 (new 'stack-no-clear 'vector)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (vector-reset! a2-0) + (set! (-> a2-0 y) 1.0) + (let ((t0-0 (-> arg0 state))) + (set! (-> v1-3 quad) (-> t0-0 heading quad)) + ) + (let* ((a1-3 (-> *perf-stats* data 33)) + (a3-3 (-> a1-3 ctrl)) + ) + (+! (-> a1-3 count) 1) + (b! (zero? a3-3) cfg-3 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a3-3) + ) + (.sync.l) + (.sync.p) + (label cfg-3) + 0 + (forward-up-nopitch->quaternion (-> this root quat) v1-3 a2-0) + ) + (let ((v1-5 (-> *perf-stats* data 33))) + (b! (zero? (-> v1-5 ctrl)) cfg-5 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-4 pcr0) + (+! (-> v1-5 accum0) a0-4) + (.mfpc a0-6 pcr1) + (+! (-> v1-5 accum1) a0-6) + ) + (label cfg-5) + 0 + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod enemy-common-post ((this neo-grenadier)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 34)))) + (spawn (-> this part) a1-1) + ) + (none) + ) + +(defmethod init-enemy-collision! ((this neo-grenadier)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 22528.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 6553.6 0.0 6553.6) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action)) + (set! (-> v1-15 transform-index) 31) + (set-vector! (-> v1-15 local-sphere) 0.0 0.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 enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action deadly)) + (set! (-> v1-17 transform-index) 34) + (set-vector! (-> v1-17 local-sphere) 0.0 0.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 collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action deadly)) + (set! (-> v1-19 transform-index) 23) + (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 collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 16) + (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 collide-with) (collide-spec backgnd obstacle hit-by-others-list)) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set-vector! (-> v1-23 local-sphere) 0.0 12288.0 0.0 12288.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod relocate ((this neo-grenadier) (offset int)) + (when (-> this hostile-path) + (if (nonzero? (-> this hostile-path)) + (&+! (-> this hostile-path) offset) + ) + ) + (call-parent-method this offset) + ) + +(defmethod init-enemy! ((this neo-grenadier)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-grenadier" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *neo-grenadier-nav-enemy-info*) + (let ((v1-5 (-> this neck))) + (when v1-5 + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-5 ignore-angle) 30947.555) + ) + ) + (let ((v1-6 (-> this nav))) + (set! (-> v1-6 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this heading) (if (rand-vu-percent? 0.5) + #t + #f + ) + ) + (set! (-> this move-angle) 5461.3335) + (set! (-> this status-flags) (grenadier-status-flag)) + (set! (-> this suppress-knockaside-timer) 0) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1523) this)) + (set! (-> this hostile-path) (new 'process 'path-control this 'hostile 0.0 (-> this entity) #t)) + (if (zero? (-> this hostile-path)) + (set! (-> this hostile-path) #f) + ) + (if (-> this hostile-path) + (logior! (-> this hostile-path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (add-connection + *part-engine* + this + 24 + this + 468 + (new 'static 'vector :x 532.48 :y -81.92 :z 1515.52 :w 163840.0) + ) + (add-connection + *part-engine* + this + 24 + this + 468 + (new 'static 'vector :x -532.48 :y -81.92 :z 1515.52 :w 163840.0) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/sewer/neo-juicer.gc b/goal_src/jak3/levels/sewer/neo-juicer.gc index b8e87ad10e..adf9776699 100644 --- a/goal_src/jak3/levels/sewer/neo-juicer.gc +++ b/goal_src/jak3/levels/sewer/neo-juicer.gc @@ -7,3 +7,1722 @@ ;; DECOMP BEGINS +(defpartgroup group-neo-juicer-shot-hit + :id 1524 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5003)) + ) + +(defpart 5003 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 64.0) + (:g 64.0 32.0) + (:b 96.0 64.0) + (:a 64.0) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-r -0.35555556) + (:fade-g -0.35555556) + (:fade-b 0.0) + (:fade-a -0.30476192) + (:accel-y (meters -0.00016666666) (meters 0.00016666666)) + (:timer (seconds 0.7)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.2)) + (:next-launcher 5004) + (:rotate-y (degrees 0) (degrees 180)) + ) + ) + +(defpart 5005 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 5006 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 48.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 5007 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 16)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 5008 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 128.0) + (:b 64.0 64.0) + (:a 32.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(deftype neo-juicer-shot (projectile) + ((lightning lightning-control 5) + (victim handle) + ) + ) + + +(defmethod proj-event-handler ((this neo-juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('reset) + (let ((v1-1 (the-as object (-> arg3 param 0)))) + (set! (-> this root trans quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) + (set! (-> this starting-pos quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) + (set! (-> this root transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) + (set! (-> this pre-move-transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) + ) + (set! (-> this hits) 0) + (set-time! (-> this spawn-time)) + (if (made-impact? this) + (go (method-of-object this impact)) + (go (method-of-object this moving)) + ) + #t + ) + (else + ((method-of-type projectile proj-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate dissipate (neo-juicer-shot) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +(defmethod deal-damage! ((this neo-juicer-shot) (arg0 process) (arg1 event-message-block)) + (let ((a0-2 (if (type? arg0 process-focusable) + arg0 + ) + ) + ) + (when a0-2 + (set! (-> this victim) (process->handle a0-2)) + #t + ) + ) + ) + +(defmethod projectile-method-25 ((this neo-juicer-shot)) + (let ((s5-0 (-> this starting-pos)) + (s4-0 (-> this root trans)) + ) + (when (line-in-view-frustum? s5-0 s4-0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'matrix)) + ) + (launch-particles (-> *part-id-table* 5007) s5-0) + (launch-particles (-> *part-id-table* 5008) s5-0) + (when (not (handle->process (-> this victim))) + (launch-particles (-> *part-id-table* 5007) s4-0) + (launch-particles (-> *part-id-table* 5008) s4-0) + ) + (vector-! s2-0 s4-0 s5-0) + (vector-normalize! s2-0 1.0) + (matrix-axis-angle! s1-0 s2-0 13107.2) + (vector-reset! (-> s1-0 trans)) + (set-vector! s3-0 (-> s2-0 z) 0.0 (- (-> s2-0 x)) 1.0) + (vector-normalize! s3-0 409.6) + (dotimes (s0-0 5) + (vector-matrix*! s3-0 s3-0 s1-0) + (vector+! s2-0 s3-0 s5-0) + (let ((a0-17 (-> this lightning s0-0)) + (v1-21 s2-0) + ) + (set! (-> a0-17 state meet data 0 quad) (-> v1-21 quad)) + ) + (let ((a0-20 (-> this lightning s0-0)) + (v1-25 s4-0) + ) + (set! (-> a0-20 state meet data (+ (-> a0-20 state points-to-draw) -1) quad) (-> v1-25 quad)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this neo-juicer-shot)) + (projectile-method-25 this) + (cond + ((logtest? (-> *part-group-id-table* 1524 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1524)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1524)) + ) + ) + 0 + (none) + ) + +(defmethod made-impact? ((this neo-juicer-shot)) + (let ((gp-0 (-> this root)) + (s5-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-0 s5-0)) + (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) + (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-0 action-mask) (collide-action solid)) + ) + (let ((a0-2 (handle->process (-> this notify-handle)))) + (when a0-2 + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) + (f0-2 (- (vector-length s4-1))) + ) + (fill-and-try-snap-to-surface gp-0 s4-1 f0-2 0.0 -3072.0 s5-0) + ) + ) + ) + ) + ) + +(defun neo-juicer-proj-move ((arg0 neo-juicer-shot)) + (let ((s5-0 (handle->process (-> arg0 victim)))) + (cond + (s5-0 + (set! (-> arg0 root trans quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + ((method-of-type projectile deal-damage!) arg0 s5-0 (the-as event-message-block #f)) + ) + (else + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this neo-juicer-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (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 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; WARN: Return type mismatch projectile vs neo-juicer-shot. +(defmethod relocate ((this neo-juicer-shot) (offset int)) + (dotimes (v1-0 5) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) offset) + ) + ) + (the-as neo-juicer-shot ((method-of-type projectile relocate) this offset)) + ) + +(defmethod init-proj-settings! ((this neo-juicer-shot)) + (logior! (-> this options) (projectile-options po17)) + (set! (-> this move) neo-juicer-proj-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this attack-mode) 'neo-juicer-shot) + (dotimes (s5-0 5) + (set! (-> this lightning s5-0) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :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 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1433.6 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + (set! (-> this victim) (the-as handle #f)) + 0 + (none) + ) + +(defskelgroup skel-neo-juicer neo-juicer neo-juicer-lod0-jg -1 + ((neo-juicer-lod0-mg (meters 20)) (neo-juicer-lod1-mg (meters 40)) (neo-juicer-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.3) + :shadow neo-juicer-shadow-mg + :origin-joint-index 21 + ) + +(deftype neo-juicer-anim-info (structure) + ((anim-index int32) + ) + :pack-me + ) + + +(deftype neo-juicer-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (idle-anim neo-juicer-anim-info 3 :inline) + (patrol-anim neo-juicer-anim-info 2 :inline) + (notice-anim neo-juicer-anim-info 2 :inline) + (charge-anim neo-juicer-anim-info 2 :inline) + (knocked-anim neo-juicer-anim-info 2 :inline) + (celebrate-anim neo-juicer-anim-info 2 :inline) + (yellow-hit-anim neo-juicer-anim-info 4 :inline) + (blue-hit-anim neo-juicer-anim-info 6 :inline) + ) + ) + + +(deftype neo-juicer (nav-enemy) + ((los los-control :inline) + (intro-path path-control) + (joint joint-mod) + (joint-enable symbol) + (joint-blend float) + (last-fire-time time-frame) + (heading symbol) + (move-angle float) + (torso-track-player joint-mod) + (circle-backward? symbol :offset 832) + (using-turn-anim symbol) + (hit-focus focus) + (ambush-path-pt int8) + (charge-index int8) + (hostile-dest vector :inline) + (current-projectile handle) + ) + (:state-methods + ambush-cont + attack + ) + (:methods + (go-die-or-knocked (_type_) object) + (spawn-proj! (_type_ process-focusable uint) none) + (track-focus! (_type_) none) + (start-tracking (_type_) none) + (toggle-deadly-flag (_type_ symbol) none) + ) + ) + + +(define *neo-juicer-global-info* (new 'static 'neo-juicer-global-info + :idle-anim (new 'static 'inline-array neo-juicer-anim-info 3 + (new 'static 'neo-juicer-anim-info :anim-index 5) + (new 'static 'neo-juicer-anim-info :anim-index 6) + (new 'static 'neo-juicer-anim-info :anim-index 7) + ) + :patrol-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 8) + (new 'static 'neo-juicer-anim-info :anim-index 23) + ) + :notice-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 21) + (new 'static 'neo-juicer-anim-info :anim-index 22) + ) + :charge-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 9) + (new 'static 'neo-juicer-anim-info :anim-index 20) + ) + :knocked-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 16) + (new 'static 'neo-juicer-anim-info :anim-index 18) + ) + :celebrate-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 24) + (new 'static 'neo-juicer-anim-info :anim-index 25) + ) + :yellow-hit-anim (new 'static 'inline-array neo-juicer-anim-info 4 + (new 'static 'neo-juicer-anim-info :anim-index 33) + (new 'static 'neo-juicer-anim-info :anim-index 34) + (new 'static 'neo-juicer-anim-info :anim-index 35) + (new 'static 'neo-juicer-anim-info :anim-index 36) + ) + :blue-hit-anim (new 'static 'inline-array neo-juicer-anim-info 6 + (new 'static 'neo-juicer-anim-info :anim-index 26) + (new 'static 'neo-juicer-anim-info :anim-index 27) + (new 'static 'neo-juicer-anim-info :anim-index 28) + (new 'static 'neo-juicer-anim-info :anim-index 29) + (new 'static 'neo-juicer-anim-info :anim-index 30) + (new 'static 'neo-juicer-anim-info :anim-index 31) + ) + ) + ) + +(define *fact-info-neo-juicer-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +(define *neo-juicer-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #t + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 21 + :hostile-anim 9 + :hit-anim 11 + :knocked-anim 18 + :knocked-land-anim 19 + :die-anim 40 + :die-falling-anim 41 + :victory-anim 24 + :jump-wind-up-anim 37 + :jump-in-air-anim 38 + :jump-land-anim 39 + :neck-joint 34 + :look-at-joint 34 + :bullseye-joint 6 + :sound-hit (static-sound-name "juicer-hit") + :sound-die (static-sound-name "juicer-die") + :notice-distance (meters 30) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 24) + :default-hit-points 9.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.9 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'shock-red + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 65536.0 + :knocked-soft-vxz-hi 94208.0 + :knocked-soft-vy-lo 77824.0 + :knocked-soft-vy-hi 98304.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 98304.0 + :knocked-medium-vy-lo 81920.0 + :knocked-medium-vy-hi 122880.0 + :knocked-hard-vxz-lo 65536.0 + :knocked-hard-vxz-hi 95846.4 + :knocked-hard-vy-lo 122880.0 + :knocked-hard-vy-hi 163840.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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 98304.0 + :knocked-red-vy-lo 90112.0 + :knocked-red-vy-hi 131072.0 + :knocked-blue-vxz-lo 24576.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 73728.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 34 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 942.08 :z 40.96 :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 8 + :turn-anim 10 + :run-anim 9 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 20) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 2) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 7.5) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 28672.0 + :circle-dist-hi 53248.0 + :nav-mesh #f + ) + ) + +(set! (-> *neo-juicer-nav-enemy-info* fact-defaults) *fact-info-neo-juicer-defaults*) + +(defmethod track-focus! ((this neo-juicer)) + (let ((s3-0 (handle->process (-> this focus handle)))) + (when s3-0 + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (let ((s3-1 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform fvec) 1.0) + ) + ) + (vector-! s5-0 s5-0 s4-0) + (vector-normalize! s5-0 1.0) + (quaternion-from-two-vectors-partial! (-> this joint quat) s3-1 s5-0 (-> this joint-blend)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod start-tracking ((this neo-juicer)) + (cond + ((-> this torso-track-player) + (set! (-> this joint-enable) #t) + (seek! (-> this joint-blend) 1.0 (* 2.0 (seconds-per-frame))) + (track-focus! this) + ) + ((-> this joint-enable) + (seek! (-> this joint-blend) 0.0 (* 4.0 (seconds-per-frame))) + (track-focus! this) + (if (= (-> this joint-blend) 0.0) + (set! (-> this joint-enable) #f) + ) + ) + ) + 0 + (none) + ) + +(defmethod enemy-common-post ((this neo-juicer)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (los-control-method-9 + (-> this los) + (the-as process-focusable (handle->process (-> this focus handle))) + (the-as vector #f) + 819.2 + 4096.0 + ) + (start-tracking this) + (none) + ) + +(defmethod go-die-or-knocked ((this neo-juicer)) + (if (and (= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) + ) + ) + ) + (zero? (rnd-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (f1-0 32768.0) + ) + (>= f0-0 (* f1-0 f1-0)) + ) + ) + (go-die this) + (go (method-of-object this knocked)) + ) + ) + +(defmethod event-handler ((this neo-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit-flinch) + (cond + ((= (-> this hit-points) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go-die-or-knocked this) + ) + (else + (let ((v1-29 (ja-channel-float! (the-as art-joint-anim (-> this draw art-group data 11)) 0.0 0.0 0.0))) + (when v1-29 + (set! (-> v1-29 param 0) 1.0) + (set! (-> v1-29 param 1) 0.75) + (set! (-> v1-29 param 2) 2.0) + (set! (-> v1-29 num-func) num-func-interp-play!) + ) + ) + ) + ) + #t + ) + (('hit) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (= (-> this hit-points) 0.0) + (go-die-or-knocked this) + (go (method-of-object this hit)) + ) + #t + ) + (('instant-death) + (when (< 0.0 (-> this hit-points)) + (set! (-> this hit-points) 0.0) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (let ((s4-0 (get-knockback-dir! this (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s4-0 (-> this root quat)) + (vector-float*! s4-0 s4-0 -1.0) + (vector-normalize! s4-0 1.0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go-die-or-knocked this) + ) + #t + ) + (('notify) + (if (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) (handle->process (-> this focus handle)))) + (set! (-> this hit-focus) (the-as focus #t)) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate active (neo-juicer) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (or (= v1-2 neo-juicer-charge0-ja) (= v1-2 neo-juicer-charge1-ja))) + (let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 neo-juicer-patrol0-ja) (= v1-8 neo-juicer-patrol1-ja))) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (let ((gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* patrol-anim (rnd-int self 2) anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-34 (ja-group))) + (if (not (and v1-34 (= v1-34 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (zero? (rnd-int self 2)) + (nav-enemy-method-182 self) + (ja-channel-push! 1 (seconds 0.3)) + (let ((gp-1 0)) + (until (not (enemy-method-134 self 0.4)) + (let* ((v1-61 (enemy-method-131 self 3 gp-1)) + (a1-15 (-> self draw art-group data (-> *neo-juicer-global-info* idle-anim v1-61 anim-index))) + ) + (set! gp-1 (ash 1 v1-61)) + (ja-no-eval :group! a1-15 :num! (seek! max f30-0) :frame-num 0.0) + ) + (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (nav-enemy-method-181 self) + ) + ) + ) + #f + ) + ) + +(defmethod setup-jump! ((this neo-juicer) (arg0 enemy-jump-info)) + ((method-of-type nav-enemy setup-jump!) this arg0) + (none) + ) + +(defmethod go-directed2 ((this neo-juicer)) + (case (-> this jump-why) + ((2) + (go (method-of-object this ambush-cont)) + ) + (else + ((method-of-type nav-enemy go-directed2) this) + ) + ) + ) + +(defstate ambush (neo-juicer) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy ambush) enter))) + (if t9-0 + (t9-0) + ) + ) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate ambush-cont (neo-juicer) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self ambush-path-pt) 1)) + ) + (if (< v1-1 (-> a0-0 curve num-cverts)) + (set! (-> self ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate notice (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((s5-0 0)) + (let ((s4-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + (gp-1 (vector-! + (new 'stack-no-clear 'vector) + (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0) + (-> self root trans) + ) + ) + ) + (vector-flatten! gp-1 gp-1 (-> s4-0 uvec)) + (vector-normalize! gp-1 1.0) + (cond + ((< (vector-dot gp-1 (-> s4-0 fvec)) (cos 8192.0)) + ) + (else + (set! s5-0 (logior s5-0 1)) + ) + ) + ) + (let ((f30-1 (rnd-float-range self 0.8 1.2)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (let* ((a0-13 (enemy-method-131 self 2 s5-0)) + (a1-8 (-> self draw art-group data (-> *neo-juicer-global-info* notice-anim a0-13 anim-index))) + ) + (ja-no-eval :group! a1-8 :num! (seek! max f30-1) :frame-num 0.0) + ) + (until (ja-done? 0) + (let ((a1-9 (-> self nav state))) + (set! (-> gp-2 quad) (-> a1-9 travel quad)) + ) + (seek-toward-heading-vec! (-> self root) gp-2 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + (go-best-state self) + ) + ) + +(defstate victory (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (let ((gp-1 (-> self draw art-group data (-> *neo-juicer-global-info* celebrate-anim (rnd-int self 2) anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +(defstate hostile (neo-juicer) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 neo-juicer-charge0-ja) (= v1-2 neo-juicer-charge1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let* ((v1-16 (rnd-int self 2)) + (gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* charge-anim v1-16 anim-index))) + ) + (set! (-> self charge-index) v1-16) + (let ((v1-19 (ja-group))) + (if (not (and v1-19 (= v1-19 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let* ((gp-0 (get-trans (the-as process-focusable a0-1) 1)) + (f0-0 (vector-vector-xz-distance (-> self root trans) gp-0)) + ) + (let ((v1-8 (-> self nav state))) + (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + ) + 0 + (if (and (>= 53248.0 f0-0) (should-check-los? (-> self los) 0) (get-focus! self)) + (go-virtual attack) + ) + ) + ) + ) + (nav-enemy-travel-post) + ) + ) + +(defmethod get-focus! ((this neo-juicer)) + (let* ((t9-0 (method-of-type nav-enemy get-focus!)) + (v1-1 (t9-0 this)) + ) + (if (and v1-1 (time-elapsed? (-> this last-fire-time) (seconds 7))) + v1-1 + ) + ) + ) + +(defbehavior neo-juicer-face-player-post neo-juicer () + (let ((gp-0 (handle->process (-> self focus handle)))) + (when (and (nav-enemy-method-186 self) gp-0) + (let ((f0-1 + (fabs + (deg-diff + (quaternion-y-angle (-> self root quat)) + (vector-y-angle + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) + ) + ) + ) + ) + ) + (cond + ((or (< 5461.3335 f0-1) (and (-> self using-turn-anim) (< 910.2222 f0-1))) + (set! (-> self using-turn-anim) #t) + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable gp-0) 0) + (-> self nav max-rotation-rate) + (seconds 0.2) + ) + ) + (else + (set! (-> self using-turn-anim) #f) + ) + ) + ) + ) + ) + (nav-enemy-simple-post) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod spawn-proj! ((this neo-juicer) (arg0 process-focusable) (arg1 uint)) + (with-pp + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 20))) + (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (when (not (handle->process (-> this current-projectile))) + (set! (-> s5-0 ent) (-> this entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options)) + (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 notify-handle) (process->handle this)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 target-handle) (the-as handle #f)) + (set! (-> s5-0 target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 ignore-handle) (process->handle this)) + (set! (-> s5-0 attack-id) arg1) + (set! (-> s5-0 timeout) (seconds 4)) + ) + (vector-normalize! (vector-! (-> s5-0 pos) (get-trans arg0 3) s4-0) 1.0) + (vector-float*! (-> s5-0 vel) (-> s5-0 pos) (* 24576.0 (-> pp clock frames-per-second))) + (vector+float*! (-> s5-0 pos) s4-0 (-> s5-0 pos) -1024.0) + (let ((a0-21 (handle->process (-> this current-projectile)))) + (if a0-21 + (send-event a0-21 'reset s5-0) + (set! (-> this current-projectile) + (ppointer->handle (spawn-projectile neo-juicer-shot s5-0 this *default-dead-pool*)) + ) + ) + ) + ) + (none) + ) + ) + +(defstate attack (neo-juicer) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state)) + (a0-1 (-> self root trans)) + ) + (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + ) + 0 + (set! (-> self torso-track-player) (the-as joint-mod #t)) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self hit-focus) #f) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-9 *game-info*) + (v0-0 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) v0-0) + (set! (-> self attack-id) v0-0) + ) + ) + :exit (behavior () + (set! (-> self torso-track-player) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (toggle-deadly-flag self #f) + (set-time! (-> self last-fire-time)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (send-event (handle->process (-> self current-projectile)) 'die) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! neo-juicer-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (< 11.0 (ja-aframe-num 0)) + (toggle-deadly-flag self #t) + ) + (suspend) + (ja :num! (seek!)) + ) + 0 + (let* ((gp-0 #f) + (v1-29 *game-info*) + (s5-0 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) s5-0) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 (seconds 0.25)) + (ja-no-eval :group! neo-juicer-attack0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s3-0 (handle->process (-> self focus handle)))) + (when s3-0 + (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) + (spawn-proj! self (the-as process-focusable s3-0) s5-0) + (current-time) + (if (not gp-0) + (set! gp-0 #t) + ) + ) + ) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (b! + (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) + (not (and v1-73 (= v1-73 neo-juicer-attack-turn-ja))) + ) + ) + ) + cfg-31 + :delay (empty-form) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! neo-juicer-attack-turn-ja) + (b! #t cfg-42 :delay (nop!)) + (label cfg-31) + (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) + (not (and v1-84 (= v1-84 neo-juicer-attack0-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! neo-juicer-attack0-ja) + ) + (label cfg-42) + (suspend) + (ja :num! (seek!)) + ) + (send-event (handle->process (-> self current-projectile)) 'die) + (let ((a0-37 (handle->process (-> self focus handle)))) + (when a0-37 + (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) + (go-virtual circling) + ) + ) + ) + (suspend) + ) + ) + ) + (if (-> self hit-focus) + (go-virtual victory) + ) + (go-hostile self) + ) + :post neo-juicer-face-player-post + ) + +(defstate circling (neo-juicer) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 neo-juicer-charge0-ja) (= v1-2 neo-juicer-charge1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (nav-enemy-method-177 self) + (let* ((v1-22 (rnd-int self 2)) + (gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* charge-anim v1-22 anim-index))) + ) + (set! (-> self charge-index) v1-22) + (let ((v1-25 (ja-group))) + (if (not (and v1-25 (= v1-25 gp-0))) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + (let ((s5-0 (+ (rnd-int self 6) 2)) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (< 20480.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (vector-reset! (-> self root transv)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-2 (-> self draw art-group data (-> *neo-juicer-global-info* celebrate-anim (rnd-int self 2) anim-index))) + (f30-2 (rnd-float-range self 0.9 1.1)) + ) + (ja-no-eval :group! gp-2 :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + ) + ) + ) + #f + ) + ) + +(defstate hit (neo-juicer) + :virtual #t + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-39 enemy-flag) (v1-41 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (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 vulnerable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag vulnerable))) + (set! v1-37 (logclear v1-36 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? v1-38 (enemy-flag attackable-backup)) + (set! v1-39 (logior v1-38 (enemy-flag attackable))) + (set! v1-39 (logclear v1-38 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (let ((v1-40 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-40) + (set! v1-41 (logior (enemy-flag trackable) v1-40)) + (set! v1-41 (logclear v1-40 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-41) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-virtual hostile) + ) + ) + +(defstate stare (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 1)) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate taunt (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.6)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (s5-0 (current-time)) + (f28-0 f30-0) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (loop! f28-0) + :frame-num 0.0 + ) + (until (time-elapsed? s5-0 gp-0) + (suspend) + (ja :num! (loop! f28-0)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info taunt-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual stare) + ) + ) + +(defmethod knocked-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + (local-vars (a2-2 int)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 0) + (let* ((a2-0 (ash 1 (-> *neo-juicer-global-info* prev-yellow-hit))) + (v1-3 (enemy-method-131 this 4 a2-0)) + (a1-6 (-> this draw art-group data (-> *neo-juicer-global-info* yellow-hit-anim v1-3 anim-index))) + ) + (set! (-> *neo-juicer-global-info* prev-yellow-hit) v1-3) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) + (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) + (set! (-> a0-13 param 1) (-> arg0 anim-speed)) + (set! (-> a0-13 frame-num) 0.0) + (joint-control-channel-group! a0-13 (the-as art-joint-anim a1-6) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (let ((v1-11 (ash 1 (-> *neo-juicer-global-info* prev-blue-hit)))) + (if (zero? (-> this charge-index)) + (set! a2-2 (logior v1-11 56)) + (set! a2-2 (logior v1-11 7)) + ) + ) + (let* ((v1-15 (enemy-method-131 this 6 a2-2)) + (s5-1 (-> this draw art-group data (-> *neo-juicer-global-info* blue-hit-anim v1-15 anim-index))) + ) + (set! (-> *neo-juicer-global-info* prev-blue-hit) v1-15) + (let ((v1-18 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-18 (= v1-18 (-> this draw art-group data 32))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-32 (-> this skel root-channel 0))) + (set! (-> a0-32 frame-group) (the-as art-joint-anim s5-1)) + (set! (-> a0-32 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) + (set! (-> a0-32 param 1) 1.0) + (set! (-> a0-32 frame-num) 0.0) + (joint-control-channel-group! a0-32 (the-as art-joint-anim s5-1) num-func-seek!) + ) + ) + ) + (else + (let ((s4-1 (-> this draw art-group data (-> *neo-juicer-global-info* knocked-anim (rnd-int this 2) anim-index)))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-37 (-> this skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-37 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-37 param 1) (-> arg0 anim-speed)) + (set! (-> a0-37 frame-num) 0.0) + (joint-control-channel-group! a0-37 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + ) + ) + #t + ) + +(defmethod knocked-land-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 32))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + #t + ) + ) + ((!= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (let* ((v1-14 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (s4-1 (if (and v1-14 (= v1-14 (-> this draw art-group data 18))) + (-> this draw art-group data 19) + (-> this draw art-group data 17) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + #t + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod toggle-deadly-flag ((this neo-juicer) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (if arg0 + (logior! (-> a2-1 prim-core action) (collide-action deadly)) + (logclear! (-> a2-1 prim-core action) (collide-action deadly)) + ) + ) + ) + ) + (none) + ) + +(defmethod enemy-method-108 ((this neo-juicer) (arg0 process-focusable)) + (focus-test? arg0 invulnerable) + ) + +(defmethod init-enemy-collision! ((this neo-juicer)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> s4-0 transform-index) 21) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 -4096.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 6) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 16) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 11) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid)) + (set! (-> v1-22 transform-index) 34) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid)) + (set! (-> v1-24 transform-index) 20) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-26 prim-core action) (collide-action solid)) + (set-vector! (-> v1-26 local-sphere) 0.0 8192.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-28 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-28 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-28 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod relocate ((this neo-juicer) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) offset) + ) + (call-parent-method this offset) + ) + +(defmethod init-enemy! ((this neo-juicer)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-juicer" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *neo-juicer-nav-enemy-info*) + (let ((v1-5 (-> this neck))) + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-5 ignore-angle) 30947.555) + ) + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this last-fire-time) 0) + (set! (-> this heading) (if (rand-vu-percent? 0.5) + #t + #f + ) + ) + (set! (-> this move-angle) 5461.3335) + (set! (-> this torso-track-player) #f) + (init-los! (-> this los) this (seconds 0.2) 327680.0 (collide-spec backgnd hit-by-others-list los-blocker)) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode polar-look-at) this 5)) + (set! (-> this using-turn-anim) #f) + (let ((v1-18 (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t))) + (set! (-> this intro-path) v1-18) + (if (nonzero? v1-18) + (logior! (-> v1-18 flags) (path-control-flag display draw-line draw-point draw-text)) + ) + ) + (add-connection + *part-engine* + this + 34 + this + 468 + (new 'static 'vector :x 901.12 :y -1146.88 :z 1269.76 :w 163840.0) + ) + (add-connection + *part-engine* + this + 34 + this + 468 + (new 'static 'vector :x -901.12 :y -1146.88 :z 1269.76 :w 163840.0) + ) + (add-connection *part-engine* this 20 this 5005 (new 'static 'vector :w 163840.0)) + (set! (-> this root pause-adjust-distance) 81920.0) + (set! (-> this current-projectile) (the-as handle #f)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/sewer/saberfish-spawner.gc b/goal_src/jak3/levels/sewer/saberfish-spawner.gc index 3b01cc4bc5..1ff114ba9b 100644 --- a/goal_src/jak3/levels/sewer/saberfish-spawner.gc +++ b/goal_src/jak3/levels/sewer/saberfish-spawner.gc @@ -7,3 +7,1525 @@ ;; DECOMP BEGINS +(deftype path-index-array (inline-array-class) + ((data int8 :dynamic) + ) + ) + + +(set! (-> path-index-array heap-base) (the-as uint 1)) + +(deftype nav-mesh-jump (structure) + ((mesh nav-mesh) + (paths path-index-array) + (in-water? symbol) + ) + ) + + +(deftype nav-mesh-jump-array (inline-array-class) + ((data nav-mesh-jump :inline :dynamic) + ) + ) + + +(set! (-> nav-mesh-jump-array heap-base) (the-as uint 16)) + +(deftype saberfish-spawner-command (structure) + ((command symbol) + (message symbol) + (initial-state symbol) + (parent handle) + ) + ) + + +(deftype saberfish-spawn-query (structure) + ((alive-count int16) + ) + ) + + +(deftype saberfish-spawner (process-drawable) + ((jump-paths (array path-control)) + (nav-mesh-jumps nav-mesh-jump-array) + (live-count int8) + (last-spawned-process handle) + (mgr-parent handle) + (spawned-saberfish handle 128) + (num-spawned-saberfish int32) + ) + (:state-methods + saberfish-spawner-base-state + ) + (:methods + (saberfish-spawner-method-21 (_type_) none) + (saberfish-spawner-method-22 (_type_ vector saberfish-find-behavior) int) + (draw-paths (_type_) none) + (saberfish-spawner-method-24 (_type_ saberfish) int) + (spawn-saberfish (_type_ symbol symbol process) none) + (saberfish-spawner-method-26 (_type_ process int symbol event-message-block) object) + ) + ) + + +(defmethod init-from-entity! ((this saberfish-spawner) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (process-entity-set! this arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this num-spawned-saberfish) 0) + (set! (-> this last-spawned-process) (the-as handle #f)) + (let ((s5-1 0)) + (let ((s4-0 (-> ((method-of-type res-lump lookup-tag-idx) (-> this entity) 'path 'base -1000000000.0) lo))) + (when (>= (the-as int s4-0) 0) + (let ((s3-0 (the-as int s4-0)) + (v1-6 (-> this entity tag s4-0)) + ) + 0 + (while (= (-> v1-6 name) (-> this entity tag s4-0 name)) + (make-property-data (-> this entity) 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f)) + (+! s5-1 1) + (+! s3-0 1) + (set! v1-6 (-> this entity tag s3-0)) + ) + ) + ) + ) + (let ((a3-2 (* (/ s5-1 2) 2))) + (set! (-> this jump-paths) (new 'process 'boxed-array path-control a3-2)) + ) + ) + 0.0 + (dotimes (s5-2 (-> this jump-paths length)) + (set! (-> this jump-paths s5-2) + (new 'process 'path-control this 'path (the float s5-2) (the-as entity #f) #f) + ) + (logior! (-> this jump-paths s5-2 flags) (path-control-flag display draw-line draw-point draw-text)) + ) + 0 + (set! sv-16 (new 'static 'res-tag)) + (res-lump-struct (-> this entity) 'nav-mesh-actor structure :tag-ptr (& sv-16)) + (let ((s5-3 (-> sv-16 elt-count))) + (set! (-> this nav-mesh-jumps) (new 'process 'nav-mesh-jump-array (the-as int s5-3))) + (dotimes (s4-1 (the-as int s5-3)) + (let ((v1-38 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor s4-1))) + (if v1-38 + (set! (-> this nav-mesh-jumps data s4-1 mesh) v1-38) + ) + ) + ) + ) + (saberfish-spawner-method-21 this) + (let ((f0-3 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-3) + ) + (let ((t9-13 (method-of-type res-lump get-property-struct)) + (a0-32 (-> this entity)) + (a1-16 'trans-offset) + (a2-9 'interp) + (a3-6 -1000000000.0) + (t0-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> t0-3 x) 0.0) + (set! (-> t0-3 y) 0.0) + (set! (-> t0-3 z) 0.0) + (set! (-> t0-3 w) 1.0) + (let ((v1-49 (the-as vector (t9-13 a0-32 a1-16 a2-9 a3-6 t0-3 (the-as (pointer res-tag) #f) *res-static-buf*)))) + (vector+! (-> this root trans) (-> this root trans) v1-49) + ) + ) + (go (method-of-object this saberfish-spawner-base-state)) + ) + +(defstate saberfish-spawner-base-state (saberfish-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (saberfish-spawner-method-26 self proc argc message block) + ) + :enter (behavior () + '() + ) + :trans (behavior () + (draw-paths self) + ) + :code sleep-code + ) + +(define *temporary-closest-nav-mesh-indices* (new 'static 'array int8 64 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ) + ) + +(define *temporary-num-paths-per-nav-mesh-count* (the-as (pointer uint8) (new 'static 'array int8 64 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod saberfish-spawner-method-21 ((this saberfish-spawner)) + (dotimes (v1-0 64) + (set! (-> *temporary-closest-nav-mesh-indices* v1-0) -1) + (set! (-> *temporary-num-paths-per-nav-mesh-count* v1-0) (the-as uint 0)) + ) + (dotimes (s5-0 (-> this jump-paths length)) + (let ((a0-5 (-> this jump-paths s5-0))) + -1 + (let ((s4-0 (new 'stack-no-clear 'vector))) + (get-point-at-percent-along-path! a0-5 s4-0 0.5 'interp) + (let ((v1-9 (saberfish-spawner-method-22 this s4-0 (saberfish-find-behavior none)))) + (set! (-> *temporary-closest-nav-mesh-indices* s5-0) v1-9) + (cond + ((>= v1-9 0) + (+! (-> *temporary-num-paths-per-nav-mesh-count* v1-9) 1) + ) + (else + ) + ) + ) + ) + ) + ) + (dotimes (s5-1 (-> this nav-mesh-jumps length)) + (let* ((s4-1 (-> this nav-mesh-jumps data s5-1)) + (s3-0 s5-1) + (a2-2 (-> *temporary-num-paths-per-nav-mesh-count* s3-0)) + (s2-0 0) + ) + (set! (-> s4-1 paths) (new 'process 'path-index-array (the-as int a2-2))) + (dotimes (v1-20 (-> this jump-paths length)) + (when (= (-> *temporary-closest-nav-mesh-indices* v1-20) s3-0) + (set! (-> s4-1 paths data s2-0) v1-20) + (set! (-> s4-1 in-water?) (= (logand v1-20 1) 1)) + (+! s2-0 1) + ) + ) + ) + ) + (none) + ) + +(defmethod saberfish-spawner-method-22 ((this saberfish-spawner) (arg0 vector) (arg1 saberfish-find-behavior)) + (local-vars (v1-16 float) (sv-64 nav-poly) (sv-72 int) (sv-80 number) (sv-84 vector) (sv-88 symbol)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-64 (new 'stack-no-clear 'nav-poly)) + (set! sv-72 -1) + (set! sv-80 24576.0) + (set! sv-84 arg0) + (set! sv-88 (in-water<-find-behavior arg1)) + (set! (-> sv-64 data 20) (the-as uint 7)) + (dotimes (s4-0 (-> this nav-mesh-jumps length)) + (let ((a0-4 (-> this nav-mesh-jumps data s4-0 mesh))) + (when a0-4 + (when (or (= arg1 (saberfish-find-behavior none)) (= (-> this nav-mesh-jumps data s4-0 in-water?) sv-88)) + (vector-! (the-as vector (-> sv-64 vertex)) sv-84 (the-as vector (-> a0-4 bounds))) + (.lvf vf1 (&-> (-> sv-64 vertex) 0 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-16 vf1) + (let ((f0-1 v1-16) + (f1-0 (-> a0-4 bounds r)) + ) + (when (< f0-1 (* f1-0 f1-0)) + (set! (-> sv-64 vertex1 x) 409600.0) + (nav-mesh-method-46 a0-4 sv-64) + (when (>= (the-as float sv-80) (-> sv-64 vertex1 w)) + (set! sv-80 (-> sv-64 vertex1 w)) + (set! sv-72 s4-0) + ) + ) + ) + ) + ) + ) + ) + sv-72 + ) + ) + +(defmethod relocate ((this saberfish-spawner) (offset int)) + (when (nonzero? (-> this jump-paths)) + (dotimes (v1-2 (-> this jump-paths length)) + (if (nonzero? (-> this jump-paths v1-2)) + (&+! (-> this jump-paths v1-2) offset) + ) + ) + ) + (when (nonzero? (-> this nav-mesh-jumps)) + (dotimes (v1-7 (-> this nav-mesh-jumps length)) + (if (nonzero? (-> this nav-mesh-jumps data v1-7 paths)) + (&+! (-> this nav-mesh-jumps data v1-7 paths) offset) + ) + ) + ) + (if (nonzero? (-> this jump-paths)) + (&+! (-> this jump-paths) offset) + ) + (if (nonzero? (-> this nav-mesh-jumps)) + (&+! (-> this nav-mesh-jumps) offset) + ) + (call-parent-method this offset) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod draw-paths ((this saberfish-spawner)) + (dotimes (s5-0 (-> this jump-paths length)) + (debug-draw (-> this jump-paths s5-0)) + ) + (none) + ) + +(defmethod saberfish-spawner-method-24 ((this saberfish-spawner) (arg0 saberfish)) + (local-vars + (sv-48 float) + (sv-56 int) + (sv-64 number) + (sv-68 vector) + (sv-72 vector) + (sv-160 (function path-control vector vector symbol float)) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + ) + (set! (-> arg0 dest-nav-mesh-index) (-> arg0 desired-dest-mesh-index)) + (set! sv-48 (the-as float -1.0)) + (set! sv-56 -1) + (set! sv-64 40960000000.0) + (let ((v1-4 (new 'stack-no-clear 'vector))) + (set! (-> v1-4 quad) (-> arg0 root trans quad)) + (set! sv-68 v1-4) + ) + (set! sv-72 (new 'stack-no-clear 'vector)) + (cond + ((saberfish-method-243 arg0) + (vector-! sv-72 (-> arg0 desired-dest-nav-point) (-> arg0 root trans)) + (set! (-> sv-72 y) 0.0) + ) + (else + (vector-z-quaternion! sv-72 (-> arg0 root quat)) + (set! (-> sv-72 y) 0.0) + (vector-normalize! sv-72 61440.0) + ) + ) + (set! sv-56 -1) + (when (>= (-> arg0 current-nav-mesh-index) 0) + (let ((s4-0 (-> this nav-mesh-jumps data (-> arg0 current-nav-mesh-index)))) + (dotimes (s3-0 (-> s4-0 paths length)) + (let* ((s2-0 (-> s4-0 paths data s3-0)) + (s1-0 (-> this jump-paths s2-0)) + ) + 0.0 + 0.0 + (let* ((f0-6 (cond + (#f + (path-control-method-23 s1-0 sv-68) + ) + (else + (let ((s0-0 s1-0)) + (set! sv-160 (method-of-object s0-0 path-control-method-28)) + (set! sv-176 sv-68) + (set! sv-192 sv-72) + (let ((a3-0 (not (saberfish-method-243 arg0)))) + (sv-160 s0-0 sv-176 sv-192 a3-0) + ) + ) + ) + ) + ) + (f30-0 (fmax 0.0 (fmin 1.0 f0-6))) + (s0-1 vector-vector-xz-distance) + ) + (set! sv-208 sv-68) + (let* ((a1-8 (get-point-at-percent-along-path! s1-0 (new 'stack-no-clear 'vector) f30-0 'interp)) + (f0-8 (s0-1 sv-208 a1-8)) + ) + (when (< f0-8 (the-as float sv-64)) + (set! sv-64 f0-8) + (set! sv-56 s2-0) + (set! sv-48 f30-0) + ) + ) + ) + ) + ) + ) + ) + (cond + ((>= sv-56 0) + (let* ((v1-41 (if (saberfish-method-243 arg0) + -1 + 1 + ) + ) + (s3-1 (-> this jump-paths sv-56)) + (s4-1 (-> this jump-paths (+ sv-56 v1-41))) + ) + (if (or (< (+ sv-56 v1-41) 0) (>= (+ sv-56 v1-41) (-> this jump-paths length))) + (return 0) + ) + (let ((s2-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((s0-2 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + (f30-1 0.4) + ) + (get-point-at-percent-along-path! s3-1 (-> arg0 jump-point-start) sv-48 'interp) + (if (saberfish-method-243 arg0) + (set! f30-1 0.24) + ) + (vector-! s5-1 (-> arg0 jump-point-start) (-> arg0 root trans)) + (get-point-at-percent-along-path! s3-1 s0-2 (+ -0.05 sv-48) 'interp) + (get-point-at-percent-along-path! s3-1 s1-1 (+ 0.05 sv-48) 'interp) + (vector-! s2-1 s1-1 s0-2) + (vector-normalize! s2-1 1.0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (when (< f30-1 (fabs (vector-dot s5-1 s2-1))) + (set! sv-48 (path-control-method-23 s3-1 sv-68)) + (get-point-at-percent-along-path! s3-1 (-> arg0 jump-point-start) sv-48 'interp) + ) + ) + (cond + ((saberfish-method-243 arg0) + (let ((f0-20 (path-control-method-28 s4-1 (-> arg0 jump-point-start) sv-72 #f))) + (get-point-at-percent-along-path! s4-1 (-> arg0 jump-point-end) f0-20 'interp) + ) + ) + (else + (let ((f0-21 (path-control-method-23 s4-1 (-> arg0 jump-point-start)))) + (get-point-at-percent-along-path! s4-1 (-> arg0 jump-point-end) f0-21 'interp) + ) + ) + ) + (vector-! s5-1 (-> arg0 jump-point-end) (-> arg0 jump-point-start)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + ) + ) + (let ((v1-74 (-> arg0 nav state)) + (a0-46 (-> arg0 jump-point-start)) + ) + (logclear! (-> v1-74 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-74 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-74 target-pos quad) (-> a0-46 quad)) + ) + 0 + ) + (else + ) + ) + 0 + ) + +(defmethod saberfish-spawner-method-26 ((this saberfish-spawner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('transition-terrain-begin) + (saberfish-spawner-method-24 this (the-as saberfish arg0)) + ) + (('saberfish-query) + (let ((gp-0 (the-as saberfish-spawner-query-msg (-> arg3 param 0)))) + (case (-> gp-0 query-type) + (((saberfish-query-type set-nav-idx)) + (set! v0-0 (saberfish-spawner-method-22 this (the-as vector (&-> gp-0 mesh)) (-> gp-0 behavior))) + (set! (-> gp-0 closest-nav-mesh-index) (the-as int v0-0)) + v0-0 + ) + (((saberfish-query-type set-mesh)) + (set! v0-0 (-> this nav-mesh-jumps data (-> gp-0 closest-nav-mesh-index) mesh)) + (set! (-> gp-0 mesh) (the-as nav-mesh v0-0)) + v0-0 + ) + (((saberfish-query-type set-in-water)) + (set! v0-0 (-> this nav-mesh-jumps data (-> gp-0 closest-nav-mesh-index) in-water?)) + (set! (-> gp-0 in-water?) (the-as symbol v0-0)) + v0-0 + ) + (((saberfish-query-type can-go-to-ground?)) + (send-event (handle->process (-> this mgr-parent)) 'query-can-go-to-ground? gp-0) + ) + ) + ) + ) + (('spawn-command) + (set! (-> this mgr-parent) (process->handle arg0)) + (let ((v1-17 (the-as saberfish-spawner-command (-> arg3 param 0)))) + (case (-> v1-17 command) + (('spawn-enemy) + (spawn-saberfish this (-> v1-17 message) (-> v1-17 initial-state) (handle->process (-> v1-17 parent))) + ) + ) + ) + ) + (('child-die) + (set! v0-0 (+ (-> this live-count) -1)) + (set! (-> this live-count) (the-as int v0-0)) + v0-0 + ) + (('saberfish-spawn-query) + (let ((v1-22 (the-as saberfish-spawn-query (-> arg3 param 0)))) + (set! v0-0 (-> this live-count)) + (set! (-> v1-22 alive-count) (the-as int v0-0)) + ) + v0-0 + ) + (('saberfish-ground-query) + (let ((v1-23 (the-as saberfish-spawn-query (-> arg3 param 0)))) + (set! (-> v1-23 alive-count) 0) + (dotimes (a1-21 (-> this num-spawned-saberfish)) + (let ((a2-14 (-> this spawned-saberfish a1-21))) + (when (handle->process a2-14) + (let ((a2-15 (the-as saberfish (handle->process a2-14)))) + (if (or (= (-> a2-15 ground-state) 4) + (and (-> a2-15 next-state) (let ((a2-19 (-> a2-15 next-state name))) + (or (= a2-19 'transition-terrain-move-towards-initial-jump) + (= a2-19 'jump) + (= a2-19 'transition-terrain-jump-from-water) + ) + ) + ) + ) + (+! (-> v1-23 alive-count) 1) + ) + ) + ) + ) + ) + ) + #f + ) + (('forward-event) + (send-event + (handle->process (-> this last-spawned-process)) + (the-as symbol (-> arg3 param 0)) + (-> arg3 param 1) + ) + ) + ) + ) + +(defmethod spawn-saberfish ((this saberfish-spawner) (arg0 symbol) (arg1 symbol) (arg2 process)) + (if (not arg2) + (set! arg2 this) + ) + (let ((s4-0 (new 'stack-no-clear 'saberfish-init-by-other-params))) + (if (= arg1 'saberfish-crawl-out-of-tube) + (sound-play "sf-spawner") + ) + (set! (-> s4-0 trans quad) (-> this entity extra trans quad)) + (quaternion-copy! (-> s4-0 quat) (-> this entity quat)) + (set! (-> s4-0 entity) (-> this entity)) + (set! (-> s4-0 directed?) #f) + (set! (-> s4-0 no-initial-move-to-ground?) #f) + (set! (-> s4-0 art-level) #f) + (set! (-> s4-0 spawn-parent) (process->handle this)) + (set! (-> s4-0 message) arg0) + (set! (-> s4-0 initial-state) arg1) + (set! (-> s4-0 pos quad) (-> this root trans quad)) + (quaternion-copy! (-> s4-0 orient) (-> this root quat)) + (set! (-> this last-spawned-process) + (ppointer->handle (process-spawn saberfish this s4-0 :name "saberfish" :to arg2)) + ) + ) + (+! (-> this live-count) 1) + (set! (-> this spawned-saberfish (-> this num-spawned-saberfish)) (-> this last-spawned-process)) + (+! (-> this num-spawned-saberfish) 1) + (when (>= (-> this num-spawned-saberfish) 128) + (set! (-> this num-spawned-saberfish) 0) + 0 + ) + 0 + (none) + ) + +(deftype saberfish-spawn-manager-base (process) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (total-num-spawned int32) + (total-alive int32) + (spawn-timer time-frame) + (state-time time-frame) + (allowed-on-land-count int8) + ) + (:state-methods + active + idle + ) + (:methods + (go-active (_type_) object) + (get-alive-count (_type_) int) + (get-alive-count-grounded (_type_ int) int) + ) + ) + + +(defmethod init-from-entity! ((this saberfish-spawn-manager-base) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 2048) + (set-setting! 'gem-pool-index #f 0.0 2) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this allowed-on-land-count) 2) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this total-num-spawned) 0) + (set! (-> this total-alive) 0) + (set! (-> this spawn-timer) 0) + (go-active this) + ) + +(defmethod get-alive-count-grounded ((this saberfish-spawn-manager-base) (arg0 int)) + (with-pp + (let ((s4-0 (new 'stack-no-clear 'saberfish-spawn-query)) + (gp-0 0) + ) + (dotimes (s3-0 (-> this actor-group-count)) + (dotimes (s2-0 (-> this actor-group s3-0 length)) + (set! (-> s4-0 alive-count) 0) + (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) 'saberfish-ground-query) + (set! (-> a1-1 param 0) (the-as uint s4-0)) + (let ((t9-0 send-event-function) + (v1-7 (-> this actor-group s3-0 data s2-0 actor)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-1 + ) + ) + ) + (+! gp-0 (-> s4-0 alive-count)) + ) + ) + gp-0 + ) + ) + ) + +(defmethod get-alive-count ((this saberfish-spawn-manager-base)) + (with-pp + (let ((s4-0 (new 'stack-no-clear 'saberfish-spawn-query)) + (gp-0 0) + ) + (dotimes (s3-0 (-> this actor-group-count)) + (dotimes (s2-0 (-> this actor-group s3-0 length)) + (set! (-> s4-0 alive-count) 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) 'saberfish-spawn-query) + (set! (-> a1-0 param 0) (the-as uint s4-0)) + (let ((t9-0 send-event-function) + (v1-7 (-> this actor-group s3-0 data s2-0 actor)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-0 + ) + ) + ) + (+! gp-0 (-> s4-0 alive-count)) + ) + ) + gp-0 + ) + ) + ) + +(defstate active (saberfish-spawn-manager-base) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +(defstate idle (saberfish-spawn-manager-base) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual active) + ) + ) + ) + :code sleep-code + ) + +(defbehavior saberfish-mgr-event-handler saberfish-spawn-manager-base ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + (go-virtual active) + ) + ) + (('query-can-go-to-ground?) + (let ((gp-0 (the-as saberfish-spawner-query-msg (-> arg3 param 0))) + (v0-0 (the-as object (< (get-alive-count-grounded self arg1) (-> self allowed-on-land-count)))) + ) + (set! (-> gp-0 in-water?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + +(defmethod go-active ((this saberfish-spawn-manager-base)) + (go (method-of-object this active)) + ) + +(deftype saberfish-mgr-room1 (saberfish-spawn-manager-base) + () + ) + + +(defstate active (saberfish-mgr-room1) + :virtual #t + :event saberfish-mgr-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-command)) + (s4-0 (-> self actor-group 0 data)) + (s5-0 (-> self actor-group 0 data 1)) + ) + (set! (-> gp-0 parent) (process->handle self)) + (set! (-> gp-0 command) 'spawn-enemy) + (set! (-> gp-0 initial-state) 'saberfish-crawl-out-of-tube) + (set! (-> self allowed-on-land-count) 2) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.1)) + (suspend) + ) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-command) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-20 (-> s4-0 0 actor)) + ) + (t9-0 + (if v1-20 + (-> v1-20 extra process) + ) + a1-0 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (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) 'spawn-command) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-1 send-event-function) + (v1-33 (-> s5-0 actor)) + ) + (t9-1 + (if v1-33 + (-> v1-33 extra process) + ) + a1-1 + ) + ) + ) + (until (>= 1 (get-alive-count self)) + (suspend) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'spawn-command) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-3 send-event-function) + (v1-43 (-> s4-0 0 actor)) + ) + (t9-3 + (if v1-43 + (-> v1-43 extra process) + ) + a1-2 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1.5)) + (suspend) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'spawn-command) + (set! (-> a1-3 param 0) (the-as uint gp-0)) + (let ((t9-4 send-event-function) + (v1-56 (-> s5-0 actor)) + ) + (t9-4 + (if v1-56 + (-> v1-56 extra process) + ) + a1-3 + ) + ) + ) + (until (>= 2 (get-alive-count self)) + (suspend) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'spawn-command) + (set! (-> a1-4 param 0) (the-as uint gp-0)) + (let ((t9-6 send-event-function) + (v1-66 (-> s4-0 0 actor)) + ) + (t9-6 + (if v1-66 + (-> v1-66 extra process) + ) + a1-4 + ) + ) + ) + (set! (-> self allowed-on-land-count) 3) + (until (>= 1 (get-alive-count self)) + (suspend) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'spawn-command) + (set! (-> a1-5 param 0) (the-as uint gp-0)) + (let ((t9-8 send-event-function) + (v1-77 (-> s5-0 actor)) + ) + (t9-8 + (if v1-77 + (-> v1-77 extra process) + ) + a1-5 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.3)) + (suspend) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'spawn-command) + (set! (-> a1-6 param 0) (the-as uint gp-0)) + (let ((t9-9 send-event-function) + (v1-90 (-> s4-0 0 actor)) + ) + (t9-9 + (if v1-90 + (-> v1-90 extra process) + ) + a1-6 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'spawn-command) + (set! (-> a1-7 param 0) (the-as uint gp-0)) + (let ((t9-10 send-event-function) + (v1-102 (-> s4-0 0 actor)) + ) + (t9-10 + (if v1-102 + (-> v1-102 extra process) + ) + a1-7 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 2.5)) + (suspend) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'spawn-command) + (set! (-> a1-8 param 0) (the-as uint gp-0)) + (let ((t9-11 send-event-function) + (v1-115 (-> s5-0 actor)) + ) + (t9-11 + (if v1-115 + (-> v1-115 extra process) + ) + a1-8 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'spawn-command) + (set! (-> a1-9 param 0) (the-as uint gp-0)) + (let ((t9-13 send-event-function) + (v1-130 (-> s5-0 actor)) + ) + (t9-13 + (if v1-130 + (-> v1-130 extra process) + ) + a1-9 + ) + ) + ) + ) + (until #f + (suspend) + ) + #f + ) + ) + +(defmethod go-active ((this saberfish-mgr-room1)) + (go (method-of-object this idle)) + ) + +(deftype saberfish-mgr-room2 (saberfish-spawn-manager-base) + () + (:state-methods + stage-0 + stage-1 + stage-2 + ) + ) + + +(defmethod go-active ((this saberfish-mgr-room2)) + (cond + ((task-node-closed? (game-task-node sewer-kg-met-button0-pressed)) + (process-entity-status! this (entity-perm-status dead) #t) + (go empty-state) + ) + (else + (go (method-of-object this stage-0)) + ) + ) + ) + +(defstate stage-0 (saberfish-mgr-room2) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger-start) + (go-virtual stage-1) + ) + (else + (saberfish-mgr-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-command))) + (set! (-> gp-0 parent) (process->handle self)) + (set! (-> gp-0 command) 'spawn-enemy) + (set! (-> gp-0 initial-state) 'saberfish-sitting-on-land) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.1)) + (suspend) + ) + (set! (-> self allowed-on-land-count) 3) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-command) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-18 (-> self actor-group 1 data 0 actor)) + ) + (t9-0 + (if v1-18 + (-> v1-18 extra process) + ) + a1-0 + ) + ) + ) + (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) 'spawn-command) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-1 send-event-function) + (v1-27 (-> self actor-group 1 data 1 actor)) + ) + (t9-1 + (if v1-27 + (-> v1-27 extra process) + ) + a1-1 + ) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'spawn-command) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-2 send-event-function) + (v1-36 (-> self actor-group 1 data 2 actor)) + ) + (t9-2 + (if v1-36 + (-> v1-36 extra process) + ) + a1-2 + ) + ) + ) + ) + (sleep-code) + ) + ) + +(defstate stage-1 (saberfish-mgr-room2) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual stage-2) + ) + (else + (saberfish-mgr-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (let ((v1-0 (new 'stack-no-clear 'saberfish-spawner-command))) + (set! (-> v1-0 parent) (process->handle self)) + ) + (set! (-> self allowed-on-land-count) 4) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'forward-event) + (set! (-> a1-4 param 0) (the-as uint 'saberfish-command)) + (set! (-> a1-4 param 1) (the-as uint 'go-alive)) + (let ((t9-0 send-event-function) + (v1-16 (-> self actor-group 1 data 0 actor)) + ) + (t9-0 + (if v1-16 + (-> v1-16 extra process) + ) + a1-4 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 2) + (set! (-> a1-5 message) 'forward-event) + (set! (-> a1-5 param 0) (the-as uint 'saberfish-command)) + (set! (-> a1-5 param 1) (the-as uint 'go-alive)) + (let ((t9-1 send-event-function) + (v1-33 (-> self actor-group 1 data 1 actor)) + ) + (t9-1 + (if v1-33 + (-> v1-33 extra process) + ) + a1-5 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'forward-event) + (set! (-> a1-6 param 0) (the-as uint 'saberfish-command)) + (set! (-> a1-6 param 1) (the-as uint 'go-alive)) + (let ((t9-2 send-event-function) + (v1-50 (-> self actor-group 1 data 2 actor)) + ) + (t9-2 + (if v1-50 + (-> v1-50 extra process) + ) + a1-6 + ) + ) + ) + (sleep-code) + ) + ) + +(defstate stage-2 (saberfish-mgr-room2) + :virtual #t + :event saberfish-mgr-event-handler + :enter (behavior () + '() + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-command))) + (set! (-> gp-0 parent) (process->handle self)) + (set! (-> gp-0 command) 'spawn-enemy) + (set! (-> gp-0 initial-state) 'saberfish-swimming) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-command) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-11 (-> self actor-group 2 data 0 actor)) + ) + (t9-0 + (if v1-11 + (-> v1-11 extra process) + ) + a1-0 + ) + ) + ) + (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) 'spawn-command) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-1 send-event-function) + (v1-20 (-> self actor-group 2 data 1 actor)) + ) + (t9-1 + (if v1-20 + (-> v1-20 extra process) + ) + a1-1 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (set! (-> gp-0 initial-state) 'saberfish-crawl-out-of-tube) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'spawn-command) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-3 send-event-function) + (v1-39 (-> self actor-group 0 data 1 actor)) + ) + (t9-3 + (if v1-39 + (-> v1-39 extra process) + ) + a1-2 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'spawn-command) + (set! (-> a1-3 param 0) (the-as uint gp-0)) + (let ((t9-4 send-event-function) + (v1-54 (-> self actor-group 0 data 0 actor)) + ) + (t9-4 + (if v1-54 + (-> v1-54 extra process) + ) + a1-3 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'spawn-command) + (set! (-> a1-4 param 0) (the-as uint gp-0)) + (let ((t9-6 send-event-function) + (v1-72 (-> self actor-group 0 data 0 actor)) + ) + (t9-6 + (if v1-72 + (-> v1-72 extra process) + ) + a1-4 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'spawn-command) + (set! (-> a1-5 param 0) (the-as uint gp-0)) + (let ((t9-7 send-event-function) + (v1-87 (-> self actor-group 0 data 1 actor)) + ) + (t9-7 + (if v1-87 + (-> v1-87 extra process) + ) + a1-5 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (until (>= 4 (get-alive-count self)) + (suspend) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'spawn-command) + (set! (-> a1-6 param 0) (the-as uint gp-0)) + (let ((t9-9 send-event-function) + (v1-105 (-> self actor-group 0 data 0 actor)) + ) + (t9-9 + (if v1-105 + (-> v1-105 extra process) + ) + a1-6 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 2 (get-alive-count self)) + (suspend) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'spawn-command) + (set! (-> a1-7 param 0) (the-as uint gp-0)) + (let ((t9-11 send-event-function) + (v1-123 (-> self actor-group 0 data 0 actor)) + ) + (t9-11 + (if v1-123 + (-> v1-123 extra process) + ) + a1-7 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'spawn-command) + (set! (-> a1-8 param 0) (the-as uint gp-0)) + (let ((t9-12 send-event-function) + (v1-138 (-> self actor-group 0 data 0 actor)) + ) + (t9-12 + (if v1-138 + (-> v1-138 extra process) + ) + a1-8 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1.5)) + (suspend) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'spawn-command) + (set! (-> a1-9 param 0) (the-as uint gp-0)) + (let ((t9-13 send-event-function) + (v1-153 (-> self actor-group 0 data 1 actor)) + ) + (t9-13 + (if v1-153 + (-> v1-153 extra process) + ) + a1-9 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) (process->ppointer self)) + (set! (-> a1-10 num-params) 1) + (set! (-> a1-10 message) 'spawn-command) + (set! (-> a1-10 param 0) (the-as uint gp-0)) + (let ((t9-14 send-event-function) + (v1-168 (-> self actor-group 0 data 0 actor)) + ) + (t9-14 + (if v1-168 + (-> v1-168 extra process) + ) + a1-10 + ) + ) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 1) + (set! (-> a1-11 message) 'spawn-command) + (set! (-> a1-11 param 0) (the-as uint gp-0)) + (let ((t9-16 send-event-function) + (v1-180 (-> self actor-group 0 data 1 actor)) + ) + (t9-16 + (if v1-180 + (-> v1-180 extra process) + ) + a1-11 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer self)) + (set! (-> a1-12 num-params) 1) + (set! (-> a1-12 message) 'spawn-command) + (set! (-> a1-12 param 0) (the-as uint gp-0)) + (let ((t9-17 send-event-function) + (v1-195 (-> self actor-group 0 data 1 actor)) + ) + (t9-17 + (if v1-195 + (-> v1-195 extra process) + ) + a1-12 + ) + ) + ) + ) + (sleep-code) + ) + ) diff --git a/goal_src/jak3/levels/sewer/saberfish.gc b/goal_src/jak3/levels/sewer/saberfish.gc index 884fc7df38..c875528628 100644 --- a/goal_src/jak3/levels/sewer/saberfish.gc +++ b/goal_src/jak3/levels/sewer/saberfish.gc @@ -5,5 +5,3687 @@ ;; name in dgo: saberfish ;; dgos: SEA +(define-extern find-ground-for-obj (function process-focusable int)) + +;; +++saberfish-query-type +(defenum saberfish-query-type + :type uint64 + (set-nav-idx) + (set-mesh) + (set-in-water) + (can-go-to-ground?) + ) +;; ---saberfish-query-type + + +;; +++saberfish-find-behavior +(defenum saberfish-find-behavior + :type uint64 + (none) + (behavior1) + (behavior2) + ) +;; ---saberfish-find-behavior + + +;; +++saberfish-command +(defenum saberfish-command + :type int32 + (attack 0) + (hostile-orient 1) + (hostile 2) + (spin-attack 3) + (stare 4) + (start-terrain-transition 5) + ) +;; ---saberfish-command + + ;; DECOMP BEGINS +(defskelgroup skel-saberfish saberfish saberfish-lod0-jg saberfish-idle-ja + ((saberfish-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + :shadow saberfish-shadow-mg + ) + +(deftype saberfish-jump-info (structure) + ((windup-anim uint32) + (air-anim uint32) + (land-anim uint32) + ) + :pack-me + ) + + +(deftype saberfish-init-by-other-params (enemy-init-by-other-params) + ((spawn-parent handle) + (message symbol) + (pos vector :inline) + (orient quaternion :inline) + (initial-state symbol) + ) + ) + + +(deftype saberfish-spawner-query-msg (structure) + ((query-type saberfish-query-type) + (closest-nav-mesh-index int8) + (pos vector :inline) + (behavior saberfish-find-behavior) + (nav-mesh-index int8 :overlay-at closest-nav-mesh-index) + (mesh nav-mesh :overlay-at (-> pos data 0)) + (in-water? symbol :offset 40) + (can-go-to-ground? symbol :overlay-at in-water?) + ) + ) + + +;; WARN: Return type mismatch int vs saberfish-find-behavior. +(defun find-behavior<-in-water? ((arg0 symbol)) + (the-as saberfish-find-behavior (if arg0 + (the-as saberfish-find-behavior (saberfish-find-behavior behavior1)) + (the-as saberfish-find-behavior (saberfish-find-behavior behavior2)) + ) + ) + ) + +(defun in-water<-find-behavior ((arg0 saberfish-find-behavior)) + (case arg0 + (((saberfish-find-behavior behavior1)) + #t + ) + (((saberfish-find-behavior behavior2)) + #f + ) + (else + #f + ) + ) + ) + +(deftype saberfish (nav-enemy) + ((initial-y-angle float) + (last-attack-time time-frame) + (in-pursuit? symbol) + (flee-to-readjust? symbol) + (use-stored-flee-point? symbol) + (scare-start-time time-frame) + (scare-time time-frame) + (jump-point-start vector :inline) + (jump-point-end vector :inline) + (jump saberfish-jump-info :inline :offset 708) + (flee-point-temp vector :inline) + (last-land-check-time time-frame) + (last-target-check-time time-frame) + (is-submerged? symbol) + (current-nav-mesh-index int8) + (dest-nav-mesh-index int8) + (desired-dest-nav-point vector :inline) + (desired-dest-mesh-index int8) + (flee-point vector :inline) + (spawn-parent handle) + (pos-start vector :inline) + (quat-start quaternion :inline) + (move-to-ground? symbol) + (swim-final-rotate-deg float) + (swim-travel-anim int8) + (swim-speed float) + (swim-rotate-last-dot float) + (swim-anim-last-dot float) + (last-swim-flip-time time-frame) + (saberfish-y-rotate float) + (doing-180-spin? symbol) + (adjusted-y-yet? symbol) + (attack-dir vector :inline) + (rotate-anim-quat quaternion :inline) + (post-spinflip-expected-heading vector :inline) + (nav-velocity vector :inline) + (nav-dir vector :inline) + (initial-state symbol) + (knocked-under-water? symbol) + (ground-state uint8) + (jump-start-ground-state uint8) + (ground-only? symbol) + ) + (:state-methods + attack + hostile-orient + swimming-hostile + spin-attack + stare-idle + undefined0 + transition-terrain-move-towards-initial-jump + transition-terrain-orient-towards-initial-jump + transition-terrain-jump + undefined1 + water-land + undefined2 + undefined3 + base-saberfish-state + diving-into-water + water-impact + command-mode + swim-180-spin + swimming-base + saberfish-crawl-out-of-tube + undefined4 + saberfish-sitting-on-land + knocked-recover-water + saberfish-swimming + ) + (:methods + (saberfish-method-214 (_type_ vector) float) + (saberfish-method-215 (_type_) float) + (get-cmd (_type_) saberfish-command) + (saberfish-method-217 (_type_) none) + (saberfish-method-218 (_type_) none) + (saberfish-method-219 (_type_) none) + (saberfish-method-220 (_type_) none) + (handle-cmd (_type_ saberfish-command) object) + (attack-delay-elapsed? (_type_) symbol) + (saberfish-method-223 (_type_) none) + (go-terrain-transition (_type_ symbol) object) + (get-nav-mesh-idx (_type_ vector saberfish-find-behavior) int) + (start-terrain-transition (_type_) object) + (desired-nav-idx-valid? (_type_) symbol) + (saberfish-method-228 (_type_) symbol) + (set-dest-nav! (_type_ vector saberfish-find-behavior) none) + (change-nav-mesh (_type_) none) + (saberfish-method-231 (_type_ vector float symbol vector) symbol) + (do-jump (_type_) object) + (saberfish-method-233 (_type_) nav-poly) + (saberfish-method-234 (_type_ vector) none) + (on-submerged (_type_ symbol) none) + (saberfish-method-236 (_type_ int) nav-mesh) + (saberfish-method-237 (_type_ int) symbol) + (saberfish-method-238 (_type_ symbol float float) object) + (saberfish-method-239 (_type_ vector) float) + (saberfish-method-240 (_type_ time-frame) none) + (saberfish-method-241 (_type_) symbol) + (get-ground-state (_type_) int) + (saberfish-method-243 (_type_) symbol) + (set-should-move-to-ground (_type_) none) + ) + (:states + transition-terrain-jump-from-land + transition-terrain-jump-from-water + ) + ) + + +(defstate base-saberfish-state (saberfish) + :virtual #t + :event enemy-event-handler + :code sleep-code + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(define *saberfish-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 4 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 5 + :hit-anim 3 + :knocked-anim 11 + :knocked-land-anim 12 + :die-anim 11 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 13 + :look-at-joint 14 + :bullseye-joint 20 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd water) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.96 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list water pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 61440.0 + :knocked-medium-vxz-hi 61440.0 + :knocked-medium-vy-lo 49152.0 + :knocked-medium-vy-hi 69632.0 + :knocked-hard-vxz-lo 61440.0 + :knocked-hard-vxz-hi 90112.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 73728.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 61440.0 + :knocked-yellow-vxz-hi 61440.0 + :knocked-yellow-vy-lo 49152.0 + :knocked-yellow-vy-hi 69632.0 + :knocked-red-vxz-lo 61440.0 + :knocked-red-vxz-hi 90112.0 + :knocked-red-vy-lo 49152.0 + :knocked-red-vy-hi 73728.0 + :knocked-blue-vxz-lo 20480.0 + :knocked-blue-vxz-hi 28672.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9983 :y -0.0558 :z 0.0132 :w 27913.42) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9155 :y 0.3114 :z -0.2546 :w 18151.014) + :geo-tform (new 'static 'vector :x -1.0 :w 10.176285) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 27209.91) + :geo-tform (new 'static 'vector :x -0.9985 :y 0.0536 :z -0.0019 :w 20896.482) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0165 :z -0.9998 :w 19429.002) + :geo-tform (new 'static 'vector :x 0.2521 :y 0.9606 :z -0.1166 :w 20369.662) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2289 :z -0.9734 :w 4466.9336) + :geo-tform (new 'static 'vector :x 0.2309 :y 0.4174 :z 0.8788 :w 26025.31) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9134 :z 0.407 :w 21663.545) + :geo-tform (new 'static 'vector :x -0.4328 :y 0.8967 :z 0.0917 :w 27352.541) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.21 :z 0.9776 :w 14450.142) + :geo-tform (new 'static 'vector :x 0.6331 :y -0.6641 :z 0.3975 :w 19916.846) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.262 :z 0.965 :w 13256.131) + :geo-tform (new 'static 'vector :x -0.0466 :y 0.5681 :z 0.8215 :w 40370.1) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8605 :z -0.5094 :w 18296.832) + :geo-tform (new 'static 'vector :x 0.3835 :y -0.2752 :z 0.8815 :w 26565.291) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.8653 :z -0.5012 :w 1296.8118) + :geo-tform (new 'static 'vector :x -0.9994 :y 0.0297 :z 0.015 :w 17863.275) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3818 :z -0.9242 :w 259.39514) + :geo-tform (new 'static 'vector :x -0.9903 :y -0.0926 :z 0.1029 :w 15323.264) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.5325 :z 0.8464 :w 2252.818) + :geo-tform (new 'static 'vector :x -0.9999 :y 0.0039 :z 0.0062 :w 16416.531) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1966.4896 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.794 :z 0.6078 :w 42.30713) + :geo-tform (new 'static 'vector :x -0.9999 :y 0.005 :z 0.005 :w 16384.236) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1553.6128 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 862.1079) + :geo-tform (new 'static 'vector :x -0.9972 :y -0.006 :z -0.0739 :w 5204.942) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2452.6848 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9971 :z -0.0754 :w 5204.851) + :geo-tform (new 'static 'vector :x -0.4775 :y -0.1888 :z -0.858 :w 1142.2561) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7479 :z -0.6637 :w 1560.7944) + :geo-tform (new 'static 'vector :x -0.7484 :y -0.1026 :z -0.6552 :w 1775.261) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7465 :z -0.6652 :w 1765.8129) + :geo-tform (new 'static 'vector :x -0.9932 :y -0.107 :z -0.0452 :w 16973.86) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.119 :z -0.9928 :w 16093.275) + :geo-tform (new 'static 'vector :x 0.5242 :y 0.8508 :z 0.035 :w 33237.656) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3382 :z -0.941 :w 11515.366) + :geo-tform (new 'static 'vector :x -0.2239 :y -0.4468 :z 0.8661 :w 25938.275) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9222 :z 0.3865 :w 21078.58) + :geo-tform (new 'static 'vector :x 0.4237 :y 0.5776 :z 0.6976 :w 37524.24) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5995 :z -0.8003 :w 19175.633) + :geo-tform (new 'static 'vector :x 0.0961 :y 0.9634 :z 0.2499 :w 40414.94) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2235.5967 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 20 + :pre-tform (new 'static 'vector :x -0.9723 :z 0.2333 :w 1824.8136) + :geo-tform (new 'static 'vector :x -0.9803 :y -0.1799 :z -0.0811 :w 15291.715) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8223 :z 0.5689 :w 2307.7227) + :geo-tform (new 'static 'vector :x 0.2202 :y -0.8918 :z 0.3952 :w 3410.111) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3544 :z 0.935 :w 1537.347) + :geo-tform (new 'static 'vector :x -0.0081 :y -0.9942 :z 0.1065 :w 2835.7427) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1642.0864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2096 :z 0.9777 :w 302.33942) + :geo-tform (new 'static 'vector :x -0.6496 :y -0.7587 :z 0.0484 :w 5384.1646) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1437.2864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint 20 + :pre-tform (new 'static 'vector :x -0.1904 :z 0.9817 :w 17496.0) + :geo-tform (new 'static 'vector :x -0.6922 :y 0.5601 :z -0.455 :w 15608.09) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9013 :z -0.4331 :w 10963.08) + :geo-tform (new 'static 'vector :x 0.7074 :y -0.0914 :z -0.7007 :w 22558.492) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8192 :z -0.5734 :w 22395.672) + :geo-tform (new 'static 'vector :x 0.9857 :y -0.1663 :z -0.0232 :w 40309.043) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9055 :z -0.4242 :w 41043.812) + :geo-tform (new 'static 'vector :x -0.4884 :y 0.8434 :z 0.2236 :w 10095.093) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + ) + ) + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 14 + :gem-seg #x2 + :gem-offset (new 'static 'sphere :y 1511.424 :z 700.416 :r 327680.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 6 + :turn-anim -1 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 60) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 1) + :maximum-rotation-rate (degrees 180) + :notice-nav-radius (meters 2) + :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! (-> *saberfish-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod init-enemy-collision! ((this saberfish)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot player-list water)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 24576.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd water)) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 -4096.0 0.0 6144.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd water)) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 4096.0 0.0 6144.0) + ) + (set-vector! + (-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere) + 0.0 + 4505.6 + 0.0 + 4505.6 + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid deadly no-standon)) + (set! (-> v1-19 transform-index) 14) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 6144.0 4505.6) + ) + (set! (-> s5-0 nav-radius) 10240.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + 0 + (none) + ) + +(defbehavior get-spawn-parent saberfish () + (handle->process (-> self spawn-parent)) + ) + +(defmethod init-enemy! ((this saberfish)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-saberfish" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *saberfish-nav-enemy-info*) + (set! (-> this last-attack-time) 0) + (set! (-> this scare-start-time) 0) + (set! (-> this scare-time) 0) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flag part-splash part-water find-water)) + (water-control-method-10 (-> this water)) + (set! (-> this last-swim-flip-time) 0) + (set! (-> this doing-180-spin?) #f) + (set! (-> this fact pickup-type) (pickup-type eco-pill-dark)) + (if (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 11)) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (when (nonzero? (-> this neck)) + (let ((v1-20 (-> this neck))) + (set! (-> v1-20 ear) (the-as uint 0)) + (set! (-> v1-20 up) (the-as uint 1)) + (set! (-> v1-20 nose) (the-as uint 2)) + (set-vector! (-> v1-20 twist-max) 8192.0 11832.889 0.0 1.0) + (set! (-> v1-20 ignore-angle) 30947.555) + ) + ) + (set! (-> this current-nav-mesh-index) -1) + (cond + ((not (-> this ground-only?)) + (change-nav-mesh this) + ) + (else + (set! (-> this current-nav-mesh-index) 0) + (change-to (-> *saberfish-nav-enemy-info* nav-mesh) this) + ) + ) + (set! (-> *saberfish-nav-enemy-info* nav-mesh) #f) + (set-should-move-to-ground this) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this in-pursuit?) #t) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (set! (-> this scare-time) 0) + (set! (-> this desired-dest-mesh-index) (-> this current-nav-mesh-index)) + (set! (-> this is-submerged?) #f) + (set! (-> this root trans quad) (-> this pos-start quad)) + (quaternion-copy! (-> this root quat) (-> this quat-start)) + (set! (-> this move-to-ground?) #f) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-1 frame-num) 0.0) + ) + (ja-post) + (logior! (-> this fact options) (actor-option suck-in)) + 0 + (none) + ) + +(defmethod saberfish-method-220 ((this saberfish)) + (when (< 2 (the-as int (-> this focus aware))) + (let ((s4-0 (handle->process (-> this focus handle)))) + (when s4-0 + (let ((s5-0 (or (focus-test? (the-as process-focusable s4-0) touch-water on-water under-water) + (and (-> (the-as process-focusable s4-0) water) + (logtest? (water-flag touch-water) (-> (the-as process-focusable s4-0) water flags)) + ) + ) + ) + ) + (when (not s5-0) + (case (find-ground-for-obj (the-as process-focusable s4-0)) + ((3 1) + (set! s5-0 #t) + ) + ) + ) + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s4-0) 0) quad)) + (set-dest-nav! this (-> this focus-pos) (find-behavior<-in-water? (the-as symbol s5-0))) + ) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod saberfish-method-217 ((this saberfish)) + (cond + ((and (< (vector-vector-distance (-> this focus-pos) (-> this root trans)) 28672.0) + (get-focus! this) + (time-elapsed? (-> this last-attack-time) (seconds 1)) + ) + #t + ) + (else + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs saberfish-command. +(defmethod get-cmd ((this saberfish)) + (saberfish-method-220 this) + (let ((f30-0 (vector-vector-distance (-> this focus-pos) (-> this root trans))) + (f28-0 28672.0) + (gp-0 #f) + ) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (set! f28-0 (* 1.5 f28-0)) + ) + (let ((s4-1 + (cond + ((and (-> this ground-only?) (!= (find-nearest-nav-mesh (target-pos 0) 8192.0) (-> this nav state mesh))) + (the-as saberfish-command (saberfish-command stare)) + ) + ((and (not (-> this ground-only?)) (or (saberfish-method-228 this) (nav-enemy-method-174 this))) + (the-as saberfish-command (saberfish-command start-terrain-transition)) + ) + (else + (the-as + saberfish-command + (cond + ((< 61440.0 f30-0) + (saberfish-command hostile) + ) + (else + (let ((f0-2 (saberfish-method-215 this))) + 0.0 + (if (and (!= (* 20480.0 (the float (the int (* 0.000048828126 (+ 10240.0 (fabs f0-2)))))) 0.0) + (not (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere))) + ) + (set! gp-0 #t) + ) + (cond + ((and (>= 8192.0 (fabs f0-2)) (>= f28-0 f30-0) (< 16384.0 f30-0)) + (the-as saberfish-command (saberfish-command attack)) + ) + ((>= 28672.0 f30-0) + (the-as saberfish-command (saberfish-command spin-attack)) + ) + ((and (>= 10922.667 (fabs f0-2)) (< f28-0 f30-0)) + (the-as saberfish-command (saberfish-command hostile)) + ) + (else + (the-as saberfish-command (saberfish-command stare)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-43 (handle->process (-> this focus handle)))) + (when (or (not v1-43) + (or (not (and v1-43 + (not (logtest? (-> (the-as process-focusable v1-43) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + (not (attack-delay-elapsed? this)) + ) + ) + (let ((v1-51 (the-as int s4-1))) + (if (or (zero? v1-51) (= v1-51 3)) + (set! s4-1 (saberfish-command stare)) + ) + ) + ) + ) + (set! gp-0 (and (= (the-as int s4-1) 4) gp-0)) + (if gp-0 + (set! s4-1 (saberfish-command hostile-orient)) + ) + (the-as saberfish-command s4-1) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior saberfish-water-post saberfish () + (none) + ) + +(defbehavior saberfish-chase-post saberfish () + (local-vars (v1-10 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (get-trans (the-as process-focusable a0-1) 1))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> self root trans) gp-0) + (let ((f0-0 16384.0)) + (.lvf vf1 (&-> s5-0 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-10 vf1) + (if (< f0-0 v1-10) + (vector-normalize! s5-0 16384.0) + ) + ) + (vector+! gp-0 gp-0 s5-0) + ) + (let ((v1-15 (-> self nav state))) + (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-15 target-pos quad) (-> gp-0 quad)) + ) + ) + 0 + ) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + ) + +(defstate hit (saberfish) + :virtual #t + :enter (behavior () + (sound-play "sabfish-gethit") + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +(defstate hostile (saberfish) + :virtual #t + :enter (behavior () + (if (saberfish-method-243 self) + (go-virtual swimming-hostile) + ) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (if a0-1 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + ) + ) + (let ((a1-2 (get-cmd self))) + (if (or (not (and (-> self next-state) (= (-> self next-state name) 'hostile))) (!= a1-2 2)) + (handle-cmd self a1-2) + ) + ) + (let ((t9-4 (-> (find-parent-state) trans))) + (if t9-4 + (t9-4) + ) + ) + ) + :post saberfish-chase-post + ) + +(defmethod handle-cmd ((this saberfish) (arg0 saberfish-command)) + (case arg0 + (((saberfish-command start-terrain-transition)) + (start-terrain-transition this) + ) + (((saberfish-command attack)) + (go (method-of-object this attack)) + ) + (((saberfish-command hostile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) + ) + ) + (((saberfish-command spin-attack)) + (go (method-of-object this spin-attack)) + ) + (((saberfish-command hostile-orient)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile-orient))) + (go (method-of-object this hostile-orient)) + ) + ) + (((saberfish-command stare)) + (if (and (not (and (-> this next-state) (= (-> this next-state name) 'stare))) + (not (and (-> this next-state) (= (-> this next-state name) 'stare-idle))) + ) + (go (method-of-object this stare)) + ) + ) + ) + ) + +(defmethod saberfish-method-215 ((this saberfish)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (when a0-2 + (let ((a1-2 (get-trans (the-as process-focusable a0-2) 0))) + (saberfish-method-214 this a1-2) + ) + ) + ) + ) + +(defmethod saberfish-method-214 ((this saberfish) (arg0 vector)) + (let ((gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + 0.0 + 0.0 + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 3 prim-core) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + 0.0 + (set! (-> s4-1 y) 0.0) + (set! (-> gp-0 y) 0.0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s4-1 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s5-0 1.0) + (let ((f0-7 (acos (vector-dot s4-1 s5-0)))) + (if (< (vector-dot s4-1 gp-0) 0.0) + (set! f0-7 (* -1.0 f0-7)) + ) + f0-7 + ) + ) + ) + ) + +(defbehavior saberfish-orient-code-setup saberfish () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! saberfish-turn-ja :num! (loop!) :frame-num 0.0) + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defbehavior saberfish-orient-code-single-pass saberfish ((arg0 float)) + (* 0.00006510417 (the float (ja-num-frames 0))) + (let ((f30-1 (if (< arg0 0.0) + -1.0 + 1.0 + ) + ) + (f24-0 (ja-frame-num 0)) + (f28-0 1.3333333) + ) + 0.0 + (let ((f26-0 (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + -1.0 + 1.0 + ) + ) + (gp-1 (* 20480.0 (the float (the int (* 0.000048828126 (+ arg0 (* 10240.0 f30-1))))))) + ) + (when (!= gp-1 0.0) + (until #f + (let ((f22-0 (ja-frame-num 0))) + 0.0 + (let ((f0-10 (* f30-1 f26-0))) + (when (or (and (< f0-10 0.0) (< f24-0 f22-0)) (and (< 0.0 f0-10) (< f22-0 f24-0))) + 0 + (goto cfg-25) + ) + ) + (let ((f0-15 (* (fmin (* 15360.0 (seconds-per-frame) f28-0) (fabs gp-1)) f30-1))) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) f0-15) + ) + (ja :num! (loop! (* f28-0 f30-1 f26-0))) + (set! f24-0 f22-0) + ) + (suspend) + 0 + ) + #f + ) + (label cfg-25) + gp-1 + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior saberfish-orient-code saberfish () + (saberfish-orient-code-setup) + (until #f + (let ((f0-0 (saberfish-method-215 self))) + (saberfish-orient-code-single-pass f0-0) + ) + (let ((a1-0 (get-cmd self))) + (handle-cmd self a1-0) + ) + ) + #f + (none) + ) + +(defstate hostile-orient (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (stop-look-at! self) + ) + :exit (behavior () + (set-look-at-mode! self 1) + ) + :code saberfish-orient-code + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(defstate stare-idle (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (set-look-at-mode! self 1) + ) + :trans (behavior () + (let ((a1-0 (get-cmd self))) + (if (!= a1-0 (saberfish-command stare)) + (handle-cmd self a1-0) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! saberfish-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(defstate stare (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (if (saberfish-method-243 self) + (go-virtual swimming-hostile) + ) + (nav-enemy-method-182 self) + (stop-look-at! self) + ) + :exit (behavior () + (set-look-at-mode! self 1) + ) + :trans (behavior () + '() + ) + :code (behavior () + (saberfish-orient-code-setup) + (until #f + (let ((f0-0 (saberfish-method-215 self))) + (saberfish-orient-code-single-pass f0-0) + ) + (let ((a1-0 (get-cmd self))) + (case a1-0 + (((saberfish-command stare)) + (go-virtual stare-idle) + ) + (else + (handle-cmd self a1-0) + ) + ) + ) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(defstate attack (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (stop-look-at! self) + ) + :exit (behavior () + (set-look-at-mode! self 1) + (set-time! (-> self last-attack-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! saberfish-attack-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 5)) + 0.0 + (let ((f0-5 (saberfish-method-215 self))) + 0.0 + (let ((f30-0 (* 0.06666667 (the float gp-0)))) + (let ((f1-5 (fmin (* (/ 8192.0 f30-0) (seconds-per-frame)) (fabs f0-5)))) + (if (< f0-5 0.0) + (set! f1-5 (* -1.0 f1-5)) + ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) f1-5) + ) + (when (>= 5.0 (ja-frame-num 0)) + (let ((v1-29 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector+float*! (-> self root trans) (-> self root trans) v1-29 (* (/ 8192.0 f30-0) (seconds-per-frame))) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (dotimes (gp-1 1) + (ja-no-eval :group! saberfish-attack-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (logclear! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! saberfish-attack-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-2 (ja-num-frames 0)) + (v1-83 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (vector+float*! + (-> self root trans) + (-> self root trans) + v1-83 + (* -8192.0 (seconds-per-frame) (/ 15.0 (the float gp-2))) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual hostile) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(defmethod saberfish-method-218 ((this saberfish)) + 0 + (none) + ) + +(defmethod saberfish-method-234 ((this saberfish) (arg0 vector)) + (let ((s4-0 (saberfish-method-233 this)) + (a0-3 (saberfish-method-236 this (-> this current-nav-mesh-index))) + (t0-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info)) + ) + (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)) + (when a0-3 + (set! (-> arg0 y) 0.0) + (clamp-vector-to-mesh-no-gaps a0-3 (-> this root trans) s4-0 arg0 t0-0) + ) + ) + 0 + (none) + ) + +(defstate water-land (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (on-submerged self #f) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (vector+float*! gp-0 (-> self root trans) s5-0 81920.0) + (let ((v1-8 (-> self nav state))) + (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + ) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self nav flags) (nav-control-flag use-momentum)) + ) + :trans (behavior () + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 81920.0 (seconds-per-frame)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (gp-0 1) + (ja-no-eval :group! saberfish-swim-burst-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual swimming-hostile) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate swim-180-spin (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + (stop-look-at! self) + (set! (-> self swim-speed) 57344.0) + (set-time! (-> self state-time)) + (let ((a1-0 (-> self nav state)) + (v1-8 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-8 quad) (-> a1-0 target-pos quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + 0.0 + (vector-! gp-0 (-> self root trans) v1-8) + (set! (-> gp-0 y) 0.0) + (when (< (vector-normalize-ret-len! gp-0 1.0) 20480.0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (saberfish-method-231 self s5-0 4551.1113 #t gp-0) + (let ((v1-13 (-> self nav state))) + (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-13 target-pos quad) (-> s5-0 quad)) + ) + ) + 0 + ) + ) + ) + ) + :exit (behavior () + (set! (-> self root transv y) 0.0) + (set! (-> self adjusted-y-yet?) #f) + (set! (-> self saberfish-y-rotate) 0.0) + (vector-z-quaternion! (-> self nav-velocity) (-> self root quat)) + (set! (-> self nav-velocity y) 0.0) + (vector-normalize! (-> self nav-velocity) 1.0) + (set! (-> self nav-dir quad) (-> self nav-velocity quad)) + (set! (-> self doing-180-spin?) #f) + (set-time! (-> self last-swim-flip-time)) + (set! (-> self saberfish-y-rotate) 0.0) + ) + :code (behavior () + (local-vars (sv-144 vector)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! saberfish-swim-180-turn-ja) + (set! (-> self doing-180-spin?) #t) + (quaternion-copy! (-> self rotate-anim-quat) (-> self root quat)) + (vector-z-quaternion! (-> self post-spinflip-expected-heading) (-> self root quat)) + (set! (-> self post-spinflip-expected-heading y) 0.0) + (vector-normalize! (-> self post-spinflip-expected-heading) 1.0) + (vector-float*! (-> self post-spinflip-expected-heading) (-> self post-spinflip-expected-heading) -1.0) + (let ((gp-0 #f)) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (set! (-> self root transv quad) (the-as uint128 0)) + (vector-float*! (-> self root transv) (-> self root transv) -1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (set! (-> self root transv quad) (the-as uint128 0)) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (quaternion-normalize! + (quaternion*! (-> self rotate-anim-quat) (-> self rotate-anim-quat) (-> self align delta quat)) + ) + (quaternion-copy! (-> self root quat) (-> self rotate-anim-quat)) + (when (< 3.0 (ja-frame-num 0)) + (let ((a0-16 (-> self nav state)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 quad) (-> a0-16 travel quad)) + (let ((s3-0 (new 'stack-no-clear 'quaternion)) + (s5-1 (new 'stack-no-clear 'quaternion)) + ) + (let ((s4-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) + 0.0 + (vector-normalize! s2-0 1.0) + (when (< 4.0 (ja-frame-num 0)) + (when (not gp-0) + (set! gp-0 #t) + (let ((a1-10 (new 'stack-no-clear 'vector))) + (set! (-> a1-10 quad) (-> self root trans quad)) + (splash-spawn 0.0 a1-10 1) + ) + ) + ) + (when (< 5.0 (ja-frame-num 0)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (f30-5 (/ (+ -5.0 (ja-frame-num 0)) (+ -5.0 (the float (ja-num-frames 0))))) + ) + (let ((s0-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> s0-0 y) 0.0) + (vector-normalize! s0-0 1.0) + (vector-lerp! s1-0 s0-0 s2-0 f30-5) + ) + (let ((s1-1 (-> self root trans)) + (s0-1 (-> self root trans)) + ) + (set! sv-144 s2-0) + (let ((f0-13 (* (lerp 0.0 57344.0 f30-5) (seconds-per-frame)))) + (vector+float*! s1-1 s0-1 sv-144 f0-13) + ) + ) + ) + ) + (let ((f30-6 (vector-dot (-> self post-spinflip-expected-heading) s2-0))) + (cond + ((< 0.9999 f30-6) + (quaternion-identity! s3-0) + ) + (else + (let ((s1-4 (vector-cross! (new 'stack-no-clear 'vector) (-> self post-spinflip-expected-heading) s2-0))) + (vector-normalize! s1-4 1.0) + (quaternion-vector-angle! s3-0 s1-4 (acos f30-6)) + ) + ) + ) + ) + (let ((f0-20 (/ (+ -3.0 (ja-frame-num 0)) (+ -3.0 (the float (ja-num-frames 0)))))) + (quaternion-slerp! s5-1 s4-0 s3-0 f0-20) + ) + ) + (quaternion*! (-> self root quat) (-> self rotate-anim-quat) s5-1) + ) + ) + ) + ) + (ja :num! (seek!)) + (suspend) + ) + ) + (go-virtual swimming-hostile) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior saberfish-swim-code saberfish () + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 saberfish-swim-burst-ja))) + (ja-channel-push! 3 (seconds 0.2)) + (ja :group! saberfish-swim-burst-ja) + (ja :chan 1 :group! saberfish-swim-turn-left-ja) + (ja :chan 2 :group! saberfish-swim-turn-right-ja) + ) + ) + (until #f + (let* ((f0-1 (* 0.000061035156 (-> self swim-final-rotate-deg))) + (f0-2 (fmin 1.0 f0-1)) + ) + (let ((v1-19 (-> self skel root-channel 0)) + (f1-3 (- 1.0 f0-2)) + ) + (set! (-> v1-19 frame-interp 1) f1-3) + (set! (-> v1-19 frame-interp 0) f1-3) + ) + (ja :chan (-> self swim-travel-anim) :frame-interp0 f0-2 :frame-interp1 f0-2) + ) + (let ((v1-27 (-> self skel root-channel (- 3 (-> self swim-travel-anim)))) + (f0-3 0.0) + ) + (set! (-> v1-27 frame-interp 1) f0-3) + (set! (-> v1-27 frame-interp 0) f0-3) + ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (suspend) + ) + #f + (none) + ) + +(defmethod saberfish-method-239 ((this saberfish) (arg0 vector)) + (when (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (let ((v1-3 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((f0-0 (-> this swim-speed))) + 0.0 + 0.0 + (set! (-> v1-3 quad) (-> arg0 quad)) + (set! (-> v1-3 y) (fmin (-> v1-3 y) (+ -8192.0 (-> this water surface-height)))) + (vector-! s5-0 v1-3 (-> this root trans)) + (let ((f1-4 (-> s5-0 y)) + (v1-4 s5-0) + ) + (set! (-> this root transv y) + (/ f1-4 (/ (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) f0-0)) + ) + ) + ) + (set! (-> this root transv y) (fmin 16384.0 (-> this root transv y))) + (vector-normalize! s5-0 1.0) + (set! (-> this saberfish-y-rotate) + (deg-seek (-> this saberfish-y-rotate) (* -16384.0 (-> s5-0 y)) (* 16384.0 (seconds-per-frame))) + ) + ) + ) + ) + +(defmethod nav-enemy-method-161 ((this saberfish) (arg0 nav-control)) + (if (and (not (-> this doing-180-spin?)) + (not (and (-> this next-state) (= (-> this next-state name) 'hostile-orient))) + ) + (call-parent-method this arg0) + ) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defbehavior saberfish-swim-travel-trans saberfish () + (local-vars (f26-0 float) (f28-0 float)) + (when (not (-> self doing-180-spin?)) + (let ((a0-0 (-> self nav state)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> a0-0 travel quad)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((f30-0 (-> self swim-speed))) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + 0.0 + 0.0 + (let ((v1-6 (-> self nav state))) + (set! (-> v1-6 speed) f30-0) + ) + 0 + (set! (-> gp-0 y) 0.0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s5-0 1.0) + (cond + (#f + (set! f26-0 (-> self swim-anim-last-dot)) + (set! f28-0 (-> self swim-rotate-last-dot)) + (set! (-> s5-0 quad) (-> gp-0 quad)) + ) + (else + (let ((f0-6 (vector-dot s4-0 s5-0))) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f0-6 (* -1.0 f0-6)) + ) + (let ((f0-7 (* -1.0 f0-6))) + (set! f26-0 (seek (-> self swim-anim-last-dot) f0-7 (* 4.0 (seconds-per-frame)))) + ) + ) + (set! (-> self swim-anim-last-dot) f26-0) + (let ((f0-11 (vector-dot gp-0 s5-0))) + (set! f28-0 (seek (-> self swim-rotate-last-dot) f0-11 (* 2.0 (seconds-per-frame)))) + ) + (set! (-> self swim-rotate-last-dot) f28-0) + (set! (-> self swim-rotate-last-dot) f28-0) + ) + ) + ) + (set! (-> self swim-final-rotate-deg) (- 16384.0 (acos (fabs f26-0)))) + (if (>= f26-0 0.0) + (set! (-> self swim-travel-anim) 2) + (set! (-> self swim-travel-anim) 1) + ) + (cond + ((and (< f28-0 -0.1) + (let ((f26-1 61440.0) + (t9-8 vector-vector-xz-distance) + (a0-15 (-> self root trans)) + (a2-2 (-> self nav state)) + (a1-7 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-7 quad) (-> a2-2 target-pos quad)) + (< f26-1 (t9-8 a0-15 a1-7)) + ) + (let ((v1-37 (ja-group))) + (and (not (and v1-37 (= v1-37 saberfish-swim-180-turn-ja))) #f) + ) + ) + (set! (-> self swim-travel-anim) -1) + ) + ((< 0.99999 f28-0) + (set! (-> gp-0 quad) (-> s5-0 quad)) + ) + (else + (let ((s4-1 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f30-1 (fmin (acos f28-0) (* 0.53333336 (seconds-per-frame) f30-0)))) + (vector-cross! s4-1 gp-0 s5-0) + (vector-normalize! s4-1 1.0) + (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) f30-1 s4-1) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + ) + ) + ) + (let ((a0-27 (-> self nav state)) + (v1-48 gp-0) + ) + (set! (-> a0-27 heading quad) (-> v1-48 quad)) + ) + 0 + (set! (-> self nav-dir quad) (-> gp-0 quad)) + (vector-normalize! gp-0 (-> self swim-speed)) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> gp-0 quad)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 24576.0) + (saberfish-method-234 self s5-1) + (when (< (vector-length s5-1) 6144.0) + (set! (-> self swim-travel-anim) -1) + (set! (-> gp-0 quad) (the-as uint128 0)) + (go-virtual swim-180-spin) + ) + ) + (let ((a0-34 (-> self nav state)) + (v1-65 gp-0) + ) + (set! (-> a0-34 velocity quad) (-> v1-65 quad)) + ) + 0 + (set! (-> self nav-velocity quad) (-> gp-0 quad)) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior swimming-base-exit saberfish () + (set! (-> self root transv y) 0.0) + (set! (-> self saberfish-y-rotate) 0.0) + (set! (-> self doing-180-spin?) #f) + (none) + ) + +(defstate swimming-base (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + (stop-look-at! self) + (set! (-> self swim-speed) 57344.0) + (set-time! (-> self state-time)) + ) + :exit swimming-base-exit + :trans (behavior () + (saberfish-method-220 self) + (saberfish-swim-travel-trans) + (if (saberfish-method-228 self) + (start-terrain-transition self) + ) + ) + :code saberfish-swim-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +(defstate swimming-hostile (saberfish) + :virtual #t + :parent (saberfish swimming-base) + :enter (behavior () + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 enter))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + (let ((a0-2 (handle->process (-> self focus handle)))) + (when a0-2 + (vector-! (-> self attack-dir) (get-trans (the-as process-focusable a0-2) 1) (-> self root trans)) + (set! (-> self attack-dir y) 0.0) + (vector-normalize! (-> self attack-dir) 1.0) + ) + ) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status dangerous)) + (let ((a0-1 (-> self prev-state parent))) + (when a0-1 + (let ((t9-0 (-> a0-1 exit))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (set! (-> self root transv y) 0.0) + ) + :trans (behavior () + (let ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (when #t + (let ((s4-0 #f)) + (let ((s3-0 #f)) + (when s5-0 + (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (let ((f0-2 (- (vector-dot (-> self root trans) (-> self attack-dir)) (vector-dot gp-0 (-> self attack-dir))))) + (if (< -61440.0 f0-2) + (set! s3-0 #t) + ) + (when (< 0.0 f0-2) + #t + (vector+float*! gp-0 gp-0 (-> self attack-dir) 32768.0) + (if (< 12288.0 f0-2) + (set! s4-0 #t) + ) + ) + ) + ) + (let ((a0-7 (-> self nav state)) + (v1-27 gp-0) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-27 quad)) + ) + 0 + (when (or (not (-> self adjusted-y-yet?)) (not s3-0)) + (saberfish-method-239 self gp-0) + (set! (-> self adjusted-y-yet?) #t) + ) + ) + (when (or (not s5-0) + (or s4-0 + (not (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + ) + ) + (set! (-> self flee-to-readjust?) #f) + (set! (-> self use-stored-flee-point?) #f) + (set-time! (-> self scare-start-time)) + (let* ((f30-0 300.0) + (f28-0 2.5) + (f26-0 1.5) + (v1-50 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-51 (the-as number (logior #x3f800000 v1-50))) + ) + (set! (-> self scare-time) + (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-51))))))) + ) + ) + (saberfish-method-231 + self + (-> self flee-point-temp) + 4551.1113 + #t + (vector-! (new 'stack-no-clear 'vector) (-> self root trans) gp-0) + ) + (go-flee self) + ) + ) + ) + ) + (let ((v1-61 (-> self state parent))) + (when v1-61 + (let ((t9-5 (-> v1-61 trans))) + (if t9-5 + (t9-5) + ) + ) + ) + ) + ) + ) + +(defmethod saberfish-method-219 ((this saberfish)) + (set! (-> this enemy-info idle-anim) 3) + (set! (-> this enemy-info walk-anim) 6) + (set! (-> this enemy-info run-anim) 5) + (set! (-> this enemy-info hostile-anim) 5) + 0 + (none) + ) + +(defstate active (saberfish) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (if (saberfish-method-243 self) + (set! f30-0 (* 0.65 f30-0)) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +(defstate spin-attack (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (stop-look-at! self) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self last-attack-time)) + ) + :exit (behavior () + (set-look-at-mode! self 1) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :code (behavior () + (local-vars (f22-0 float) (f28-0 float) (f30-0 float)) + (let ((f24-0 (saberfish-method-215 self)) + (f26-0 1.0) + ) + 0.0 + 0.0 + 0.0 + 0.0 + (let ((f0-4 f24-0)) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f0-4 (* -1.0 f0-4)) + ) + (cond + ((< 0.0 f0-4) + (ja-channel-push! 1 (seconds 0.2)) + (set! f30-0 3.0) + (set! f28-0 9.0) + (set! f22-0 6.0) + (ja-no-eval :group! saberfish-spin-attack-right-ja :num! (loop!) :frame-num 0.0) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (set! f30-0 3.0) + (set! f28-0 9.0) + (set! f22-0 6.0) + (ja-no-eval :group! saberfish-spin-attack-left-ja :num! (loop!) :frame-num 0.0) + ) + ) + ) + (if (< f24-0 0.0) + (set! f26-0 -1.0) + ) + (let* ((f0-10 (fabs f24-0)) + (f0-11 (+ 16384.0 f0-10)) + (f26-1 (* (fmax 16384.0 (fmin 32768.0 f0-11)) f26-0 (/ 15.0 f22-0))) + ) + (until (ja-done? 0) + (let ((f0-15 (ja-frame-num 0))) + (if (and (>= f0-15 f30-0) (>= f28-0 f0-15)) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* f26-1 (seconds-per-frame))) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (go-virtual hostile) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(defmethod attack-delay-elapsed? ((this saberfish)) + (time-elapsed? (-> this last-attack-time) (seconds 1)) + ) + +(defmethod coin-flip? ((this saberfish)) + #f + ) + +(defmethod enemy-method-108 ((this saberfish) (arg0 process-focusable)) + (not (time-elapsed? (-> this scare-start-time) (-> this scare-time))) + ) + +(defmethod go-stare2 ((this saberfish)) + (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'swimming-hostile) (= v1-3 'flee)) + ) + ) + ) + (call-parent-method this) + ) + ) + +;; WARN: Return type mismatch enemy-jump-flags vs none. +(defmethod init-jump-info! ((this saberfish) (arg0 enemy-jump-info)) + (call-parent-method this arg0) + (if (saberfish-method-243 this) + (logior! (-> arg0 flags) (enemy-jump-flags ejf0)) + (logclear! (-> arg0 flags) (enemy-jump-flags ejf0)) + ) + (logclear! (-> arg0 flags) (enemy-jump-flags ejf0)) + (none) + ) + +(defmethod do-jump ((this saberfish)) + (stop-look-at! this) + (cond + ((saberfish-method-243 this) + (set! (-> this jump windup-anim) (the-as uint 18)) + (set! (-> this jump air-anim) (the-as uint 19)) + (set! (-> this jump land-anim) (the-as uint 20)) + (set! (-> this move-to-ground?) #t) + ) + (else + (set! (-> this jump air-anim) (the-as uint 21)) + (set! (-> this jump land-anim) (the-as uint 22)) + (set! (-> this move-to-ground?) #f) + ) + ) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-end) (-> this jump-point-start))) + (s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (+ (vector-length s3-1) (if (saberfish-method-243 this) + 49152.0 + 20480.0 + ) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 (if (saberfish-method-243 this) + 49152.0 + 20480.0 + ) + ) + (vector+! s5-0 (-> this jump-point-start) s4-0) + (set! (-> s5-0 y) (-> this jump-point-end y)) + (set! (-> this jump-start-ground-state) (the-as uint (get-ground-state this))) + (set! (-> this enemy-flags) + (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event this 'jump 0 s5-0) + ) + ) + +(defstate water-impact (saberfish) + :virtual #t + :parent (saberfish base-saberfish-state) + :enter (behavior () + (let ((v1-1 (-> self state parent))) + (when v1-1 + (let ((t9-0 (-> v1-1 enter))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data (-> self jump land-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self root transv quad) (the-as uint128 0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (set! (-> self root transv quad) (the-as uint128 0)) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* (lerp 40960.0 40960.0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) (seconds-per-frame)) + ) + (set! (-> self root trans y) + (- (-> self root trans y) (* (lerp 83968.0 0.0 (* 0.2 (ja-frame-num 0))) (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + (logior! (-> self root root-prim prim-core collide-with) (collide-spec backgnd)) + (go-virtual swimming-hostile) + ) + ) + +(defstate diving-into-water (saberfish) + :virtual #t + :parent (saberfish base-saberfish-state) + :enter (behavior () + (set! (-> self state-time) (+ (current-time) (seconds 8))) + (logclear! (-> self root status) (collide-status touch-surface)) + (set! (-> self root transv quad) (the-as uint128 0)) + (set! (-> self root transv y) -61440.0) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (water-control-method-10 (-> self water)) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 40960.0 (seconds-per-frame)) + ) + (set! (-> self root trans y) (- (-> self root trans y) (* 81920.0 (seconds-per-frame)))) + (set! (-> self root transv quad) (the-as uint128 0)) + (if (or (< (-> self root trans y) (+ -8192.0 (-> self water surface-height))) + (logtest? (-> self root status) (collide-status touch-surface)) + (time-elapsed? (-> self state-time) (seconds 0.05)) + ) + (go-virtual water-impact) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-0 (-> self draw art-group data (-> self jump air-anim))) + (s5-0 #f) + ) + (ja-no-eval :group! gp-0 + :num! (identity (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1))) + ) + (until #f + (ja :group! gp-0 :num! (identity (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)))) + (suspend) + (when (and (not s5-0) (< (-> self root trans y) (-> self water surface-height))) + (set! s5-0 #t) + (set-time! (-> self state-time)) + ) + ) + ) + #f + ) + :post enemy-falling-post + ) + +(defstate transition-terrain-jump-from-water (saberfish) + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (set! (-> self saberfish-y-rotate) 0.0) + (quaternion-look-at! + (-> self root quat) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + *up-vector* + ) + ) + :exit (behavior () + (logior! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! saberfish-jump-to-land-windup-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (f30-0 (ja-frame-num 0)) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 (-> self swim-speed)) + (vector-v++! (-> self root trans) gp-0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (set! (-> self root transv x) 0.0) + (set! (-> self root transv z) 0.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (set! (-> self root transv quad) (the-as uint128 0)) + (if (>= f30-0 6.0) + (do-jump self) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (do-jump self) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(defbehavior jump-from-land-dive-anim saberfish () + (let ((f30-0 1.0)) + (compute-alignment! (-> self align)) + (cond + ((< (ja-frame-num 0) 4.5) + (align! (-> self align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + ) + ((< 4.5 (ja-frame-num 0)) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* (lerp 81920.0 40960.0 (* 0.22222222 (+ -4.5 (ja-frame-num 0)))) (seconds-per-frame)) + ) + (set! (-> self root trans y) + (- (-> self root trans y) + (* (lerp 2048.0 81920.0 (* 0.22222222 (+ -4.5 (ja-frame-num 0)))) (seconds-per-frame)) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (none) + ) + +(defstate transition-terrain-jump-from-land (saberfish) + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + ) + :exit (behavior () + '() + ) + :code (behavior () + (logclear! (-> self water flags) (water-flag swim-ground)) + (ja-channel-push! 1 (seconds 0.2)) + (stop-look-at! self) + (logclear! (-> self root root-prim prim-core collide-with) (collide-spec backgnd)) + (set! (-> self jump air-anim) (the-as uint 21)) + (set! (-> self jump land-anim) (the-as uint 22)) + (ja-no-eval :group! (-> self draw art-group data (-> self jump air-anim)) :num! (seek!) :frame-num 0.0) + (set! (-> self root transv quad) (the-as uint128 0)) + (until (ja-done? 0) + (jump-from-land-dive-anim) + ) + (set! (-> self move-to-ground?) #f) + (go-virtual diving-into-water) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +(defstate transition-terrain-jump (saberfish) + :virtual #t + :enter (behavior () + (if (saberfish-method-243 self) + (go transition-terrain-jump-from-water) + (go transition-terrain-jump-from-land) + ) + ) + :code sleep-code + ) + +(defbehavior transition-pursue-behavior saberfish () + (when (-> self in-pursuit?) + (saberfish-method-220 self) + (if (desired-nav-idx-valid? self) + (go-virtual hostile) + ) + ) + (nav-enemy-method-187 self) + (none) + ) + +(defstate transition-terrain-orient-towards-initial-jump (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + ) + :trans (behavior () + (if (< (fabs (saberfish-method-214 self (-> self jump-point-end))) 2730.6667) + (go transition-terrain-jump-from-land) + ) + ) + :code (behavior () + (saberfish-orient-code-setup) + (until #f + (let ((f0-0 (saberfish-method-214 self (-> self jump-point-end)))) + (if (= (saberfish-orient-code-single-pass f0-0) 0.0) + (go transition-terrain-jump-from-land) + ) + ) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defbehavior turbo-swim saberfish () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! saberfish-swim-burst-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + +(defstate transition-terrain-move-towards-initial-jump (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (set! (-> self swim-speed) 57344.0) + (when (saberfish-method-243 self) + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + 0 + ) + ) + :exit (behavior () + (if (saberfish-method-243 self) + (swimming-base-exit) + ) + ) + :trans (behavior () + (go-terrain-transition self #f) + (if (saberfish-method-243 self) + (saberfish-swim-travel-trans) + ) + ) + :code (behavior () + (cond + ((saberfish-method-243 self) + (saberfish-swim-code) + ) + (else + (let ((v1-3 (method-of-type enemy hostile))) + (when v1-3 + (let ((t9-2 (-> v1-3 code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + ) + ) + ) + :post transition-pursue-behavior + ) + +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f2, f5] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f1, f3, f6] +(defmethod saberfish-method-238 ((this saberfish) (arg0 symbol) (arg1 float) (arg2 float)) + (local-vars + (f1-5 float) + (sv-192 vector) + (sv-196 float) + (sv-200 vector) + (sv-204 vector) + (sv-240 vector) + (sv-244 vector) + (sv-248 vector) + (sv-252 float) + (sv-256 float) + (sv-512 vector) + (sv-516 vector) + (sv-520 vector) + (sv-524 vector) + (sv-528 float) + (sv-532 float) + (sv-536 vector) + (sv-540 vector) + (sv-592 vector) + (sv-608 vector) + ) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (-> this swim-speed) + #t + (let ((s3-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> s3-0 query-type) (saberfish-query-type can-go-to-ground?)) + (set! (-> s3-0 in-water?) #f) + (send-event (get-spawn-parent) 'saberfish-query s3-0) + (let ((v1-6 (-> s3-0 in-water?)) + (s3-1 #f) + ) + (cond + ((and arg0 (not v1-6)) + (set! s3-1 #t) + ) + (arg0 + (set! s3-1 #t) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! sv-196 (the-as float 30720.0)) + (set! sv-200 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (set! sv-204 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (set! (-> sv-204 y) 0.0) + (vector-normalize! sv-204 1.0) + (set! sv-240 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-start) (-> this root trans))) + (set! sv-244 sv-204) + (set! sv-248 (vector-float*! (new 'stack-no-clear 'vector) sv-204 -1.0)) + (set! sv-252 (the-as float 0.0)) + (set! sv-256 (the-as float 0.0)) + (set! (-> sv-240 y) 0.0) + (vector-normalize! sv-240 1.0) + (set! sv-252 (vector-dot sv-244 sv-240)) + (set! sv-256 (vector-dot sv-248 sv-240)) + (cond + ((< sv-256 sv-252) + (vector+float*! sv-192 (-> this root trans) sv-244 sv-196) + (set! (-> sv-204 quad) (-> sv-244 quad)) + ) + (else + (vector+float*! sv-192 (-> this root trans) sv-248 sv-196) + (set! (-> sv-204 quad) (-> sv-248 quad)) + ) + ) + (when (< (* sv-196 sv-196) (vector-vector-xz-distance-squared sv-192 (-> this jump-point-start))) + (set! sv-592 (new 'stack-no-clear 'vector)) + (let ((v1-33 (-> this jump-point-start)) + (a0-22 sv-192) + ) + (.lvf vf4 (&-> v1-33 quad)) + (.lvf vf5 (&-> a0-22 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-592 quad) vf6) + (set! sv-608 (new 'stack-no-clear 'vector)) + (let ((s0-1 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + (set! (-> sv-592 y) 0.0) + (let* ((f0-19 (vector-length sv-592)) + (f30-1 (sqrtf (- (* f0-19 f0-19) (* sv-196 sv-196)))) + ) + (let ((f28-0 (atan sv-196 f30-1))) + (vector-normalize! sv-592 -1.0) + (vector-rotate-y! sv-608 sv-592 f28-0) + (let ((t9-10 vector-rotate-y!) + (a0-26 s0-1) + (a2-2 (- f28-0)) + ) + (t9-10 a0-26 sv-592 a2-2) + ) + ) + (vector-normalize! sv-608 f30-1) + (vector-normalize! s0-1 f30-1) + ) + (vector+float*! s3-2 (-> this jump-point-start) sv-608 1.0) + (vector+float*! s1-1 (-> this jump-point-start) s0-1 1.0) + (vector-! sv-608 s3-2 (-> this root trans)) + (vector-! s0-1 s1-1 (-> this root trans)) + (set! (-> sv-608 y) 0.0) + (set! (-> s0-1 y) 0.0) + (let ((f30-2 (vector-normalize-ret-len! sv-608 1.0)) + (f0-28 (vector-normalize-ret-len! s0-1 1.0)) + ) + (let* ((v1-47 sv-200) + ; (f1-4 (-> sv-608 x)) + ; (f2-1 (-> sv-608 y)) + ; (f3-0 (-> sv-608 z)) + ; (f4-0 (-> v1-47 x)) + ; (f5-0 (-> v1-47 y)) + ; (f6-0 (-> v1-47 z)) + ) + ;; og:preserve-this + ; (.mula.s f1-4 f4-0) + ; (.madda.s f2-1 f5-0) + ; (.madd.s f1-5 f3-0 f6-0) + (set! f1-5 (vector-dot sv-608 v1-47)) + ) + (set! sv-252 f1-5) + (set! sv-256 (vector-dot s0-1 sv-200)) + (cond + ((< f30-2 40.96) + (set! (-> s2-1 quad) (-> s3-2 quad)) + ) + ((< f0-28 40.96) + (set! (-> s2-1 quad) (-> s1-1 quad)) + ) + ((< sv-256 sv-252) + (set! (-> s2-1 quad) (-> s3-2 quad)) + ) + (else + (set! (-> s2-1 quad) (-> s1-1 quad)) + ) + ) + ) + ) + (set! (-> s2-1 y) (-> this root trans y)) + (cond + ((< (vector-vector-xz-distance-squared (-> this jump-point-start) s2-1) 822083600.0) + (if (< 8192.0 arg1) + (set! s3-1 #t) + (set! s3-1 #f) + ) + ) + ((begin + (let ((s3-4 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-start) (-> this jump-point-end))) + (s0-2 (new 'stack-no-clear 'vector)) + (s1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-4 y) 0.0) + (vector-normalize! s3-4 1.0) + (vector-rotate-y! s0-2 s3-4 -8192.0) + (vector-rotate-y! s1-2 s3-4 8192.0) + (vector-normalize! s0-2 arg2) + (vector-normalize! s1-2 arg2) + (set! s3-1 #f) + (set! sv-512 (vector+! (new 'stack-no-clear 'vector) (-> this jump-point-start) s0-2)) + (set! sv-516 (vector+! (new 'stack-no-clear 'vector) (-> this jump-point-start) s1-2)) + (set! sv-520 (new 'stack-no-clear 'vector)) + (set! sv-524 (new 'stack-no-clear 'vector)) + (set! sv-528 (the-as float 0.0)) + (set! sv-532 (the-as float 0.0)) + (set! sv-536 (new 'stack-no-clear 'vector)) + (set! sv-540 (new 'stack-no-clear 'vector)) + (set! (-> sv-536 quad) (-> this root trans quad)) + (set! (-> sv-540 quad) (-> s2-1 quad)) + (set! (-> sv-536 y) (-> sv-512 y)) + (set! (-> sv-540 y) (-> sv-512 y)) + (let ((a1-37 (vector-! (new 'stack-no-clear 'vector) sv-516 sv-512)) + (a0-60 (new 'stack-no-clear 'vector)) + (v1-76 (new 'stack-no-clear 'vector)) + ) + (set-vector! a0-60 (-> s0-2 z) 0.0 (- (-> s0-2 x)) 1.0) + (set-vector! v1-76 (- (-> s0-2 z)) 0.0 (-> s0-2 x) 1.0) + (set! sv-252 (vector-dot a0-60 a1-37)) + (if (< 0.0 sv-252) + (set! (-> sv-520 quad) (-> a0-60 quad)) + (set! (-> sv-520 quad) (-> v1-76 quad)) + ) + (set-vector! a0-60 (-> s1-2 z) 0.0 (- (-> s1-2 x)) 1.0) + (set-vector! v1-76 (- (-> s1-2 z)) 0.0 (-> s1-2 x) 1.0) + (set! sv-252 (vector-dot a0-60 a1-37)) + (if (< 0.0 sv-252) + (set! (-> sv-524 quad) (-> v1-76 quad)) + (set! (-> sv-524 quad) (-> a0-60 quad)) + ) + ) + ) + (vector-normalize! sv-520 1.0) + (vector-normalize! sv-524 1.0) + (set! sv-528 (vector-dot sv-520 sv-512)) + (set! sv-252 (vector-dot sv-520 sv-536)) + (set! sv-256 (vector-dot sv-520 sv-540)) + (or (< sv-252 sv-528) (< sv-256 sv-528)) + ) + (set! s3-1 #t) + ) + (else + (set! sv-532 (vector-dot sv-524 sv-516)) + (set! sv-252 (vector-dot sv-524 sv-536)) + (set! sv-256 (vector-dot sv-524 sv-540)) + (if (or (< sv-252 sv-532) (< sv-256 sv-532)) + (set! s3-1 #t) + ) + ) + ) + ) + ) + ) + ) + (when (< 26624.0 (- (-> this water surface-height) (-> this root trans y))) + ) + (cond + (s3-1 + (set-time! (-> this scare-start-time)) + (set! (-> this scare-time) (seconds 12.5)) + (set! (-> this flee-to-readjust?) #t) + (set! (-> this use-stored-flee-point?) #t) + (saberfish-method-231 this (-> this flee-point-temp) 1820.4445 #f (the-as vector #f)) + (set-time! (-> this last-land-check-time)) + (let* ((a0-70 this) + (t9-24 (method-of-object a0-70 saberfish-method-218)) + ) + #t + (t9-24 a0-70) + ) + (if (not (and (-> this next-state) (= (-> this next-state name) 'flee))) + (go-flee this) + ) + ) + ((and (< arg2 49152.0) (< arg1 8192.0)) + (go transition-terrain-jump-from-water) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'transition-terrain-move-towards-initial-jump))) + (go (method-of-object this transition-terrain-move-towards-initial-jump)) + ) + ) + ) + ) + ) + ) + +(defmethod go-terrain-transition ((this saberfish) (arg0 symbol)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) (-> this jump-point-start))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-end) (-> this jump-point-start))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (let* ((f0-2 (vector-dot s3-0 s4-1)) + (f28-0 (acos f0-2)) + ) + (cond + ((saberfish-method-243 this) + (saberfish-method-238 this arg0 f28-0 f30-0) + ) + (else + (cond + ((and (< f30-0 4096.0) (< f28-0 2730.6667)) + (go transition-terrain-jump-from-land) + ) + ((< f30-0 8192.0) + (nav-enemy-method-176 this) + (go (method-of-object this transition-terrain-orient-towards-initial-jump)) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'transition-terrain-move-towards-initial-jump))) + (nav-enemy-method-177 this) + (go (method-of-object this transition-terrain-move-towards-initial-jump)) + ) + ) + ) + ) + ) + ) + ) + +(defmethod saberfish-method-233 ((this saberfish)) + (let ((gp-0 (new 'stack-no-clear 'nav-poly)) + (a0-2 (saberfish-method-236 this (-> this current-nav-mesh-index))) + ) + (if (not a0-2) + (return (the-as nav-poly #f)) + ) + (vector-! (the-as vector (-> gp-0 vertex)) (-> this root trans) (the-as vector (-> a0-2 bounds))) + (set! (-> gp-0 vertex1 x) 40960.0) + (set! (-> gp-0 data 20) (the-as uint 3)) + (nav-mesh-method-45 a0-2 gp-0) + ) + ) + +(defmethod saberfish-method-231 ((this saberfish) (arg0 vector) (arg1 float) (arg2 symbol) (arg3 vector)) + (local-vars (sv-64 vector) (sv-68 vector) (sv-72 float) (sv-76 float) (sv-80 vector) (sv-84 float)) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! sv-68 (new 'stack-no-clear 'vector)) + (set! sv-72 (the-as float 0.0)) + (set! sv-76 (the-as float 0.0)) + (set! sv-80 (new 'stack-no-clear 'vector)) + (set! sv-84 (the-as float -1.0)) + (if arg2 + (set! (-> sv-64 quad) (-> arg3 quad)) + (vector-! sv-64 (-> this jump-point-start) (-> this jump-point-end)) + ) + (set! (-> sv-64 y) 0.0) + (set! sv-76 arg1) + (vector-normalize-copy! sv-68 sv-64 1.0) + (let ((s3-0 (saberfish-method-236 this (-> this current-nav-mesh-index))) + (s2-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info)) + (s1-0 (saberfish-method-233 this)) + ) + 0.0 + (when s1-0 + (dotimes (s0-0 13) + (vector-rotate-y! sv-64 sv-68 sv-72) + (vector-normalize! sv-64 94208.0) + (clamp-vector-to-mesh-no-gaps s3-0 (-> this root trans) s1-0 sv-64 s2-0) + (vector+! arg0 (-> this root trans) sv-64) + (let ((f0-7 (vector-length sv-64))) + (when (< 84787.195 f0-7) + (set! (-> arg0 y) (-> this water surface-height)) + (return #t) + ) + (when (< sv-84 f0-7) + (set! sv-84 f0-7) + (set! (-> sv-80 quad) (-> arg0 quad)) + ) + ) + (if (= (logand s0-0 1) 1) + (set! sv-72 (+ sv-72 sv-76)) + (set! sv-72 (- sv-72 sv-76)) + ) + (set! sv-76 (+ sv-76 arg1)) + ) + (set! (-> arg0 quad) (-> sv-80 quad)) + (set! (-> arg0 y) (-> this water surface-height)) + (return #t) + ) + ) + #f + ) + +(defmethod change-nav-mesh ((this saberfish)) + (let* ((s5-0 (get-nav-mesh-idx this (-> this root trans) (saberfish-find-behavior none))) + (a0-3 (saberfish-method-236 this s5-0)) + ) + (when (and (>= s5-0 0) (or (!= s5-0 (-> this current-nav-mesh-index)) (!= (-> this nav state mesh) a0-3))) + (set! (-> this current-nav-mesh-index) s5-0) + (change-to a0-3 this) + ) + ) + (none) + ) + +(defmethod desired-nav-idx-valid? ((this saberfish)) + (!= (-> this desired-dest-mesh-index) (-> this dest-nav-mesh-index)) + ) + +(defmethod set-dest-nav! ((this saberfish) (arg0 vector) (arg1 saberfish-find-behavior)) + (set! (-> this desired-dest-nav-point quad) (-> arg0 quad)) + (set! (-> this desired-dest-mesh-index) (get-nav-mesh-idx this arg0 arg1)) + (when (= (-> this desired-dest-mesh-index) -1) + ) + 0 + (none) + ) + +(defmethod saberfish-method-228 ((this saberfish)) + (and (not (-> this ground-only?)) + (>= (+ (current-time) (seconds -0.1)) (-> this last-swim-flip-time)) + (!= (-> this desired-dest-mesh-index) (-> this current-nav-mesh-index)) + (!= (-> this current-nav-mesh-index) -1) + ) + ) + +(defmethod start-terrain-transition ((this saberfish)) + (set-should-move-to-ground this) + (send-event (get-spawn-parent) 'transition-terrain-begin) + (go-terrain-transition this #t) + ) + +(defmethod normalize-heading! ((this saberfish) (arg0 nav-control)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((and (not (and (-> this next-state) (= (-> this next-state name) 'transition-terrain-orient-towards-initial-jump))) + (and (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (not (logtest? (enemy-flag ef39) (-> this enemy-flags))) + ) + ) + (cond + ((or (saberfish-method-243 this) (not (logtest? (enemy-flag ef37) (-> this enemy-flags)))) + (set! (-> s5-0 quad) (-> this nav-dir quad)) + ) + (else + (let ((a1-3 (-> this nav state))) + (set! (-> s5-0 quad) (-> a1-3 heading quad)) + ) + ) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (quaternion-set! s4-0 0.0 (-> s5-0 x) 0.0 (+ 1.0 (-> s5-0 z))) + (quaternion-normalize! s4-0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) + (if (>= (+ (current-time) (seconds -0.6)) (-> this last-swim-flip-time)) + (quaternion-copy! (-> this root quat) s4-0) + (quaternion-slerp! (-> this root quat) (-> this root quat) s4-0 (* 4.0 (seconds-per-frame))) + ) + ) + ) + (else + ) + ) + ) + (if (saberfish-method-243 this) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) (-> this saberfish-y-rotate)) + ) + 0 + (none) + ) + +(defmethod jump-wind-up-anim ((this saberfish) (arg0 enemy-jump-info)) + (when (not (saberfish-method-243 this)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump windup-anim))) + (a0-5 (-> this skel root-channel 0)) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!) + ) + ) + #t + ) + +(defmethod jump-in-air-anim ((this saberfish) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +(defmethod jump-land-anim ((this saberfish) (arg0 enemy-jump-info)) + (cond + ((zero? (-> this jump land-anim)) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.075)) + (let ((a1-2 (-> this draw art-group data (-> this jump land-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod setup-jump! ((this saberfish) (arg0 enemy-jump-info)) + (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) + (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) + ) + (let ((f0-4 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) + (v1-3 (vector-! (new 'stack-no-clear 'vector) (-> arg0 dest-pos) (-> arg0 start-pos))) + ) + (set! (-> v1-3 y) 0.0) + (let ((f0-6 (* (/ f0-4 (vector-length v1-3)) (if (saberfish-method-243 this) + 49152.0 + 20480.0 + ) + ) + ) + ) + (+ 2048.0 f0-6) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'traj3d-params))) + (set! (-> s4-0 dest quad) (-> arg0 dest-pos quad)) + (set! (-> s4-0 src quad) (-> arg0 start-pos quad)) + (let ((f30-1 11832.889)) + (if (not (saberfish-method-243 this)) + (set! f30-1 8192.0) + ) + (set! (-> s4-0 initial-tilt) f30-1) + ) + (set! (-> s4-0 gravity) 4.551111) + (traj3d-calc-initial-velocity-using-tilt s4-0) + (set! (-> arg0 traj initial-position quad) (-> arg0 start-pos quad)) + (set! (-> arg0 traj gravity) -4.551111) + (set! (-> arg0 traj time) (-> s4-0 time)) + (set! (-> arg0 traj initial-velocity quad) (-> s4-0 initial-velocity quad)) + ) + (none) + ) + +(defmethod get-nav-mesh-idx ((this saberfish) (arg0 vector) (arg1 saberfish-find-behavior)) + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> gp-0 query-type) (saberfish-query-type set-nav-idx)) + (set! (-> gp-0 behavior) arg1) + (set! (-> (the-as vector (&-> gp-0 mesh)) quad) (-> arg0 quad)) + (send-event (get-spawn-parent) 'saberfish-query gp-0) + (-> gp-0 closest-nav-mesh-index) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod nav-enemy-method-164 ((this saberfish)) + (call-parent-method this) + (let* ((a0-3 this) + (t9-2 (method-of-object a0-3 set-dest-nav!)) + (a2-0 (-> this nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-0 target-pos quad)) + (t9-2 a0-3 a1-1 (saberfish-find-behavior none)) + ) + (if (saberfish-method-228 this) + (start-terrain-transition this) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs vector. +(defmethod nav-enemy-method-166 ((this saberfish) (arg0 vector) (arg1 vector)) + (cond + (#t + (set! (-> arg0 quad) (-> this flee-point-temp quad)) + #t + ) + (else + (call-parent-method this arg0 arg1) + ) + ) + (if (saberfish-method-243 this) + (set! (-> arg0 y) (-> this water surface-height)) + ) + (the-as vector #t) + ) + +(defstate flee (saberfish) + :virtual #t + :enter (behavior () + (set! (-> self swim-speed) 57344.0) + (when (saberfish-method-243 self) + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + 0 + ) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit (behavior () + (set! (-> self scare-time) 0) + (if (saberfish-method-243 self) + (swimming-base-exit) + ) + (let ((t9-3 (-> (find-parent-state) exit))) + (if t9-3 + (t9-3) + ) + ) + ) + :trans (behavior () + (when (-> self flee-to-readjust?) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (when (time-elapsed? (-> self last-target-check-time) (seconds 0.2)) + (set-time! (-> self last-target-check-time)) + (saberfish-method-220 self) + (when (desired-nav-idx-valid? self) + (set! (-> self scare-time) 0) + 0 + ) + ) + (saberfish-method-239 self (-> self flee-point-temp)) + ) + ) + (when (< (vector-vector-xz-distance (-> self root trans) (-> self flee-point-temp)) 16384.0) + (set! (-> self scare-time) 0) + 0 + ) + (when (time-elapsed? (-> self last-land-check-time) (seconds 2.5)) + (saberfish-method-220 self) + (set-time! (-> self last-land-check-time)) + (if (saberfish-method-228 self) + (start-terrain-transition self) + ) + ) + (saberfish-swim-travel-trans) + (when (>= (the-as int (-> self focus aware)) 2) + (let ((t9-9 (-> (find-parent-state) trans))) + (if t9-9 + (t9-9) + ) + ) + ) + ) + :code (behavior () + (saberfish-swim-code) + ) + ) + +(defmethod is-pfoc-in-mesh? ((this saberfish) (arg0 process-focusable) (arg1 vector)) + (if (and arg0 (not arg1)) + (set! arg1 (get-trans arg0 1)) + ) + (when arg1 + (let* ((f0-0 (-> arg1 y)) + (v1-4 (-> this root)) + (f1-0 (-> v1-4 trans y)) + (a0-2 (-> this fact)) + ) + (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) + (let ((f0-1 (-> this enemy-info notice-nav-radius))) + (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) + (>= (get-nav-mesh-idx this arg1 (saberfish-find-behavior none)) 0) + ) + ) + ) + ) + ) + ) + +(defmethod enemy-common-post ((this saberfish)) + (if (not (handle->process (-> this spawn-parent))) + (go (method-of-object this die)) + ) + (water-control-method-10 (-> this water)) + (let ((a1-1 (-> this nav state)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-6 quad) (-> a1-1 heading quad)) + (set! (-> a0-6 y) 0.0) + (vector-normalize! a0-6 1.0) + ) + (when (= (-> this pid) 275) + ) + (set-should-move-to-ground this) + (if (and (-> this next-state) + (let ((v1-19 (-> this next-state name))) + (or (= v1-19 'diving-into-water) (= v1-19 'water-impact) (= v1-19 'jump) (= v1-19 'knocked)) + ) + ) + (change-nav-mesh this) + ) + (let ((a1-8 (-> this nav state)) + (a0-14 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-14 quad) (-> a1-8 travel quad)) + (set! (-> a0-14 y) 0.0) + (vector-normalize! a0-14 1.0) + ) + (cond + ((saberfish-method-243 this) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (stop-look-at! this) + ) + ((= (-> this ground-state) 4) + (logior! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + ) + ) + (call-parent-method this) + (none) + ) + +(defmethod jump-anim-handler ((this saberfish) (arg0 int) (arg1 enemy-jump-info)) + (when (saberfish-method-243 this) + (case arg0 + ((5) + (compute-alignment! (-> this align)) + (align! (-> this align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> this root trans) (-> this root transv)) + (when (< (ja-frame-num 0) 8.0) + (let ((f0-1 (vector-length (-> this root transv)))) + (let ((v1-17 (-> this nav state))) + (set! (-> v1-17 speed) f0-1) + ) + 0 + (let ((v1-19 (-> this nav))) + (set! (-> v1-19 target-speed) f0-1) + ) + 0 + (set! (-> this swim-speed) f0-1) + ) + ) + (set! (-> this root transv quad) (the-as uint128 0)) + ) + ) + ) + (call-parent-method this arg0 arg1) + ) + +(defmethod go-directed2 ((this saberfish)) + (if (saberfish-method-243 this) + (go (method-of-object this water-land)) + (call-parent-method this) + ) + ) + +(defmethod enemy-method-50 ((this saberfish) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list water pusher) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) + (set! (-> v1-8 prim-core action) (collide-action)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + (none) + ) + +(defstate knocked (saberfish) + :virtual #t + :enter (behavior () + (set! (-> self knocked-under-water?) #f) + (set! (-> self move-to-ground?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +(defstate knocked-recover-water (saberfish) + :virtual #t + :parent (saberfish knocked-recover) + :enter (behavior () + '() + ) + :code (behavior () + (when (handle->process (-> self ragdoll-proc)) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (saberfish-method-240 self (seconds 1)) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! saberfish-swim-180-turn-ja :num! (seek!) :frame-num 0.0) + (let ((gp-0 (current-time))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (go-virtual swimming-hostile) + ) + :post (behavior () + (enemy-simple-post) + ) + ) + +(defstate knocked-recover (saberfish) + :virtual #t + :enter (behavior () + (set-should-move-to-ground self) + (if (saberfish-method-243 self) + (go-virtual knocked-recover-water) + ) + (let ((t9-4 (-> (find-parent-state) enter))) + (if t9-4 + (t9-4) + ) + ) + ) + :code (behavior () + (if (handle->process (-> self ragdoll-proc)) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! saberfish-flip-up-start-ja :num! (seek!) :frame-num 0.0) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.4)) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! saberfish-flip-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (change-nav-mesh self) + (water-control-method-10 (-> self water)) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +(defmethod go-die ((this saberfish)) + (sound-play "sabfish-death") + (send-event (handle->process (-> this spawn-parent)) 'child-die) + (call-parent-method this) + ) + +(defmethod process-mask->search-info-flag ((this saberfish)) + (let ((v0-1 (call-parent-method this))) + (if (-> this is-submerged?) + (set! v0-1 (logior v0-1 (search-info-flag abort))) + ) + v0-1 + ) + ) + +(defmethod on-submerged ((this saberfish) (arg0 symbol)) + (if arg0 + (logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + ) + (set! (-> this is-submerged?) arg0) + 0 + (none) + ) + +(defstate idle (saberfish) + :virtual #t + :trans (behavior () + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) + (cond + ((= (-> self focus aware) (enemy-aware ea1)) + (go-virtual active) + ) + ((< 1 (the-as int (-> self focus aware))) + (go-virtual notice) + ) + ) + ) + ) + ) + +(defstate notice (saberfish) + :virtual #t + :enter (behavior () + (go-virtual hostile) + ) + ) + +(defbehavior saberfish-command-event-handler saberfish ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('saberfish-command) + (case (-> arg3 param 0) + (('go-alive) + (go-virtual idle) + ) + ) + ) + (else + (event-handler self arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate command-mode (saberfish) + :virtual #t + :event saberfish-command-event-handler + :trans (behavior () + '() + ) + :code sleep-code + ) + +(defstate saberfish-swimming (saberfish) + :virtual #t + :parent (saberfish command-mode) + :enter (behavior () + (set! (-> self swim-travel-anim) 0) + (set! (-> self saberfish-y-rotate) 0.0) + (set! (-> self swim-final-rotate-deg) 0.0) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 57344.0 (seconds-per-frame)) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set! (-> self current-nav-mesh-index) -1) + (change-nav-mesh self) + (go-virtual swimming-hostile) + ) + (let ((v1-15 (-> self state parent))) + (when v1-15 + (let ((t9-3 (-> v1-15 trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + ) + :code (behavior () + (saberfish-swim-code) + ) + ) + +(defstate saberfish-crawl-out-of-tube (saberfish) + :virtual #t + :parent (saberfish command-mode) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (logclear! (-> self water flags) (water-flag swim-ground)) + (ja-channel-push! 1 0) + (stop-look-at! self) + (logclear! (-> self root root-prim prim-core collide-with) (collide-spec backgnd)) + (set! (-> self jump air-anim) (the-as uint 21)) + (set! (-> self jump land-anim) (the-as uint 22)) + (ja-no-eval :group! saberfish-crawl-out-of-tube-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 40960.0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self root transv quad) (the-as uint128 0)) + (ja-channel-push! 1 0) + (ja :group! saberfish-jump-to-water-air-ja :num! (identity 5.0)) + (until (ja-done? 0) + (jump-from-land-dive-anim) + ) + (set! (-> self move-to-ground?) #f) + (go-virtual diving-into-water) + ) + :post (behavior () + (ja-post) + ) + ) + +(defstate saberfish-sitting-on-land (saberfish) + :virtual #t + :parent (saberfish command-mode) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('saberfish-command) + (case (-> block param 0) + (('go-alive) + (go transition-terrain-jump-from-land) + ) + ) + ) + (else + (event-handler self proc argc message block) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! saberfish-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +(defmethod go-idle2 ((this saberfish)) + (case (-> this initial-state) + (('saberfish-crawl-out-of-tube) + (go (method-of-object this saberfish-crawl-out-of-tube)) + ) + (('saberfish-sitting-on-land) + (go (method-of-object this saberfish-sitting-on-land)) + ) + (('saberfish-swimming) + (go (method-of-object this saberfish-swimming)) + ) + (('idle) + (go (method-of-object this hostile)) + ) + ) + ) + +(defmethod init-from-entity! ((this saberfish) (arg0 entity-actor)) + (set! (-> this ground-only?) #t) + (set! (-> this spawn-parent) (process->handle this)) + (set! (-> *saberfish-nav-enemy-info* nav-mesh) + (find-nearest-nav-mesh (-> arg0 extra trans) (the-as float #x7f800000)) + ) + (set! (-> this initial-state) 'idle) + (set! (-> this pos-start quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this quat-start) (-> arg0 quat)) + (call-parent-method this arg0) + ) + +(defbehavior saberfish-init-by-other saberfish ((arg0 process-drawable) (arg1 saberfish-init-by-other-params)) + (set! (-> self pos-start quad) (-> arg1 pos quad)) + (quaternion-copy! (-> self quat-start) (-> arg1 orient)) + (set! (-> self spawn-parent) (-> arg1 spawn-parent)) + (set! (-> self initial-state) (-> arg1 initial-state)) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self ground-only?) #f) + (enemy-init-by-other arg0 arg1) + ) + +(defmethod saberfish-method-236 ((this saberfish) (arg0 int)) + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> gp-0 query-type) (saberfish-query-type set-mesh)) + (set! (-> gp-0 closest-nav-mesh-index) arg0) + (set! (-> gp-0 mesh) #f) + (send-event (get-spawn-parent) 'saberfish-query gp-0) + (-> gp-0 mesh) + ) + ) + +(defmethod saberfish-method-237 ((this saberfish) (arg0 int)) + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> gp-0 query-type) (saberfish-query-type set-in-water)) + (set! (-> gp-0 closest-nav-mesh-index) arg0) + (send-event (get-spawn-parent) 'saberfish-query gp-0) + (-> gp-0 in-water?) + ) + ) + +(defmethod should-move-to-ground? ((this saberfish)) + (-> this move-to-ground?) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod copy-nav-state-vel! ((this saberfish) (arg0 vector)) + (cond + ((saberfish-method-243 this) + (set! (-> arg0 quad) (-> this nav-velocity quad)) + ) + (else + (let ((a0-2 (-> this nav state))) + (set! (-> arg0 quad) (-> a0-2 velocity quad)) + ) + ) + ) + (none) + ) + +(defmethod go-flee ((this saberfish)) + (go (method-of-object this flee)) + ) + +(defmethod saberfish-method-240 ((this saberfish) (arg0 time-frame)) + (let ((s5-0 (handle->process (-> this ragdoll-proc)))) + (when s5-0 + (disable-for-duration (the-as ragdoll-proc s5-0) arg0) + (logclear! (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-flags) (ragdoll-flag rf9)) + (enemy-method-90 this (the-as ragdoll-proc s5-0)) + ) + ) + 0 + (none) + ) + +(defmethod saberfish-method-241 ((this saberfish)) + (let ((a1-4 (-> (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))) ragdoll)) + (v1-3 0) + ) + (dotimes (a2-1 (the-as int (-> a1-4 num-joints))) + (if (logtest? (-> a1-4 ragdoll-joints a2-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2)) + (+! v1-3 1) + ) + ) + (set! (-> this knocked-under-water?) (>= v1-3 (the-as int (shr (-> a1-4 num-joints) 1)))) + (>= v1-3 (the int (* 0.6666667 (the float (-> a1-4 num-joints))))) + ) + ) + +(defmethod ragdoll-settled? ((this saberfish)) + (let* ((s5-0 (handle->process (-> this ragdoll-proc))) + (v0-0 + (or (not s5-0) + (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) + (and (not (saberfish-method-243 this)) + (time-elapsed? (-> this state-time) (seconds 0.1)) + (< (vector-length (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-joints 0 velocity)) + (* 49152.0 (seconds-per-frame)) + ) + (< (cos (* 16384.0 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) + (or (= (-> this root gspot-pos y) -40959590.0) + (< (- (-> this root trans y) (-> this root gspot-pos y)) 4096.0) + ) + ) + ) + ) + ) + ) + (if (not v0-0) + (set! v0-0 (saberfish-method-241 this)) + ) + v0-0 + ) + ) + +(defmethod within-gspot-range? ((this saberfish)) + (if (-> this knocked-under-water?) + #f + (call-parent-method this) + ) + ) + +(defun find-ground-for-obj ((arg0 process-focusable)) + (let ((gp-0 (new 'stack-no-clear 'water-info))) + (water-info-init! (-> arg0 root) gp-0 (collide-action solid semi-solid)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-5 (above-ground? (-> arg0 root) s5-0 (-> arg0 root trans) (collide-spec backgnd) 8192.0 81920.0 1024.0))) + (cond + ((and (logtest? (water-flag touch-water) (-> gp-0 flags)) + v1-5 + (>= (+ 819.2 (-> s5-0 best-other-tri intersect y)) (-> arg0 root trans y)) + ) + (if (< (-> gp-0 base-height) (-> s5-0 best-other-tri intersect y)) + 4 + 3 + ) + ) + ((logtest? (water-flag touch-water) (-> gp-0 flags)) + 3 + ) + ((and v1-5 (>= (+ 819.2 (-> s5-0 best-other-tri intersect y)) (-> arg0 root trans y))) + 4 + ) + ((and v1-5 (logtest? (water-flag over-water) (-> gp-0 flags))) + (if (< (-> gp-0 base-height) (-> s5-0 best-other-tri intersect y)) + 2 + 1 + ) + ) + (v1-5 + 2 + ) + ((logtest? (water-flag over-water) (-> gp-0 flags)) + 1 + ) + (else + 0 + ) + ) + ) + ) + ) + ) + +(defmethod get-ground-state ((this saberfish)) + (if (-> this ground-only?) + (return 4) + ) + (when (and (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'knocked) (= v1-6 'knocked-recover)) + ) + ) + (handle->process (-> this ragdoll-proc)) + ) + (let ((v1-11 0) + (a1-6 0) + ) + (let ((a2-5 (-> (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))) ragdoll))) + 0 + (dotimes (a3-5 (the-as int (-> a2-5 num-joints))) + (if (logtest? (-> a2-5 ragdoll-joints a3-5 ragdoll-joint-flags) (ragdoll-joint-flag rjf2)) + (+! a1-6 1) + ) + (if (logtest? (-> a2-5 ragdoll-joints a3-5 ragdoll-joint-flags) (ragdoll-joint-flag rjf0)) + (+! v1-11 1) + ) + ) + ) + (when (or (> v1-11 0) (> a1-6 0)) + (if (< a1-6 v1-11) + (return 4) + (return 3) + ) + (the-as none 0) + ) + ) + ) + (find-ground-for-obj this) + ) + +(defmethod saberfish-method-243 ((this saberfish)) + (= (-> this ground-state) 3) + ) + +;; WARN: Return type mismatch nav-flags vs none. +(defmethod set-should-move-to-ground ((this saberfish)) + (set! (-> this ground-state) (the-as uint (get-ground-state this))) + (when #t + (case (-> this ground-state) + ((4 1 2) + (set! (-> this move-to-ground?) #t) + ) + (else + (set! (-> this move-to-ground?) #f) + ) + ) + ) + (cond + ((= (-> this ground-state) 3) + (logclear! (-> this root nav-flags) (nav-flags has-root-sphere)) + ) + (else + (set! (-> this root nav-radius) 8192.0) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + ) + ) + (none) + ) + +(defmethod nav-enemy-method-181 ((this saberfish)) + (call-parent-method this) + (none) + ) + +(defmethod relocate ((this saberfish) (offset int)) + (call-parent-method this offset) + ) + +(defmethod go-stare ((this saberfish)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (go (method-of-object this swimming-hostile)) + (call-parent-method this) + ) + ) + +(defmethod event-handler ((this saberfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('saberfish-query) + (let ((s5-1 (the-as saberfish-spawner-query-msg (-> arg3 param 0)))) + (case (-> s5-1 query-type) + (((saberfish-query-type set-nav-idx)) + (set! (-> s5-1 closest-nav-mesh-index) 0) + 0 + ) + (((saberfish-query-type set-mesh)) + (set! (-> s5-1 mesh) (find-nearest-nav-mesh (-> this entity extra trans) (the-as float #x7f800000))) + (nop!) + 0 + ) + (((saberfish-query-type set-in-water)) + (set! (-> s5-1 in-water?) #f) + #f + ) + (((saberfish-query-type can-go-to-ground?)) + (break!) + 0 + ) + ) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) diff --git a/goal_src/jak3/levels/sewer/sew-laser-guard.gc b/goal_src/jak3/levels/sewer/sew-laser-guard.gc index 3cc8b265ff..607e2eaf8f 100644 --- a/goal_src/jak3/levels/sewer/sew-laser-guard.gc +++ b/goal_src/jak3/levels/sewer/sew-laser-guard.gc @@ -7,3 +7,720 @@ ;; DECOMP BEGINS +(deftype gun-turret-params (structure) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (barrel-joint int32) + (gun-joint int32) + (hole-joints int32 8) + ) + ) + + +(deftype sew-laser-guard (enemy) + ((params gun-turret-params) + (aim-pos vector :inline) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (sync-orient sync-linear :inline) + (start-orient quaternion :inline) + (end-orient quaternion :inline) + (last-play-sweep-dir-positive? symbol) + (last-play-sweep-sync float) + (sound-hum sound-id) + (sound-scorch sound-id) + ) + (:methods + (sew-laser-guard-method-155 (_type_) none) + (sew-laser-guard-method-156 (_type_) none) + ) + ) + + +(defpart 4935 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 4936 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 64.0 64.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +(defpart 4937 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.4) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0 30.0) + (:b 128.0) + (:a 128.0 128.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 4938 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 2.0 6.0) + (:z (meters 0.1)) + (:scale-x (meters 0.05) (meters 0.1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 1 128.0) + (:g :copy r) + (:b 255.0) + (:a 255.0) + (:omega (degrees 0.03375)) + (:vel-y (meters 0.02) (meters 0.02)) + (:fade-a -2.56 -2.56) + (:friction 0.9) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4939 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 64.0 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +(defpartgroup group-sew-laser-guard-hit + :id 1505 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4757 :period (seconds 5) :length (seconds 0.085) :offset -10) + (sp-item 4758 :fade-after (meters 60) :period (seconds 5) :length (seconds 0.1)) + (sp-item 4759 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 5) :length (seconds 0.335)) + (sp-item 4760 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 5) :length (seconds 0.167)) + (sp-item 4761 :period (seconds 5) :length (seconds 0.017) :offset -10) + (sp-item 4762 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 5) :length (seconds 0.167)) + ) + ) + +(deftype sew-laser-shot (projectile) + () + ) + + +(defstate dissipate (sew-laser-shot) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +(defmethod made-impact? ((this sew-laser-shot)) + (let ((gp-0 (-> this root)) + (s5-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-0 s5-0)) + (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) + (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-0 action-mask) (collide-action solid)) + ) + (let ((a0-2 (handle->process (-> this notify-handle)))) + (when a0-2 + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) + (f0-2 (- (vector-length s4-1))) + ) + (fill-and-try-snap-to-surface gp-0 s4-1 f0-2 0.0 -3072.0 s5-0) + ) + ) + ) + ) + ) + +(defun sew-laser-shot-move ((arg0 sew-laser-shot)) + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this sew-laser-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (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 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this sew-laser-shot)) + (set! (-> this attack-mode) 'shock) + (set! (-> this max-speed) 131072.0) + (set! (-> this timeout) (seconds 0.125)) + (set! (-> this move) sew-laser-shot-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + +(defskelgroup skel-sew-laser-guard sew-laser-guard sew-laser-guard-lod0-jg sew-laser-guard-idle-ja + ((sew-laser-guard-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) + +(define *sew-laser-guard-enemy-info* + (new 'static 'enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 3 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 150) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + ) + ) + +(set! (-> *sew-laser-guard-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defun fire-laser! ((arg0 vector) (arg1 vector) (arg2 sew-laser-guard) (arg3 float)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-float*! (-> s5-0 move-dist) arg1 arg3) + (let ((v1-3 s5-0)) + (set! (-> v1-3 radius) 40.96) + (set! (-> v1-3 collide-with) (collide-spec backgnd jak enemy obstacle hit-by-others-list player-list)) + (set! (-> v1-3 ignore-process0) arg2) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (if (>= f0-2 0.0) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-2) + (set! (-> s5-0 best-other-tri collide-ptr) #f) + ) + ) + (cond + ((and (-> s5-0 best-other-tri collide-ptr) (let ((s3-0 (-> s5-0 best-other-tri collide-ptr))) + (if (type? s3-0 collide-shape-prim-sphere) + s3-0 + ) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s3-1 ent) (-> arg2 entity)) + (set! (-> s3-1 charge) 1.0) + (set! (-> s3-1 options) (projectile-options)) + (logclear! (-> s3-1 options) (projectile-options po14 po15 po16)) + (set! (-> s3-1 notify-handle) (the-as handle #f)) + (set! (-> s3-1 owner-handle) (the-as handle #f)) + (set! (-> s3-1 target-handle) (the-as handle #f)) + (set! (-> s3-1 target-pos quad) (the-as uint128 0)) + (set! (-> s3-1 ignore-handle) (process->handle arg2)) + (let* ((v1-19 *game-info*) + (a0-17 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-17) + (set! (-> s3-1 attack-id) a0-17) + ) + (set! (-> s3-1 timeout) (seconds 4)) + (set! (-> s3-1 pos quad) (-> s5-0 start-pos quad)) + (vector-normalize-copy! (-> s3-1 vel) (-> s5-0 move-dist) 4096000.0) + (spawn-projectile sew-laser-shot s3-1 arg2 *default-dead-pool*) + ) + (sound-play + "laser-hit-jak" + :position (vector+! (new 'stack-no-clear 'vector) (-> s5-0 start-pos) (-> s5-0 move-dist)) + ) + (vector-normalize! (-> s5-0 move-dist) (+ 2048.0 (vector-length (-> s5-0 move-dist)))) + ) + (else + (when arg2 + (let ((v1-30 arg2)) + (sound-play + "laser-sizzle" + :id (-> v1-30 sound-scorch) + :position (vector+! (new 'stack-no-clear 'vector) (-> s5-0 start-pos) (-> s5-0 move-dist)) + ) + ) + ) + ) + ) + (set! (-> *part-id-table* 4935 init-specs 4 initial-valuef) (vector-length (-> s5-0 move-dist))) + (draw-beam (-> *part-id-table* 4935) arg0 (-> s5-0 move-dist) #f) + (launch-particles (-> *part-id-table* 4936) arg0) + (launch-particles (-> *part-id-table* 4937) arg0) + (launch-particles (-> *part-id-table* 4938) (vector+! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) arg0)) + (launch-particles (-> *part-id-table* 4939) (vector+! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) arg0)) + ) + (none) + ) + +(defmethod sew-laser-guard-method-155 ((this sew-laser-guard)) + (let ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5)))) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! s4-0 (-> this root quat)) + (vector-normalize! s4-0 1.0) + (fire-laser! s5-0 s4-0 this 491520.0) + ) + ) + (none) + ) + +(defstate hostile (sew-laser-guard) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (if (= proc *target*) + (send-event proc 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 3)) + (shove-up (meters 1)) + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (ja :group! sew-laser-guard-idle-ja) + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (until #f + (let ((f30-0 (get-norm! (-> self sync-orient) 0))) + (cond + ((-> self last-play-sweep-dir-positive?) + (when (and (< (- f30-0 (-> self last-play-sweep-sync)) 0.0) (< 0.8 f30-0)) + (sound-play "laser-sweep") + (set! (-> self last-play-sweep-dir-positive?) #f) + ) + ) + (else + (when (and (< 0.0 (- f30-0 (-> self last-play-sweep-sync))) (< f30-0 0.2)) + (sound-play "laser-sweep") + (set! (-> self last-play-sweep-dir-positive?) #t) + ) + ) + ) + (quaternion-slerp! (-> self root quat) (-> self start-orient) (-> self end-orient) f30-0) + (quaternion-normalize! (-> self root quat)) + (set! (-> self last-play-sweep-sync) f30-0) + ) + (sound-play "laser-guard" :id (-> self sound-hum)) + (let ((t9-8 (method-of-object self sew-laser-guard-method-155)) + (a0-9 self) + ) + #t + (t9-8 a0-9) + ) + (suspend) + ) + #f + ) + ) + +(defstate stare (sew-laser-guard) + :virtual #t + :trans (behavior () + (go-hostile self) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this sew-laser-guard)) + (the-as search-info-flag 1) + ) + +(defmethod event-handler ((this sew-laser-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('start) + #f + ) + (('attack) + #f + ) + (('touched 'touch) + #f + ) + (('stop) + #f + ) + (('bonk) + (when (= (-> arg0 type) target) + (send-event arg0 'target-mech-get-off (seconds 0.3)) + (send-event arg0 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + ) + #f + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate die (sew-laser-guard) + :virtual #t + :enter (behavior () + (on-dying self) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self hit-points) 0.0) + ) + :code (behavior () + (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock)) + (sound-play "turret-explode") + (suspend) + (cleanup-for-death self) + (ja-channel-set! 0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (+! (-> gp-1 y) 10240.0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2)) + (spawn (-> self part) gp-1) + (suspend) + ) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defmethod init-enemy-collision! ((this sew-laser-guard)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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)) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 3686.4 0.0 7372.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod deactivate ((this sew-laser-guard)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this casing-part)) + (kill-particles (-> this casing-part)) + ) + ((method-of-type enemy deactivate) this) + (none) + ) + +(defmethod coin-flip? ((this sew-laser-guard)) + #f + ) + +;; WARN: Return type mismatch enemy vs sew-laser-guard. +(defmethod relocate ((this sew-laser-guard) (offset int)) + (the-as sew-laser-guard ((method-of-type enemy relocate) this offset)) + ) + +(defmethod sew-laser-guard-method-156 ((this sew-laser-guard)) + 0 + (none) + ) + +(defmethod init-enemy! ((this sew-laser-guard)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-guard" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *sew-laser-guard-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1505) this)) + (let ((f30-0 (res-lump-float (-> this entity) 'rotoffset)) + (f28-0 (res-lump-float (-> this entity) 'rotmax :default 8192.0)) + (f26-0 (res-lump-float (-> this entity) 'rotmin :default -8192.0)) + (s5-1 (new 'stack-no-clear 'sync-info-params)) + ) + (if (!= f30-0 0.0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f30-0) + ) + (quaternion-rotate-y! (-> this start-orient) (-> this root quat) f26-0) + (quaternion-rotate-y! (-> this end-orient) (-> this start-orient) (- f28-0 f26-0)) + (let ((v1-20 0)) + (if #t + (set! v1-20 (logior v1-20 1)) + ) + (set! (-> s5-1 sync-type) 'sync-linear) + (set! (-> s5-1 sync-flags) (the-as sync-flags v1-20)) + ) + (set! (-> s5-1 entity) (-> this entity)) + (set! (-> s5-1 period) (the-as uint 1200)) + (set! (-> s5-1 percent) 0.0) + (initialize! (-> this sync-orient) s5-1) + ) + (set! (-> this last-play-sweep-dir-positive?) #t) + (set! (-> this last-play-sweep-sync) (get-norm! (-> this sync-orient) 0)) + (set! (-> this sound-hum) (new-sound-id)) + (set! (-> this sound-scorch) (new-sound-id)) + (logclear! (-> this mask) (process-mask enemy)) + 0 + (none) + ) + +(defmethod go-idle2 ((this sew-laser-guard)) + (go (method-of-object this hostile)) + ) + +(defmethod damage-enemy! ((this sew-laser-guard) (arg0 object) (arg1 event-message-block)) + (send-event + (the-as process-tree arg0) + 'shove + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + 0.0 + ) + +(defstate hit (sew-laser-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (go-hostile self) + ) + :code sleep-code + ) diff --git a/goal_src/jak3/levels/sewer/sew-platforms.gc b/goal_src/jak3/levels/sewer/sew-platforms.gc index ea3064cd91..9873ec4afd 100644 --- a/goal_src/jak3/levels/sewer/sew-platforms.gc +++ b/goal_src/jak3/levels/sewer/sew-platforms.gc @@ -7,3 +7,828 @@ ;; DECOMP BEGINS +(deftype sew-plat-updown (base-plat) + ((sync sync-eased :inline) + (path-pos float) + ) + (:state-methods + idle + active + ) + (:methods + (get-skel (_type_) art-group) + ) + ) + + +(defstate idle (sew-plat-updown) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code sleep-code + :post ja-post + ) + +(defstate active (sew-plat-updown) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post plat-post + ) + +(defmethod base-plat-method-34 ((this sew-plat-updown)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this sew-plat-updown) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-5 param 0) 1.0) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! + a0-5 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-24 0)) + (if (not (logtest? (-> this fact options) (actor-option loop))) + (set! v1-24 (logior v1-24 1)) + ) + (set! (-> a1-6 sync-type) 'sync-eased) + (set! (-> a1-6 sync-flags) (the-as sync-flags v1-24)) + ) + (set! (-> a1-6 period) (the-as uint 1800)) + (set! (-> a1-6 entity) arg0) + (set! (-> a1-6 percent) 0.0) + (set! (-> a1-6 ease-in) 0.15) + (set! (-> a1-6 ease-out) 0.15) + (set! (-> a1-6 pause-in) 0.2) + (set! (-> a1-6 pause-out) 0.0) + (initialize! (-> this sync) a1-6) + ) + (base-plat-method-34 this) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((> (-> this sync period) 0) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + +(defskelgroup skel-sew-slide-step sew-slide-step sew-slide-step-lod0-jg sew-slide-step-idle-ja + ((sew-slide-step-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) + +(deftype sew-slide-step (sew-plat-updown) + ((last-played-start? symbol) + ) + ) + + +(defmethod get-skel ((this sew-slide-step)) + (art-group-get-by-name *level* "skel-sew-slide-step" (the-as (pointer level) #f)) + ) + +(defstate active (sew-slide-step) + :virtual #t + :enter (behavior () + (set! (-> self last-played-start?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (cond + ((and (-> self last-played-start?) (< 0.9 (-> self path-pos))) + (sound-play "moving-step-out") + (set! (-> self last-played-start?) #f) + ) + ((and (not (-> self last-played-start?)) (< (-> self path-pos) 0.1)) + (set! (-> self last-played-start?) #t) + (sound-play "moving-step-in") + ) + ) + ) + ) + +(defmethod init-collision! ((this sew-slide-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defskelgroup skel-sew-moving-step-a sew-moving-step-a sew-moving-step-a-lod0-jg sew-moving-step-a-idle-ja + ((sew-moving-step-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 4) + ) + +(deftype sew-moving-step-a (sew-plat-updown) + ((last-played-start? symbol) + (last-val float) + ) + ) + + +;; WARN: Return type mismatch sparticle-launch-control vs none. +(defmethod base-plat-method-34 ((this sew-moving-step-a)) + (call-parent-method this) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1496) this)) + (none) + ) + +(defmethod update-part-and-sfx! ((this sew-moving-step-a)) + 0 + (none) + ) + +(defstate active (sew-moving-step-a) + :virtual #t + :enter (behavior () + (set! (-> self last-played-start?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self last-val) -1.0) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (when (< (-> self path-pos) 0.5) + (new 'stack-no-clear 'vector) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (quaternion-copy! s5-0 (-> self entity quat)) + (quaternion->matrix gp-0 s5-0) + ) + (set! (-> gp-0 trans quad) (-> self entity extra trans quad)) + (+! (-> gp-0 trans y) 20480.0) + (spawn-from-mat (-> self part) gp-0) + ) + ) + (if (and (< 0.65 (-> self last-val)) (>= 0.65 (-> self path-pos))) + (sound-play "mv-stp-a-splash") + ) + (if (and (< (-> self last-val) 0.95) (>= (-> self path-pos) 0.95)) + (sound-play "move-step-a-hit") + ) + (set! (-> self last-val) (-> self path-pos)) + ) + ) + +(defmethod get-skel ((this sew-moving-step-a)) + (art-group-get-by-name *level* "skel-sew-moving-step-a" (the-as (pointer level) #f)) + ) + +(defmethod init-collision! ((this sew-moving-step-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(deftype sew-moving-step-b (process-drawable) + ((sync sync-linear :inline) + (num-steps int8) + (step-delay time-frame) + (start-step-pos vector :inline) + (end-step-pos vector :inline) + (last-sync-val float) + (sound-idle sound-id) + ) + (:state-methods + idle + active + ) + (:methods + (sew-moving-step-b-method-22 (_type_ float) int) + (sew-moving-step-b-method-23 (_type_) float) + (sew-moving-step-b-method-24 (_type_) int) + (alloc-trsqv! (_type_) none) + (sew-moving-step-b-method-26 (_type_ int float) float) + ) + ) + + +(defmethod alloc-trsqv! ((this sew-moving-step-b)) + (set! (-> this root) (new 'process 'trsqv)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this sew-moving-step-b) (arg0 entity-actor)) + (alloc-trsqv! this) + (process-drawable-from-entity! this arg0) + (set! (-> this sound-idle) (new-sound-id)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-6 0)) + (if #f + (set! v1-6 (logior v1-6 1)) + ) + (set! (-> a1-3 sync-type) 'sync-linear) + (set! (-> a1-3 sync-flags) (the-as sync-flags v1-6)) + ) + (set! (-> a1-3 entity) arg0) + (set! (-> a1-3 period) (the-as uint 4800)) + (set! (-> a1-3 percent) 0.0) + (initialize! (-> this sync) a1-3) + ) + (set! (-> this num-steps) + (res-lump-value (-> this entity) 'sesc-num-steps int :default (the-as uint128 4) :time -1000000000.0) + ) + (set! (-> this step-delay) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'sesc-step-delay :default 4.0)))) + ) + (set! (-> this num-steps) (min (-> this num-steps) (sew-moving-step-b-method-24 this))) + (set! (-> this last-sync-val) (- 1.0 (* 0.5 (sew-moving-step-b-method-23 this)))) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((> (-> this sync period) 0) + (let ((s4-0 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (s5-3 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) + ) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s5-3 s4-0))) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 16384.0) + (vector-! s4-0 s4-0 s3-1) + (vector-! s5-3 s5-3 s3-1) + ) + (set! (-> this start-step-pos quad) (-> s4-0 quad)) + (set! (-> this end-step-pos quad) (-> s5-3 quad)) + ) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + +(defstate idle (sew-moving-step-b) + :virtual #t + :code sleep-code + :post ja-post + ) + +(defmethod sew-moving-step-b-method-24 ((this sew-moving-step-b)) + (the int (/ (the float (-> this sync period)) (the float (-> this step-delay)))) + ) + +(defmethod sew-moving-step-b-method-23 ((this sew-moving-step-b)) + (/ (the float (-> this step-delay)) (the float (-> this sync period))) + ) + +(defmethod sew-moving-step-b-method-22 ((this sew-moving-step-b) (arg0 float)) + (the int (/ arg0 (sew-moving-step-b-method-23 this))) + ) + +(defmethod sew-moving-step-b-method-26 ((this sew-moving-step-b) (arg0 int) (arg1 float)) + (let ((f30-1 (- arg1 (* (the float arg0) (sew-moving-step-b-method-23 this))))) + (if (< f30-1 0.0) + (+! f30-1 (* (the float (-> this num-steps)) (sew-moving-step-b-method-23 this))) + ) + f30-1 + ) + ) + +(deftype sew-moving-step-b-step (base-plat) + ((start-pos vector :inline) + (end-pos vector :inline) + (start-path-pos vector :inline) + (end-path-pos vector :inline) + (sync sync-linear :inline) + (path-pos float) + (last-t-val float) + ) + (:state-methods + active + die + ) + ) + + +(deftype sew-moving-step-b-step-param (structure) + ((start-pos vector :inline) + (end-pos vector :inline) + (ent entity-actor) + (period time-frame) + (offset float) + ) + ) + + +(defskelgroup skel-sew-moving-step-b sew-moving-step-b sew-moving-step-b-lod0-jg sew-moving-step-b-idle-ja + ((sew-moving-step-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +(defbehavior sew-moving-step-b-step-init-by-other sew-moving-step-b-step ((arg0 sew-moving-step-b-step-param)) + (process-entity-set! self (-> arg0 ent)) + (init-collision! self) + (set! (-> self root trans quad) (-> arg0 start-pos quad)) + (set! (-> self start-pos quad) (-> arg0 start-pos quad)) + (set! (-> self end-pos quad) (-> arg0 end-pos quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-moving-step-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) 16384.0) + (set! (-> self path) (new 'process 'path-control self 'path 0.0 (-> arg0 ent) #f)) + (get-point-at-percent-along-path! (-> self path) (-> self start-path-pos) 0.0 'interp) + (get-point-at-percent-along-path! (-> self path) (-> self end-path-pos) 1.0 'interp) + (let ((a1-7 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-16 0)) + (if #f + (set! v1-16 (logior v1-16 1)) + ) + (set! (-> a1-7 sync-type) 'sync-linear) + (set! (-> a1-7 sync-flags) (the-as sync-flags v1-16)) + ) + (set! (-> a1-7 entity) #f) + (set! (-> a1-7 period) (the-as uint (-> arg0 period))) + (set! (-> a1-7 percent) 0.0) + (initialize! (-> self sync) a1-7) + ) + (sync-now! (-> self sync) (-> arg0 offset)) + (set! (-> self last-t-val) -1.0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1497) self)) + (go-virtual active) + ) + +(defun fmod ((arg0 float) (arg1 float)) + (- arg0 (* (the float (the int (/ arg0 arg1))) arg1)) + ) + +;; WARN: Return type mismatch process vs sew-moving-step-b-step. +(defun spawn-moving-step-b-step ((arg0 sew-moving-step-b) (arg1 float)) + (let ((gp-0 (new 'stack-no-clear 'sew-moving-step-b-step-param))) + (set! (-> gp-0 start-pos quad) (-> arg0 start-step-pos quad)) + (set! (-> gp-0 end-pos quad) (-> arg0 end-step-pos quad)) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 period) (the-as time-frame (-> arg0 sync period))) + (set! (-> gp-0 offset) arg1) + (let ((s5-0 (the-as process #f))) + (let ((v1-5 (process-spawn sew-moving-step-b-step gp-0 :name "sew-moving-step-b-step"))) + (if v1-5 + (set! s5-0 (-> v1-5 0)) + ) + ) + (the-as sew-moving-step-b-step s5-0) + ) + ) + ) + +(defmethod deactivate ((this sew-moving-step-b)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-idle)) + (sound-stop (-> this sound-idle)) + ) + (call-parent-method this) + (none) + ) + +(defstate active (sew-moving-step-b) + :virtual #t + :enter (behavior () + '() + ) + :trans (behavior () + (sound-play "move-step-b-lp" :id (-> self sound-idle)) + (let ((f30-0 (get-norm! (-> self sync) 0))) + (let* ((s5-0 (sew-moving-step-b-method-22 self (-> self last-sync-val))) + (gp-0 (- (sew-moving-step-b-method-22 self f30-0) s5-0)) + (f28-1 (fmod f30-0 (* (the float (-> self num-steps)) (sew-moving-step-b-method-23 self)))) + ) + (if (< gp-0 0) + (+! gp-0 (sew-moving-step-b-method-24 self)) + ) + (dotimes (s4-1 gp-0) + (set! s5-0 (mod (+ s5-0 1) (sew-moving-step-b-method-24 self))) + (if (< s5-0 (-> self num-steps)) + (spawn-moving-step-b-step self (sew-moving-step-b-method-26 self s5-0 f28-1)) + ) + ) + ) + (set! (-> self last-sync-val) f30-0) + ) + ) + :code sleep-code + ) + +(defmethod init-collision! ((this sew-moving-step-b-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod update-part-and-sfx! ((this sew-moving-step-b-step)) + 0 + (none) + ) + +(defstate die (sew-moving-step-b-step) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code (behavior () + '() + ) + ) + +(defstate active (sew-moving-step-b-step) + :virtual #t + :event plat-event + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (the-as time-frame (-> self sync period))) + (go-virtual die) + ) + (let ((f30-0 (get-norm! (-> self sync) 0))) + (if (< f30-0 (-> self last-t-val)) + (go-virtual die) + ) + (if (and (< (-> self last-t-val) 0.5) (>= f30-0 0.5)) + (sound-play "move-step-b-hit") + ) + (set! (-> self last-t-val) f30-0) + (cond + ((< f30-0 0.2) + (let ((f0-5 (* 5.0 f30-0))) + (vector-lerp! (-> self basetrans) (-> self start-pos) (-> self start-path-pos) f0-5) + ) + (spawn (-> self part) (-> self start-path-pos)) + ) + ((< 0.8 f30-0) + (let ((f0-8 (* 5.0 (+ -0.8 f30-0)))) + (vector-lerp! (-> self basetrans) (-> self end-path-pos) (-> self end-pos) f0-8) + ) + ) + (else + (let ((f28-0 (* 1.6666666 (+ -0.2 f30-0)))) + (set! (-> self path-pos) f28-0) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (let ((f0-12 (fmax 0.25 (fmin 1.0 (* 2.0 (- 1.0 f28-0)))))) + (set-vector! (-> self draw color-mult) f0-12 f0-12 f0-12 1.0) + ) + ) + (if (< f30-0 0.48) + (spawn (-> self part) (-> self basetrans)) + ) + ) + ) + ) + (plat-trans) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post plat-post + ) + +(defskelgroup skel-sew-rove-plat sew-rove-plat sew-rove-plat-lod0-jg sew-rove-plat-idle-ja + ((sew-rove-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.5) + ) + +(deftype sew-rove-plat (sew-plat-updown) + ((sound-id sound-id) + ) + ) + + +(defmethod get-skel ((this sew-rove-plat)) + (art-group-get-by-name *level* "skel-sew-rove-plat" (the-as (pointer level) #f)) + ) + +(defmethod run-logic? ((this sew-rove-plat)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod deactivate ((this sew-rove-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this sound-id)) + (call-parent-method this) + (none) + ) + +(defmethod init-collision! ((this sew-rove-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) -15.5648 -3650.3552 0.8192 29212.262) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this sound-id) (new-sound-id)) + 0 + (none) + ) + +(defstate active (sew-rove-plat) + :virtual #t + :trans (behavior () + (sound-play "rove-plat-loop" :id (-> self sound-id)) + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + ) + ) + +(defskelgroup skel-sew-move-plat sew-move-plat sew-move-plat-lod0-jg sew-move-plat-idle-ja + ((sew-move-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +(deftype sew-move-plat (base-plat) + ((sound-id sound-id) + (positions vector 2 :inline) + (current-pos-index int8) + (dest-pos-index int8) + (speed float) + ) + (:state-methods + waiting + active + ) + (:methods + (sew-move-plat-method-37 (_type_) int) + ) + ) + + +(defstate waiting (sew-move-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (go-virtual active) + ) + ) + (plat-event proc argc message block) + ) + :enter (behavior () + (set! (-> self basetrans quad) (-> self positions (-> self current-pos-index) quad)) + ) + :trans (behavior () + (plat-trans) + (if (> (-> self root num-riders) 0) + (go-virtual active) + ) + ) + :code sleep-code + :post (behavior () + (plat-post) + ) + ) + +(defmethod sew-move-plat-method-37 ((this sew-move-plat)) + (let ((f30-0 (vector-vector-xz-distance-squared (target-pos 0) (the-as vector (-> this positions))))) + (logand (+ (-> this dest-pos-index) 1) 1) + (if (< f30-0 (vector-vector-xz-distance-squared (target-pos 0) (-> this positions 1))) + 0 + 1 + ) + ) + ) + +(defstate active (sew-move-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('foo) + (format 0 "FOo~%") + ) + ) + ) + :enter (behavior () + (set! (-> self dest-pos-index) (logand (+ (-> self current-pos-index) 1) 1)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (sound-play "move-plat-loop" :id (-> self sound-id)) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (if (>= (vector-vector-xz-distance (-> self basetrans) (target-pos 0)) 40960.0) + (set! (-> self dest-pos-index) (sew-move-plat-method-37 self)) + ) + (set-time! (-> self state-time)) + ) + (let ((gp-2 + (vector-! (new 'stack-no-clear 'vector) (-> self positions (-> self dest-pos-index)) (-> self basetrans)) + ) + ) + 0.0 + (let ((f0-2 (vector-normalize-ret-len! gp-2 1.0)) + (f1-2 (* 20480.0 (seconds-per-frame))) + ) + (cond + ((< f0-2 f1-2) + (set! (-> self current-pos-index) (-> self dest-pos-index)) + (sound-stop (-> self sound-id)) + (sound-play "move-plat-hit") + (go-virtual waiting) + ) + (else + (vector+float*! (-> self basetrans) (-> self basetrans) gp-2 f1-2) + (set! (-> self root trans quad) (-> self basetrans quad)) + ) + ) + ) + ) + (plat-trans) + ) + :code sleep-code + :post plat-post + ) + +(defmethod init-collision! ((this sew-move-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this sound-id) (new-sound-id)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this sew-move-plat) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-move-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-5 param 0) 1.0) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! + a0-5 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (set! (-> this current-pos-index) 0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (get-point-at-percent-along-path! (-> this path) (the-as vector (-> this positions)) 0.0 'interp) + (get-point-at-percent-along-path! (-> this path) (-> this positions 1) 1.0 'interp) + (set! (-> this basetrans quad) (-> this root trans quad)) + (set! (-> this current-pos-index) (sew-move-plat-method-37 this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this waiting)) + ) + +(defmethod deactivate ((this sew-move-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + ) + (call-parent-method this) + (none) + ) + +(defmethod run-logic? ((this sew-move-plat)) + "Should this process be run? Checked by execute-process-tree." + #t + ) diff --git a/goal_src/jak3/levels/sewer/sew-whirlpool.gc b/goal_src/jak3/levels/sewer/sew-whirlpool.gc index cb57e88cc8..74c9e15315 100644 --- a/goal_src/jak3/levels/sewer/sew-whirlpool.gc +++ b/goal_src/jak3/levels/sewer/sew-whirlpool.gc @@ -7,3 +7,102 @@ ;; DECOMP BEGINS +(deftype sew-whirlpool (process-drawable) + ((spool-sound-id sound-id) + ) + (:state-methods + idle + ) + ) + + +(defstate idle (sew-whirlpool) + :virtual #t + :trans (behavior () + (when (and *target* + (or (logtest? (water-flag touch-water) (-> *target* water flags)) + (logtest? (-> *target* control status) (collide-status on-water)) + ) + (not (logtest? (-> *target* focus-status) (focus-status grabbed))) + ) + (let* ((gp-0 (target-pos 0)) + (f30-0 (vector-vector-xz-distance (-> self root trans) gp-0)) + ) + (when (< f30-0 61440.0) + (let* ((f26-0 (* 0.000016276043 (- 61440.0 f30-0))) + (f24-0 98304.0) + (f0-6 (atan (- (-> gp-0 x) (-> self root trans x)) (- (-> gp-0 z) (-> self root trans z)))) + (f28-0 (* 0.5 f26-0 f24-0 (seconds-per-frame))) + (f22-0 (+ f0-6 f28-0)) + (f26-1 (- f30-0 (fmin f30-0 (* 0.16874999 f26-0 (fabs f24-0) (seconds-per-frame))))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! s5-0 (* (sin f22-0) f26-1) 0.0 (* (cos f22-0) f26-1) 1.0) + (vector+! s5-0 s5-0 (-> self root trans)) + (set! (-> s5-0 x) (* (- (-> s5-0 x) (-> gp-0 x)) (-> self clock frames-per-second))) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* (- (-> s5-0 z) (-> gp-0 z)) (-> self clock frames-per-second))) + (let ((gp-1 (-> *target* control))) + (let ((s4-1 (new 'stack-no-clear 'collide-query))) + (send-event (-> gp-1 process) 'rotate-y-angle f28-0) + (set! (-> s4-1 collide-with) (-> gp-1 root-prim prim-core collide-with)) + (set! (-> s4-1 ignore-process0) self) + (set! (-> s4-1 ignore-process1) #f) + (set! (-> s4-1 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> s4-1 action-mask) (collide-action solid)) + (fill-cache-for-shape gp-1 8192.0 s4-1) + ) + (let ((s4-2 (-> gp-1 status))) + (integrate-and-collide! gp-1 s5-0) + (set! (-> gp-1 status) s4-2) + ) + ) + ) + (when (and (< f30-0 4096.0) (not (logtest? (-> *target* focus-status) (focus-status dead)))) + (set-action! + *gui-control* + (gui-action play) + (-> self spool-sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (sound-params-set! *gui-control* (-> self spool-sound-id) #f -1 -1 -1 0.5) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'drown-death) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +(defmethod deactivate ((this sew-whirlpool)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defmethod init-from-entity! ((this sew-whirlpool) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this spool-sound-id) + (add-process *gui-control* this (gui-channel gun) (gui-action queue) "whrlpool" -99.0 0) + ) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/sewer/sewer-frog.gc b/goal_src/jak3/levels/sewer/sewer-frog.gc index f0f55c5345..dfafba2a51 100644 --- a/goal_src/jak3/levels/sewer/sewer-frog.gc +++ b/goal_src/jak3/levels/sewer/sewer-frog.gc @@ -7,3 +7,1110 @@ ;; DECOMP BEGINS +(defskelgroup skel-sewer-frog sewer-frog sewer-frog-lod0-jg -1 + ((sewer-frog-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow sewer-frog-shadow-mg + :origin-joint-index 19 + ) + +(deftype sewer-frog (nav-enemy) + ((scared-timer time-frame) + ) + (:state-methods + attack + turn-to-face-focus + ) + (:methods + (sewer-frog-method-192 (_type_) none) + ) + ) + + +(define *fact-info-sewer-frog-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +(define *sewer-frog-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 9 + :hostile-anim 5 + :hit-anim 17 + :knocked-anim 17 + :knocked-land-anim 3 + :die-anim 17 + :die-falling-anim 17 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 13 + :look-at-joint 14 + :bullseye-joint 4 + :sound-hit (static-sound-name "frog-hit") + :sound-die (static-sound-name "frog-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.96 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.0676 :y -0.6016 :z 0.7959 :w 30666.041) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1444 :z 0.9894 :w 28642.4) + :geo-tform (new 'static 'vector :x 0.0925 :y -0.3416 :z 0.9349 :w 31829.453) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1984.512 + :hit-sound (static-sound-name "frog-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9735 :z -0.2274 :w 40103.246) + :geo-tform (new 'static 'vector :x 0.6954 :y -0.5427 :z 0.4701 :w 20942.34) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 2285.9775 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9656 :z -0.2587 :w 9536.927) + :geo-tform (new 'static 'vector :x 0.1274 :y -0.3552 :z 0.9257 :w 31935.02) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 2165.5552 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9743 :z -0.2249 :w 4085.8784) + :geo-tform (new 'static 'vector :x 0.1327 :y -0.1756 :z 0.9751 :w 32268.125) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1615.4624 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5322 :z 0.8462 :w 9507.29) + :geo-tform (new 'static 'vector :x 0.2871 :y 0.8561 :z 0.4289 :w 28150.988) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9435 :z -0.3305 :w 10984.38) + :geo-tform (new 'static 'vector :x -0.1293 :y 0.9912 :z -0.0126 :w 27502.092) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 318.6688 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 13 + :pre-tform (new 'static 'vector :x -0.9599 :z 0.2795 :w 8485.092) + :geo-tform (new 'static 'vector :x 0.0847 :y 0.7561 :z 0.6485 :w 34826.777) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1267.3024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2587 :z 0.9657 :w 16383.618) + :geo-tform (new 'static 'vector :x -0.0125 :y -0.0002 :z 0.9998 :w 15964.989) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z -0.0125 :w 16512.342) + :geo-tform (new 'static 'vector :x -0.4189 :y -0.8113 :z -0.4067 :w 18265.03) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0273 :z -0.9994 :w 9645.098) + :geo-tform (new 'static 'vector :x 0.3147 :y -0.9196 :z 0.2348 :w 17491.832) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1064.96 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0536 :z -0.9983 :w 10284.383) + :geo-tform (new 'static 'vector :y 1.0 :w 16905.375) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 363.3152 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.2587 :z -0.9657 :w 16384.346) + :geo-tform (new 'static 'vector :x -0.3909 :y 0.397 :z -0.8299 :w 18671.133) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7246 :z 0.6887 :w 16217.065) + :geo-tform (new 'static 'vector :x -0.1156 :y 0.9519 :z 0.2825 :w 24950.34) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7086 :z 0.7052 :w 5922.1064) + :geo-tform (new 'static 'vector :x -0.3934 :y 0.2208 :z 0.8921 :w 31601.842) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1087.488 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.66 :z 0.7508 :w 11664.098) + :geo-tform (new 'static 'vector :y -1.0 :w 8004.1665) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 452.608 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.9763 :z -0.2153 :w 10854.364) + :geo-tform (new 'static 'vector :x -0.0517 :y 0.8422 :z -0.536 :w 34465.51) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1393.4592 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9814 :z -0.1916 :w 12053.145) + :geo-tform (new 'static 'vector :x 0.0117 :y 0.992 :z 0.1236 :w 34765.535) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1039.9744 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2473 :z 0.9686 :w 14074.312) + :geo-tform (new 'static 'vector :x 0.4625 :y 0.8439 :z 0.2713 :w 24201.445) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8453 :z -0.5342 :w 10724.566) + :geo-tform (new 'static 'vector :x -0.4236 :y -0.3812 :z 0.8213 :w 36821.477) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5795 :z 0.8146 :w 41836.6) + :geo-tform (new 'static 'vector :x -0.3352 :y 0.2062 :z 0.9189 :w 30666.19) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1061.6832 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6926 :z 0.721 :w 27957.91) + :geo-tform (new 'static 'vector :x -0.148 :y 0.9414 :z 0.302 :w 23747.88) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 562.7904 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.1352 :z -0.9905 :w 14070.961) + :geo-tform (new 'static 'vector :x 0.304 :y -0.8482 :z -0.4328 :w 20045.35) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9968 :z -0.0763 :w 9360.489) + :geo-tform (new 'static 'vector :x 0.5934 :y -0.3585 :z 0.7204 :w 26778.32) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1915 :z 0.9814 :w 23136.174) + :geo-tform (new 'static 'vector :x 0.4151 :y 0.3163 :z 0.8526 :w 36129.96) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1043.2512 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5995 :z 0.8 :w 40254.598) + :geo-tform (new 'static 'vector :x 0.1548 :y 0.9404 :z 0.3018 :w 42156.035) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 652.0832 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.0201 :z -0.9995 :w 9496.604) + :geo-tform (new 'static 'vector :x 0.4419 :y -0.494 :z 0.7483 :w 35945.93) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 547.6352 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9733 :z -0.2282 :w 11187.232) + :geo-tform (new 'static 'vector :x 0.5046 :y 0.0354 :z 0.8622 :w 30183.021) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 349.3888 + :hit-sound (static-sound-name "frog-rgdoll") + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim -1 + :run-anim 5 + :taunt-anim 3 + :run-travel-speed (meters 11.6667) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 0.5) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 0.2) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *sewer-frog-nav-enemy-info* fact-defaults) *fact-info-sewer-frog-defaults*) + +(defmethod init-enemy-collision! ((this sewer-frog)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle 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 4915.2 0.0 10240.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.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 enemy)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-15 transform-index) 18) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 1228.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-17 transform-index) 14) + (set-vector! (-> v1-17 local-sphere) 0.0 409.6 1228.8 4096.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defbehavior sewer-frog-hop sewer-frog () + (let ((a1-0 (-> self nav state)) + (a0-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-0 quad) (-> a1-0 target-pos quad)) + (let* ((f0-0 (vector-vector-xz-distance a0-0 (-> self root trans))) + (gp-0 (-> self enemy-info)) + (f30-0 (lerp-scale 0.0 1.0 f0-0 12288.0 28672.0)) + (f28-0 1.0) + ) + (let ((s5-0 (-> self nav))) + (set! (-> s5-0 target-speed) (lerp (-> gp-0 walk-travel-speed) (-> gp-0 run-travel-speed) f30-0)) + ) + 0 + (let ((s5-1 (-> self nav))) + (set! (-> s5-1 acceleration) (lerp (-> gp-0 walk-acceleration) (-> gp-0 run-acceleration) f30-0)) + ) + 0 + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 turning-acceleration) (-> gp-0 run-turning-acceleration)) + ) + 0 + (ja-channel-push! 2 (seconds 0.01)) + (ja-no-eval :group! sewer-frog-hop-small-start-ja :num! (seek! max f28-0) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! sewer-frog-hop0-start-ja + :num! (chan 0) + :frame-interp0 f30-0 + :frame-interp1 f30-0 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (let ((a0-7 (-> self skel root-channel 0))) + (let ((f0-14 (- 1.0 f30-0))) + (set! (-> a0-7 frame-interp 1) f0-14) + (set! (-> a0-7 frame-interp 0) f0-14) + ) + (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group frames num-frames) -1))) + (set! (-> a0-7 param 1) f28-0) + (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! sewer-frog-hop-small-end-ja :num! (seek! max f28-0) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! sewer-frog-hop0-end-ja + :num! (chan 0) + :frame-interp0 f30-0 + :frame-interp1 f30-0 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (let ((a0-13 (-> self skel root-channel 0))) + (let ((f0-24 (- 1.0 f30-0))) + (set! (-> a0-13 frame-interp 1) f0-24) + (set! (-> a0-13 frame-interp 0) f0-24) + ) + (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group frames num-frames) -1))) + (set! (-> a0-13 param 1) f28-0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + ) + ) + ) + 0 + (none) + ) + +(defbehavior sewer-frog-turn-to-face sewer-frog ((arg0 vector)) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root trans))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (vector-normalize-copy! s4-0 s2-1 1.0) + (let* ((f0-1 (vector-dot s4-0 s3-0)) + (f30-0 (vector-dot s4-0 gp-0)) + (gp-1 (the int (+ 0.5 (* 0.00012207031 (acos f0-1))))) + ) + (cond + ((>= (the-as uint gp-1) (the-as uint 3)) + (ja-channel-push! 1 (seconds 0.08)) + (dotimes (s4-1 (+ (shr gp-1 2) 1)) + (cond + ((< 0.0 f30-0) + (ja-no-eval :group! sewer-frog-turn-left-180-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-to-point-toward-point! (-> self root) arg0 49152.0 (seconds 0.02)) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! sewer-frog-turn-right-180-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-to-point-toward-point! (-> self root) arg0 49152.0 (seconds 0.02)) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ((> (the-as uint gp-1) 0) + (ja-channel-push! 1 (seconds 0.1)) + (dotimes (s5-1 (+ gp-1 1)) + (cond + ((< 0.0 f30-0) + (ja-no-eval :group! sewer-frog-turn-left-45-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 20480.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! sewer-frog-turn-right-45-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -20480.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate turn-to-face-focus (sewer-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (set-look-at-mode! self 1) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (sewer-frog-turn-to-face (-> self focus-pos)) + (go-stare self) + ) + :post nav-enemy-simple-post + ) + +(defstate active (sewer-frog) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-182 self) + ) + :trans #f + :code (behavior () + (until #f + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) (nav-enemy-method-174 self)) + (nav-enemy-method-164 self) + (nav-enemy-method-173 self) + ) + (let ((t9-3 sewer-frog-turn-to-face) + (a1-0 (-> self nav state)) + (a0-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-3 quad) (-> a1-0 target-pos quad)) + (t9-3 a0-3) + ) + ((-> (method-of-type nav-enemy active) trans)) + (nav-enemy-method-181 self) + (sewer-frog-hop) + (nav-enemy-method-182 self) + (let ((gp-0 (the int (* 300.0 (rnd-float-range self 1.0 3.0))))) + (ja-channel-push! 1 (seconds 0.2)) + (let ((s5-0 (current-time)) + (f30-1 1.0) + ) + (ja-no-eval :group! sewer-frog-idle0-ja :num! (loop! f30-1) :frame-num 0.0) + (until (time-elapsed? s5-0 gp-0) + ((-> (method-of-type nav-enemy active) trans)) + (suspend) + (ja :num! (loop! f30-1)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-travel-post) + ) + ) + +(defstate stare (sewer-frog) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-184 self) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (not (enemy-method-104 self (-> self focus-pos) 10012.444)) + ) + (go-virtual turn-to-face-focus) + ) + ) + ) + +(defstate hostile (sewer-frog) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag alert)) + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-184 self) + (nav-enemy-method-182 self) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (let ((gp-0 (current-time)) + (s5-0 60) + (f30-0 1.0) + ) + (ja-no-eval :group! sewer-frog-idle0-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-0 s5-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (sewer-frog-method-192 self) + (until #f + (let ((t9-4 sewer-frog-turn-to-face) + (a1-3 (-> self nav state)) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (t9-4 a0-4) + ) + (sewer-frog-method-192 self) + (nav-enemy-method-181 self) + (sewer-frog-hop) + (nav-enemy-method-182 self) + ) + #f + ) + ) + +(defstate attack (sewer-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (nav-enemy-method-184 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 (-> self enemy-info))) + (nav-enemy-method-178 self) + (ja-no-eval :group! sewer-frog-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-26 (-> self nav))) + (set! (-> v1-26 target-speed) 122880.0) + ) + 0 + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 acceleration) (-> gp-0 run-acceleration)) + ) + 0 + (let ((v1-30 (-> self nav))) + (set! (-> v1-30 turning-acceleration) (-> gp-0 run-turning-acceleration)) + ) + ) + 0 + (let* ((a0-6 (-> self root root-prim)) + (v1-34 (-> (the-as collide-shape-prim-group a0-6) child 2)) + ) + (+! (-> a0-6 local-sphere w) 4096.0) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot player-list)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! sewer-frog-attack0-mid-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (logtest? (-> self water flags) (water-flag active)) + (spawn-ripples (-> self water) 1.0 (-> self root trans) 1 *null-vector* #f) + ) + (let* ((v1-69 (-> self root root-prim)) + (a0-14 (-> (the-as collide-shape-prim-group v1-69) child 2)) + ) + (+! (-> v1-69 local-sphere w) -4096.0) + (set! (-> a0-14 prim-core collide-as) (collide-spec)) + (set! (-> a0-14 prim-core collide-with) (collide-spec)) + ) + 0 + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! sewer-frog-attack0-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 3.8 5.6))))) + (go-best-state self) + ) + :post nav-enemy-chase-post + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior sewer-frog-check-hop sewer-frog () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self move-dest quad)) + (set! (-> a1-0 w) (-> self nav-radius-backup)) + (if (add-root-sphere-to-hash! (-> self nav) a1-0 #x100068) + (go-virtual stare) + ) + ) + (none) + ) + +(defstate flee (sewer-frog) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (nav-enemy-method-182 self) + (ja-channel-push! 1 (seconds 0.12)) + (let ((gp-0 (current-time)) + (s5-0 60) + (f30-0 1.0) + ) + (ja-no-eval :group! sewer-frog-idle0-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-0 s5-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + ((-> (method-of-type nav-enemy flee) trans)) + (until #f + (let ((t9-5 sewer-frog-turn-to-face) + (a1-3 (-> self nav state)) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (t9-5 a0-4) + ) + ((-> (method-of-type nav-enemy flee) trans)) + (sewer-frog-check-hop) + (nav-enemy-method-181 self) + (sewer-frog-hop) + (nav-enemy-method-182 self) + ) + #f + ) + ) + +(defstate knocked (sewer-frog) + :virtual #t + :post (behavior () + (let ((v1-1 (handle->process (-> self ragdoll-proc)))) + (when v1-1 + (if (< 0.0 (-> self root transv y)) + (logior! (-> (the-as ragdoll-proc v1-1) ragdoll ragdoll-flags) (ragdoll-flag rf11)) + (logtest? (-> (the-as ragdoll-proc v1-1) ragdoll ragdoll-flags) (ragdoll-flag rf11)) + ) + ) + ) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs vector. +(defmethod nav-enemy-method-167 ((this sewer-frog)) + (let ((a0-2 (handle->process (-> this focus handle))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (the-as + vector + (when (and a0-2 (nav-enemy-method-166 this s5-0 (get-trans (the-as process-focusable a0-2) 0))) + (set! (-> s5-0 w) (-> this nav-radius-backup)) + (not (add-root-sphere-to-hash! (-> this nav) s5-0 #x100068)) + ) + ) + ) + ) + +(defmethod go-stare2 ((this sewer-frog)) + (if (not (enemy-method-104 this (-> this focus-pos) 6371.5557)) + (go (method-of-object this turn-to-face-focus)) + (go (method-of-object this stare)) + ) + ) + +(defmethod sewer-frog-method-192 ((this sewer-frog)) + ((-> (method-of-type nav-enemy hostile) trans)) + (let* ((a0-1 (-> this focus-pos)) + (v1-3 (vector-! (new 'stack-no-clear 'vector) a0-1 (-> this root trans))) + (f0-4 (sqrtf (+ (* (-> v1-3 x) (-> v1-3 x)) (* (-> v1-3 z) (-> v1-3 z))))) + ) + (when (< f0-4 40960.0) + (if (< 12288.0 f0-4) + (go (method-of-object this attack)) + (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 1.8 3.6))))) + ) + ) + ) + 0 + (none) + ) + +(defmethod ragdoll-settled? ((this sewer-frog)) + (let ((a0-2 (handle->process (-> this ragdoll-proc)))) + (or (not a0-2) + (ragdoll-proc-method-19 (the-as ragdoll-proc a0-2)) + (time-elapsed? (-> this state-time) (seconds 5)) + ) + ) + ) + +;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod enemy-method-108 ((this sewer-frog) (arg0 process-focusable)) + (or (< (current-time) (-> this scared-timer)) + (let ((v1-4 (handle->process (-> this focus handle)))) + (if v1-4 + (and (focus-test? (the-as process-focusable v1-4) disable dead ignore grabbed) + (< (vector-vector-xz-distance (-> this focus-pos) (-> this root trans)) 163840.0) + ) + #f + ) + ) + ) + ) + +(defmethod play-damage-sound ((this sewer-frog) (arg0 int)) + (case arg0 + ((2) + (if (and (-> this next-state) (= (-> this next-state name) 'knocked)) + (sound-play "frog-splash") + (sound-play "frog-waterhop") + ) + ) + (else + ((method-of-type nav-enemy play-damage-sound) this arg0) + ) + ) + ) + +(defmethod enemy-common-post ((this sewer-frog)) + (when (< 1 (the-as int (-> this focus aware))) + (let ((a0-3 (handle->process (-> this focus handle)))) + (if a0-3 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-3) 3) quad)) + ) + ) + ) + (water-control-method-10 (-> this water)) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +(defmethod event-handler ((this sewer-frog) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod init-enemy! ((this sewer-frog)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sewer-frog" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *sewer-frog-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 0 4096.0 8192.0 2048.0)) + (set! (-> this water flags) + (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) + ) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (let ((v1-10 (make-u128 (the-as uint #x706f687265) (the-as uint #x7461772d676f7266)))) + (set! (-> this water enter-water-sound) (the-as sound-name v1-10)) + ) + (let ((v1-11 (-> this neck))) + (set! (-> v1-11 up) (the-as uint 1)) + (set! (-> v1-11 nose) (the-as uint 2)) + (set! (-> v1-11 ear) (the-as uint 0)) + (set-vector! (-> v1-11 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-11 ignore-angle) 30947.555) + ) + (set! (-> this scared-timer) 0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/sewer/sewer-mood.gc b/goal_src/jak3/levels/sewer/sewer-mood.gc index ef2dd5da62..f388c29e2b 100644 --- a/goal_src/jak3/levels/sewer/sewer-mood.gc +++ b/goal_src/jak3/levels/sewer/sewer-mood.gc @@ -7,3 +7,368 @@ ;; DECOMP BEGINS +(deftype sewa-states (structure) + () + ) + + +;; WARN: Return type mismatch vector vs none. +(defun update-sewer-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (let ((a1-0 (-> v1-0 0))) + (set! (-> a1-0 dir0 direction x) -0.372) + (set! (-> a1-0 dir0 direction y) 0.853) + (set! (-> a1-0 dir0 direction z) 0.363) + (set! (-> a1-0 dir0 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 0.65 0.855 0.82 1.0) + (let ((a1-2 (-> v1-0 0 dir1))) + (set! (-> a1-2 direction x) 0.372) + (set! (-> a1-2 direction y) 0.853) + (set! (-> a1-2 direction z) -0.363) + (set! (-> a1-2 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir1 color) 0.65 0.855 0.82 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.627 0.718 1.0 1.0) + (set! (-> v1-0 0 dir0 extra x) 0.85) + (set! (-> v1-0 0 dir1 extra x) 0.3) + (set! (-> v1-0 0 dir2 extra x) 0.0) + (set! (-> v1-0 0 ambi extra x) 0.3) + ) + (let ((v1-2 (-> arg0 current-fog))) + (set! (-> v1-2 fog-color x) 150.0) + (set! (-> v1-2 fog-color y) 165.0) + (set! (-> v1-2 fog-color z) 220.0) + (set! (-> v1-2 fog-color w) 128.0) + ) + (set-vector! (-> arg0 current-fog fog-dists) 2048000.0 12288000.0 255.0 150.0) + (none) + ) + +(defbehavior update-mood-sewa time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +(deftype sewb-states (structure) + ((pulse pulse-state :inline) + ) + ) + + +(defun init-mood-sewb ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-2 1.0)) + (set! (-> v1-0 3) (the-as uint f0-2)) + f0-2 + ) + ) + ) + +(defbehavior update-mood-sewb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (update-mood-pulse arg0 7 0 1.0 0.25 (* 65536.0 (seconds-per-frame)) 0.0) + ) + ) + 0 + (none) + ) + +(deftype sewc-states (structure) + ((pulse pulse-state :inline) + (electricity electricity-state :inline) + (rot float) + ) + ) + + +(defun init-mood-sewc ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 5) (the-as uint 1.0)) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-3 1.0)) + (set! (-> v1-0 3) (the-as uint f0-3)) + f0-3 + ) + ) + ) + +(defbehavior update-mood-sewc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewc-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 2 16 0.8 1.0) + (update-mood-pulse arg0 3 0 1.0 0.25 (* 87381.336 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype sewd-states (structure) + ((pulse pulse-state :inline) + (electricity electricity-state :inline) + (rot float) + ) + ) + + +(defun init-mood-sewd ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 5) (the-as uint 0.0)) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-3 1.0)) + (set! (-> v1-0 3) (the-as uint f0-3)) + f0-3 + ) + ) + ) + +(defbehavior update-mood-sewd time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewd-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 2 16 0.8 1.0) + (update-mood-pulse arg0 3 0 1.0 0.25 (* 87381.336 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun set-sewd-light! ((arg0 float)) + (let ((v1-1 (level-get *level* 'sewd))) + (when (and v1-1 (= (-> v1-1 status) 'active)) + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 5) (the-as uint arg0)) + ) + ) + ) + (none) + ) + +(deftype sewg-states (structure) + ((electricity electricity-state 2 :inline) + (rot float :offset 32) + ) + ) + + +(defun init-mood-sewg ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 1) (the-as uint 1.0)) + (let ((f0-1 1.0)) + (set! (-> v1-0 5) (the-as uint f0-1)) + f0-1 + ) + ) + ) + +(defbehavior update-mood-sewg time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewg-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-electricity arg0 2 0 1.2 1.7) + (update-mood-electricity arg0 3 16 1.2 1.7) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +(defun set-sewg-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'sewg))) + (when v1-1 + (let ((v1-2 (the-as sewg-states (-> v1-1 mood-context state)))) + (set! (-> (the-as sewg-states (+ (the-as uint v1-2) (* arg1 16))) electricity 0 scale) arg0) + ) + ) + ) + 0 + (none) + ) + +(deftype sewh-states (structure) + ((electricity electricity-state 5 :inline) + (turret-value float :offset 80) + ) + ) + + +(defun init-mood-sewh ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 5) (the-as uint 1.0)) + (set! (-> v1-0 9) (the-as uint 1.0)) + (set! (-> v1-0 13) (the-as uint 1.0)) + (let ((f0-4 1.0)) + (set! (-> v1-0 17) (the-as uint f0-4)) + f0-4 + ) + ) + ) + +(defbehavior update-mood-sewh time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewh-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 2 0 1.2 1.7) + (update-mood-electricity arg0 3 16 1.2 1.7) + (update-mood-electricity arg0 5 48 1.2 1.7) + (update-mood-electricity arg0 6 64 1.2 1.7) + (set! (-> arg0 times 7 w) (-> gp-0 turret-value)) + (if (not (paused?)) + (set! (-> gp-0 turret-value) (fmax 0.0 (+ -0.1 (-> gp-0 turret-value)))) + ) + ) + ) + ) + 0 + (none) + ) + +(defun set-sewh-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'sewh))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as sewh-states (+ (the-as uint v1-2) (* arg1 16))) electricity 0 scale) arg0) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun set-sewh-turret-flash! () + (let ((v1-1 (level-get *level* 'sewh))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 20) (the-as uint 1.2)) + ) + ) + ) + (none) + ) + +(deftype sewj-states (structure) + ((rot float) + ) + ) + + +(defbehavior update-mood-sewj time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewj-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/sewer/sewer-move-turret.gc b/goal_src/jak3/levels/sewer/sewer-move-turret.gc index 14b258bf6d..0de2b21437 100644 --- a/goal_src/jak3/levels/sewer/sewer-move-turret.gc +++ b/goal_src/jak3/levels/sewer/sewer-move-turret.gc @@ -5,5 +5,536 @@ ;; name in dgo: sewer-move-turret ;; dgos: SEA +(declare-type sew-move-turret process-drawable) +(declare-type sew-move-turret-shot projectile) +(define-extern spawn-sew-move-turret-projectile (function sew-move-turret vector vector float vector (pointer sew-move-turret-shot))) + ;; DECOMP BEGINS +(deftype sew-move-turret (process-drawable) + ((sound-id sound-id) + (use-doppler? symbol) + ) + (:state-methods + idle + active + ) + (:methods + (sew-move-turret-method-22 (_type_ int) none) + ) + ) + + +(defskelgroup skel-sew-move-turret sew-move-turret sew-move-turret-lod0-jg sew-move-turret-idle-ja + ((sew-move-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +(defstate idle (sew-move-turret) + :virtual #t + :trans (behavior () + (let ((f30-0 (vector-vector-distance (-> self root trans) (target-pos 0))) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-1 (target-pos 0) (-> self root trans)) + (let ((f0-1 (vector-dot gp-1 (-> self node-list data 5 bone transform fvec))) + (f1-2 (fabs (vector-dot gp-1 (the-as vector (-> self node-list data 5 bone transform))))) + ) + (if (and (< 4096.0 f0-1) (>= 81920.0 f1-2) (< f30-0 450560.0)) + (go-virtual active) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate active (sew-move-turret) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('use-doppler?) + (-> self use-doppler?) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self use-doppler?) #f) + ) + :trans (behavior () + (let ((f30-0 (vector-vector-distance (-> self root trans) (target-pos 0))) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-1 (target-pos 0) (-> self root trans)) + (let ((f0-1 (vector-dot gp-1 (-> self node-list data 5 bone transform fvec))) + (f1-2 (fabs (vector-dot gp-1 (the-as vector (-> self node-list data 5 bone transform))))) + ) + (when (or (>= 0.0 f0-1) (< 81920.0 f1-2) (>= f30-0 450560.0)) + (if (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + ) + (go-virtual idle) + ) + ) + ) + (logior! (-> self skel status) (joint-control-status sync-math)) + ) + :code (behavior () + (until #f + (sound-play "turret-move-lp" :id (-> self sound-id)) + (let ((f30-0 -10.0)) + (until (ja-done? 0) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) + (let ((f28-0 (ja-frame-num 0))) + (let ((v1-6 #f)) + (if (or (and (< f30-0 23.0) (>= f28-0 23.0)) (and (< f30-0 67.0) (>= f28-0 67.0))) + (set! v1-6 #t) + ) + (set! (-> self use-doppler?) v1-6) + ) + (set-time! (-> self state-time)) + (sound-play "turret-gun-fire") + (sew-move-turret-method-22 self 5) + (set! f30-0 f28-0) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + (ja-no-eval :group! sew-move-turret-move-shoot-ja :num! (seek!) :frame-num 0.0) + ) + #f + ) + :post transform-post + ) + +(defmethod sew-move-turret-method-22 ((this sew-move-turret) (arg0 int)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform fvec quad)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) + (let ((f0-0 (ja-frame-num 0))) + (cond + ((< f0-0 45.0) + (let ((f1-1 1228.8)) + (cond + ((< f0-0 5.0) + (set! f1-1 (* 0.2 f0-0 f1-1)) + ) + ((< 40.0 f0-0) + (set! f1-1 (* 0.2 (- 45.0 f0-0) f1-1)) + ) + ) + (vector+float*! s4-0 s4-0 (the-as vector (-> this node-list data arg0 bone transform)) f1-1) + ) + ) + (else + (let ((f1-2 -1228.8)) + (cond + ((< f0-0 50.0) + (set! f1-2 (* 0.2 (+ -45.0 f0-0) f1-2)) + ) + ((< 85.0 f0-0) + (set! f1-2 (* 0.2 (- 90.0 f0-0) f1-2)) + ) + ) + (vector+float*! s4-0 s4-0 (the-as vector (-> this node-list data arg0 bone transform)) f1-2) + ) + ) + ) + ) + (vector-normalize! s5-0 40960.0) + (spawn-sew-move-turret-projectile + this + s4-0 + (vector+! (new 'stack-no-clear 'vector) s4-0 s5-0) + 122880.0 + (the-as vector #f) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this sew-move-turret) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-9 transform-index) 4) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> s4-0 penetrated-by) (penetrate)) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-move-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-23 (-> this skel root-channel 0))) + (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + ) + (set! (-> this sound-id) (new-sound-id)) + (transform-post) + (go (method-of-object this idle)) + ) + +(defmethod deactivate ((this sew-move-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + ) + (call-parent-method this) + (none) + ) + +(deftype sew-move-turret-shot (guard-shot) + ((doppler-sound sound-id) + (use-doppler? symbol) + ) + ) + + +(defun sew-turret-shot-move ((arg0 sew-move-turret-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (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 (< 16384.0 f0-0) + (vector-normalize! s4-0 16384.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defpart 4940 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0) + (:b 0.0) + (:a 255.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 4941 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0.3)) + (:scale-x (meters 0.9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0) + (:b 0.0) + (:a 255.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 4942 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2) (meters 1)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 64.0 128.0) + (:b 32.0) + (:a 128.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4943 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-sew-move-turret-hit-object + :id 1506 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4944 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4945 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpartgroup group-sew-move-turret-hit + :id 1507 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4944 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4945 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4946 :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 4946 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 16.0 48.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.30476192) + (:fade-g 0.15238096) + (:fade-b 0.30476192) + (:fade-a -0.15238096) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 1.4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4944 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.026666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.2) + (:fade-b -6.375) + (:fade-a -2.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defmethod projectile-method-25 ((this sew-move-turret-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((a1-0 (-> this root trans)) + (v1-1 (-> this tail-pos)) + (a0-2 (vector-! (new 'stack-no-clear 'vector) a1-0 v1-1)) + ) + (vector-length a0-2) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-4 0.8)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-2 quad)) + (.lvf vf4 (&-> v1-1 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) + (launch-particles (-> *part-id-table* 4940) gp-0) + (launch-particles (-> *part-id-table* 4941) gp-0) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-24 ((this sew-move-turret-shot)) + (draw-beam (-> *part-id-table* 4942) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((v1-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (gp-1 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) v1-1)) + ) + (set-sewh-turret-flash!) + (launch-particles (-> *part-id-table* 4943) gp-1) + ) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this sew-move-turret-shot)) + (let* ((s4-0 (-> this root)) + (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector+! gp-0 gp-0 v1-1) + (cond + ((-> this hit-actor?) + (sound-play "bullet-hit-jak") + (cond + ((logtest? (-> *part-group-id-table* 1506 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1506)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1506)) + ) + ) + ) + ((begin (sound-play "bullet-ricco") (logtest? (-> *part-group-id-table* 1507 flags) (sp-group-flag sp13))) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1507)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1507)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer sew-move-turret-shot). +(defun spawn-sew-move-turret-projectile ((arg0 sew-move-turret) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 40960.0) + ) + (the-as (pointer sew-move-turret-shot) (spawn-projectile sew-move-turret-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; WARN: Return type mismatch (function sew-move-turret-shot none) vs none. +(defmethod init-proj-settings! ((this sew-move-turret-shot)) + (call-parent-method this) + (set! (-> this doppler-sound) (new-sound-id)) + (set! (-> this use-doppler?) (the-as symbol (send-event (ppointer->process (-> this parent)) 'use-doppler?))) + (set! (-> this max-speed) 163840.0) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 (/ 819200.0 (-> this max-speed)))))) + (set! (-> this move) sew-turret-shot-move) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod play-impact-sound ((this sew-move-turret-shot) (arg0 projectile-options)) + (cond + ((and (= arg0 3) (-> this use-doppler?)) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (target-pos 0)))) + 0.0 + (let ((s4-1 (< 0.0 (vector-dot s5-2 (-> this root transv)))) + (f0-2 (vector-normalize-ret-len! s5-2 1.0)) + ) + (if (or (and s4-1 (< f0-2 40960.0)) (and (not s4-1) (< f0-2 102400.0))) + (sound-play-by-name + (static-sound-name "bullet-by-loop") + (-> this doppler-sound) + 1024 + (the int + (* 1524.0 (fmax -0.08 (fmin 1.0 (* 0.5 (doppler-pitch-shift (-> this root trans) (-> this root transv)))))) + ) + 0 + (sound-group) + (-> this root trans) + ) + (sound-stop (-> this doppler-sound)) + ) + ) + ) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +(defmethod deactivate ((this sew-move-turret-shot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this doppler-sound)) + (call-parent-method this) + (none) + ) diff --git a/goal_src/jak3/levels/sewer/sewer-obs.gc b/goal_src/jak3/levels/sewer/sewer-obs.gc index 14a6417469..c61ae90479 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs.gc @@ -7,3 +7,1918 @@ ;; DECOMP BEGINS +(defskelgroup skel-sew-curved-door sew-curved-door sew-curved-door-lod0-jg sew-curved-door-idle-ja + ((sew-curved-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 5 0 15) + ) + +(deftype sew-curved-door (com-airlock) + () + ) + + +(defmethod init-from-entity! ((this sew-curved-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 20480.0 0.0 61440.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 20480.0 0.0 61440.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-curved-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "curve-door-open" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "curve-door-hit" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "curve-door-cls" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "curve-door-hit" :group 1)) + (go (method-of-object this close) #t) + ) + +(deftype sew-floating-plat (elevator) + () + ) + + +(defskelgroup skel-sew-floating-plat sew-float-plat sew-float-plat-lod0-jg sew-float-plat-idle-ja + ((sew-float-plat-lod0-mg (meters 20)) (sew-float-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defmethod get-art-group ((this sew-floating-plat)) + (art-group-get-by-name *level* "skel-sew-floating-plat" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod go-arrived-or-waiting ((this sew-floating-plat)) + (go (method-of-object this dormant)) + (none) + ) + +(defmethod init-collision! ((this sew-floating-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-16 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this sew-floating-plat)) + (set! (-> this sound-running-loop) (static-sound-spec "float-plat-loop" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "float-plat-end" :group 1)) + (none) + ) + +(deftype sew-cam-sequencer (process) + ((activate-script pair :offset 132) + (enter-script pair) + (exit-script pair) + (timeout time-frame) + (offset uint64) + ) + (:state-methods + active + ) + ) + + +(defbehavior sew-cam-sequencer-init-by-other sew-cam-sequencer ((arg0 entity-actor)) + (set! (-> self entity) arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self enter-script) (res-lump-struct (-> self entity) 'on-enter pair)) + (set! (-> self activate-script) (res-lump-struct (-> self entity) 'on-movie pair)) + (set! (-> self exit-script) (res-lump-struct (-> self entity) 'on-exit pair)) + (set! (-> self timeout) (the-as time-frame (the int (* 300.0 (res-lump-float (-> self entity) 'timeout))))) + (set! (-> self offset) (the-as uint (the int (* 300.0 (res-lump-float (-> self entity) 'offset-time))))) + (go-virtual active) + ) + +(defun sew-cam-eval-script ((arg0 pair)) + (script-eval arg0) + ) + +(defstate active (sew-cam-sequencer) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (until (process-grab? *target* #f) + (suspend) + ) + (let ((a0-1 (-> self enter-script))) + (if a0-1 + (sew-cam-eval-script a0-1) + ) + ) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (-> self timeout)) + (suspend) + ) + ) + (let ((a0-3 (-> self activate-script))) + (if a0-3 + (sew-cam-eval-script a0-3) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (the-as time-frame (-> self offset))) + (suspend) + ) + ) + (let ((a0-5 (-> self exit-script))) + (if a0-5 + (sew-cam-eval-script a0-5) + ) + ) + (until (process-release? *target*) + (suspend) + ) + ) + ) + +(deftype sew-floor-switch (process-drawable) + () + (:state-methods + idle-up + going-down + idle-down + ) + ) + + +(defskelgroup skel-sew-floor-switch sew-floor-switch sew-floor-switch-lod0-jg sew-floor-switch-idle-ja + ((sew-floor-switch-lod0-mg (meters 20)) (sew-floor-switch-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +(defmethod run-logic? ((this sew-floor-switch)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defstate idle-up (sew-floor-switch) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) + (go-virtual going-down) + #f + ) + ) + ) + ) + :code transform-and-sleep-code + ) + +(defstate going-down (sew-floor-switch) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('subtask-msg) + (process-spawn sew-cam-sequencer (-> self entity) :name "sew-cam-sequencer" :to self) + ) + ) + ) + :code (behavior () + (sound-play "floor-switch") + (ja-no-eval :group! sew-floor-switch-pushdown-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-1 (res-lump-struct (-> self entity) 'on-activate pair))) + (if gp-1 + (script-eval gp-1) + ) + ) + (go-virtual idle-down) + ) + ) + +(defstate idle-down (sew-floor-switch) + :virtual #t + :code (behavior () + (ja-channel-set! 1) + (ja :group! sew-floor-switch-pushdown-ja :num! (identity (the float (ja-num-frames 0)))) + (ja-post) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this sew-floor-switch) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 4) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (set-vector! (-> this root scale) 1.5 1.0 1.5 1.0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-floor-switch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((s4-2 (the-as object #f))) + (let ((s5-2 (res-lump-struct (-> this entity) 'open-test structure))) + (if s5-2 + (set! s4-2 (script-eval (the-as pair s5-2))) + ) + ) + (if s4-2 + (go (method-of-object this idle-down)) + (go (method-of-object this idle-up)) + ) + ) + ) + +(deftype sew-jump-pad (jump-pad) + () + ) + + +(defskelgroup skel-sew-jump-pad sew-jump-pad sew-jump-pad-lod0-jg sew-jump-pad-idle-ja + ((sew-jump-pad-lod0-mg (meters 20)) (sew-jump-pad-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defmethod get-fan-joint-idx ((this sew-jump-pad)) + 4 + ) + +(defmethod get-skel ((this sew-jump-pad)) + (art-group-get-by-name *level* "skel-sew-jump-pad" (the-as (pointer level) #f)) + ) + +(defmethod bouncer-method-24 ((this sew-jump-pad)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (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 crate)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 2)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 0) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-10 prim-core action) (collide-action)) + (set-vector! (-> v1-10 local-sphere) 0.0 4096.0 0.0 10240.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-sounds ((this sew-jump-pad)) + (set! (-> this fan-loop-sound) (static-sound-spec "sewer-fan" :group 1)) + (set! (-> this jump-sound) (static-sound-spec "jump-pad" :group 1)) + 0 + (none) + ) + +(deftype sew-fan (enemy) + ((activate-distance float) + (path-pos float) + (sweep-dir int8) + (travel-dir int8) + (float-quat quaternion :inline) + (base-trans-y float) + (base-quat quaternion :inline) + (dest-quat quaternion :inline) + (fan-rot float) + (fan-rot-vel float) + (hostile-part sparticle-launch-control) + (gust-part sparticle-launch-control) + (sound-fan-loop-id sound-id) + ) + ) + + +(defskelgroup skel-sew-fan sew-fan sew-fan-lod0-jg sew-fan-idle-ja + ((sew-fan-lod0-mg (meters 20)) (sew-fan-lod1-mg (meters 40)) (sew-fan-lod2-mg (meters 999999))) + :bounds (static-spherem 0 1 0 4) + ) + +(define *sew-fan-enemy-info* (new 'static 'enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 4 + :hit-anim 4 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 4 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :look-at-joint 4 + :bullseye-joint 5 + :notice-distance (meters 30) + :notice-distance-delta (meters 10) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + ) + ) + +(set! (-> *sew-fan-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defskelgroup skel-sew-fan-explode sew-fan sew-fan-explode-lod0-jg sew-fan-explode-idle-ja + ((sew-fan-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 100) + ) + +(define *sew-fan-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defbehavior update-surface-float sew-fan () + (when (< 0.99999046 (fabs (-> (quaternion*! + (new 'stack-no-clear 'quaternion) + (quaternion-inverse! (new 'stack-no-clear 'quaternion) (-> self root quat)) + (-> self float-quat) + ) + w + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (set-vector! s5-1 (rand-vu-float-range -1.0 1.0) 0.0 (rand-vu-float-range -1.0 1.0) 1.0) + (vector-normalize! s5-1 1.0) + (quaternion-vector-angle! gp-1 s5-1 1456.3556) + (quaternion-copy! (-> self float-quat) (-> self entity quat)) + (quaternion*! (-> self float-quat) (-> self float-quat) gp-1) + ) + ) + (set! (-> self root trans y) (+ (-> self base-trans-y) (* 614.4 (sin (the float (* 30 (current-time))))))) + ) + +(defbehavior update-idle sew-fan () + (seek! (-> self fan-rot-vel) -21845.334 (* 21845.334 (seconds-per-frame))) + (quaternion-smooth-seek! (-> self base-quat) (-> self base-quat) (-> self dest-quat) 0.005) + (quaternion-smooth-seek! (-> self root quat) (-> self root quat) (-> self float-quat) 0.005) + (when (nonzero? (-> self path)) + (set! (-> self path-pos) + (path-control-method-26 + (-> self path) + (-> self path-pos) + (* 2048.0 (seconds-per-frame) (the float (-> self travel-dir))) + ) + ) + (if (or (= (-> self path-pos) 1.0) (= (-> self path-pos) 0.0)) + (set! (-> self travel-dir) (* -1 (-> self travel-dir))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + ) + (update-surface-float) + (sound-play-by-name + (static-sound-name "small-sewer-fan") + (-> self sound-fan-loop-id) + 1024 + (the int (* 1524.0 (lerp-scale -0.9 0.6 (-> self fan-rot-vel) -21845.334 -174762.67))) + 0 + (sound-group) + #t + ) + (when (< 0.99984777 (fabs (-> (quaternion*! + (new 'stack-no-clear 'quaternion) + (quaternion-inverse! (new 'stack-no-clear 'quaternion) (-> self base-quat)) + (-> self dest-quat) + ) + w + ) + ) + ) + (set! (-> self sweep-dir) (* -1 (-> self sweep-dir))) + (quaternion-copy! (-> self dest-quat) (-> self entity quat)) + (quaternion-rotate-y! (-> self dest-quat) (-> self dest-quat) (* 8192.0 (the float (-> self sweep-dir)))) + ) + (remove-setting! 'global-wind) + (none) + ) + +(defbehavior update-hostile sew-fan () + (let ((f0-0 -174762.67)) + (seek! (-> self fan-rot-vel) f0-0 (* (fabs f0-0) (seconds-per-frame))) + ) + (when *target* + (quaternion<-rotate-y-vector + (-> self dest-quat) + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)) + ) + (when (nonzero? (-> self path)) + (seek! + (-> self path-pos) + (path-control-method-23 (-> self path) (target-pos 0)) + (* (/ 4096.0 (total-distance (-> self path))) (seconds-per-frame)) + ) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + ) + ) + (quaternion-smooth-seek! (-> self base-quat) (-> self base-quat) (-> self dest-quat) 0.05) + (quaternion-smooth-seek! (-> self root quat) (-> self root quat) (-> self float-quat) 0.005) + (update-surface-float) + (sound-play-by-name + (static-sound-name "small-sewer-fan") + (-> self sound-fan-loop-id) + 1024 + (the int (* 1524.0 (lerp-scale -0.9 0.6 (-> self fan-rot-vel) -21845.334 -174762.67))) + 0 + (sound-group) + #t + ) + (when (and *target* + (< 0.99619657 (fabs (-> (quaternion*! + (new 'stack-no-clear 'quaternion) + (quaternion-inverse! (new 'stack-no-clear 'quaternion) (-> self base-quat)) + (-> self dest-quat) + ) + w + ) + ) + ) + ) + (let ((gp-4 (new 'stack-no-clear 'vector)) + (f30-4 + (fmin + 163840.0 + (fmax 0.0 (* 0.0000061035157 (- 163840.0 (vector-vector-distance (target-pos 0) (-> self root trans))))) + ) + ) + ) + (if (and *target* (focus-test? *target* board)) + (send-event + *target* + 'push-trans + (vector-float*! gp-4 (vector-z-quaternion! gp-4 (-> self base-quat)) (* 4915.2 f30-4)) + (seconds 10) + ) + (send-event + *target* + 'push-trans + (vector-float*! gp-4 (vector-z-quaternion! gp-4 (-> self base-quat)) (* 819.2 f30-4)) + (seconds 10) + ) + ) + (spawn-from-cspace (-> self gust-part) (joint-node sew-fan-lod0-jg fan)) + (let ((v1-46 (vector-z-quaternion! gp-4 (-> self base-quat)))) + (vector-float*! v1-46 v1-46 (* 4096.0 (* 30.0 f30-4))) + (let ((t1-1 (new 'static 'vector))) + (set! (-> t1-1 quad) (-> v1-46 quad)) + (set-setting! 'global-wind #f 0.0 t1-1) + ) + ) + ) + ) + (none) + ) + +(defstate idle (sew-fan) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type enemy idle) trans))) + (if t9-0 + (t9-0) + ) + ) + (seek! (-> self fan-rot-vel) -21845.334 (* 21845.334 (seconds-per-frame))) + (spawn-from-cspace (-> self part) (joint-node sew-fan-lod0-jg lasersight)) + ) + ) + +(defstate notice (sew-fan) + :virtual #t + :code (behavior () + (go-best-state self) + ) + ) + +(defstate active (sew-fan) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type enemy active) trans))) + (if t9-0 + (t9-0) + ) + ) + (update-idle) + (spawn-from-cspace (-> self part) (joint-node sew-fan-lod0-jg lasersight)) + ) + ) + +(defstate hostile (sew-fan) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (update-hostile) + (spawn-from-cspace (-> self hostile-part) (joint-node sew-fan-lod0-jg lasersight)) + ) + ) + +(defstate die (sew-fan) + :virtual #t + :enter (behavior () + (if (nonzero? (-> self sound-fan-loop-id)) + (sound-stop (-> self sound-fan-loop-id)) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((t9-1 (-> (method-of-type enemy die) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set-vector! (-> gp-0 fountain-rand-transv-lo) -122880.0 40960.0 -122880.0 1.0) + (set-vector! (-> gp-0 fountain-rand-transv-hi) 122880.0 81920.0 122880.0 1.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-sew-fan-explode" (the-as (pointer level) #f)) + 7 + gp-0 + *sew-fan-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock)) + (sound-play "sewer-fan-explo") + (suspend) + (cleanup-for-death self) + (ja-channel-set! 0) + (send-event self 'death-end) + (let ((gp-2 (-> self child))) + (while gp-2 + (send-event (ppointer->process gp-2) 'notice 'die) + (set! gp-2 (-> gp-2 0 brother)) + ) + ) + (while (-> self child) + (suspend) + ) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defmethod event-handler ((this sew-fan) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched) + (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'shock) + (shove-up (meters 2)) + (shove-back (meters 4)) + ) + ) + ) + ) + (('attack) + (let ((v1-5 (the-as attack-info (-> arg3 param 1)))) + (when (not (logtest? (-> v1-5 penetrate-using) (penetrate flop punch spin roll uppercut bonk))) + (when (!= (-> v1-5 id) (-> this incoming attack-id)) + (set! (-> this incoming attack-id) (-> v1-5 id)) + (let ((f0-6 (if (logtest? (attack-mask damage) (-> v1-5 mask)) + (-> v1-5 damage) + (penetrate-using->damage (-> v1-5 penetrate-using)) + ) + ) + ) + (if (= (-> arg0 type) gun-yellow-shot-3) + (set! f0-6 0.5) + ) + (let ((f0-7 (fmin 6.0 f0-6))) + (set! (-> this hit-points) (- (-> this hit-points) f0-7)) + ) + ) + (if (>= 0.0 (-> this hit-points)) + (go (method-of-object this die)) + ) + ) + ) + ) + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod go-stare ((this sew-fan)) + (go (method-of-object this idle)) + ) + +(defmethod go-stare2 ((this sew-fan)) + (go (method-of-object this idle)) + ) + +(defun sew-fan-joint-fan ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as sew-fan (-> arg0 param1)))) + (set! (-> v1-0 fan-rot) + (the float (sar (shl (the int (+ (-> v1-0 fan-rot) (* (-> v1-0 fan-rot-vel) (seconds-per-frame)))) 48) 48)) + ) + (quaternion-rotate-local-z! (-> arg1 quat) (-> arg1 quat) (-> v1-0 fan-rot)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defun sew-fan-joint-floor ((arg0 cspace) (arg1 transformq)) + (let ((s1-0 (-> arg0 param1))) + (quaternion-rotate-local-y! + (-> arg1 quat) + (-> arg1 quat) + (- (quaternion-y-angle (-> (the-as sew-fan s1-0) base-quat)) + (quaternion-y-angle (-> (the-as sew-fan s1-0) root quat)) + ) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defmethod coin-flip? ((this sew-fan)) + #f + ) + +(defmethod enemy-method-103 ((this sew-fan) (arg0 vector) (arg1 float)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this base-quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> arg0 quad)) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s4-0 s5-0) (cos arg1)) + ) + ) + +(defmethod is-pfoc-in-mesh? ((this sew-fan) (arg0 process-focusable) (arg1 vector)) + (local-vars (v0-0 symbol)) + (cond + ((= (-> this activate-distance) 0.0) + (return #t) + v0-0 + ) + (else + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (get-trans arg0 3) (-> this root trans))) + (f0-2 (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this base-quat)))) + ) + (when (and (< 0.0 f0-2) (< f0-2 (-> this activate-distance))) + (if (and *target* (focus-test? *target* edge-grab)) + (return #f) + ) + (return (enemy-method-103 this s5-1 5461.3335)) + v0-0 + ) + ) + ) + ) + ) + +(defmethod init-enemy-collision! ((this sew-fan)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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)) + (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 enemy)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 16384.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 enemy)) + (set! (-> v1-12 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 10240.0 0.0 9216.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 11673.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch enemy vs sew-fan. +(defmethod relocate ((this sew-fan) (offset int)) + (if (nonzero? (-> this hostile-part)) + (&+! (-> this hostile-part) offset) + ) + (if (nonzero? (-> this gust-part)) + (&+! (-> this gust-part) offset) + ) + (the-as sew-fan ((method-of-type enemy relocate) this offset)) + ) + +(defmethod deactivate ((this sew-fan)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-fan-loop-id)) + (sound-stop (-> this sound-fan-loop-id)) + ) + (if (nonzero? (-> this hostile-part)) + (kill-particles (-> this hostile-part)) + ) + (if (nonzero? (-> this gust-part)) + (kill-particles (-> this gust-part)) + ) + ((method-of-type enemy deactivate) this) + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-enemy! ((this sew-fan)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-fan" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *sew-fan-enemy-info*) + (set! (-> this activate-distance) (res-lump-float (-> this entity) 'distance :default 122880.0)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (when (logtest? (-> this path flags) (path-control-flag not-found)) + (set! (-> this path) (the-as path-control 0)) + 0 + ) + (when (nonzero? (-> this path)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-pos) (path-control-method-23 (-> this path) (-> this root trans))) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + ) + (set! (-> this travel-dir) 1) + (let ((v1-26 (-> this skel root-channel 0))) + (set! (-> v1-26 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (ja-post) + (quaternion-copy! (-> this float-quat) (-> this root quat)) + (matrix->quat (-> this node-list data 4 bone transform) (-> this base-quat)) + (let ((a0-16 (-> this node-list data 4))) + (set! (-> a0-16 param0) sew-fan-joint-floor) + (set! (-> a0-16 param1) this) + (set! (-> a0-16 param2) (the-as basic 0)) + ) + (quaternion-rotate-local-y! (-> this dest-quat) (-> this base-quat) 8192.0) + (set! (-> this sweep-dir) 1) + (let ((a0-18 (-> this node-list data 5))) + (set! (-> a0-18 param0) sew-fan-joint-fan) + (set! (-> a0-18 param1) this) + (set! (-> a0-18 param2) (the-as basic 0)) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1478) this)) + (set! (-> this hostile-part) (create-launch-control (-> *part-group-id-table* 1479) this)) + (set! (-> this gust-part) (create-launch-control (-> *part-group-id-table* 1501) this)) + (set! (-> this base-trans-y) (-> this root trans y)) + (set! (-> this root trans y) (+ (-> this base-trans-y) (* 614.4 (sin (the float (* 30 (current-time))))))) + (set! (-> this sound-fan-loop-id) (new-sound-id)) + (none) + ) + +(defmethod init-from-entity! ((this sew-fan) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + ((method-of-type enemy init-from-entity!) this arg0) + ) + +(defmethod go-idle2 ((this sew-fan)) + (go (method-of-object this idle)) + ) + +(deftype sew-elevator (process-drawable) + () + (:state-methods + idle + ) + (:methods + (init-collision! (_type_) none) + ) + ) + + +(defskelgroup skel-sew-elevator sew-elevator sew-elevator-lod0-jg sew-elevator-idle-ja + ((sew-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 6 10) + :origin-joint-index 3 + ) + +(defstate idle (sew-elevator) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (transform-and-sleep) + ) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this sew-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 24576.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 24576.0 40960.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! (-> this root) s5-0) + ) + (none) + ) + +(defmethod init-from-entity! ((this sew-elevator) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-elevator" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +(deftype sew-gate (process-drawable) + ((play-time time-frame) + (sound-played1 symbol) + (sound-played2 symbol) + ) + (:state-methods + idle + open + opened + ) + ) + + +(defskelgroup skel-sew-gate sew-gate sew-gate-lod0-jg sew-gate-idle-ja + ((sew-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 7 0 8) + ) + +(defstate idle (sew-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open) + (go-virtual open) + ) + ) + ) + :code sleep-code + :post transform-post + ) + +(defstate open (sew-gate) + :virtual #t + :code (behavior () + (set-time! (-> self play-time)) + (set! (-> self sound-played1) #f) + (set! (-> self sound-played2) #f) + (ja-no-eval :group! sew-gate-open-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (not (-> self sound-played1)) (time-elapsed? (-> self play-time) (seconds 0.015))) + (sound-play "sew-gate-open") + (set! (-> self sound-played1) #t) + ) + (when (and (not (-> self sound-played2)) (time-elapsed? (-> self play-time) (seconds 1.8))) + (sound-play "sew-gate-hit") + (set! (-> self sound-played2) #t) + ) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual opened) + ) + :post transform-post + ) + +(defstate opened (sew-gate) + :virtual #t + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (ja :group! sew-gate-open-ja :num! (identity (the float (ja-num-frames 0)))) + (transform-post) + ) + :code sleep-code + :post #f + ) + +(defmethod init-from-entity! ((this sew-gate) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 28672.0 0.0 32768.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 28672.0 0.0 32768.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) 0.0 -28672.0 0.0 32768.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-gate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this opened)) + (go (method-of-object this idle)) + ) + ) + +(deftype sew-wall-switch (process-drawable) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (minimap connection-minimap) + ) + (:state-methods + idle + open + opened + ) + ) + + +(defskelgroup skel-sew-wall-switch sew-wall-switch sew-wall-switch-lod0-jg sew-wall-switch-idle-ja + ((sew-wall-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1) + ) + +(defstate idle (sew-wall-switch) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (case (-> (the-as attack-info (-> block param 1)) mode) + (('spin 'punch) + (sound-play "wall-btn-switch") + (go-virtual open) + ) + ) + ) + ) + ) + :enter (behavior () + (setup-masks (-> self draw) 4 2) + ) + :trans (behavior () + (launch-particles (-> *part-id-table* 4872) (-> self root trans)) + ) + :code sleep-code + :post ja-post + ) + +(defstate open (sew-wall-switch) + :virtual #t + :enter (behavior () + (setup-masks (-> self draw) 2 4) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-0 (-> self actor-group 0))) + (dotimes (s5-0 (-> gp-0 length)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'open) + (let ((t9-1 send-event-function) + (v1-9 (-> gp-0 data s5-0 actor)) + ) + (t9-1 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + ) + :trans (behavior () + (launch-particles (-> *part-id-table* 4873) (-> self root trans)) + ) + :code (behavior () + (ja-no-eval :group! sew-wall-switch-push-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-25 (res-lump-value (-> self entity) 'extra-id uint128 :time -1000000000.0))) + (when (= (the-as uint v1-25) 1) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'entity-name "camera-300" 0.0 0) + (process-grab? *target* #f) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (let ((gp-2 (-> self actor-group 1))) + (dotimes (s5-0 (-> gp-2 length)) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'cue-chase) + (let ((t9-8 send-event-function) + (v1-47 (-> gp-2 data s5-0 actor)) + ) + (t9-8 + (if v1-47 + (-> v1-47 extra process) + ) + a1-7 + ) + ) + ) + ) + ) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 2)) + (suspend) + ) + ) + (remove-setting! 'mode-name) + (remove-setting! 'interp-time) + (remove-setting! 'entity-name) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.5)) + (suspend) + ) + ) + (process-release? *target*) + (go-virtual opened) + ) + ) + ) + :post ja-post + ) + +(defstate opened (sew-wall-switch) + :virtual #t + :enter (behavior () + (if (nonzero? (-> self minimap)) + (kill-callback (-> *minimap* engine) (-> self minimap)) + ) + (setup-masks (-> self draw) 2 4) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (-> self actor-group 0))) + (dotimes (s5-0 (-> gp-0 length)) + (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) 'open) + (let ((t9-3 send-event-function) + (v1-12 (-> gp-0 data s5-0 actor)) + ) + (t9-3 + (if v1-12 + (-> v1-12 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defmethod init-from-entity! ((this sew-wall-switch) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 4) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 3072.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-wall-switch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! sv-16 (new 'static 'res-tag)) + (set! (-> this actor-group) + (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)) + ) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (cond + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this opened)) + ) + (else + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 13) (the-as int #f) (the-as vector #t) 0)) + (go (method-of-object this idle)) + ) + ) + ) + +(defskelgroup skel-sew-fence-gate sew-fence-gate sew-fence-gate-lod0-jg sew-fence-gate-idle-ja + ((sew-fence-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(deftype sew-fence-gate (process-drawable) + () + (:state-methods + closed + open + opening + closing + ) + ) + + +(defmethod init-from-entity! ((this sew-fence-gate) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot enemy hit-by-others-list player-list projectile)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 61440.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) + (collide-spec jak bot enemy hit-by-others-list player-list projectile) + ) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 61440.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-13 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-fence-gate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (process-entity-set! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (let ((s4-2 (the-as object #f))) + (let ((s5-1 (res-lump-struct (-> this entity) 'open-test structure))) + (if s5-1 + (set! s4-2 (script-eval (the-as pair s5-1))) + ) + ) + (if s4-2 + (go (method-of-object this open)) + (go (method-of-object this closed)) + ) + ) + ) + +(defstate closed (sew-fence-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual opening) + ) + (('trigger-perm) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual opening) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + ) + ) + +(defstate open (sew-fence-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual closing) + ) + ) + ) + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + :code (behavior () + (ja :group! sew-fence-gate-close-ja + :num! (identity (the float (+ (-> (the-as art-joint-anim sew-fence-gate-close-ja) frames num-frames) -1))) + ) + (sleep-code) + ) + :post (behavior () + (transform-post) + ) + ) + +(defstate opening (sew-fence-gate) + :virtual #t + :code (behavior () + (set-time! (-> self state-time)) + (ja-channel-push! 1 0) + (let ((gp-0 #f)) + (ja-no-eval :group! sew-fence-gate-close-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (not gp-0) (time-elapsed? (-> self state-time) (seconds 0.5))) + (sound-play "sew-gate-open") + (set! gp-0 #t) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual open) + ) + :post (behavior () + (transform-post) + ) + ) + +(defstate closing (sew-fence-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual closing) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja :group! sew-fence-gate-close-ja :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (ja :num! (seek! 0.0)) + (suspend) + ) + (go-virtual closed) + ) + :post (behavior () + (transform-post) + ) + ) + +(deftype sew-vent (process-drawable) + ((sync sync-linear :inline) + (attack-id int32) + (last-sync-val float) + (vent-sound sound-id) + ) + (:state-methods + idle + ) + ) + + +(defstate idle (sew-vent) + :virtual #t + :enter (behavior () + (set! (-> self last-sync-val) 1.0) + ) + :trans (behavior () + (let ((f30-0 (get-norm! (-> self sync) 0))) + (cond + ((< f30-0 0.5) + (if (zero? (-> self vent-sound)) + (set! (-> self vent-sound) (new-sound-id)) + ) + (sound-play "steam-vent" :id (-> self vent-sound) :position (-> self root trans)) + (spawn (-> self part) (-> self root trans)) + (when (< 0.5 (-> self last-sync-val)) + ) + (when (< (vector-vector-distance (target-pos 0) (-> self root trans)) 14336.0) + (let* ((gp-1 *target*) + (a0-8 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (if a0-8 + (send-event + a0-8 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint (-> self attack-id))) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 3)) + (shove-up (meters 3)) + ) + ) + ) + ) + ) + ) + ) + (else + (when (nonzero? (-> self vent-sound)) + (sound-stop (-> self vent-sound)) + (set! (-> self vent-sound) (new 'static 'sound-id)) + 0 + ) + ) + ) + (set! (-> self last-sync-val) f30-0) + ) + ) + :code sleep-code + :post ja-post + ) + +(defmethod deactivate ((this sew-vent)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (when (nonzero? (-> this vent-sound)) + (sound-stop (-> this vent-sound)) + (set! (-> this vent-sound) (new 'static 'sound-id)) + 0 + ) + (call-parent-method this) + (none) + ) + +(defmethod init-from-entity! ((this sew-vent) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let* ((v1-1 *game-info*) + (a0-4 (+ (-> v1-1 attack-id) 1)) + ) + (set! (-> v1-1 attack-id) a0-4) + (set! (-> this attack-id) (the-as int a0-4)) + ) + (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-2 0)) + (if #f + (set! v1-2 (logior v1-2 1)) + ) + (set! (-> a1-3 sync-type) 'sync-linear) + (set! (-> a1-3 sync-flags) (the-as sync-flags v1-2)) + ) + (set! (-> a1-3 entity) arg0) + (set! (-> a1-3 period) (the-as uint 1800)) + (set! (-> a1-3 percent) 0.0) + (initialize! (-> this sync) a1-3) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1473) this)) + (go (method-of-object this idle)) + ) + +(deftype sew-power-switch (process-drawable) + () + (:state-methods + idle + turned-off + ) + ) + + +(defskelgroup skel-sew-power-switch sew-power-switch sew-power-switch-lod0-jg sew-power-switch-idle-ja + ((sew-power-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 4) + ) + +(defstate idle (sew-power-switch) + :virtual #t + :trans (behavior () + (when (and (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + (not (movie?)) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual turned-off) + ) + ) + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +(defstate turned-off (sew-power-switch) + :virtual #t + :code (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (ja :group! sew-power-switch-off-ja :num! min) + (ja-post) + (when (task-node-open? (game-task-node sewer-hum-kg-switch-off)) + (set-setting! 'exclusive-load '((ignore all) (allow sewa) (allow sewe)) 0.0 0) + (let ((a1-2 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-2 9) #f) + (set! (-> a1-2 8) #f) + (set! (-> a1-2 7) #f) + (set! (-> a1-2 6) #f) + (set! (-> a1-2 5) #f) + (set! (-> a1-2 4) #f) + (set! (-> a1-2 3) #f) + (set! (-> a1-2 2) 'sewe) + (set! (-> a1-2 1) 'ctyinda) + (set! (-> a1-2 0) 'sewa) + (want-levels *load-state* a1-2) + ) + (want-display-level *load-state* 'ctyinda 'display) + (while (!= (status-of-level-and-borrows *level* 'ctyinda #f) 'active) + (suspend) + ) + (let ((gp-2 (add-process *gui-control* self (gui-channel background) (gui-action queue) "pwrdown" -99.0 0))) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'entity-name "camera-224" 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (process-grab? *target* #f) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 2)) + (suspend) + ) + ) + (task-node-close! (game-task-node sewer-hum-kg-switch-off) 'event) + (script-eval '(send-event "ctyinda-vingate-1" 'shutdown)) + (set-action! + *gui-control* + (gui-action play) + gp-2 + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 2.4)) + (suspend) + ) + ) + (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) + (remove-setting! 'entity-name) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + (remove-setting! 'exclusive-load) + (remove-setting! 'interp-time) + (remove-setting! 'allow-progress) + (process-release? *target*) + (set-continue! *game-info* "sewe-switch-off" #f) + (talker-spawn-func (-> *talker-speech* 62) *entity-pool* (target-pos 0) (the-as region #f)) + (script-eval '(auto-save 'auto-save)) + ) + (remove-setting! 'allow-logo) + (logior! (-> self mask) (process-mask actor-pause)) + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this sew-power-switch) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-power-switch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set-setting! 'allow-logo #f 0.0 0) + (if (or (task-node-closed? (game-task-node sewer-hum-kg-switch-off)) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + (go (method-of-object this turned-off)) + (go (method-of-object this idle)) + ) + ) + +(deftype sew-gas-step (base-plat) + ((sound-id sound-id) + (sync sync-linear :inline) + (last-sync-val float) + (gas-time time-frame) + (attack-id int32) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-sew-gas-step sew-gas-step sew-gas-step-lod0-jg sew-gas-step-idle-ja + ((sew-gas-step-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defmethod init-from-entity! ((this sew-gas-step) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-gas-step" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-5 param 0) 1.0) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! + a0-5 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (let* ((v1-18 *game-info*) + (a0-7 (+ (-> v1-18 attack-id) 1)) + ) + (set! (-> v1-18 attack-id) a0-7) + (set! (-> this attack-id) (the-as int a0-7)) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1473) this)) + (set! (-> this gas-time) (the-as time-frame (the int (* 300.0 (res-lump-float arg0 'delay :default 1.0))))) + (let ((a1-7 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-25 0)) + (if #f + (set! v1-25 (logior v1-25 1)) + ) + (set! (-> a1-7 sync-type) 'sync-linear) + (set! (-> a1-7 sync-flags) (the-as sync-flags v1-25)) + ) + (set! (-> a1-7 entity) arg0) + (set! (-> a1-7 period) (the-as uint 1800)) + (set! (-> a1-7 percent) 0.0) + (initialize! (-> this sync) a1-7) + ) + (go (method-of-object this idle)) + ) + +(defstate idle (sew-gas-step) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (set! (-> self last-sync-val) (get-norm! (-> self sync) 0)) + (sound-play "steam-vent" :id (-> self sound-id) :position (-> self root trans)) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! sew-gas-step-rattle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-time! (-> self state-time)) + (loop + (spawn + (-> self part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node sew-gas-step-lod0-jg poison_gas)) + ) + (let ((f0-7 (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) + (f1-0 14336.0) + ) + (when (< f0-7 (* f1-0 f1-0)) + (let* ((gp-2 *target*) + (a0-9 (if (type? gp-2 process-focusable) + gp-2 + ) + ) + ) + (if a0-9 + (send-event + a0-9 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint (-> self attack-id))) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 3)) + (shove-up (meters 3)) + ) + ) + ) + ) + ) + ) + ) + (suspend) + ) + ) + :post plat-post + ) + +(defmethod init-collision! ((this sew-gas-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 18432.0 0.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> v1-10 transform-index) 0) + (set-vector! (-> v1-10 local-sphere) 0.0 18432.0 0.0 24576.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> v1-12 transform-index) 0) + (set-vector! (-> v1-12 local-sphere) 0.0 18432.0 0.0 24576.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this sound-id) (new-sound-id)) + 0 + (none) + ) + +(defmethod deactivate ((this sew-gas-step)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + ) + (call-parent-method this) + (none) + ) diff --git a/goal_src/jak3/levels/sewer/sewer-obs2.gc b/goal_src/jak3/levels/sewer/sewer-obs2.gc index 6201acacc9..10b5023783 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs2.gc @@ -7,3 +7,583 @@ ;; DECOMP BEGINS +(deftype sew-laser-beam (process-drawable) + ((sync sync-linear :inline) + (sound-id sound-id) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-sew-laser-beam sew-laser-beam sew-laser-beam-lod0-jg sew-laser-beam-idle-ja + ((sew-laser-beam-lod0-mg (meters 20)) (sew-laser-beam-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 5.75 12) + :shadow sew-laser-beam-shadow-mg + :shadow-joint-index 4 + ) + +(defun fire-sew-laser-beam! ((arg0 vector) (arg1 vector) (arg2 sew-laser-beam)) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (f30-0 47104.0) + ) + (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-normalize-copy! (-> s4-0 move-dist) arg1 f30-0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd jak enemy obstacle hit-by-others-list player-list)) + (set! (-> v1-2 ignore-process0) arg2) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (if (>= f0-1 0.0) + (vector-float*! (-> s4-0 move-dist) (-> s4-0 move-dist) f0-1) + (set! (-> s4-0 best-other-tri collide-ptr) #f) + ) + ) + (when (and (-> s4-0 best-other-tri collide-ptr) (let ((s2-0 (-> s4-0 best-other-tri collide-ptr))) + (if (type? s2-0 collide-shape-prim-sphere) + s2-0 + ) + ) + ) + (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s2-1 ent) (-> arg2 entity)) + (set! (-> s2-1 charge) 1.0) + (set! (-> s2-1 options) (projectile-options)) + (logclear! (-> s2-1 options) (projectile-options po14 po15 po16)) + (set! (-> s2-1 notify-handle) (the-as handle #f)) + (set! (-> s2-1 owner-handle) (the-as handle #f)) + (set! (-> s2-1 target-handle) (the-as handle #f)) + (set! (-> s2-1 target-pos quad) (the-as uint128 0)) + (set! (-> s2-1 ignore-handle) (process->handle arg2)) + (let* ((v1-19 *game-info*) + (a0-17 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-17) + (set! (-> s2-1 attack-id) a0-17) + ) + (set! (-> s2-1 timeout) (seconds 4)) + (set! (-> s2-1 pos quad) (-> s4-0 start-pos quad)) + (vector-normalize-copy! (-> s2-1 vel) (-> s4-0 move-dist) 491520.0) + (sound-play "laser-hit-jak") + (spawn-projectile sew-laser-shot s2-1 arg2 *default-dead-pool*) + ) + (vector-normalize! (-> s4-0 move-dist) (+ 2048.0 (vector-length (-> s4-0 move-dist)))) + ) + (set! (-> *part-id-table* 4935 init-specs 4 initial-valuef) f30-0) + (let ((a2-5 (new 'stack-no-clear 'vector))) + (vector-float*! a2-5 arg1 f30-0) + (draw-beam (-> *part-id-table* 4935) arg0 a2-5 #t) + ) + ) + (none) + ) + +(defstate idle (sew-laser-beam) + :virtual #t + :trans (behavior () + (sound-play "laser-beam-loop" :id (-> self sound-id)) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node sew-laser-beam-lod0-jg laser)))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! s5-0 (-> self root quat)) + (vector-normalize! s5-0 1.0) + (fire-sew-laser-beam! gp-0 s5-0 self) + ) + ) + ) + :code (behavior () + (until #f + (let ((f0-2 (* (get-norm! (-> self sync) 0) (the float (ja-num-frames 0)))) + (a0-2 (-> self skel root-channel 0)) + ) + (set! (-> a0-2 param 0) f0-2) + (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +(define *sew-laser-beam-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x9a)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 163840.0) + :top-plane (new 'static 'plane :y 1.0 :w -163840.0) + :shadow-type 1 + ) + ) + ) + +(defmethod init-from-entity! ((this sew-laser-beam) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-beam" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((a1-5 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-4 0)) + (if #f + (set! v1-4 (logior v1-4 1)) + ) + (set! (-> a1-5 sync-type) 'sync-linear) + (set! (-> a1-5 sync-flags) (the-as sync-flags v1-4)) + ) + (set! (-> a1-5 entity) arg0) + (set! (-> a1-5 period) (the-as uint 2700)) + (set! (-> a1-5 percent) 0.0) + (initialize! (-> this sync) a1-5) + ) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw shadow-ctrl) *sew-laser-beam-shadow-control*) + (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80ffc000)) + (go (method-of-object this idle)) + ) + +(defmethod deactivate ((this sew-laser-beam)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + ) + (call-parent-method this) + (none) + ) + +(deftype sew-m-gate (process-drawable) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + open + raised + ) + ) + + +(defskelgroup skel-sew-m-gate sew-m-gate sew-m-gate-lod0-jg sew-m-gate-idle-ja + ((sew-m-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 6.5) + ) + +(defstate idle (sew-m-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual open) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (v1-6 symbol)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (> (-> self actor-group-count) 0) + (dotimes (v1-5 (-> self actor-group 0 length)) + (let ((a1-1 (-> self actor-group 0 data v1-5 actor))) + (when (or (not a1-1) (not (logtest? (-> a1-1 extra perm status) (entity-perm-status subtask-complete)))) + (set! v1-6 #f) + (goto cfg-13) + ) + ) + ) + ) + (set! v1-6 #t) + (label cfg-13) + (if v1-6 + (go-virtual open) + ) + ) + ) + :code sleep-code + :post #f + ) + +(defstate open (sew-m-gate) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'entity-name "camera-353" 0.0 0) + (process-grab? *target* #f) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) + (suspend) + ) + ) + (sound-play "gate-open") + (ja-no-eval :group! sew-m-gate-gate-open-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (remove-setting! 'mode-name) + (remove-setting! 'interp-time) + (remove-setting! 'entity-name) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.5)) + (suspend) + ) + ) + (process-release? *target*) + (go-virtual raised) + ) + :post #f + ) + +(defstate raised (sew-m-gate) + :virtual #t + :enter (behavior () + (ja :group! sew-m-gate-gate-open-ja :num! max) + (transform-post) + ) + :code sleep-code + :post #f + ) + +(defmethod init-from-entity! ((this sew-m-gate) (arg0 entity-actor)) + (local-vars (r0-0 uint128) (v1-15 uint128) (a0-15 object) (a1-10 uint128) (sv-16 int)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 -2048.0 0.0 26624.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-m-gate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! sv-16 0) + (let ((v1-13 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (cond + ((and v1-13 (begin + (let ((a0-16 #t)) + (let ((a1-9 (the-as uint128 sv-16))) + (.pcpyud a1-10 a1-9 r0-0) + ) + (let ((a1-12 (the-as int (shr (* (the-as int a1-10) 2) 49)))) + (cmove-#f-zero a0-15 a1-12 a0-16) + ) + ) + a0-15 + ) + ) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-13)) + (let ((v1-14 (the-as uint128 sv-16))) + (.pcpyud v1-15 v1-14 r0-0) + ) + (set! (-> this actor-group-count) (shr (* (the-as int v1-15) 2) 49)) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (let ((v1-21 (-> this skel root-channel 0))) + (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + ) + (transform-post) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this raised)) + (go (method-of-object this idle)) + ) + ) + +(deftype sew-pipe (process-drawable) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + lower + down + ) + ) + + +(defskelgroup skel-sew-pipe sew-pipe sew-pipe-lod0-jg sew-pipe-idle-ja + ((sew-pipe-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7.5 0 27) + ) + +(defstate idle (sew-pipe) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual lower) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (v1-6 symbol)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (> (-> self actor-group-count) 0) + (dotimes (v1-5 (-> self actor-group 0 length)) + (let ((a1-1 (-> self actor-group 0 data v1-5 actor))) + (when (or (not a1-1) (not (logtest? (-> a1-1 extra perm status) (entity-perm-status subtask-complete)))) + (set! v1-6 #f) + (goto cfg-13) + ) + ) + ) + ) + (set! v1-6 #t) + (label cfg-13) + (if v1-6 + (go-virtual lower) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate lower (sew-pipe) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'entity-name "camera-352" 0.0 0) + (process-grab? *target* #f) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (sound-play "pipe-lower") + (set-time! (-> self state-time)) + (ja-no-eval :group! sew-pipe-down-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (if (time-elapsed? (-> self state-time) (seconds 1.557)) + (sound-play "pipe-lower-hit") + ) + (transform-post) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (remove-setting! 'mode-name) + (remove-setting! 'interp-time) + (remove-setting! 'entity-name) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.5)) + (suspend) + ) + ) + (process-release? *target*) + (go-virtual down) + ) + :post #f + ) + +(defstate down (sew-pipe) + :virtual #t + :enter (behavior () + (ja :group! sew-pipe-down-ja :num! max) + (transform-post) + ) + :code sleep-code + :post #f + ) + +(defmethod init-from-entity! ((this sew-pipe) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 -30720.0 0.0 110592.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-pipe" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-13 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-13 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-13)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this down)) + (go (method-of-object this idle)) + ) + ) + +(deftype sew-grate-plat (process-drawable) + ((test-pos vector :inline) + (closed-x float) + (opened-x float) + ) + (:state-methods + closed + open + opened + close + ) + ) + + +(defskelgroup skel-sew-grate-plat sew-grate-plat sew-grate-plat-lod0-jg sew-grate-plat-idle-ja + ((sew-grate-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(defstate closed (sew-grate-plat) + :virtual #t + :trans (behavior () + (let ((gp-0 (-> self test-pos)) + (a0-1 (target-pos 0)) + ) + (if (and (< 0.0 (- (-> a0-1 y) (-> gp-0 y))) (< (vector-vector-xz-distance a0-1 gp-0) 61440.0)) + (go-virtual open) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate open (sew-grate-plat) + :virtual #t + :enter (behavior () + (sound-play "sew-grate-slide") + ) + :trans (behavior () + (seek! (-> self root trans x) (-> self opened-x) (* 327680.0 (seconds-per-frame))) + (if (= (-> self root trans x) (-> self opened-x)) + (go-virtual opened) + ) + ) + :code sleep-code + :post transform-post + ) + +(defstate opened (sew-grate-plat) + :virtual #t + :trans (behavior () + (let ((gp-0 (-> self test-pos)) + (a0-1 (target-pos 0)) + ) + (if (not (and (< 0.0 (- (-> a0-1 y) (-> gp-0 y))) (< (vector-vector-xz-distance a0-1 gp-0) 61440.0))) + (go-virtual close) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate close (sew-grate-plat) + :virtual #t + :enter (behavior () + (sound-play "sew-grate-slide" :pitch -0.25) + ) + :trans (behavior () + (seek! (-> self root trans x) (-> self closed-x) (* 327680.0 (seconds-per-frame))) + (if (= (-> self root trans x) (-> self closed-x)) + (go-virtual closed) + ) + ) + :code sleep-code + :post transform-post + ) + +(defmethod init-from-entity! ((this sew-grate-plat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-grate-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this test-pos quad) (-> this root trans quad)) + (+! (-> this test-pos x) -40960.0) + (set! (-> this closed-x) (-> this root trans x)) + (set! (-> this opened-x) (+ -32768.0 (-> this root trans x))) + (go (method-of-object this closed)) + ) diff --git a/goal_src/jak3/levels/sewer/sewer-part.gc b/goal_src/jak3/levels/sewer/sewer-part.gc index f81162aac7..99f25ff048 100644 --- a/goal_src/jak3/levels/sewer/sewer-part.gc +++ b/goal_src/jak3/levels/sewer/sewer-part.gc @@ -5,5 +5,2039 @@ ;; name in dgo: sewer-part ;; dgos: SEA +(define-extern *range-color-sewer-gas* curve-color-fast) +(define-extern *range-alpha-sewer-gas* curve2d-fast) +(define-extern *range-scale-sewer-gas-x* curve2d-fast) +(define-extern *range-scale-sewer-gas-y* curve2d-fast) +(define-extern *r-curve-sewer-gas* curve2d-fast) +(define-extern *g-curve-sewer-gas* curve2d-fast) +(define-extern *b-curve-sewer-gas* curve2d-fast) +(define-extern *curve-alpha-sewer-gas* curve2d-fast) +(define-extern *curve-sewer-gas-x* curve2d-fast) +(define-extern *curve-sewer-gas-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-sewer-gas + :id 1470 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4856 :fade-after (meters 200) :falloff-to (meters 300) :flags (is-3d))) + ) + +(defpart 4856 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.15) + (:x (meters 10) (meters 50)) + (:y (meters 20) (meters 40)) + (:scale-x (meters 20) (meters 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 128.0) + (:b 128.0 64.0) + (:a 0.0) + (:vel-x (meters -0.016666668) (meters 0.033333335)) + (:vel-y (meters 0) (meters 0.0033333334)) + (:scalevel-x (meters 0) (meters 0.033333335)) + (:scalevel-y (meters 0) (meters 0.033333335)) + (:fade-a 0.053333335) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 4)) + (:next-launcher 4857) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4857 + :init-specs ((:fade-a -0.053333335)) + ) + +(defpartgroup group-sewer-steamvent + :id 1471 + :flags (sp1 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4858 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7))) + ) + +(defpart 4858 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 0.15) + (:x (meters -1) (meters 2)) + (:y (meters -2) (meters 4)) + (:z (meters 2)) + (:scale-x (meters 4) (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 255.0) + (:b 20.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0016666667)) + (:vel-z (meters 0.006666667) (meters 0.02)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0.000033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + ) + ) + +(if #t + (set! *range-color-sewer-gas* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 8.0 :y 8.0 :z 8.0 :w 128.0) + (new 'static 'vector :x 64.0 :y 64.0 :z 64.0 :w 128.0) + (new 'static 'vector :x 64.0 :y 64.0 :z 64.0 :w 128.0) + (new 'static 'vector :x 64.0 :y 64.0 :z 64.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x 32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-sewer-gas-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 4.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-sewer-gas-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 4.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 0.5 :z 0.3) + :one-over-x-deltas (new 'static 'vector :x -1.0 :y -1.0 :z -1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.1 :y 0.1 :z 1.1 :w 2.1) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 0.9999999 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 0.5 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.5 :y 1.0 :z -3.3333333 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sewer-gas-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sewer-gas-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-sewer-steam-puff-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 3) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0 pcf1) + ) + ) + +(set! (-> *part-id-table* 4858 init-specs 21 initial-valuef) + (the-as float *part-sewer-steam-puff-curve-settings*) + ) + +(set! (-> *part-sewer-steam-puff-curve-settings* color-start) *range-color-sewer-gas*) + +(set! (-> *part-sewer-steam-puff-curve-settings* alpha-start) *range-alpha-sewer-gas*) + +(set! (-> *part-sewer-steam-puff-curve-settings* scale-x-start) *range-scale-sewer-gas-x*) + +(set! (-> *part-sewer-steam-puff-curve-settings* scale-y-start) *range-scale-sewer-gas-y*) + +(set! (-> *part-sewer-steam-puff-curve-settings* r-scalar) *r-curve-sewer-gas*) + +(set! (-> *part-sewer-steam-puff-curve-settings* g-scalar) *g-curve-sewer-gas*) + +(set! (-> *part-sewer-steam-puff-curve-settings* b-scalar) *b-curve-sewer-gas*) + +(set! (-> *part-sewer-steam-puff-curve-settings* a-scalar) *curve-alpha-sewer-gas*) + +(set! (-> *part-sewer-steam-puff-curve-settings* scale-x-scalar) *curve-sewer-gas-x*) + +(set! (-> *part-sewer-steam-puff-curve-settings* scale-y-scalar) *curve-sewer-gas-y*) + +(defpartgroup group-sewer-hard-blowing-steam + :id 1472 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4859 :flags (sp7))) + ) + +(define *steam-particle-list* (new 'static 'boxed-array :type int32 #x405c00 #x400000)) + +(defun birth-func-texture-group-steam ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (particle-adgif-callback + (-> arg1 adgif) + (the-as + texture-id + (-> *steam-particle-list* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *steam-particle-list* length)) + ) + ) + ) + 0 + (none) + ) + +(defpart 4859 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam) + (:num 2.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-z (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:friction 0.92) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 4860) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4860 + :init-specs ((:fade-a -0.32)) + ) + +(defpartgroup group-sewer-green-steam + :id 1473 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4861 :flags (sp7))) + ) + +(defpart 4861 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam) + (:num 2.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 90.0 30.0) + (:g 130.0) + (:b 32.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-y (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:friction 0.92 0.02) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.167)) + (:next-launcher 4862) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4862 + :init-specs ((:fade-a -0.16)) + ) + +(defpartgroup group-sewer-deadly-mist + :id 1474 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4863 :flags (sp7))) + ) + +(defpart 4863 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 2)) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 90.0 30.0) + (:g 130.0) + (:b 32.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00033333333)) + (:friction 0.98) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4864) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4864 + :init-specs ((:fade-a -0.018823529)) + ) + +(defpartgroup group-sewer-light-glow + :id 1475 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4865 :fade-after (meters 200) :flags (sp6))) + ) + +(defpart 4865 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 64.0) + (:a 12.0 4.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sewer-panel-light-glow + :id 1476 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4866 :fade-after (meters 200) :flags (sp6))) + ) + +(defpart 4866 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 255.0) + (:b 255.0) + (:a 12.0 4.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-sew-little-ridge-wake + :id 1477 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4867 :flags (sp7))) + ) + +(defpart 4867 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.3 0.8) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.001)) + (:accel-z (meters 0.001)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-fan-lasersight + :id 1478 + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4868 :flags (sp6 sp7)) (sp-item 4869 :flags (sp6 sp7))) + ) + +(defpart 4868 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 64.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4869 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 64.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-fan-lasersight-hostile + :id 1479 + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4870 :flags (sp6 sp7)) (sp-item 4871 :flags (sp6 sp7))) + ) + +(defpart 4870 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 112.0) + (:g 16.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4871 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 112.0) + (:g 16.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 1228.8) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4872 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 30.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4873 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 0.0) + (:a 30.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-sew-wake-small + :id 1480 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4874 :flags (is-3d sp7))) + ) + +(defpart 4874 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.2) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.008333334) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:accel-z (meters 0.00033333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-sew-grate-wake + :id 1481 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4875 :flags (is-3d sp7))) + ) + +(defpart 4875 + :init-specs ((:texture (water-wake sewa-sprite)) + (:num 0.5) + (:x (meters 0)) + (:z (meters -6) 6 (meters 2.1)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.016666668) (meters 0.0016666667)) + (:scalevel-y (meters 0.006666667) (meters 0.0016666667)) + (:fade-a -0.10666667 -0.10666667) + (:accel-z (meters 0.00033333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-sew-yellow-grate-wake + :id 1482 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4876 :flags (is-3d sp7))) + ) + +(defpart 4876 + :init-specs ((:texture (water-wake sewa-sprite)) + (:num 1.0) + (:x (meters 0)) + (:z (meters -7.6) 4 (meters 3)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.016666668) (meters 0.0016666667)) + (:scalevel-y (meters 0.013333334) (meters 0.0016666667)) + (:fade-a -0.21333334 -0.21333334) + (:accel-x (meters 0.00033333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-sewer-falls-froth + :id 1483 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4877 :flags (is-3d sp7)) + (sp-item 4878 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 4877 + :init-specs ((:texture (water-froth sewa-sprite)) + (:num 0.02 0.02) + (:x (meters -4) (meters 8)) + (:z (meters -10)) + (:scale-x (meters 5) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 110.0) + (:b 60.0 20.0) + (:a 32.0 32.0) + (:vel-z (meters 0.02) (meters 0.006666667)) + (:rotvel-y (degrees -0.010000001) (degrees 0.020000001)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 5)) + (:next-launcher 4879) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4879 + :init-specs ((:fade-a -0.042666666)) + ) + +(defpart 4878 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -5) (meters 10)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:accel-z (meters 0.00016666666)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sewer-whirlpool-center + :id 1484 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4880 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4881 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 4881 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 1)) + (:y (meters -0.5)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-y (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335) + (:accel-y (meters -0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 2)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4880 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 2)) + (:y (meters 1)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4882) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4882 + :init-specs ((:fade-a -0.018823529)) + ) + +(defpartgroup group-sewer-falls-tilt + :id 1485 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4883 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7))) + ) + +(defpart 4883 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 6.0) + (:x (meters -9) (meters 18)) + (:y (meters 0.4)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters -0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sewer-waterfall-base + :id 1486 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4884 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4885 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 4884 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:z (meters 1)) + (:scale-x (meters 3) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-z (meters 0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4885 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -1.5) (meters 3)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sewer-waterfall-base-big + :id 1487 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4886 :fade-after (meters 100) :falloff-to (meters 400) :flags (sp7)) + (sp-item 4887 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +(defpart 4886 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3 0.3) + (:x (meters -10) (meters 15)) + (:y (meters -0.4)) + (:z (meters 0)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4888) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4888 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +(defpart 4889 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:z (meters 1)) + (:scale-x (meters 12) (meters 0.5)) + (:rot-y (degrees 0) 1 (degrees 180)) + (:scale-y (meters 3) (meters 0.5)) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-z (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4890 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:z (meters 1)) + (:scale-x (meters 3) (meters 0.5)) + (:rot-y (degrees 90) 1 (degrees 180)) + (:scale-y (meters 12) (meters 0.5)) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-z (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4887 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -6) (meters 12)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sewer-waterfall-base-tube + :id 1488 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4891 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 4891 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -6) (meters 12)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 50.0 50.0) + (:b 40.0) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:vel-z (meters 0.0033333334) (meters 0.02)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-wake-medium + :id 1489 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4892 :flags (sp7)) (sp-item 4893 :flags (sp7)) (sp-item 4894 :flags (is-3d sp7))) + ) + +(defpart 4892 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 5.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters 0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees -10) (degrees -90)) + ) + ) + +(defpart 4893 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 5.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters -0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 180) (degrees 100.00001)) + ) + ) + +(defpart 4894 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.5) + (:scale-x (meters 8) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-z (meters 0.02)) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111) + (:accel-x (meters -0.00013333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-wake-large + :id 1490 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4895 :flags (is-3d sp7))) + ) + +(defpart 4895 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:scale-x (meters 3.3)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:accel-x (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:next-time (seconds 0.335)) + (:next-launcher 4896) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4896 + :init-specs ((:scalevel-x (meters -0.006666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-sew-wake-tiny + :id 1491 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4897 :flags (is-3d sp7))) + ) + +(defpart 4897 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.2) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:accel-x (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-sewer-deep-mist + :id 1492 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 200) + :parts ((sp-item 4898 :flags (sp7))) + ) + +(defpart 4898 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 10)) + (:scale-x (meters 10) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 20.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.008 0.008) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.99) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 6.667)) + (:next-launcher 4899) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4899 + :init-specs ((:fade-a -0.032 -0.032)) + ) + +(defpartgroup group-sewer-waterfall-base-huge + :id 1493 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 4900 :fade-after (meters 50) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4901 :fade-after (meters 50) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4902 :fade-after (meters 50) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 4900 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3 0.3) + (:x (meters 0)) + (:y (meters -0.4)) + (:z (meters -40) (meters 80)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4903) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4903 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +(defpart 4901 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters 0)) + (:z (meters -40) (meters 40)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters 0.00033333333) (meters 0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4902 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters 0)) + (:z (meters 0) (meters 40)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters 0.00033333333) (meters 0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sewer-waterfall-base-top + :id 1494 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4904 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 4905 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +(defpart 4904 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3 0.3) + (:x (meters 0)) + (:y (meters -0.4)) + (:z (meters -30) (meters 60)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4903) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4905 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 20.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters 0)) + (:z (meters -30) (meters 60)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters 0.00033333333) (meters 0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-4-waterfalls + :id 1495 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4906 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4907 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4908 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4909 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4910 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4911 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4912 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4913 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4914 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 4906 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5 0.5) + (:x (meters 0)) + (:y (meters -0.4)) + (:z (meters -20) (meters 35)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4915) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4915 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +(defpart 4907 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters 13)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4908 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters 10) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4909 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters 4.6)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4910 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters 1.4) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4911 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters -3)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4912 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters -6.5) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4913 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters -11.5)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4914 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters -15) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-moving-step-a-wake + :id 1496 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 4916 :flags (sp7)) (sp-item 4917 :flags (sp7)) (sp-item 4918 :flags (is-3d sp7))) + ) + +(defpart 4916 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 2.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters 0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 80) (degrees -90)) + ) + ) + +(defpart 4917 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 2.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters -0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 260) (degrees 100.00001)) + ) + ) + +(defpart 4918 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:scale-x (meters 6.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:accel-x (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:next-time (seconds 0.335)) + (:next-launcher 4919) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4919 + :init-specs ((:scalevel-x (meters -0.006666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-sew-moving-step-b-wake + :id 1497 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 4920 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4921 :fade-after (meters 80) :falloff-to (meters 100) :flags (is-3d sp7)) + ) + ) + +(defpart 4920 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 3.0) + (:x (meters -4.2) (meters 8.4)) + (:z (meters 1.2)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.013333334)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:accel-y (meters -0.0016666667)) + (:accel-z (meters 0.001)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4921 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.4) + (:y (meters 0.8)) + (:z (meters 1.5)) + (:scale-x (meters 9) (meters 1)) + (:rot-y (degrees 0)) + (:scale-y (meters 1) (meters 1)) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-y (meters 0.013333334)) + (:fade-a -0.21333334) + (:accel-z (meters 0.001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-x (degrees 55)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-grate-bubbles + :id 1498 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4922 :fade-after (meters 80) :falloff-to (meters 100) :flags (is-3d sp7))) + ) + +(defpart 4922 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.2) + (:z (meters -1)) + (:scale-x (meters 4) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0) + (:vel-z (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.017777778 -0.017777778) + (:accel-z (meters 0.00066666666)) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sewer-slide-froth + :id 1499 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4923 :fade-after (meters 80) :falloff-to (meters 100) :flags (is-3d sp7))) + ) + +(defpart 4923 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters -2) (meters 4)) + (:z (meters -1)) + (:scale-x (meters 4) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-z (meters 0.00066666666)) + (:friction 0.9 0.03) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x58300600)) + (:next-time (seconds 0.335)) + (:next-launcher 4924) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4924 + :init-specs ((:fade-a -0.04)) + ) + +(defpartgroup group-flyingsaw-sparks + :id 1500 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4925 :flags (sp7)) (sp-item 4926 :flags (sp7))) + ) + +(defpart 4925 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4926 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5 0.5) + (:scale-x (meters 0.05) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.64) + (:fade-b -2.56) + (:fade-a -1.28 -1.28) + (:accel-y (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-sew-fan-gust + :id 1501 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4927 :flags (sp7))) + ) + +(defpart 4927 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 6.0) + (:y (meters 1) (meters 0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-z (meters 0.1)) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-sewer-rising-bubbles + :id 1502 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4928 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +(defpart 4928 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.01 0.5) + (:x (meters 0) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:accel-y (meters 0.00083333335)) + (:timer (seconds 3.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-birth-on-bubble-pop) + (:next-time (seconds 0.017)) + (:next-launcher 4929) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4929 + :init-specs ((:scale-x (meters 0.2) (meters 0.2)) + (:scale-y :copy scale-x) + (:fade-a -0.04 0.16) + (:accel-x (meters -0.00033333333) 1 (meters 0.00066666666)) + (:accel-z (meters -0.00033333333) 1 (meters 0.00066666666)) + (:friction 0.9) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 4929) + ) + ) + +;; WARN: Return type mismatch (pointer process) vs none. +(defun spt-func-birth-on-bubble-pop ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (zero? (-> arg1 timer)) + (cond + ((logtest? (-> *part-group-id-table* 1503 flags) (sp-group-flag sp13)) + (let ((v1-6 (-> *launch-matrix* trans)) + (a0-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-1 x) (-> arg2 launchrot x)) + (set! (-> a0-1 y) (-> arg2 launchrot y)) + (set! (-> a0-1 z) (-> arg2 launchrot z)) + (set! (-> a0-1 w) 1.0) + (set! (-> v1-6 quad) (-> a0-1 quad)) + ) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1503)) + ) + (else + (let ((v1-19 (-> *launch-matrix* trans)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-6 x) (-> arg2 launchrot x)) + (set! (-> a0-6 y) (-> arg2 launchrot y)) + (set! (-> a0-6 z) (-> arg2 launchrot z)) + (set! (-> a0-6 w) 1.0) + (set! (-> v1-19 quad) (-> a0-6 quad)) + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1503)) + ) + ) + ) + (none) + ) + +(defpartgroup group-sewer-rising-bubbles-pop + :id 1503 + :duration (seconds 1.5) + :linger-duration (seconds 0) + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4930 :fade-after (meters 100) :falloff-to (meters 200) :flags (is-3d sp7) :period (seconds 20) :length (seconds 0.035)) + ) + ) + +(defpart 4930 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sewer-abyss-waterfall-mist + :id 1504 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4931 :fade-after (meters 200) :falloff-to (meters 400) :flags (sp7)) + (sp-item 4932 :fade-after (meters 200) :falloff-to (meters 400) :flags (sp7)) + ) + ) + +(defpart 4932 + :init-specs ((:texture (ceiling-dust sewa-sprite)) + (:num 0.04 0.02) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 4) (meters 2)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0.046666667)) + (:scalevel-x (meters 0.00033333333) (meters 0.0016666667)) + (:scalevel-y (meters 0.0033333334) (meters 0.0033333334)) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters -0.0005)) + (:friction 0.99) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4933) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4933 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +(defpart 4931 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.2 0.2) + (:x (meters -5) (meters 10)) + (:y (meters 1)) + (:z (meters -10)) + (:scale-x (meters 6) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0.046666667)) + (:scalevel-x (meters 0.006666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.064 0.064) + (:accel-y (meters -0.00006666667) (meters -0.00006666667)) + (:friction 0.99) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.835)) + (:next-launcher 4934) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4934 + :init-specs ((:fade-a -0.032 -0.032)) + ) diff --git a/goal_src/jak3/levels/wascity/cty-attack-controller.gc b/goal_src/jak3/levels/wascity/cty-attack-controller.gc index 14509865fd..170496e3b8 100644 --- a/goal_src/jak3/levels/wascity/cty-attack-controller.gc +++ b/goal_src/jak3/levels/wascity/cty-attack-controller.gc @@ -7,3 +7,8 @@ ;; DECOMP BEGINS +;; stub +(defun cty-attack-reset ((arg0 symbol) (arg1 symbol) (arg2 symbol)) + (format 0 "skipping (cty-attack-reset ~A ~A ~A)~%" arg0 arg1 arg2) + (none) + ) \ No newline at end of file diff --git a/goal_src/jak3/levels/wascity/cty-faction.gc b/goal_src/jak3/levels/wascity/cty-faction.gc index f6b7bca5f7..eff871f52f 100644 --- a/goal_src/jak3/levels/wascity/cty-faction.gc +++ b/goal_src/jak3/levels/wascity/cty-faction.gc @@ -7,3 +7,13 @@ ;; DECOMP BEGINS +;; stub +(defun setup-city-task-faction () + (format 0 "skipping setup-city-task-faction~%") + 0 + ) + +(defun cty-faction-evaluate-commands ((arg0 pair)) + (format 0 "skipping (cty-faction-evaluate-commands ~A)~%" arg0) + 0 + ) \ No newline at end of file diff --git a/goal_src/jak3/levels/wascity/ctymark-obs-h.gc b/goal_src/jak3/levels/wascity/ctymark-obs-h.gc index 860d944a35..cbc9941621 100644 --- a/goal_src/jak3/levels/wascity/ctymark-obs-h.gc +++ b/goal_src/jak3/levels/wascity/ctymark-obs-h.gc @@ -7,3 +7,186 @@ ;; DECOMP BEGINS +(deftype market-object (crate) + ((sound-explode sound-spec) + (part-explode sparticle-launch-group) + (explode-matrix matrix :inline) + ) + ) + + +(defmethod init-collision! ((this market-object)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 7372.8 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + knocked + ) + ) + (set! (-> this root) (the-as collide-shape-moving s5-0)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch market-object vs none. +(defmethod init-skel! ((this market-object)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this look) (-> this type symbol)) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + 0 + ) + (set! (-> this base quad) (-> this root trans quad)) + (crate-post) + (nav-mesh-connect-from-ent this) + (none) + ) + +(defstate idle (market-object) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((a1-1 (the-as object (-> block param 1))) + (a0-2 proc) + ) + (-> (the-as attack-info a1-1) id) + (let ((gp-0 (-> (the-as attack-info a1-1) count))) + (cond + ((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info a1-1) mask)) + (logtest? (penetrate jak-dark-nuke) (-> (the-as attack-info a1-1) penetrate-using)) + ) + (go-virtual die #t 0) + ) + (else + (when a0-2 + (let ((v1-9 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when v1-9 + (forward-up-nopitch->inv-matrix + (-> self explode-matrix) + (vector-! (new 'stack-no-clear 'vector) (-> v1-9 root trans) (-> self root trans)) + *up-vector* + ) + (set! (-> self explode-matrix trans quad) (-> self root trans quad)) + ) + ) + ) + (send-event proc 'get-attack-count 1) + (process-contact-action proc) + (set! (-> self target) (process->handle proc)) + (go-virtual die #f (the-as int gp-0)) + ) + ) + ) + ) + ) + (else + (crate-standard-event-handler proc argc message block) + ) + ) + ) + ) + +(defstate die (market-object) + :virtual #t + :enter (behavior ((arg0 symbol) (arg1 int)) + (when (not arg0) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< (vector-vector-xz-distance (-> self root trans) (camera-pos)) 409600.0) + ) + (if (logtest? (-> self part-explode flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> self part-explode) + :mat-joint (-> self explode-matrix) + ) + (part-tracker-spawn part-tracker :to self :group (-> self part-explode) :mat-joint (-> self explode-matrix)) + ) + ) + (if (nonzero? (-> self sound-explode)) + (sound-play-by-spec (-> self sound-explode) (new-sound-id) (the-as vector #t)) + ) + ) + (let* ((t9-10 find-parent-method) + (a0-9 market-object) + (a1-9 30) + (t9-11 (-> (the-as (state symbol int market-object) (t9-10 a0-9 a1-9)) enter)) + ) + (if t9-11 + (t9-11 (the-as symbol a0-9) a1-9) + ) + ) + ) + ) + +(deftype market-basket-a (market-object) + () + ) + + +(deftype market-basket-b (market-object) + () + ) + + +(deftype market-crate (market-object) + () + ) + + +(deftype market-sack-a (market-object) + () + ) + + +(deftype market-sack-b (market-object) + () + ) + + +(deftype fruit-stand (process-focusable) + ((incoming-attack-id uint32) + (hack-counter uint32) + (count-sparts uint32) + (first-sparts uint32) + (num-sparts uint32) + (sparts-index uint32 4) + (sparts-pos vector 4 :inline) + (parts-alive? symbol) + ) + (:state-methods + idle + ) + (:methods + (fruit-stand-method-29 (_type_) none) + (fruit-stand-method-30 (_type_) none) + ) + ) diff --git a/goal_src/jak3/levels/wascity/ctymark-obs.gc b/goal_src/jak3/levels/wascity/ctymark-obs.gc index 7cc3595937..079e2c8609 100644 --- a/goal_src/jak3/levels/wascity/ctymark-obs.gc +++ b/goal_src/jak3/levels/wascity/ctymark-obs.gc @@ -7,3 +7,1544 @@ ;; DECOMP BEGINS +(defpartgroup group-mcrate-explode + :id 248 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1117 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1118 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1119 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1120 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1121 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 1119 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 128.0) + (:g 64.0 32.0) + (:b 0.0 32.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1120 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1121 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 4)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 196.0) + (:b 128.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 1118 + :init-specs ((:texture (new 'static 'texture-id :index #x15 :page #xc1)) + (:num 12.0 6.0) + (:y (meters 0) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1117 + :init-specs ((:texture (new 'static 'texture-id :index #x15 :page #xc1)) + (:num 6.0 3.0) + (:y (meters 0) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.3) (meters 2)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.6)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-mbasket-a-explode + :id 249 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1123 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1124 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1125 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1126 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1127 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1128 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1129 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 1126 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 3)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 128.0 64.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1125 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.083333336)) + (:accel-y (meters -0.003) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata 30720.0) + (:func 'check-water-level-drop-motion) + (:next-time (seconds 0) (seconds 0.58)) + (:next-launcher 41) + (:conerot-x (degrees 0) (degrees 85)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +(defpart 1127 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 2.0) + (:y (meters 0) (meters 2)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 64.0 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1128 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 4.0 3.0) + (:y (meters 0) (meters 4)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1129 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 7)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 64.0) + (:g 196.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 1124 + :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xc1)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 4)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1123 + :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xc1)) + (:birth-func 'birth-func-texture-group) + (:num 6.0 3.0) + (:y (meters 0.5) (meters 4)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-mbasket-b-explode + :id 250 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1130 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1131 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1132 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1133 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1134 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1135 :fade-after (meters 30) :falloff-to (meters 40) :flags (is-3d) :period (seconds 4) :length (seconds 0.335)) + (sp-item 1136 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 1134 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 255.0) + (:g :copy r) + (:b :copy g) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1135 + :init-specs ((:texture (specs level-default-sprite)) + (:num 2.0) + (:x (meters -3) (meters 6)) + (:y (meters 0.05)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 1.5) (meters 1)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 1.5) (meters 1)) + (:r 255.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:fade-a 3.2) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.135)) + (:next-launcher 1137) + ) + ) + +(defpart 1137 + :init-specs ((:fade-a 0.0) (:next-time (seconds 1) (seconds 0.997)) (:next-launcher 1138)) + ) + +(defpart 1138 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +(defpart 1132 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 192.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1133 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1136 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 7)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 1131 + :init-specs ((:texture (new 'static 'texture-id :page #xc1)) + (:num 6.0 3.0) + (:y (meters 0.5) (meters 0.5)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1130 + :init-specs ((:texture (new 'static 'texture-id :page #xc1)) + (:num 4.0 2.0) + (:y (meters 0.5) (meters 0.5)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; WARN: Return type mismatch number vs none. +(defun check-market-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (and (>= 35225.6 (-> arg2 launchrot y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 launchrot y) 35225.6) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (none) + ) + +(defpart 1122 + :init-specs ((:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0)) + (:vel-y (meters 0)) + (:rotvel-x (degrees 0)) + (:rotvel-y (degrees 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:friction 0.8 0.1) + (:timer (seconds 4)) + (:next-time (seconds 0.5) (seconds 0.997)) + (:next-launcher 1139) + ) + ) + +(defpart 1139 + :init-specs ((:fade-a -0.21333334 -0.21333334) (:flags (sp-cpuinfo-flag-2 left-multiply-quat))) + ) + +(defpartgroup group-msack-a-explode + :id 251 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1140 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1141 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1142 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1143 :fade-after (meters 30) :falloff-to (meters 40) :flags (is-3d) :period (seconds 4) :length (seconds 0.335)) + (sp-item 1144 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1145 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1146 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 1142 + :init-specs ((:texture (new 'static 'texture-id :index #x10 :page #xc1)) + (:num 32.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.6)) + (:r 128.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 96.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y (meters 0.00033333333)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1143 + :init-specs ((:texture (new 'static 'texture-id :index #x11 :page #xc1)) + (:num 1.0 1.0) + (:x (meters -3) (meters 6)) + (:y (meters 0.05)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 1.5) (meters 1.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.2) (seconds 0.065)) + (:next-launcher 1137) + ) + ) + +(defpart 1144 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 3.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 150.0 60.0) + (:g 96.0 64.0) + (:b 0.0 32.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1145 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 3.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1146 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 5)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 4.5)) + (:r 255.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 1141 + :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1)) + (:num 8.0 3.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1140 + :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1)) + (:num 4.0 2.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-msack-b-explode + :id 252 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1147 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1148 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1149 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1150 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1151 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +(defpart 1148 + :init-specs ((:texture (new 'static 'texture-id :index #x1 :page #xc1)) + (:num 32.0) + (:y (meters 0) (meters 1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0033333334) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 3.335)) + (:next-launcher 1152) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1152 + :init-specs ((:vel-y (meters 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:friction 0.8 0.1) + (:timer (seconds 5.667)) + (:next-time (seconds 1.5) (seconds 0.997)) + (:next-launcher 1139) + ) + ) + +(defpart 1149 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 2.0) + (:y (meters 0) (meters 1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 150.0 60.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 16.0 8.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1150 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0 2.0) + (:y (meters 0) (meters 1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1151 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 3)) + (:rot-x (degrees 0.675)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 1147 + :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1)) + (:num 6.0 2.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 0.2)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +(defskelgroup skel-market-basket-a market-basket-a market-basket-a-lod0-jg market-basket-a-idle-ja + ((market-basket-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 2.5) + ) + +;; WARN: Return type mismatch market-basket-a vs none. +(defmethod init-skel! ((this market-basket-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 249)) + (set! (-> this sound-explode) (static-sound-spec "break-vase" :group 1)) + (call-parent-method this) + (none) + ) + +(defskelgroup skel-market-basket-b market-basket-b market-basket-b-lod0-jg market-basket-b-idle-ja + ((market-basket-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; WARN: Return type mismatch market-basket-b vs none. +(defmethod init-skel! ((this market-basket-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 250)) + (set! (-> this sound-explode) (static-sound-spec "break-flour" :group 1)) + (call-parent-method this) + (none) + ) + +(defskelgroup skel-market-crate market-crate market-crate-lod0-jg market-crate-idle-ja + ((market-crate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; WARN: Return type mismatch market-crate vs none. +(defmethod init-skel! ((this market-crate)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-crate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 248)) + (set! (-> this sound-explode) (static-sound-spec "break-crate" :group 1)) + (call-parent-method this) + (none) + ) + +(defskelgroup skel-market-sack-a market-sack-a market-sack-a-lod0-jg market-sack-a-idle-ja + ((market-sack-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + ) + +;; WARN: Return type mismatch market-sack-a vs none. +(defmethod init-skel! ((this market-sack-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 251)) + (set! (-> this sound-explode) (static-sound-spec "break-crate" :group 1)) + (call-parent-method this) + (none) + ) + +(defskelgroup skel-market-sack-b market-sack-b market-sack-b-lod0-jg market-sack-b-idle-ja + ((market-sack-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + ) + +;; WARN: Return type mismatch market-sack-b vs none. +(defmethod init-skel! ((this market-sack-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 252)) + (set! (-> this sound-explode) (static-sound-spec "break-veg-straw" :group 1)) + (call-parent-method this) + (none) + ) + +(defun market-activate ((arg0 level)) + (let* ((v1-0 (-> arg0 name)) + (gp-0 (cond + ((= v1-0 'ctymarka) + (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00) + ) + ((= v1-0 'ctymarkb) + (new 'static 'boxed-array :type int32 5 0 0 #xcd00200 #xcd00c00) + ) + ((= v1-0 'waswide) + (new 'static 'boxed-array :type int32 5 0 0 #x29a01400 #x29a01500) + ) + (else + (format 0 "ERROR: market-activate called for unknown level ~A~%" (-> arg0 name)) + ) + ) + ) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 1124) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 1123) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + ) + (setup-special-textures (-> *part-id-table* 1118) "wood-plain-debris") + (setup-special-textures (-> *part-id-table* 1117) "wood-plain-debris") + (setup-special-textures (-> *part-id-table* 1124) "clay-pot-debris-01") + (setup-special-textures (-> *part-id-table* 1123) "clay-pot-debris-01") + (setup-special-textures (-> *part-id-table* 1131) "basket-debris-01") + (setup-special-textures (-> *part-id-table* 1130) "basket-debris-01") + (setup-special-textures (-> *part-id-table* 1141) "cotton-wrap-debris") + (setup-special-textures (-> *part-id-table* 1140) "cotton-wrap-debris") + (setup-special-textures (-> *part-id-table* 1147) "basket-debris-01") + (setup-special-textures (-> *part-id-table* 1142) "straw-bit") + (setup-special-textures (-> *part-id-table* 1143) "straw-ground") + (setup-special-textures (-> *part-id-table* 1148) "cherry") + 0 + (none) + ) + +(define *fruit-check-ground-counter* 0) + +(defun fruit-check-ground-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 matrix)) + (let ((v1-1 (-> arg1 key proc)) + (f0-0 (-> arg1 user-float)) + ) + (set! (-> (the-as fruit-stand (+ (* (-> (the-as fruit-stand v1-1) num-sparts) 4) (the-as uint v1-1))) + sparts-index + 0 + ) + (the-as uint arg3) + ) + (when (and (>= (-> (the-as fruit-stand v1-1) count-sparts) (-> (the-as fruit-stand v1-1) first-sparts)) + (nonzero? (-> (the-as fruit-stand v1-1) hack-counter)) + ) + (set-vector! + (-> (the-as fruit-stand v1-1) sparts-pos (-> (the-as fruit-stand v1-1) num-sparts)) + (-> arg2 launchrot x) + (-> arg2 launchrot y) + (-> arg2 launchrot z) + 1.0 + ) + (+! (-> (the-as fruit-stand v1-1) num-sparts) 1) + (+! (-> (the-as fruit-stand v1-1) hack-counter) -1) + ) + (+! (-> (the-as fruit-stand v1-1) count-sparts) 1) + (when (and (< (-> arg2 launchrot y) f0-0) (< (-> arg1 vel-sxvel y) 0.0)) + (set! (-> arg2 launchrot y) f0-0) + (if (and (< (-> arg1 vel-sxvel y) -122.88) (< (rand-vu-int-count 10) 3)) + (set-vector! + (new 'stack-no-clear 'vector) + (-> arg2 launchrot x) + (-> arg2 launchrot y) + (-> arg2 launchrot z) + 1.0 + ) + ) + (set! (-> arg1 vel-sxvel y) (* (-> arg1 vel-sxvel y) (- (rand-vu-float-range 0.6 0.8)))) + ) + ) + ) + +(defun fruit-sparticle-next-on-mode-1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg1 key))) + (cond + ((zero? (-> s5-0 state-mode 0)) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + 0.0 + (let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega)))) + (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0)) + (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0)) + (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0)) + ) + (vector-float*! s4-0 (the-as vector (-> s5-0 origin)) f26-0) + (let ((a1-5 s4-0)) + (let ((v1-8 s4-0)) + (let ((a0-10 (-> s5-0 origin uvec))) + (let ((a2-1 f30-0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-8 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-5 quad) vf6) + ) + (let ((a1-6 s4-0)) + (let ((v1-9 s4-0)) + (let ((a0-11 (-> s5-0 origin fvec))) + (let ((a2-2 f0-8)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-11 quad)) + ) + (.lvf vf4 (&-> v1-9 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! (-> arg1 vel-sxvel x) (-> s4-0 x)) + (set! (-> arg1 vel-sxvel y) (-> s4-0 y)) + (set! (-> arg1 vel-sxvel z) (-> s4-0 z)) + ) + (-> arg1 vel-sxvel) + (set! (-> arg1 user-float) (+ (-> s5-0 origin trans y) (-> arg1 omega))) + ) + ) + ) + 0.0 + ) + ) + +(defpartgroup group-ctywide-fruit + :id 253 + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 6) + :rotate ((degrees 30) (degrees 0) (degrees 0)) + :parts ((sp-item 1153 :flags (sp3 sp7)) + (sp-item 1154 :flags (sp3 sp7)) + (sp-item 1155 :flags (sp3 sp7)) + (sp-item 1156 :flags (sp3 sp7)) + (sp-item 1157 :flags (sp3 sp7)) + ) + ) + +(defpart 1153 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 8.0 2.0) + (:x (meters 2.2) 2 (meters 0.75)) + (:y (meters 1.1)) + (:z (meters -1.25) 2 (meters 0.75)) + (:scale-x (meters 0.6) (meters 0.15)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 40.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 9)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1638.4) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1158) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1158 + :init-specs ((:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.96 0.02) + (:func 'fruit-check-ground-bounce) + (:next-time (seconds 2) (seconds 3.997)) + (:next-launcher 1159) + ) + ) + +(defpart 1157 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 40.0) + (:x (meters -3.7) 7 (meters 0.25)) + (:y (meters 1.1)) + (:z (meters -1.1) 7 (meters 0.25)) + (:scale-x (meters 0.25) (meters 0.1)) + (:scale-y (meters 0.35) (meters 0.1)) + (:r 0.0 1 120.0) + (:g 90.0 20.0) + (:b 0.0 1 80.0) + (:a 128.0) + (:omega (degrees 4.5)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 819.2) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1160) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1156 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 24.0) + (:x (meters -3.6) 7 (meters 0.25)) + (:y (meters 1.25)) + (:z (meters -1.075) 6 (meters 0.25)) + (:scale-x (meters 0.25) (meters 0.1)) + (:scale-y (meters 0.35) (meters 0.1)) + (:r 0.0 1 120.0) + (:g 90.0 20.0) + (:b 0.0 1 80.0) + (:a 128.0) + (:omega (degrees 4.5)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 819.2) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1160) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1160 + :init-specs ((:rot-z (degrees 0) (degrees 360)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.97 0.02) + (:func 'fruit-check-ground-bounce) + (:next-time (seconds 1.5) (seconds 2.997)) + (:next-launcher 1161) + ) + ) + +(defpart 1161 + :init-specs ((:rotvel-z (degrees 0)) (:fade-a -0.42666668)) + ) + +(defpart 1155 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 32.0) + (:x (meters -0.8) 3 (meters 0.5)) + (:y (meters 1)) + (:z (meters -1) 3 (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.15)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 100.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 6.7500005)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1228.8) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1162) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1154 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 32.0) + (:x (meters -0.55) 2 (meters 0.5)) + (:y (meters 1.25)) + (:z (meters -0.8) 2 (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.15)) + (:scale-y :copy scale-x) + (:r 140.0 64.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6.7500005)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1228.8) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1162) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1162 + :init-specs ((:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.97 0.02) + (:func 'fruit-check-ground-bounce) + (:next-time (seconds 2) (seconds 3.997)) + (:next-launcher 1159) + ) + ) + +(defpart 1159 + :init-specs ((:fade-a -0.42666668)) + ) + +(defskelgroup skel-fruit-stand cty-fruit-stand cty-fruit-stand-lod0-jg cty-fruit-stand-idle-ja + ((cty-fruit-stand-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; WARN: Return type mismatch none vs object. +(defbehavior fruit-stand-event-handler fruit-stand ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((gp-0 (the-as attack-info (-> arg3 param 1)))) + (when (and (!= (-> gp-0 id) (-> self incoming-attack-id)) + (nonzero? (-> self part)) + (zero? (-> self part state-mode 0)) + ) + (sound-play "break-veg-wood") + (set! (-> self incoming-attack-id) (-> gp-0 id)) + (set! (-> self part state-mode 0) (the-as uint 1)) + (when (not (run-logic? self)) + (format 0 "Killing self!~%") + (when (-> self parts-alive?) + (set! (-> self parts-alive?) #f) + (kill-particles (-> self part)) + ) + ) + ) + ) + ) + ) + ) + +(defmethod run-logic? ((this fruit-stand)) + "Should this process be run? Checked by execute-process-tree." + (if (-> this parts-alive?) + (call-parent-method this) + #t + ) + ) + +(defstate idle (fruit-stand) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (fruit-stand-event-handler proc argc message block) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (when (-> self parts-alive?) + (dotimes (gp-0 (the-as int (-> self num-sparts))) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (s4-0 (-> *sp-particle-system-2d* cpuinfo-table (-> self sparts-index gp-0))) + ) + (when (and (nonzero? (-> s4-0 key)) (= (-> s4-0 key group) (lookup-part-group-by-name "group-ctywide-fruit"))) + (set! (-> s5-0 start-pos quad) (-> self sparts-pos gp-0 quad)) + (+! (-> s5-0 start-pos y) 4096.0) + (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-11 s5-0)) + (set! (-> v1-11 radius) (-> s4-0 omega)) + (set! (-> v1-11 collide-with) (collide-spec backgnd)) + (set! (-> v1-11 ignore-process0) #f) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (if (>= f0-7 0.0) + (set! (-> s4-0 user-float) (+ (-> s5-0 start-pos y) (* (-> s5-0 move-dist y) f0-7))) + ) + (when (< f0-7 0.0) + ) + ) + ) + ) + ) + (+! (-> self first-sparts) (-> self num-sparts)) + (when (>= (-> self first-sparts) (-> self count-sparts)) + (set! (-> self first-sparts) (the-as uint 0)) + 0 + ) + (set! (-> self num-sparts) (the-as uint 0)) + (set! (-> self hack-counter) (the-as uint 4)) + (set! (-> self count-sparts) (the-as uint 0)) + 0 + ) + (let ((a0-16 (new 'stack 'sphere))) + (set! (-> a0-16 quad) (-> self root trans quad)) + (set! (-> a0-16 r) (-> self root root-prim local-sphere w)) + (cond + ((or (= (-> self part state-mode 0) 1) + (and (sphere-in-view-frustum? a0-16) + (< (vector-vector-distance (-> self root trans) (math-camera-pos)) 491520.0) + ) + ) + (when (not (-> self parts-alive?)) + (initialize (-> self part) (-> *part-group-id-table* 253) self) + (set! (-> self parts-alive?) #t) + ) + (spawn-from-cspace (-> self part) (the-as cspace (-> self node-list data))) + ) + (else + (when (-> self parts-alive?) + (set! (-> self parts-alive?) #f) + (kill-particles (-> self part)) + ) + ) + ) + ) + (ja-post) + ) + ) + +(defmethod fruit-stand-method-29 ((this fruit-stand)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 0) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod fruit-stand-method-30 ((this fruit-stand)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 253) this)) + (set! (-> this parts-alive?) #t) + 0 + (none) + ) + +(defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor)) + (fruit-stand-method-29 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fruit-stand" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (fruit-stand-method-30 this) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/wascity/dogat.gc b/goal_src/jak3/levels/wascity/dogat.gc index 8a0f431e72..4c70e37aaa 100644 --- a/goal_src/jak3/levels/wascity/dogat.gc +++ b/goal_src/jak3/levels/wascity/dogat.gc @@ -7,3 +7,524 @@ ;; DECOMP BEGINS +(deftype dogat (nav-enemy) + ((rotation-matrix matrix :inline) + (scared-timer time-frame) + ) + (:state-methods + sit-idle + ) + (:methods + (dogat-method-191 (_type_) none) + ) + ) + + +(defskelgroup skel-dogat dogat dogat-lod0-jg dogat-idle-ja + ((dogat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow dogat-shadow-mg + ) + +(define *dogat-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 7 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 15) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 3 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 15) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 2 + :param1 4 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 15) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 2 + :param1 4 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 3 + :hostile-anim 7 + :hit-anim -1 + :knocked-anim 8 + :knocked-land-anim 9 + :die-anim 3 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :look-at-joint 23 + :bullseye-joint 3 + :sound-hit (static-sound-name "dogat-hit") + :sound-die (static-sound-name "dogat-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #f + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim -1 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 15) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 7.5) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 25) + :maximum-rotation-rate (degrees 1440) + :notice-nav-radius (meters 2) + :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! (-> *dogat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; WARN: Return type mismatch symbol vs none. +(defbehavior dogat-travel-post dogat () + (none) + ) + +(defstate idle (dogat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy idle) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self scared-timer) 0) + 0 + ) + ) + +(defstate sit-idle (dogat) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self state-timeout) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.6 2.1))))) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + (let ((v1-0 (-> self focus aware))) + (cond + ((= v1-0 (enemy-aware ea4)) + (go-flee self) + ) + ((< (the-as int v1-0) 1) + (go-virtual idle) + ) + ) + ) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) + (go-virtual active) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let ((gp-0 (rand-vu-int-range 2 4))) + (dotimes (s5-0 gp-0) + (ja-no-eval :group! dogat-idle-sit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (let ((gp-1 (rand-vu-int-range 2 4))) + (dotimes (s5-1 gp-1) + (ja-no-eval :group! dogat-idle-situp-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (let ((gp-2 (rand-vu-int-range 2 4))) + (dotimes (s5-2 gp-2) + (ja-no-eval :group! dogat-idle-eat-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +(defstate active (dogat) + :virtual #t + :enter (behavior () + (local-vars (v1-12 symbol) (v1-15 vector) (f0-4 float)) + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (let* ((a2-0 (-> self root trans)) + (gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (closest-point-on-mesh (-> self nav) gp-0 a2-0 (the-as nav-poly #f))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 0)) + (until (< f0-4 (sqrtf (+ (* (-> v1-15 x) (-> v1-15 x)) (* (-> v1-15 z) (-> v1-15 z))))) + (vector-rotate-around-y! s5-0 (-> self rotation-matrix fvec) (* 182.04445 (rand-vu-float-range -175.0 175.0))) + (vector-normalize! s5-0 (* 4096.0 (rand-vu-float-range 10.0 24.0))) + (clamp-vector-to-mesh-cross-gaps + (-> self nav) + gp-0 + s4-0 + s5-0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (+! s3-0 1) + (when (< 6 s3-0) + (set! v1-12 #f) + (goto cfg-8) + ) + (set! f0-4 16384.0) + (set! v1-15 s5-0) + ) + ) + (set! v1-12 #t) + (label cfg-8) + (if v1-12 + (vector+! (-> self move-dest) gp-0 s5-0) + (set! (-> self move-dest quad) (-> gp-0 quad)) + ) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! dogat-run0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ((-> (method-of-type nav-enemy active) trans)) + (if (< (vector-vector-xz-distance (-> self move-dest) (-> self root trans)) 8192.0) + (go-virtual sit-idle) + ) + ) + #f + ) + :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-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +(defstate notice (dogat) + :virtual #t + :enter (behavior () + (go-virtual flee) + ) + ) + +(defstate flee (dogat) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (until #f + (suspend) + (ja :num! (loop! 2.0)) + ) + #f + ) + ) + +(defmethod go-hostile ((this dogat)) + (set-time! (-> this scared-timer)) + (go (method-of-object this flee)) + ) + +(defmethod enemy-method-108 ((this dogat) (arg0 process-focusable)) + (or (< (vector-vector-xz-distance (-> this root trans) (get-trans arg0 0)) 143360.0) + (not (time-elapsed? (-> this scared-timer) (seconds 4))) + ) + ) + +(defmethod send-attack-to-all-tshapes ((this dogat) (arg0 process-focusable) (arg1 event-message-block)) + 0 + ) + +(defmethod init-enemy-collision! ((this dogat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list projectile) + ) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 9011.2) + (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 enemy)) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (set! (-> s5-0 nav-radius) 4096.0) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod enemy-method-50 ((this dogat) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0))) + (set! (-> v1-4 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (set! (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 prim-core collide-with) + (collide-spec) + ) + 0 + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch shadow-control vs none. +(defmethod init-enemy! ((this dogat)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dogat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *dogat-nav-enemy-info*) + (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask civilian)) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + -4096.0 + 4096.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/wascity/wasall-init.gc b/goal_src/jak3/levels/wascity/wasall-init.gc index 6afb301438..f6442c9586 100644 --- a/goal_src/jak3/levels/wascity/wasall-init.gc +++ b/goal_src/jak3/levels/wascity/wasall-init.gc @@ -7,3 +7,90 @@ ;; DECOMP BEGINS +(define *wasall-reserve* #f) + +(defun wasall-login ((arg0 level)) + (let ((gp-0 (the-as int (-> *game-info* current-vehicle)))) + (when (or (< (the-as uint gp-0) (the-as uint 12)) + (< (the-as uint 19) (the-as uint gp-0)) + (not (have-vehicle-v-type? gp-0)) + ) + (let ((s5-0 12)) + (countdown (s4-0 8) + (if (have-vehicle-v-type? s5-0) + (set! gp-0 s5-0) + ) + (+! s5-0 1) + ) + ) + (set! (-> *game-info* current-vehicle) (the-as game-vehicle-u8 gp-0)) + ) + ) + 0 + (none) + ) + +(defun wasall-logout ((arg0 level)) + (set! *trail-graph* #f) + 0 + (none) + ) + +(defun wasall-activate ((arg0 level)) + (let ((v1-0 *traffic-info*) + (a1-0 (-> arg0 name)) + ) + (set! (-> v1-0 vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 12) a1-0) + (set! (-> v1-0 vehicle-levels 13) a1-0) + (set! (-> v1-0 vehicle-levels 14) a1-0) + (set! (-> v1-0 vehicle-levels 15) a1-0) + (set! (-> v1-0 vehicle-levels 16) a1-0) + (set! (-> v1-0 vehicle-levels 17) a1-0) + (set! (-> v1-0 vehicle-levels 18) a1-0) + (set! (-> v1-0 vehicle-levels 19) a1-0) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +(defun wasall-deactivate ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 vehicle-level) (the-as basic #f)) + ) + (vehicle-manager-kill) + 0 + (none) + ) + +(defun desert-game-activate ((arg0 level)) + (let ((v1-0 *traffic-info*) + (a0-1 (-> arg0 name)) + ) + (set! (-> v1-0 vehicle-levels 20) a0-1) + (set! (-> v1-0 vehicle-levels 22) a0-1) + (set! (-> v1-0 vehicle-levels 23) a0-1) + ) + 0 + (none) + ) + +(defun desert-race-level-activate ((arg0 level)) + (let ((v1-0 *traffic-info*) + (a1-0 (-> arg0 name)) + ) + (set! (-> v1-0 race-vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 20) a1-0) + ) + 0 + (none) + ) + +(defun desert-race-level-deactivate ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 race-vehicle-level) (the-as basic #f)) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/wascity/wasall-obs.gc b/goal_src/jak3/levels/wascity/wasall-obs.gc index 2661850f5b..a0ea89ad57 100644 --- a/goal_src/jak3/levels/wascity/wasall-obs.gc +++ b/goal_src/jak3/levels/wascity/wasall-obs.gc @@ -7,3 +7,1673 @@ ;; DECOMP BEGINS +(defskelgroup skel-wascity-airlock wascity-airlock wascity-airlock-lod0-jg wascity-airlock-idle-ja + ((wascity-airlock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 40) + ) + +(deftype wascity-airlock (com-airlock) + () + ) + + +(defmethod init-from-entity! ((this wascity-airlock) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 49152.0 0.0 122880.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 81920.0 40960.0 0.0 81920.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -81920.0 40960.0 0.0 81920.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-airlock" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this allow-pilot?) #t) + (set! (-> this sound-gear) (static-sound-spec "w-door-steam" :group 1)) + (set! (-> this gear-stop-frame) 2.0) + (set! (-> this sound-open) (static-sound-spec "w-door-op-strt" :group 1)) + (set! (-> this sound-open-loop) (static-sound-spec "w-door-roll" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "w-door-open-hit" :group 1)) + (set! (-> this sound-close) (static-sound-spec "w-door-cls-star" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "w-door-roll" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "w-door-cls-hit" :group 1)) + (go (method-of-object this close) #t) + ) + +(defskelgroup skel-wascity-airlock-small wascity-airlock-small wascity-airlock-small-lod0-jg wascity-airlock-small-idle-ja + ((wascity-airlock-small-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + ) + +(deftype wascity-airlock-small (com-airlock) + () + ) + + +(defmethod init-from-entity! ((this wascity-airlock-small) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 40960.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 32768.0 0.0 0.0 40960.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 7) + (set-vector! (-> v1-10 local-sphere) -32768.0 0.0 0.0 40960.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 -8192.0 0.0 40960.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-wascity-airlock-small" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-gear) (static-sound-spec "air-door-steam" :group 1)) + (set! (-> this gear-stop-frame) 2.0) + (set! (-> this sound-open) (static-sound-spec "air-ver-open" :group 1)) + (set! (-> this sound-open-loop) (static-sound-spec "air-horiz-slide" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "air-horiz-hit" :group 1)) + (set! (-> this sound-close) (static-sound-spec "air-horiz-close" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "air-hor-sld-cls" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "air-hor-cls-hit" :group 1)) + (set! (-> this sound-post-close) (static-sound-spec "air-ver-cls-hit" :group 1)) + (go (method-of-object this close) #t) + ) + +(defskelgroup skel-wascity-elevator-door wascity-elevator-door wascity-elevator-door-lod0-jg wascity-elevator-door-idle-ja + ((wascity-elevator-door-lod0-mg (meters 20)) + (wascity-elevator-door-lod1-mg (meters 40)) + (wascity-elevator-door-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 10 0 20) + ) + +(deftype wascity-elevator-door (com-airlock) + () + ) + + +(defstate open (wascity-elevator-door) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v1-0 message) + (a0-1 'front) + ) + (cond + ((= v1-0 a0-1) + (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) + (f0-0 (check-crossing-distance self (camera-pos) #f)) + ) + (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< 2048.0 f30-0) + (>= (* f30-0 f0-0) 0.0) + ) + ) + ) + (else + (let ((t9-4 (-> (method-of-type com-airlock open) event))) + (if t9-4 + (t9-4 (the-as process a0-1) argc message block) + ) + ) + ) + ) + ) + ) + ) + +(defmethod init-from-entity! ((this wascity-elevator-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 53248.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 53248.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-wascity-elevator-door" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "ver-open-hit" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "ver-open-hit" :group 1)) + (go (method-of-object this close) #t) + ) + +(deftype tentacle (process-drawable) + ((init-pos vector :inline) + (focus-pos vector :inline) + (nav-mesh nav-mesh) + (active-timer time-frame) + (fade-level float) + (sound-id-loop sound-id) + (sound-id-attack sound-id) + ) + (:state-methods + dormant + un-dive-player + attacking-0 + attacking-1 + kill-player + wait + ) + ) + + +(defskelgroup skel-tentacle tentacle tentacle-lod0-jg tentacle-emerge-ja + ((tentacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 20 0 20) + ) + +(defbehavior tentacle-follow-post tentacle () + (let ((a0-0 *target*)) + (when a0-0 + (set! (-> self focus-pos quad) (-> (get-trans a0-0 0) quad)) + (set-vector! (-> self root trans) (-> self focus-pos x) (-> self root trans y) (-> self focus-pos z) 1.0) + ) + ) + (ja-post) + (none) + ) + +(defbehavior tentacle-attack-handler tentacle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('target) + (case (-> arg3 param 0) + (('die) + (when (= (-> arg3 param 1) 'tentacle) + (go-virtual kill-player) + #t + ) + ) + ) + ) + (('joint) + 3 + ) + ) + ) + +(defstate dormant (tentacle) + :virtual #t + :enter (behavior () + (set! (-> self active-timer) 0) + 0 + ) + :exit (behavior () + (set-setting! 'dive #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'jump #f 0.0 0) + (set-setting! 'double-jump #f 0.0 0) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self fade-level) 0.0) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (-> self fade-level))))) + ) + :trans (behavior () + (local-vars (v1-13 target)) + (if (not (-> self nav-mesh)) + (set! (-> self nav-mesh) (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0)) + ) + (let ((gp-0 *target*)) + (if (not (and gp-0 + (not (focus-test? *target* dead flut)) + (-> self nav-mesh) + (= (-> *game-info* mode) 'play) + (nav-mesh-method-11 (-> self nav-mesh) (get-trans gp-0 0)) + (begin (set! v1-13 gp-0) v1-13) + (or (focus-test? v1-13 on-water under-water) + (= (-> v1-13 control ground-pat material) (pat-material waterbottom)) + ) + ) + ) + (set-time! (-> self active-timer)) + ) + (when (and gp-0 (time-elapsed? (-> self active-timer) (seconds 0.1))) + (set! (-> self root trans quad) (-> (get-trans gp-0 0) quad)) + (set! (-> self root trans y) (+ -114688.0 (get-base-height *ocean-map*))) + (set! (-> self init-pos quad) (-> self root trans quad)) + (if (focus-test? gp-0 under-water) + (go-virtual un-dive-player) + (go-virtual attacking-0) + ) + ) + ) + ) + :code sleep-code + :post #f + ) + +(defstate un-dive-player (tentacle) + :virtual #t + :trans (behavior () + (let ((v1-0 *target*)) + (cond + ((not v1-0) + (go empty-state) + ) + ((not (focus-test? v1-0 under-water)) + (go-virtual attacking-0) + ) + ) + ) + ) + :code sleep-code + :post tentacle-follow-post + ) + +(defstate attacking-0 (tentacle) + :virtual #t + :event tentacle-attack-handler + :trans (behavior () + (set! (-> self sound-id-attack) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "tentacle" -99.0 0) + ) + (sound-play "tentacle-loop" :id (-> self sound-id-loop)) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! tentacle-emerge-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual attacking-1) + ) + :post (behavior () + (set! (-> self fade-level) (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (-> self fade-level))))) + (let ((f30-2 (fmax 0.0 (fmin 1.0 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))))) + (set! (-> *part-id-table* 1644 init-specs 11 initial-valuef) (lerp 6.826667 54.613335 f30-2)) + (set! (-> *part-id-table* 1644 init-specs 11 random-rangef) + (the-as float (the int (lerp 6.826667 54.613335 f30-2))) + ) + (set! (-> *part-id-table* 1644 init-specs 10 initial-valuef) (the-as float (the int (lerp 4.0 16.0 f30-2)))) + (set! (-> *part-id-table* 1644 init-specs 10 random-rangef) (the-as float (the int (lerp 4.0 16.0 f30-2)))) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self root))) + (set-vector! gp-0 (-> s4-0 trans x) (get-base-height *ocean-map*) (-> s4-0 trans z) 1.0) + ) + (spawn (-> self part) gp-0) + ) + (tentacle-follow-post) + ) + ) + +(defstate attacking-1 (tentacle) + :virtual #t + :event tentacle-attack-handler + :exit (behavior () + (sound-stop (-> self sound-id-loop)) + ) + :trans (behavior () + (while (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'tentacle)) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self root))) + (set-vector! gp-0 (-> s4-0 trans x) (get-base-height *ocean-map*) (-> s4-0 trans z) 1.0) + ) + (cond + ((logtest? (-> *part-group-id-table* 409 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 409)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 409)) + ) + ) + ) + (tentacle-follow-post) + ) + ) + +(defstate kill-player (tentacle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('joint) + 3 + ) + ) + ) + :enter (behavior () + (sound-params-set! *gui-control* (-> self sound-id-attack) #f -1 -1 -1 1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id-attack) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + :exit (behavior () + (if *target* + (send-event *target* 'end-mode 'bot) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! tentacle-tentacle-attack-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual wait) + ) + :post ja-post + ) + +(defstate wait (tentacle) + :virtual #t + :code sleep-code + ) + +(defmethod init-from-entity! ((this tentacle) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 64) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-tentacle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 408) this)) + (set! (-> this nav-mesh) #f) + (set! (-> this sound-id-loop) (new-sound-id)) + (set! (-> this sound-id-attack) (new-sound-id)) + (go (method-of-object this dormant)) + ) + +(defskelgroup skel-terraformer-des-fma-2 terraformer terraformer-lod0-jg terraformer-walk-ja + ((terraformer-lod0-mg (meters 20)) (terraformer-lod0-mg (meters 40)) (terraformer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 175 75 25000) + :origin-joint-index 3 + :global-effects 32 + ) + +(load-scene (new 'static 'scene + :name "desert-final-boss-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-211" + :art-group "scenecamera" + :anim "desert-final-boss-intro" + :parts 24 + :command-list '((0 + (kill "terraformer-1") + (apply ,(lambda () + (set! (-> *sky-work* disable-day-star) (the-as basic #t)) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-time-for-random-weather! *mood-control* 180.0 180.0) + ) + ) + (apply ,(lambda () + (set-setting! 'fog-special-interp-targ #f 0.15 0) + (set-setting! 'dust-storm-fog-scalar #f 0.5 0) + (set-setting! 'fog-special-interp-rate #f 1000.0 0) + ) + ) + ) + (1 (part-tracker + "group-cloud-spread" + entity + "particleman" + joint + "particleK" + track + #t + duration + (frame-range 1 2000) + ) + ) + (10 (part-tracker + "group-desert-final-boss-gate" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 10 20) + ) + ) + (21 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 21 22) + ) + ) + (25 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 25 26) + ) + ) + (26 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 26 27) + ) + ) + (27 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 27 28) + ) + ) + (41 (part-tracker + "group-desert-final-boss-gate" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 41 51) + ) + ) + (57 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleH" + track + #t + duration + (frame-range 57 58) + ) + ) + (59 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 59 75) + ) + ) + (125 + (part-tracker + "group-desert-fireball-shot" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 125 260) + ) + (part-tracker + "group-desert-fireball-shot-trail" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 125 260) + subsample-num + (new 'static 'bfloat :data 5.0) + ) + ) + (192 (part-tracker + "group-desert-fireball-explosion" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-range 192 193) + ) + ) + (275 (apply ,(lambda () + (set-setting! 'fog-special-interp-targ #f 0.4 0) + (set-setting! 'dust-storm-fog-scalar #f 0.4 0) + (set-setting! 'fog-special-interp-rate #f 0.03 0) + ) + ) + ) + (696 (apply ,(lambda () + (set-setting! 'fog-special-interp-targ #f 0.15 0) + (set-setting! 'dust-storm-fog-scalar #f 1.0 0) + (set-setting! 'fog-special-interp-rate #f 1000.1 0) + ) + ) + ) + (1066 (fadeout (frame-time-30 10))) + (10000 (task-close! "desert-final-boss-introduction")) + ) + :cut-list '(0 87 136 260 696 768 875 1013) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'desboss1 + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'desboss1 + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((16 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(1013) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'desboss1 + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((50 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "errol" + :level 'deserrol + :art-group "skel-errol" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "v-snake" + :level 'wasall + :art-group "skel-v-snake" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x2 + ) + (new 'static 'scene-actor + :name "snake-wheel-fma" + :level 'desboss1 + :art-group "skel-snake-wheel-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-2" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-2" + :prefix "" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x2 + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-head" + :level 'desboss1 + :art-group "skel-terraformer-head" + :prefix "" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasall-final-boss-intro-movie" + :end-point "desertb-final-boss-start" + :borrow '((desert-game alias desert copy desboss1 special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "arena-outro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-106" + :art-group "scenecamera" + :anim "arena-outro" + :parts #xb4 + :command-list '((0 (fadein (frame-time-30 10)) (send-event *time-of-day* 'change 'hour (int 14))) + (10 + (part-tracker + "group-precursor-staff-shot-glow" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 10 5300) + ) + ) + (2744 + (part-tracker + "group-precursor-staff-shot" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 2744 2750) + ) + ) + (2763 + (part-tracker + "group-precursor-staff-hit" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 2763 2764) + ) + ) + (2985 + (part-tracker + "group-precursor-staff-shot" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 2985 2996) + ) + ) + (3009 + (part-tracker + "group-precursor-staff-hit" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 3009 3010) + ) + ) + (3320 + (part-tracker + "group-ship-door-light" + entity + "precursor-ship" + joint + "door_glow" + track + #t + duration + (frame-range 3320 4385) + ) + ) + (4371 + (part-tracker + "group-mothership-thrusters" + entity + "precursor-ship" + joint + "thruster_a" + track + #t + duration + (frame-range 4371 4577) + ) + (part-tracker + "group-mothership-thrusters" + entity + "precursor-ship" + joint + "thruster_b" + track + #t + duration + (frame-range 4371 4577) + ) + (part-tracker + "group-mothership-thrusters" + entity + "precursor-ship" + joint + "thruster_c" + track + #t + duration + (frame-range 4371 4577) + ) + ) + (5380) + (5390 (fadeout (frame-time-30 10))) + (10000) + (10000 (task-close! "city-win-introduction")) + ) + :cut-list '(208 + 327 + 495 + 672 + 786 + 916 + 1061 + 1168 + 1245 + 1300 + 1387 + 1526 + 1678 + 1749 + 1803 + 1883 + 1954 + 2276 + 2385 + 2557 + 2722 + 2750 + 2918 + 2996 + 3225 + 3292 + 3380 + 3453 + 3598 + 3689 + 3827 + 3894 + 4028 + 4169 + 4318 + 4371 + 4513 + 4578 + 4629 + 4683 + 4857 + 5020 + 5300 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'outrocst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'outrocst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (1300 1678) (1803 1954) (3292 3380) (3598 3689) (4169 4399) (4683 5401)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(4371 5020) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x3a2 + ) + (new 'static 'scene-actor + :name "precursor-ship" + :level 'loutro + :art-group "skel-precursor-ship" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'loutro + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (1803 2276) (2385 2722) (2749 2764)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-leader" + :level 'loutro + :art-group "skel-ottsel-leader" + :prefix "" + :draw-frames '((0 327) + (786 1061) + (1168 1300) + (1387 1526) + (1803 1883) + (2276 2557) + (2722 2750) + (2918 2996) + (3292 3380) + (3598 3689) + (4169 4371) + ) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(2276) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-surfer" + :level 'loutro + :art-group "skel-ottsel-surfer" + :prefix "" + :draw-frames '((208 327) (786 1245) (1387 1526) (2722 2750) (2918 2996) (3292 3380) (3598 3689)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-veger" + :level 'loutro + :art-group "skel-ottsel-veger" + :prefix "" + :draw-frames '((3689 4169)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-tess" + :level 'loutro2 + :art-group "skel-ottsel-tess" + :prefix "" + :draw-frames '((3010 3380) (3453 3598) (4371 4513) (4683 5300)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'loutro2 + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((0 208) (327 672) (4371 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-daxpants" + :level 'loutro2 + :art-group "skel-ottsel-daxpants" + :prefix "" + :draw-frames '((2764 2918) (2996 3380) (3453 3598) (4371 4513) (4683 5401)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-dummy-outro" + :level 'loutro2 + :art-group "skel-ottsel-dummy-outro" + :prefix "" + :draw-frames '((0 327) (786 1061) (1168 1245) (1387 1526) (1803 1883) (3292 3380) (3598 3689)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'outrocst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((1300 1387) (1526 1890) (3380 3453) (4371 4513) (4629 4683)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tess-highres" + :level 'outrocst + :art-group "skel-tess-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (1803 2276) (2385 2722) (2749 2918) (2996 3010)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((0 208) (327 672) (4371 4513) (4578 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "seem-highres" + :level 'outrocst + :art-group "skel-seem-highres" + :prefix "" + :draw-frames '((1300 1387) (1526 1890) (3380 3453) (4371 4513) (4629 4683)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kleever-highres" + :level 'outrocst + :art-group "skel-kleever-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (3689 4169) (4371 4513) (4513 4578)) + :scissor-frames '((3535 4169)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'outrocst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((327 786) (4371 4513) (4578 4629) (5020 5300)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-simple" + :level 'loutro3 + :art-group "skel-onin-simple" + :prefix "" + :draw-frames '((327 495) (4371 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-ship-door" + :level 'loutro3 + :art-group "skel-precursor-ship-door" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-simple" + :level 'outcast3 + :art-group "skel-torn-simple" + :prefix "" + :draw-frames '((1300 1387) (1526 1890) (3380 3453) (4371 4513) (4629 4683)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-simple" + :level 'outcast3 + :art-group "skel-keira-simple" + :prefix "" + :draw-frames '((327 672) (4371 4513) (4578 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "wstd-arena-plat" + :level 'wasstada + :art-group "skel-wstd-arena-plat" + :prefix "" + :draw-frames '((0 208) (786 916) (3689 4169) (4371 4513) (4513 4578)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasstada-outro" + :end-point "title-credits" + :borrow '((wasstada 0 loutro special) (outrocst 0 loutro2 special) (wasall 0 loutro3 special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #x10f + :on-running #f + :on-complete #f + ) + ) diff --git a/goal_src/jak3/levels/wascity/wasall-part.gc b/goal_src/jak3/levels/wascity/wasall-part.gc index bd45fbaebf..c3008e001a 100644 --- a/goal_src/jak3/levels/wascity/wasall-part.gc +++ b/goal_src/jak3/levels/wascity/wasall-part.gc @@ -5,5 +5,1758 @@ ;; name in dgo: wasall-part ;; dgos: WASALL +(define-extern *wasdoors-range-color-flame* curve-color-fast) +(define-extern *wasdoors-range-alpha-flame* curve2d-fast) +(define-extern *wasdoors-range-scale-flame-x* curve2d-fast) +(define-extern *wasdoors-range-scale-flame-y* curve2d-fast) +(define-extern *r-wasdoors-curve-flame* curve2d-fast) +(define-extern *g-wasdoors-curve-flame* curve2d-fast) +(define-extern *b-wasdoors-curve-flame* curve2d-fast) +(define-extern *wasdoors-curve-alpha-flame* curve2d-fast) +(define-extern *wasdoors-curve-flame-x* curve2d-fast) +(define-extern *wasdoors-curve-flame-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-desert-buggy-dust + :id 383 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1587 :flags (sp7))) + ) + +(defpart 1587 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.2) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 30.0 10.0) + (:vel-y (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.044444446 -0.044444446) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + ) + ) + +(defpartgroup group-desert-buggy-dust-stop + :id 384 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1588 :flags (sp7)) (sp-item 1589 :flags (sp7))) + ) + +(defpart 1588 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 30.0 10.0) + (:vel-z (meters 0.13333334)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.016666668 -0.016666668) + (:accel-y (meters 0) (meters 0.0001)) + (:friction 0.95) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 1590) + (:conerot-x (degrees 0) (degrees -10)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1590 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-buggy-dirt-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 200)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpart 1589 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-buggy-dirt-bits) + (:num 1.0 2.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:rotvel-z (degrees -2) (degrees 4)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees 0) (degrees -20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defun spt-birth-func-part-buggy-dirt-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-buggy-dirt-bits arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-desert-buggy-dust-skid + :id 385 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1591 :flags (sp7)) (sp-item 1592 :flags (sp7))) + ) + +(defpart 1591 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 30.0 10.0) + (:vel-z (meters -0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06666667 -0.06666667) + (:accel-y (meters 0) (meters 0.00016666666)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 1593) + (:conerot-x (degrees 10) (degrees 30)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1593 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpart 1592 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-buggy-skid-bits) + (:num 2.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters -0.05) (meters -0.016666668)) + (:rotvel-z (degrees -2) (degrees 4)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees 20)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +(defun spt-birth-func-part-buggy-skid-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-buggy-dirt-bits arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-part-wascity-door-steam + :id 386 + :duration (seconds 1.335) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1594 :flags (sp7) :period (seconds 30) :length (seconds 1.335))) + ) + +(defpart 1594 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-z (meters 0.01) (meters 0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405c00)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-part-wascity-door-pre-steam1 + :id 387 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1595 :period (seconds 20) :length (seconds 1) :offset 200)) + ) + +(defpart 1595 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters -3) (meters 8)) + (:y (meters -6)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.06666667) (meters 0.13333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1596) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1596 + :init-specs ((:fade-a -0.011428571)) + ) + +(defpartgroup group-part-wascity-door-pre-steam2 + :id 388 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1597 :period (seconds 20) :length (seconds 1) :offset 200)) + ) + +(defpart 1597 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters -3) (meters 8)) + (:y (meters -6)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.06666667) (meters 0.13333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1596) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-part-wascity-door-big-steam1 + :id 389 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1598 :period (seconds 30) :length (seconds 2))) + ) + +(defpart 1598 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 2.0) + (:x (meters -27)) + (:y (meters 8)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-x (meters -0.05) (meters -0.033333335)) + (:vel-y (meters -0.05) (meters -0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.93 0.03) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + ) + ) + +(defpartgroup group-part-wascity-door-big-steam2 + :id 390 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1599 :period (seconds 30) :length (seconds 2))) + ) + +(defpart 1599 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 2.0) + (:x (meters 27)) + (:y (meters 8)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-x (meters 0.05) (meters 0.033333335)) + (:vel-y (meters -0.05) (meters -0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.93 0.03) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + ) + ) + +(defpartgroup group-part-wascity-door-big-pre-steam1 + :id 391 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1600 :period (seconds 20) :length (seconds 1))) + ) + +(defpart 1600 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters -10) (meters -20)) + (:y (meters 0)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.13333334) (meters 0.26666668)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1601) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1601 + :init-specs ((:fade-a -0.011428571)) + ) + +(defpartgroup group-part-wascity-door-big-pre-steam2 + :id 392 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1602 :period (seconds 20) :length (seconds 1))) + ) + +(defpart 1602 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters 10) (meters 20)) + (:y (meters 0)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.13333334) (meters 0.26666668)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1601) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-wasdoors-gaslamp + :id 393 + :flags (sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1603 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1604 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1605 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1606 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1607 :fade-after (meters 20) :falloff-to (meters 30) :flags (sp7)) + ) + ) + +(defpart 1603 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:z (meters 0.4)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-z (meters -0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters -0.016666668)) + (:accel-x (meters -0.001)) + (:accel-z (meters 0.0013333333) (meters 0.0013333333)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0)) + (:conerot-y (degrees 0)) + ) + ) + +(if #t + (set! *wasdoors-range-color-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *wasdoors-range-alpha-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 96.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 159.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *wasdoors-range-scale-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *wasdoors-range-scale-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 4.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-wasdoors-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-wasdoors-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -1.0 :z -2.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-wasdoors-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0) + :one-over-x-deltas (new 'static 'vector :y -5.0000005 :w 1.0) + ) + ) + ) + +(if #t + (set! *wasdoors-curve-alpha-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.01 :y 0.01 :z 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :y 3.3000002 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *wasdoors-curve-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 0.3 :y 0.6 :z 0.5 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y -1.0 :z -0.75000006 :w 1.0) + ) + ) + ) + +(if #t + (set! *wasdoors-curve-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 0.5 :w 0.6) + :one-over-x-deltas (new 'static 'vector :x 0.4 :y 0.5 :z 0.3333334 :w 1.0) + ) + ) + ) + +(define *part-wasdoors-gas-lamp-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.3) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +(set! (-> *part-id-table* 1603 init-specs 17 initial-valuef) + (the-as float *part-wasdoors-gas-lamp-flame-curve-settings*) + ) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* color-start) *wasdoors-range-color-flame*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* alpha-start) *wasdoors-range-alpha-flame*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-x-start) *wasdoors-range-scale-flame-x*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-y-start) *wasdoors-range-scale-flame-y*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* r-scalar) *r-wasdoors-curve-flame*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* g-scalar) *g-wasdoors-curve-flame*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* b-scalar) *b-wasdoors-curve-flame*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* a-scalar) *wasdoors-curve-alpha-flame*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-x-scalar) *wasdoors-curve-flame-x*) + +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-y-scalar) *wasdoors-curve-flame-y*) + +(defpart 1604 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters -0.3) (meters 0.6)) + (:z (meters 0.3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 10.0 20.0) + (:g 10.0 20.0) + (:b 200.0) + (:a 64.0) + (:scalevel-x (meters -0.00033333333)) + (:fade-a -0.64) + (:accel-x (meters -0.001)) + (:accel-z (meters 0.0013333333) (meters 0.0013333333)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1605 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.4) + (:x (meters -1)) + (:z (meters 2.5)) + (:scale-x (meters 12) (meters 6)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 8.0 4.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1606 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 0.01 0.05) + (:scale-x (meters 0.3) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 8.0) + (:a 255.0) + (:vel-z (meters 0.06666667) (meters 0.016666668)) + (:fade-g -0.16666667) + (:fade-b -5.0) + (:fade-a -1.7) + (:accel-x (meters 0.0016666667)) + (:friction 0.95) + (:timer (seconds 2) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees -40)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 1607 + :init-specs ((:num 0.2) + (:x (meters 0) (meters 2)) + (:y (meters -0.5) (meters 1)) + (:z (meters 6)) + (:rot-x 8) + (:r 8192.0) + (:g 1228.8) + (:b 1024.0) + (:accel-x (meters 0.001)) + (:accel-z (meters 0.0016666667)) + (:timer (seconds 0.335)) + (:flags (distort)) + (:rotate-y (degrees -30)) + ) + ) + +(defpartgroup group-wasdoors-red-lights + :id 394 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 1608 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 1608 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-elevator-palace-door + :id 395 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1609 :flags (sp7) :period (seconds 20) :length (seconds 2))) + ) + +(defpart 1609 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -5) (meters 10)) + (:y (meters -7)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 90.0) + (:g 70.0) + (:b 50.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.93) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees -60) (degrees 120)) + (:conerot-z (degrees -30) (degrees 60)) + ) + ) + +(defpartgroup group-elevator-palace-door-close + :id 396 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1610 :flags (sp7) :period (seconds 20) :length (seconds 0.035))) + ) + +(defpart 1610 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 30.0 10.0) + (:x (meters -5) (meters 10)) + (:y (meters -20)) + (:z (meters -5) (meters 10)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 90.0) + (:g 70.0) + (:b 50.0) + (:a 32.0 32.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.93) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees -60) (degrees 120)) + ) + ) + +(defpartgroup group-desert-fireball-shot + :id 397 + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1611 :flags (sp6)) (sp-item 1612)) + ) + +(defpart 1611 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100) (meters 20)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 40.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 1612 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters -1)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-desert-fireball-shot-trail + :id 398 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1613)) + ) + +(defpart 1613 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 10)) + (:scale-x (meters 30) (meters 10)) + (:scale-y (meters 20) (meters 5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:scalevel-x (meters -0.06666667) (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.6666667) + (:fade-b -3.4) + (:accel-y (meters -0.0033333334) (meters -0.016666668)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.25)) + (:next-launcher 1614) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1614 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.48 -0.48)) + ) + +(defpartgroup group-desert-fireball-explosion + :id 399 + :flags (sp0) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1615 :flags (sp3))) + ) + +(defpart 1615 + :init-specs ((:texture (middot level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2500)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -6.6666665)) + (:scalevel-y :copy scalevel-x) + (:fade-b -0.10666667) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 1616) + ) + ) + +(defpart 1616 + :init-specs ((:scalevel-x (meters -3.3333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:next-time (seconds 0.335)) + (:next-launcher 1617) + ) + ) + +(defpart 1617 + :init-specs ((:scalevel-x (meters -2.6666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.5)) + (:next-launcher 1618) + ) + ) + +(defpart 1618 + :init-specs ((:scalevel-x (meters -2.3333333)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.667)) + (:next-launcher 1619) + ) + ) + +(defpart 1619 + :init-specs ((:scalevel-x (meters -2)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-cloud-spread + :id 400 + :duration (seconds 200) + :linger-duration (seconds 20) + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1620 :flags (is-3d sp7) :period (seconds 200) :length (seconds 0.017))) + ) + +(defpart 1620 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 100.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 2000)) + (:scale-x (meters 100) (meters 300)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:accel-z (meters 0.033333335)) + (:friction 0.3) + (:timer (seconds 20)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 6.4)) + (:next-launcher 1621) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1621 + :init-specs ((:fade-a 0.21333334) (:friction 0.0)) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-part-desert-boss-slide-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 140)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 20)) + (v1-3 (+ (logand 0 (rand-uint31-gen *random-generator*)) 40)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-3))) + ) + (none) + ) + +(defpartgroup group-desert-boss-slide-dust + :id 401 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1622)) + ) + +(defpart 1622 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-part-desert-boss-slide-dust) + (:num 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 32.0 32.0) + (:vel-z (meters 0) (meters -0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-y (degrees -20) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-desert-final-boss-gate + :id 402 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1623 :flags (sp6 sp7)) + (sp-item 1624 :flags (sp6 sp7)) + (sp-item 1625 :flags (sp7)) + (sp-item 1626 :flags (sp7)) + ) + ) + +(defpart 1623 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 60.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 1624 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 0.0) + (:b 255.0) + (:a 60.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 1625 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 20.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g 32.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 0.5) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1626 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters -0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.53333336) (degrees 1.0666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.13)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + ) + ) + +(defpartgroup group-precursor-staff-shot-glow + :id 403 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1627)) + ) + +(defpart 1627 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0.6) (meters 0.3)) + (:rot-x (degrees 45)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:fade-a 0.6) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.167)) + (:next-launcher 1628) + ) + ) + +(defpart 1628 + :init-specs ((:fade-a -0.6)) + ) + +(defpartgroup group-precursor-staff-shot + :id 404 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1629 :flags (sp7))) + ) + +(defpart 1629 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 20.0) + (:y (meters 0) (meters 0.03)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 64.0) + (:a 32.0 32.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.03) (meters 0.0033333334)) + (:timer (seconds 0.835) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.635)) + (:next-launcher 1630) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1630 + :init-specs ((:scalevel-x (meters -0.00066666666) (meters 0.0013333333)) + (:scalevel-y :copy scalevel-x) + (:accel-x (meters -0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.013333334) (meters 0.026666667)) + (:friction 0.5 0.1) + ) + ) + +(defpartgroup group-precursor-staff-hit + :id 405 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1631 :flags (sp3 sp7))) + ) + +(defpart 1631 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y (meters -0.06666667)) + (:fade-a -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-ship-door-light + :id 406 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1632 :flags (sp6)) + (sp-item 1633 :flags (is-3d)) + (sp-item 1634 :flags (is-3d)) + (sp-item 1635 :flags (is-3d)) + ) + ) + +(defpart 1632 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 6.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1636 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1637) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 1637 + :init-specs ((:fade-a -2.56)) + ) + +(defpart 1633 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1637) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 1634 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1637) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 1635 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1638) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 1638 + :init-specs ((:fade-a -1.28)) + ) + +(defpartgroup group-mothership-thrusters + :id 407 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 1639 :flags (sp6)) (sp-item 1640 :flags (sp6)) (sp-item 1641 :flags (sp7))) + ) + +(defpart 1640 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 1639 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0) + (:b 255.0) + (:a 50.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 81920.0) + ) + ) + +(defpart 1641 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0) (meters 4)) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters -0.0033333334) (meters 0.006666667)) + (:vel-y (meters -0.033333335) (meters -0.016666668)) + (:vel-z (meters -0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.02) (meters 0.04)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 2.56) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40a000 #x409b00 #x409b00)) + (:next-time (seconds 0.085)) + (:next-launcher 1642) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1642 + :init-specs ((:fade-a -0.07314286 -0.14628571)) + ) + +(defpartgroup group-tentacle-warn + :id 408 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1643 :flags (sp7)) (sp-item 1644 :flags (sp7)) (sp-item 1645 :flags (is-3d sp7))) + ) + +(defpart 1643 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 3.0) + (:x (meters 0) (meters 6)) + (:y (meters -3) (meters -5)) + (:scale-x (meters 0.1) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.006666667)) + (:fade-a 0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'check-bubble-height) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1644 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 3.0) + (:x (meters 0) (meters 3)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0) + (:vel-y (meters 0.013333334) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1645 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.3) + (:x (meters 0)) + (:y (meters 0)) + (:scale-x (meters 3)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 40.0 40.0) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-tentacle-attack + :id 409 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1646 :flags (sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 1647 :flags (sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 1648 :flags (sp7) :period (seconds 10) :length (seconds 0.067) :offset 325) + ) + ) + +(defpart 1646 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters 0) (meters 1)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:scalevel-x (meters 0.001) (meters 0.001)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'check-drop-group-center) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1647 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 100.0) + (:x (meters 0) (meters 1)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334)) + (:scalevel-x (meters -0.0033333334) (meters -0.0033333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.000033333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 78) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1648 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters 0) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:scalevel-x (meters 0.001) (meters 0.001)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 13.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-wascity-burning-bush-holo-on + :id 381 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1649 :flags (is-3d sp6 sp7)) + (sp-item 1650 :flags (is-3d sp6 sp7)) + (sp-item 1651 :flags (is-3d sp6 sp7)) + ) + ) + +(defpart 1652 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 2.0 4.0) + (:x (meters -2.25) (meters 4.5)) + (:y (meters 6.1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 6)) + (:r 128.0 1 128.0) + (:g 255.0) + (:b 32.0) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.067)) + (:next-launcher 1653) + (:rotate-y (degrees 0) 1 (degrees 180)) + ) + ) + +(defpart 1653 + :init-specs ((:fade-a -1.6)) + ) + +(defpart 1649 + :init-specs ((:texture (kleever-fist-logo desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 55.0) + (:g 55.0) + (:b 55.0) + (:a 160.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1651 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 8)) + (:r 255.0) + (:g 60.0) + (:b 10.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1650 + :init-specs ((:texture (kleever-fist-logo desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 4.8) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-wascity-burning-bush-holo-off + :id 382 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1654 :flags (is-3d sp6 sp7)) + (sp-item 1655 :flags (is-3d sp6 sp7)) + (sp-item 1656 :flags (is-3d sp6 sp7)) + ) + ) + +(defpart 1654 + :init-specs ((:texture (burning-bush-off desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1656 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 8)) + (:r 64.0 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 32.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1657 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees -90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 0.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1655 + :init-specs ((:texture (burning-bush-off desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/wascity/wascitya-obs.gc b/goal_src/jak3/levels/wascity/wascitya-obs.gc index 0e45a8200d..30002aa4b2 100644 --- a/goal_src/jak3/levels/wascity/wascitya-obs.gc +++ b/goal_src/jak3/levels/wascity/wascitya-obs.gc @@ -7,3 +7,117 @@ ;; DECOMP BEGINS +(defskelgroup skel-wascity-stad-door wascity-stad-door wascity-stad-door-lod0-jg wascity-stad-door-idle-ja + ((wascity-stad-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 20) + ) + +(deftype wascity-stad-door (com-airlock) + () + ) + + +(defmethod init-from-entity! ((this wascity-stad-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 61440.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-stad-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "ver-open-hit" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "air-ver-cls-hit" :group 1)) + (set! (-> this sound-behind?) #t) + (set! (-> this allow-pilot?) #t) + (go (method-of-object this close) #t) + ) + +(deftype waspala-elevator (elevator) + () + ) + + +(defskelgroup skel-waspala-elevator waspala-elevator waspala-elevator-lod0-jg waspala-elevator-idle-ja + ((waspala-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 20 0 30) + ) + +(defmethod elevator-method-47 ((this waspala-elevator)) + (if *target* + (< (vector-vector-xz-distance (target-pos 0) (-> this root trans)) + (* 0.4 (-> this root root-prim prim-core world-sphere w)) + ) + #f + ) + ) + +(defmethod get-art-group ((this waspala-elevator)) + (art-group-get-by-name *level* "skel-waspala-elevator" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this waspala-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 8192.0 0.0 40960.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! (-> this root) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this waspala-elevator)) + (set! (-> this sound-running-loop) (static-sound-spec "palacelev-loop" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "palacelev-stop" :group 1)) + (none) + ) diff --git a/goal_src/jak3/levels/wascity/waswide-obs.gc b/goal_src/jak3/levels/wascity/waswide-obs.gc index e9916cbbc0..d4fafb0e7d 100644 --- a/goal_src/jak3/levels/wascity/waswide-obs.gc +++ b/goal_src/jak3/levels/wascity/waswide-obs.gc @@ -7,3 +7,842 @@ ;; DECOMP BEGINS +(deftype wascity-windmill (process-drawable) + ((quat quaternion :inline) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-wascity-windmill wascity-windmill wascity-windmill-lod0-jg wascity-windmill-idle-ja + ((wascity-windmill-lod0-mg (meters 20)) (wascity-windmill-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 20) + ) + +(defstate idle (wascity-windmill) + :virtual #t + :trans (behavior () + (quaternion-rotate-local-y! + (-> self root quat) + (-> self quat) + (lerp-scale -16384.0 16384.0 (sin (* 5.0 (the float (current-time)))) -1.0 1.0) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defun wascity-windmill-callback ((arg0 cspace) (arg1 transformq)) + (quaternion-rotate-local-z! (-> arg1 quat) (-> arg1 quat) (* 109.22667 (the float (current-time)))) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defmethod init-from-entity! ((this wascity-windmill) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-windmill" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (quaternion-copy! (-> this quat) (-> this root quat)) + (let ((a0-7 (-> this node-list data 4))) + (set! (-> a0-7 param0) wascity-windmill-callback) + (set! (-> a0-7 param1) this) + (set! (-> a0-7 param2) (the-as basic 0)) + ) + (go (method-of-object this idle)) + ) + +(deftype wascity-flag-base (process-drawable) + () + (:state-methods + idle + ) + (:methods + (wascity-flag-base-method-21 (_type_) none) + (wascity-flag-base-method-22 (_type_) none) + ) + ) + + +(defstate idle (wascity-flag-base) + :virtual #t + :enter (behavior () + (ja :num-func num-func-identity :frame-num (the float (rand-vu-int-count (ja-num-frames 0)))) + ) + :trans (behavior () + (ja :num! (loop!)) + (if (ja-done? 0) + (wascity-flag-base-method-22 self) + ) + ) + :code sleep-code + :post ja-post + ) + +(defmethod wascity-flag-base-method-22 ((this wascity-flag-base)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this wascity-flag-base) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (wascity-flag-base-method-21 this)) (the-as pair 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) + ) + +(deftype wascity-flag-a (wascity-flag-base) + () + ) + + +(defskelgroup skel-wascity-flag-a wascity-flag-a wascity-flag-a-lod0-jg wascity-flag-a-flap-ja + ((wascity-flag-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 12) + ) + +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-a)) + (art-group-get-by-name *level* "skel-wascity-flag-a" (the-as (pointer level) #f)) + (none) + ) + +(deftype wascity-flag-b (wascity-flag-base) + () + ) + + +(defskelgroup skel-wascity-flag-b wascity-flag-b wascity-flag-b-lod0-jg wascity-flag-b-flap-ja + ((wascity-flag-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 12) + ) + +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-b)) + (art-group-get-by-name *level* "skel-wascity-flag-b" (the-as (pointer level) #f)) + (none) + ) + +(deftype wascity-flag-c (wascity-flag-base) + () + ) + + +(defskelgroup skel-wascity-flag-c wascity-flag-c wascity-flag-c-lod0-jg wascity-flag-c-flap-ja + ((wascity-flag-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 7 0 10) + ) + +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-c)) + (art-group-get-by-name *level* "skel-wascity-flag-c" (the-as (pointer level) #f)) + (none) + ) + +(deftype wascity-flag-d (wascity-flag-base) + () + ) + + +(defskelgroup skel-wascity-flag-d wascity-flag-d wascity-flag-d-lod0-jg wascity-flag-d-flap-ja + ((wascity-flag-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-d)) + (art-group-get-by-name *level* "skel-wascity-flag-d" (the-as (pointer level) #f)) + (none) + ) + +(deftype wascity-wind-fan (process-drawable) + ((quat quaternion :inline) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-wascity-wind-fan wascity-wind-fan wascity-wind-fan-lod0-jg wascity-wind-fan-idle-ja + ((wascity-wind-fan-lod0-mg (meters 20)) (wascity-wind-fan-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 15) + ) + +(defstate idle (wascity-wind-fan) + :virtual #t + :trans (behavior () + (quaternion-rotate-local-y! (-> self root quat) (-> self quat) (* 18.204445 (the float (current-time)))) + ) + :code (behavior () + (ja :group! wascity-wind-fan-idle-ja :num! none :frame-num 0.0) + (sleep-code) + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this wascity-wind-fan) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-wind-fan" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (quaternion-copy! (-> this quat) (-> this root quat)) + (go (method-of-object this idle)) + ) + +(deftype shaker (structure) + ((axis vector :inline) + (start-time time-frame) + (decay-time float) + (amplitude float) + (freq float) + (y-decay-time float) + (y-amplitude float) + (y-freq float) + (shake float) + (y-shake float) + ) + (:methods + (shaker-method-9 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod shaker-method-9 ((this shaker)) + (let ((s5-0 (- (current-time) (-> this start-time)))) + (set! (-> this shake) (* (-> this amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this freq)))) + ) + ) + (set! (-> this y-shake) (* (-> this y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this y-freq)))) + ) + ) + ) + (none) + ) + +(defskelgroup skel-wascity-cactus wascity-cactus wascity-cactus-lod0-jg wascity-cactus-idle-ja + ((wascity-cactus-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 7) + ) + +(defskelgroup skel-wascity-cactus-explode wascity-cactus wascity-cactus-explode-lod0-jg wascity-cactus-explode-idle-ja + ((wascity-cactus-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +(define *wascity-cactus-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(deftype wascity-cactus (process-focusable) + ((shakers shaker 6 :inline) + (incoming-attack-id uint32) + (incoming-attack-time time-frame) + (hit-points float) + ) + (:state-methods + idle + die + ) + (:methods + (wascity-cactus-method-30 (_type_) none) + (wascity-cactus-method-31 (_type_) none) + ) + ) + + +(defun wascity-cactus-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (-> arg0 param1)) + (s3-0 (the-as object (-> arg0 param2))) + ) + (quaternion*! + (-> arg1 quat) + (-> arg1 quat) + (quaternion-vector-angle! + (the-as quaternion (new 'stack-no-clear 'vector)) + (the-as vector (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0))) + (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) shake) + ) + ) + (quaternion-rotate-local-y! + (-> arg1 quat) + (-> arg1 quat) + (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) y-shake) + ) + (if (< (the int (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) decay-time)) + (- (current-time) (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defstate die (wascity-cactus) + :virtual #t + :enter #f + :exit #f + :trans #f + :code (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) 0 #t) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post #f + ) + +(defstate idle (wascity-cactus) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((a1-1 (the-as object (-> block param 1))) + (a0-2 proc) + ) + (when (and (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (!= (-> (the-as attack-info a1-1) mode) 'flut) + ) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) + (= (pu->knocked-type a0-4) (knocked-type none)) + (< 0.0 (-> self hit-points)) + ) + (if (not (time-elapsed? (-> self incoming-attack-time) (seconds 0.6))) + (return #f) + ) + (sound-play "cactus-hit") + (seek! (-> self hit-points) 0.0 0.1) + (set-time! (-> self incoming-attack-time)) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-2 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root trans) (-> self root trans)) 1.0) + *up-vector* + ) + (-> self root quat) + ) + (let ((v1-20 (-> self shakers))) + (set! (-> v1-20 0 axis quad) (-> gp-2 quad)) + (set-time! (-> v1-20 0 start-time)) + (set! (-> v1-20 0 decay-time) 300.0) + (set! (-> v1-20 0 freq) 150.0) + (set! (-> v1-20 0 amplitude) 1820.4445) + (set! (-> v1-20 0 y-amplitude) 0.0) + ) + (let ((a0-19 (joint-node wascity-cactus-lod0-jg main))) + (set! (-> a0-19 param0) wascity-cactus-callback) + (set! (-> a0-19 param1) self) + (set! (-> a0-19 param2) (the-as basic 0)) + ) + (let ((v1-23 (-> self shakers 1))) + (set! (-> v1-23 axis quad) (-> gp-2 quad)) + (set! (-> v1-23 start-time) (+ (current-time) (seconds -0.06))) + (set! (-> v1-23 decay-time) 600.0) + (set! (-> v1-23 freq) 150.0) + (set! (-> v1-23 amplitude) 364.0889) + (set! (-> v1-23 y-amplitude) 0.0) + (set! (-> v1-23 y-decay-time) 450.0) + (set! (-> v1-23 y-freq) 150.0) + (set! (-> v1-23 y-amplitude) 3640.889) + ) + (let ((v1-25 (joint-node wascity-cactus-lod0-jg a))) + (set! (-> v1-25 param0) wascity-cactus-callback) + (set! (-> v1-25 param1) self) + (set! (-> v1-25 param2) (the-as basic 1)) + ) + (let ((v1-26 (-> self shakers 2))) + (set! (-> v1-26 axis quad) (-> gp-2 quad)) + (set! (-> v1-26 start-time) (+ (current-time) (seconds -0.2))) + (set! (-> v1-26 decay-time) 600.0) + (set! (-> v1-26 freq) 150.0) + (set! (-> v1-26 amplitude) 364.0889) + (set! (-> v1-26 y-decay-time) 450.0) + (set! (-> v1-26 y-freq) 150.0) + (set! (-> v1-26 y-amplitude) 3640.889) + ) + (let ((v1-28 (joint-node wascity-cactus-lod0-jg b))) + (set! (-> v1-28 param0) wascity-cactus-callback) + (set! (-> v1-28 param1) self) + (set! (-> v1-28 param2) (the-as basic 2)) + ) + (let ((v1-29 (-> self shakers 3))) + (set! (-> v1-29 axis quad) (-> gp-2 quad)) + (set! (-> v1-29 start-time) (+ (current-time) (seconds -0.2))) + (set! (-> v1-29 decay-time) 600.0) + (set! (-> v1-29 freq) 150.0) + (set! (-> v1-29 amplitude) 364.0889) + (set! (-> v1-29 y-decay-time) 450.0) + (set! (-> v1-29 y-freq) 150.0) + (set! (-> v1-29 y-amplitude) 3640.889) + ) + (let ((v1-31 (joint-node wascity-cactus-lod0-jg c))) + (set! (-> v1-31 param0) wascity-cactus-callback) + (set! (-> v1-31 param1) self) + (set! (-> v1-31 param2) (the-as basic 2)) + ) + (let ((v1-32 (-> self shakers 4))) + (set! (-> v1-32 axis quad) (-> gp-2 quad)) + (set! (-> v1-32 start-time) (+ (current-time) (seconds -0.2))) + (set! (-> v1-32 decay-time) 600.0) + (set! (-> v1-32 freq) 150.0) + (set! (-> v1-32 amplitude) 364.0889) + (set! (-> v1-32 y-decay-time) 450.0) + (set! (-> v1-32 y-freq) 150.0) + (set! (-> v1-32 y-amplitude) 3640.889) + ) + (let ((v1-34 (joint-node wascity-cactus-lod0-jg d))) + (set! (-> v1-34 param0) wascity-cactus-callback) + (set! (-> v1-34 param1) self) + (set! (-> v1-34 param2) (the-as basic 2)) + ) + (let ((v1-35 (-> self shakers 5))) + (set! (-> v1-35 axis quad) (-> gp-2 quad)) + (set! (-> v1-35 start-time) (+ (current-time) (seconds -0.4))) + (set! (-> v1-35 decay-time) 600.0) + (set! (-> v1-35 freq) 150.0) + (set! (-> v1-35 amplitude) 364.0889) + (set! (-> v1-35 y-decay-time) 450.0) + (set! (-> v1-35 y-freq) 150.0) + (set! (-> v1-35 y-amplitude) 3640.889) + ) + ) + (let ((v0-0 (the-as object (joint-node wascity-cactus-lod0-jg e)))) + (set! (-> (the-as cspace v0-0) param0) wascity-cactus-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 2)) + v0-0 + ) + ) + (else + (sound-play "cactus-burst") + (let ((gp-4 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-4 fountain-rand-transv-lo quad) (-> s5-0 root trans quad)) + (set! (-> gp-4 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-4 fountain-rand-transv-hi y) 122880.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-wascity-cactus-explode" (the-as (pointer level) #f)) + 7 + gp-4 + *wascity-cactus-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit #f + :code sleep-code + :post (behavior () + (dotimes (gp-0 6) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + ) + ) + +(defmethod wascity-cactus-method-30 ((this wascity-cactus)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 16384.0 0.0 28672.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod wascity-cactus-method-31 ((this wascity-cactus)) + (logior! (-> this mask) (process-mask crate)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this wascity-cactus) (arg0 entity-actor)) + (ctywide-entity-hack) + (wascity-cactus-method-30 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-cactus" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (wascity-cactus-method-31 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type none) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> this hit-points) 1.0) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (let ((f0-4 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) + ) + (transform-post) + (go (method-of-object this idle)) + ) + +(deftype wascity-market-crate (market-crate) + () + ) + + +(deftype wascity-market-basket-a (market-basket-a) + () + ) + + +(deftype wascity-market-basket-b (market-basket-b) + () + ) + + +(deftype wascity-market-sack-a (market-sack-a) + () + ) + + +(deftype wascity-market-sack-b (market-sack-b) + () + ) + + +(deftype wascity-fruit-stand (fruit-stand) + () + ) + + +(deftype wascity-water-pump (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defskelgroup skel-wascity-water-pump wascity-water-pump wascity-water-pump-lod0-jg wascity-water-pump-idle-ja + ((wascity-water-pump-lod0-mg (meters 20)) (wascity-water-pump-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(defstate idle (wascity-water-pump) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this wascity-water-pump) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable no-standon)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 10240.0 0.0 8192.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-10 transform-index) 8) + (set-vector! (-> v1-10 local-sphere) -8192.0 0.0 0.0 12288.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 1)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid rideable)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 49152.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-15 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-water-pump" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +(defskelgroup skel-wascity-awning-a wascity-awning-a wascity-awning-a-lod0-jg wascity-awning-a-idle-ja + ((wascity-awning-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2.5 5 10) + ) + +(deftype wascity-awning-a (bouncer) + () + ) + + +(defmethod play-sound ((this wascity-awning-a)) + (sound-play "tarp-bounce") + 0 + (none) + ) + +(defmethod bouncer-method-26 ((this wascity-awning-a)) + (sound-play "bounce-whoosh") + 0 + (none) + ) + +(defmethod bouncer-method-23 ((this wascity-awning-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +(defmethod bouncer-method-24 ((this wascity-awning-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 -16384.0 16384.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defskelgroup skel-wascity-awning-b wascity-awning-b wascity-awning-b-lod0-jg wascity-awning-b-idle-ja + ((wascity-awning-b-lod0-mg (meters 20)) (wascity-awning-b-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(deftype wascity-awning-b (bouncer) + () + ) + + +(defmethod play-sound ((this wascity-awning-b)) + (sound-play "tarp-bounce") + 0 + (none) + ) + +(defmethod bouncer-method-26 ((this wascity-awning-b)) + (sound-play "bounce-whoosh") + 0 + (none) + ) + +(defmethod bouncer-method-23 ((this wascity-awning-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +(defmethod bouncer-method-24 ((this wascity-awning-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defskelgroup skel-monk-npc monk monk-lod0-jg monk-standing-idle-1-ja + ((monk-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.2 0 1.6) + :shadow monk-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +(deftype monk-npc (process-taskable) + () + ) + + +(defmethod init-skeleton! ((this monk-npc)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-monk-npc" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (let* ((v1-8 (mod + (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + 6 + ) + ) + (s5-1 (cond + ((zero? v1-8) + 4171 + ) + ((= v1-8 1) + 8357 + ) + ((= v1-8 2) + #x4113 + ) + ((= v1-8 3) + #x8225 + ) + ((= v1-8 4) + #x10407 + ) + ((= v1-8 5) + #x20825 + ) + ) + ) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) s5-1 0) + ) + 0 + (none) + ) + +(defmethod get-art-element ((this monk-npc)) + (if (not (logtest? (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + 1 + ) + ) + (-> this draw art-group data 9) + (-> this draw art-group data 10) + ) + ) diff --git a/goal_src/jak3/levels/wascity/waswide-part.gc b/goal_src/jak3/levels/wascity/waswide-part.gc index c15e6d3d7b..16bd38261a 100644 --- a/goal_src/jak3/levels/wascity/waswide-part.gc +++ b/goal_src/jak3/levels/wascity/waswide-part.gc @@ -5,5 +5,4240 @@ ;; name in dgo: waswide-part ;; dgos: WWD +(define-extern *range-sat-explo-scene-color* curve-color-fast) +(define-extern *range-sat-explo-scene-alpha* curve2d-fast) +(define-extern *range-sat-explo-scene-scale-x* curve2d-fast) +(define-extern *range-sat-explo-scene-scale-y* curve2d-fast) +(define-extern *curve-sat-explo-scene-alpha* curve2d-fast) +(define-extern *curve-sat-explo-scene-scale-x* curve2d-fast) +(define-extern *curve-sat-explo-scene-scale-y* curve2d-fast) +(define-extern *part-neo-satellite-explosion-texture-scene-curve-settings* particle-curve-settings) +(define-extern *range-color-wascity-palace-fire-beacon-flame* curve-color-fast) +(define-extern *range-alpha-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *range-scale-wascity-palace-fire-beacon-flame-x* curve2d-fast) +(define-extern *range-scale-wascity-palace-fire-beacon-flame-y* curve2d-fast) +(define-extern *r-curve-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *g-curve-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *b-curve-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *curve-alpha-wascity-palace-fire-beacon-flame* curve2d-fast) +(define-extern *curve-wascity-palace-fire-beacon-flame-x* curve2d-fast) +(define-extern *curve-wascity-palace-fire-beacon-flame-y* curve2d-fast) +(define-extern *part-wascity-palace-fire-beacon-flame-curve-settings* particle-curve-settings) +(define-extern *range-wrsplash-color* curve-color-fast) +(define-extern *range-wrsplash-alpha* curve2d-fast) +(define-extern *range-wrsplash-scale-x* curve2d-fast) +(define-extern *range-wrsplash-scale-y* curve2d-fast) +(define-extern *curve-wrsplash-alpha* curve2d-fast) +(define-extern *curve-wrsplash-scale-x* curve2d-fast) +(define-extern *curve-wrsplash-scale-y* curve2d-fast) +(define-extern *part-water-rocks-splash-curve-settings* particle-curve-settings) +(define-extern *range-color-flame* curve-color-fast) +(define-extern *range-alpha-flame* curve2d-fast) +(define-extern *range-scale-flame-x* curve2d-fast) +(define-extern *range-scale-flame-y* curve2d-fast) +(define-extern *r-curve-flame* curve2d-fast) +(define-extern *g-curve-flame* curve2d-fast) +(define-extern *b-curve-flame* curve2d-fast) +(define-extern *curve-alpha-flame* curve2d-fast) +(define-extern *curve-flame-x* curve2d-fast) +(define-extern *curve-flame-y* curve2d-fast) +(define-extern *part-gas-lamp-flame-curve-settings* particle-curve-settings) +(define-extern *part-talltorch-flame-curve-settings* particle-curve-settings) + ;; DECOMP BEGINS +(defpartgroup group-wascity-pre-game-sat-sparks + :id 460 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1815 :flags (sp7)) (sp-item 1816 :flags (sp7))) + ) + +(defpart 1815 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.02) (meters 0.033333335)) + (:friction 0.96) + (:timer (seconds 0.5) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1816 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters -0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.53333336) (degrees 1.0666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.13)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + ) + ) + +(defpartgroup group-daxter-slide-dust + :id 461 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1817 :flags (sp7))) + ) + +(defpart 1817 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 32.0 32.0) + (:vel-y (meters 0) (meters 0.0013333333)) + (:scalevel-x (meters 0.001)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405c00 #x409b00)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-sat-scrape-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 120)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 25)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpartgroup group-sat-scrape-dust + :id 462 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1818 :flags (sp7))) + ) + +(defpart 1818 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 4.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 32.0 64.0) + (:vel-y (meters 0) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405c00 #x409b00)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-sat-scrape-dirt + :id 463 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1819 :flags (sp7)) (sp-item 1820 :flags (sp7))) + ) + +(defpart 1819 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-sat-scrape-dirt) + (:num 10.0) + (:x (meters 0) (meters 1)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406500 #x404a00)) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-sat-scrape-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-scrape-dirt arg0 arg1 arg2) + (none) + ) + +(defpart 1820 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-sat-scrape-rocks) + (:num 8.0) + (:x (meters 0) (meters 1)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-sat-scrape-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-sat-scrape-dirt arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-neo-satellite-buildup-scene + :id 464 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1821 :flags (is-3d sp7) :period (seconds 10) :length (seconds 1)) + (sp-item 1822 :flags (sp7) :period (seconds 10) :length (seconds 0.035)) + ) + ) + +(defpart 1821 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.2 0.2) + (:scale-x (meters 40) (meters 40)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0)) + (:r 128.0) + (:g 64.0) + (:b 255.0) + (:a 255.0) + (:scalevel-y (meters 0.033333335)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.167)) + (:next-launcher 1823) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1823 + :init-specs ((:scalevel-y (meters 0))) + ) + +(defpart 1822 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + (:func 'sparticle-track-root) + ) + ) + +(defpartgroup group-neo-satellite-explode-scene + :id 465 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1824 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1825 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1826 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 1827 :period (seconds 30) :length (seconds 0.167)) + (sp-item 1828 :period (seconds 30) :length (seconds 0.335)) + (sp-item 1829 :period (seconds 30) :length (seconds 0.667) :offset 300) + (sp-item 1830 :period (seconds 30) :length (seconds 0.117)) + ) + ) + +(defpart 1830 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 10.0) + (:y (meters -3.5) (meters 2)) + (:scale-x (meters 5)) + (:rot-x 4) + (:scale-y (meters 0.2) (meters 0.4)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 0.0675)) + (:vel-y (meters 0.26666668) (meters 0.33333334)) + (:fade-a -0.51 -0.51) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.9 0.08) + (:timer (seconds 1.5) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 140)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1829 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 10.0) + (:x (meters -5) (meters 10)) + (:y (meters -5) (meters 10)) + (:z (meters -5) (meters 10)) + (:scale-x (meters 0.05) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g 0.0 32.0) + (:b 255.0) + (:a 120.0 120.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0) (meters 0.01)) + (:fade-a -0.17 -0.1275) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017)) + (:next-launcher 1831) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1831 + :init-specs ((:accel-x (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-y (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-z (meters -0.0033333334) 1 (meters 0.006666667)) + (:next-time (seconds 0.067) (seconds 0.03)) + (:next-launcher 1831) + ) + ) + +(defpart 1824 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 0.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 1825 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 30.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.06666667) + (:fade-g -0.025) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.99) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1827 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 30.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.6666667) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.13333334) + (:fade-g -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.8) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1828 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -4) (meters 8)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.13333334) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-sat-explo-scene-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 32.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 64.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-sat-explo-scene-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-sat-explo-scene-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-sat-explo-scene-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sat-explo-scene-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sat-explo-scene-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 0.625 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-sat-explo-scene-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 0.625 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-neo-satellite-explosion-texture-scene-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.7) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 1828 init-specs 16 initial-valuef) + (the-as float *part-neo-satellite-explosion-texture-scene-curve-settings*) + ) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* color-start) + *range-sat-explo-scene-color* + ) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* alpha-start) + *range-sat-explo-scene-alpha* + ) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* scale-x-start) + *range-sat-explo-scene-scale-x* + ) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* scale-y-start) + *range-sat-explo-scene-scale-y* + ) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* r-scalar) #f) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* g-scalar) #f) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* b-scalar) #f) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* a-scalar) *curve-sat-explo-scene-alpha*) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* scale-x-scalar) + *curve-sat-explo-scene-scale-x* + ) + +(set! (-> *part-neo-satellite-explosion-texture-scene-curve-settings* scale-y-scalar) + *curve-sat-explo-scene-scale-y* + ) + +(defpart 1826 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 40.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-wascity-pre-game-crystal-glow + :id 466 + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1832 :flags (sp6 sp7))) + ) + +(defpart 1832 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.2 0.5) + (:x (meters -0.05) (meters 0.1)) + (:y (meters -0.05) (meters 0.1)) + (:z (meters -0.05) (meters 0.1)) + (:scale-x (meters 0.05) (meters 0.2)) + (:rot-x (degrees 0.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 2 128.0) + (:g 0.0 1 128.0) + (:b 255.0) + (:a 0.0) + (:vel-z (meters 0)) + (:fade-a 0.21333334 0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.4096) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.5) (seconds 0.497)) + (:next-launcher 1833) + ) + ) + +(defpart 1833 + :init-specs ((:fade-a -0.42666668)) + ) + +(defpartgroup group-wascity-pre-game-crystal-creation + :id 467 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1834 :flags (sp6 sp7)) + (sp-item 1835 :flags (sp6 sp7)) + (sp-item 1836 :flags (sp7)) + (sp-item 1837 :flags (sp7)) + ) + ) + +(defpart 1834 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4) (meters 0.3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 60.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 1835 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 0.0) + (:b 255.0) + (:a 60.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 1836 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g 32.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 0.5) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 1837 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 2.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters -0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.53333336) (degrees 1.0666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.13)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + ) + ) + +(defpartgroup group-wascity-pre-game-res-text + :id 468 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1838 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017)) + (sp-item 1839 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 5) + (sp-item 1840 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 10) + (sp-item 1841 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 15) + (sp-item 1842 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 20) + (sp-item 1843 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 20) + (sp-item 1844 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 15) + (sp-item 1845 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 10) + (sp-item 1846 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 5) + (sp-item 1847 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017)) + (sp-item 1848 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 5) + (sp-item 1849 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 10) + (sp-item 1850 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 15) + (sp-item 1851 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017) :offset 20) + (sp-item 1852 :flags (is-3d sp7) :period (seconds 0.335) :length (seconds 0.017)) + ) + ) + +(defpart 1838 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters -0.4)) + (:y (meters 0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1853 + :init-specs ((:a 16.0 64.0) (:next-time (seconds 0.017)) (:next-launcher 1853)) + ) + +(defpart 1839 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters -0.2)) + (:y (meters 0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1840 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1841 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters 0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1842 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.4)) + (:y (meters 0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1843 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters -0.4)) + (:y (meters 0)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1844 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters -0.2)) + (:y (meters 0)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1845 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1846 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters 0)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1847 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.4)) + (:y (meters 0)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1848 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters -0.4)) + (:y (meters -0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1849 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters -0.2)) + (:y (meters -0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1850 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0)) + (:y (meters -0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1851 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters -0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 1852 + :init-specs ((:texture (dp-text-01 wasseem-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0.4)) + (:y (meters -0.25)) + (:z (meters 0.02)) + (:scale-x (meters 0.2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 0 + 0 + #x7b700000 + #x7b700100 + #x7b700200 + #x7b700300 + #x7b700400 + #x7b700500 + #x7b700600 + #x7b700700 + #x7b700800 + #x7b700900 + #x7b700a00 + #x7b700b00 + #x7b700c00 + #x7b700d00 + #x7b700e00 + #x7b700f00 + ) + ) + (:next-time (seconds 0.017)) + (:next-launcher 1853) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-wasteland-scenes-leaper-dust + :id 469 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1854 :flags (sp7))) + ) + +(defpart 1854 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-z (degrees 90) (degrees 10)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 80.0) + (:b 60.0) + (:a 64.0) + (:vel-x (meters 0.016666668) (meters 0.016666668)) + (:vel-y (meters 0.006666667)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x409b00 #x405c00)) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-day-star-fma + :id 470 + :flags (sp1) + :bounds (static-bspherem 0 0 0 70) + :parts ((sp-item 1855 :flags (sp6)) (sp-item 1856 :flags (sp6))) + ) + +(defpart 1855 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 1125)) + (:rot-z (degrees 30)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:omega (degrees 0)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 12.0) + ) + ) + +(defpart 1856 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 1125)) + (:rot-z (degrees 30)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 0.0) + (:b 128.0) + (:a 64.0) + (:omega (degrees 0)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 13.0) + ) + ) + +(defpartgroup group-wascity-palace-fire-beacon + :id 471 + :flags (sp0 sp4 sp11) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1857 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + (sp-item 1858 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + (sp-item 1859 :fade-after (meters 10000) :falloff-to (meters 10000) :flags (sp7)) + ) + ) + +(defpart 1857 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 0.5) + (:y (meters 0)) + (:scale-x (meters 1)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:accel-y (meters 0.00066666666) (meters 0.00066666666)) + (:friction 0.99) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 130)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-color-wascity-palace-fire-beacon-flame* + (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-wascity-palace-fire-beacon-flame* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 96.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 159.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-wascity-palace-fire-beacon-flame-x* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 40.0 :y 56.0 :z 57.0 :w 58.0) + :one-over-x-deltas (new 'static 'vector :x 16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-wascity-palace-fire-beacon-flame-y* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 52.0 :y 60.0 :z 61.0 :w 62.0) + :one-over-x-deltas (new 'static 'vector :x 8.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-wascity-palace-fire-beacon-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-wascity-palace-fire-beacon-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -1.0 :z -2.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-wascity-palace-fire-beacon-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0) + :one-over-x-deltas (new 'static 'vector :y -5.0000005 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-wascity-palace-fire-beacon-flame* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :z 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :y 3.3333335 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wascity-palace-fire-beacon-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 0.3 :y 0.6 :z 0.5 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y -1.0 :z -0.75000006 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wascity-palace-fire-beacon-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 0.5 :w 0.6) + :one-over-x-deltas (new 'static 'vector :x 0.4 :y 0.5 :z 0.3333334 :w 1.0) + ) + ) + ) + +(define *part-wascity-palace-fire-beacon-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 2) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf1) + ) + ) + +(set! (-> *part-id-table* 1857 init-specs 16 initial-valuef) + (the-as float *part-wascity-palace-fire-beacon-flame-curve-settings*) + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* color-start) + *range-color-wascity-palace-fire-beacon-flame* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* alpha-start) + *range-alpha-wascity-palace-fire-beacon-flame* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* scale-x-start) + *range-scale-wascity-palace-fire-beacon-flame-x* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* scale-y-start) + *range-scale-wascity-palace-fire-beacon-flame-y* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* r-scalar) + *r-curve-wascity-palace-fire-beacon-flame* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* g-scalar) + *g-curve-wascity-palace-fire-beacon-flame* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* b-scalar) + *b-curve-wascity-palace-fire-beacon-flame* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* a-scalar) + *curve-alpha-wascity-palace-fire-beacon-flame* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* scale-x-scalar) + *curve-wascity-palace-fire-beacon-flame-x* + ) + +(set! (-> *part-wascity-palace-fire-beacon-flame-curve-settings* scale-y-scalar) + *curve-wascity-palace-fire-beacon-flame-y* + ) + +(defpart 1858 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.2) + (:y (meters 10)) + (:scale-x (meters 100) (meters 6)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 2250011.2)) + (:fade-a 0.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 4096.0) + (:next-time (seconds 0.5)) + (:next-launcher 1860) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1860 + :init-specs ((:fade-a -0.2)) + ) + +(defpart 1859 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.1) + (:x (meters -10) (meters 20)) + (:y (meters 20)) + (:z (meters -10) (meters 20)) + (:scale-x (meters 20) (meters 4)) + (:rot-z (degrees 160) (degrees 40)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 10.0) + (:a 0.0) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.13333334 0.13333334) + (:accel-y (meters 0.0013333333)) + (:friction 0.98) + (:timer (seconds 20)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:next-time (seconds 2)) + (:next-launcher 1861) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1861 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14222223) + (:fade-g 0.031111112) + (:fade-b 0.13111112) + (:fade-a -0.032) + (:next-time (seconds 2)) + (:next-launcher 1862) + ) + ) + +(defpart 1862 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:accel-y (meters 0.00066666666)) + ) + ) + +(defpartgroup group-waswide-chimney + :id 472 + :bounds (static-bspherem 0 0 -12 24) + :parts ((sp-item 1863 :fade-after (meters 200) :falloff-to (meters 300)) + (sp-item 1864 :fade-after (meters 200) :flags (sp6)) + ) + ) + +(defpart 1864 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 16) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 4518)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 6144.0) + ) + ) + +(defpart 1863 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters -0.00066666666) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 1865) + ) + ) + +(defpart 1865 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 1866)) + ) + +(defpart 1866 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 1867) + ) + ) + +(defpart 1867 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 1868) + ) + ) + +(defpart 1868 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-waswide-chimney-smoke + :id 473 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 1869 :fade-after (meters 600) :falloff-to (meters 700))) + ) + +(defpart 1869 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.05 0.08) + (:scale-x (meters 0.5) (meters 2)) + (:rot-z (degrees 0) (degrees 20)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 200.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees 0) (degrees -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-x (meters -0.00013333333) (meters -0.00013333333)) + (:accel-y (meters 0.000016666667) (meters 0.00006666667)) + (:friction 0.99) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 2)) + (:next-launcher 1870) + ) + ) + +(defpart 1870 + :init-specs ((:scalevel-x (meters 0.01)) (:fade-a -0.053333335 -0.053333335)) + ) + +(defpartgroup group-waswide-chimney-double-smoke + :id 474 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 1871 :fade-after (meters 600) :falloff-to (meters 700)) + (sp-item 1872 :fade-after (meters 600) :falloff-to (meters 700)) + ) + ) + +(defpart 1871 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.05 0.08) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 20)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 200.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees 0) (degrees -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-x (meters -0.00013333333) (meters -0.00013333333)) + (:accel-y (meters 0.000016666667) (meters 0.00006666667)) + (:friction 0.99) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 2)) + (:next-launcher 1873) + ) + ) + +(defpart 1873 + :init-specs ((:scalevel-x (meters 0.01)) (:fade-a -0.053333335 -0.053333335)) + ) + +(defpart 1872 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.05 0.08) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 20)) + (:scale-y (meters 1) (meters 1)) + (:r 200.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.00033333333) (meters 0.0016666667)) + (:rotvel-z (degrees 0) (degrees -0.033333335)) + (:fade-a 0.10666667) + (:accel-x (meters -0.00013333333) (meters -0.00013333333)) + (:accel-y (meters 0.000033333334) (meters 0.000016666667)) + (:friction 0.986) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 2)) + (:next-launcher 1874) + ) + ) + +(defpart 1874 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y (meters 0.001)) (:fade-a -0.053333335 -0.053333335)) + ) + +(defpartgroup group-waswide-chimney-long-smoke + :id 475 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 1875 :fade-after (meters 600) :falloff-to (meters 700))) + ) + +(defpart 1875 + :init-specs ((:texture (topglow level-default-sprite)) + (:num 0.05 0.08) + (:scale-x (meters 0.5) (meters 2)) + (:rot-z (degrees 0) (degrees 30)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 200.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees 0) (degrees -0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.053333335) + (:accel-x (meters -0.00013333333) (meters -0.00026666667)) + (:accel-y (meters 0.000016666667) (meters 0.00006666667)) + (:friction 0.99) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 4)) + (:next-launcher 1876) + ) + ) + +(defpart 1876 + :init-specs ((:scalevel-x (meters 0.01)) (:fade-a -0.035555556 -0.035555556)) + ) + +(defpartgroup group-waswide-chimney-small + :id 476 + :bounds (static-bspherem 0 0 -12 48) + :parts ((sp-item 1877 :fade-after (meters 300) :falloff-to (meters 350))) + ) + +(defpart 1877 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.00066666666) (meters -0.0002)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 1878) + ) + ) + +(defpart 1878 + :init-specs ((:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 1879) + ) + ) + +(defpart 1879 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-waswide-steamvent + :id 477 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1880 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7)) + (sp-item 1881 :fade-after (meters 10) :falloff-to (meters 15) :flags (sp7)) + ) + ) + +(defpart 1880 + :init-specs ((:birth-func 'birth-func-texture-group) + (:num 0.0 0.1) + (:z (meters 1)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-y (meters 0.0033333334)) + (:vel-z (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.42666668) + (:accel-x (meters 0.0001)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 1882) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1882 + :init-specs ((:fade-a -0.06095238 -0.06095238)) + ) + +(defpart 1881 + :init-specs ((:num 0.3) + (:x (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:rot-x 8) + (:r 2048.0) + (:g 1024.0) + (:b 860.16) + (:vel-y (meters 0.0033333334)) + (:vel-z (meters 0.0033333334) (meters 0.0033333334)) + (:accel-x (meters 0.0001)) + (:timer (seconds 2)) + (:flags (distort)) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + ) + ) + +(defpartgroup group-waswide-topdust + :id 478 + :flags (sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1883 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +(defpart 1883 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.2) + (:x (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 170.0) + (:g 150.0) + (:b 120.0) + (:a 0.0) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16666667 0.16666667) + (:accel-z (meters 0.006666667)) + (:friction 0.8 0.03) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 1884) + ) + ) + +(defpart 1884 + :init-specs ((:fade-a -0.071428575 -0.071428575)) + ) + +(defpartgroup group-waswide-pump + :id 479 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 1885 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7) :period (seconds 2) :length (seconds 1) :offset 200) + (sp-item 1886 :fade-after (meters 100) :falloff-to (meters 140) :flags (is-3d sp7) :period (seconds 2) :length (seconds 1.2) :offset 200) + (sp-item 1887 :falloff-to (meters 50) :flags (sp7) :period (seconds 2) :length (seconds 1.2) :offset 200) + (sp-item 1888 :fade-after (meters 100) :falloff-to (meters 200) :flags (is-3d sp7) :period (seconds 2) :length (seconds 1.2) :offset 425) + (sp-item 1889 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7) :period (seconds 2) :length (seconds 1.2) :offset 425) + ) + ) + +(defpart 1888 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 0)) + (:y (meters -1.5)) + (:z (meters 2.2)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 30.0) + (:g :copy r) + (:b :copy r) + (:a 128.0 64.0) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:next-time (seconds 0.167)) + (:next-launcher 1890) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1890 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.55) + (:next-time (seconds 0.085)) + (:next-launcher 1891) + ) + ) + +(defpart 1891 + :init-specs ((:scalevel-x (meters 0.0016666667) (meters 0.0016666667)) (:scalevel-y :copy scalevel-x)) + ) + +(defpart 1889 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.5) + (:x (meters -0.2) (meters 0.4)) + (:y (meters -1.5)) + (:z (meters 2) (meters 0.4)) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-y (meters -0.0016666667) (meters -0.0033333334)) + (:vel-z (meters 0) (meters 0.00066666666)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0.00016666666)) + (:friction 0.97) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1886 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0 2.0) + (:x (meters -0.05) (meters 0.1)) + (:y (meters -0.14)) + (:z (meters -0.14)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 160.0) + (:g 160.0) + (:b 160.0) + (:a 32.0 32.0) + (:vel-z (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y (meters 0.0016666667)) + (:accel-y (meters 0)) + (:timer (seconds 0.735)) + (:flags (sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406700 #x406700 #x406700 #x406600 #x406500)) + (:func 'sparticle-rotate-to-vel-3d) + (:next-time (seconds 0.335)) + (:next-launcher 1892) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1892 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:accel-y (meters -0.00066666666))) + ) + +(defpart 1885 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 0.4 0.8) + (:x (meters -0.1) (meters 0.2)) + (:y (meters -0.14)) + (:z (meters -0.14) (meters -0.1)) + (:scale-x (meters 0.1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-z (meters 0.01)) + (:scalevel-x (meters 0) (meters 0.001)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0)) + (:timer (seconds 0.735)) + (:flags (launch-along-z left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 1893) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1893 + :init-specs ((:accel-y (meters -0.0005) (meters -0.00033333333)) (:next-time (seconds 0.017)) (:next-launcher 1894)) + ) + +(defpart 1894 + :init-specs ((:a 128.0 128.0) (:next-time (seconds 0.017) (seconds 0.015)) (:next-launcher 1895)) + ) + +(defpart 1895 + :init-specs ((:a 0.0) (:next-time (seconds 0.05) (seconds 0.165)) (:next-launcher 1894)) + ) + +(defpart 1887 + :init-specs ((:num 0.4 0.8) + (:x (meters -0.1) (meters 0.2)) + (:y (meters -0.14)) + (:z (meters -0.14) (meters -0.1)) + (:rot-x 8) + (:r 614.4) + (:g 163.84 327.68) + (:b 327.68) + (:vel-z (meters 0.01)) + (:accel-y (meters 0)) + (:timer (seconds 0.735)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.335)) + (:next-launcher 1896) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1896 + :init-specs ((:accel-y (meters -0.00066666666))) + ) + +(defpartgroup group-part-water-rocks-splash + :id 480 + :duration (seconds 1) + :linger-duration (seconds 6) + :flags (sp0 sp9) + :bounds (static-bspherem 0 0 0 600) + :parts ((sp-item 1897 :fade-after (meters 300) :falloff-to (meters 300) :period (seconds 60) :length (seconds 0.2)) + (sp-item 1898 :fade-after (meters 300) :falloff-to (meters 300) :flags (is-3d) :period (seconds 60) :length (seconds 0.035) :offset 150) + (sp-item 1899 :fade-after (meters 300) :falloff-to (meters 300) :period (seconds 60) :length (seconds 0.2) :offset 20) + ) + ) + +(defpart 1897 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 3.0) + (:y (meters -3)) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:vel-z (meters 0.016666668) (meters 0.016666668)) + (:accel-y (meters -0.0011666666)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-wrsplash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 90.0 :y 130.0 :z 110.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wrsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 127.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wrsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 6.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wrsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.9 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 6.0 :y 30.0 :z 40.0 :w 41.0) + :one-over-x-deltas (new 'static 'vector :x 26.666668 :y 99.99998 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wrsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wrsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wrsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -0.3 :w -1.0) + :ys (new 'static 'vector :y 2.5 :z 4.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 12.5 :y 14.999999 :w 1.0) + ) + ) + ) + +(define *part-water-rocks-splash-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 1.5) :lifetime-offset (seconds 1)) + ) + +(set! (-> *part-id-table* 1897 init-specs 16 initial-valuef) + (the-as float *part-water-rocks-splash-curve-settings*) + ) + +(set! (-> *part-water-rocks-splash-curve-settings* color-start) *range-wrsplash-color*) + +(set! (-> *part-water-rocks-splash-curve-settings* alpha-start) *range-wrsplash-alpha*) + +(set! (-> *part-water-rocks-splash-curve-settings* scale-x-start) *range-wrsplash-scale-x*) + +(set! (-> *part-water-rocks-splash-curve-settings* scale-y-start) *range-wrsplash-scale-y*) + +(set! (-> *part-water-rocks-splash-curve-settings* r-scalar) #f) + +(set! (-> *part-water-rocks-splash-curve-settings* g-scalar) #f) + +(set! (-> *part-water-rocks-splash-curve-settings* b-scalar) #f) + +(set! (-> *part-water-rocks-splash-curve-settings* a-scalar) *curve-wrsplash-alpha*) + +(set! (-> *part-water-rocks-splash-curve-settings* scale-x-scalar) *curve-wrsplash-scale-x*) + +(set! (-> *part-water-rocks-splash-curve-settings* scale-y-scalar) #f) + +(defpart 1898 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 4)) + (:y (meters 1.5)) + (:scale-x (meters 5) (meters 3)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 5) (meters 3)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:scalevel-y (meters 0.033333335) (meters 0.016666668)) + (:fade-a -0.21333334) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 1899 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 3.0) + (:x (meters 0) (meters 1)) + (:y (meters 5)) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.01) (meters 0.0033333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064 -0.064) + (:accel-y (meters -0.0011666666)) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:func 'check-drop-group-center) + (:conerot-x (degrees -15) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-part-water-wave-foam + :id 481 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 400) + :parts ((sp-item 1901 :flags (is-3d sp7) :period (seconds 6) :length (seconds 0.067) :binding 1900) + (sp-item 1900 :flags (is-3d sp2) :period (seconds 6) :length (seconds 1) :offset 25) + ) + ) + +(defpart 1901 + :init-specs ((:texture (wave-foam wascityb-sprite)) + (:num 1.0) + (:x (meters -20) (meters 40)) + (:y (meters 3)) + (:z (meters -20)) + (:scale-x (meters 10) (meters 10)) + (:scale-y (meters 1) (meters 3)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters 0.001)) + (:vel-z (meters 0.06666667) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y (meters 0.026666667) (meters 0.013333334)) + (:fade-a 0.064) + (:accel-z (meters -0.0005) (meters -0.00006666667)) + (:friction 0.99) + (:timer (seconds 6.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 2.5)) + (:next-launcher 1902) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1902 + :init-specs ((:fade-a -0.1024 -0.1024)) + ) + +(defpart 1900 + :init-specs ((:texture (water-froth wascityb-sprite)) + (:num 0.1) + (:x (meters -20) (meters 40)) + (:scale-x (meters 20)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-z (meters -0.000033333334)) + (:fade-a 0.42666668) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-turn-to-vel) + (:next-time (seconds 0.5)) + (:next-launcher 1903) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1903 + :init-specs ((:scalevel-y (meters 0.033333335)) (:fade-a 0.0) (:next-time (seconds 1)) (:next-launcher 1904)) + ) + +(defpart 1904 + :init-specs ((:accel-z (meters -0.001)) (:next-time (seconds 0.335)) (:next-launcher 1905)) + ) + +(defpart 1905 + :init-specs ((:fade-a -0.32 -0.32)) + ) + +(defpartgroup group-part-wascityb-birds + :id 482 + :bounds (static-bspherem 0 0 0 600) + :parts ((sp-item 1906 :flags (sp3)) + (sp-item 1907 :flags (sp3)) + (sp-item 1908 :flags (sp3)) + (sp-item 1909 :flags (sp3)) + (sp-item 1910 :flags (sp3)) + (sp-item 1911 :flags (sp3)) + (sp-item 1912 :flags (sp3)) + (sp-item 1913 :flags (sp3)) + (sp-item 1914 :flags (sp3)) + (sp-item 1915 :flags (sp3)) + ) + ) + +(defpart 1906 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b301f00 + #x3b302000 + #x3b302100 + #x3b302200 + #x3b302300 + #x3b302400 + #x3b302500 + #x3b302600 + #x3b302700 + #x3b302800 + #x3b302900 + #x3b302a00 + #x3b302b00 + ) + ) + (:func 'part-wascityb-bird1-path) + ) + ) + +(defun part-wascityb-bird1-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1906 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) 0.57735026) + (set! (-> s3-0 y) 0.57735026) + (set! (-> s3-0 z) 0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) 1.1547005) + (set! (-> v1-11 y) 1.7320508) + (set! (-> v1-11 z) 2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 8192.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1906) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1907 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.6)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301f00 + #x3b302000 + #x3b302200 + #x3b302300 + #x3b302500 + #x3b302600 + #x3b302800 + #x3b302900 + #x3b302b00 + ) + ) + (:func 'part-wascityb-bird2-path) + ) + ) + +(defun part-wascityb-bird2-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1907 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) 0.0) + (set! (-> s2-0 y) 1.0) + (set! (-> s2-0 z) 0.0) + (set! (-> s2-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-9 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-9 x) 2.0) + (set! (-> v1-9 y) 0.0) + (set! (-> v1-9 z) 0.0) + (set! (-> v1-9 w) 1.0) + (let ((s3-1 + (vector-cross! (new 'stack-no-clear 'vector) s2-0 (vector-cross! (new 'stack-no-clear 'vector) s2-0 v1-9)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s3-1 32768.0) + (vector-rotate-around-axis! s3-1 (the-as quaternion s3-1) f28-0 s2-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1907) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-10 (-> arg1 key)) + (v1-16 (-> a0-10 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-10 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) + (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) + (set! (-> arg2 z) (+ (-> v1-16 z) (-> s3-1 z))) + 0.0 + (let ((a0-14 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-17 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-14 s5-1))) + (vector-float*! v1-17 a0-14 f0-22) + ) + (vector-! s5-1 s5-1 v1-17) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1908 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.7)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 120.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b302000 + #x3b302100 + #x3b302200 + #x3b302400 + #x3b302500 + #x3b302600 + #x3b302800 + #x3b302900 + #x3b302a00 + ) + ) + (:func 'part-wascityb-bird3-path) + ) + ) + +(defun part-wascityb-bird3-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1908 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) -0.57735026) + (set! (-> s3-0 y) 0.57735026) + (set! (-> s3-0 z) -0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) 1.1547005) + (set! (-> v1-11 y) -1.7320508) + (set! (-> v1-11 z) -2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 20480.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1908) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1909 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.8)) + (:scale-y :copy scale-x) + (:r 90.0) + (:g 90.0) + (:b 90.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b301f00 + #x3b302000 + #x3b302100 + #x3b302200 + #x3b302300 + #x3b302400 + #x3b302500 + #x3b302600 + #x3b302700 + #x3b302800 + #x3b302900 + #x3b302a00 + #x3b302b00 + ) + ) + (:func 'part-wascityb-bird4-path) + ) + ) + +(defun part-wascityb-bird4-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1909 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) -0.57735026) + (set! (-> s3-0 y) -0.57735026) + (set! (-> s3-0 z) -0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) -1.1547005) + (set! (-> v1-11 y) -1.7320508) + (set! (-> v1-11 z) -2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 16384.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1909) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1910 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.9)) + (:scale-y :copy scale-x) + (:r 110.0) + (:g 110.0) + (:b 110.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b301f00 + #x3b302100 + #x3b302200 + #x3b302300 + #x3b302400 + #x3b302600 + #x3b302700 + #x3b302800 + #x3b302900 + #x3b302b00 + ) + ) + (:func 'part-wascityb-bird5-path) + ) + ) + +(defun part-wascityb-bird5-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1910 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) -1.0) + (set! (-> s2-0 y) 0.0) + (set! (-> s2-0 z) 0.0) + (set! (-> s2-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-9 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-9 x) 0.0) + (set! (-> v1-9 y) 0.0) + (set! (-> v1-9 z) -4.0) + (set! (-> v1-9 w) 1.0) + (let ((s3-1 + (vector-cross! (new 'stack-no-clear 'vector) s2-0 (vector-cross! (new 'stack-no-clear 'vector) s2-0 v1-9)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s3-1 24576.0) + (vector-rotate-around-axis! s3-1 (the-as quaternion s3-1) f28-0 s2-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1910) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-10 (-> arg1 key)) + (v1-16 (-> a0-10 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-10 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) + (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) + (set! (-> arg2 z) (+ (-> v1-16 z) (-> s3-1 z))) + 0.0 + (let ((a0-14 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-17 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-14 s5-1))) + (vector-float*! v1-17 a0-14 f0-22) + ) + (vector-! s5-1 s5-1 v1-17) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1911 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b301f00 + #x3b302000 + #x3b302100 + #x3b302200 + #x3b302300 + #x3b302400 + #x3b302500 + #x3b302600 + #x3b302700 + #x3b302800 + #x3b302900 + #x3b302a00 + #x3b302b00 + ) + ) + (:func 'part-wascityb-bird6-path) + ) + ) + +(defun part-wascityb-bird6-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1911 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) -0.57735026) + (set! (-> s3-0 y) -0.57735026) + (set! (-> s3-0 z) -0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) -1.1547005) + (set! (-> v1-11 y) -1.7320508) + (set! (-> v1-11 z) -2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 10240.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1911) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1912 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.6)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301f00 + #x3b302000 + #x3b302200 + #x3b302300 + #x3b302500 + #x3b302600 + #x3b302800 + #x3b302900 + #x3b302b00 + ) + ) + (:func 'part-wascityb-bird7-path) + ) + ) + +(defun part-wascityb-bird7-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1912 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) 0.0) + (set! (-> s2-0 y) -1.0) + (set! (-> s2-0 z) 0.0) + (set! (-> s2-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-9 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-9 x) -2.0) + (set! (-> v1-9 y) 0.0) + (set! (-> v1-9 z) 0.0) + (set! (-> v1-9 w) 1.0) + (let ((s3-1 + (vector-cross! (new 'stack-no-clear 'vector) s2-0 (vector-cross! (new 'stack-no-clear 'vector) s2-0 v1-9)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s3-1 34816.0) + (vector-rotate-around-axis! s3-1 (the-as quaternion s3-1) f28-0 s2-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1912) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-10 (-> arg1 key)) + (v1-16 (-> a0-10 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-10 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) + (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) + (set! (-> arg2 z) (+ (-> v1-16 z) (-> s3-1 z))) + 0.0 + (let ((a0-14 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-17 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-14 s5-1))) + (vector-float*! v1-17 a0-14 f0-22) + ) + (vector-! s5-1 s5-1 v1-17) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1913 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.7)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 120.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b301f00 + #x3b302000 + #x3b302100 + #x3b302200 + #x3b302400 + #x3b302500 + #x3b302600 + #x3b302700 + #x3b302800 + #x3b302900 + #x3b302a00 + ) + ) + (:func 'part-wascityb-bird8-path) + ) + ) + +(defun part-wascityb-bird8-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1913 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) 0.57735026) + (set! (-> s3-0 y) -0.57735026) + (set! (-> s3-0 z) 0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) -1.1547005) + (set! (-> v1-11 y) 1.7320508) + (set! (-> v1-11 z) 2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 22528.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1913) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1914 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.8)) + (:scale-y :copy scale-x) + (:r 90.0) + (:g 90.0) + (:b 90.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b301f00 + #x3b302000 + #x3b302100 + #x3b302200 + #x3b302300 + #x3b302400 + #x3b302500 + #x3b302600 + #x3b302700 + #x3b302800 + #x3b302900 + #x3b302a00 + #x3b302b00 + ) + ) + (:func 'part-wascityb-bird9-path) + ) + ) + +(defun part-wascityb-bird9-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1914 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) 0.57735026) + (set! (-> s3-0 y) 0.57735026) + (set! (-> s3-0 z) 0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) 1.1547005) + (set! (-> v1-11 y) 1.7320508) + (set! (-> v1-11 z) 2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 18432.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1914) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1915 + :init-specs ((:texture (flying-bird-01 wascityb-sprite)) + (:num 1.0) + (:scale-x (meters 2.9)) + (:scale-y :copy scale-x) + (:r 110.0) + (:g 110.0) + (:b 110.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 5 + 1 + 0 + #x3b301c00 + #x3b301d00 + #x3b301e00 + #x3b302000 + #x3b302100 + #x3b302200 + #x3b302400 + #x3b302500 + #x3b302600 + #x3b302800 + #x3b302900 + #x3b302a00 + ) + ) + (:func 'part-wascityb-bird10-path) + ) + ) + +(defun part-wascityb-bird10-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1915 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) 1.0) + (set! (-> s2-0 y) 0.0) + (set! (-> s2-0 z) 0.0) + (set! (-> s2-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-9 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-9 x) 0.0) + (set! (-> v1-9 y) 0.0) + (set! (-> v1-9 z) 4.0) + (set! (-> v1-9 w) 1.0) + (let ((s3-1 + (vector-cross! (new 'stack-no-clear 'vector) s2-0 (vector-cross! (new 'stack-no-clear 'vector) s2-0 v1-9)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s3-1 26624.0) + (vector-rotate-around-axis! s3-1 (the-as quaternion s3-1) f28-0 s2-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1915) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-10 (-> arg1 key)) + (v1-16 (-> a0-10 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-10 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) + (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) + (set! (-> arg2 z) (+ (-> v1-16 z) (-> s3-1 z))) + 0.0 + (let ((a0-14 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-17 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-14 s5-1))) + (vector-float*! v1-17 a0-14 f0-22) + ) + (vector-! s5-1 s5-1 v1-17) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpartgroup group-part-wascitya-flies + :id 483 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1916 :flags (sp3 sp6)) (sp-item 1917 :flags (sp3 sp6)) (sp-item 1918 :flags (sp3 sp6))) + ) + +(defpart 1916 + :init-specs ((:texture (shell-casing-03 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 20.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:func 'part-wascitya-fly1-path) + ) + ) + +(defun part-wascitya-fly1-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1916 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) 0.57735026) + (set! (-> s3-0 y) 0.57735026) + (set! (-> s3-0 z) 0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) 1.1547005) + (set! (-> v1-11 y) 1.7320508) + (set! (-> v1-11 z) 2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 409.6) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1916) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1917 + :init-specs ((:texture (shell-casing-03 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 20.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:func 'part-wascitya-fly2-path) + ) + ) + +(defun part-wascitya-fly2-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1917 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) 0.0) + (set! (-> s2-0 y) 1.0) + (set! (-> s2-0 z) 0.0) + (set! (-> s2-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-9 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-9 x) 2.0) + (set! (-> v1-9 y) 0.0) + (set! (-> v1-9 z) 0.0) + (set! (-> v1-9 w) 1.0) + (let ((s3-1 + (vector-cross! (new 'stack-no-clear 'vector) s2-0 (vector-cross! (new 'stack-no-clear 'vector) s2-0 v1-9)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s3-1 4096.0) + (vector-rotate-around-axis! s3-1 (the-as quaternion s3-1) f28-0 s2-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1917) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-10 (-> arg1 key)) + (v1-16 (-> a0-10 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-10 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) + (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) + (set! (-> arg2 z) (+ (-> v1-16 z) (-> s3-1 z))) + 0.0 + (let ((a0-14 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-17 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-14 s5-1))) + (vector-float*! v1-17 a0-14 f0-22) + ) + (vector-! s5-1 s5-1 v1-17) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpart 1918 + :init-specs ((:texture (shell-casing-03 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.22)) + (:scale-y :copy scale-x) + (:r 20.0) + (:g 20.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 3.2958984) (degrees 6.591797)) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-13)) + (:func 'part-wascitya-fly3-path) + ) + ) + +(defun part-wascitya-fly3-path ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-texture-animate arg0 arg1 arg2) + (let ((f30-0 + (/ (the float + (- (the-as int (-> *part-id-table* 1918 init-specs 9 initial-valuef)) (the-as uint (-> arg1 timer))) + ) + (-> arg1 omega) + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 x) -0.57735026) + (set! (-> s3-0 y) 0.57735026) + (set! (-> s3-0 z) -0.57735026) + (set! (-> s3-0 w) 1.0) + (let ((f28-0 (* 182.04445 (* 360.0 f30-0))) + (v1-11 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-11 x) 1.1547005) + (set! (-> v1-11 y) -1.7320508) + (set! (-> v1-11 z) -2.309401) + (set! (-> v1-11 w) 1.0) + (let ((s2-1 + (vector-cross! (new 'stack-no-clear 'vector) s3-0 (vector-cross! (new 'stack-no-clear 'vector) s3-0 v1-11)) + ) + ) + (set! (-> arg1 rot-syvel quad) (the-as uint128 0)) + (vector-normalize! s2-1 6144.0) + (vector-rotate-around-axis! s2-1 (the-as quaternion s2-1) f28-0 s3-0) + (cond + ((< 1.0 f30-0) + (sp-kill-particle arg0 arg1) + (sp-relaunch-particle-2d arg0 (-> *part-id-table* 1918) arg1 (the-as sprite-vec-data-2d arg2)) + ) + (else + (let* ((a0-12 (-> arg1 key)) + (v1-18 (-> a0-12 proc root trans)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> (the-as part-spawner (-> a0-12 proc)) last-velocity quad)) + 0.0 + (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) + (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) + (set! (-> arg2 z) (+ (-> v1-18 z) (-> s2-1 z))) + 0.0 + (let ((a0-16 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-19 (new 'stack-no-clear 'vector))) + (let ((f0-22 (vector-dot a0-16 s5-1))) + (vector-float*! v1-19 a0-16 f0-22) + ) + (vector-! s5-1 s5-1 v1-19) + ) + ) + (let ((a2-7 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-1 s5-1 a2-7) + (let ((f0-30 (the float (sar (shl (the int (atan (-> s5-1 y) (* -1.0 (-> s5-1 x)))) 48) 48)))) + (rot-to-particle f0-30 (the-as sprite-vec-data-2d arg2) a2-7) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defpartgroup group-waswide-gaslamp + :id 484 + :flags (sp4 sp11) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1919 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1920 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1921 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1922 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1923 :fade-after (meters 20) :falloff-to (meters 30) :flags (sp7)) + ) + ) + +(defpart 1919 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:z (meters 0.4)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-z (meters -0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters -0.016666668)) + (:accel-x (meters -0.001)) + (:accel-z (meters 0.0013333333) (meters 0.0013333333)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0)) + (:conerot-y (degrees 0)) + ) + ) + +(if #t + (set! *range-color-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 96.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 159.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 4.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -1.0 :z -2.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0) + :one-over-x-deltas (new 'static 'vector :y -5.0000005 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.01 :y 0.01 :z 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :y 3.3000002 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 0.3 :y 0.6 :z 0.5 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y -1.0 :z -0.75000006 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 0.5 :w 0.6) + :one-over-x-deltas (new 'static 'vector :x 0.4 :y 0.5 :z 0.3333334 :w 1.0) + ) + ) + ) + +(define *part-gas-lamp-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.3) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +(set! (-> *part-id-table* 1919 init-specs 17 initial-valuef) + (the-as float *part-gas-lamp-flame-curve-settings*) + ) + +(set! (-> *part-gas-lamp-flame-curve-settings* color-start) *range-color-flame*) + +(set! (-> *part-gas-lamp-flame-curve-settings* alpha-start) *range-alpha-flame*) + +(set! (-> *part-gas-lamp-flame-curve-settings* scale-x-start) *range-scale-flame-x*) + +(set! (-> *part-gas-lamp-flame-curve-settings* scale-y-start) *range-scale-flame-y*) + +(set! (-> *part-gas-lamp-flame-curve-settings* r-scalar) *r-curve-flame*) + +(set! (-> *part-gas-lamp-flame-curve-settings* g-scalar) *g-curve-flame*) + +(set! (-> *part-gas-lamp-flame-curve-settings* b-scalar) *b-curve-flame*) + +(set! (-> *part-gas-lamp-flame-curve-settings* a-scalar) *curve-alpha-flame*) + +(set! (-> *part-gas-lamp-flame-curve-settings* scale-x-scalar) *curve-flame-x*) + +(set! (-> *part-gas-lamp-flame-curve-settings* scale-y-scalar) *curve-flame-y*) + +(defpart 1920 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters -0.3) (meters 0.6)) + (:z (meters 0.3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 10.0 20.0) + (:g 10.0 20.0) + (:b 200.0) + (:a 64.0) + (:scalevel-x (meters -0.00033333333)) + (:fade-a -0.64) + (:accel-x (meters -0.001)) + (:accel-z (meters 0.0013333333) (meters 0.0013333333)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1921 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.4) + (:x (meters -1)) + (:z (meters 2.5)) + (:scale-x (meters 12) (meters 6)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 8.0 4.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1922 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 0.01 0.05) + (:scale-x (meters 0.3) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 8.0) + (:a 255.0) + (:vel-z (meters 0.06666667) (meters 0.016666668)) + (:fade-g -0.16666667) + (:fade-b -5.0) + (:fade-a -1.7) + (:accel-x (meters 0.0016666667)) + (:friction 0.95) + (:timer (seconds 2) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees -40)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 1923 + :init-specs ((:num 0.2) + (:x (meters 0) (meters 2)) + (:y (meters -0.5) (meters 1)) + (:z (meters 6)) + (:rot-x 8) + (:r 8192.0) + (:g 1228.8) + (:b 1024.0) + (:accel-x (meters 0.001)) + (:accel-z (meters 0.0016666667)) + (:timer (seconds 0.335)) + (:flags (distort)) + (:rotate-y (degrees -30)) + ) + ) + +(defpartgroup group-waswide-talltorch + :id 485 + :flags (sp4) + :bounds (static-bspherem 0 0 -12 40) + :parts ((sp-item 1924 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1925 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1926 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + ) + ) + +(defpart 1924 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:z (meters 0.4)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-z (meters -0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters -0.016666668)) + (:accel-x (meters -0.001)) + (:accel-z (meters 0.0013333333) (meters 0.0013333333)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0)) + (:conerot-y (degrees 0)) + ) + ) + +(define *part-talltorch-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.3) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +(set! (-> *part-id-table* 1924 init-specs 17 initial-valuef) + (the-as float *part-talltorch-flame-curve-settings*) + ) + +(set! (-> *part-talltorch-flame-curve-settings* color-start) *range-color-flame*) + +(set! (-> *part-talltorch-flame-curve-settings* alpha-start) *range-alpha-flame*) + +(set! (-> *part-talltorch-flame-curve-settings* scale-x-start) *range-scale-flame-x*) + +(set! (-> *part-talltorch-flame-curve-settings* scale-y-start) *range-scale-flame-y*) + +(set! (-> *part-talltorch-flame-curve-settings* r-scalar) *r-curve-flame*) + +(set! (-> *part-talltorch-flame-curve-settings* g-scalar) *g-curve-flame*) + +(set! (-> *part-talltorch-flame-curve-settings* b-scalar) *b-curve-flame*) + +(set! (-> *part-talltorch-flame-curve-settings* a-scalar) *curve-alpha-flame*) + +(set! (-> *part-talltorch-flame-curve-settings* scale-x-scalar) *curve-flame-x*) + +(set! (-> *part-talltorch-flame-curve-settings* scale-y-scalar) *curve-flame-y*) + +(defpart 1925 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.4) + (:x (meters -1)) + (:z (meters 2.5)) + (:scale-x (meters 12) (meters 6)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3599)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 8.0 4.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1926 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 0.01 0.05) + (:scale-x (meters 0.3) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 8.0) + (:a 255.0) + (:vel-z (meters 0.06666667) (meters 0.016666668)) + (:fade-g -0.16666667) + (:fade-b -5.0) + (:fade-a -1.7) + (:accel-x (meters 0.0016666667)) + (:friction 0.95) + (:timer (seconds 2) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees -40)) + (:rotate-z (degrees 0)) + ) + ) diff --git a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc index e04136aa84..0052306f32 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc @@ -115,7 +115,7 @@ (gem-seg uint32) (gem-no-seg uint32) (gem-offset sphere :inline) - (knocked-off basic) + (knocked-off symbol) ) (:methods (copy-enemy-info! (_type_ _type_) none) @@ -466,7 +466,7 @@ (enemy-method-88 (_type_ enemy-knocked-info) symbol) (within-gspot-range? (_type_) symbol) (enemy-method-90 (_type_ ragdoll-proc) none) - (enemy-method-91 (_type_) symbol) + (enemy-method-91 (_type_ enemy-jump-info) object) (init-jump-info! (_type_ enemy-jump-info) none) (setup-jump! (_type_ enemy-jump-info) none) (move-to-gspot! (_type_) float) @@ -476,14 +476,14 @@ (jump-wind-up-anim (_type_ enemy-jump-info) symbol) (jump-anim-handler (_type_ int enemy-jump-info) symbol) (in-jump-handler (_type_ int enemy-jump-info) none) - (enemy-method-101 (_type_) none) + (enemy-method-101 (_type_ int enemy-jump-info) none) (go-directed2 (_type_) object) (enemy-method-103 (_type_ vector float) symbol) (enemy-method-104 (_type_ vector float) symbol) (enemy-method-105 (_type_ float symbol) symbol) (find-best-focus (_type_) process) - (enemy-method-107 (_type_) symbol) - (enemy-method-108 (_type_) symbol) + (is-pfoc-in-mesh? (_type_ process-focusable vector) symbol) + (enemy-method-108 (_type_ process-focusable) symbol) (enemy-method-109 (_type_) symbol) (send-attack (_type_ process touching-shapes-entry uint) symbol) (on-attack (_type_ process-focusable) none) @@ -756,3 +756,7 @@ (logclear! (-> this flags) (enemy-flag look-at-focus)) (none) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc index 77836a2f6c..4ec5016615 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc @@ -1342,12 +1342,12 @@ ) ;; definition for method 107 of type enemy -(defmethod enemy-method-107 ((this enemy)) +(defmethod is-pfoc-in-mesh? ((this enemy) (arg0 process-focusable) (arg1 vector)) #t ) ;; definition for method 108 of type enemy -(defmethod enemy-method-108 ((this enemy)) +(defmethod enemy-method-108 ((this enemy) (arg0 process-focusable)) #f ) @@ -1521,11 +1521,7 @@ (cond ((< f30-0 (-> this enemy-info proximity-notice-distance)) (set! s3-1 #t) - (let* ((a0-3 this) - (t9-2 (method-of-object a0-3 enemy-method-107)) - ) - (set! s2-0 (t9-2 a0-3)) - ) + (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) ) (else (let ((f0-1 (the-as float (-> this enemy-info notice-distance)))) @@ -1533,11 +1529,7 @@ (set! f0-1 (+ (the-as meters f0-1) (-> this enemy-info notice-distance-delta))) ) (when (or (< f30-0 f0-1) (not (logtest? (-> this enemy-flags) (enemy-flag use-notice-distance)))) - (let* ((a0-7 this) - (t9-3 (method-of-object a0-7 enemy-method-107)) - ) - (set! s2-0 (t9-3 a0-7)) - ) + (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) ) @@ -1548,7 +1540,7 @@ (let ((aware (cond (s3-1 (cond - ((enemy-method-108 this) + ((enemy-method-108 this arg0) (the-as enemy-aware (enemy-aware ea4)) ) (s2-0 @@ -2429,7 +2421,8 @@ ) ;; definition for method 91 of type enemy -(defmethod enemy-method-91 ((this enemy)) +;; WARN: Return type mismatch symbol vs object. +(defmethod enemy-method-91 ((this enemy) (arg0 enemy-jump-info)) #f ) @@ -2486,7 +2479,7 @@ ;; definition for method 101 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-101 ((this enemy)) +(defmethod enemy-method-101 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) 0 (none) ) diff --git a/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc b/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc index 6a3138c0d5..281c304ccf 100644 --- a/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc @@ -124,7 +124,7 @@ (vehicle-level basic) (race-vehicle-level basic) (traffic-object-levels level 29) - (vehicle-levels level 44) + (vehicle-levels symbol 44) (traffic-object-type-from-vehicle-type traffic-type 44) (restore-speech-callback basic) ) diff --git a/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc b/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc index 1df3e0147f..d8bea7cb2e 100644 --- a/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc @@ -279,10 +279,7 @@ ) (cond (a0-33 - (let ((t9-10 (method-of-object a0-33 nav-mesh-method-31))) - self - (t9-10) - ) + (add-process-drawable-to-nav-mesh a0-33 self #f) ) (else (format 0 "ERROR: fma-sphere-init-by-other: failed to find nearest nav-mesh!~%") diff --git a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc index 03b43925bf..b84f5ccb70 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc @@ -2492,21 +2492,13 @@ ;; definition for function clmf-cam-string ;; INFO: Used lq/sq (defbehavior clmf-cam-string cam-layout ((arg0 string) (arg1 symbol)) - (local-vars (r0-0 uint128) (v1-5 uint128) (sv-16 int)) + (local-vars (sv-16 res-tag)) (format arg0 ":") - (set! sv-16 0) - (let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (set! sv-16 (new 'static 'res-tag)) + (let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (& sv-16)))) (when s5-1 - (let ((s4-0 0)) - (while (begin - (let ((v1-4 (the-as uint128 sv-16))) - (.pcpyud v1-5 v1-4 r0-0) - ) - (< s4-0 (shr (* (the-as int v1-5) 2) 49)) - ) - (format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4))))) - (+! s4-0 1) - ) + (dotimes (s4-0 (the-as int (-> sv-16 elt-count))) + (format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4))))) ) ) ) @@ -3721,3 +3713,7 @@ (cam-layout-stop) (cam-layout-start) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc index 4dcb3ff213..aa64875bcd 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc @@ -1385,7 +1385,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ((actor-hash-index int16 :offset 12) (process process-drawable) (max-iteration-count uint8) - (nav-flags uint8) + (nav-flags nav-flags) (total-prims uint8) (num-riders uint8) (pat-ignore-mask pat-surface) @@ -1651,7 +1651,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (set! (-> s5-0 actor-hash-index) -1) (set! (-> s5-0 process) arg0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> s5-0 nav-flags) (the-as uint 1)) + (set! (-> s5-0 nav-flags) (nav-flags has-root-sphere)) (set! (-> s5-0 event-self) #f) (set! (-> s5-0 event-other) #f) (set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f)) diff --git a/test/decompiler/reference/jak3/engine/common-obs/basebutton_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/basebutton_REF.gc new file mode 100644 index 0000000000..877fc1f3b8 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/basebutton_REF.gc @@ -0,0 +1,489 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type basebutton +(deftype basebutton (process-focusable) + ((button-status button-status) + (notify-actor entity) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (timeout float) + (button-id int32) + (event-going-down symbol) + (event-down symbol) + (event-going-up symbol) + (event-up symbol) + (anim-speed float) + (move-to-pos vector :inline) + (move-to-quat quaternion :inline) + ) + (:state-methods + down-idle + going-down + going-up + up-idle + ) + (:methods + (init! (_type_) none) + (idle-state-transition (_type_) object) + (init-skel-and-ja! (_type_) none) + (init-collision! (_type_) none) + (prepare-trigger-event! (_type_) none) + (send-event! (_type_ symbol) none) + (move-to! (_type_ vector quaternion) none) + (press! (_type_ symbol) entity-perm-status) + ) + ) + +;; definition for method 3 of type basebutton +(defmethod inspect ((this basebutton)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tbutton-status: ~D~%" (-> this button-status)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Ttimeout: ~f~%" (-> this timeout)) + (format #t "~2Tbutton-id: ~D~%" (-> this button-id)) + (format #t "~2Tevent-going-down: ~A~%" (-> this event-going-down)) + (format #t "~2Tevent-down: ~A~%" (-> this event-down)) + (format #t "~2Tevent-going-up: ~A~%" (-> this event-going-up)) + (format #t "~2Tevent-up: ~A~%" (-> this event-up)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Tmove-to-pos: #~%" (-> this move-to-pos)) + (format #t "~2Tmove-to-quat: #~%" (-> this move-to-quat)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-generic-button mtn-dice-button 0 3 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 3)) + +;; definition for method 38 of type basebutton +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod move-to! ((this basebutton) (arg0 vector) (arg1 quaternion)) + (logclear! (-> this button-status) (button-status button-status-2)) + (if arg0 + (set! (-> this move-to-pos quad) (-> arg0 quad)) + (set! (-> this move-to-pos quad) (-> this root trans quad)) + ) + (if arg1 + (quaternion-copy! (-> this move-to-quat) arg1) + (quaternion-copy! (-> this move-to-quat) (-> this root quat)) + ) + 0 + (none) + ) + +;; definition for method 33 of type basebutton +(defmethod idle-state-transition ((this basebutton)) + (if (logtest? (-> this button-status) (button-status pressed)) + (go (method-of-object this down-idle)) + (go (method-of-object this up-idle)) + ) + ) + +;; failed to figure out what this is: +(defstate up-idle (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (the-as attack-info (-> block param 1)))) + (case (-> v1-1 mode) + (('flop 'spin 'punch 'eco-yellow 'eco-red 'eco-blue 'eco-dark) + (when (or (not (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'punch))) + (logtest? (-> self button-status) (button-status button-status-3)) + ) + (send-event! self (-> self event-going-down)) + (go-virtual going-down) + ) + ) + ) + ) + ) + (('trigger) + (sound-play "silo-button") + (go-virtual going-down) + ) + (('touch) + (when (logtest? (-> self button-status) (button-status button-status-4)) + (send-event! self (-> self event-going-down)) + (go-virtual going-down) + ) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + ) + ) + :enter (behavior () + (press! self #f) + ) + :trans (behavior () + (if (logtest? (-> self button-status) (button-status button-status-2)) + (rider-trans) + ) + ) + :code sleep-code + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + (rider-post) + ) + ) + ) + +;; failed to figure out what this is: +(defstate going-down (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + ) + ) + :enter (behavior () + (press! self #t) + ) + :trans rider-trans + :code (behavior () + (ja-no-eval :num! (seek! max (-> self anim-speed))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))) + ) + (send-event! self (-> self event-down)) + (let ((gp-0 (res-lump-struct (-> self entity) 'on-activate structure))) + (if gp-0 + (script-eval (the-as pair gp-0)) + ) + ) + (go-virtual down-idle) + ) + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + ) + (rider-post) + ) + ) + +;; failed to figure out what this is: +(defstate down-idle (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('untrigger) + (go-virtual going-up) + ) + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + ) + ) + :enter (behavior () + (press! self #t) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (logtest? (-> self button-status) (button-status button-status-2)) + (rider-trans) + ) + ) + :code (behavior () + (cond + ((= (-> self timeout) 0.0) + (sleep-code) + ) + (else + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) + (suspend) + ) + (send-event! self (-> self event-going-up)) + (sound-play "silo-button") + (go-virtual going-up) + ) + ) + ) + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + (rider-post) + ) + ) + ) + +;; failed to figure out what this is: +(defstate going-up (basebutton) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-to) + (move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1))) + ) + (('trigger) + (go-virtual going-down) + ) + ) + ) + :enter (behavior () + (press! self #f) + ) + :trans rider-trans + :code (behavior () + (ja-no-eval :num! (seek! 0.0 (-> self anim-speed))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0 (-> self anim-speed))) + ) + (send-event! self (-> self event-up)) + (go-virtual up-idle) + ) + :post (behavior () + (when (logtest? (-> self button-status) (button-status button-status-2)) + (logclear! (-> self button-status) (button-status button-status-2)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) + ) + (rider-post) + ) + ) + +;; definition for method 39 of type basebutton +(defmethod press! ((this basebutton) (arg0 symbol)) + (if arg0 + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) + ) + (when (not (logtest? (-> this button-status) (button-status button-status-1))) + (if arg0 + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #f) + ) + ) + ) + +;; definition for method 37 of type basebutton +;; WARN: Return type mismatch int vs none. +(defmethod send-event! ((this basebutton) (arg0 symbol)) + (with-pp + (when 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) arg0) + (let ((t9-0 send-event-function) + (v1-2 (-> this notify-actor)) + ) + (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-1 + ) + ) + ) + (dotimes (s4-0 (-> this actor-group-count)) + (let ((s3-0 (-> this actor-group s4-0))) + (dotimes (s2-0 (-> s3-0 length)) + (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) arg0) + (let ((t9-1 send-event-function) + (v1-10 (-> s3-0 data s2-0 actor)) + ) + (t9-1 + (if v1-10 + (-> v1-10 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 32 of type basebutton +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this basebutton)) + (set! (-> this button-status) (button-status)) + (set! (-> this notify-actor) #f) + (set! (-> this timeout) 0.0) + (set! (-> this event-going-down) #f) + (set! (-> this event-down) #f) + (set! (-> this event-going-up) #f) + (set! (-> this event-up) #f) + (set! (-> this anim-speed) 1.0) + 0 + (none) + ) + +;; definition for method 36 of type basebutton +;; WARN: Return type mismatch int vs none. +(defmethod prepare-trigger-event! ((this basebutton)) + (set! (-> this event-going-down) 'trigger) + 0 + (none) + ) + +;; definition for method 34 of type basebutton +;; WARN: Return type mismatch int vs none. +(defmethod init-skel-and-ja! ((this basebutton)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-button" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (set! (-> this anim-speed) 2.0) + (transform-post) + (none) + ) + +;; definition for method 35 of type basebutton +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this basebutton)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type basebutton +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (init! this) + (set! (-> this button-id) -1) + (let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (if (>= (the-as int v1-4) 0) + (set! (-> this button-id) (the-as int v1-4)) + ) + ) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-15 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-15 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-15)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (if (not (logtest? (-> this button-status) (button-status button-status-1))) + (nav-mesh-connect-from-ent this) + ) + (prepare-trigger-event! this) + (init-skel-and-ja! this) + (idle-state-transition this) + ) + +;; definition for function basebutton-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior basebutton-init-by-other basebutton ((arg0 entity-actor) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float)) + (init! self) + (logior! (-> self button-status) (button-status button-status-1)) + (set! (-> self button-id) -1) + (if arg4 + (logior! (-> self button-status) (button-status pressed)) + ) + (set! (-> self notify-actor) arg3) + (set! (-> self timeout) arg5) + (if arg0 + (process-entity-set! self arg0) + ) + (set! (-> self actor-group) (the-as (pointer actor-group) #f)) + (set! (-> self actor-group-count) 0) + (init-collision! self) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-copy! (-> self root quat) arg2) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (prepare-trigger-event! self) + (init-skel-and-ja! self) + (idle-state-transition self) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc index bbd415fa13..0dd1841a15 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc @@ -931,9 +931,10 @@ ;; definition for method 11 of type elevator ;; WARN: Return type mismatch none vs object. +;; INFO: Process stack size was changed from 512 to 1024 (defmethod init-from-entity! ((this elevator) (arg0 entity-actor)) (local-vars (sv-32 float) (sv-36 path-control) (sv-40 target)) - (stack-size-set! (-> this main-thread) 512) + (stack-size-set! (-> this main-thread) 1024) (set! (-> this sound-running-loop) #f) (set! (-> this sound-arrived) #f) (set! (-> this sound-start) #f) @@ -1021,3 +1022,7 @@ (init-sound! this) (go-arrived-or-waiting this) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/enemy-part_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/enemy-part_REF.gc new file mode 100644 index 0000000000..540c8b89db --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/enemy-part_REF.gc @@ -0,0 +1,407 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-kg-huge-explosion + :id 217 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (4.0 4.0 4.0) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-kg-big-explosion + :id 218 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-kg-explosion + :id 219 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.75 0.75 0.75) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-kg-mid-explosion + :id 220 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.5 0.5 0.5) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-kg-small-explosion + :id 221 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.3 0.3 0.3) + :parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017)) + (sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05)) + (sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 884 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow set-conerot)) + (:next-time (seconds 0.25)) + (:next-launcher 890) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 890 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 889 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.085)) + (:next-launcher 891) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 888 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 891) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 891 + :init-specs ((:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 892) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 892 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 893) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 893 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 894) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 894 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125) (:rotate-y (degrees 0))) + ) + +;; failed to figure out what this is: +(defpart 883 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:next-time (seconds 0.1)) + (:next-launcher 895) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 895 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 887 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 896) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 896 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 897) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 897 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043) (:rotate-y (degrees 0))) + ) + +;; failed to figure out what this is: +(defpart 885 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 898) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 898 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 899) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 899 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 886 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 set-conerot)) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc index 0de4d01c69..4f5ea99451 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc @@ -61,7 +61,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type enemy idle) enter)) - (set! (-> self root nav-flags) (the-as uint 0)) + (set! (-> self root nav-flags) (nav-flags)) (let ((v1-4 (-> self root root-prim))) (set! (-> v1-4 prim-core collide-as) (collide-spec)) (set! (-> v1-4 prim-core collide-with) (collide-spec)) @@ -82,7 +82,7 @@ ) (logclear! (-> self draw status) (draw-control-status no-draw)) (logclear! (-> self enemy-flags) (enemy-flag directed-ready)) - (logior! (-> self root nav-flags) 1) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) ) :code sleep-code ) @@ -125,7 +125,7 @@ 0 (logior! (-> self draw status) (draw-control-status no-draw)) (logior! (-> self enemy-flags) (enemy-flag directed-ready)) - (logand! (-> self root nav-flags) -2) + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) ) :exit (behavior () ((-> (method-of-type enemy dormant) exit)) @@ -433,7 +433,7 @@ (init-jump-info! self gp-0) (if (and (-> self enemy-info use-jump-blocked) (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) - (enemy-method-91 self) + (enemy-method-91 self gp-0) ) (go-virtual jump-blocked) ) @@ -443,7 +443,7 @@ (goto cfg-12) ) (in-jump-handler self s5-0 gp-0) - (enemy-method-101 self) + (enemy-method-101 self s5-0 gp-0) (suspend) (set! s5-0 1) ) @@ -458,7 +458,7 @@ (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) (jump-anim-handler self s5-1 gp-0) (in-jump-handler self s5-1 gp-0) - (enemy-method-101 self) + (enemy-method-101 self s5-1 gp-0) (suspend) (set! s5-1 3) ) @@ -471,7 +471,7 @@ (goto cfg-19) ) (in-jump-handler self s5-2 gp-0) - (enemy-method-101 self) + (enemy-method-101 self s5-2 gp-0) (suspend) (set! s5-2 5) ) @@ -769,7 +769,7 @@ ) (else (when (and (-> self skel effect) (logtest? (enemy-flag auto-death-phase-out) (-> self enemy-flags))) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) (suspend) 0 ) @@ -852,7 +852,7 @@ ((handle->process (-> self ragdoll-proc)) (ja-channel-push! 1 0) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek!) :frame-num 0.0) - (ragdoll-method-25 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -998,7 +998,7 @@ ) ) (if (-> self skel effect) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) ) (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 0.8)) @@ -1094,7 +1094,7 @@ ) ) (if (-> self skel effect) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) ) (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 1)) diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc index d2b4997bc9..e2499ee944 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc @@ -1239,7 +1239,7 @@ ) (('do-effect) (if (and (nonzero? (-> self skel)) (-> self skel effect)) - (do-effect (-> self skel effect) (the-as symbol (-> block param 0)) (the-as float (-> block param 1)) -1) + (do-effect (-> self skel effect) (the-as string (-> block param 0)) (the-as float (-> block param 1)) -1) ) ) (('no-actor-pause) diff --git a/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc index c8463a61ff..20758dc3c8 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc @@ -571,7 +571,7 @@ ;; definition for method 0 of type flow-control ;; INFO: Used lq/sq (defmethod new flow-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 res-lump)) - (local-vars (r0-0 uint128) (v1-16 uint128) (sv-16 int)) + (local-vars (sv-16 res-tag)) (if (not arg1) (set! arg1 (-> arg0 entity)) ) @@ -587,15 +587,9 @@ ) (set! (-> gp-0 speed) (res-lump-float arg1 'speed :default 12288.0)) (set! (-> gp-0 belt-radius) (res-lump-float arg1 'extra-radius :default 16384.0)) - (set! sv-16 0) - (let* ((a1-6 (res-lump-data arg1 'scale-factor pointer :tag-ptr (the-as (pointer res-tag) (& sv-16)))) - (a0-8 gp-0) - (t9-6 (method-of-object a0-8 setup)) - ) - (let ((v1-15 (the-as uint128 sv-16))) - (.pcpyud v1-16 v1-15 r0-0) - ) - (t9-6 a0-8 (the-as (pointer float) a1-6) (shr (* (the-as int v1-16) 2) 49)) + (set! sv-16 (new 'static 'res-tag)) + (let ((a1-6 (res-lump-data arg1 'scale-factor pointer :tag-ptr (& sv-16)))) + (setup gp-0 (the-as (pointer float) a1-6) (the-as int (-> sv-16 elt-count))) ) ) (else @@ -701,3 +695,7 @@ (set! (-> this flow) (new 'process 'flow-control (the-as process-drawable this) (the-as res-lump #f))) (go (method-of-object this idle)) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/data/art-h_REF.gc b/test/decompiler/reference/jak3/engine/data/art-h_REF.gc index 305b650ce6..cf9a414185 100644 --- a/test/decompiler/reference/jak3/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/data/art-h_REF.gc @@ -551,6 +551,7 @@ This stores settings like the name of the art-group, shadow/level-of-detail sett ((lod lod-group 6 :inline) (max-lod int8) ) + :allow-misaligned (:methods (setup-lods! (_type_ skeleton-group art-group entity) _type_) ) diff --git a/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc index 79073761a4..50a1c9bc94 100644 --- a/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc @@ -2912,19 +2912,10 @@ (defun dm-task-menu-pick-func ((arg0 game-task) (arg1 debug-menu-msg)) (let ((gp-0 (/ (the-as int arg0) 8))) (when (= arg1 (debug-menu-msg press)) - (cond - ((cpad-hold? 0 l1) - (task-node-open! (the-as game-task-node gp-0) 'menu) - ) - (else - (let ((t9-1 task-node-close!) - (a0-2 gp-0) - ) - 'menu - (t9-1 (the-as game-task-node a0-2)) - ) + (if (cpad-hold? 0 l1) + (task-node-open! (the-as game-task-node gp-0) 'menu) + (task-node-close! (the-as game-task-node gp-0) 'menu) ) - ) ) (if (and (not (task-node-closed? (the-as game-task-node gp-0))) (not (task-node-open? (the-as game-task-node gp-0))) @@ -7269,7 +7260,3 @@ (debug-menus-handler *debug-menu-context*) (debug-menus-handler *popup-menu-context*) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/dma/dma-buffer_REF.gc b/test/decompiler/reference/jak3/engine/dma/dma-buffer_REF.gc index 452b8e45a5..d8bbb3c33b 100644 --- a/test/decompiler/reference/jak3/engine/dma/dma-buffer_REF.gc +++ b/test/decompiler/reference/jak3/engine/dma/dma-buffer_REF.gc @@ -103,7 +103,8 @@ (base pointer) (end pointer) (real-buffer-end int32) - (data uint64 1 :offset 32) + (data-buffer uint8 :dynamic :overlay-at real-buffer-end) + (data uint64 1 :offset 32) ) (:methods (new (symbol type int) _type_) @@ -235,7 +236,3 @@ (dma-send-chain chan (the-as uint (-> buf data))) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/entity/entity_REF.gc b/test/decompiler/reference/jak3/engine/entity/entity_REF.gc index 35d67226f1..695e3f803c 100644 --- a/test/decompiler/reference/jak3/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak3/engine/entity/entity_REF.gc @@ -268,7 +268,7 @@ (let ((s4-0 (-> v1-4 bsp nav-meshes))) (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) - ((method-of-object (-> s4-0 s3-0 nav-mesh) nav-mesh-method-28)) + (update-navigation (-> s4-0 s3-0 nav-mesh)) ) ) ) @@ -976,9 +976,6 @@ ;; WARN: Return type mismatch int vs none. (defmethod level-group-method-24 ((this level-group)) (local-vars - (r0-0 uint128) - (a0-23 object) - (a1-10 uint128) (sv-16 (inline-array vector)) (sv-20 vector) (sv-24 vector) @@ -986,7 +983,7 @@ (sv-32 float) (sv-36 vector) (sv-40 entity) - (sv-48 int) + (sv-48 res-tag) ) (dotimes (s5-0 (-> this length)) (let ((v1-3 (-> this level s5-0))) @@ -1020,23 +1017,9 @@ ((string-prefix= "battle" (res-lump-struct sv-40 'name string)) (set! (-> sv-20 quad) (-> sv-36 quad)) (set! (-> sv-24 quad) (-> sv-36 quad)) - (set! sv-48 0) - (let ((v1-29 - (res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (the-as (pointer res-tag) (& sv-48))) - ) - ) - (when (and v1-29 (begin - (let ((a0-24 #t)) - (let ((a1-9 (the-as uint128 sv-48))) - (.pcpyud a1-10 a1-9 r0-0) - ) - (let ((a1-12 (the-as int (shr (* (the-as int a1-10) 2) 49)))) - (cmove-#f-zero a0-23 a1-12 a0-24) - ) - ) - a0-23 - ) - ) + (set! sv-48 (new 'static 'res-tag)) + (let ((v1-29 (res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (& sv-48)))) + (when (and v1-29 (nonzero? (-> sv-48 elt-count))) (let* ((s2-2 (-> v1-29 0)) (s1-1 (-> s2-2 length)) ) @@ -2763,3 +2746,7 @@ 0 (none) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc index 07cd30f230..dd2ff3e94b 100644 --- a/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc @@ -16,7 +16,7 @@ (:methods (new (symbol type process-drawable) _type_) (effect-control-method-9 (_type_) none) - (do-effect (_type_ symbol float int) none) + (do-effect (_type_ string float int) none) (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) (play-effect-sound (_type_ symbol float int basic sound-name) int) (set-channel-offset! (_type_ int) none) diff --git a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc index 696f52c75a..110e3fa41d 100644 --- a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc @@ -270,7 +270,7 @@ ) (t9-0 a0-1 - (the-as symbol (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset))))) + (the-as string (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset))))) f0-0 -1 ) @@ -288,21 +288,20 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement. -(defmethod do-effect ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod do-effect ((this effect-control) (arg0 string) (arg1 float) (arg2 int)) (local-vars (sv-288 res-lump)) (let* ((v1-2 (rtype-of arg0)) - (s3-0 (the-as string (cond - ((= v1-2 symbol) - (symbol->string arg0) - ) - ((= v1-2 string) - arg0 - ) - (else - #f - ) - ) - ) + (s3-0 (cond + ((= v1-2 symbol) + (symbol->string (the-as symbol arg0)) + ) + ((= v1-2 string) + arg0 + ) + (else + (the-as string #f) + ) + ) ) ) (cond @@ -477,8 +476,8 @@ (s0-0 (-> (the-as death-info s3-1) sound)) ) (set! sv-288 (-> this res)) - (let ((t1-5 (string->sound-name (the-as string (-> (the-as death-info s3-1) sound))))) - (s1-0 s2-3 s0-0 arg1 arg2 sv-288 t1-5) + (let ((t1-5 (string->sound-name (-> (the-as death-info s3-1) sound)))) + (s1-0 s2-3 (the-as symbol s0-0) arg1 arg2 sv-288 t1-5) ) ) ) @@ -563,45 +562,44 @@ ((string= (the-as string sv-192) "effect-land-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-land-poof-unk" - "group-land-poof-ice" - "group-land-poof-qsd" - "group-land-poof-wtr" - "group-land-poof-tar" - "group-land-poof-san" - "group-land-poof-wod" - "group-land-poof-grs" - "group-land-poof-pmt" - "group-land-poof-snw" - "group-land-poof-dsn" - "group-land-poof-unk" - "group-land-poof-lav" - "group-land-poof-cwd" - "group-land-poof-grv" - "group-land-poof-drt" - "group-land-poof-mtl" - "group-land-poof-str" - "group-land-poof-pmt" - "group-land-poof-swm" - "group-land-poof-unk" - "group-land-poof-mtl" - "group-land-poof-neu" - "group-land-poof-stn" - "group-land-poof-cmt" - "group-land-poof-car" - "group-land-poof-gmt" - "group-land-poof-smt" - "group-land-poof-hwd" - "group-land-poof-sqi" - "group-land-poof-mhm" - "group-land-poof-for" - "group-land-poof-mhs" - "group-land-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-land-poof-unk" + "group-land-poof-ice" + "group-land-poof-qsd" + "group-land-poof-wtr" + "group-land-poof-tar" + "group-land-poof-san" + "group-land-poof-wod" + "group-land-poof-grs" + "group-land-poof-pmt" + "group-land-poof-snw" + "group-land-poof-dsn" + "group-land-poof-unk" + "group-land-poof-lav" + "group-land-poof-cwd" + "group-land-poof-grv" + "group-land-poof-drt" + "group-land-poof-mtl" + "group-land-poof-str" + "group-land-poof-pmt" + "group-land-poof-swm" + "group-land-poof-unk" + "group-land-poof-mtl" + "group-land-poof-neu" + "group-land-poof-stn" + "group-land-poof-cmt" + "group-land-poof-car" + "group-land-poof-gmt" + "group-land-poof-smt" + "group-land-poof-hwd" + "group-land-poof-sqi" + "group-land-poof-mhm" + "group-land-poof-for" + "group-land-poof-mhs" + "group-land-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -609,45 +607,44 @@ ((string= (the-as string sv-192) "effect-run-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-run-poof-unk" - "group-run-poof-ice" - "group-run-poof-qsd" - "group-run-poof-wtr" - "group-run-poof-tar" - "group-run-poof-san" - "group-run-poof-wod" - "group-run-poof-grs" - "group-run-poof-pmt" - "group-run-poof-snw" - "group-run-poof-dsn" - "group-run-poof-unk" - "group-run-poof-lav" - "group-run-poof-cwd" - "group-run-poof-grv" - "group-run-poof-drt" - "group-run-poof-mtl" - "group-run-poof-str" - "group-run-poof-pmt" - "group-run-poof-swm" - "group-run-poof-unk" - "group-run-poof-mtl" - "group-run-poof-neu" - "group-run-poof-stn" - "group-run-poof-cmt" - "group-run-poof-car" - "group-run-poof-gmt" - "group-run-poof-smt" - "group-run-poof-hwd" - "group-run-poof-sqi" - "group-run-poof-mhm" - "group-run-poof-for" - "group-run-poof-mhs" - "group-run-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-run-poof-unk" + "group-run-poof-ice" + "group-run-poof-qsd" + "group-run-poof-wtr" + "group-run-poof-tar" + "group-run-poof-san" + "group-run-poof-wod" + "group-run-poof-grs" + "group-run-poof-pmt" + "group-run-poof-snw" + "group-run-poof-dsn" + "group-run-poof-unk" + "group-run-poof-lav" + "group-run-poof-cwd" + "group-run-poof-grv" + "group-run-poof-drt" + "group-run-poof-mtl" + "group-run-poof-str" + "group-run-poof-pmt" + "group-run-poof-swm" + "group-run-poof-unk" + "group-run-poof-mtl" + "group-run-poof-neu" + "group-run-poof-stn" + "group-run-poof-cmt" + "group-run-poof-car" + "group-run-poof-gmt" + "group-run-poof-smt" + "group-run-poof-hwd" + "group-run-poof-sqi" + "group-run-poof-mhm" + "group-run-poof-for" + "group-run-poof-mhs" + "group-run-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -655,45 +652,44 @@ ((string= (the-as string sv-192) "effect-just-footprint") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-just-footprint-unk" - "group-just-footprint-ice" - "group-just-footprint-qsd" - "group-just-footprint-wtr" - "group-just-footprint-tar" - "group-just-footprint-san" - "group-just-footprint-wod" - "group-just-footprint-grs" - "group-just-footprint-pmt" - "group-just-footprint-snw" - "group-just-footprint-dsn" - "group-just-footprint-unk" - "group-just-footprint-lav" - "group-just-footprint-cwd" - "group-just-footprint-grv" - "group-just-footprint-drt" - "group-just-footprint-mtl" - "group-just-footprint-str" - "group-just-footprint-pmt" - "group-just-footprint-swm" - "group-just-footprint-unk" - "group-just-footprint-mtl" - "group-just-footprint-neu" - "group-just-footprint-stn" - "group-just-footprint-cmt" - "group-just-footprint-car" - "group-just-footprint-gmt" - "group-just-footprint-smt" - "group-just-footprint-hwd" - "group-just-footprint-sqi" - "group-just-footprint-mhm" - "group-just-footprint-for" - "group-just-footprint-mhs" - "group-just-footprint-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-just-footprint-unk" + "group-just-footprint-ice" + "group-just-footprint-qsd" + "group-just-footprint-wtr" + "group-just-footprint-tar" + "group-just-footprint-san" + "group-just-footprint-wod" + "group-just-footprint-grs" + "group-just-footprint-pmt" + "group-just-footprint-snw" + "group-just-footprint-dsn" + "group-just-footprint-unk" + "group-just-footprint-lav" + "group-just-footprint-cwd" + "group-just-footprint-grv" + "group-just-footprint-drt" + "group-just-footprint-mtl" + "group-just-footprint-str" + "group-just-footprint-pmt" + "group-just-footprint-swm" + "group-just-footprint-unk" + "group-just-footprint-mtl" + "group-just-footprint-neu" + "group-just-footprint-stn" + "group-just-footprint-cmt" + "group-just-footprint-car" + "group-just-footprint-gmt" + "group-just-footprint-smt" + "group-just-footprint-hwd" + "group-just-footprint-sqi" + "group-just-footprint-mhm" + "group-just-footprint-for" + "group-just-footprint-mhs" + "group-just-footprint-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -701,45 +697,44 @@ ((string= (the-as string sv-192) "effect-just-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-just-poof-unk" - "group-just-poof-ice" - "group-just-poof-qsd" - "group-just-poof-wtr" - "group-just-poof-tar" - "group-just-poof-san" - "group-just-poof-wod" - "group-just-poof-grs" - "group-just-poof-pmt" - "group-just-poof-snw" - "group-just-poof-dsn" - "group-just-poof-unk" - "group-just-poof-lav" - "group-just-poof-cwd" - "group-just-poof-grv" - "group-just-poof-drt" - "group-just-poof-mtl" - "group-just-poof-str" - "group-just-poof-pmt" - "group-just-poof-swm" - "group-just-poof-unk" - "group-just-poof-mtl" - "group-just-poof-neu" - "group-just-poof-stn" - "group-just-poof-cmt" - "group-just-poof-car" - "group-just-poof-gmt" - "group-just-poof-smt" - "group-just-poof-hwd" - "group-just-poof-sqi" - "group-just-poof-mhm" - "group-just-poof-for" - "group-just-poof-mhs" - "group-just-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-just-poof-unk" + "group-just-poof-ice" + "group-just-poof-qsd" + "group-just-poof-wtr" + "group-just-poof-tar" + "group-just-poof-san" + "group-just-poof-wod" + "group-just-poof-grs" + "group-just-poof-pmt" + "group-just-poof-snw" + "group-just-poof-dsn" + "group-just-poof-unk" + "group-just-poof-lav" + "group-just-poof-cwd" + "group-just-poof-grv" + "group-just-poof-drt" + "group-just-poof-mtl" + "group-just-poof-str" + "group-just-poof-pmt" + "group-just-poof-swm" + "group-just-poof-unk" + "group-just-poof-mtl" + "group-just-poof-neu" + "group-just-poof-stn" + "group-just-poof-cmt" + "group-just-poof-car" + "group-just-poof-gmt" + "group-just-poof-smt" + "group-just-poof-hwd" + "group-just-poof-sqi" + "group-just-poof-mhm" + "group-just-poof-for" + "group-just-poof-mhs" + "group-just-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -747,45 +742,44 @@ ((string= (the-as string sv-192) "effect-slide-poof") (do-effect this - (the-as symbol (-> (new 'static 'boxed-array :type string - "group-slide-poof-unk" - "group-slide-poof-ice" - "group-slide-poof-qsd" - "group-slide-poof-wtr" - "group-slide-poof-tar" - "group-slide-poof-san" - "group-slide-poof-wod" - "group-slide-poof-grs" - "group-slide-poof-pmt" - "group-slide-poof-snw" - "group-slide-poof-dsn" - "group-slide-poof-unk" - "group-slide-poof-lav" - "group-slide-poof-cwd" - "group-slide-poof-grv" - "group-slide-poof-drt" - "group-slide-poof-mtl" - "group-slide-poof-str" - "group-slide-poof-pmt" - "group-slide-poof-swm" - "group-slide-poof-unk" - "group-slide-poof-mtl" - "group-slide-poof-neu" - "group-slide-poof-stn" - "group-slide-poof-cmt" - "group-slide-poof-car" - "group-slide-poof-gmt" - "group-slide-poof-smt" - "group-slide-poof-hwd" - "group-slide-poof-sqi" - "group-slide-poof-mhm" - "group-slide-poof-for" - "group-slide-poof-mhs" - "group-slide-poof-dma" - ) - (-> arg4 material) - ) - ) + (-> (new 'static 'boxed-array :type string + "group-slide-poof-unk" + "group-slide-poof-ice" + "group-slide-poof-qsd" + "group-slide-poof-wtr" + "group-slide-poof-tar" + "group-slide-poof-san" + "group-slide-poof-wod" + "group-slide-poof-grs" + "group-slide-poof-pmt" + "group-slide-poof-snw" + "group-slide-poof-dsn" + "group-slide-poof-unk" + "group-slide-poof-lav" + "group-slide-poof-cwd" + "group-slide-poof-grv" + "group-slide-poof-drt" + "group-slide-poof-mtl" + "group-slide-poof-str" + "group-slide-poof-pmt" + "group-slide-poof-swm" + "group-slide-poof-unk" + "group-slide-poof-mtl" + "group-slide-poof-neu" + "group-slide-poof-stn" + "group-slide-poof-cmt" + "group-slide-poof-car" + "group-slide-poof-gmt" + "group-slide-poof-smt" + "group-slide-poof-hwd" + "group-slide-poof-sqi" + "group-slide-poof-mhm" + "group-slide-poof-for" + "group-slide-poof-mhs" + "group-slide-poof-dma" + ) + (-> arg4 material) + ) arg1 -1 ) @@ -1073,8 +1067,8 @@ (defbehavior target-land-effect target () (cond ((focus-test? self flut) - (do-effect (-> self skel effect) (the-as symbol "effect-land-poof") -1.0 -1) - (do-effect (-> self skel effect) (the-as symbol "effect-flut-land") -1.0 -1) + (do-effect (-> self skel effect) "effect-land-poof" -1.0 -1) + (do-effect (-> self skel effect) "effect-flut-land" -1.0 -1) ) ((focus-test? self pilot) (sound-play-by-name @@ -1088,11 +1082,11 @@ ) ) ((logtest? (water-flag touch-water) (-> self water flags)) - (do-effect (-> self skel effect) (the-as symbol "effect-land-water") -1.0 -1) + (do-effect (-> self skel effect) "effect-land-water" -1.0 -1) ) (else - (do-effect (-> self skel effect) (the-as symbol "effect-land-poof") -1.0 -1) - (do-effect (-> self skel effect) (the-as symbol "effect-land") -1.0 -1) + (do-effect (-> self skel effect) "effect-land-poof" -1.0 -1) + (do-effect (-> self skel effect) "effect-land" -1.0 -1) ) ) 0 diff --git a/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc index 868251d3b4..f0951c9b89 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc @@ -315,7 +315,7 @@ (play-list (array game-task-info)) (sub-task-list (array game-task-node-info)) (mission-list (array game-task-node-info)) - (task-node-commands (array uint8)) + (task-node-commands (array game-task-node-command)) (task-node-exclusive (array uint16)) (task-counter uint32) (unknown-arr4 (array uint16)) diff --git a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc index 695a20c406..277e85640f 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc @@ -2178,7 +2178,7 @@ board sidekick board-launch - feature39 + board-zap darkjak darkjak-smack darkjak-bomb0 @@ -2191,7 +2191,7 @@ lightjak-freeze lightjak-shield artifact-invis - feature56 + jakc lighteco darkeco ) diff --git a/test/decompiler/reference/jak3/engine/game/task/game-task_REF.gc b/test/decompiler/reference/jak3/engine/game/task/game-task_REF.gc index 7441167d14..31b62012db 100644 --- a/test/decompiler/reference/jak3/engine/game/task/game-task_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/game-task_REF.gc @@ -4203,10 +4203,11 @@ :user-count 3 ) :borrow '() - :open? (lambda () (or (not (task-node-closed? (game-task-node wascity-defend-get-to))) - (task-node-closed? (game-task-node wascity-defend-resolution)) - ) - ) + :open? (lambda () + (or (not (task-node-closed? (game-task-node wascity-defend-get-to))) + (task-node-closed? (game-task-node wascity-defend-resolution)) + ) + ) :on-close #f :reset (new 'static 'task-reset-info :restart-info #f @@ -23350,83 +23351,85 @@ ) ) (set! (-> game-info mission-list) (new 'global 'boxed-array game-task-node-info 410)) - (set! (-> game-info task-node-commands) (new 'static 'boxed-array :type uint8 - #x48 - #x20 - #x1f - #x1 - #x5 - #x23 - #x22 - #x19 - #x36 - #xa - #x3a - #x41 - #x48 - #x32 - #x39 - #x3f - #x3a - #x8 - #x6 - #x37 - #xd - #xb - #x3e - #x3a - #x39 - #xf - #x40 - #x31 - #x28 - #x27 - #x26 - #x2f - #x2d - #x3 - #x3b - #x29 - #x2a - #x33 - #x12 - #x10 - #x1b - #xe - #xc - #x21 - #x1a - #x2e - #x34 - #x30 - #x13 - #x11 - #x1c - #x9 - #x7 - #x14 - #x1d - #x3c - #x43 - #x39 - #x44 - #x46 - #x45 - #x39 - #x17 - #x15 - #x2b - #x47 - #x38 - #x35 - #x18 - #x16 - #x3a - #x1e - #x42 - #x4 - #x3 - ) + (set! (-> game-info task-node-commands) + (the-as (array game-task-node-command) (new 'static 'boxed-array :type uint8 + #x48 + #x20 + #x1f + #x1 + #x5 + #x23 + #x22 + #x19 + #x36 + #xa + #x3a + #x41 + #x48 + #x32 + #x39 + #x3f + #x3a + #x8 + #x6 + #x37 + #xd + #xb + #x3e + #x3a + #x39 + #xf + #x40 + #x31 + #x28 + #x27 + #x26 + #x2f + #x2d + #x3 + #x3b + #x29 + #x2a + #x33 + #x12 + #x10 + #x1b + #xe + #xc + #x21 + #x1a + #x2e + #x34 + #x30 + #x13 + #x11 + #x1c + #x9 + #x7 + #x14 + #x1d + #x3c + #x43 + #x39 + #x44 + #x46 + #x45 + #x39 + #x17 + #x15 + #x2b + #x47 + #x38 + #x35 + #x18 + #x16 + #x3a + #x1e + #x42 + #x4 + #x3 + ) + ) ) (dotimes (v1-4 (-> game-info sub-task-list length)) (if (-> game-info sub-task-list v1-4 manager) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc index 3cc1b892fa..3817fb4c3e 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc @@ -1534,11 +1534,11 @@ (faction-commands pair) ) (:methods - (game-task-node-info-method-9 () none) + (get-idx-in-task-list (_type_) int) (open! (_type_ symbol) int) (game-task-node-info-method-11 (_type_ symbol) none) (game-task-node-info-method-12 (_type_) symbol) - (game-task-node-info-method-13 () none) + (eval-game-task-cmd! (_type_) none) ) ) @@ -1722,25 +1722,27 @@ (hud-counter handle :overlay-at (-> hud 1)) (intro-time time-frame) ) + (:state-methods + wait + active + complete + resolution + (fail resetter-params) + (restart symbol) + ) (:methods - (task-manager-method-14 () none) - (task-manager-method-15 () none) - (task-manager-method-16 () none) - (task-manager-method-17 () none) - (task-manager-method-18 () none) - (task-manager-method-19 () none) - (task-manager-method-20 () none) - (task-manager-method-21 () none) - (task-manager-method-22 () none) - (task-manager-method-23 () none) - (task-manager-method-24 () none) - (task-manager-method-25 () none) - (task-manager-method-26 () none) - (task-manager-method-27 () none) - (task-manager-method-28 () none) - (task-manager-method-29 () none) - (task-manager-method-30 () none) - (task-manager-method-31 (_type_ symbol) resetter-spec) + (init! (_type_) none) + (set-time-limit (_type_) none) + (kill-all-children (_type_) none) + (hud-timer-handler (_type_) none) + (ready? (_type_) object) + (task-manager-method-25 (_type_) none) + (task-manager-method-26 (_type_) none) + (task-manager-method-27 (_type_) none) + (task-manager-method-28 (_type_) none) + (go-fail (_type_) object) + (taskman-event-handler (_type_ process int symbol event-message-block) object) + (on-fail (_type_ symbol) resetter-params) ) ) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc new file mode 100644 index 0000000000..cf7e6f61af --- /dev/null +++ b/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc @@ -0,0 +1,3489 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type resetter-control +(deftype resetter-control (basic) + ((process handle) + (handle-init-hack symbol :overlay-at process) + ) + (:methods + (check-reset (_type_) object) + (get-resetter (_type_) process) + (spawn-resetter! (_type_ resetter-params game-task-node-info) symbol) + (do-reset (_type_) object) + ) + ) + +;; definition for method 3 of type resetter-control +(defmethod inspect ((this resetter-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~D~%" (-> this process)) + (format #t "~1Thandle-init-hack: ~A~%" (-> this handle-init-hack)) + (label cfg-4) + this + ) + +;; definition for symbol *resetter-control*, type resetter-control +(define *resetter-control* (new 'static 'resetter-control :handle-init-hack #f)) + +;; definition for method 2 of type resetter-spec +(defmethod print ((this resetter-spec)) + (format + #t + "#" + (-> this continue) + (-> this reset-mode) + (game-task-node->string (-> this node)) + (-> this execute) + this + ) + this + ) + +;; definition for function game-task-node->string +(defun game-task-node->string ((arg0 game-task-node)) + (-> *game-info* sub-task-list arg0 name) + ) + +;; definition for method 9 of type game-task-info +(defmethod get-play-list-idx ((this game-task-info)) + (let ((v1-1 (-> *game-info* play-list))) + (countdown (a1-0 (-> v1-1 length)) + (if (= this (-> v1-1 a1-0)) + (return a1-0) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type game-task-node-info +(defmethod get-idx-in-task-list ((this game-task-node-info)) + (let ((v1-1 (-> *game-info* sub-task-list))) + (countdown (a1-0 (-> v1-1 length)) + (if (= this (-> v1-1 a1-0)) + (return a1-0) + ) + ) + ) + 0 + ) + +;; definition for function reset-city-squad-control +(defun reset-city-squad-control ((arg0 symbol)) + (if (and (nonzero? *cty-attack-controller*) *cty-attack-controller*) + (cty-attack-reset arg0 #f #f) + ) + (none) + ) + +;; definition for function city-task-faction-commands +(defun city-task-faction-commands () + (if (or (zero? *cty-faction-manager*) (not *cty-faction-manager*)) + (return 0) + ) + (setup-city-task-faction) + ) + +;; definition for function evaluate-faction-commands +(defun evaluate-faction-commands ((arg0 pair)) + (if (or (zero? *cty-faction-manager*) (not *cty-faction-manager*) (zero? arg0)) + (return 0) + ) + (cty-faction-evaluate-commands arg0) + ) + +;; definition for function update-task-masks +(defun update-task-masks ((arg0 symbol)) + (local-vars (a3-2 symbol) (sv-176 game-task-event)) + (if (= arg0 'none) + (return 0) + ) + (do-nothing *level*) + (cond + ((or (= arg0 'debug) (= arg0 'level)) + ) + ((logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! (-> *game-info* features) (game-feature + gun + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + board + gun-upgrade-yellow-ammo-1 + gun-upgrade-yellow-ammo-2 + gun-upgrade-red-ammo-1 + gun-upgrade-red-ammo-2 + gun-upgrade-blue-ammo-1 + gun-upgrade-blue-ammo-2 + gun-upgrade-dark-ammo-1 + gun-upgrade-dark-ammo-2 + board-launch + board-zap + darkjak + darkjak-bomb0 + darkjak-bomb1 + lightjak + lightjak-regen + lightjak-freeze + lightjak-shield + armor0 + armor1 + armor2 + armor3 + lighteco + darkeco + ) + ) + (set! (-> *game-info* items) (game-items)) + (set! (-> *game-info* vehicles) (game-vehicles v-turtle v-snake v-scorpion v-toad v-rhino)) + (set! (-> *game-info* light-crystal) 0.0) + (set! (-> *game-info* dark-crystal) 0.0) + ) + (else + (set! (-> *game-info* features) (game-feature)) + (set! (-> *game-info* items) (game-items)) + (set! (-> *game-info* vehicles) (game-vehicles)) + (set! (-> *game-info* light-crystal) 0.0) + (set! (-> *game-info* dark-crystal) 0.0) + ) + ) + (let ((s5-0 (-> *minimap* engine alive-list))) + (while s5-0 + (let ((s4-0 s5-0)) + (if (and (logtest? (-> s4-0 flags) (minimap-flag task-graph)) + (or (not (game-task-node-info-method-12 (-> *game-info* sub-task-list (-> s4-0 node)))) + (not (minimap-class-node-method-9 (-> s4-0 class))) + ) + ) + (logior! (-> s4-0 flags) (minimap-flag fade-out)) + ) + ) + (set! s5-0 (-> s5-0 next)) + ) + ) + (let ((v1-43 (-> *game-info* task-node-exclusive))) + (set! (-> v1-43 length) 0) + (let ((a0-10 (-> *game-info* sub-task-list))) + (dotimes (a1-0 (-> a0-10 length)) + (when (nonzero? a1-0) + (let ((a2-3 (-> a0-10 a1-0))) + (set! a3-2 + (and (logtest? (-> a2-3 flags) (game-task-node-flag exclusive)) + (not (logtest? (-> a2-3 flags) (game-task-node-flag closed))) + (begin + (dotimes (a3-5 4) + (let ((t1-0 (-> a2-3 parent-node a3-5))) + (when (and (nonzero? t1-0) (not (logtest? (-> a0-10 t1-0 flags) (game-task-node-flag closed)))) + (set! a3-2 #f) + (goto cfg-38) + ) + ) + ) + #t + ) + ) + ) + (label cfg-38) + (when a3-2 + (when (< (-> v1-43 length) (-> v1-43 allocated-length)) + (set! (-> v1-43 (-> v1-43 length)) (the-as uint (-> a2-3 task))) + (+! (-> v1-43 length) 1) + ) + ) + ) + ) + ) + ) + ) + (let ((s5-1 + (lambda ((arg0 pair)) + (let ((s4-0 (-> arg0 car))) + (while (not (null? (the-as object arg0))) + (let ((v1-0 (-> (the-as pair s4-0) car)) + (s5-0 (-> (the-as pair (-> (the-as pair s4-0) cdr)) car)) + ) + (-> (the-as pair (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) car) + (-> (the-as pair (-> (the-as pair (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) cdr)) car) + (let* ((s3-0 (-> (the-as symbol v1-0) value)) + (v1-1 (if (type? s3-0 level-load-info) + s3-0 + ) + ) + (a0-11 (-> (the-as pair (-> (the-as pair s4-0) cdr)) cdr)) + ) + (when (and v1-1 (-> (the-as level-load-info v1-1) borrow)) + (case s5-0 + (('alias) + (set! a0-11 (cond + ((-> (the-as pair a0-11) car) + (empty) + a0-11 + ) + (else + #f + ) + ) + ) + (set! (-> (the-as level-load-info v1-1) borrow alias) a0-11) + ) + (else + (set! (-> (the-as level-load-info v1-1) borrow borrow-info (/ (the-as int s5-0) 8)) a0-11) + ) + ) + ) + ) + ) + (set! arg0 (the-as pair (-> arg0 cdr))) + (set! s4-0 (-> arg0 car)) + ) + ) + #f + ) + ) + ) + (let ((s4-1 #f)) + (s5-1 (-> *game-info* sub-task-list (game-task-node city-start-start) borrow)) + (evaluate-faction-commands (-> *game-info* sub-task-list (game-task-node city-start-start) faction-commands)) + (let ((s3-0 (-> *game-info* sub-task-list))) + (dotimes (s2-0 (-> s3-0 length)) + (when (nonzero? s2-0) + (let ((s1-0 (-> s3-0 s2-0))) + (case arg0 + (('debug 'level) + ) + (else + (if (logtest? (-> s1-0 flags) (game-task-node-flag closed)) + (eval-game-task-cmd! s1-0) + ) + ) + ) + (when (game-task-node-info-method-12 s1-0) + (if (-> s1-0 on-open) + (script-eval (-> s1-0 on-open) :key s1-0) + ) + (when (-> s1-0 when-open) + (let ((s0-0 (-> s1-0 when-open length))) + (while (begin (label cfg-75) (nonzero? s0-0)) + (+! s0-0 -1) + (set! sv-176 (-> s1-0 when-open s0-0)) + (case (-> sv-176 actor) + (((game-task-actor minimap)) + (if (not (minimap-class-node-method-9 (-> *minimap-class-list* (-> sv-176 icon)))) + (goto cfg-75) + ) + (let ((v1-89 (add-icon! *minimap* *dproc* (-> sv-176 icon) (the-as int (-> sv-176 icon)) (the-as vector #f) s2-0))) + (when v1-89 + (logior! (-> v1-89 flags) (minimap-flag task-graph)) + (cond + ((and (logtest? (minimap-flag ctywide) (-> v1-89 class flags)) + (logtest? (minimap-flag transport) (-> v1-89 class flags)) + ) + (let ((v1-91 (add-icon! *minimap* *dproc* (the-as uint 21) 21 (the-as vector #f) s2-0))) + (if v1-91 + (logior! (-> v1-91 flags) (minimap-flag task-graph)) + ) + ) + ) + ((and (logtest? (minimap-flag wasall waswide desert) (-> v1-89 class flags)) + (logtest? (minimap-flag transport) (-> v1-89 class flags)) + ) + (let ((v1-96 (add-icon! *minimap* *dproc* (the-as uint 18) 18 (the-as vector #f) s2-0))) + (if v1-96 + (logior! (-> v1-96 flags) (minimap-flag task-graph)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (s5-1 (-> s1-0 borrow)) + (when (not (null? (-> s1-0 faction-commands))) + (set! s4-1 #t) + (evaluate-faction-commands (-> s1-0 faction-commands)) + ) + ) + ) + ) + ) + ) + (if (not s4-1) + (city-task-faction-commands) + ) + ) + (dotimes (s4-2 (the-as int (-> *setting-control* user-current faction-command-count))) + (evaluate-faction-commands (-> *setting-control* user-current faction-command s4-2)) + ) + (if (logtest? (game-secrets darkjak-tracking) (-> *game-info* secrets)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature44) (-> *game-info* features))) + ) + ) + (logior! (-> *game-info* features) (-> *game-info* debug-features)) + (logior! (-> *game-info* items) (-> *game-info* debug-items)) + (logior! (-> *game-info* vehicles) (-> *game-info* debug-vehicles)) + (dotimes (s4-3 (the-as int (-> *setting-control* user-current borrow-count))) + (s5-1 (-> *setting-control* user-current borrow s4-3)) + ) + ) + (case arg0 + (('load) + ) + (else + (let ((s5-2 (-> *game-info* sub-task-list))) + (dotimes (s4-4 (-> s5-2 length)) + (when (nonzero? s4-4) + (let ((s3-1 (-> s5-2 s4-4))) + (if (and (-> s3-1 manager) (or (and (logtest? (-> s3-1 flags) (game-task-node-flag closed)) + (not (task-node-closed? (-> s3-1 manager final-node))) + ) + (game-task-node-info-method-12 s3-1) + ) + ) + (script-eval '(task-manager) :key s3-1) + ) + ) + ) + ) + ) + ) + ) + (add-borrow-levels *load-state*) + (dotimes (s5-3 (-> *level* length)) + (let ((a0-75 (-> *level* level s5-3))) + (if (= (-> a0-75 status) 'active) + (set-proto-vis! a0-75 arg0) + ) + ) + ) + (if (logtest? (game-secrets vehicle-fox) (-> *game-info* secrets)) + (logior! (-> *game-info* vehicles) (game-vehicles v-fox)) + ) + (if (logtest? (game-secrets vehicle-mirage) (-> *game-info* secrets)) + (logior! (-> *game-info* vehicles) (game-vehicles v-mirage)) + ) + (if (logtest? (game-secrets vehicle-x-ride) (-> *game-info* secrets)) + (logior! (-> *game-info* vehicles) (game-vehicles v-x-ride)) + ) + (set! (-> *game-info* percent-complete) (calculate-percentage *game-info*)) + 0 + ) + +;; definition for method 22 of type level +(defmethod set-proto-vis! ((this level) (arg0 symbol)) + (if (= arg0 'none) + (return 0) + ) + (set! (-> this task-mask) + (logior (logand (-> this info base-task-mask) (task-mask task0 task1 task2 task3 task4 task5 task6 task7 done)) + (logand (-> this task-mask) (task-mask primary0)) + ) + ) + (let ((v1-8 (-> this info taskname)) + (a0-4 (-> *game-info* sub-task-list)) + ) + (dotimes (a1-1 (-> a0-4 length)) + (when (nonzero? a1-1) + (let ((a2-3 (-> a0-4 a1-1))) + (when (and (logtest? (-> a2-3 flags) (game-task-node-flag closed)) (= (-> a2-3 level) v1-8)) + (cond + ((logtest? (-> a2-3 flags) (game-task-node-flag abs-task-mask)) + (set! (-> this task-mask) (-> a2-3 task-mask)) + ) + ((logtest? (-> a2-3 flags) (game-task-node-flag set-task-mask)) + (logior! (-> this task-mask) (-> a2-3 task-mask)) + ) + ((logtest? (-> a2-3 flags) (game-task-node-flag clear-task-mask)) + (logclear! (-> this task-mask) (-> a2-3 task-mask)) + ) + ) + ) + ) + ) + ) + ) + (case (-> this name) + (('foresta 'forestb) + (prototypes-game-visible-set! '("gun-base-cylinder.mb" "gun-base-tubes.mb") #f this) + (prototypes-game-visible-set! + '("destroyed-statue-base.mb" + "destroyed-statue-chunk-a.mb" + "destroyed-statue-chunk-b.mb" + "destroyed-statue-eyelid.mb" + "destroyed-statue-rubble-terrain.mb" + "fora-grounder-destroyed-statue-lil-rocks.mb" + "fora-shrub-destroyed-statue-pebbles.mb" + "neo-spawner-root-a.mb" + "neo-spawner-root-b.mb" + ) + (and (task-node-closed? (game-task-node wascity-defend-resolution)) + (not (task-node-closed? (game-task-node precursor-tour-resolution))) + ) + this + ) + (prototypes-game-visible-set! + '("green-eco-vent-a.mb") + (not (task-node-closed? (game-task-node forest-ring-chase-introduction))) + this + ) + ) + (('mhcityb 'mhcitya) + (prototypes-game-visible-set! + '("mhcity-de-tower-grind-strand-long-nocol01.mb" + "mhcity-ground-lower-wall-gapfiller-strand-nub-01.mb" + "mhcity-ground-lower-wall-veins-small-02.mb" + "mhcity-wall-vine-thin-c-destrand-01.mb" + "mhcity-wall-vine-thin-s-destrand-01.mb" + ) + (not (task-node-closed? (game-task-node city-destroy-darkeco-resolution))) + this + ) + ) + (('factoryb) + (prototypes-game-visible-set! + '("facb-gun-tower-base-01.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower1))) + this + ) + (prototypes-game-visible-set! + '("facb-gun-tower-base-02.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower2))) + this + ) + (prototypes-game-visible-set! + '("facb-gun-tower-base-03.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower3))) + this + ) + (prototypes-game-visible-set! + '("facb-gun-tower-base-04.mb") + (not (task-node-closed? (game-task-node factory-sky-battle-tower4))) + this + ) + ) + (('precurd) + (prototypes-game-visible-set! + '("precur-road-bridge01.mb" + "precur-road-bridge02.mb" + "precur-road-bridge03.mb" + "precur-road-bridge04.mb" + "precur-road-bridge05.mb" + ) + (not (task-node-closed? (game-task-node precursor-destroy-ship-escape-continue))) + this + ) + ) + (('desertg) + (prototypes-game-visible-set! '("des-egg.mb") (not (task-node-closed? (game-task-node nest-eggs-wall))) this) + ) + (('wasstada) + (prototypes-game-visible-set! + '("wstd-table.mb") + (task-node-closed? (game-task-node arena-fight-1-introduction)) + this + ) + ) + (('desertg) + (prototypes-game-visible-set! '("des-egg.mb") (not (task-node-closed? (game-task-node nest-eggs-wall))) this) + ) + (('templea 'templed) + (prototypes-game-visible-set! + '("tpl-hide-debris-blocka.mb" + "tpl-hide-debris-blockb.mb" + "tpl-hide-debris-plank-8m.mb" + "tpl-hide-debris-rock1.mb" + "tpl-hide-sunken-brick-01.mb" + "tpl-hide-collision-01.mb" + ) + (task-node-closed? (game-task-node temple-defend-introduction)) + this + ) + (prototypes-game-visible-set! + '("tpl-hall-alter-tunnel-section-jnt-hide.mb" "tpl-hall-alter-tunnel-section-hide.mb") + (not (task-node-closed? (game-task-node temple-tests-resolution))) + this + ) + ) + (('ctywide) + (prototypes-game-visible-set! + '("palcab-lowres-mhcity-tower-shell.mb" + "palcab-lowres-mhcity-tower-shelleye-01.mb" + "palcab-lowres-mhcity-tower-cap.mb" + "palcab-lowres-mhcity-tower-capdoor-01.mb" + ) + (not (task-node-closed? (game-task-node tower-destroy-resolution))) + this + ) + (prototypes-game-visible-set! + '("palcab-lowres-mhcity-tower-shell-blasted-01.mb" "palcab-lowres-mhcity-tower-shell-blasted-02.mb") + (task-node-closed? (game-task-node tower-destroy-resolution)) + this + ) + ) + (('ctygenb) + (prototypes-game-visible-set! + '("city-cable-grindable-turnoff-01.mb" + "city-cable-grindable-collision-01.mb" + "city-cable-grindable-collision.mb" + ) + (task-node-closed? (game-task-node tower-destroy-resolution)) + this + ) + ) + (('atoll) + ) + (('ctymarkb) + ) + (('ctypal) + ) + (('ctyasha) + ) + (('stadiumb) + ) + (('hiphog) + ) + ) + (logior! (-> this task-mask) (-> *setting-control* user-current task-mask)) + 0 + ) + +;; definition for function play-clean +(defun play-clean ((arg0 symbol)) + (set! *display-entity-errors* #f) + (set! *display-profile* #f) + (set! *display-actor-marks* #f) + (set! (-> *level* play?) #t) + (time-of-day-setup #t) + (set! *time-of-day-fast* #f) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (let ((t9-2 reset-city-squad-control) + (a0-5 #f) + ) + (t9-2 a0-5) + ) + (when arg0 + (let ((s5-0 (-> *game-info* mode))) + (set! (-> *game-info* mode) arg0) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + (set! (-> *game-info* mode) s5-0) + ) + ) + 0 + ) + +;; definition for function play-task +;; WARN: Return type mismatch object vs string. +(defun play-task ((arg0 game-task) (arg1 symbol) (arg2 symbol)) + (persist-with-delay *setting-control* 'fail-music-volume (seconds 5) 'music-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-sfx-volume (seconds 5) 'sfx-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-dialog-volume (seconds 5) 'dialog-volume 'abs 0.0 0) + (play-clean arg1) + (let ((gp-1 (-> *game-info* play-list arg0))) + (the-as string (cond + ((and (= arg2 'pre-play) (-> gp-1 pre-play-continue)) + (task-node-open! (-> gp-1 pre-play-node) 'menu) + (-> gp-1 pre-play-continue) + ) + ((and (= arg2 'kiosk) (-> gp-1 kiosk-play-continue)) + (send-event (ppointer->process *time-of-day*) 'change 'hour 7) + (task-node-open! (-> gp-1 kiosk-play-node) 'event) + (if (pair? (-> gp-1 kiosk-play-continue)) + (-> (the-as pair (-> gp-1 kiosk-play-continue)) car) + (-> gp-1 kiosk-play-continue) + ) + ) + (else + (if (-> gp-1 play-continue) + (task-node-open! (-> gp-1 play-node) 'menu) + ) + (-> gp-1 play-continue) + ) + ) + ) + ) + ) + +;; definition for function restart-mission +(defun restart-mission () + (let ((gp-0 #t)) + (let ((s5-0 #f)) + (let ((t9-0 reset-city-squad-control) + (a0-0 #f) + ) + (t9-0 a0-0) + ) + (let ((v1-1 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (let ((s4-0 (-> v1-1 next0))) + (while (!= v1-1 (-> *task-manager-engine* alive-list-end)) + (let ((a0-3 (-> (the-as connection v1-1) param1))) + (if (not s5-0) + (set! s5-0 #t) + ) + (if (and (-> (the-as task-manager a0-3) next-state) + (let ((v1-7 (-> (the-as task-manager a0-3) next-state name))) + (or (= v1-7 'complete) (= v1-7 'resolution) (= v1-7 'fail) (= v1-7 'restart)) + ) + ) + (set! s5-0 'busy) + ) + (if (send-event (the-as process-tree a0-3) 'restart) + (set! gp-0 #f) + ) + ) + (set! v1-1 s4-0) + *task-manager-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (if (or (and *target* (focus-test? *target* dead) s5-0) (= s5-0 'busy)) + (return (the-as int #f)) + ) + ) + (cond + ((-> *setting-control* user-current restart-info) + (spawn-resetter! + *resetter-control* + (the-as resetter-params (-> *setting-control* user-current restart-info)) + (the-as game-task-node-info #f) + ) + ) + (gp-0 + (let ((s5-1 (the-as game-task-node-info #f)) + (s4-1 (level-get-target-inside *level*)) + (gp-1 (the-as string #f)) + ) + (when (and s4-1 (not (logtest? (-> s4-1 info level-flags) (level-flags lf0)))) + (let ((s3-0 (-> *game-info* sub-task-list))) + (dotimes (s2-0 (-> s3-0 length)) + (when (nonzero? s2-0) + (let ((s1-0 (-> s3-0 s2-0))) + (if (and (= (-> s1-0 level) (-> s4-1 info taskname)) + (!= (-> s1-0 level) 'city) + (not (logtest? (-> s1-0 flags) (game-task-node-flag no-restart))) + (game-task-node-info-method-12 s1-0) + ) + (set! s5-1 s1-0) + ) + ) + ) + ) + ) + ) + (when s5-1 + (let ((v1-56 (-> *game-info* play-list (-> s5-1 task)))) + (cond + ((and (-> s5-1 reset) (-> s5-1 reset restart-info)) + (spawn-resetter! *resetter-control* (-> s5-1 reset restart-info) (the-as game-task-node-info #f)) + (return 0) + ) + ((-> v1-56 play-continue) + (set! gp-1 (-> v1-56 play-continue)) + ) + ) + ) + ) + (let ((a1-8 (new 'stack-no-clear 'resetter-params))) + (set! (-> a1-8 flags) (resetter-flag auto-reset text-message no-audio)) + (set! (-> a1-8 message) (resetter-message mission-retry)) + (set! (-> a1-8 retry continue) gp-1) + (set! (-> a1-8 retry node) (game-task-node none)) + (set! (-> a1-8 retry reset-mode) 'try) + (set! (-> a1-8 retry execute) #f) + (set! (-> a1-8 fail node) (game-task-node none)) + (set! (-> a1-8 fail continue) #f) + (set! (-> a1-8 fail reset-mode) 'life) + (set! (-> a1-8 fail execute) #f) + (set! (-> a1-8 reset-delay) (the-as uint 0)) + (set! (-> a1-8 task) (game-task none)) + (set! (-> a1-8 text-message) (text-id null)) + (spawn-resetter! *resetter-control* a1-8 (the-as game-task-node-info #f)) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for function fail-mission +;; WARN: Return type mismatch int vs none. +;; WARN: Function fail-mission has a return type of none, but the expression builder found a return statement. +(defun fail-mission () + (let ((gp-0 #t)) + (let ((s5-0 #f)) + (let ((t9-0 reset-city-squad-control) + (a0-0 #f) + ) + (t9-0 a0-0) + ) + (let ((v1-1 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (let ((s4-0 (-> v1-1 next0))) + (while (!= v1-1 (-> *task-manager-engine* alive-list-end)) + (let ((a0-3 (-> (the-as connection v1-1) param1))) + (if (not s5-0) + (set! s5-0 #t) + ) + (if (and (-> (the-as task-manager a0-3) next-state) + (let ((v1-7 (-> (the-as task-manager a0-3) next-state name))) + (or (= v1-7 'complete) (= v1-7 'resolution) (= v1-7 'fail) (= v1-7 'restart)) + ) + ) + (set! s5-0 'busy) + ) + (if (send-event (the-as process-tree a0-3) 'fail #t) + (set! gp-0 #f) + ) + ) + (set! v1-1 s4-0) + *task-manager-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (if (or (and *target* (focus-test? *target* dead) s5-0) (= s5-0 'busy)) + (return #f) + ) + ) + (cond + ((-> *setting-control* user-current fail-info) + (spawn-resetter! + *resetter-control* + (the-as resetter-params (-> *setting-control* user-current fail-info)) + (the-as game-task-node-info #f) + ) + ) + (gp-0 + (let ((s4-1 (the-as game-task-node-info #f)) + (s3-0 (level-get-target-inside *level*)) + (gp-1 (the-as string #f)) + (s5-1 138) + ) + (when (and s3-0 (not (logtest? (-> s3-0 info level-flags) (level-flags lf0)))) + (let ((s2-0 (-> *game-info* sub-task-list))) + (dotimes (s1-0 (-> s2-0 length)) + (when (nonzero? s1-0) + (let ((s0-0 (-> s2-0 s1-0))) + (if (and (= (-> s0-0 level) (-> s3-0 info taskname)) + (!= (-> s0-0 level) 'city) + (not (logtest? (-> s0-0 flags) (game-task-node-flag no-restart))) + (game-task-node-info-method-12 s0-0) + ) + (set! s4-1 s0-0) + ) + ) + ) + ) + ) + ) + (cond + ((and s4-1 (-> s4-1 reset) (-> s4-1 reset fail-info)) + (spawn-resetter! *resetter-control* (-> s4-1 reset fail-info) (the-as game-task-node-info #f)) + (return 0) + ) + ((= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (set! gp-1 "wasdoors-desert") + (if (and (-> *game-info* current-continue) + (logtest? (continue-flags record-path) (-> *game-info* current-continue flags)) + ) + (set! gp-1 (-> *game-info* current-continue name)) + ) + (set! s5-1 1973) + ) + ((and s4-1 (let ((a0-25 (-> *game-info* play-list (-> s4-1 task) play-continue))) + (when a0-25 + (set! gp-1 a0-25) + gp-1 + ) + ) + ) + ) + ) + (let ((a1-12 (new 'stack-no-clear 'resetter-params))) + (set! (-> a1-12 flags) (resetter-flag auto-reset text-message)) + (set! (-> a1-12 message) (resetter-message mission-fail)) + (set! (-> a1-12 retry continue) #f) + (set! (-> a1-12 retry node) (game-task-node none)) + (set! (-> a1-12 retry reset-mode) 'try) + (set! (-> a1-12 retry execute) #f) + (set! (-> a1-12 fail node) (game-task-node none)) + (set! (-> a1-12 fail continue) gp-1) + (set! (-> a1-12 fail reset-mode) 'life) + (set! (-> a1-12 fail execute) #f) + (set! (-> a1-12 reset-delay) (the-as uint 1500)) + (set! (-> a1-12 task) (game-task none)) + (set! (-> a1-12 text-message) (the-as text-id s5-1)) + (spawn-resetter! *resetter-control* a1-12 (the-as game-task-node-info #f)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function task-node-by-name +(defun task-node-by-name ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= arg0 (-> s3-0 name)) + (return s3-0) + ) + ) + ) + ) + ) + (the-as game-task-node-info #f) + ) + +;; definition for function task-node-index-by-name +(defun task-node-index-by-name ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((v1-4 (-> s5-0 s4-0))) + (if (string= arg0 (-> v1-4 name)) + (return s4-0) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for function task-resolution-close! +(defun task-resolution-close! ((arg0 game-task)) + (let ((v1-1 (-> *game-info* sub-task-list))) + (dotimes (a1-0 (-> v1-1 length)) + (when (nonzero? a1-0) + (let ((a2-3 (-> v1-1 a1-0))) + (when (and (= (-> a2-3 task) arg0) (logtest? (-> a2-3 flags) (game-task-node-flag close-task))) + (open! a2-3 'event) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +;; definition for function task-close! +(defun task-close! ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (when (string= arg0 (-> s3-0 name)) + (let ((gp-2 (not (logtest? (-> s3-0 flags) (game-task-node-flag closed))))) + (open! s3-0 'event) + (return gp-2) + ) + ) + ) + ) + ) + ) + (format 0 "ERROR: attempting to close unknown task node ~A.~%" arg0) + #f + ) + +;; definition for function task-closed? +(defun task-closed? ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= arg0 (-> s3-0 name)) + (return (logtest? (-> s3-0 flags) (game-task-node-flag closed))) + ) + ) + ) + ) + ) + (format 0 "ERROR: attempting to query closed? of unknown task node ~A.~%" arg0) + #f + ) + +;; definition for function open-task-nodes +(defun open-task-nodes ((arg0 (array game-task-node-info))) + (local-vars (a3-4 symbol)) + (set! (-> arg0 length) 0) + (let ((v1-1 (-> *game-info* sub-task-list))) + (dotimes (a1-0 (-> v1-1 length)) + (when (nonzero? a1-0) + (let ((a2-3 (-> v1-1 a1-0))) + (when (and (not (logtest? (-> a2-3 flags) (game-task-node-flag closed))) + (begin + (dotimes (a3-3 4) + (when (and (nonzero? (-> a2-3 parent-node a3-3)) + (not (logtest? (-> v1-1 (-> a2-3 parent-node a3-3) flags) (game-task-node-flag closed))) + ) + (set! a3-4 #f) + (goto cfg-14) + ) + ) + (set! a3-4 #t) + (label cfg-14) + (and a3-4 (< (-> arg0 length) (-> arg0 allocated-length))) + ) + ) + (set! (-> arg0 (-> arg0 length)) a2-3) + (+! (-> arg0 length) 1) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for method 2 of type game-task-node-info +(defmethod print ((this game-task-node-info)) + (format + #t + "#" + (-> this name) + (cond + ((logtest? (-> this flags) (game-task-node-flag closed)) + "closed" + ) + ((game-task-node-info-method-12 this) + "open" + ) + (else + "inactive" + ) + ) + this + ) + this + ) + +;; definition for method 10 of type game-task-node-info +(defmethod open! ((this game-task-node-info) (arg0 symbol)) + (when (not (logtest? (-> this flags) (game-task-node-flag closed))) + (let ((s4-0 (lambda ((arg0 game-task-node-info) (arg1 symbol)) + (logior! (-> arg0 flags) (game-task-node-flag closed)) + (+! (-> *game-info* task-counter) 1) + (when (zero? (-> arg0 close-time)) + (set! (-> arg0 gem-count) (the-as uint (the int (-> *game-info* gem)))) + (set! (-> arg0 skill-count) (the-as uint (the int (-> *game-info* skill)))) + (set! (-> arg0 close-time) (the-as uint (-> *display* game-clock frame-counter))) + ) + (if (-> arg0 on-close) + (script-eval (-> arg0 on-close) :key arg0) + ) + (when (logtest? (-> arg0 flags) (game-task-node-flag close-task)) + (let ((t9-2 reset-city-squad-control) + (a0-4 #f) + ) + (t9-2 a0-4) + ) + (target-reset-on-task-finish) + (if (= arg1 'event) + (menu-secrets-notify-task-node-close (the-as game-task-node arg0)) + ) + ) + (if (logtest? (-> arg0 flags) (game-task-node-flag close-task)) + ((lambda ((arg0 game-task-node-info)) + (if *target* + (send-event *target* 'get-pickup (pickup-type fuel-cell) (the float (-> arg0 task))) + (give *game-info* 'fuel-cell (the float (-> arg0 task)) (the-as handle #f)) + ) + ) + arg0 + ) + ) + ) + ) + ) + (let ((s2-0 0) + (s3-0 (new 'stack-no-clear 'array 'game-task-node 64)) + ) + (let ((s1-0 this)) + (loop + (cond + ((= (-> s1-0 parent-node 0) (game-task-node none)) + (goto cfg-21) + ) + ((= (-> s1-0 parent-node 1) (game-task-node none)) + (let ((v1-10 (-> *game-info* sub-task-list (-> s1-0 parent-node 0)))) + (cond + ((logtest? (-> v1-10 flags) (game-task-node-flag closed)) + (goto cfg-21) + ) + (else + (set! (-> s3-0 s2-0) (-> s1-0 parent-node 0)) + (+! s2-0 1) + (when (< 64 s2-0) + (break!) + 0 + ) + ) + ) + (set! s1-0 v1-10) + ) + ) + (else + (dotimes (s0-0 4) + (let ((v1-15 (-> s1-0 parent-node s0-0))) + (if (nonzero? v1-15) + (open! (-> *game-info* sub-task-list v1-15) 'none) + ) + ) + ) + (goto cfg-21) + ) + ) + ) + ) + (label cfg-21) + (while (nonzero? s2-0) + (+! s2-0 -1) + (s4-0 (-> *game-info* sub-task-list (-> s3-0 s2-0)) arg0) + ) + ) + (s4-0 this arg0) + ) + (let ((s4-1 (-> *game-info* sub-task-list))) + (dotimes (s3-1 (-> s4-1 length)) + (when (nonzero? s3-1) + (let ((s2-1 (-> s4-1 s3-1))) + (if (and (or (logtest? (-> s2-1 flags) (game-task-node-flag auto-close disk-close)) + (and (kiosk?) + (logtest? (-> this flags) (game-task-node-flag close-task)) + (!= arg0 'menu) + (logtest? (-> s2-1 flags) (game-task-node-flag kiosk-close)) + ) + ) + (game-task-node-info-method-12 s2-1) + ) + (open! s2-1 'none) + ) + ) + ) + ) + ) + (update-task-masks arg0) + ) + 0 + ) + +;; definition for function task-node-closed? +(defun task-node-closed? ((arg0 game-task-node)) + (let ((v1-2 (-> *game-info* sub-task-list arg0))) + (logtest? (-> v1-2 flags) (game-task-node-flag closed)) + ) + ) + +;; definition for function task-node-close! +(defun task-node-close! ((arg0 game-task-node) (arg1 symbol)) + (open! (-> *game-info* sub-task-list arg0) arg1) + 0 + ) + +;; definition for function task-open? +(defun task-open? ((arg0 string)) + (let ((s5-0 (-> *game-info* sub-task-list)) + (s4-0 0) + ) + (while (< s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((v1-4 (-> s5-0 s4-0))) + (if (string= arg0 (-> v1-4 name)) + (return (task-node-open? (the-as game-task-node s4-0))) + ) + ) + ) + (set! s4-0 (+ s4-0 1)) + ) + ) + (format 0 "ERROR: attempting to query open? of unknown task node ~A.~%" arg0) + #f + ) + +;; definition for method 11 of type game-task-node-info +;; WARN: Return type mismatch int vs none. +(defmethod game-task-node-info-method-11 ((this game-task-node-info) (arg0 symbol)) + (local-vars (v1-19 symbol)) + (when (logtest? (-> this flags) (game-task-node-flag closed)) + (logclear! (-> this flags) (game-task-node-flag closed)) + (+! (-> *game-info* task-counter) 1) + (if (logtest? (-> this flags) (game-task-node-flag close-task)) + (logclear! (-> *game-info* task-perm-list data (-> this task) status) (entity-perm-status complete)) + ) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((a0-4 (-> s5-0 s4-0))) + (set! v1-19 + (and (logtest? (-> a0-4 flags) (game-task-node-flag closed)) + (begin + (dotimes (v1-20 4) + (when (and (nonzero? (-> a0-4 parent-node v1-20)) + (not (logtest? (-> s5-0 (-> a0-4 parent-node v1-20) flags) (game-task-node-flag closed))) + ) + (set! v1-19 #t) + (goto cfg-17) + ) + ) + #f + ) + ) + ) + (label cfg-17) + (if v1-19 + (game-task-node-info-method-11 a0-4 'none) + ) + ) + ) + ) + ) + (update-task-masks arg0) + ) + 0 + (none) + ) + +;; definition for function task-node-open? +(defun task-node-open? ((arg0 game-task-node)) + (let ((v1-1 (-> *game-info* sub-task-list))) + (game-task-node-info-method-12 (-> v1-1 arg0)) + ) + ) + +;; definition for method 12 of type game-task-node-info +(defmethod game-task-node-info-method-12 ((this game-task-node-info)) + (local-vars (a0-3 symbol) (a1-1 symbol)) + (let ((a1-0 (-> *game-info* sub-task-list)) + (v1-1 this) + ) + (and (not (logtest? (-> v1-1 flags) (game-task-node-flag closed))) + (begin + (dotimes (a2-2 4) + (let ((t0-0 (-> v1-1 parent-node a2-2))) + (when (and (nonzero? t0-0) (not (logtest? (-> a1-0 t0-0 flags) (game-task-node-flag closed)))) + (set! a1-1 #f) + (goto cfg-12) + ) + ) + ) + (set! a1-1 #t) + (label cfg-12) + a1-1 + ) + (and (or (zero? (+ (-> *setting-control* user-current exclusive-task-count) (-> *game-info* task-node-exclusive length)) + ) + (begin + (dotimes (a1-6 (the-as int (-> *setting-control* user-current exclusive-task-count))) + (when (= (-> *setting-control* user-current exclusive-task a1-6) (-> this task)) + (set! a0-3 #t) + (goto cfg-29) + ) + ) + (dotimes (a1-9 (-> *game-info* task-node-exclusive length)) + (when (= (-> *game-info* task-node-exclusive a1-9) (-> this task)) + (set! a0-3 #t) + (goto cfg-29) + ) + ) + (set! a0-3 #f) + (label cfg-29) + (or a0-3 (logtest? (-> v1-1 flags) (game-task-node-flag auto-close disk-close))) + ) + ) + (or (not (-> v1-1 open?)) ((-> v1-1 open?) v1-1)) + ) + ) + ) + ) + +;; definition for function task-node-open! +(defun task-node-open! ((arg0 game-task-node) (arg1 symbol)) + (let ((s5-0 (-> *game-info* sub-task-list arg0))) + (dotimes (s4-0 4) + (if (nonzero? (-> s5-0 parent-node s4-0)) + (open! (-> *game-info* sub-task-list (-> s5-0 parent-node s4-0)) arg1) + ) + ) + (game-task-node-info-method-11 s5-0 arg1) + ) + 0 + ) + +;; definition for method 13 of type game-task-node-info +;; WARN: Return type mismatch int vs none. +(defmethod eval-game-task-cmd! ((this game-task-node-info)) + (dotimes (v1-0 (the-as int (-> this command-count))) + (case (-> *game-info* task-node-commands (+ (-> this command-index) v1-0)) + (((game-task-node-command none)) + ) + (((game-task-node-command add-jakc)) + (set! (-> *game-info* features) (the-as game-feature (logior (game-feature jakc) (-> *game-info* features)))) + ) + (((game-task-node-command add-sidekick)) + (logior! (-> *game-info* features) (game-feature sidekick)) + ) + (((game-task-node-command sub-sidekick)) + (logclear! (-> *game-info* features) (game-feature sidekick)) + ) + (((game-task-node-command add-board)) + (logior! (-> *game-info* features) (game-feature board)) + ) + (((game-task-node-command add-board-training)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature36) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-board-launch)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature board-launch) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-board-zap)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature board-zap) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-board-trail)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature board-trail) (-> *game-info* features))) + ) + ) + (((game-task-node-command sub-board-trail)) + (set! (-> *game-info* features) + (the-as game-feature (logclear (-> *game-info* features) (game-feature board-trail))) + ) + ) + (((game-task-node-command sub-board)) + (logclear! (-> *game-info* features) (game-feature board)) + ) + (((game-task-node-command add-gun-red-1)) + (logior! (-> *game-info* features) (game-feature gun gun-red-1)) + ) + (((game-task-node-command add-gun-red-2)) + (logior! (-> *game-info* features) (game-feature gun gun-red-2)) + ) + (((game-task-node-command add-gun-red-3)) + (logior! (-> *game-info* features) (game-feature gun gun-red-3)) + ) + (((game-task-node-command add-gun-red-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-red-ammo-1)) + ) + (((game-task-node-command add-gun-red-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-red-ammo-2)) + ) + (((game-task-node-command add-gun-yellow-1)) + (logior! (-> *game-info* features) (game-feature gun gun-yellow-1)) + ) + (((game-task-node-command add-gun-yellow-2)) + (logior! (-> *game-info* features) (game-feature gun gun-yellow-2)) + ) + (((game-task-node-command add-gun-yellow-3)) + (logior! (-> *game-info* features) (game-feature gun gun-yellow-3)) + ) + (((game-task-node-command add-gun-yellow-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-yellow-ammo-1)) + ) + (((game-task-node-command add-gun-yellow-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-yellow-ammo-2)) + ) + (((game-task-node-command add-gun-blue-1)) + (logior! (-> *game-info* features) (game-feature gun gun-blue-1)) + ) + (((game-task-node-command add-gun-blue-2)) + (logior! (-> *game-info* features) (game-feature gun gun-blue-2)) + ) + (((game-task-node-command add-gun-blue-3)) + (logior! (-> *game-info* features) (game-feature gun gun-blue-3)) + ) + (((game-task-node-command add-gun-blue-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-blue-ammo-1)) + ) + (((game-task-node-command add-gun-blue-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-blue-ammo-2)) + ) + (((game-task-node-command add-gun-dark-1)) + (logior! (-> *game-info* features) (game-feature gun gun-dark-1)) + ) + (((game-task-node-command add-gun-dark-2)) + (logior! (-> *game-info* features) (game-feature gun gun-dark-2)) + ) + (((game-task-node-command add-gun-dark-3)) + (logior! (-> *game-info* features) (game-feature gun gun-dark-3)) + ) + (((game-task-node-command add-gun-dark-ammo-1)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-dark-ammo-1)) + ) + (((game-task-node-command add-gun-dark-ammo-2)) + (logior! (-> *game-info* features) (game-feature gun gun-upgrade-dark-ammo-2)) + ) + (((game-task-node-command add-pass-port-mh)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature31) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-port-inda)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature32) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-inda-indb)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature33) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-indb-sluma)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature34) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-pass-slumb-genb)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature35) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkeco)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkeco) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-smack)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak-smack) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-bomb0)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak-bomb0) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-bomb1)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak-bomb1) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-tracking)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature44) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-darkjak-invinc)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature feature45) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lighteco)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lighteco) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-regen)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-regen) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-swoop)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-swoop) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-freeze)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-freeze) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-lightjak-shield)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak lightjak-shield) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-0)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor0) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-1)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor1) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-2)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor2) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-armor-3)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature armor3) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-artifact-invis)) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* features))) + ) + ) + (((game-task-node-command add-light-eco-crystal)) + (+! (-> *game-info* light-crystal) 1.0) + (case (-> *game-info* light-crystal) + ((1.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal0)) + ) + ((2.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal1)) + ) + ((3.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal2)) + ) + ((4.0) + (logior! (-> *game-info* items) (game-items light-eco-crystal3)) + ) + ) + ) + (((game-task-node-command add-dark-eco-crystal)) + (+! (-> *game-info* dark-crystal) 1.0) + (case (-> *game-info* dark-crystal) + ((1.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal0)) + ) + ((2.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal1)) + ) + ((3.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal2)) + ) + ((4.0) + (logior! (-> *game-info* items) (game-items dark-eco-crystal3)) + ) + ) + ) + (((game-task-node-command add-vehicle-turtle)) + (logior! (-> *game-info* vehicles) (game-vehicles v-turtle)) + ) + (((game-task-node-command add-vehicle-snake)) + (logior! (-> *game-info* vehicles) (game-vehicles v-snake)) + ) + (((game-task-node-command add-vehicle-scorpion)) + (logior! (-> *game-info* vehicles) (game-vehicles v-scorpion)) + ) + (((game-task-node-command add-vehicle-toad)) + (logior! (-> *game-info* vehicles) (game-vehicles v-toad)) + ) + (((game-task-node-command add-vehicle-rhino)) + (logior! (-> *game-info* vehicles) (game-vehicles v-rhino)) + ) + (((game-task-node-command add-amulet-1)) + (logior! (-> *game-info* items) (game-items amulet0)) + ) + (((game-task-node-command add-amulet-2)) + (logior! (-> *game-info* items) (game-items amulet1)) + ) + (((game-task-node-command add-amulet-3)) + (logior! (-> *game-info* items) (game-items amulet2)) + ) + (((game-task-node-command add-pass-front-gate)) + (logior! (-> *game-info* items) (game-items pass-front-gate)) + ) + (((game-task-node-command add-seal)) + (logior! (-> *game-info* items) (game-items seal-of-mar)) + ) + (((game-task-node-command add-cypher-gliph)) + (logior! (-> *game-info* items) (game-items cypher-gliph)) + ) + (((game-task-node-command add-av-cube)) + (logior! (-> *game-info* items) (game-items artifact-holocube)) + ) + (((game-task-node-command add-av-reflector)) + (logior! (-> *game-info* items) (game-items artifact-av-reflector)) + ) + (((game-task-node-command add-av-prism)) + (logior! (-> *game-info* items) (game-items artifact-av-prism)) + ) + (((game-task-node-command add-av-generator)) + (logior! (-> *game-info* items) (game-items artifact-av-generator)) + ) + (((game-task-node-command add-av-map)) + (logior! (-> *game-info* items) (game-items artifact-av-map)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function task-node-close-upwards +;; WARN: Return type mismatch int vs none. +(defun task-node-close-upwards ((arg0 (array game-task-node-info)) (arg1 int)) + (let ((s5-0 (-> arg0 arg1))) + (dotimes (s4-0 4) + (when (nonzero? (-> s5-0 parent-node s4-0)) + (let ((v1-11 (-> arg0 (-> s5-0 parent-node s4-0)))) + (when (not (logtest? (-> v1-11 flags) (game-task-node-flag closed))) + (logior! (-> v1-11 flags) (game-task-node-flag closed)) + (task-node-close-upwards arg0 (the-as int (-> s5-0 parent-node s4-0))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function task-node-reset +(defun task-node-reset ((arg0 symbol)) + (let ((s5-0 (-> *game-info* sub-task-list))) + (dotimes (s4-0 (-> s5-0 length)) + (when (nonzero? s4-0) + (let ((s3-0 (-> s5-0 s4-0))) + (when (logtest? (-> s3-0 flags) (game-task-node-flag closed)) + (case arg0 + (('game) + (if (nonzero? s4-0) + (logclear! (-> s3-0 flags) (game-task-node-flag closed)) + ) + ) + (('life) + (if (and (not (task-complete? *game-info* (-> s3-0 task))) + (not (logtest? (-> s3-0 flags) (game-task-node-flag save-on-life))) + ) + (logclear! (-> s3-0 flags) (game-task-node-flag closed)) + ) + ) + (('try) + (if (and (not (task-complete? *game-info* (-> s3-0 task))) + (or (not (logtest? (-> s3-0 flags) (game-task-node-flag save-on-life save-on-try))) + (logtest? (-> s3-0 flags) (game-task-node-flag reset-on-try)) + ) + ) + (logclear! (-> s3-0 flags) (game-task-node-flag closed)) + ) + ) + ) + (if (logtest? (-> s3-0 flags) (game-task-node-flag closed)) + (task-node-close-upwards s5-0 s4-0) + ) + ) + ) + ) + ) + ) + (+! (-> *game-info* task-counter) 1) + 0 + ) + +;; definition (debug) for function task-node-dump +(defun-debug task-node-dump ((arg0 symbol)) + (let ((gp-0 (-> *game-info* sub-task-list))) + (dotimes (s5-0 (-> gp-0 length)) + (when (nonzero? s5-0) + (let* ((s0-0 (-> gp-0 s5-0)) + (s4-0 format) + (s3-0 #t) + (s2-0 " ~-40S ~-8S ~S~%") + (s1-0 (game-task-node->string (the-as game-task-node s5-0))) + (a3-0 (if (task-node-closed? (the-as game-task-node s5-0)) + "closed" + "open" + ) + ) + (t0-0 (and (-> s0-0 manager) (handle->process (-> s0-0 manager manager)))) + ) + (set! t0-0 (cond + (t0-0 + (empty) + t0-0 + ) + (else + "" + ) + ) + ) + (s4-0 s3-0 s2-0 s1-0 a3-0 t0-0) + ) + ) + ) + ) + #f + ) + +;; definition for method 2 of type game-task-event +(defmethod print ((this game-task-event)) + (let* ((t9-0 format) + (a0-1 #t) + (a1-0 "#") + (v1-0 (-> this actor)) + (a2-1 (cond + ((= v1-0 (game-task-actor wascity-turret)) + "wascity-turret" + ) + ((= v1-0 (game-task-actor none)) + "none" + ) + ((= v1-0 (game-task-actor burning-bush-genb-2)) + "burning-bush-genb-2" + ) + ((= v1-0 (game-task-actor unused-slot-18)) + "unused-slot-18" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-3)) + "burning-bush-wasb-3" + ) + ((= v1-0 (game-task-actor burning-bush-desd-3)) + "burning-bush-desd-3" + ) + ((= v1-0 (game-task-actor unused-slot-17)) + "unused-slot-17" + ) + ((= v1-0 (game-task-actor unused-slot-15)) + "unused-slot-15" + ) + ((= v1-0 (game-task-actor burning-bush-inda-1)) + "burning-bush-inda-1" + ) + ((= v1-0 (game-task-actor veger-ruins)) + "veger-ruins" + ) + ((= v1-0 (game-task-actor burning-bush-desb-2)) + "burning-bush-desb-2" + ) + ((= v1-0 (game-task-actor unused-slot-16)) + "unused-slot-16" + ) + ((= v1-0 (game-task-actor burning-bush-desf)) + "burning-bush-desf" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-3)) + "burning-bush-slumb-3" + ) + ((= v1-0 (game-task-actor wascity-leaper)) + "wascity-leaper" + ) + ((= v1-0 (game-task-actor unused-slot-8)) + "unused-slot-8" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-2)) + "burning-bush-slumb-2" + ) + ((= v1-0 (game-task-actor burning-bush-desb)) + "burning-bush-desb" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-2)) + "burning-bush-wasa-2" + ) + ((= v1-0 (game-task-actor seem-wascitya)) + "seem-wascitya" + ) + ((= v1-0 (game-task-actor ashelin-oasis)) + "ashelin-oasis" + ) + ((= v1-0 (game-task-actor was-pre-game-deserte)) + "was-pre-game-deserte" + ) + ((= v1-0 (game-task-actor burning-bush-indb)) + "burning-bush-indb" + ) + ((= v1-0 (game-task-actor burning-bush-port-4)) + "burning-bush-port-4" + ) + ((= v1-0 (game-task-actor burning-bush-port-5)) + "burning-bush-port-5" + ) + ((= v1-0 (game-task-actor seem-wascity)) + "seem-wascity" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-1)) + "burning-bush-wasa-1" + ) + ((= v1-0 (game-task-actor unused-slot-20)) + "unused-slot-20" + ) + ((= v1-0 (game-task-actor vin-vinroom)) + "vin-vinroom" + ) + ((= v1-0 (game-task-actor burning-bush-marka)) + "burning-bush-marka" + ) + ((= v1-0 (game-task-actor burning-bush-slumc-2)) + "burning-bush-slumc-2" + ) + ((= v1-0 (game-task-actor burning-bush-desc-5)) + "burning-bush-desc-5" + ) + ((= v1-0 (game-task-actor unused-slot-19)) + "unused-slot-19" + ) + ((= v1-0 (game-task-actor monk-mummy)) + "monk-mummy" + ) + ((= v1-0 (game-task-actor torn-freehq)) + "torn-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-indb-3)) + "burning-bush-indb-3" + ) + ((= v1-0 (game-task-actor burning-bush-desb-4)) + "burning-bush-desb-4" + ) + ((= v1-0 (game-task-actor seem-temple)) + "seem-temple" + ) + ((= v1-0 (game-task-actor kleever-arena)) + "kleever-arena" + ) + ((= v1-0 (game-task-actor unused-slot-21)) + "unused-slot-21" + ) + ((= v1-0 (game-task-actor burning-bush-indb-2)) + "burning-bush-indb-2" + ) + ((= v1-0 (game-task-actor oracle-oracle)) + "oracle-oracle" + ) + ((= v1-0 (game-task-actor jinx-hiphog)) + "jinx-hiphog" + ) + ((= v1-0 (game-task-actor minimap)) + "minimap" + ) + ((= v1-0 (game-task-actor burning-bush-arena)) + "burning-bush-arena" + ) + ((= v1-0 (game-task-actor damus-wasdoors)) + "damus-wasdoors" + ) + ((= v1-0 (game-task-actor kleever-pen)) + "kleever-pen" + ) + ((= v1-0 (game-task-actor burning-bush-markb)) + "burning-bush-markb" + ) + ((= v1-0 (game-task-actor burning-bush-genb-4)) + "burning-bush-genb-4" + ) + ((= v1-0 (game-task-actor daxter)) + "daxter" + ) + ((= v1-0 (game-task-actor burning-bush-genb-5)) + "burning-bush-genb-5" + ) + ((= v1-0 (game-task-actor torn-hipbar)) + "torn-hipbar" + ) + ((= v1-0 (game-task-actor burning-bush-genb-1)) + "burning-bush-genb-1" + ) + ((= v1-0 (game-task-actor burning-bush-inda-4)) + "burning-bush-inda-4" + ) + ((= v1-0 (game-task-actor burning-bush-desb-3)) + "burning-bush-desb-3" + ) + ((= v1-0 (game-task-actor sig-nest)) + "sig-nest" + ) + ((= v1-0 (game-task-actor unused-slot-22)) + "unused-slot-22" + ) + ((= v1-0 (game-task-actor burning-bush-slumb)) + "burning-bush-slumb" + ) + ((= v1-0 (game-task-actor ashelin-freehq)) + "ashelin-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-desc-2)) + "burning-bush-desc-2" + ) + ((= v1-0 (game-task-actor samos-onintent)) + "samos-onintent" + ) + ((= v1-0 (game-task-actor burning-bush-desd)) + "burning-bush-desd" + ) + ((= v1-0 (game-task-actor burning-bush-desg-2)) + "burning-bush-desg-2" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-6)) + "burning-bush-wasa-6" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-7)) + "burning-bush-wasb-7" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-2)) + "burning-bush-wasb-2" + ) + ((= v1-0 (game-task-actor burning-bush-inda-5)) + "burning-bush-inda-5" + ) + ((= v1-0 (game-task-actor sig-talkbox)) + "sig-talkbox" + ) + ((= v1-0 (game-task-actor pecker-onintent)) + "pecker-onintent" + ) + ((= v1-0 (game-task-actor damus-arena)) + "damus-arena" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-5)) + "burning-bush-wasa-5" + ) + ((= v1-0 (game-task-actor unused-slot-23)) + "unused-slot-23" + ) + ((= v1-0 (game-task-actor damus-wascity)) + "damus-wascity" + ) + ((= v1-0 (game-task-actor monk-wascity)) + "monk-wascity" + ) + ((= v1-0 (game-task-actor damus-desert)) + "damus-desert" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-1)) + "burning-bush-wasb-1" + ) + ((= v1-0 (game-task-actor burning-bush-desc-4)) + "burning-bush-desc-4" + ) + ((= v1-0 (game-task-actor burning-bush-dese-5)) + "burning-bush-dese-5" + ) + ((= v1-0 (game-task-actor was-pre-game-wascityb)) + "was-pre-game-wascityb" + ) + ((= v1-0 (game-task-actor burning-bush-slumc)) + "burning-bush-slumc" + ) + ((= v1-0 (game-task-actor power-game-vinroom)) + "power-game-vinroom" + ) + ((= v1-0 (game-task-actor tess-gungame)) + "tess-gungame" + ) + ((= v1-0 (game-task-actor pecker)) + "pecker" + ) + ((= v1-0 (game-task-actor torn-hipbooth)) + "torn-hipbooth" + ) + ((= v1-0 (game-task-actor burning-bush-desg-4)) + "burning-bush-desg-4" + ) + ((= v1-0 (game-task-actor burning-bush-genc-2)) + "burning-bush-genc-2" + ) + ((= v1-0 (game-task-actor damus-ruins)) + "damus-ruins" + ) + ((= v1-0 (game-task-actor unused-slot-24)) + "unused-slot-24" + ) + ((= v1-0 (game-task-actor ashelin-talkbox)) + "ashelin-talkbox" + ) + ((= v1-0 (game-task-actor burning-bush-port-8)) + "burning-bush-port-8" + ) + ((= v1-0 (game-task-actor burning-bush-port-2)) + "burning-bush-port-2" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-6)) + "burning-bush-wasb-6" + ) + ((= v1-0 (game-task-actor burning-bush-port-3)) + "burning-bush-port-3" + ) + ((= v1-0 (game-task-actor unused-slot-27)) + "unused-slot-27" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-4)) + "burning-bush-slumb-4" + ) + ((= v1-0 (game-task-actor burning-bush-desg-3)) + "burning-bush-desg-3" + ) + ((= v1-0 (game-task-actor sig-wasdoors)) + "sig-wasdoors" + ) + ((= v1-0 (game-task-actor samos-freehq)) + "samos-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-sluma-1)) + "burning-bush-sluma-1" + ) + ((= v1-0 (game-task-actor onin-talkbox)) + "onin-talkbox" + ) + ((= v1-0 (game-task-actor unused-slot-25)) + "unused-slot-25" + ) + ((= v1-0 (game-task-actor burning-bush-desc-3)) + "burning-bush-desc-3" + ) + ((= v1-0 (game-task-actor burning-bush-genb)) + "burning-bush-genb" + ) + ((= v1-0 (game-task-actor burning-bush-markb-2)) + "burning-bush-markb-2" + ) + ((= v1-0 (game-task-actor burning-bush-dese-2)) + "burning-bush-dese-2" + ) + ((= v1-0 (game-task-actor burning-bush-indb-1)) + "burning-bush-indb-1" + ) + ((= v1-0 (game-task-actor unused-slot-9)) + "unused-slot-9" + ) + ((= v1-0 (game-task-actor burning-bush-slumb-1)) + "burning-bush-slumb-1" + ) + ((= v1-0 (game-task-actor unused-slot-28)) + "unused-slot-28" + ) + ((= v1-0 (game-task-actor burning-bush-pal-2)) + "burning-bush-pal-2" + ) + ((= v1-0 (game-task-actor burning-bush-desa-2)) + "burning-bush-desa-2" + ) + ((= v1-0 (game-task-actor burning-bush-farma)) + "burning-bush-farma" + ) + ((= v1-0 (game-task-actor burning-bush-desg)) + "burning-bush-desg" + ) + ((= v1-0 (game-task-actor keira-freehq)) + "keira-freehq" + ) + ((= v1-0 (game-task-actor unused-slot-26)) + "unused-slot-26" + ) + ((= v1-0 (game-task-actor burning-bush-desd-5)) + "burning-bush-desd-5" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-5)) + "burning-bush-wasb-5" + ) + ((= v1-0 (game-task-actor burning-bush-desc)) + "burning-bush-desc" + ) + ((= v1-0 (game-task-actor burning-bush-genb-3)) + "burning-bush-genb-3" + ) + ((= v1-0 (game-task-actor onin-onintent)) + "onin-onintent" + ) + ((= v1-0 (game-task-actor unused-slot-29)) + "unused-slot-29" + ) + ((= v1-0 (game-task-actor unused-slot-10)) + "unused-slot-10" + ) + ((= v1-0 (game-task-actor burning-bush-inda-2)) + "burning-bush-inda-2" + ) + ((= v1-0 (game-task-actor unused-slot-30)) + "unused-slot-30" + ) + ((= v1-0 (game-task-actor burning-bush-inda-3)) + "burning-bush-inda-3" + ) + ((= v1-0 (game-task-actor burning-bush-slumc-1)) + "burning-bush-slumc-1" + ) + ((= v1-0 (game-task-actor samos-genb)) + "samos-genb" + ) + ((= v1-0 (game-task-actor burning-bush-dese-4)) + "burning-bush-dese-4" + ) + ((= v1-0 (game-task-actor burning-bush-desh)) + "burning-bush-desh" + ) + ((= v1-0 (game-task-actor samos-talkbox)) + "samos-talkbox" + ) + ((= v1-0 (game-task-actor burning-bush-farmb)) + "burning-bush-farmb" + ) + ((= v1-0 (game-task-actor gun-gungame)) + "gun-gungame" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-4)) + "burning-bush-wasa-4" + ) + ((= v1-0 (game-task-actor unused-slot-12)) + "unused-slot-12" + ) + ((= v1-0 (game-task-actor onin-freehq)) + "onin-freehq" + ) + ((= v1-0 (game-task-actor burning-bush-desa-3)) + "burning-bush-desa-3" + ) + ((= v1-0 (game-task-actor burning-bush-port-6)) + "burning-bush-port-6" + ) + ((= v1-0 (game-task-actor unused-slot-11)) + "unused-slot-11" + ) + ((= v1-0 (game-task-actor unused-slot-31)) + "unused-slot-31" + ) + ((= v1-0 (game-task-actor burning-bush-wasa-3)) + "burning-bush-wasa-3" + ) + ((= v1-0 (game-task-actor veger-cave)) + "veger-cave" + ) + ((= v1-0 (game-task-actor burning-bush-port-1)) + "burning-bush-port-1" + ) + ((= v1-0 (game-task-actor keira-genb)) + "keira-genb" + ) + ((= v1-0 (game-task-actor burning-bush-dese-3)) + "burning-bush-dese-3" + ) + ((= v1-0 (game-task-actor burning-bush-gena-2)) + "burning-bush-gena-2" + ) + ((= v1-0 (game-task-actor burning-bush-genc)) + "burning-bush-genc" + ) + ((= v1-0 (game-task-actor burning-bush-desd-2)) + "burning-bush-desd-2" + ) + ((= v1-0 (game-task-actor burning-bush-desa)) + "burning-bush-desa" + ) + ((= v1-0 (game-task-actor burning-bush-port)) + "burning-bush-port" + ) + ((= v1-0 (game-task-actor burning-bush-inda)) + "burning-bush-inda" + ) + ((= v1-0 (game-task-actor burning-bush-stadium)) + "burning-bush-stadium" + ) + ((= v1-0 (game-task-actor damus-waspal)) + "damus-waspal" + ) + ((= v1-0 (game-task-actor burning-bush-port-7)) + "burning-bush-port-7" + ) + ((= v1-0 (game-task-actor burning-bush-wasb-4)) + "burning-bush-wasb-4" + ) + ((= v1-0 (game-task-actor keira-garage)) + "keira-garage" + ) + ((= v1-0 (game-task-actor torn-hiptable)) + "torn-hiptable" + ) + ((= v1-0 (game-task-actor torn-hiphog)) + "torn-hiphog" + ) + ((= v1-0 (game-task-actor kleever-wasdoors)) + "kleever-wasdoors" + ) + ((= v1-0 (game-task-actor unused-slot-14)) + "unused-slot-14" + ) + ((= v1-0 (game-task-actor unused-slot-13)) + "unused-slot-13" + ) + ((= v1-0 (game-task-actor burning-bush-dese)) + "burning-bush-dese" + ) + ((= v1-0 (game-task-actor seem-leaper)) + "seem-leaper" + ) + ((= v1-0 (game-task-actor burning-bush-pal)) + "burning-bush-pal" + ) + ((= v1-0 (game-task-actor kleever-wascityb)) + "kleever-wascityb" + ) + ((= v1-0 (game-task-actor burning-bush-desd-4)) + "burning-bush-desd-4" + ) + ((= v1-0 (game-task-actor burning-bush-sluma-3)) + "burning-bush-sluma-3" + ) + ((= v1-0 (game-task-actor burning-bush-sluma-2)) + "burning-bush-sluma-2" + ) + ((= v1-0 (game-task-actor burning-bush-gena)) + "burning-bush-gena" + ) + ((= v1-0 (game-task-actor burning-bush-sluma)) + "burning-bush-sluma" + ) + (else + "*unknown*" + ) + ) + ) + (v1-1 (-> this action)) + ) + (t9-0 + a0-1 + a1-0 + a2-1 + (cond + ((= v1-1 (game-task-action idle)) + "idle" + ) + ((= v1-1 (game-task-action play)) + "play" + ) + ((= v1-1 (game-task-action show)) + "show" + ) + ((= v1-1 (game-task-action talk)) + "talk" + ) + ((= v1-1 (game-task-action hide)) + "hide" + ) + ((= v1-1 (game-task-action say)) + "say" + ) + ((= v1-1 (game-task-action trade)) + "trade" + ) + ((= v1-1 (game-task-action menu)) + "menu" + ) + (else + "*unknown*" + ) + ) + (-> this scene) + this + ) + ) + this + ) + +;; definition for method 0 of type game-task-control +(defmethod new game-task-control ((allocation symbol) (type-to-make type) (arg0 game-task-actor)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 actor) arg0) + v0-0 + ) + ) + +;; definition for method 9 of type game-task-control +(defmethod get-current-task-event ((this game-task-control)) + (let ((gp-0 (new 'static 'game-task-event :scene #f))) + (let ((s4-0 #f)) + (when (!= (-> this counter) (-> *game-info* task-counter)) + (set! (-> this counter) (-> *game-info* task-counter)) + (set! (-> this current-node) (game-task-node none)) + (set! (-> this current-event) #f) + (set! s4-0 #t) + (let ((s2-0 (-> *game-info* sub-task-list))) + (dotimes (s3-0 (-> s2-0 length)) + (when (nonzero? s3-0) + (let ((s1-0 (-> s2-0 s3-0))) + (when (and (task-node-open? (the-as game-task-node s3-0)) + (-> s1-0 when-open) + (begin + (countdown (v1-12 (-> s1-0 when-open length)) + (when (= (-> this actor) (-> s1-0 when-open v1-12 actor)) + (set! (-> this current-event) (-> s1-0 when-open v1-12)) + (set! (-> this current-node) (the-as game-task-node s3-0)) + #t + (goto cfg-18) + ) + ) + #f + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + (cond + ((= (-> this current-node) (game-task-node none)) + (set! (-> gp-0 actor) (-> this actor)) + ) + ((begin (set! gp-0 (-> this current-event)) (not (logtest? (-> gp-0 flags) (game-task-flags gatflag-00)))) + ) + (else + (set! (-> gp-0 action) (the-as game-task-action (-> gp-0 tex))) + ) + ) + (if s4-0 + (logior! (-> gp-0 flags) (game-task-flags gatflag-01)) + (logclear! (-> gp-0 flags) (game-task-flags gatflag-01)) + ) + ) + gp-0 + ) + ) + +;; definition of type resetter +(deftype resetter (process) + ((params resetter-params :inline) + (message resetter-message :overlay-at (-> params message)) + (flags resetter-flag :overlay-at (-> params flags)) + (reset-delay uint32 :overlay-at (-> params reset-delay)) + (task game-task :overlay-at (-> params task)) + (text-message text-id :overlay-at (-> params text-message)) + (retry resetter-spec :inline :overlay-at (-> params retry)) + (retry-continue continue-point :overlay-at (-> params retry continue)) + (retry-node game-task-node :overlay-at (-> params retry node)) + (retry-reset-mode symbol :overlay-at (-> params retry reset-mode)) + (fail resetter-spec :inline :overlay-at (-> params fail)) + (fail-continue continue-point :overlay-at (-> params fail continue)) + (fail-node game-task-node :overlay-at (-> params fail node)) + (fail-reset-mode symbol :overlay-at (-> params fail reset-mode)) + (resetter-id text-id :offset 176) + (grabbed-player? symbol :offset 180) + (grabbed-time time-frame) + (dead-player? symbol) + (retry? symbol) + (message-id text-id) + (stinger uint32) + (start-time time-frame) + ) + (:state-methods + idle + resetting + ) + (:methods + (resetter-method-16 (_type_) none) + ) + ) + +;; definition for method 3 of type resetter +(defmethod inspect ((this resetter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Tmessage: ~D~%" (-> this params message)) + (format #t "~2Tflags: ~D~%" (-> this params flags)) + (format #t "~2Treset-delay: ~D~%" (-> this params reset-delay)) + (format #t "~2Ttask: ~D~%" (-> this params task)) + (format #t "~2Ttext-message: ~D~%" (-> this params text-message)) + (format #t "~2Tretry: #~%" (-> this params retry)) + (format #t "~2Tretry-continue: ~A~%" (-> this params retry continue)) + (format #t "~2Tretry-node: ~D~%" (-> this params retry node)) + (format #t "~2Tretry-reset-mode: ~A~%" (-> this params retry reset-mode)) + (format #t "~2Tfail: #~%" (-> this params fail)) + (format #t "~2Tfail-continue: ~A~%" (-> this params fail continue)) + (format #t "~2Tfail-node: ~D~%" (-> this params fail node)) + (format #t "~2Tfail-reset-mode: ~A~%" (-> this params fail reset-mode)) + (format #t "~2Tresetter-id: ~D~%" (-> this resetter-id)) + (format #t "~2Tgrabbed-player?: ~A~%" (-> this grabbed-player?)) + (format #t "~2Tgrabbed-time: ~D~%" (-> this grabbed-time)) + (format #t "~2Tdead-player?: ~A~%" (-> this dead-player?)) + (format #t "~2Tretry?: ~A~%" (-> this retry?)) + (format #t "~2Tmessage-id: ~D~%" (-> this message-id)) + (format #t "~2Tstinger: ~D~%" (-> this stinger)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (label cfg-4) + this + ) + +;; definition for method 12 of type resetter +(defmethod run-logic? ((this resetter)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 16 of type resetter +;; WARN: Return type mismatch float vs none. +(defmethod resetter-method-16 ((this resetter)) + (when (and (not (logtest? (-> this params flags) (resetter-flag no-message))) + (= (get-status *gui-control* (the-as sound-id (-> this message-id))) (gui-status active)) + ) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) + ) + ) + (set! (-> gp-0 origin x) 120.0) + (let ((v1-7 gp-0)) + (set! (-> v1-7 scale) 0.7) + ) + (let ((v1-8 gp-0)) + (set! (-> v1-8 width) (the float 300)) + ) + (let ((v1-9 gp-0)) + (set! (-> v1-9 height) (the float 35)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((s4-0 (if (logtest? (-> this params flags) (resetter-flag text-message)) + (the-as int (-> this params text-message)) + 138 + ) + ) + ) + (when (nonzero? s4-0) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as text-id s4-0) #f) 1) + (s3-0 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (when (= (-> this params message) (resetter-message mission-fail-or-retry)) + (let ((v1-17 gp-0)) + (set! (-> v1-17 height) (the float 95)) + ) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-008b) #f) 1) + (s5-1 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-19 gp-0)) + (set! (-> v1-19 height) (the float 155)) + ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0081) #f) 1) + (s5-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (resetter) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + (cond + ((-> self grabbed-player?) + (persist-with-delay *setting-control* 'fail (seconds 10) 'bg-a 'abs 1.0 0) + (go-virtual resetting) + ) + (else + (logior! (-> self params flags) (resetter-flag auto-reset)) + (set! (-> self params reset-delay) (the-as uint 0)) + #t + ) + ) + ) + (('query) + (case (-> block param 0) + (('reset) + (-> self grabbed-player?) + ) + ) + ) + ) + ) + :exit (behavior () + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (update-rates! (-> *display* camera-clock) 1.0) + ) + :code (behavior () + (if (and *target* (focus-test? *target* dead)) + (set! (-> self dead-player?) #t) + ) + (cond + ((or (= (-> self params message) (resetter-message mission-fail)) + (= (-> self params message) (resetter-message mission-retry)) + (logtest? (-> self params flags) (resetter-flag no-grab)) + ) + (while (begin + (if (and *target* (focus-test? *target* grabbed)) + (process-release? *target*) + ) + (if (logtest? (-> self params flags) (resetter-flag no-draw-target)) + (send-event *target* 'draw #f) + ) + (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) 'attack-invinc) + (set! (-> a1-1 param 0) (the-as uint #f)) + (set! (-> a1-1 param 1) + (the-as + uint + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'bot)) + ) + ) + ) + (not (or (send-event-function *target* a1-1) (and *target* (focus-test? *target* dead)))) + ) + ) + (suspend) + ) + (hide-hud 'hud-health) + ) + ((= (-> self params message) (resetter-message mission-fail-or-retry)) + (while (not (process-grab? *target* 'dead)) + (suspend) + ) + ) + ) + (set! (-> self grabbed-player?) #t) + (set! (-> self grabbed-time) (-> *display* real-clock frame-counter)) + (kill-current-talker '() '() 'exit) + (when (and (not (-> self dead-player?)) (not (logtest? (-> self params flags) (resetter-flag no-slow-down)))) + (while (< (- (-> *display* real-clock frame-counter) (-> self grabbed-time)) (seconds 1.5)) + (let ((f30-0 + (lerp-scale 0.0 1.0 (the float (- (-> *display* real-clock frame-counter) (-> self grabbed-time))) 0.0 450.0) + ) + ) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-0 0.0 1.0) + (lerp-scale 1.0 0.875 f30-0 0.0 1.0) + (lerp-scale 1.0 0.25 f30-0 0.0 1.0) + ) + (update-rates! (-> *display* bg-clock) (- 1.0 f30-0)) + (update-rates! (-> *display* entity-clock) (- 1.0 f30-0)) + (update-rates! (-> *display* target-clock) (- 1.0 f30-0)) + (update-rates! (-> *display* camera-clock) (- 1.0 f30-0)) + ) + (resetter-method-16 self) + (suspend) + ) + (+! (-> self clock ref-count) -1) + (+! (-> *display* real-clock ref-count) 1) + (set! (-> self clock) (-> *display* real-clock)) + (logclear! (-> self mask) (process-mask freeze)) + (set-master-mode 'freeze) + (set-setting! 'sfx-volume 'abs 0.0 0) + (set-setting! 'ambient-volume 'abs 0.0 0) + ) + (case (-> self params message) + (((resetter-message mission-fail) (resetter-message mission-retry)) + (until #f + (when (or (and (logtest? (-> self params flags) (resetter-flag auto-reset)) + (>= (- (-> *display* real-clock frame-counter) (-> self grabbed-time)) + (the-as time-frame (-> self params reset-delay)) + ) + ) + (or (cpad-pressed? 0 confirm) + (and (kiosk?) + (>= (- (-> *display* real-clock frame-counter) (-> self start-time)) (seconds 60)) + (>= (- (-> *display* real-clock frame-counter) (-> *cpad-list* cpads 0 real-change-time)) (seconds 60)) + ) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (if (= (-> self params message) (resetter-message mission-retry)) + (set! (-> self retry?) #t) + ) + (persist-with-delay *setting-control* 'fail (seconds 10) 'bg-a 'abs 1.0 0) + (go-virtual resetting) + ) + (resetter-method-16 self) + (suspend) + ) + #f + ) + (((resetter-message mission-fail-or-retry)) + (until #f + (when (cpad-pressed? 0 confirm) + (sound-play "mission-retry") + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> self retry?) #t) + (cond + ((not *target*) + ) + ((focus-test? *target* grabbed) + (while (not (process-release? *target*)) + (suspend) + ) + ) + ) + (suspend) + (persist-with-delay *setting-control* 'fail (seconds 10) 'bg-a 'abs 1.0 0) + (go-virtual resetting) + ) + (let ((v1-147 (when (cpad-pressed? 0 triangle) + (sound-play "mission-quit") + #t + ) + ) + ) + (when (or v1-147 + (and (kiosk?) + (>= (- (-> *display* real-clock frame-counter) (-> self start-time)) (seconds 60)) + (>= (- (-> *display* real-clock frame-counter) (-> *cpad-list* cpads 0 real-change-time)) (seconds 60)) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> self retry?) #f) + (cond + ((not *target*) + ) + ((focus-test? *target* grabbed) + (while (not (process-release? *target*)) + (suspend) + ) + ) + ) + (suspend) + (go-virtual resetting) + ) + ) + (resetter-method-16 self) + (suspend) + ) + #f + ) + ) + ) + ) + +;; definition for method 10 of type resetter +(defmethod deactivate ((this resetter)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set-filter-color! 1.0 1.0 1.0) + (sound-group-continue (the-as sound-group #xffffffff)) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (update-rates! (-> *display* camera-clock) 1.0) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate resetting (resetter) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('reset) + #t + ) + (('query) + (case (-> block param 0) + (('reset) + #t + ) + ) + ) + ) + ) + :exit (behavior () + (if (= *master-mode* 'freeze) + (set-master-mode 'game) + ) + (process-release? *target*) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 300.0))) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-0 0.0 1.0) + (lerp-scale 1.0 0.875 f30-0 0.0 1.0) + (lerp-scale 1.0 0.25 f30-0 0.0 1.0) + ) + ) + (suspend) + ) + ) + (let ((gp-1 (if (-> self retry?) + (-> self params retry) + (-> self params fail) + ) + ) + ) + (format 0 "---------> resetting with ~`resetter-spec`P~%" gp-1) + (let ((s5-1 (-> gp-1 execute))) + (if s5-1 + (script-eval (the-as pair s5-1)) + ) + ) + (cond + ((and *target* + (or (and (focus-test? *target* dead) #t) (and (not (-> gp-1 continue)) (focus-test? *target* grabbed))) + ) + (inc-death-count! *game-info*) + (if (-> gp-1 continue) + (set-continue! *game-info* (-> gp-1 continue) #t) + ) + (when (-> gp-1 reset-mode) + (task-node-reset (-> gp-1 reset-mode)) + (update-task-masks (-> gp-1 reset-mode)) + ) + (if (nonzero? (-> gp-1 node)) + (task-node-open! (-> gp-1 node) 'event) + ) + (if (and *target* (focus-test? *target* dead grabbed)) + (send-event *target* 'end-mode 'bot (if (-> self retry?) + (-> self params retry) + (-> self params fail) + ) + ) + ) + ) + (else + (initialize! *game-info* #f (the-as game-save #f) (the-as string #f) gp-1) + ) + ) + (cond + ((or (and *target* (focus-test? *target* dead)) (-> gp-1 continue)) + (persist-with-delay *setting-control* 'fail-sfx-volume (seconds 3) 'sfx-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-dialog-volume (seconds 3) 'dialog-volume 'abs 0.0 0) + (persist-with-delay *setting-control* 'fail-music-volume (seconds 3) 'music-volume 'abs 0.0 0) + ) + (else + (set-action! + *gui-control* + (gui-action fade) + (the-as sound-id (-> self stinger)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + ) + (persist-with-delay *setting-control* 'allow-continue (seconds 3) 'allow-continue #f 0.0 0) + (persist-with-delay *setting-control* 'speech-control (seconds 3) 'speech-control #f 0.0 0) + ) + ) + +;; definition for function resetter-init-by-other +(defbehavior resetter-init-by-other resetter ((arg0 resetter-params) (arg1 game-task-node-info)) + (stack-size-set! (-> self main-thread) 512) + (mem-copy! (the-as pointer (-> self params)) (the-as pointer arg0) 48) + (set! (-> self grabbed-player?) #f) + (set! (-> self dead-player?) #f) + (set! (-> self retry?) #f) + (set-setting! 'allow-continue #f 0.0 0) + (set-setting! 'gun-eject #f 0.0 0) + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self start-time) (-> *display* real-clock frame-counter)) + (set! (-> *game-info* mode) 'play) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel guard) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel citizen) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel jak-mode) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (when (not (or (logtest? (-> arg0 flags) (resetter-flag no-audio)) + (and arg1 (logtest? (-> arg0 flags) (resetter-flag no-audio-first)) (zero? (-> arg1 death-count))) + ) + ) + (if (and arg1 (logtest? (-> arg0 flags) (resetter-flag no-audio-first))) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + (gui-channel alert) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (set! (-> self stinger) + (the-as uint (add-process *gui-control* *target* (gui-channel task) (gui-action play) "lose1" -99.0 0)) + ) + (sound-params-set! *gui-control* (the-as sound-id (-> self stinger)) #f -1 -1 -1 0.75) + ) + (set-setting! 'music-volume 'abs 0.0 0) + (if (logtest? (-> arg0 flags) (resetter-flag stop-sfx)) + (set-setting! 'sfx-volume 'abs 0.0 0) + ) + (set-setting! 'speech-control #f 0.0 0) + (set-setting! 'allow-progress #f 0.0 0) + (set-setting! 'allow-pause #f 0.0 0) + (+! (-> self clock ref-count) -1) + (+! (-> *display* base-clock ref-count) 1) + (set! (-> self clock) (-> *display* base-clock)) + (apply-settings *setting-control*) + (if (or (not (logtest? (-> self params flags) (resetter-flag text-message))) + (nonzero? (-> self params text-message)) + (= (-> self params message) (resetter-message mission-fail-or-retry)) + ) + (set! (-> self message-id) + (the-as text-id (add-process *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0)) + ) + ) + (set! (-> self resetter-id) + (the-as text-id (add-process *gui-control* self (gui-channel resetter) (gui-action play) "fail" -99.0 0)) + ) + (go-virtual idle) + ) + +;; definition for method 11 of type resetter-control +(defmethod spawn-resetter! ((this resetter-control) (arg0 resetter-params) (arg1 game-task-node-info)) + (when (not (handle->process (-> this process))) + (let ((v1-4 (process-spawn resetter arg0 arg1 :name "resetter" :to *entity-pool*))) + (when v1-4 + (set! (-> this process) (process->handle (-> v1-4 0))) + #t + ) + ) + ) + ) + +;; definition for method 12 of type resetter-control +(defmethod do-reset ((this resetter-control)) + (send-event (handle->process (-> this process)) 'reset) + ) + +;; definition for method 9 of type resetter-control +(defmethod check-reset ((this resetter-control)) + (send-event (handle->process (-> this process)) 'query 'reset) + ) + +;; definition for method 10 of type resetter-control +(defmethod get-resetter ((this resetter-control)) + (handle->process (-> this process)) + ) + +;; definition for method 25 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-25 ((this task-manager)) + 0 + (none) + ) + +;; definition for method 26 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager)) + 0 + (none) + ) + +;; definition for method 27 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-27 ((this task-manager)) + 0 + (none) + ) + +;; definition for method 28 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-28 ((this task-manager)) + 0 + (none) + ) + +;; definition for method 31 of type task-manager +;; WARN: Return type mismatch structure vs resetter-params. +;; WARN: disable def twice: 65. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 127. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 189. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 251. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod on-fail ((this task-manager) (arg0 symbol)) + (local-vars (v0-0 structure)) + (let ((gp-0 (-> *game-info* sub-task-list (-> this node-info manager final-node))) + (s5-0 (-> this node-info)) + (v1-5 arg0) + ) + (the-as + resetter-params + (cond + ((= v1-5 'death) + (let ((v1-7 (-> *setting-control* user-current death-info))) + (if v1-7 + (return (the-as resetter-params v1-7)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset death-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset death-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset death-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset death-info))) + v0-0 + ) + ) + ((= v1-5 'fail) + (let ((v1-35 (-> *setting-control* user-current fail-info))) + (if v1-35 + (return (the-as resetter-params v1-35)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset fail-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset fail-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset fail-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset fail-info))) + v0-0 + ) + ) + ((= v1-5 'restart) + (let ((v1-63 (-> *setting-control* user-current restart-info))) + (if v1-63 + (return (the-as resetter-params v1-63)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset restart-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset restart-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset restart-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset restart-info))) + v0-0 + ) + ) + ((= v1-5 'quit) + (let ((v1-91 (-> *setting-control* user-current quit-info))) + (if v1-91 + (return (the-as resetter-params v1-91)) + ) + ) + (while (!= gp-0 s5-0) + (if (and (-> gp-0 reset) + (-> gp-0 reset quit-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset quit-info))) + ) + (set! gp-0 (-> *game-info* sub-task-list (-> gp-0 parent-node 0))) + ) + (when (and (-> gp-0 reset) + (-> gp-0 reset quit-info) + (or (logtest? (-> gp-0 flags) (game-task-node-flag closed)) (game-task-node-info-method-12 gp-0)) + ) + (return (the-as resetter-params (-> gp-0 reset quit-info))) + v0-0 + ) + ) + (else + (the-as structure #f) + ) + ) + ) + ) + ) + +;; definition for function task-manager-init-by-other +(defbehavior task-manager-init-by-other task-manager ((arg0 game-task-node-info) (arg1 symbol)) + (stack-size-set! (-> self main-thread) 1024) + (add-connection *task-manager-engine* self nothing self arg0 #f) + (set! (-> self node-info) arg0) + (set! (-> self lev-name) arg1) + (add-setting! 'task arg0 0.0 0) + (add-setting! 'task-manager (process->ppointer self) 0.0 0) + (set-time! (-> self intro-time)) + (set! (-> self fail-on-death?) (if (and (-> self node-info reset) (-> self node-info reset death-info)) + #t + #f + ) + ) + (when arg1 + (let* ((v1-19 (level-get *level* arg1)) + (a1-6 (if (and (nonzero? (-> v1-19 entity)) (> (-> v1-19 entity length) 0)) + (-> v1-19 entity data 0 entity) + ) + ) + ) + (if a1-6 + (process-entity-set! self a1-6) + ) + ) + ) + (init! self) + (go-virtual wait) + ) + +;; definition for method 22 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod kill-all-children ((this task-manager)) + (while (-> this child) + (deactivate (ppointer->process (-> this child))) + ) + 0 + (none) + ) + +;; definition for method 29 of type task-manager +;; WARN: Return type mismatch int vs object. +(defmethod go-fail ((this task-manager)) + (if *debug-segment* + (format #t "task failed: ran out of time~%") + ) + (go (method-of-object this fail) (on-fail this 'fail)) + 0 + ) + +;; definition for method 23 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod hud-timer-handler ((this task-manager)) + (when (nonzero? (-> this start-time)) + (let ((v1-3 (handle->process (-> this hud-timer)))) + (if (and *target* (not v1-3)) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to *target*)) + ) + ) + ) + (let ((v1-13 (- (-> this time-limit) (- (current-time) (-> this start-time))))) + (let ((a0-15 *game-info*)) + (set! (-> a0-15 timer) v1-13) + (set! (-> a0-15 timer-flash) (< v1-13 (seconds 10))) + ) + (when (< v1-13 0) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (go-fail this) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 20 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this task-manager)) + (set! (-> this info) (-> this node-info manager)) + (countdown (v1-2 4) + (set! (-> this hud v1-2) (the-as handle #f)) + ) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this player-vehicle) (the-as handle #f)) + (set! (-> this fail-now) #f) + (set! (-> this restart-now) #f) + (set! (-> this allow-fail) #t) + 0 + (none) + ) + +;; definition for method 21 of type task-manager +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager)) + (when (logtest? (-> this info mask) (task-manager-mask time-limit)) + (set-time! (-> this start-time)) + (set! (-> this time-limit) (the-as time-frame (-> this info time-limit))) + ) + 0 + (none) + ) + +;; definition for method 10 of type task-manager +(defmethod deactivate ((this task-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (with-pp + (let ((s5-0 pp)) + (set! pp this) + (task-manager-method-25 this) + (set! pp s5-0) + ) + (countdown (s5-1 4) + (send-event (handle->process (-> this hud s5-1)) 'hide-and-die) + ) + ((method-of-type process deactivate) this) + (none) + ) + ) + +;; definition for function task-manager-event-handler +(defbehavior task-manager-event-handler task-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (taskman-event-handler self arg0 arg1 arg2 arg3) + ) + +;; definition for method 30 of type task-manager +(defmethod taskman-event-handler ((this task-manager) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-2 object)) + (case arg2 + (('fail) + (let ((s4-0 (on-fail this 'fail)) + (v1-2 (if (>= arg1 1) + (-> arg3 param 0) + ) + ) + ) + (if (and (not (and (-> this next-state) (let ((a0-7 (-> this next-state name))) + (or (= a0-7 'complete) (= a0-7 'resolution) (= a0-7 'fail) (= a0-7 'retry)) + ) + ) + ) + (or (not v1-2) s4-0) + (not (scene-select?)) + ) + (go (method-of-object this fail) s4-0) + ) + ) + ) + (('restart) + (let ((a0-12 (on-fail this 'restart))) + (if (and (not (and (-> this next-state) (let ((v1-11 (-> this next-state name))) + (or (= v1-11 'complete) (= v1-11 'fail) (= v1-11 'restart)) + ) + ) + ) + a0-12 + ) + (go (method-of-object this restart) (the-as symbol a0-12)) + ) + ) + ) + (('restart-immediately) + (let ((a0-16 (on-fail this 'restart))) + (when (and (or (not (and (-> this next-state) (let ((v1-19 (-> this next-state name))) + (or (= v1-19 'complete) (= v1-19 'resolution) (= v1-19 'fail) (= v1-19 'restart)) + ) + ) + ) + (not (-> this allow-fail)) + ) + a0-16 + ) + (set! (-> this restart-now) #t) + (go (method-of-object this restart) (the-as symbol a0-16)) + ) + ) + ) + (('quit) + (let ((a0-20 (on-fail this 'quit))) + (if (and (not (and (-> this next-state) (let ((v1-30 (-> this next-state name))) + (or (= v1-30 'complete) (= v1-30 'resolution) (= v1-30 'fail) (= v1-30 'restart)) + ) + ) + ) + a0-20 + ) + (go (method-of-object this restart) (the-as symbol a0-20)) + ) + ) + ) + (('complete) + (if (or (not (and (-> this next-state) (let ((v1-37 (-> this next-state name))) + (or (= v1-37 'complete) (= v1-37 'resolution) (= v1-37 'fail) (= v1-37 'restart)) + ) + ) + ) + (not (-> this allow-fail)) + ) + (go (method-of-object this complete)) + ) + ) + (('wait) + (go (method-of-object this wait)) + ) + (('active) + (go (method-of-object this active)) + ) + (('fail-on-death) + (set! v0-2 (-> arg3 param 0)) + (set! (-> this fail-on-death?) (the-as symbol v0-2)) + v0-2 + ) + (('target) + (case (-> arg3 param 0) + (('die) + (let ((a0-37 (on-fail this 'death))) + (when a0-37 + (if (not (and (-> this next-state) + (let ((v1-51 (-> this next-state name))) + (or (= v1-51 'wait) (= v1-51 'complete) (= v1-51 'resolution) (= v1-51 'fail) (= v1-51 'restart)) + ) + ) + ) + (go (method-of-object this fail) a0-37) + ) + (if (not (and (-> this next-state) (let ((v1-59 (-> this next-state name))) + (or (= v1-59 'wait) (= v1-59 'complete) (= v1-59 'resolution)) + ) + ) + ) + 'wait + ) + ) + ) + ) + ) + ) + (('fail-continue) + (let ((v1-61 (on-fail this 'fail))) + (when v1-61 + (case (-> v1-61 message) + (((resetter-message mission-retry)) + (-> v1-61 retry) + ) + (else + (-> v1-61 fail) + ) + ) + ) + ) + ) + (('fail-immediately) + (when (or (not (and (-> this next-state) (let ((v1-65 (-> this next-state name))) + (or (= v1-65 'complete) (= v1-65 'resolution) (= v1-65 'fail) (= v1-65 'restart)) + ) + ) + ) + (not (-> this allow-fail)) + ) + (set! (-> this allow-fail) #t) + (set! (-> this fail-now) #t) + (go (method-of-object this fail) (on-fail this 'fail)) + ) + ) + (('allow-fail) + (set! v0-2 (-> arg3 param 0)) + (set! (-> this allow-fail) (the-as symbol v0-2)) + v0-2 + ) + ) + ) + +;; definition for method 24 of type task-manager +(defmethod ready? ((this task-manager)) + (and (or (not (logtest? (game-task-node-flag city-wait) (-> this node-info flags))) + (let ((a0-4 (level-get-target-inside *level*))) + (cond + ((not (and a0-4 (logtest? (-> a0-4 info level-flags) (level-flags lf0)))) + (set-time! (-> this intro-time)) + #f + ) + (else + #t + ) + ) + ) + ) + (or (zero? (-> this info intro-delay)) + (time-elapsed? (-> this intro-time) (the-as time-frame (-> this info intro-delay))) + ) + (and *target* (not (logtest? (focus-status dead teleporting) (-> *target* focus-status)))) + (not (-> *setting-control* user-current talking)) + ) + ) + +;; failed to figure out what this is: +(defstate wait (task-manager) + :virtual #t + :event task-manager-event-handler + :trans (behavior () + (if (or (and (nonzero? (-> self info final-node)) (task-node-closed? (-> self info final-node))) + (and (not (logtest? (-> self node-info flags) (game-task-node-flag closed))) + (not (game-task-node-info-method-12 (-> self node-info))) + ) + ) + (deactivate self) + ) + ) + :code (behavior () + (local-vars (v1-18 symbol)) + (while (or (not *target*) (not *spawn-actors*)) + (suspend) + ) + (when (or (logtest? (game-task-node-flag intro-wait city-wait) (-> self node-info flags)) + (nonzero? (-> self info intro-delay)) + ) + (while (not (ready? self)) + (suspend) + ) + (let ((a0-5 (-> self info intro-scene))) + (when a0-5 + (let ((gp-1 (talker-spawn-func + (string->talker-speech (the-as string a0-5)) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + ) + ) + (get-status *gui-control* gp-1) + (until v1-18 + (suspend) + (let ((v1-17 (get-status *gui-control* gp-1))) + (set! v1-18 (or (= v1-17 (gui-status stop)) (= v1-17 (gui-status unknown)))) + ) + ) + ) + ) + ) + (if (logtest? (-> self node-info flags) (game-task-node-flag intro-wait)) + (open! (-> self node-info) 'event) + ) + ) + (set-time-limit self) + (if (logtest? (-> self info mask) (task-manager-mask auto-complete)) + (go-virtual complete) + ) + (go-virtual active) + ) + ) + +;; failed to figure out what this is: +(defstate active (task-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + ((-> (method-of-object self wait) trans)) + (if (logtest? (-> self info mask) (task-manager-mask time-limit)) + (hud-timer-handler self) + ) + (if (and *debug-segment* (not *editable*)) + (format *stdebug* "task-manager ~A alive~%" (-> self node-info name)) + ) + (task-manager-method-26 self) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate complete (task-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-setting! 'allow-progress #f 0.0 0) + ) + :code (behavior () + (if (get-resetter *resetter-control*) + (sleep-code) + ) + (send-event (handle->process (-> self arrow)) 'die) + (countdown (gp-0 4) + (send-event (handle->process (-> self hud gp-0)) 'hide-and-die) + ) + (let ((gp-1 (-> self child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'notify 'die) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (when (not (logtest? (game-task-node-flag no-hud-wait) (-> self node-info flags))) + (let ((gp-2 (current-time))) + (label cfg-28) + (when (not (time-elapsed? gp-2 (seconds 5))) + (when (handle->process (-> self arrow)) + (suspend) + (goto cfg-28) + ) + (countdown (v1-42 4) + (when (handle->process (-> self hud v1-42)) + (suspend) + (goto cfg-28) + ) + ) + ) + ) + ) + (go-virtual resolution) + ) + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-27 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-27 (or (handle->process (-> self arrow)) (begin + (countdown (v1-28 4) + (when (handle->process (-> self hud v1-28)) + (set! v1-27 #t) + (goto cfg-39) + ) + ) + #f + ) + ) + ) + (label cfg-39) + v1-27 + ) + (suspend) + ) + ) + ) + +;; failed to figure out what this is: +(defstate fail (task-manager) + :virtual #t + :event task-manager-event-handler + :exit (behavior () + (disable *screen-filter*) + ) + :code (behavior ((arg0 resetter-params)) + (while (not (-> self allow-fail)) + (suspend) + ) + (send-event (handle->process (-> self arrow)) 'die) + (countdown (s5-0 4) + (send-event (handle->process (-> self hud s5-0)) 'hide-and-die) + ) + (task-manager-method-28 self) + (let ((s5-1 (-> self info on-fail))) + (if s5-1 + (script-eval s5-1) + ) + ) + (when arg0 + (spawn-resetter! *resetter-control* arg0 (-> self node-info)) + (while (get-resetter *resetter-control*) + (suspend) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate restart (task-manager) + :virtual #t + :event task-manager-event-handler + :exit (-> (method-of-type task-manager fail) exit) + :code (behavior ((arg0 symbol)) + (send-event (handle->process (-> self arrow)) 'die) + (countdown (s5-0 4) + (send-event (handle->process (-> self hud s5-0)) 'hide-and-die) + ) + (task-manager-method-28 self) + (let ((s5-1 (-> self info on-fail))) + (if s5-1 + (script-eval s5-1) + ) + ) + (cond + (arg0 + (spawn-resetter! *resetter-control* (the-as resetter-params arg0) (-> self node-info)) + (while (get-resetter *resetter-control*) + (suspend) + ) + ) + (else + (initialize! *game-info* 'try (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc index d6eddcf901..a1fb00bed7 100644 --- a/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/path-h_REF.gc @@ -36,7 +36,7 @@ These path-controls are typically allocated on a process heap." (path-control-method-25 (_type_ vector) float) (path-control-method-26 (_type_ float float) float) (path-control-method-27 (_type_ vector) vector) - (path-control-method-28 (_type_ vector float float) float) + (path-control-method-28 (_type_ vector vector symbol) float) (path-control-method-29 (_type_ vector int float) float) (should-display-marks? (_type_) symbol) (displacement-between-two-points! (_type_ vector float float) vector) diff --git a/test/decompiler/reference/jak3/engine/geometry/path_REF.gc b/test/decompiler/reference/jak3/engine/geometry/path_REF.gc new file mode 100644 index 0000000000..a888de36e5 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/geometry/path_REF.gc @@ -0,0 +1,609 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type path-control +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this path-control)) + (cond + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type? (-> this process) process-drawable) *display-entity-errors* (not *display-capture-mode*)) + (let ((s5-0 add-debug-text-3d) + (s4-0 #t) + (s3-0 577) + ) + (format (clear *temp-string*) "path data error in ~S" (-> this process name)) + (s5-0 + s4-0 + (the-as bucket-id s3-0) + *temp-string* + (-> this process root trans) + (font-color red) + (the-as vector2h #f) + ) + ) + ) + ) + ((let ((a0-5 this)) + (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) + ) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this curve cverts s5-1))) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (< s5-1 (+ (-> this curve num-cverts) -1))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + s4-1 + (-> this curve cverts (+ s5-1 1)) + (new 'static 'rgba :r #xff :g #x80 :a #x80) + #f + (the-as rgba -1) + ) + ) + (if (logtest? (-> this flags) (path-control-flag draw-point)) + (add-debug-x #t (bucket-id debug-no-zbuf1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + ) + (when (logtest? (-> this flags) (path-control-flag draw-text)) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-0 577) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-1 s2-1 (the-as bucket-id s1-0) *temp-string* s4-1 (font-color orange) (the-as vector2h #f)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 18 of type path-control +(defmethod total-distance ((this path-control)) + (let ((f30-0 (-> this curve length))) + (when (= f30-0 0.0) + (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) + (+! f30-0 (vector-vector-distance (-> this curve cverts s5-0) (-> this curve cverts (+ s5-0 1)))) + ) + (set! (-> this curve length) f30-0) + ) + f30-0 + ) + ) + +;; definition for method 18 of type curve-control +(defmethod total-distance ((this curve-control)) + (let ((f0-0 (-> this curve length))) + (when (= f0-0 0.0) + (set! f0-0 (curve-length (-> this curve))) + (set! (-> this curve length) f0-0) + ) + f0-0 + ) + ) + +;; definition for method 26 of type path-control +;; INFO: Used lq/sq +(defmethod path-control-method-26 ((this path-control) (arg0 float) (arg1 float)) + (local-vars (v1-9 float)) + (let ((f30-0 (* arg0 (the float (+ (-> this curve num-cverts) -1)))) + (f28-0 (if (< 0.0 arg1) + 1.0 + -1.0 + ) + ) + (f26-0 (fabs arg1)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (get-point-in-path! this s5-0 f30-0 'interp) + 0.0 + (while (< 0.0 f26-0) + (let ((f24-0 (the float (the int (+ f28-0 f30-0))))) + (set! f30-0 (cond + ((or (< f24-0 0.0) (>= f24-0 (the float (-> this curve num-cverts)))) + (set! v1-9 f24-0) + (goto cfg-19) + f30-0 + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> this curve cverts (the int (the float (the int f24-0))) quad)) + 0.0 + (let ((f0-16 (vector-vector-distance s5-0 s4-0))) + (cond + ((< f0-16 f26-0) + (set! f26-0 (- f26-0 f0-16)) + (set! (-> s5-0 quad) (-> s4-0 quad)) + f24-0 + ) + (else + (let ((f0-17 (/ f26-0 f0-16))) + (set! v1-9 (lerp f30-0 f24-0 f0-17)) + ) + (goto cfg-19) + f30-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v1-9 (the-as float #f)) + (label cfg-19) + (let* ((f0-21 (/ v1-9 (the float (+ (-> this curve num-cverts) -1)))) + (f0-22 (fmin 1.0 f0-21)) + ) + (fmax 0.0 f0-22) + ) + ) + +;; definition for method 10 of type path-control +;; INFO: Used lq/sq +(defmethod get-point-in-path! ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (let ((a1-1 (-> this curve num-cverts)) + (f0-3 (the float (the int arg1))) + ) + (cond + ((< arg1 0.0) + (set! (-> arg0 quad) (-> this curve cverts 0 quad)) + ) + ((>= f0-3 (the float (+ a1-1 -1))) + (set! (-> arg0 quad) (-> this curve cverts (+ a1-1 -1) quad)) + ) + ((or (= arg2 'exact) (= f0-3 arg1)) + (set! (-> arg0 quad) (-> this curve cverts (the int f0-3) quad)) + ) + (else + (vector-lerp! + arg0 + (-> this curve cverts (the int f0-3)) + (-> this curve cverts (the int (+ 1.0 f0-3))) + (- arg1 f0-3) + ) + ) + ) + ) + arg0 + ) + +;; definition for method 11 of type path-control +;; INFO: Used lq/sq +(defmethod get-random-point ((this path-control) (arg0 vector)) + (with-pp + (cond + ((> (-> this curve num-cverts) 0) + (let ((a0-2 (rand-vu-int-count (-> this curve num-cverts)))) + (set! (-> arg0 quad) (-> this curve cverts a0-2 quad)) + ) + ) + (else + (format #t "WARNING: method get-random-point called on a path-control object with no vertices.~%") + (if pp + (format #t "current process is ~A~%" (-> pp name)) + ) + (set! (-> arg0 quad) (-> *null-vector* quad)) + ) + ) + arg0 + ) + ) + +;; definition for method 14 of type path-control +(defmethod get-point-at-percent-along-path! ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (get-point-in-path! this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1))) arg2) + ) + +;; definition for method 14 of type curve-control +(defmethod get-point-at-percent-along-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (if (not (logtest? (-> this flags) (path-control-flag not-found))) + (curve-evaluate! + arg0 + arg1 + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + ) + arg0 + ) + +;; definition for method 10 of type curve-control +(defmethod get-point-in-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (if (not (logtest? (-> this flags) (path-control-flag not-found))) + (curve-evaluate! + arg0 + (/ arg1 (the float (+ (-> this curve num-cverts) -1))) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + ) + arg0 + ) + +;; definition for method 31 of type path-control +(defmethod displacement-between-two-points! ((this path-control) (arg0 vector) (arg1 float) (arg2 float)) + (let ((v1-0 (-> this curve num-cverts)) + (f0-3 (the float (the int arg1))) + ) + (cond + ((or (logtest? (-> this flags) (path-control-flag not-found)) (< v1-0 2) (< arg1 0.0)) + (vector-reset! arg0) + ) + (else + (let ((f0-4 (fmin f0-3 (the float (+ v1-0 -2))))) + (vector-! arg0 (-> this curve cverts (the int (+ 1.0 f0-4))) (-> this curve cverts (the int f0-4))) + ) + (vector-float*! arg0 arg0 arg2) + ) + ) + ) + arg0 + ) + +;; definition for method 12 of type path-control +(defmethod path-control-method-12 ((this path-control) (arg0 vector) (arg1 float) (arg2 float)) + (displacement-between-two-points! this arg0 arg1 arg2) + ) + +;; definition for method 15 of type path-control +(defmethod path-control-method-15 ((this path-control) (arg0 vector) (arg1 float) (arg2 float)) + (path-control-method-12 + this + arg0 + (* arg1 (the float (+ (-> this curve num-cverts) -1))) + (* arg2 (the float (+ (-> this curve num-cverts) -1))) + ) + ) + +;; definition for method 13 of type path-control +(defmethod displacement-between-two-points-normalized! ((this path-control) (arg0 vector) (arg1 float)) + (displacement-between-two-points! this arg0 arg1 1.0) + (vector-normalize! arg0 1.0) + ) + +;; definition for method 16 of type path-control +(defmethod displacement-between-points-at-percent-normalized! ((this path-control) (arg0 vector) (arg1 float)) + (displacement-between-two-points-normalized! this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1)))) + ) + +;; definition for method 31 of type curve-control +(defmethod displacement-between-two-points! ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) + (when (not (logtest? (-> this flags) (path-control-flag not-found))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (curve-evaluate! + arg0 + arg1 + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + (cond + ((< arg1 (- 1.0 arg2)) + (curve-evaluate! + s4-0 + (+ arg1 arg2) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + (vector-! arg0 s4-0 arg0) + ) + (else + (curve-evaluate! + s4-0 + (- arg1 arg2) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + (vector-! arg0 arg0 s4-0) + ) + ) + ) + ) + ) + +;; definition for method 26 of type curve-control +(defmethod path-control-method-26 ((this curve-control) (arg0 float) (arg1 float)) + (let* ((f30-0 0.0001) + (v1-2 (displacement-between-two-points! this (new 'stack-no-clear 'vector) arg0 f30-0)) + ) + 0.0 + 0.0 + (let* ((f0-3 (/ f30-0 (vector-length v1-2))) + (v1-4 (+ arg0 (* f0-3 arg1))) + ) + (fmax 0.0 (fmin 1.0 v1-4)) + ) + ) + ) + +;; definition for method 12 of type curve-control +(defmethod path-control-method-12 ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) + (displacement-between-two-points! this arg0 (/ arg1 (the float (+ (-> this curve num-cverts) -1))) arg2) + ) + +;; definition for method 15 of type curve-control +(defmethod path-control-method-15 ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) + (displacement-between-two-points! this arg0 arg1 arg2) + ) + +;; definition for method 16 of type curve-control +(defmethod displacement-between-points-at-percent-normalized! ((this curve-control) (arg0 vector) (arg1 float)) + (displacement-between-two-points! this arg0 arg1 0.01) + (vector-normalize! arg0 1.0) + ) + +;; definition for method 13 of type curve-control +(defmethod displacement-between-two-points-normalized! ((this curve-control) (arg0 vector) (arg1 float)) + (displacement-between-points-at-percent-normalized! + this + arg0 + (/ arg1 (the float (+ (-> this curve num-cverts) -1))) + ) + ) + +;; definition for method 28 of type path-control +;; INFO: Used lq/sq +(defmethod path-control-method-28 ((this path-control) (arg0 vector) (arg1 vector) (arg2 symbol)) + (local-vars + (sv-96 vector) + (sv-100 vector) + (sv-104 vector) + (sv-108 vector) + (sv-112 number) + (sv-116 vector) + (sv-120 symbol) + (sv-124 float) + ) + (set! sv-96 (new 'stack-no-clear 'vector)) + (set! sv-100 (new 'stack-no-clear 'vector)) + (set! sv-104 (new 'stack-no-clear 'vector)) + (set! sv-108 (new 'stack-no-clear 'vector)) + (set! sv-112 -1.0) + (set! sv-116 (new 'stack-no-clear 'vector)) + (set! sv-120 (the-as symbol #f)) + (set! sv-124 (the-as float -1.0)) + (get-point-in-path! this sv-96 0.0 'interp) + (set! sv-112 (gpr->fpr #x7f800000)) + (when (not arg2) + (set! sv-124 (path-control-method-22 this arg0)) + (get-point-in-path! this sv-108 sv-124 'interp) + (set! sv-112 (vector-vector-distance-squared sv-108 arg0)) + ) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (vector+! s3-1 arg0 arg1) + (dotimes (s2-0 (+ (-> this curve num-cverts) -1)) + (get-point-in-path! this sv-100 (the float (+ s2-0 1)) 'interp) + (vector-! sv-104 sv-100 sv-96) + (let ((s0-0 #f)) + 0.0 + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! (-> s1-0 x) -1.0) + (set! (-> s1-0 y) -1.0) + (line-line-find-intersection-xz arg0 arg1 sv-96 sv-104 s1-0) + (when (>= (-> s1-0 x) 0.0) + (if (and (< 0.0 (-> s1-0 y)) (>= 1.0 (-> s1-0 y))) + (set! s0-0 #t) + ) + (vector+float*! sv-116 arg0 arg1 (-> s1-0 x)) + (cond + ((and s0-0 (not sv-120)) + (set! (-> sv-108 quad) (-> sv-116 quad)) + (set! sv-112 (vector-vector-distance-squared sv-116 arg0)) + (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) + (set! sv-120 #t) + ) + ((and s0-0 sv-120) + (let ((f0-22 (vector-vector-distance-squared sv-116 arg0))) + (when (< f0-22 (the-as float sv-112)) + (set! (-> sv-108 quad) (-> sv-116 quad)) + (set! sv-112 f0-22) + (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) + ) + ) + ) + ((not (or s0-0 sv-120)) + (let ((s0-1 (new 'stack-no-clear 'vector)) + (a3-5 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-0 y) (fmax 0.0 (fmin 1.0 (-> s1-0 y)))) + (vector+float*! s0-1 sv-96 sv-104 (-> s1-0 y)) + (let* ((f0-32 (vector-segment-distance-point! s0-1 arg0 s3-1 a3-5)) + (f0-33 (* f0-32 f0-32)) + ) + (when (< f0-33 (the-as float sv-112)) + (set! (-> sv-108 quad) (-> s0-1 quad)) + (set! sv-112 f0-33) + (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> sv-96 quad) (-> sv-100 quad)) + ) + ) + (set! sv-124 (/ sv-124 (the float (+ (-> this curve num-cverts) -1)))) + sv-124 + ) + +;; definition for method 29 of type path-control +(defmethod path-control-method-29 ((this path-control) (arg0 vector) (arg1 int) (arg2 float)) + (let ((s2-0 (get-point-in-path! this (new 'stack-no-clear 'vector) (the float arg1) 'interp)) + (a2-3 (get-point-in-path! this (new 'stack-no-clear 'vector) (the float (+ arg1 1)) 'interp)) + ) + (vector-segment-distance-point! arg0 s2-0 a2-3 (the-as vector arg2)) + ) + ) + +;; definition for method 22 of type path-control +;; INFO: Used lq/sq +(defmethod path-control-method-22 ((this path-control) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (f30-0 4096000000.0) + (f28-0 0.0) + ) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> arg0 quad)) + (set! (-> s3-0 y) 0.0) + (get-point-in-path! this s4-0 0.0 'interp) + (set! (-> s4-0 y) 0.0) + (dotimes (s1-0 (+ (-> this curve num-cverts) -1)) + (set! (-> s5-0 quad) (-> s4-0 quad)) + (get-point-in-path! this s4-0 (the float (+ s1-0 1)) 'interp) + (set! (-> s4-0 y) 0.0) + (let ((f0-5 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) + (when (< f0-5 f30-0) + (set! f30-0 f0-5) + (set! f28-0 + (+ (/ (vector-vector-xz-distance s2-0 s5-0) (vector-vector-xz-distance s4-0 s5-0)) (the float s1-0)) + ) + ) + ) + ) + ) + f28-0 + ) + ) + +;; definition for method 24 of type path-control +;; INFO: Used lq/sq +(defmethod path-control-method-24 ((this path-control) (arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (f30-0 4096000000.0) + (f28-0 0.0) + ) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> arg0 quad)) + (get-point-in-path! this s4-0 0.0 'interp) + (dotimes (s1-0 (+ (-> this curve num-cverts) -1)) + (set! (-> s5-0 quad) (-> s4-0 quad)) + (get-point-in-path! this s4-0 (the float (+ s1-0 1)) 'interp) + (let ((f0-2 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) + (when (< f0-2 f30-0) + (set! f30-0 f0-2) + (set! f28-0 (+ (/ (vector-vector-distance s2-0 s5-0) (vector-vector-distance s4-0 s5-0)) (the float s1-0))) + ) + ) + ) + ) + f28-0 + ) + ) + +;; definition for method 25 of type path-control +(defmethod path-control-method-25 ((this path-control) (arg0 vector)) + (/ (path-control-method-24 this arg0) (the float (+ (-> this curve num-cverts) -1))) + ) + +;; definition for method 23 of type path-control +(defmethod path-control-method-23 ((this path-control) (arg0 vector)) + (/ (path-control-method-22 this arg0) (the float (+ (-> this curve num-cverts) -1))) + ) + +;; definition for method 9 of type curve-control +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this curve-control)) + (cond + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type? (-> this process) process-drawable) *display-entity-errors* (not *display-capture-mode*)) + (let ((s5-0 add-debug-text-3d) + (s4-0 #t) + (s3-0 577) + ) + (format (clear *temp-string*) "curve data error in ~S" (-> this process name)) + (s5-0 + s4-0 + (the-as bucket-id s3-0) + *temp-string* + (-> this process root trans) + (font-color red) + (the-as vector2h #f) + ) + ) + ) + ) + ((let ((a0-5 this)) + (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) + ) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (> (-> this curve num-cverts) 0)) + (add-debug-curve2 + #t + (bucket-id debug-no-zbuf1) + (-> this curve) + (new 'static 'rgba :r #xff :g #x80 :a #x80) + #f + ) + ) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this curve cverts s5-1))) + (if (logtest? (-> this flags) (path-control-flag draw-point)) + (add-debug-x #t (bucket-id debug-no-zbuf1) s4-1 (new 'static 'rgba :r #xff :a #x80)) + ) + (when (logtest? (-> this flags) (path-control-flag draw-text)) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-0 577) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-1 s2-1 (the-as bucket-id s1-0) *temp-string* s4-1 (font-color orange) (the-as vector2h #f)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type path-control +(defmethod path-control-method-27 ((this path-control) (arg0 vector)) + (let ((s4-0 (-> this curve num-cverts))) + (let ((f30-0 (/ 1.0 (the float s4-0)))) + (set-vector! arg0 0.0 0.0 0.0 0.0) + (dotimes (s3-0 s4-0) + (vector+float*! + arg0 + arg0 + (get-point-in-path! this (new 'stack-no-clear 'vector) (the float s3-0) 'interp) + f30-0 + ) + ) + ) + (dotimes (s3-1 s4-0) + (let ((f0-10 + (vector-vector-distance arg0 (get-point-in-path! this (new 'stack-no-clear 'vector) (the float s3-1) 'interp)) + ) + ) + (if (< (-> arg0 w) f0-10) + (set! (-> arg0 w) (+ 4096.0 f0-10)) + ) + ) + ) + ) + arg0 + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-h_REF.gc index c081bbc029..84e9e7444c 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-h_REF.gc @@ -72,7 +72,8 @@ ;; definition of type hfrag-packed-index (deftype hfrag-packed-index (uint16) - () + ((bit11 uint8 :offset 11 :size 5) + ) ) ;; definition of type hfrag-vertex @@ -673,8 +674,8 @@ (buckets-far uint32) (buckets-mid uint32) (buckets-near uint32) - (verts uint32) - (pat-array uint32) + (verts (inline-array hfrag-vertex)) + (pat-array (pointer pat-surface)) (pat-length uint16) (num-buckets-far uint16) (num-buckets-mid uint16) @@ -684,9 +685,9 @@ (:methods (hfragment-method-17 (_type_ collide-cache collide-query) none) (hfragment-method-18 (_type_ collide-cache collide-query) none) - (hfragment-method-19 () none) - (hfragment-method-20 () none) - (hfragment-method-21 () none) + (hfragment-method-19 (_type_ collide-cache collide-query int int int int) none) + (hfragment-method-20 (_type_ collide-cache int int uint uint uint pat-surface) none) + (hfragment-method-21 (_type_ collide-cache int int uint uint uint pat-surface) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-blend-shape_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-blend-shape_REF.gc new file mode 100644 index 0000000000..ea9ebf4ee2 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-blend-shape_REF.gc @@ -0,0 +1,361 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *stats-blerc*, type symbol +(define *stats-blerc* #f) + +;; definition of type blerc-block-header +(deftype blerc-block-header (structure) + ((tag generic-merc-tag :inline) + (vtx-count uint32) + (overlap uint32) + (lump-dest uint32) + (lump-qwc uint32) + ) + ) + +;; definition for method 3 of type blerc-block-header +(defmethod inspect ((this blerc-block-header)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'blerc-block-header) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tvtx-count: ~D~%" (-> this vtx-count)) + (format #t "~1Toverlap: ~D~%" (-> this overlap)) + (format #t "~1Tlump-dest: ~D~%" (-> this lump-dest)) + (format #t "~1Tlump-qwc: ~D~%" (-> this lump-qwc)) + (label cfg-4) + this + ) + +;; definition of type blerc-block +(deftype blerc-block (structure) + ((output uint8 848) + (header blerc-block-header :inline) + ) + ) + +;; definition for method 3 of type blerc-block +(defmethod inspect ((this blerc-block)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'blerc-block) + (format #t "~1Toutput[848] @ #x~X~%" (-> this output)) + (format #t "~1Theader: #~%" (-> this header)) + (label cfg-4) + this + ) + +;; definition of type blerc-dcache +(deftype blerc-dcache (structure) + ((repl-mult vector 40 :inline) + ) + ) + +;; definition for method 3 of type blerc-dcache +(defmethod inspect ((this blerc-dcache)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'blerc-dcache) + (format #t "~1Trepl-mult[40] @ #x~X~%" (-> this repl-mult)) + (label cfg-4) + this + ) + +;; definition of type blerc-globals +(deftype blerc-globals (structure) + ((first uint32) + (next uint32) + (min-val int16) + (max-val int16) + (fragment-count int32) + (vtx-count int32) + (target-vtx-count int32) + ) + ) + +;; definition for method 3 of type blerc-globals +(defmethod inspect ((this blerc-globals)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'blerc-globals) + (format #t "~1Tfirst: #x~X~%" (-> this first)) + (format #t "~1Tnext: #x~X~%" (-> this next)) + (format #t "~1Tmin-val: ~D~%" (-> this min-val)) + (format #t "~1Tmax-val: ~D~%" (-> this max-val)) + (format #t "~1Tfragment-count: ~D~%" (-> this fragment-count)) + (format #t "~1Tvtx-count: ~D~%" (-> this vtx-count)) + (format #t "~1Ttarget-vtx-count: ~D~%" (-> this target-vtx-count)) + (label cfg-4) + this + ) + +;; definition for symbol *blerc-globals*, type blerc-globals +(define *blerc-globals* (new 'global 'blerc-globals)) + +;; definition of type blerc-context +(deftype blerc-context (structure) + ((block-a blerc-block :inline) + (dummy uint8 7312) + (block-b blerc-block :inline) + ) + ) + +;; definition for method 3 of type blerc-context +(defmethod inspect ((this blerc-context)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'blerc-context) + (format #t "~1Tblock-a: #~%" (-> this block-a)) + (format #t "~1Tdummy[7312] @ #x~X~%" (-> this dummy)) + (format #t "~1Tblock-b: #~%" (-> this block-b)) + (label cfg-4) + this + ) + +;; definition (debug) for function blerc-stats-init +;; WARN: Return type mismatch int vs none. +(defun-debug blerc-stats-init () + (when *stats-blerc* + (when (nonzero? (-> *blerc-globals* fragment-count)) + (format *stdcon* "~%BLERC (merc blend target) STATS~%") + (format + *stdcon* + " ~D fragments, ~D vertices~%" + (-> *blerc-globals* fragment-count) + (-> *blerc-globals* vtx-count) + ) + (format + *stdcon* + " ~D blend target computations (~F average)~%" + (-> *blerc-globals* target-vtx-count) + (/ (the float (-> *blerc-globals* target-vtx-count)) (the float (-> *blerc-globals* vtx-count))) + ) + (if (< (-> *blerc-globals* min-val) 0) + (format *stdcon* "MINIMUM OUT OF RANGE: ~D~%" (-> *blerc-globals* min-val)) + ) + (if (< 255 (-> *blerc-globals* max-val)) + (format *stdcon* "MAXIMUM OUT OF RANGE: ~D~%" (-> *blerc-globals* max-val)) + ) + ) + (let ((a0-7 *blerc-globals*)) + (set! (-> a0-7 min-val) 255) + (set! (-> a0-7 max-val) 0) + (set! (-> a0-7 fragment-count) 0) + (set! (-> a0-7 vtx-count) 0) + (set! (-> a0-7 target-vtx-count) 0) + ) + ) + 0 + (none) + ) + +;; definition for function blerc-init +;; WARN: Return type mismatch int vs none. +(defun blerc-init () + (blerc-stats-init) + (let ((v1-0 *blerc-globals*)) + (set! (-> v1-0 first) (the-as uint 0)) + (set! (-> v1-0 next) (the-as uint 0)) + ) + 0 + (none) + ) + +;; definition for function blerc-a-fragment +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function dma-from-spr +;; ERROR: function has no type analysis. Cannot decompile. + +;; definition for function merc-dma-chain-to-spr +;; ERROR: function has no type analysis. Cannot decompile. + +;; definition for function blerc-execute +;; INFO: function output is handled by mips2c +(def-mips2c blerc-execute (function none)) + +;; definition for function merc-blend-shape +;; WARN: Return type mismatch int vs object. +(defun merc-blend-shape ((arg0 process-drawable)) + (let* ((v1-1 (-> arg0 skel float-channels)) + (a2-0 (cond + ((> v1-1 0) + (-> arg0 skel channel (+ v1-1 -1 (-> arg0 skel active-channels))) + ) + (else + (let ((v1-7 (-> arg0 skel root-channel)) + (a0-5 (-> arg0 skel effect)) + ) + (-> v1-7 (if a0-5 + (-> a0-5 channel-offset) + 0 + ) + ) + ) + ) + ) + ) + (a3-0 (-> a2-0 frame-group)) + (a1-0 (new 'stack-no-clear 'array 'int16 128)) + ) + (when (and a3-0 (and (> (-> arg0 skel active-channels) 0) + (zero? (-> arg0 draw cur-lod)) + (logtest? (-> arg0 skel status) (joint-control-status blend-shape)) + ) + ) + (cond + ((and (-> arg0 skel override) (!= (-> arg0 skel override 0) 0.0)) + (let* ((a0-12 (-> arg0 draw mgeo)) + (v1-20 (-> a0-12 header blend-target-count)) + (a2-2 (-> arg0 skel override)) + ) + (when (nonzero? v1-20) + (dotimes (a3-1 (the-as int v1-20)) + (set! (-> a1-0 a3-1) (the int (* 8192.0 (-> a2-2 (+ a3-1 1))))) + ) + (setup-blerc-chains a0-12 a1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (logior! (-> arg0 skel status) (joint-control-status blend-shape-valid)) + (return (the-as object #f)) + ) + ) + ) + (else + (let ((t2-0 (-> a3-0 blend-shape-anim))) + (when t2-0 + (let ((a0-14 (-> arg0 draw mgeo))) + (let* ((v1-33 (-> a0-14 header blend-target-count)) + (t0-8 (-> a2-0 frame-num)) + (t1-2 (the int t0-8)) + (a2-6 (&+ t2-0 (* (the-as uint t1-2) v1-33))) + ) + (cond + ((< t1-2 (the-as int (+ (-> a3-0 frames num-frames) -1))) + (let* ((a3-6 (&+ a2-6 v1-33)) + (t0-9 (* 64.0 (- t0-8 (the float t1-2)))) + (t1-4 (- 64.0 t0-9)) + ) + (dotimes (t2-2 (the-as int v1-33)) + (set! (-> a1-0 t2-2) (the int (+ 0.5 + (* (the float (+ (-> (the-as (pointer uint8) (&+ a3-6 t2-2))) -64)) t0-9) + (* (the float (+ (-> (the-as (pointer uint8) (&+ a2-6 t2-2))) -64)) t1-4) + ) + ) + ) + ) + ) + ) + (else + (dotimes (a3-7 (the-as int v1-33)) + (set! (-> a1-0 a3-7) (the-as int (* (+ (-> (the-as (pointer uint8) (&+ a2-6 a3-7))) -64) 64))) + ) + ) + ) + ) + (setup-blerc-chains a0-14 a1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + ) + (logior! (-> arg0 skel status) (joint-control-status blend-shape-valid)) + (return (the-as object #f)) + ) + ) + ) + ) + ) + ) + (when (logtest? (-> arg0 skel status) (joint-control-status blend-shape-valid)) + (logclear! (-> arg0 skel status) (joint-control-status blend-shape-valid)) + (setup-blerc-chains + (-> arg0 draw lod-set lod 0 geo) + (new 'static 'array int16 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + (-> *display* frames (-> *display* on-screen) global-buf) + ) + ) + 0 + ) + +;; definition for function setup-blerc-chains-for-one-fragment +;; INFO: function output is handled by mips2c +(def-mips2c setup-blerc-chains-for-one-fragment (function object object object object object object object)) + +;; definition for function setup-blerc-chains +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun setup-blerc-chains ((arg0 merc-ctrl) (arg1 (pointer int16)) (arg2 dma-buffer)) + (local-vars + (sv-16 uint) + (sv-20 pointer) + (sv-24 merc-effect) + (sv-28 uint) + (sv-32 object) + (sv-48 int) + (sv-64 int) + ) + (set! sv-16 (-> arg0 header effect-count)) + (let ((s3-0 (-> arg0 header blend-target-count)) + (v1-1 (-> arg2 base)) + ) + (set! sv-20 (&+ v1-1 0)) + (let ((a2-1 (the-as object (&+ v1-1 16)))) + (if (zero? (-> *blerc-globals* first)) + (set! (-> *blerc-globals* first) (the-as uint a2-1)) + ) + (dotimes (s2-0 (the-as int sv-16)) + (set! sv-24 (-> arg0 effect s2-0)) + (set! sv-28 (-> sv-24 blend-frag-count)) + (when (nonzero? sv-28) + (let ((v1-15 (the-as object (-> sv-24 frag-geo))) + (s1-0 (the-as structure (-> sv-24 frag-ctrl))) + (s0-0 (the-as object (-> sv-24 blend-data))) + ) + (set! sv-32 (-> sv-24 blend-ctrl)) + (set! sv-48 0) + (while (< sv-48 (the-as int sv-28)) + (set! sv-64 (+ (the-as int v1-15) + (logand (* (+ (-> (the-as merc-fragment-control s1-0) unsigned-four-count) 3) 4) #xfff0) + ) + ) + (if (nonzero? (-> (the-as (pointer uint8) sv-32) 0)) + (set! a2-1 (setup-blerc-chains-for-one-fragment s3-0 arg1 a2-1 s0-0 sv-32 sv-64)) + ) + (let ((a0-14 (logand (+ (* (the-as uint 6) (-> (the-as merc-blend-ctrl sv-32) blend-vtx-count)) 15) #xfff0))) + (set! v1-15 + (+ sv-64 + (logand (* (+ (-> (the-as merc-fragment-control s1-0) lump-four-count) 3) 4) #xfff0) + (* (-> (the-as merc-fragment-control s1-0) fp-qwc) 16) + ) + ) + (set! s1-0 (+ (the-as uint s1-0) (* (-> (the-as merc-fragment-control s1-0) mat-xfer-count) 2) 4)) + (set! s0-0 + (+ (the-as int s0-0) (* (the-as uint a0-14) (+ (-> (the-as merc-blend-ctrl sv-32) nonzero-index-count) 1))) + ) + ) + (set! sv-32 (+ (the-as int sv-32) s3-0 2)) + (the-as int sv-32) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + (set! (-> (the-as (pointer int64) sv-20)) (logior #x20000000 (shr (shl (the-as int a2-1) 33) 1))) + (set! (-> (the-as (pointer uint32) sv-20) 2) (the-as uint 0)) + (set! (-> (the-as (pointer uint32) sv-20) 3) (the-as uint 0)) + (set! (-> arg2 base) (the-as pointer a2-1)) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-death_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-death_REF.gc new file mode 100644 index 0000000000..ffa3d5a0d9 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-death_REF.gc @@ -0,0 +1,167 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *merc-death-globals*, type vector +(define *merc-death-globals* (new 'global 'vector)) + +;; definition for function birth-func-death-sparks +;; WARN: Return type mismatch int vs none. +(defun birth-func-death-sparks () + 0 + (none) + ) + +;; definition for symbol death-seed, type death-info +(define death-seed + (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x34 :sound "temp-enemy-die") + ) + +;; definition for function start-seed-effect +;; WARN: Return type mismatch int vs none. +(defun start-seed-effect ((arg0 process-drawable) (arg1 vector) (arg2 cspace)) + (let ((v1-0 (-> arg0 draw)) + (a1-1 death-seed) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-1 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-1 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-1 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-1 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior process-drawable () (let ((v0-0 200)) + (set! (-> self draw death-timer) (the-as uint v0-0)) + (the-as time-frame v0-0) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 52 + :init-specs ((:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 64.0 196.0) + (:g 196.0 64.0) + (:b 0.0) + (:a 4.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:func 'sparticle-texture-glow-soft) + ) + ) + +;; definition for symbol death-default, type death-info +(define death-default + (new 'static 'death-info :vertex-skip #xa :timer #x4b :overlap #x4 :effect #x35 :sound "enemy-fizz") + ) + +;; definition for symbol death-warp-in, type death-info +(define death-warp-in + (new 'static 'death-info :vertex-skip #x96 :timer #x4b :effect #x36 :sound "warpgate-tele") + ) + +;; definition for symbol death-warp-out, type death-info +(define death-warp-out + (new 'static 'death-info :vertex-skip #x96 :timer #x96 :effect #x36 :sound "warpgate-tele") + ) + +;; definition for function sparticle-texture-glow-soft +;; WARN: Return type mismatch int vs none. +(defun sparticle-texture-glow-soft ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (particle-adgif-callback (-> arg1 adgif) (new 'static 'texture-id :index #xf :page #x4)) + (set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 54 + :init-specs ((:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 64.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0 -1.28) + (:friction 0.92 0.02) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.1) (seconds 0.065)) + (:next-launcher 55) + ) + ) + +;; failed to figure out what this is: +(defpart 55 + :init-specs ((:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:a 64.0 32.0) + (:omega (degrees 0.045) (degrees 0.03375)) + (:vel-x (meters -0.053333335) (meters 0.10666667)) + (:vel-y (meters -0.026666667) (meters 0.093333334)) + (:vel-z (meters -0.053333335) (meters 0.10666667)) + (:scalevel-x (meters -0.001) (meters -0.008)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:func 'sparticle-motion-blur) + ) + ) + +;; failed to figure out what this is: +(defpart 53 + :init-specs ((:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 96.0 150.0) + (:g 32.0 64.0) + (:b 128.0 128.0) + (:a 128.0) + (:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0 -1.28) + (:friction 0.92 0.02) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.1) (seconds 0.065)) + (:next-launcher 56) + ) + ) + +;; failed to figure out what this is: +(defpart 56 + :init-specs ((:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:a 64.0 32.0) + (:omega (degrees 0.045) (degrees 0.03375)) + (:vel-x (meters -0.053333335) (meters 0.10666667)) + (:vel-y (meters -0.026666667) (meters 0.093333334)) + (:vel-z (meters -0.053333335) (meters 0.10666667)) + (:scalevel-x (meters -0.001) (meters -0.008)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:func 'sparticle-motion-blur) + ) + ) + +;; definition for function merc-death-spawn +;; WARN: Return type mismatch int vs none. +(defun merc-death-spawn ((arg0 int) (arg1 vector) (arg2 vector)) + (let ((v1-2 (-> *part-id-table* arg0))) + (if (and (nonzero? v1-2) (= (-> v1-2 type) sparticle-launcher)) + (sp-launch-particles-death *sp-particle-system-2d* v1-2 arg1) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-h_REF.gc index 3907b06824..1a8d8c95e8 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc-h_REF.gc @@ -877,7 +877,7 @@ Consists of a header and a list of [[merc-effect]]s." (timer uint8) (overlap uint8) (effect uint32) - (sound symbol) + (sound string) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc index 782ddd2273..f00dbb55ef 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc @@ -315,3 +315,7 @@ ) ) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new-h_REF.gc index 13e56e4649..88e182e5e3 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new-h_REF.gc @@ -199,20 +199,20 @@ (base-color rgba) ) (:methods - (lightning-bolt-method-9 (_type_ int int lightning-appearance) none) - (lightning-bolt-method-10 () none) + (init! (_type_ int int lightning-appearance) none) + (reset-spans! (_type_) none) (lightning-bolt-method-11 (_type_) none) (lightning-bolt-method-12 (_type_) none) (lightning-bolt-method-13 (_type_ int) none) (lightning-bolt-method-14 (_type_) int) - (lightning-bolt-method-15 () none) - (lightning-bolt-method-16 () none) - (lightning-bolt-method-17 () none) - (lightning-bolt-method-18 () none) - (lightning-bolt-method-19 () none) - (lightning-bolt-method-20 () none) - (lightning-bolt-method-21 () none) - (lightning-bolt-method-22 () none) + (lightning-bolt-method-15 (_type_ object int lightning-span-internal) none) + (lightning-bolt-method-16 (_type_ vector float float vector matrix) none) + (lightning-bolt-method-17 (_type_ uint float float curve2d-fast float) float) + (lightning-bolt-method-18 (_type_ prim-strip vector rgba float float) none) + (lightning-bolt-method-19 (_type_ vector int int matrix float float) none) + (lightning-bolt-method-20 (_type_ int lightning-span-internal) vector) + (lightning-bolt-method-21 (_type_ int int float) none) + (lightning-bolt-method-22 (_type_) none) ) ) @@ -256,9 +256,9 @@ (lifetime time-frame) (state-time time-frame) ) - (:methods - (lightning-new-tracker-method-14 () none) - (lightning-new-tracker-method-15 () none) + (:state-methods + active + die ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc new file mode 100644 index 0000000000..0783a92797 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc @@ -0,0 +1,883 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *lightning-alpha-additive*, type gs-alpha +(define *lightning-alpha-additive* (new 'static 'gs-alpha :b #x2 :d #x1)) + +;; definition for symbol *lightning-alpha-blend*, type gs-alpha +(define *lightning-alpha-blend* (new 'static 'gs-alpha :b #x1 :d #x1)) + +;; definition for symbol *lightning-alpha-subtractive*, type gs-alpha +(define *lightning-alpha-subtractive* (new 'static 'gs-alpha :a #x2 :d #x1)) + +;; definition for method 9 of type lightning-bolt +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this lightning-bolt) (arg0 int) (arg1 int) (arg2 lightning-appearance)) + (set! (-> this num-spans) arg0) + (set! (-> this spans) (new 'process 'lightning-spans-array arg0)) + (set! (-> this num-active-spans) 0) + (set! (-> this span-pts-start) (new 'process 'vector-array arg0)) + (let ((s3-0 (* arg1 arg0))) + (let ((s2-1 (+ (* arg1 (+ arg0 -1)) 1))) + (set! (-> this current-points) (new 'process 'vector-array s2-1)) + (set! (-> this desired-points) (new 'process 'vector-array s2-1)) + ) + (let ((f30-0 (* 2.0 (the float s3-0)))) + (set! (-> this strip1) + (new 'process 'prim-strip (the int f30-0) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + (set! (-> this strip2) + (new 'process 'prim-strip (the int f30-0) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f)) + ) + ) + ) + (set! (-> this appearance) arg2) + (set! (-> this spans-internal) (new 'process 'lightning-spans-internal-array arg0)) + (set! (-> this current-uv-shift) 0.0) + (set! (-> this strip1 clamp) (new 'static 'gs-clamp)) + (set! (-> this strip2 clamp) (new 'static 'gs-clamp)) + (when (-> this appearance use-sprite-bucket?) + (set! (-> this strip1 bucket) (bucket-id generic-sprite-1)) + (set! (-> this strip1 sink) (the-as uint 65)) + (set! (-> this strip1 texture-index) (the-as uint 7)) + (set! (-> this strip2 bucket) (bucket-id generic-sprite-1)) + (set! (-> this strip2 sink) (the-as uint 65)) + (set! (-> this strip2 texture-index) (the-as uint 7)) + ) + (set! (-> this new-inner-point-generate-time) + (rand-vu-int-range + (the-as int (-> this appearance regenerate-time-start)) + (the-as int (-> this appearance regenerate-time-end)) + ) + ) + (set! (-> this base-width) + (rand-vu-float-range (-> this appearance width-range-start) (-> this appearance width-range-end)) + ) + (set! (-> this fade-mode) (the-as uint 0)) + (set! (-> this current-fade-scalar) 1.0) + (when (-> this appearance uv-shift?) + (let* ((v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-32 (the-as number (logior #x3f800000 v1-31))) + ) + (set! (-> this current-uv-shift) (+ -1.0 (the-as float v1-32))) + ) + ) + (dotimes (v1-35 (-> this num-spans)) + (logand! (-> this spans-internal data v1-35 span-flags) -2) + (set! (-> this spans-internal data v1-35 index) v1-35) + ) + (set! (-> this base-color) *color-gray*) + 0 + (none) + ) + +;; definition for method 10 of type lightning-bolt +;; WARN: Return type mismatch int vs none. +(defmethod reset-spans! ((this lightning-bolt)) + (set! (-> this num-active-spans) 0) + 0 + (none) + ) + +;; definition for method 20 of type lightning-bolt +;; INFO: Used lq/sq +(defmethod lightning-bolt-method-20 ((this lightning-bolt) (arg0 int) (arg1 lightning-span-internal)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let* ((f30-0 -0.5) + (v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + ) + (set! (-> s3-0 x) (+ f30-0 (+ -1.0 (the-as float v1-3)))) + ) + (let* ((f30-1 -0.5) + (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + ) + (set! (-> s3-0 y) (+ f30-1 (+ -1.0 (the-as float v1-8)))) + ) + (set! (-> s3-0 z) (the float (-> arg1 index))) + (set! (-> s3-0 w) 1.0) + (set! (-> this desired-points data arg0 quad) (-> s3-0 quad)) + ) + (set! (-> this current-points data arg0 z) (the float (-> arg1 index))) + (-> this desired-points data arg0) + ) + +;; definition for method 21 of type lightning-bolt +;; WARN: Return type mismatch int vs none. +(defmethod lightning-bolt-method-21 ((this lightning-bolt) (arg0 int) (arg1 int) (arg2 float)) + (local-vars (sv-16 int) (sv-24 vector) (sv-28 vector) (sv-32 float)) + (let ((v1-0 (-> this desired-points))) + (when (< 1 (- arg1 arg0)) + (set! sv-16 (/ (+ arg0 arg1) 2)) + (set! sv-24 (-> v1-0 data arg0)) + (set! sv-28 (-> v1-0 data arg1)) + (set! sv-32 (the-as float 1.0)) + (set! sv-32 (-> sv-28 z)) + (let ((s2-0 (-> v1-0 data sv-16))) + (let* ((f30-0 (* 0.5 (+ (-> sv-24 x) (-> sv-28 x)))) + (f28-0 arg2) + (f26-0 -0.5) + (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (set! (-> s2-0 x) (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-7)))))) + ) + (let* ((f30-1 (* 0.5 (+ (-> sv-24 y) (-> sv-28 y)))) + (f28-1 arg2) + (f26-1 -0.5) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> s2-0 y) (+ f30-1 (* f28-1 (+ f26-1 (+ -1.0 (the-as float v1-15)))))) + ) + (set! (-> s2-0 z) (lerp (-> sv-24 z) sv-32 0.5)) + ) + (lightning-bolt-method-21 this arg0 sv-16 (* arg2 (-> this fractal-reduction))) + (lightning-bolt-method-21 this sv-16 arg1 (* arg2 (-> this fractal-reduction))) + ) + ) + 0 + (none) + ) + +;; definition for method 15 of type lightning-bolt +(defmethod lightning-bolt-method-15 ((this lightning-bolt) (arg0 object) (arg1 int) (arg2 lightning-span-internal)) + (let ((v1-0 (-> this generate-mode))) + (cond + ((zero? v1-0) + (let ((f30-0 (the float (-> arg2 index))) + (f28-0 (the float (+ (-> arg2 index) 1))) + (f26-0 (/ 1.0 (the float (+ (-> arg2 num-inner-points) 1)))) + ) + 0.0 + (let ((f24-0 (+ 0.0 f26-0))) + (dotimes (s3-0 (-> arg2 num-inner-points)) + (let ((f22-0 (lerp f30-0 f28-0 f24-0))) + (let ((s2-0 (-> this desired-points data (+ s3-0 1 arg1)))) + (let* ((f20-0 -0.5) + (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (set! (-> s2-0 x) (+ f20-0 (+ -1.0 (the-as float v1-14)))) + ) + (let* ((f20-1 -0.5) + (v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-19 (the-as number (logior #x3f800000 v1-18))) + ) + (set! (-> s2-0 y) (+ f20-1 (+ -1.0 (the-as float v1-19)))) + ) + (set! (-> s2-0 z) f22-0) + (set! (-> s2-0 w) 1.0) + ) + (set! (-> this current-points data (+ s3-0 1 arg1) z) f22-0) + ) + (+! f24-0 f26-0) + ) + ) + ) + ) + ((= v1-0 1) + (lightning-bolt-method-21 this arg1 (+ (-> arg2 num-inner-points) 1 arg1) 1.0) + ) + ) + ) + (none) + ) + +;; definition for method 14 of type lightning-bolt +;; WARN: Return type mismatch uint vs int. +(defmethod lightning-bolt-method-14 ((this lightning-bolt)) + (the-as int (-> this fade-mode)) + ) + +;; definition for method 13 of type lightning-bolt +;; WARN: Return type mismatch int vs none. +(defmethod lightning-bolt-method-13 ((this lightning-bolt) (arg0 int)) + (when (!= (-> this fade-mode) arg0) + (let ((v1-1 arg0)) + (cond + ((zero? v1-1) + (set! (-> this current-fade-scalar) 1.0) + (set-time! (-> this start-fade-time)) + ) + ((= v1-1 2) + (set-time! (-> this start-fade-time)) + (set! (-> this current-fade-scalar) 1.0) + ) + ((= v1-1 1) + (set! (-> this current-fade-scalar) 0.0) + (set-time! (-> this start-fade-time)) + ) + ((= v1-1 3) + (dotimes (v1-12 (-> this num-spans)) + (logand! (-> this spans-internal data v1-12 span-flags) -2) + ) + ) + ) + ) + (set! (-> this fade-mode) (the-as uint arg0)) + ) + (none) + ) + +;; definition for method 11 of type lightning-bolt +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 11 lightning-bolt) has a return type of none, but the expression builder found a return statement. +(defmethod lightning-bolt-method-11 ((this lightning-bolt)) + (local-vars + (sv-16 time-frame) + (sv-24 float) + (sv-32 time-frame) + (sv-40 float) + (sv-64 vector) + (sv-68 float) + (sv-72 float) + ) + (with-pp + (case (-> this fade-mode) + ((2) + (let* ((f1-2 (/ (the float (- (current-time) (-> this start-fade-time))) (the float (-> this appearance fade-time)))) + (f0-3 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (set! (-> this current-fade-scalar) (lerp 1.0 0.0 f0-3)) + ) + (if (>= 0.0 (-> this current-fade-scalar)) + (lightning-bolt-method-13 this 3) + ) + ) + ((1) + (let* ((f1-7 (/ (the float (- (current-time) (-> this start-fade-time))) (the float (-> this appearance fade-time)))) + (f0-9 (fmax 0.0 (fmin 1.0 f1-7))) + ) + (set! (-> this current-fade-scalar) (lerp 0.0 1.0 f0-9)) + ) + (if (>= (-> this current-fade-scalar) 1.0) + (lightning-bolt-method-13 this 0) + ) + ) + ) + (if (= (-> this fade-mode) 3) + (return 0) + ) + (if (zero? (-> this fade-mode)) + (set! (-> this current-fade-scalar) 1.0) + ) + (set! (-> this num-active-spans) (min (-> this num-active-spans) (+ (-> this num-spans) -1))) + (let ((v1-31 (-> this num-active-spans)) + (a0-14 (+ (-> this num-spans) -1)) + ) + (while (>= a0-14 v1-31) + (let ((a1-6 (-> this spans-internal data v1-31))) + (logand! (-> a1-6 span-flags) -2) + ) + (+! v1-31 1) + ) + ) + (let ((v1-37 (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time)))) + (dotimes (a0-17 (-> this num-active-spans)) + (-> this spans data a0-17) + (let ((a1-12 (-> this spans-internal data a0-17))) + (if (or v1-37 (not (logtest? (-> a1-12 span-flags) 1))) + (logior! (-> a1-12 span-flags) 2) + (logand! (-> a1-12 span-flags) -3) + ) + ) + ) + ) + (let ((s5-0 0)) + (dotimes (s4-0 (-> this num-active-spans)) + (-> this spans data s4-0) + (let* ((a2-13 (-> this spans-internal data s4-0)) + (s3-0 (+ (-> a2-13 num-inner-points) 1)) + ) + (when (logtest? (-> a2-13 span-flags) 2) + (when (or (-> this snap-inner-points?) + (and (logtest? (-> a2-13 span-flags) 2) (not (logtest? (-> a2-13 span-flags) 1))) + ) + (dotimes (v1-55 s3-0) + (set! (-> this current-points data (+ v1-55 s5-0) quad) (-> this desired-points data (+ v1-55 s5-0) quad)) + ) + ) + (lightning-bolt-method-20 this s5-0 a2-13) + ) + (+! s5-0 s3-0) + ) + ) + (when (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time)) + (lightning-bolt-method-20 this s5-0 (-> this spans-internal data (-> this num-active-spans))) + (if (-> this snap-inner-points?) + (set! (-> this current-points data s5-0 quad) (-> this desired-points data s5-0 quad)) + ) + (set-time! (-> this last-generate-time)) + (set! (-> this new-inner-point-generate-time) (rand-vu-int-range + (the-as int (-> this appearance regenerate-time-start)) + (the-as int (-> this appearance regenerate-time-end)) + ) + ) + ) + ) + (let ((s5-1 0)) + (dotimes (s4-1 (-> this num-active-spans)) + (let* ((a1-24 (-> this spans data s4-1)) + (a3-5 (-> this spans-internal data s4-1)) + (s3-1 (+ (-> a3-5 num-inner-points) 1)) + ) + (if (logtest? (-> a3-5 span-flags) 2) + (lightning-bolt-method-15 this a1-24 s5-1 a3-5) + ) + (+! s5-1 s3-1) + ) + ) + ) + (let ((s5-2 0)) + (dotimes (s4-2 (+ (-> this num-active-spans) 1)) + (-> this spans data s4-2) + (let* ((v1-102 (-> this spans-internal data s4-2)) + (s3-2 (+ (-> v1-102 num-inner-points) 1)) + ) + (if (= s4-2 (-> this num-active-spans)) + (set! s3-2 1) + ) + (cond + ((not (-> this appearance use-accurate-interp?)) + (let ((a0-49 (the-as int (- (current-time) (-> pp clock old-frame-counter))))) + 0.0 + (if (logtest? (-> v1-102 span-flags) 2) + (set! a0-49 0) + ) + (let* ((f1-12 (/ (the float a0-49) (the float (-> this inner-point-travel-time)))) + (f30-0 (fmax 0.0 (fmin 1.0 f1-12))) + ) + (dotimes (s2-0 s3-2) + (vector-lerp! + (-> this current-points data (+ s2-0 s5-2)) + (-> this current-points data (+ s2-0 s5-2)) + (-> this desired-points data (+ s2-0 s5-2)) + f30-0 + ) + ) + ) + ) + ) + (else + (set! sv-16 (- (current-time) (- (current-time) (-> pp clock old-frame-counter)))) + (set! sv-24 (the-as float 0.0)) + (set! sv-32 (current-time)) + (set! sv-40 (the-as float 0.0)) + (set! sv-24 + (/ (the float (- sv-16 (-> this last-generate-time))) (the float (-> this inner-point-travel-time))) + ) + (set! sv-40 + (/ (the float (- sv-32 (-> this last-generate-time))) (the float (-> this inner-point-travel-time))) + ) + (set! sv-24 (fmax 0.0 (fmin 1.0 sv-24))) + (set! sv-40 (fmax 0.0 (fmin 1.0 sv-40))) + (let ((f30-1 (- 1.0 sv-24))) + (dotimes (s2-1 s3-2) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! sv-68 (the-as float 0.0)) + (set! sv-72 (the-as float 0.0)) + (set-vector! + sv-64 + (- (-> this desired-points data (+ s2-1 s5-2) x) (-> this current-points data (+ s2-1 s5-2) x)) + (- (-> this desired-points data (+ s2-1 s5-2) y) (-> this current-points data (+ s2-1 s5-2) y)) + 0.0 + 1.0 + ) + (set! sv-68 (vector-normalize-ret-len! sv-64 1.0)) + (when (< 0.0 f30-1) + (set! sv-72 (/ sv-68 f30-1)) + (vector-float*! sv-64 sv-64 (* sv-72 (- sv-40 sv-24))) + (vector+! (-> this current-points data (+ s2-1 s5-2)) (-> this current-points data (+ s2-1 s5-2)) sv-64) + (set! (-> this current-points data (+ s2-1 s5-2) z) (-> this desired-points data (+ s2-1 s5-2) z)) + ) + ) + ) + ) + ) + (+! s5-2 s3-2) + ) + ) + ) + (dotimes (v1-156 (-> this num-active-spans)) + (-> this spans data v1-156) + (let ((a0-82 (-> this spans-internal data v1-156))) + (logior! (-> a0-82 span-flags) 1) + ) + ) + (none) + ) + ) + +;; definition for method 19 of type lightning-bolt +;; WARN: Return type mismatch vector vs none. +(defmethod lightning-bolt-method-19 ((this lightning-bolt) (arg0 vector) (arg1 int) (arg2 int) (arg3 matrix) (arg4 float) (arg5 float)) + (let ((a1-2 + (vector-! (new 'stack-no-clear 'vector) (-> this current-points data arg2) (-> this current-points data arg1)) + ) + ) + (set! (-> a1-2 x) (* (-> a1-2 x) arg4)) + (set! (-> a1-2 y) (* (-> a1-2 y) arg4)) + (set! (-> a1-2 z) (* (-> a1-2 z) arg5)) + (vector-rotate*! arg0 a1-2 arg3) + ) + (none) + ) + +;; definition for function matrix<-vector-yz2! +;; INFO: Used lq/sq +(defun matrix<-vector-yz2! ((arg0 matrix) (arg1 vector) (arg2 vector)) + (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-cross! (-> arg0 rvec) arg2 arg1) + (vector-normalize! (-> arg0 rvec) 1.0) + (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) + (vector-normalize! (-> arg0 uvec) 1.0) + (set! (-> arg0 rvec w) 1.0) + (set! (-> arg0 uvec w) 1.0) + (set! (-> arg0 fvec w) 1.0) + arg0 + ) + +;; definition for method 22 of type lightning-bolt +;; WARN: Return type mismatch number vs none. +;; WARN: Function (method 22 lightning-bolt) has a return type of none, but the expression builder found a return statement. +(defmethod lightning-bolt-method-22 ((this lightning-bolt)) + (with-pp + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (set! (-> this strip1 adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip1 data0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> this strip2 adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> this strip2 data0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> this strip1 adnops 1 cmds) (gs-reg64 alpha-1)) + (set! (-> this strip2 adnops 1 cmds) (gs-reg64 alpha-1)) + (let ((v1-9 (-> this appearance blend-mode))) + (cond + ((= v1-9 1) + (set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-additive*)) + (set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-additive*)) + ) + ((zero? v1-9) + (set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-blend*)) + (set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-blend*)) + ) + ((= v1-9 2) + (set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-subtractive*)) + (set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-subtractive*)) + ) + ) + ) + (set! (-> this strip1 tex-id) (the-as texture-id (-> this appearance tex-id))) + (set! (-> this strip2 tex-id) (the-as texture-id (-> this appearance tex-id))) + (if (= (-> this fade-mode) 3) + (return 0) + ) + (when (-> this appearance uv-shift?) + (let ((f0-2 (/ (the float (- (current-time) (-> pp clock old-frame-counter))) + (the float (-> this appearance uv-shift-speed)) + ) + ) + ) + (+! (-> this current-uv-shift) f0-2) + ) + (let ((f0-4 (-> this current-uv-shift))) + (set! (-> this current-uv-shift) (- f0-4 (the float (the int f0-4)))) + ) + (if (< (-> this current-uv-shift) 1.0) + (+! (-> this current-uv-shift) 1.0) + ) + ) + (none) + ) + ) + +;; definition for function choose-nice-perp +(defun choose-nice-perp ((arg0 vector)) + (let* ((f0-0 (-> arg0 x)) + (f0-2 (* f0-0 f0-0)) + (f1-0 (-> arg0 z)) + ) + (if (< (+ f0-2 (* f1-0 f1-0)) 0.01) + *x-vector* + *up-vector* + ) + ) + ) + +;; definition for method 12 of type lightning-bolt +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 12 lightning-bolt) has a return type of none, but the expression builder found a return statement. +(defmethod lightning-bolt-method-12 ((this lightning-bolt)) + (local-vars + (sv-48 int) + (sv-56 float) + (sv-60 vector) + (sv-64 matrix) + (sv-96 lightning-span) + (sv-100 lightning-span-internal) + (sv-104 vector) + (sv-224 matrix) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 vector) + (sv-244 float) + (sv-248 float) + (sv-256 int) + (sv-288 lightning-span) + (sv-292 lightning-span-internal) + (sv-296 vector) + (sv-416 matrix) + (sv-420 vector) + (sv-424 vector) + (sv-428 vector) + (sv-432 float) + ) + (when (= (-> this fade-mode) 3) + (set! (-> this strip1 num-verts) (the-as uint 0)) + (set! (-> this strip2 num-verts) (the-as uint 0)) + (return 0) + ) + (set! sv-48 0) + (set! sv-56 (the-as float 0.0)) + (set! sv-60 (new 'stack-no-clear 'vector)) + (set! sv-64 (new 'stack-no-clear 'matrix)) + (lightning-bolt-method-22 this) + (set! (-> sv-60 x) 0.0) + (set! (-> sv-60 y) 0.0) + (dotimes (s5-0 (-> this num-active-spans)) + (set! sv-96 (-> this spans data s5-0)) + (set! sv-100 (-> this spans-internal data s5-0)) + (set! sv-104 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'matrix)) + (set! sv-228 (new 'stack-no-clear 'vector)) + (set! sv-232 (new 'stack-no-clear 'vector)) + (set! sv-236 (the-as float 0.0)) + (set! sv-240 + (vector-! + (new 'stack-no-clear 'vector) + (-> this span-pts-start data (+ s5-0 1)) + (-> this span-pts-start data s5-0) + ) + ) + (set! sv-244 (the float (-> sv-100 index))) + (vector-normalize! sv-240 1.0) + (set! sv-236 + (vector-vector-distance (-> this span-pts-start data s5-0) (-> this span-pts-start data (+ s5-0 1))) + ) + (matrix<-vector-yz2! sv-224 sv-240 (choose-nice-perp sv-240)) + (let ((f30-0 (-> sv-96 random-offset-size-start))) + (lightning-bolt-method-19 this sv-104 sv-48 (+ sv-48 1) sv-224 f30-0 sv-236) + (set! (-> sv-232 quad) (-> this current-points data sv-48 quad)) + (set! (-> sv-232 x) (* (-> sv-232 x) f30-0)) + (set! (-> sv-232 y) (* (-> sv-232 y) f30-0)) + ) + (set! (-> sv-232 z) (- (-> sv-232 z) sv-244)) + (set! (-> sv-232 z) (* (-> sv-232 z) sv-236)) + (vector-rotate*! sv-228 sv-232 sv-224) + (vector+! sv-228 sv-228 (-> this span-pts-start data s5-0)) + (lightning-bolt-method-16 this sv-228 (vector-length sv-232) sv-56 sv-60 (the-as matrix sv-104)) + (set! sv-248 (-> sv-96 inner-random-offset-size)) + (dotimes (s4-1 (-> sv-100 num-inner-points)) + (set! sv-256 (+ sv-48 1 s4-1)) + (lightning-bolt-method-19 this sv-104 (+ sv-256 -1) sv-256 sv-224 sv-248 sv-236) + (set! (-> sv-232 quad) (-> this current-points data sv-256 quad)) + (set! (-> sv-232 x) (* (-> sv-232 x) sv-248)) + (set! (-> sv-232 y) (* (-> sv-232 y) sv-248)) + (set! (-> sv-232 z) (- (-> sv-232 z) sv-244)) + (set! (-> sv-232 z) (* (-> sv-232 z) sv-236)) + (vector-rotate*! sv-228 sv-232 sv-224) + (vector+! sv-228 sv-228 (-> this span-pts-start data s5-0)) + (lightning-bolt-method-16 this sv-228 (vector-length sv-232) sv-56 sv-60 (the-as matrix sv-104)) + ) + (set! sv-56 (+ sv-56 sv-236)) + (set! sv-48 (+ (-> sv-100 num-inner-points) 1 sv-48)) + (set! (-> sv-64 rvec quad) (-> sv-104 quad)) + ) + (let ((s5-1 (-> this num-active-spans))) + (set! sv-288 (-> this spans data s5-1)) + (set! sv-292 (-> this spans-internal data s5-1)) + (set! sv-296 (new 'stack-no-clear 'vector)) + (set! sv-416 (new 'stack-no-clear 'matrix)) + (set! sv-420 (new 'stack-no-clear 'vector)) + (set! sv-424 (new 'stack-no-clear 'vector)) + (set! sv-428 (vector-! + (new 'stack-no-clear 'vector) + (-> this span-pts-start data s5-1) + (-> this span-pts-start data (+ s5-1 -1)) + ) + ) + (set! sv-432 (the float (-> sv-292 index))) + (vector-normalize! sv-428 1.0) + (matrix<-vector-yz2! sv-416 sv-428 (choose-nice-perp sv-428)) + (let ((f0-33 (-> sv-288 random-offset-size-start))) + (set! (-> sv-424 quad) (-> this current-points data sv-48 quad)) + (set! (-> sv-424 x) (* (-> sv-424 x) f0-33)) + (set! (-> sv-424 y) (* (-> sv-424 y) f0-33)) + ) + (set! (-> sv-424 z) (- (-> sv-424 z) sv-432)) + (vector-rotate*! sv-420 sv-424 sv-416) + (vector+! sv-420 sv-420 (-> this span-pts-start data s5-1)) + ) + (lightning-bolt-method-16 this sv-420 0.0 sv-56 sv-60 sv-64) + 0 + (none) + ) + +;; definition for method 7 of type lightning-bolt +(defmethod relocate ((this lightning-bolt) (offset int)) + (if (nonzero? (-> this spans)) + (&+! (-> this spans) offset) + ) + (if (nonzero? (-> this strip1)) + (&+! (-> this strip1) offset) + ) + (if (nonzero? (-> this strip2)) + (&+! (-> this strip2) offset) + ) + (dotimes (v1-12 (+ (-> this num-spans) -1)) + ) + (if (nonzero? (-> this spans-internal)) + (&+! (-> this spans-internal) offset) + ) + (if (nonzero? (-> this current-points)) + (&+! (-> this current-points) offset) + ) + (if (nonzero? (-> this desired-points)) + (&+! (-> this desired-points) offset) + ) + (if (nonzero? (-> this span-pts-start)) + (&+! (-> this span-pts-start) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 17 of type lightning-bolt +(defmethod lightning-bolt-method-17 ((this lightning-bolt) (arg0 uint) (arg1 float) (arg2 float) (arg3 curve2d-fast) (arg4 float)) + (if (not arg3) + (return 1.0) + ) + (let ((v1-2 arg0)) + (cond + ((zero? v1-2) + (curve2d-method-9 arg3 (/ arg2 arg4) 3) + ) + ((= v1-2 1) + (curve2d-method-9 arg3 arg1 3) + ) + ((= v1-2 2) + (let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-7 (the-as number (logior #x3f800000 v1-6))) + ) + (+ -1.0 (the-as float v1-7)) + ) + ) + (else + 1.0 + ) + ) + ) + ) + +;; definition for method 16 of type lightning-bolt +;; WARN: Return type mismatch int vs none. +(defmethod lightning-bolt-method-16 ((this lightning-bolt) (arg0 vector) (arg1 float) (arg2 float) (arg3 vector) (arg4 matrix)) + (local-vars (sv-160 vector) (sv-164 vector) (sv-168 vector) (sv-172 vector) (sv-176 rgba)) + 0.0 + 0.0 + 0.0 + (let ((f28-0 + (/ (the float (- (current-time) (-> this last-generate-time))) (the float (-> this inner-point-travel-time))) + ) + (f30-0 (+ arg2 arg1)) + ) + (math-camera-pos) + (let* ((s2-0 (-> this appearance)) + (f24-0 (* (lightning-bolt-method-17 + this + (-> s2-0 alpha-1-mode) + f28-0 + f30-0 + (-> s2-0 alpha-1-curve) + (-> s2-0 alpha-1-repeat-dist) + ) + (lightning-bolt-method-17 + this + (-> s2-0 alpha-2-mode) + f28-0 + f30-0 + (-> s2-0 alpha-2-curve) + (-> s2-0 alpha-2-repeat-dist) + ) + (-> s2-0 base-alpha) + (-> this current-fade-scalar) + ) + ) + (f22-0 (* (lightning-bolt-method-17 + this + (-> s2-0 width-mode) + f28-0 + f30-0 + (-> s2-0 width-curve) + (-> s2-0 width-repeat-dist) + ) + (-> this base-width) + ) + ) + (f0-14 (/ f30-0 (-> s2-0 uv-repeat-dist))) + (f28-1 (+ (- f0-14 (* (the float (the int (/ f0-14 6.0))) 6.0)) (-> this current-uv-shift))) + ) + (vector-normalize! (the-as vector arg4) 1.0) + (let* ((a2-4 (-> (camera-matrix) uvec)) + (v1-13 (matrix-f-u-compose (new 'stack-no-clear 'matrix) (the-as vector arg4) a2-4)) + (f26-1 6.0) + ) + (set! sv-160 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* 0.5 f22-0))) + (set! sv-164 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* -0.5 f22-0))) + (set! sv-168 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* 0.5 f22-0))) + (set! sv-172 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* -0.5 f22-0))) + (set! sv-176 (the-as rgba (new 'stack-no-clear 'array 'rgba 1))) + (set! sv-176 (-> this base-color)) + (set! sv-176 (copy-and-set-field sv-176 a (the int (* 128.0 f24-0)))) + (when (< f28-1 (-> arg3 x)) + (let ((s3-1 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (let ((f24-1 (/ (- (+ f26-1 f28-1) (-> arg3 x)) f26-1))) + (let ((a1-10 (+ (the-as uint (-> this strip1 data 0 pos)) (* (+ (-> this strip1 num-verts) -2) 32))) + (s2-1 (+ (the-as uint (-> this strip1 data 0 pos)) (* (+ (-> this strip1 num-verts) -1) 32))) + ) + (vector-lerp! s3-1 (the-as vector a1-10) sv-160 f24-1) + (vector-lerp! s4-1 (the-as vector s2-1) sv-164 f24-1) + ) + (lightning-bolt-method-18 this (-> this strip1) s3-1 sv-176 0.0 f26-1) + (lightning-bolt-method-18 this (-> this strip1) s4-1 sv-176 1.0 f26-1) + (lightning-bolt-method-18 this (-> this strip1) s3-1 sv-176 0.0 0.0) + (lightning-bolt-method-18 this (-> this strip1) s4-1 sv-176 1.0 0.0) + (let ((a1-16 (+ (the-as uint (-> this strip2 data 0 pos)) (* (+ (-> this strip2 num-verts) -2) 32))) + (s2-2 (+ (the-as uint (-> this strip2 data 0 pos)) (* (+ (-> this strip2 num-verts) -1) 32))) + ) + (vector-lerp! s3-1 (the-as vector a1-16) sv-168 f24-1) + (vector-lerp! s4-1 (the-as vector s2-2) sv-172 f24-1) + ) + ) + (lightning-bolt-method-18 this (-> this strip2) s3-1 sv-176 1.0 f26-1) + (lightning-bolt-method-18 this (-> this strip2) s4-1 sv-176 0.0 f26-1) + (lightning-bolt-method-18 this (-> this strip2) s3-1 sv-176 1.0 0.0) + (lightning-bolt-method-18 this (-> this strip2) s4-1 sv-176 0.0 0.0) + ) + ) + ) + (lightning-bolt-method-18 this (-> this strip1) sv-160 sv-176 0.0 f28-1) + (lightning-bolt-method-18 this (-> this strip1) sv-164 sv-176 1.0 f28-1) + (lightning-bolt-method-18 this (-> this strip2) sv-168 sv-176 1.0 f28-1) + (lightning-bolt-method-18 this (-> this strip2) sv-172 sv-176 0.0 f28-1) + (set! (-> arg3 y) f30-0) + (set! (-> arg3 x) f28-1) + ) + ) + 0 + (none) + ) + +;; definition for method 18 of type lightning-bolt +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod lightning-bolt-method-18 ((this lightning-bolt) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) + (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) + (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) + (set! (-> v1-5 pos quad) (-> arg1 quad)) + (set! (-> v1-5 col) arg2) + (set! (-> v1-5 stq x) arg3) + (set! (-> v1-5 stq y) arg4) + ) + (+! (-> arg0 num-verts) 1) + ) + 0 + (none) + ) + +;; definition for function lightning-new-tracker-init-by-other +;; INFO: Used lq/sq +(defbehavior lightning-new-tracker-init-by-other lightning-new-tracker ((arg0 lightning-tracker-init-params)) + (set! (-> self bolt) (new 'process 'lightning-bolt)) + (init! (-> self bolt) 2 (+ (-> arg0 num-inner-points) 2) (-> arg0 appearance)) + (set! (-> self lifetime) (-> arg0 lifetime)) + (set! (-> self bolt span-pts-start data 0 quad) (-> arg0 start-pt quad)) + (set! (-> self bolt span-pts-start data 1 quad) (-> arg0 end-pt quad)) + (set! (-> self bolt spans-internal data 0 num-inner-points) (-> arg0 num-inner-points)) + (set! (-> self bolt spans data 0 inner-random-offset-size) (-> arg0 inner-random-offset-size)) + (set! (-> self bolt spans data 0 random-offset-size-start) (-> arg0 random-offset-size-start)) + (set! (-> self bolt inner-point-travel-time) (seconds 0.017)) + (set! (-> self bolt snap-inner-points?) #t) + (set! (-> self bolt appearance) (-> arg0 appearance)) + (set! (-> self bolt fractal-reduction) 0.4) + (set! (-> self bolt generate-mode) (the-as uint 1)) + (go-virtual active) + ) + +;; definition for function create-lightning-tracker-new +;; WARN: Return type mismatch process vs lightning-new-tracker. +(defun create-lightning-tracker-new ((arg0 lightning-tracker-init-params)) + (let ((v1-1 (process-spawn lightning-new-tracker arg0 :name "lightning-new-tracker" :stack-size #x8000))) + (if v1-1 + (return (the-as lightning-new-tracker (-> v1-1 0))) + ) + ) + (the-as lightning-new-tracker #f) + ) + +;; definition for method 7 of type lightning-new-tracker +(defmethod relocate ((this lightning-new-tracker) (offset int)) + (if (nonzero? (-> this bolt)) + (&+! (-> this bolt) offset) + ) + (call-parent-method this offset) + ) + +;; failed to figure out what this is: +(defstate active (lightning-new-tracker) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self bolt num-active-spans) 1) + (lightning-bolt-method-13 (-> self bolt) 0) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (-> self lifetime)) + (go-virtual die) + ) + (lightning-bolt-method-11 (-> self bolt)) + (lightning-bolt-method-12 (-> self bolt)) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (lightning-new-tracker) + :virtual #t + :enter (behavior () + (lightning-bolt-method-13 (-> self bolt) 2) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (lightning-bolt-method-11 (-> self bolt)) + (lightning-bolt-method-12 (-> self bolt)) + ) + :code (behavior () + (until (= (lightning-bolt-method-14 (-> self bolt)) 3) + (suspend) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning_REF.gc new file mode 100644 index 0000000000..dbb8a362d0 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning_REF.gc @@ -0,0 +1,874 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(kmemopen global "part-tables") + +;; definition for symbol *lightning-spec-id-table*, type (array lightning-spec) +(define *lightning-spec-id-table* (new 'global 'boxed-array lightning-spec 128)) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for symbol *lightning-gcf*, type gcf-control +(define *lightning-gcf* + (new 'static 'gcf-control + :giftag (new 'static 'generic-gif-tag + :fan-prim (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + :str-prim (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + :regs (new 'static 'gif-tag-regs-32 :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + :adnops (new 'static 'inline-array gs-adcmd 2 + (new 'static 'gs-adcmd :cmds (gs-reg64 hack)) + (new 'static 'gs-adcmd :cmds (gs-reg64 hack)) + ) + ) + ) + +;; definition for function lightning-fractal-gen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun lightning-fractal-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec)) + (local-vars (sv-16 vector) (sv-32 vector)) + (when (< 1 (- arg2 arg1)) + (let ((s1-0 (/ (+ arg1 arg2) 2))) + (set! sv-16 (-> arg0 arg1)) + (set! sv-32 (-> arg0 arg2)) + (let ((s0-0 (-> arg0 s1-0))) + (let* ((f30-0 (* 0.5 (+ (-> sv-16 x) (-> sv-32 x)))) + (f28-0 arg3) + (f26-0 -0.5) + (v1-12 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-13 (the-as number (logior #x3f800000 v1-12))) + ) + (set! (-> s0-0 x) (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-13)))))) + ) + (let* ((f30-1 (* 0.5 (+ (-> sv-16 y) (-> sv-32 y)))) + (f28-1 arg3) + (f26-1 -0.5) + (v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-20 (the-as number (logior #x3f800000 v1-19))) + ) + (set! (-> s0-0 y) (+ f30-1 (* f28-1 (+ f26-1 (+ -1.0 (the-as float v1-20)))))) + ) + (let* ((f30-2 (* 0.5 (+ (-> sv-16 z) (-> sv-32 z)))) + (f28-2 arg3) + (f26-2 -0.5) + (v1-26 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-27 (the-as number (logior #x3f800000 v1-26))) + ) + (set! (-> s0-0 z) (+ f30-2 (* f28-2 (+ f26-2 (+ -1.0 (the-as float v1-27)))))) + ) + ) + (lightning-fractal-gen arg0 arg1 s1-0 (* arg3 (-> arg4 reduction)) arg4) + (lightning-fractal-gen arg0 s1-0 arg2 (* arg3 (-> arg4 reduction)) arg4) + ) + ) + 0 + (none) + ) + +;; definition for function lightning-uniform-gen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun lightning-uniform-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec)) + (local-vars (sv-32 vector)) + (let ((s4-0 (-> arg0 arg1)) + (s3-0 (-> arg0 arg2)) + (f30-0 (/ 1.0 (the float (- arg2 arg1)))) + (f28-0 0.0) + (s2-0 (new-stack-vector0)) + (s1-0 arg1) + (s0-0 arg2) + ) + (while (>= s0-0 s1-0) + (vector-lerp! (-> arg0 s1-0) s4-0 s3-0 f28-0) + (set! sv-32 s2-0) + (let* ((f26-0 0.4) + (f24-0 -0.5) + (v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-8 (the-as number (logior #x3f800000 v1-7))) + ) + (set! (-> sv-32 x) (* f26-0 (+ f24-0 (+ -1.0 (the-as float v1-8))) arg3)) + ) + (let* ((f26-1 0.4) + (f24-1 -0.5) + (v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (set! (-> sv-32 y) (* f26-1 (+ f24-1 (+ -1.0 (the-as float v1-14))) arg3)) + ) + (let* ((f26-2 0.4) + (f24-2 -0.5) + (v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-20 (the-as number (logior #x3f800000 v1-19))) + ) + (set! (-> sv-32 z) (* f26-2 (+ f24-2 (+ -1.0 (the-as float v1-20))) arg3)) + ) + (set! (-> sv-32 w) 1.0) + (vector+! (-> arg0 s1-0) (-> arg0 s1-0) s2-0) + (+! f28-0 f30-0) + (+! s1-0 1) + ) + ) + 0 + (none) + ) + +;; definition for function lightning-trail-uniform-gen +(defun lightning-trail-uniform-gen ((arg0 (inline-array vector)) (arg1 (inline-array vector)) (arg2 float) (arg3 int)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (dotimes (s1-0 arg3) + (let ((s0-0 s2-0)) + (let* ((f30-0 0.4) + (f28-0 -0.5) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> s0-0 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-4))) arg2)) + ) + (let* ((f30-1 0.4) + (f28-1 -0.5) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (set! (-> s0-0 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-10))) arg2)) + ) + (let* ((f30-2 0.4) + (f28-2 -0.5) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> s0-0 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-16))) arg2)) + ) + (set! (-> s0-0 w) 1.0) + ) + (vector+! (-> arg0 s1-0) (-> arg1 s1-0) s2-0) + ) + ) + #f + ) + +;; definition for function lightning-trail-fractal-gen +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun lightning-trail-fractal-gen ((arg0 (inline-array vector)) + (arg1 (inline-array vector)) + (arg2 int) + (arg3 int) + (arg4 float) + (arg5 lightning-spec) + ) + (local-vars (sv-80 vector) (sv-96 vector) (sv-112 vector) (sv-128 vector) (sv-144 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (when (< 1 (- arg3 arg2)) + (let ((s0-0 (/ (+ arg2 arg3) 2))) + (set! sv-96 (new 'stack-no-clear 'vector)) + (let ((v1-5 (-> arg0 arg2)) + (a0-3 (-> arg1 arg2)) + ) + (.lvf vf4 (&-> v1-5 quad)) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-96 quad) vf6) + (set! sv-112 (new 'stack-no-clear 'vector)) + (let ((v1-9 (-> arg0 arg3)) + (a0-5 (-> arg1 arg3)) + ) + (.lvf vf4 (&-> v1-9 quad)) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-112 quad) vf6) + (set! sv-144 (new 'stack-no-clear 'vector)) + (set! sv-128 (new 'stack-no-clear 'vector)) + (set! sv-80 sv-144) + (let* ((f30-0 arg4) + (f28-0 -0.5) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> sv-80 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-16))))) + ) + (let* ((f30-1 arg4) + (f28-1 -0.5) + (v1-20 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-21 (the-as number (logior #x3f800000 v1-20))) + ) + (set! (-> sv-80 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-21))))) + ) + (let* ((f30-2 arg4) + (f28-2 -0.5) + (v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-26 (the-as number (logior #x3f800000 v1-25))) + ) + (set! (-> sv-80 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-26))))) + ) + (set! (-> sv-80 w) 1.0) + (let ((v1-31 sv-128) + (a0-15 sv-128) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-96 quad)) + (.lvf vf5 (&-> sv-112 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> a0-15 quad) vf6) + (vector-float*! v1-31 a0-15 0.5) + ) + (let ((v1-33 sv-144)) + (let ((a0-16 sv-144)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-16 quad)) + ) + (.lvf vf5 (&-> sv-128 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-33 quad) vf6) + ) + (let ((v1-35 (-> arg0 s0-0))) + (let ((a0-19 (-> arg1 s0-0))) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-19 quad)) + ) + (.lvf vf5 (&-> sv-144 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-35 quad) vf6) + ) + (lightning-trail-fractal-gen arg0 arg1 arg2 s0-0 (* arg4 (-> arg5 reduction)) arg5) + (lightning-trail-fractal-gen arg0 arg1 s0-0 arg3 (* arg4 (-> arg5 reduction)) arg5) + ) + ) + 0 + (none) + ) + ) + +;; definition of type lightning-globals +(deftype lightning-globals (structure) + ((gcf-buf uint16) + (vtx-buf uint16) + ) + ) + +;; definition for method 3 of type lightning-globals +(defmethod inspect ((this lightning-globals)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lightning-globals) + (format #t "~1Tgcf-buf: ~D~%" (-> this gcf-buf)) + (format #t "~1Tvtx-buf: ~D~%" (-> this vtx-buf)) + (label cfg-4) + this + ) + +;; definition for function gs-packed-rgba-lerp! +(defun gs-packed-rgba-lerp! ((arg0 gs-packed-rgba) (arg1 rgba) (arg2 rgba) (arg3 float)) + (local-vars (v1-0 uint128) (v1-1 uint128) (a1-1 uint128) (a1-2 uint128)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.pextlb v1-0 0 arg1) + (.pextlb a1-1 0 arg2) + (.pextlh v1-1 0 v1-0) + (.pextlh a1-2 0 a1-1) + (.mov vf1 v1-1) + (.mov vf2 a1-2) + (.mov vf3 arg3) + (.itof.vf vf1 vf1) + (.itof.vf vf2 vf2) + (.mul.w.vf acc vf1 vf0) + (.add.mul.x.vf acc vf2 vf3 acc) + (.sub.mul.x.vf vf1 vf1 vf3 acc) + (.ftoi.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function lightning-fade +(defbehavior lightning-fade process ((arg0 lightning-control)) + (local-vars (v0-1 int) (sv-16 rgba)) + (let ((f0-0 (-> arg0 spec fade-time))) + (-> arg0 process 0 clock) + (cond + ((< (-> arg0 state counter) f0-0) + (+! (-> arg0 state counter) (* 300.0 (seconds-per-frame))) + (let ((gp-0 (-> arg0 state))) + (let* ((s5-0 (-> arg0 spec)) + (f30-0 (fmax 0.0 (fmin 1.0 (* (- 1.0 (/ (-> gp-0 counter) f0-0)) (-> s5-0 fade-start-factor))))) + ) + (set! sv-16 (-> s5-0 fade-to-color)) + (set! (-> gp-0 start-color) (rgba-lerp sv-16 (-> s5-0 start-color) (the-as rgba f30-0))) + (set! v0-1 (the-as int (rgba-lerp sv-16 (-> s5-0 end-color) (the-as rgba f30-0)))) + ) + (set! (-> gp-0 end-color) (the-as rgba v0-1)) + ) + ) + (else + (let ((v1-9 arg0)) + (set! v0-1 0) + (let ((a0-4 (!= v0-1 (-> v1-9 state mode)))) + (case v0-1 + ((3) + (if a0-4 + (set! (-> v1-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-9 state start-color) (-> v1-9 spec start-color)) + (set! (-> v1-9 state end-color) (-> v1-9 spec end-color)) + ) + ) + ) + (set! (-> v1-9 state mode) (the-as uint v0-1)) + ) + ) + ) + ) + v0-1 + ) + +;; definition for function lightning-update +;; INFO: Used lq/sq +(defun lightning-update ((arg0 lightning-control)) + (local-vars + (sv-16 lightning-spec) + (sv-20 vector-array) + (sv-24 vector-array) + (sv-28 vector-array) + (sv-32 symbol) + (sv-36 clock) + ) + (let* ((gp-0 (-> arg0 state points-to-draw)) + (s4-0 (+ gp-0 -1)) + (s5-0 (-> arg0 state)) + ) + (set! sv-16 (-> arg0 spec)) + (set! sv-20 (-> s5-0 line)) + (set! sv-24 (-> s5-0 meet)) + (set! sv-28 (-> s5-0 path)) + (set! sv-32 (= (-> s5-0 mode) 1)) + (set! sv-36 (-> arg0 process 0 clock)) + (when (not (or (= (-> sv-36 time-adjust-ratio) 0.0) (< gp-0 2))) + (when (logtest? (-> sv-16 flags) (lightning-spec-flags lsf4)) + (let ((f1-1 (vector-vector-distance (the-as vector (-> sv-24 data)) (-> sv-24 data s4-0)))) + (set! (-> s5-0 box-size) + (* (-> sv-16 box-size) (fmax 1.0 (fmin 5.0 (/ f1-1 (* 4096.0 (the float (-> sv-16 adjust-distance))))))) + ) + ) + ) + (set! (-> s5-0 counter) (fmax 0.0 (- (-> s5-0 counter) (-> sv-36 time-adjust-ratio)))) + (when sv-32 + (set! (-> s5-0 mode) (the-as uint 2)) + (set! (-> s5-0 counter) 0.0) + ) + (when (>= 0.0 (-> s5-0 counter)) + (let ((v1-33 (-> sv-16 rand-func))) + (cond + ((or (zero? v1-33) (= v1-33 1)) + (let ((v1-35 (-> sv-16 rand-func))) + (cond + ((zero? v1-35) + (lightning-fractal-gen (-> sv-24 data) 0 s4-0 (-> s5-0 box-size) sv-16) + ) + ((= v1-35 1) + (lightning-uniform-gen (-> sv-24 data) 0 s4-0 (-> s5-0 box-size) sv-16) + ) + ) + ) + (when sv-32 + (dotimes (v1-43 gp-0) + (set! (-> sv-20 data v1-43 quad) (-> sv-24 data v1-43 quad)) + ) + ) + ) + ((or (= v1-33 2) (= v1-33 3)) + (case (-> sv-16 rand-func) + ((2) + (set! (-> sv-24 data 0 quad) (-> sv-28 data 0 quad)) + (set! (-> sv-24 data s4-0 quad) (-> sv-28 data s4-0 quad)) + (lightning-trail-fractal-gen (-> sv-24 data) (-> sv-28 data) 0 s4-0 (-> s5-0 box-size) sv-16) + ) + (else + (lightning-trail-uniform-gen (-> sv-24 data) (-> sv-28 data) (-> s5-0 box-size) gp-0) + ) + ) + (when sv-32 + (dotimes (v1-63 gp-0) + (set! (-> sv-20 data v1-63 quad) (-> sv-28 data v1-63 quad)) + ) + ) + ) + ) + ) + (set! (-> s5-0 counter) (the float (-> sv-16 merge-count))) + ) + (let ((f0-14 (fmax 0.0 (fmin 1.0 (* (-> sv-16 merge-factor) (-> sv-36 time-adjust-ratio)))))) + (dotimes (v1-72 gp-0) + (let* ((a1-21 (-> sv-20 data v1-72)) + (a2-7 (-> sv-24 data v1-72)) + (a0-31 a1-21) + ) + (set! (-> a0-31 x) (+ (-> a1-21 x) (* f0-14 (- (-> a2-7 x) (-> a1-21 x))))) + (set! (-> a0-31 y) (+ (-> a1-21 y) (* f0-14 (- (-> a2-7 y) (-> a1-21 y))))) + (set! (-> a0-31 z) (+ (-> a1-21 z) (* f0-14 (- (-> a2-7 z) (-> a1-21 z))))) + ) + ) + ) + #f + ) + ) + ) + +;; definition for function lightning-draw +;; INFO: Used lq/sq +(defun lightning-draw ((arg0 dma-buffer) (arg1 lightning-control) (arg2 lightning-globals)) + (local-vars + (sv-16 math-camera) + (sv-20 (inline-array gcf-vertex)) + (sv-24 lightning-spec) + (sv-28 float) + (sv-32 texture) + (sv-48 vector-array) + (sv-64 int) + (sv-80 int) + (sv-96 int) + (sv-112 int) + (sv-128 int) + (sv-144 int) + (sv-160 int) + (sv-176 gcf-control) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf17 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (set! sv-16 *math-camera*) + (set! sv-20 (the-as (inline-array gcf-vertex) *gsf-buffer*)) + (let* ((s3-0 (-> arg1 state points-to-draw)) + (s2-0 (+ s3-0 -1)) + (s1-0 *lightning-gcf*) + (s0-0 (-> sv-16 camera-rot)) + ) + (set! sv-32 (lookup-texture-by-id (-> arg1 spec texture))) + (set! sv-48 (-> arg1 state line)) + (set! sv-24 (-> arg1 spec)) + (when (< 1 s3-0) + (set! sv-64 0) + (while (< sv-64 2) + (set! sv-28 (/ 1.0 (the float s2-0))) + (cond + ((logtest? (-> sv-24 flags) (lightning-spec-flags lsf0)) + (set! sv-80 0) + (while (< sv-80 (* s3-0 2)) + (cond + ((not (logtest? sv-80 1)) + (gs-packed-rgba-lerp! + (-> sv-20 sv-80 clr) + (-> arg1 state start-color) + (-> arg1 state end-color) + (* (the float (/ sv-80 2)) sv-28) + ) + (let ((v1-24 (-> sv-20 sv-80))) + (set! (-> v1-24 tex x) 0) + (set! (-> v1-24 tex y) (* (/ 4096 s3-0) (/ sv-80 2))) + (set! (-> v1-24 tex z) 4096) + (set! (-> v1-24 tex w) 0) + ) + ) + (else + (gs-packed-rgba-lerp! + (-> sv-20 sv-80 clr) + (-> arg1 state start-color) + (-> arg1 state end-color) + (* (the float (/ sv-80 2)) sv-28) + ) + (let ((v1-33 (-> sv-20 sv-80))) + (set! (-> v1-33 tex x) 4096) + (set! (-> v1-33 tex y) (* (/ 4096 s3-0) (/ sv-80 2))) + (set! (-> v1-33 tex z) 4096) + (set! (-> v1-33 tex w) 0) + ) + ) + ) + (set! sv-80 (+ sv-80 1)) + ) + ) + ((logtest? (-> sv-24 flags) (lightning-spec-flags lsf1)) + (dotimes (v1-43 (* s3-0 2)) + (cond + ((not (logtest? v1-43 1)) + (let ((a0-26 (-> sv-20 v1-43))) + (set! (-> a0-26 tex x) 0) + (set! (-> a0-26 tex y) (* (/ 4096 s3-0) (/ v1-43 2))) + (set! (-> a0-26 tex z) 4096) + (set! (-> a0-26 tex w) 0) + ) + ) + (else + (let ((a0-30 (-> sv-20 v1-43))) + (set! (-> a0-30 tex x) 4096) + (set! (-> a0-30 tex y) (* (/ 4096 s3-0) (/ v1-43 2))) + (set! (-> a0-30 tex z) 4096) + (set! (-> a0-30 tex w) 0) + ) + ) + ) + ) + (dotimes (v1-46 (* s2-0 2)) + (set! (-> sv-20 v1-46 clr x) (the-as int (-> arg1 state start-color r))) + (set! (-> sv-20 v1-46 clr y) (the-as int (-> arg1 state start-color g))) + (set! (-> sv-20 v1-46 clr z) (the-as int (-> arg1 state start-color b))) + (set! (-> sv-20 v1-46 clr w) (the-as int (-> arg1 state start-color a))) + ) + (dotimes (v1-49 2) + (let ((a0-45 (+ v1-49 (* s2-0 2)))) + (set! (-> sv-20 a0-45 clr x) (the-as int (-> arg1 state end-color r))) + (set! (-> sv-20 a0-45 clr y) (the-as int (-> arg1 state end-color g))) + (set! (-> sv-20 a0-45 clr z) (the-as int (-> arg1 state end-color b))) + (set! (-> sv-20 a0-45 clr w) (the-as int (-> arg1 state end-color a))) + ) + ) + ) + ((logtest? (-> sv-24 flags) (lightning-spec-flags lsf2)) + (dotimes (v1-56 (* s3-0 2)) + (cond + ((not (logtest? v1-56 1)) + (let ((a0-52 (-> sv-20 v1-56))) + (set! (-> a0-52 tex x) 0) + (set! (-> a0-52 tex y) (* (/ 4096 s3-0) (/ v1-56 2))) + (set! (-> a0-52 tex z) 4096) + (set! (-> a0-52 tex w) 0) + ) + ) + (else + (let ((a0-56 (-> sv-20 v1-56))) + (set! (-> a0-56 tex x) 4096) + (set! (-> a0-56 tex y) (* (/ 4096 s3-0) (/ v1-56 2))) + (set! (-> a0-56 tex z) 4096) + (set! (-> a0-56 tex w) 0) + ) + ) + ) + ) + (dotimes (v1-59 (* (+ s3-0 -2) 2)) + (let ((a0-58 (+ v1-59 2))) + (set! (-> sv-20 a0-58 clr x) (the-as int (-> arg1 state start-color r))) + (set! (-> sv-20 a0-58 clr y) (the-as int (-> arg1 state start-color g))) + (set! (-> sv-20 a0-58 clr z) (the-as int (-> arg1 state start-color b))) + (set! (-> sv-20 a0-58 clr w) (the-as int (-> arg1 state start-color a))) + ) + ) + (dotimes (v1-62 2) + (let ((a0-63 v1-62)) + (set! (-> sv-20 a0-63 clr x) (the-as int (-> arg1 state end-color r))) + (set! (-> sv-20 a0-63 clr y) (the-as int (-> arg1 state end-color g))) + (set! (-> sv-20 a0-63 clr z) (the-as int (-> arg1 state end-color b))) + (set! (-> sv-20 a0-63 clr w) (the-as int (-> arg1 state end-color a))) + ) + ) + (dotimes (v1-65 2) + (let ((a0-67 (+ v1-65 (* s2-0 2)))) + (set! (-> sv-20 a0-67 clr x) (the-as int (-> arg1 state end-color r))) + (set! (-> sv-20 a0-67 clr y) (the-as int (-> arg1 state end-color g))) + (set! (-> sv-20 a0-67 clr z) (the-as int (-> arg1 state end-color b))) + (set! (-> sv-20 a0-67 clr w) (the-as int (-> arg1 state end-color a))) + ) + ) + ) + ) + (let ((f0-8 (-> sv-24 radius)) + (f1-4 0.5) + (v1-71 (-> sv-48 data)) + (a0-71 (the-as object (-> sv-20 0))) + (a1-82 (the-as object (-> sv-20 1))) + ) + 1 + (.lvf vf1 (&-> s0-0 rvec quad)) + (.lvf vf2 (&-> s0-0 uvec quad)) + (.lvf vf3 (&-> s0-0 fvec quad)) + (.lvf vf4 (&-> s0-0 trans quad)) + (let ((a2-44 f0-8)) + (.mov vf8 a2-44) + ) + (let ((a2-45 f1-4)) + (.mov vf17 a2-45) + ) + (.add.x.vf vf17 vf0 vf8 :mask #b10) + (.add.w.vf vf17 vf0 vf0 :mask #b100) + (.add.w.vf vf17 vf17 vf0 :mask #b100) + (dotimes (a2-46 s3-0) + (.lvf vf8 (&-> v1-71 0 quad)) + (.mul.w.vf acc vf4 vf0 :mask #b111) + (.add.mul.x.vf acc vf1 vf8 acc :mask #b111) + (.add.mul.y.vf acc vf2 vf8 acc :mask #b111) + (.add.mul.z.vf vf8 vf3 vf8 acc :mask #b111) + (.add.x.vf vf6 vf8 vf0) + (b! (zero? sv-64) cfg-44 :delay (.add.x.vf vf7 vf8 vf0)) + (.add.y.vf vf6 vf6 vf17 :mask #b10) + (b! #t cfg-45 :delay (.sub.y.vf vf7 vf7 vf17 :mask #b10)) + (label cfg-44) + (.add.y.vf vf6 vf6 vf17 :mask #b1) + (.sub.y.vf vf7 vf7 vf17 :mask #b1) + (label cfg-45) + (.svf (&-> (the-as (pointer uint128) a1-82) 2) vf6) + (.svf (&-> (the-as (pointer uint128) a0-71) 2) vf7) + (set! a1-82 (&-> (the-as (pointer uint128) a1-82) 6)) + (set! a0-71 (&-> (the-as (pointer uint128) a0-71) 6)) + (.add.x.vf vf9 vf8 vf0) + (set! v1-71 (the-as (inline-array vector) (-> v1-71 1))) + ) + ) + (set! sv-96 s2-0) + (set! sv-112 0) + (while (> sv-96 0) + (if (< 40 sv-96) + (set! sv-128 40) + (set! sv-128 sv-96) + ) + (set! sv-144 (+ sv-128 1)) + (set! sv-160 12) + (let* ((v1-81 arg0) + (a0-73 (the-as object (-> v1-81 base))) + ) + (set! (-> (the-as dma-packet a0-73) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc sv-160)) + (set! (-> (the-as dma-packet a0-73) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-73) vif1) + (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 gcf-buf) 54) 54) :num sv-160) + ) + (set! (-> v1-81 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-73) 16)))) + ) + (set! sv-176 (the-as gcf-control (-> arg0 base))) + (let* ((v1-84 (-> sv-176 matrix)) + (a3-31 (-> sv-16 perspective)) + (a0-76 (-> a3-31 rvec quad)) + (a1-88 (-> a3-31 uvec quad)) + (a2-58 (-> a3-31 fvec quad)) + (a3-32 (-> a3-31 trans quad)) + ) + (set! (-> v1-84 rvec quad) a0-76) + (set! (-> v1-84 uvec quad) a1-88) + (set! (-> v1-84 fvec quad) a2-58) + (set! (-> v1-84 trans quad) a3-32) + ) + (quad-copy! (the-as pointer (-> sv-176 giftag)) (the-as pointer (-> s1-0 giftag)) 3) + (set! (-> sv-176 giftag num-strips) (the-as uint 1)) + (set! (-> sv-176 num-dps) (the-as uint (* sv-144 2))) + (set! (-> sv-176 kick-offset) (the-as uint 0)) + (when sv-32 + (adgif-shader<-texture-simple! (the-as adgif-shader (-> sv-176 shader)) sv-32) + (adgif-shader-update! (the-as adgif-shader (-> sv-176 shader)) sv-32) + ) + (set! (-> sv-176 shader 0 shader alpha) (new 'static 'gs-miptbp :tbp1 #x48 :tbw2 #x20)) + (set! (-> sv-176 shader 0 shader tex0 tfx) 0) + (set! (-> sv-176 shader 0 pos) (the-as uint 0)) + (set! (-> sv-176 shader 0 num) (the-as uint (+ #x8000 (* sv-144 2)))) + (&+! (-> arg0 base) (* sv-160 16)) + (let* ((v1-104 arg0) + (a0-90 (the-as object (-> v1-104 base))) + ) + (set! (-> (the-as dma-packet a0-90) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc (* 6 sv-144))) + (set! (-> (the-as dma-packet a0-90) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-90) vif1) + (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 vtx-buf) 54) 54) :num (* 6 sv-144)) + ) + (set! (-> v1-104 base) (the-as pointer (&+ (the-as dma-packet a0-90) 16))) + ) + (quad-copy! (-> arg0 base) (the-as pointer (-> sv-20 sv-112)) (* 6 sv-144)) + (&+! (-> arg0 base) (* 96 sv-144)) + (let* ((v1-109 arg0) + (a0-95 (the-as object (-> v1-109 base))) + ) + (set! (-> (the-as dma-packet a0-95) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-95) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-95) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1)) + (set! (-> v1-109 base) (the-as pointer (&+ (the-as dma-packet a0-95) 16))) + ) + (set! (-> arg2 gcf-buf) (- 1704 (the-as int (-> arg2 gcf-buf)))) + (+! (-> arg2 vtx-buf) 279) + (if (< (the-as uint 567) (-> arg2 vtx-buf)) + (set! (-> arg2 vtx-buf) (the-as uint 9)) + ) + (set! sv-96 (- sv-96 sv-128)) + (set! sv-112 (+ sv-112 (* sv-128 2))) + sv-112 + ) + (set! sv-64 (+ sv-64 1)) + ) + #f + ) + ) + ) + ) + +;; definition (debug) for function lightning-start +(defun-debug lightning-start ((arg0 float) (arg1 float)) + (let ((gp-0 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when gp-0 + (let ((t9-1 (method-of-type lightning-tracker activate))) + (t9-1 (the-as lightning-tracker gp-0) *entity-pool* "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-2 run-function-in-process) + (a0-3 gp-0) + (a1-3 lightning-tracker-init) + (a2-2 (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 32768.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 18000.0 + :sound #f + ) + ) + (a3-2 0) + (t0-0 #f) + (t1-0 #f) + (t2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> t2-0 x) arg0) + (set! (-> t2-0 y) 0.0) + (set! (-> t2-0 z) arg1) + (set! (-> t2-0 w) 1.0) + (let ((t3-0 (new 'stack-no-clear 'vector))) + (set! (-> t3-0 x) arg0) + (set! (-> t3-0 y) 262144.0) + (set! (-> t3-0 z) arg1) + (set! (-> t3-0 w) 1.0) + ((the-as (function object object object object object object object object none) t9-2) + a0-3 + a1-3 + a2-2 + a3-2 + t0-0 + t1-0 + t2-0 + t3-0 + ) + ) + ) + (-> gp-0 ppointer) + ) + ) + ) + +;; definition for symbol *lightning-globals*, type lightning-globals +(define *lightning-globals* (new 'global 'lightning-globals)) + +;; definition for symbol *lightning*, type symbol +(define *lightning* #t) + +;; definition for function lightning-draw-all +;; WARN: Return type mismatch int vs none. +(defun lightning-draw-all () + (when (and *lightning* (not (get-menu-mode *blit-displays-work*))) + (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic)) + (let ((s5-0 *lightning-engine*)) + (when (> (length s5-0) 0) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id generic-sprite-3) + ) + (let ((s3-0 *lightning-globals*)) + (let ((v1-17 s3-0)) + (set! (-> v1-17 gcf-buf) (the-as uint 837)) + (set! (-> v1-17 vtx-buf) (the-as uint 9)) + ) + (let* ((v1-19 (-> s5-0 alive-list next0)) + (s2-0 (-> v1-19 next0)) + ) + (while (!= v1-19 (-> s5-0 alive-list-end)) + (let* ((s1-0 (-> (the-as connection v1-19) param1)) + (s0-0 (-> (the-as dma-buffer s1-0) data-buffer 0)) + ) + (when (not (paused?)) + (case s0-0 + ((1 2) + (lightning-update (the-as lightning-control s1-0)) + ) + ((3) + (lightning-fade (the-as lightning-control s1-0)) + ) + ) + ) + (if (or (= s0-0 2) (= s0-0 3)) + (lightning-draw s4-0 (the-as lightning-control s1-0) s3-0) + ) + ) + (set! v1-19 s2-0) + (set! s2-0 (-> s2-0 next0)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function unlink-lightning-spec-by-heap +;; WARN: Return type mismatch int vs none. +(defun unlink-lightning-spec-by-heap ((arg0 kheap)) + (let* ((v1-0 *lightning-spec-id-table*) + (a2-0 (-> v1-0 length)) + (a1-0 (-> arg0 base)) + (a0-1 (-> arg0 top-base)) + ) + (while (nonzero? a2-0) + (+! a2-0 -1) + (let ((a3-2 (-> v1-0 a2-0))) + (when (and (>= (the-as int a3-2) (the-as int a1-0)) (< (the-as int a3-2) (the-as int a0-1))) + (set! (-> v1-0 a2-0) (the-as lightning-spec 0)) + 0 + ) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/mood/mood-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/mood/mood-h_REF.gc index fc37b52184..992a549f1b 100644 --- a/test/decompiler/reference/jak3/engine/gfx/mood/mood-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/mood/mood-h_REF.gc @@ -374,6 +374,7 @@ ((value float) (scale float) ) + :pack-me ) ;; definition for method 3 of type electricity-state diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc index f96e1a3697..d44fb97088 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -54,6 +54,7 @@ (sym symbol :overlay-at initial-valuef) (sound sound-spec :overlay-at initial-valuef) ) + :allow-misaligned ) ;; definition for method 3 of type sp-field-init-spec @@ -366,7 +367,3 @@ particle system itself. This type just holds the launching-related state." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index 84c1287e24..a68c8c5cbb 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -2906,7 +2906,7 @@ ;; definition for function birth-func-texture-group-2d ;; WARN: Return type mismatch int vs none. -(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) +(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) (birth-func-texture-group (the-as int arg0) arg1 arg2) 0 (none) @@ -3215,7 +3215,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/level/level-h_REF.gc b/test/decompiler/reference/jak3/engine/level/level-h_REF.gc index 05daf3a92a..869f2f96ea 100644 --- a/test/decompiler/reference/jak3/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/level-h_REF.gc @@ -453,7 +453,7 @@ (login-begin (_type_) _type_) (debug-print-region-splitbox (_type_ vector object) none) (get-art-group-by-name (_type_ string) art-group) - (level-method-22 () none) + (set-proto-vis! (_type_ symbol) int) (lookup-text (_type_ text-id symbol) string) (level-method-24 () none) (birth (_type_) _type_) diff --git a/test/decompiler/reference/jak3/engine/level/level_REF.gc b/test/decompiler/reference/jak3/engine/level/level_REF.gc index 12e09fdfc3..5c45c10b3a 100644 --- a/test/decompiler/reference/jak3/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/level_REF.gc @@ -930,9 +930,9 @@ "Start loading data of a level." (local-vars (sv-16 level) - (sv-20 (function level-group int symbol)) + (memory-unused? (function level-group int symbol)) (sv-24 int) - (sv-32 int) + (mask int) (sv-40 int) (sv-48 int) (sv-56 int) @@ -942,7 +942,7 @@ ) (set! (-> this borrow-from-level) #f) (set! (-> this memory-mask) (the-as uint 0)) - (let ((s5-0 (the-as int (-> this info memory-mode)))) + (let ((mem-mode (-> this info memory-mode))) (dotimes (v1-4 10) (set! sv-16 (-> *level* level v1-4)) (when (and (or (= (-> sv-16 status) 'active) (= (-> sv-16 status) 'loaded)) (-> sv-16 info borrow)) @@ -951,9 +951,9 @@ (= (car (-> sv-16 info borrow borrow-info a0-16)) (-> this name)) (nonzero? (-> sv-16 info borrow borrow-size a0-16)) ) - (when (!= (the-as level-memory-mode s5-0) (level-memory-mode borrow)) + (when (!= mem-mode (level-memory-mode borrow)) (format 0 "WARNING: level ~A upgraded to borrow~%" (-> this name)) - (set! s5-0 10) + (set! mem-mode (level-memory-mode borrow)) ) (goto cfg-28) ) @@ -961,39 +961,46 @@ ) ) (label cfg-28) - (case s5-0 - ((10 11 12 13 14 15 16) - (level-find-borrow-slot this (the-as level-memory-mode s5-0)) + (case mem-mode + (((level-memory-mode borrow) + (level-memory-mode borrow0) + (level-memory-mode borrow1) + (level-memory-mode borrow2) + (level-memory-mode borrow3) + (level-memory-mode borrow4) + (level-memory-mode borrow-city-small) + ) + (level-find-borrow-slot this mem-mode) ) (else - (set! sv-20 (lambda ((arg0 level-group) (arg1 int)) - (dotimes (v1-0 11) - (if (logtest? (-> arg0 level v1-0 memory-mask) arg1) - (return #f) - ) - ) - #t - ) + (set! memory-unused? (lambda ((arg0 level-group) (arg1 int)) + (dotimes (v1-0 11) + (if (logtest? (-> arg0 level v1-0 memory-mask) arg1) + (return #f) + ) + ) + #t + ) ) (set! sv-24 0) - (set! sv-32 0) + (set! mask 0) (set! sv-40 0) (dotimes (v1-15 10) - (let ((a0-31 (-> *level* level v1-15))) - (when (and (or (= (-> a0-31 status) 'active) (= (-> a0-31 status) 'loaded)) - (or (= (-> a0-31 info memory-mode) (level-memory-mode micro)) - (= (-> a0-31 info memory-mode) (level-memory-mode city-tiny-edge)) + (let ((lev (-> *level* level v1-15))) + (when (and (or (= (-> lev status) 'active) (= (-> lev status) 'loaded)) + (or (= (-> lev info memory-mode) (level-memory-mode micro)) + (= (-> lev info memory-mode) (level-memory-mode city-tiny-edge)) ) ) - (case (-> a0-31 info memory-mode) + (case (-> lev info memory-mode) (((level-memory-mode city-tiny-edge)) - (set! sv-32 (if (or (= (-> a0-31 memory-mask) 60) (= (-> a0-31 memory-mask) #x3c000)) - 3 - #x30000 - ) + (set! mask (if (or (= (-> lev memory-mask) 60) (= (-> lev memory-mask) #x3c000)) + 3 + #x30000 + ) ) (if (zero? sv-40) - (set! sv-40 (if (or (= (-> a0-31 memory-mask) 15) (= (-> a0-31 memory-mask) #x3c000)) + (set! sv-40 (if (or (= (-> lev memory-mask) 15) (= (-> lev memory-mask) #x3c000)) #x3c000 60 ) @@ -1001,33 +1008,37 @@ ) ) (((level-memory-mode micro)) - (set! sv-32 (the-as int (-> a0-31 memory-mask))) + (set! mask (the-as int (-> lev memory-mask))) ) ) ) ) ) - (let ((v1-18 s5-0)) + (let ((v1-18 mem-mode)) (set! sv-48 (cond - ((= v1-18 8) + ((= v1-18 (level-memory-mode large)) #xbd0000 ) - ((= v1-18 7) + ((= v1-18 (level-memory-mode medium)) #x8fb800 ) - ((or (= v1-18 5) (= v1-18 6)) + ((or (= v1-18 (level-memory-mode small-center)) (= v1-18 (level-memory-mode city-center))) #x627000 ) - ((or (= v1-18 19) (= v1-18 3) (= v1-18 2) (= v1-18 1)) + ((or (= v1-18 (level-memory-mode city-tiny-edge)) + (= v1-18 (level-memory-mode tiny-center)) + (= v1-18 (level-memory-mode tiny-edge)) + (= v1-18 (level-memory-mode tiny)) + ) #x3f0000 ) - ((zero? v1-18) + ((= v1-18 (level-memory-mode micro)) #x1f8000 ) - ((= v1-18 18) + ((= v1-18 (level-memory-mode tiny-center-micro)) #x2f4000 ) - ((= v1-18 17) + ((= v1-18 (level-memory-mode tiny-center-small)) #x4ec000 ) (else @@ -1037,469 +1048,467 @@ ) ) (set! sv-56 0) - (let ((v1-20 s5-0)) - (cond - ((= v1-20 8) - (case sv-32 - ((3) - (let ((s4-0 #x3ffc0)) - (when (sv-20 *level* s4-0) - (set! sv-24 48) - (set! sv-56 s4-0) - (goto cfg-322) + (case mem-mode + (((level-memory-mode large)) + (case mask + ((3) + (let ((s4-0 #x3ffc0)) + (when (memory-unused? *level* s4-0) + (set! sv-24 48) + (set! sv-56 s4-0) + (goto cfg-322) + ) + ) + (let ((s4-1 #x3ffc)) + (when (memory-unused? *level* s4-1) + (set! sv-24 16) + (set! sv-56 s4-1) + (goto cfg-322) + ) + ) + ) + ((#x30000) + (let ((s4-2 4095)) + (when (memory-unused? *level* s4-2) + (set! sv-24 0) + (set! sv-56 s4-2) + (goto cfg-322) + ) + ) + (let ((s4-3 #xfff0)) + (when (memory-unused? *level* s4-3) + (set! sv-24 32) + (set! sv-56 s4-3) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-4 4095)) + (when (memory-unused? *level* s4-4) + (set! sv-24 0) + (set! sv-56 s4-4) + (goto cfg-322) + ) + ) + (let ((s4-5 #x3ffc0)) + (when (memory-unused? *level* s4-5) + (set! sv-24 48) + (set! sv-56 s4-5) + (goto cfg-322) + ) + ) + ) + ) + ) + (((level-memory-mode medium)) + (let ((s4-6 511)) + (when (memory-unused? *level* s4-6) + (set! sv-24 0) + (set! sv-56 s4-6) + (goto cfg-322) + ) + ) + (let ((s4-7 #x3fe00)) + (when (memory-unused? *level* s4-7) + (set! sv-24 73) + (set! sv-56 s4-7) + (goto cfg-322) + ) + ) + ) + (((level-memory-mode small-center)) + (case mask + ((3) + (case sv-40 + ((#x3c000) + (let ((s4-8 #x3f00)) + (when (memory-unused? *level* s4-8) + (set! sv-24 64) + (set! sv-56 s4-8) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-9 4032)) + (when (memory-unused? *level* s4-9) + (set! sv-24 48) + (set! sv-56 s4-9) + (goto cfg-322) + ) ) ) - (let ((s4-1 #x3ffc)) - (when (sv-20 *level* s4-1) + ) + ) + ((#x30000) + (case sv-40 + ((#x3c000) + (let ((s4-10 1008)) + (when (memory-unused? *level* s4-10) + (set! sv-24 32) + (set! sv-56 s4-10) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-11 4032)) + (when (memory-unused? *level* s4-11) + (set! sv-24 48) + (set! sv-56 s4-11) + (goto cfg-322) + ) + ) + ) + ) + ) + (else + (let ((s4-12 4032)) + (when (memory-unused? *level* s4-12) + (set! sv-24 48) + (set! sv-56 s4-12) + (goto cfg-322) + ) + ) + ) + ) + ) + (((level-memory-mode city-center)) + (let ((s4-13 4032)) + (when (memory-unused? *level* s4-13) + (set! sv-24 48) + (set! sv-56 s4-13) + (goto cfg-322) + ) + ) + ) + (((level-memory-mode small-edge)) + (case mask + ((3) + (case sv-40 + ((#x3c000) + (let ((s4-14 252)) + (when (memory-unused? *level* s4-14) + (set! sv-24 16) + (set! sv-56 s4-14) + (goto cfg-322) + ) + ) + (let ((s4-15 #x3f00)) + (when (memory-unused? *level* s4-15) + (set! sv-24 64) + (set! sv-56 s4-15) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-16 #x3f000)) + (when (memory-unused? *level* s4-16) + (set! sv-24 98) + (set! sv-56 s4-16) + (goto cfg-322) + ) + ) + (let ((s4-17 4032)) + (when (memory-unused? *level* s4-17) + (set! sv-24 48) + (set! sv-56 s4-17) + (goto cfg-322) + ) + ) + ) + ) + ) + ((#x30000) + (case sv-40 + ((#x3c000) + (let ((s4-18 #xfc00)) + (when (memory-unused? *level* s4-18) + (set! sv-24 82) + (set! sv-56 s4-18) + (goto cfg-322) + ) + ) + (let ((s4-19 1008)) + (when (memory-unused? *level* s4-19) + (set! sv-24 32) + (set! sv-56 s4-19) + (goto cfg-322) + ) + ) + ) + (else + (let ((s4-20 63)) + (when (memory-unused? *level* s4-20) + (set! sv-24 0) + (set! sv-56 s4-20) + (goto cfg-322) + ) + ) + (let ((s4-21 4032)) + (when (memory-unused? *level* s4-21) + (set! sv-24 48) + (set! sv-56 s4-21) + (goto cfg-322) + ) + ) + ) + ) + ) + (else + (let ((s4-22 63)) + (when (memory-unused? *level* s4-22) + (set! sv-24 0) + (set! sv-56 s4-22) + (goto cfg-322) + ) + ) + (let ((s4-23 #x3f000)) + (when (memory-unused? *level* s4-23) + (set! sv-24 98) + (set! sv-56 s4-23) + (goto cfg-322) + ) + ) + ) + ) + ) + (((level-memory-mode micro)) + (let ((s4-24 3)) + (when (memory-unused? *level* s4-24) + (set! sv-24 0) + (set! sv-56 s4-24) + (goto cfg-322) + ) + ) + (let ((s4-25 #x30000)) + (when (memory-unused? *level* s4-25) + (set! sv-24 130) + (set! sv-56 s4-25) + (goto cfg-322) + ) + ) + ) + (((level-memory-mode tiny-edge) (level-memory-mode city-tiny-edge)) + (let ((v1-126 mask)) + (cond + ((or (zero? v1-126) (= v1-126 3)) + (let ((s4-26 60)) + (when (memory-unused? *level* s4-26) (set! sv-24 16) - (set! sv-56 s4-1) + (set! sv-56 s4-26) + (goto cfg-322) + ) + ) + (let ((s4-27 #x3c000)) + (when (memory-unused? *level* s4-27) + (set! sv-24 114) + (set! sv-56 s4-27) (goto cfg-322) ) ) ) - ((#x30000) - (let ((s4-2 4095)) - (when (sv-20 *level* s4-2) + ((= v1-126 #x30000) + (let ((s4-28 #xf000)) + (when (memory-unused? *level* s4-28) + (set! sv-24 98) + (set! sv-56 s4-28) + (goto cfg-322) + ) + ) + (let ((s4-29 15)) + (when (memory-unused? *level* s4-29) (set! sv-24 0) - (set! sv-56 s4-2) + (set! sv-56 s4-29) (goto cfg-322) ) ) - (let ((s4-3 #xfff0)) - (when (sv-20 *level* s4-3) + ) + ) + ) + ) + (((level-memory-mode tiny)) + (let ((v1-143 mask)) + (cond + ((or (zero? v1-143) (= v1-143 3)) + (let ((s4-30 60)) + (when (memory-unused? *level* s4-30) + (set! sv-24 16) + (set! sv-56 s4-30) + (goto cfg-322) + ) + ) + (let ((s4-31 #x3c000)) + (when (memory-unused? *level* s4-31) + (set! sv-24 114) + (set! sv-56 s4-31) + (goto cfg-322) + ) + ) + (let ((s4-32 #x3c00)) + (when (memory-unused? *level* s4-32) + (set! sv-24 82) + (set! sv-56 s4-32) + (goto cfg-322) + ) + ) + (let ((s4-33 960)) + (when (memory-unused? *level* s4-33) + (set! sv-24 48) + (set! sv-56 s4-33) + (goto cfg-322) + ) + ) + ) + ((= v1-143 #x30000) + (let ((s4-34 #xf000)) + (when (memory-unused? *level* s4-34) + (set! sv-24 98) + (set! sv-56 s4-34) + (goto cfg-322) + ) + ) + (let ((s4-35 15)) + (when (memory-unused? *level* s4-35) + (set! sv-24 0) + (set! sv-56 s4-35) + (goto cfg-322) + ) + ) + (let ((s4-36 240)) + (when (memory-unused? *level* s4-36) (set! sv-24 32) - (set! sv-56 s4-3) + (set! sv-56 s4-36) + (goto cfg-322) + ) + ) + (let ((s4-37 3840)) + (when (memory-unused? *level* s4-37) + (set! sv-24 64) + (set! sv-56 s4-37) (goto cfg-322) ) ) ) - (else - (let ((s4-4 4095)) - (when (sv-20 *level* s4-4) - (set! sv-24 0) - (set! sv-56 s4-4) - (goto cfg-322) - ) - ) - (let ((s4-5 #x3ffc0)) - (when (sv-20 *level* s4-5) - (set! sv-24 48) - (set! sv-56 s4-5) - (goto cfg-322) - ) - ) - ) ) ) - ((= v1-20 7) - (let ((s4-6 511)) - (when (sv-20 *level* s4-6) - (set! sv-24 0) - (set! sv-56 s4-6) - (goto cfg-322) - ) - ) - (let ((s4-7 #x3fe00)) - (when (sv-20 *level* s4-7) - (set! sv-24 73) - (set! sv-56 s4-7) - (goto cfg-322) - ) - ) - ) - ((= v1-20 5) - (case sv-32 - ((3) - (case sv-40 - ((#x3c000) - (let ((s4-8 #x3f00)) - (when (sv-20 *level* s4-8) - (set! sv-24 64) - (set! sv-56 s4-8) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-9 4032)) - (when (sv-20 *level* s4-9) - (set! sv-24 48) - (set! sv-56 s4-9) - (goto cfg-322) - ) - ) + ) + (((level-memory-mode tiny-center)) + (let ((v1-176 mask)) + (cond + ((or (zero? v1-176) (= v1-176 3)) + (let ((s4-38 #x3c00)) + (when (memory-unused? *level* s4-38) + (set! sv-24 82) + (set! sv-56 s4-38) + (goto cfg-322) + ) + ) + (let ((s4-39 960)) + (when (memory-unused? *level* s4-39) + (set! sv-24 48) + (set! sv-56 s4-39) + (goto cfg-322) ) ) ) - ((#x30000) - (case sv-40 - ((#x3c000) - (let ((s4-10 1008)) - (when (sv-20 *level* s4-10) - (set! sv-24 32) - (set! sv-56 s4-10) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-11 4032)) - (when (sv-20 *level* s4-11) - (set! sv-24 48) - (set! sv-56 s4-11) - (goto cfg-322) - ) - ) + ((= v1-176 #x30000) + (let ((s4-40 240)) + (when (memory-unused? *level* s4-40) + (set! sv-24 32) + (set! sv-56 s4-40) + (goto cfg-322) + ) + ) + (let ((s4-41 3840)) + (when (memory-unused? *level* s4-41) + (set! sv-24 64) + (set! sv-56 s4-41) + (goto cfg-322) ) ) ) - (else - (let ((s4-12 4032)) - (when (sv-20 *level* s4-12) - (set! sv-24 48) - (set! sv-56 s4-12) - (goto cfg-322) - ) - ) - ) ) ) - ((= v1-20 6) - (let ((s4-13 4032)) - (when (sv-20 *level* s4-13) - (set! sv-24 48) - (set! sv-56 s4-13) - (goto cfg-322) - ) - ) - ) - ((= v1-20 4) - (case sv-32 - ((3) - (case sv-40 - ((#x3c000) - (let ((s4-14 252)) - (when (sv-20 *level* s4-14) - (set! sv-24 16) - (set! sv-56 s4-14) - (goto cfg-322) - ) - ) - (let ((s4-15 #x3f00)) - (when (sv-20 *level* s4-15) - (set! sv-24 64) - (set! sv-56 s4-15) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-16 #x3f000)) - (when (sv-20 *level* s4-16) - (set! sv-24 98) - (set! sv-56 s4-16) - (goto cfg-322) - ) - ) - (let ((s4-17 4032)) - (when (sv-20 *level* s4-17) - (set! sv-24 48) - (set! sv-56 s4-17) - (goto cfg-322) - ) - ) + ) + (((level-memory-mode tiny-center-small)) + (let ((v1-194 mask)) + (cond + ((or (zero? v1-194) (= v1-194 3)) + (let ((s4-42 #x3e00)) + (when (memory-unused? *level* s4-42) + (set! sv-24 72) + (set! sv-56 s4-42) + (goto cfg-322) + ) + ) + (let ((s4-43 1984)) + (when (memory-unused? *level* s4-43) + (set! sv-24 48) + (set! sv-56 s4-43) + (goto cfg-322) ) ) ) - ((#x30000) - (case sv-40 - ((#x3c000) - (let ((s4-18 #xfc00)) - (when (sv-20 *level* s4-18) - (set! sv-24 82) - (set! sv-56 s4-18) - (goto cfg-322) - ) - ) - (let ((s4-19 1008)) - (when (sv-20 *level* s4-19) - (set! sv-24 32) - (set! sv-56 s4-19) - (goto cfg-322) - ) - ) - ) - (else - (let ((s4-20 63)) - (when (sv-20 *level* s4-20) - (set! sv-24 0) - (set! sv-56 s4-20) - (goto cfg-322) - ) - ) - (let ((s4-21 4032)) - (when (sv-20 *level* s4-21) - (set! sv-24 48) - (set! sv-56 s4-21) - (goto cfg-322) - ) - ) + ((= v1-194 #x30000) + (let ((s4-44 496)) + (when (memory-unused? *level* s4-44) + (set! sv-24 32) + (set! sv-56 s4-44) + (goto cfg-322) + ) + ) + (let ((s4-45 3968)) + (when (memory-unused? *level* s4-45) + (set! sv-24 56) + (set! sv-56 s4-45) + (goto cfg-322) ) ) ) - (else - (let ((s4-22 63)) - (when (sv-20 *level* s4-22) - (set! sv-24 0) - (set! sv-56 s4-22) - (goto cfg-322) - ) - ) - (let ((s4-23 #x3f000)) - (when (sv-20 *level* s4-23) - (set! sv-24 98) - (set! sv-56 s4-23) - (goto cfg-322) - ) - ) - ) ) ) - ((zero? v1-20) - (let ((s4-24 3)) - (when (sv-20 *level* s4-24) - (set! sv-24 0) - (set! sv-56 s4-24) - (goto cfg-322) - ) - ) - (let ((s4-25 #x30000)) - (when (sv-20 *level* s4-25) - (set! sv-24 130) - (set! sv-56 s4-25) - (goto cfg-322) - ) + ) + (((level-memory-mode tiny-center-micro)) + (let ((v1-213 mask)) + (cond + ((or (zero? v1-213) (= v1-213 3)) + (let ((s4-46 448)) + (when (memory-unused? *level* s4-46) + (set! sv-24 48) + (set! sv-56 s4-46) + (goto cfg-322) + ) + ) + (let ((s4-47 #x3800)) + (when (memory-unused? *level* s4-47) + (set! sv-24 90) + (set! sv-56 s4-47) + (goto cfg-322) + ) + ) + ) + ((= v1-213 #x30000) + (let ((s4-48 3584)) + (when (memory-unused? *level* s4-48) + (set! sv-24 72) + (set! sv-56 s4-48) + (goto cfg-322) + ) + ) + (let ((s4-49 112)) + (when (memory-unused? *level* s4-49) + (set! sv-24 32) + (set! sv-56 s4-49) + (goto cfg-322) + ) + ) + ) ) ) - ((or (= v1-20 2) (= v1-20 19)) - (let ((v1-126 sv-32)) - (cond - ((or (zero? v1-126) (= v1-126 3)) - (let ((s4-26 60)) - (when (sv-20 *level* s4-26) - (set! sv-24 16) - (set! sv-56 s4-26) - (goto cfg-322) - ) - ) - (let ((s4-27 #x3c000)) - (when (sv-20 *level* s4-27) - (set! sv-24 114) - (set! sv-56 s4-27) - (goto cfg-322) - ) - ) - ) - ((= v1-126 #x30000) - (let ((s4-28 #xf000)) - (when (sv-20 *level* s4-28) - (set! sv-24 98) - (set! sv-56 s4-28) - (goto cfg-322) - ) - ) - (let ((s4-29 15)) - (when (sv-20 *level* s4-29) - (set! sv-24 0) - (set! sv-56 s4-29) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 1) - (let ((v1-143 sv-32)) - (cond - ((or (zero? v1-143) (= v1-143 3)) - (let ((s4-30 60)) - (when (sv-20 *level* s4-30) - (set! sv-24 16) - (set! sv-56 s4-30) - (goto cfg-322) - ) - ) - (let ((s4-31 #x3c000)) - (when (sv-20 *level* s4-31) - (set! sv-24 114) - (set! sv-56 s4-31) - (goto cfg-322) - ) - ) - (let ((s4-32 #x3c00)) - (when (sv-20 *level* s4-32) - (set! sv-24 82) - (set! sv-56 s4-32) - (goto cfg-322) - ) - ) - (let ((s4-33 960)) - (when (sv-20 *level* s4-33) - (set! sv-24 48) - (set! sv-56 s4-33) - (goto cfg-322) - ) - ) - ) - ((= v1-143 #x30000) - (let ((s4-34 #xf000)) - (when (sv-20 *level* s4-34) - (set! sv-24 98) - (set! sv-56 s4-34) - (goto cfg-322) - ) - ) - (let ((s4-35 15)) - (when (sv-20 *level* s4-35) - (set! sv-24 0) - (set! sv-56 s4-35) - (goto cfg-322) - ) - ) - (let ((s4-36 240)) - (when (sv-20 *level* s4-36) - (set! sv-24 32) - (set! sv-56 s4-36) - (goto cfg-322) - ) - ) - (let ((s4-37 3840)) - (when (sv-20 *level* s4-37) - (set! sv-24 64) - (set! sv-56 s4-37) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 3) - (let ((v1-176 sv-32)) - (cond - ((or (zero? v1-176) (= v1-176 3)) - (let ((s4-38 #x3c00)) - (when (sv-20 *level* s4-38) - (set! sv-24 82) - (set! sv-56 s4-38) - (goto cfg-322) - ) - ) - (let ((s4-39 960)) - (when (sv-20 *level* s4-39) - (set! sv-24 48) - (set! sv-56 s4-39) - (goto cfg-322) - ) - ) - ) - ((= v1-176 #x30000) - (let ((s4-40 240)) - (when (sv-20 *level* s4-40) - (set! sv-24 32) - (set! sv-56 s4-40) - (goto cfg-322) - ) - ) - (let ((s4-41 3840)) - (when (sv-20 *level* s4-41) - (set! sv-24 64) - (set! sv-56 s4-41) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 17) - (let ((v1-194 sv-32)) - (cond - ((or (zero? v1-194) (= v1-194 3)) - (let ((s4-42 #x3e00)) - (when (sv-20 *level* s4-42) - (set! sv-24 72) - (set! sv-56 s4-42) - (goto cfg-322) - ) - ) - (let ((s4-43 1984)) - (when (sv-20 *level* s4-43) - (set! sv-24 48) - (set! sv-56 s4-43) - (goto cfg-322) - ) - ) - ) - ((= v1-194 #x30000) - (let ((s4-44 496)) - (when (sv-20 *level* s4-44) - (set! sv-24 32) - (set! sv-56 s4-44) - (goto cfg-322) - ) - ) - (let ((s4-45 3968)) - (when (sv-20 *level* s4-45) - (set! sv-24 56) - (set! sv-56 s4-45) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ((= v1-20 18) - (let ((v1-213 sv-32)) - (cond - ((or (zero? v1-213) (= v1-213 3)) - (let ((s4-46 448)) - (when (sv-20 *level* s4-46) - (set! sv-24 48) - (set! sv-56 s4-46) - (goto cfg-322) - ) - ) - (let ((s4-47 #x3800)) - (when (sv-20 *level* s4-47) - (set! sv-24 90) - (set! sv-56 s4-47) - (goto cfg-322) - ) - ) - ) - ((= v1-213 #x30000) - (let ((s4-48 3584)) - (when (sv-20 *level* s4-48) - (set! sv-24 72) - (set! sv-56 s4-48) - (goto cfg-322) - ) - ) - (let ((s4-49 112)) - (when (sv-20 *level* s4-49) - (set! sv-24 32) - (set! sv-56 s4-49) - (goto cfg-322) - ) - ) - ) - ) - ) - ) - ) + ) ) (label cfg-322) (cond @@ -1508,8 +1517,8 @@ 0 "ERROR: level ~A could not find free ~S bank in the level-group heap (micro ~X tiny ~X)~%" (-> this name) - (level-memory-mode->string (the-as level-memory-mode s5-0)) - sv-32 + (level-memory-mode->string mem-mode) + mask sv-40 ) (dotimes (s5-1 11) @@ -1533,7 +1542,7 @@ ) (else (set! (-> this memory-mask) (the-as uint sv-56)) - (format 0 "lev ~A ~X micro ~X tiny ~X~%" (-> this name) (-> this memory-mask) sv-32 sv-40) + (format 0 "lev ~A ~X micro ~X tiny ~X~%" (-> this name) (-> this memory-mask) mask sv-40) (cond ((= (&- (-> *level* heap top) (the-as uint (-> *level* heap base))) #x1af2800) (let ((v1-245 (-> this heap))) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc index 4eade75679..6443647505 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc @@ -117,53 +117,53 @@ (user-position vector :inline :overlay-at virtual-current-pos-local) ) (:methods - (nav-state-method-9 () none) - (nav-state-method-10 () none) - (nav-state-method-11 () none) - (nav-state-method-12 () none) - (nav-state-method-13 () none) - (nav-state-method-14 () none) - (nav-state-method-15 () none) - (nav-state-method-16 () none) - (nav-state-method-17 () none) - (nav-state-method-18 () none) - (nav-state-method-19 () none) - (nav-state-method-20 () none) + (debug-draw (_type_) none) + (nav-state-method-10 (_type_) none) + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol) + (get-velocity (_type_ vector) vector) + (get-travel (_type_ vector) vector) + (get-heading (_type_ vector) vector) + (get-target-pos (_type_ vector) vector) + (get-speed (_type_) meters) + (get-rotation-rate (_type_) float) + (try-projecting-to-current-poly (_type_ vector vector vector) symbol) + (get-current-poly (_type_) nav-poly) + (copy-nav-state! (_type_ (pointer nav-state)) none) (nav-state-method-21 () none) (nav-state-method-22 () none) (nav-state-method-23 () none) - (nav-state-method-24 () none) - (nav-state-method-25 () none) - (nav-state-method-26 () none) - (nav-state-method-27 () none) - (nav-state-method-28 () none) - (nav-state-method-29 () none) - (nav-state-method-30 () none) - (nav-state-method-31 () none) - (nav-state-method-32 () none) - (nav-state-method-33 () none) + (turn-and-navigate-to-destination (_type_) none) + (navigate-using-route-portals-wrapper (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none) + (navigate-within-poly-wrapper (_type_) none) + (compute-travel-speed (_type_) none) + (nav-state-method-29 (_type_) none) + (nav-state-method-30 (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none) + (update-travel-dir-from-spheres (_type_) none) + (compute-speed-simple (_type_) none) (navigate-v1! (_type_) none) - (nav-state-method-35 () none) - (nav-state-method-36 () none) - (nav-state-method-37 () none) - (nav-state-method-38 () none) - (nav-state-method-39 () none) + (reset-target! (_type_) none) + (add-offset-to-target! (_type_ vector) none) + (navigate-v2! (_type_) none) + (set-current-poly! (_type_ nav-poly) none) + (nav-state-method-39 (_type_) symbol) (do-navigation-to-destination (_type_ vector) none) - (nav-state-method-41 () none) - (nav-state-method-42 () none) - (nav-state-method-43 () none) - (nav-state-method-44 () none) - (nav-state-method-45 () none) - (nav-state-method-46 () none) - (nav-state-method-47 () none) - (nav-state-method-48 () none) + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol) + (set-target-pos! (_type_ vector) none) + (set-virtual-cur-pos! (_type_ vector) none) + (set-travel! (_type_ vector) none) + (set-velocity! (_type_ vector) none) + (set-heading! (_type_ vector) none) + (set-speed! (_type_ meters) none) + (reset! (_type_ nav-control) none) (nav-state-method-49 () none) - (nav-state-method-50 () none) - (nav-state-method-51 () none) - (nav-state-method-52 () none) - (nav-state-method-53 () none) - (nav-state-method-54 () none) - (nav-state-method-55 () none) + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none) + (nav-state-method-51 (_type_) none) + (navigate-using-route-portals (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none) + (navigate-within-poly (_type_) none) + (clamp-travel-vector (_type_) none) ) ) @@ -279,43 +279,43 @@ ) (:methods (debug-draw (_type_) none) - (nav-control-method-10 () none) + (point-in-bsphere? (_type_ vector) symbol) (find-poly-containing-point-1 (_type_ vector) nav-poly) - (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) - (nav-control-method-13 () none) - (nav-control-method-14 () none) - (nav-control-method-15 () none) - (nav-control-method-16 () none) - (nav-control-method-17 () none) - (nav-control-method-18 () none) - (nav-control-method-19 () none) - (nav-control-method-20 () none) - (nav-control-method-21 () none) - (nav-control-method-22 () none) - (nav-control-method-23 () none) - (nav-control-method-24 () none) - (nav-control-method-25 () none) - (nav-control-method-26 () none) - (nav-control-method-27 () none) - (nav-control-method-28 () none) - (nav-control-method-29 () none) - (nav-control-method-30 () none) - (nav-control-method-31 () none) - (nav-control-method-32 () none) - (nav-control-method-33 () none) - (nav-control-method-34 () none) - (nav-control-method-35 () none) - (nav-control-method-36 () none) - (nav-control-method-37 () none) - (nav-control-method-38 () none) - (nav-control-method-39 () none) - (nav-control-method-40 () none) - (nav-control-method-41 () none) - (nav-control-method-42 () none) - (nav-control-method-43 () none) + (closest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) + (find-nearest-poly-to-point (_type_ vector) nav-poly) + (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none) + (find-poly-containing-point-2 (_type_ vector) nav-poly) + (is-above-poly-max-height? (_type_ vector float) symbol) + (is-in-mesh? (_type_ vector float) symbol) + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol) + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) + (set-spheres-from-nav-ids (_type_) none) + (add-root-sphere-to-hash! (_type_ vector int) symbol) + (get-max-rotation-rate (_type_) float) + (get-sphere-mask (_type_) uint) + (get-target-speed (_type_) meters) + (enable-extra-sphere! (_type_) none) + (disable-extra-sphere! (_type_) none) + (copy-extra-nav-sphere! (_type_ sphere) none) + (set-extra-nav-sphere-xyz! (_type_ sphere) none) + (set-extra-nav-sphere-radius! (_type_ float) none) + (set-nearest-y-thres! (_type_ float) none) + (set-nav-cull-radius! (_type_ meters) none) + (set-speed-scale! (_type_ float) none) + (set-target-speed! (_type_ meters) none) + (set-acceleration! (_type_ meters) none) + (set-turning-acceleration! (_type_ meters) none) + (set-max-rotation-rate! (_type_ float) none) + (set-sphere-mask! (_type_ uint) none) + (remove! (_type_) none) + (init! (_type_ collide-shape) none) + (display-marks? (_type_) symbol) (nav-control-method-44 () none) - (nav-control-method-45 () none) - (nav-control-method-46 () none) + (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere) + (find-sphere-ids-from-sphere-hash (_type_ symbol) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-control_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-control_REF.gc new file mode 100644 index 0000000000..ba3d03c8dd --- /dev/null +++ b/test/decompiler/reference/jak3/engine/nav/nav-control_REF.gc @@ -0,0 +1,3978 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *nav-triangle-test-count*, type int +(define *nav-triangle-test-count* 0) + +;; definition for symbol *nav-last-triangle-test-count*, type int +(define *nav-last-triangle-test-count* 0) + +;; definition for function debug-nav-validate-current-poly +(defun debug-nav-validate-current-poly ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector)) + (local-vars (sv-32 vector) (sv-36 float)) + (when (not (point-in-poly? arg0 arg1 arg2)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (project-point-into-poly-2d arg0 arg1 sv-32 arg2) + (set! sv-36 (vector-vector-xz-distance arg2 sv-32)) + #f + ) + ) + +;; definition for function debug-report-nav-stats +;; WARN: Return type mismatch int vs none. +(defun debug-report-nav-stats () + 0 + (none) + ) + +;; definition for method 7 of type nav-control +(defmethod relocate ((this nav-control) (offset int)) + (&+! (-> this process) offset) + (&+! (-> this shape) offset) + this + ) + +;; definition for method 41 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod remove! ((this nav-control)) + (remove-nav-control (-> this state mesh) this) + 0 + (none) + ) + +;; definition for method 28 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod enable-extra-sphere! ((this nav-control)) + (logior! (-> this shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +;; definition for method 29 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod disable-extra-sphere! ((this nav-control)) + (logclear! (-> this shape nav-flags) (nav-flags has-extra-sphere)) + 0 + (none) + ) + +;; definition for method 30 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod copy-extra-nav-sphere! ((this nav-control) (arg0 sphere)) + (mem-copy! (the-as pointer (-> this extra-nav-sphere)) (the-as pointer arg0) 16) + 0 + (none) + ) + +;; definition for method 31 of type nav-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-extra-nav-sphere-xyz! ((this nav-control) (arg0 sphere)) + (let ((f0-0 (-> this extra-nav-sphere w))) + (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) + (set! (-> this extra-nav-sphere w) f0-0) + ) + 0 + (none) + ) + +;; definition for method 32 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-extra-nav-sphere-radius! ((this nav-control) (arg0 float)) + (set! (-> this extra-nav-sphere w) arg0) + 0 + (none) + ) + +;; definition for method 33 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-nearest-y-thres! ((this nav-control) (arg0 float)) + (set! (-> this nearest-y-threshold) arg0) + 0 + (none) + ) + +;; definition for method 34 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-nav-cull-radius! ((this nav-control) (arg0 meters)) + (set! (-> this nav-cull-radius) arg0) + 0 + (none) + ) + +;; definition for method 35 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-speed-scale! ((this nav-control) (arg0 float)) + (set! (-> this speed-scale) arg0) + 0 + (none) + ) + +;; definition for method 36 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-target-speed! ((this nav-control) (arg0 meters)) + (set! (-> this target-speed) arg0) + 0 + (none) + ) + +;; definition for method 27 of type nav-control +(defmethod get-target-speed ((this nav-control)) + (-> this target-speed) + ) + +;; definition for method 37 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-acceleration! ((this nav-control) (arg0 meters)) + (set! (-> this acceleration) arg0) + 0 + (none) + ) + +;; definition for method 38 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-turning-acceleration! ((this nav-control) (arg0 meters)) + (set! (-> this turning-acceleration) arg0) + 0 + (none) + ) + +;; definition for method 39 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-max-rotation-rate! ((this nav-control) (arg0 float)) + (set! (-> this max-rotation-rate) arg0) + 0 + (none) + ) + +;; definition for method 25 of type nav-control +(defmethod get-max-rotation-rate ((this nav-control)) + (-> this max-rotation-rate) + ) + +;; definition for method 40 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-sphere-mask! ((this nav-control) (arg0 uint)) + (set! (-> this sphere-mask) arg0) + 0 + (none) + ) + +;; definition for method 26 of type nav-control +(defmethod get-sphere-mask ((this nav-control)) + (-> this sphere-mask) + ) + +;; definition for method 10 of type nav-control +(defmethod point-in-bsphere? ((this nav-control) (arg0 vector)) + (let ((v1-1 (-> this state mesh bounds))) + (>= (-> v1-1 r) (vector-vector-distance arg0 v1-1)) + ) + ) + +;; definition for method 43 of type nav-control +(defmethod display-marks? ((this nav-control)) + (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flag display-marks))) + ) + +;; definition for method 42 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this nav-control) (arg0 collide-shape)) + (set! (-> this callback-info) #f) + (logior! (-> this flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) + (let ((v1-2 this)) + (set! (-> v1-2 sphere-mask) (the-as uint #x1000f8)) + ) + 0 + (set! (-> this sphere-count) 0) + (set! (-> this sphere-array) (the-as (inline-array sphere) #f)) + (set! (-> this shape) arg0) + (set! (-> this process) (-> arg0 process)) + (set! (-> this speed-scale) 1.0) + (set! (-> this acceleration) 4096.0) + (set! (-> this turning-acceleration) 4096.0) + (set! (-> this max-rotation-rate) 131072.0) + (set! (-> this target-speed) 0.0) + (set! (-> this nav-cull-radius) 40960.0) + (reset! (-> this state) this) + 0 + (none) + ) + +;; definition for function get-nav-control +;; WARN: Return type mismatch object vs none. +;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement. +(defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh)) + (if (not arg1) + (set! arg1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0)) + ) + (when (not arg1) + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status error)) + ) + (go process-drawable-art-error "no nav-mesh") + (return 0) + ) + (add-process-drawable-to-nav-mesh arg1 arg0 #t) + (none) + ) + +;; definition for method 13 of type nav-control +(defmethod find-nearest-poly-to-point ((this nav-control) (arg0 vector)) + (let ((gp-0 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> gp-0 point) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 2)) + (nav-mesh-method-46 (-> this state mesh) (the-as nav-poly gp-0)) + (-> gp-0 poly) + ) + ) + +;; definition for method 14 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod project-point-onto-plane-of-poly ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + (project-point-onto-plane-of-poly-local + (-> this state mesh) + arg0 + arg1 + arg2 + (vector-! (new 'stack-no-clear 'vector) arg3 (the-as vector (-> this state mesh bounds))) + ) + (vector+! arg1 arg1 (the-as vector (-> this state mesh bounds))) + 0 + (none) + ) + +;; definition for method 17 of type nav-control +(defmethod is-in-mesh? ((this nav-control) (arg0 vector) (arg1 float)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (the-as vector (-> this state mesh bounds))) + (let ((a1-1 (-> this state mesh))) + (is-in-mesh-local? a1-1 v1-0 arg1 (-> this nearest-y-threshold)) + ) + ) + ) + +;; definition for method 9 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this nav-control)) + (local-vars (sv-32 nav-mesh) (sv-36 vector)) + (when #t + (debug-draw (-> this state mesh)) + (set! sv-32 (-> this state mesh)) + (set! sv-36 (new 'stack-no-clear 'vector)) + (if (logtest? (-> this shape nav-flags) (nav-flags has-root-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this root-nav-sphere) + (-> this root-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (if (logtest? (-> this shape nav-flags) (nav-flags has-extra-sphere)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this extra-nav-sphere) + (-> this extra-nav-sphere w) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + (when (logtest? (-> this shape nav-flags) (nav-flags has-child-spheres)) + ) + (dotimes (s5-0 (-> this sphere-count)) + (let ((v1-23 (-> this state mesh work debug sphere-array s5-0))) + (vector+! sv-36 (the-as vector (-> sv-32 bounds)) (the-as vector v1-23)) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + sv-36 + (- (-> v1-23 r) (-> this shape nav-radius)) + (new 'static 'rgba :g #xff :b #xff :a #x20) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> sv-32 static-sphere-count))) + (let ((s4-0 (-> sv-32 static-sphere s5-1))) + (add-debug-sphere #t (bucket-id debug) s4-0 (-> s4-0 r) *color-blue*) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 577) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color cyan) (the-as vector2h #f)) + ) + ) + ) + (debug-draw (-> this state)) + ) + 0 + (none) + ) + +;; definition for method 11 of type nav-control +(defmethod find-poly-containing-point-1 ((this nav-control) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> v1-0 vertex)) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> v1-0 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> v1-0 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> this state mesh) v1-0) + ) + ) + +;; definition for method 15 of type nav-control +(defmethod find-poly-containing-point-2 ((this nav-control) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> v1-0 vertex)) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> v1-0 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> v1-0 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> this state mesh) v1-0) + ) + ) + +;; definition for method 16 of type nav-control +;; WARN: Return type mismatch object vs symbol. +(defmethod is-above-poly-max-height? ((this nav-control) (arg0 vector) (arg1 float)) + (let ((a1-1 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> a1-1 vertex)) arg0 (the-as vector (-> this state mesh bounds))) + (set! (-> a1-1 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> a1-1 data 20) (the-as uint 2)) + (the-as + symbol + (and (nav-mesh-method-45 (-> this state mesh) a1-1) (< (-> arg0 y) (+ (-> this state mesh bounds y) arg1))) + ) + ) + ) + +;; definition for method 45 of type nav-control +(defmethod find-first-sphere-intersecting-ray ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s5-0 (the-as sphere #f))) + (let ((f30-0 -0.000001)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) + (f0-1 (ray-circle-intersect arg0 arg1 s0-0 (-> s0-0 r))) + ) + (when (< f30-0 f0-1) + (set! s5-0 s0-0) + (set! f30-0 f0-1) + ) + ) + ) + (set! (-> arg2 x) f30-0) + ) + s5-0 + ) + ) + +;; definition for function add-nav-sphere +;; WARN: Return type mismatch int vs none. +(defun add-nav-sphere ((arg0 nav-control) (arg1 sphere) (arg2 int)) + (local-vars (a2-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (< (-> arg0 sphere-count) arg2) + (let ((v1-3 (-> arg0 sphere-array (-> arg0 sphere-count)))) + (let ((a2-3 arg1) + (a3-0 (-> arg0 root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-3 quad)) + (.lvf vf3 (&-> a3-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-4 vf1) + (let ((f1-0 a2-4) + (f0-1 (+ (-> arg1 r) (-> arg0 shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-1 (-> arg0 nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector v1-3) (the-as vector arg1) (the-as vector (-> arg0 state mesh bounds))) + (set! (-> v1-3 r) f0-1) + (+! (-> arg0 sphere-count) 1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function add-collide-shape-spheres +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 sphere)) + (local-vars (a2-6 float) (t0-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-root-sphere)) + (set! (-> arg2 quad) (-> arg1 trans quad)) + (set! (-> arg2 r) (-> arg1 nav-radius)) + (let ((v1-4 arg0) + (a3-2 16) + ) + (when (< (-> v1-4 sphere-count) a3-2) + (let ((a3-5 (-> v1-4 sphere-array (-> v1-4 sphere-count)))) + (let ((t0-3 arg2) + (t1-0 (-> v1-4 root-nav-sphere)) + ) + (.lvf vf2 (&-> t0-3 quad)) + (.lvf vf3 (&-> t1-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-4 vf1) + (let ((f1-0 t0-4) + (f0-2 (+ (-> arg2 r) (-> v1-4 shape nav-radius))) + ) + (when (and (< 0.0 f1-0) (let ((f2-3 (+ f0-2 (-> v1-4 nav-cull-radius)))) + (< f1-0 (* f2-3 f2-3)) + ) + ) + (vector-! (the-as vector a3-5) (the-as vector arg2) (the-as vector (-> v1-4 state mesh bounds))) + (set! (-> a3-5 r) f0-2) + (+! (-> v1-4 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (when (logtest? (-> arg1 nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-9 arg0) + (a0-1 (-> arg1 process nav extra-nav-sphere)) + (a1-2 16) + ) + (when (< (-> v1-9 sphere-count) a1-2) + (let ((a1-5 (-> v1-9 sphere-array (-> v1-9 sphere-count)))) + (let ((a2-5 a0-1) + (a3-6 (-> v1-9 root-nav-sphere)) + ) + (.lvf vf2 (&-> a2-5 quad)) + (.lvf vf3 (&-> a3-6 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-6 vf1) + (let ((f1-1 a2-6) + (f0-4 (+ (-> a0-1 w) (-> v1-9 shape nav-radius))) + ) + (when (and (< 0.0 f1-1) (let ((f2-9 (+ f0-4 (-> v1-9 nav-cull-radius)))) + (< f1-1 (* f2-9 f2-9)) + ) + ) + (vector-! (the-as vector a1-5) a0-1 (the-as vector (-> v1-9 state mesh bounds))) + (set! (-> a1-5 r) f0-4) + (+! (-> v1-9 sphere-count) 1) + ) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +;; definition for method 46 of type nav-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod find-sphere-ids-from-sphere-hash ((this nav-control) (arg0 symbol)) + (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) + (set! (-> s5-0 bsphere quad) (-> this root-nav-sphere quad)) + (+! (-> s5-0 bsphere r) (-> this nav-cull-radius)) + (set! (-> s5-0 max-len) 16) + (set! (-> s5-0 mask) (-> this sphere-mask)) + (set! (-> s5-0 array) (-> this sphere-id-array)) + (set! (-> s5-0 y-threshold) (-> this nearest-y-threshold)) + (sphere-hash-method-29 (-> this state mesh sphere-hash) s5-0) + (set! (-> this sphere-count) (-> s5-0 len)) + ) + 0 + (none) + ) + +;; definition for method 23 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod set-spheres-from-nav-ids ((this nav-control)) + (let ((v1-2 (-> this state mesh sphere-hash sphere-array)) + (a1-0 (-> this sphere-id-array)) + (a2-1 (-> this state mesh bounds)) + (a3-0 (-> this root-nav-sphere)) + (t0-0 (-> this sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> v1-2 (-> a1-0 t1-0))) + (t2-4 (-> this sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-1)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (none) + ) + +;; definition of type nav-control-cfs-work +(deftype nav-control-cfs-work (structure) + ((in-dir vector :inline) + (right-dir vector :inline) + (best-dir vector 2 :inline) + (temp-dir vector 2 :inline) + (away-dir vector :inline) + (best-dir-angle degrees 2) + (ignore-mask uint64) + (initial-ignore-mask uint64) + (i-sphere int32) + (i-first-sphere int32) + (i-inside-sphere int32) + (inside-sphere-dist float) + (sign float) + (travel-len float) + (dist2 float) + (inside-dist float) + (rand-angle float) + (dir-update basic) + (debug-offset vector :inline) + ) + ) + +;; definition for method 3 of type nav-control-cfs-work +(defmethod inspect ((this nav-control-cfs-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nav-control-cfs-work) + (format #t "~1Tin-dir: #~%" (-> this in-dir)) + (format #t "~1Tright-dir: #~%" (-> this right-dir)) + (format #t "~1Tbest-dir[2] @ #x~X~%" (-> this best-dir)) + (format #t "~1Ttemp-dir[2] @ #x~X~%" (-> this temp-dir)) + (format #t "~1Taway-dir: #~%" (-> this away-dir)) + (format #t "~1Tbest-dir-angle[2] @ #x~X~%" (-> this best-dir-angle)) + (format #t "~1Tignore-mask: ~D~%" (-> this ignore-mask)) + (format #t "~1Tinitial-ignore-mask: ~D~%" (-> this initial-ignore-mask)) + (format #t "~1Ti-sphere: ~D~%" (-> this i-sphere)) + (format #t "~1Ti-first-sphere: ~D~%" (-> this i-first-sphere)) + (format #t "~1Ti-inside-sphere: ~D~%" (-> this i-inside-sphere)) + (format #t "~1Tinside-sphere-dist: ~f~%" (-> this inside-sphere-dist)) + (format #t "~1Tsign: ~f~%" (-> this sign)) + (format #t "~1Ttravel-len: ~f~%" (-> this travel-len)) + (format #t "~1Tdist2: ~f~%" (-> this dist2)) + (format #t "~1Tinside-dist: ~f~%" (-> this inside-dist)) + (format #t "~1Trand-angle: ~f~%" (-> this rand-angle)) + (format #t "~1Tdir-update: ~A~%" (-> this dir-update)) + (format #t "~1Tdebug-offset: #~%" (-> this debug-offset)) + (label cfg-4) + this + ) + +;; definition for function circle-tangent-directions +;; INFO: Used lq/sq +(defun circle-tangent-directions ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((t1-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (vector-! t1-0 arg1 arg0) + (set! (-> t1-0 y) 0.0) + (let ((a0-1 t0-0)) + (let ((t3-2 t1-0)) + (set! (-> a0-1 quad) (-> t3-2 quad)) + ) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t2-3 f0-1)) + (.mov vf3 t2-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-1 quad) vf1) + ) + (set! (-> v1-0 quad) (-> t0-0 quad)) + (set! (-> v1-0 x) (-> t0-0 z)) + (set! (-> v1-0 z) (- (-> t0-0 x))) + (let* ((f0-5 (-> arg1 w)) + (f1-1 (vector-dot t0-0 t1-0)) + (f0-6 (fmin f0-5 f1-1)) + (f2-0 f1-1) + (f2-2 (* f2-0 f2-0)) + (f3-0 f0-6) + (f2-4 (sqrtf (- f2-2 (* f3-0 f3-0)))) + (f3-4 (/ 1.0 f1-1)) + (f1-3 (* f2-4 f3-4)) + (f0-7 (* f0-6 f3-4)) + (a0-9 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-9 t0-0 f1-3) + (let ((t0-1 arg2)) + (let ((a1-3 a0-9)) + (let ((a2-1 v1-0)) + (let ((t1-1 f0-7)) + (.mov vf7 t1-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> a1-3 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 (&-> t0-1 quad) vf6) + ) + (let ((v0-0 arg3)) + (let ((a1-4 (- f0-7))) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> v1-0 quad)) + (.lvf vf4 (&-> a0-9 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 (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + ) + +;; definition for function circle-ray-intersection? +(defun circle-ray-intersection? ((arg0 vector) (arg1 vector) (arg2 float) (arg3 vector)) + (let ((f1-1 (- (-> arg3 x) (-> arg0 x))) + (f0-2 (- (-> arg3 z) (-> arg0 z))) + ) + (when (< (fabs (- (* (-> arg1 z) f1-1) (* (-> arg1 x) f0-2))) (-> arg3 w)) + (let ((f2-7 (+ (* (-> arg1 x) f1-1) (* (-> arg1 z) f0-2)))) + (cond + ((< f2-7 0.0) + (let ((f0-5 (+ (* f1-1 f1-1) (* f0-2 f0-2))) + (f1-4 (-> arg3 w)) + ) + (< f0-5 (* f1-4 f1-4)) + ) + ) + ((< arg2 f2-7) + (let* ((f0-8 (- (-> arg3 x) (+ (-> arg0 x) (* (-> arg1 x) arg2)))) + (f1-10 (- (-> arg3 z) (+ (-> arg0 z) (* (-> arg1 z) arg2)))) + (f0-11 (+ (* f0-8 f0-8) (* f1-10 f1-10))) + (f1-13 (-> arg3 w)) + ) + (< f0-11 (* f1-13 f1-13)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + ) + +;; definition for function find-closest-circle-ray-intersection +(defun find-closest-circle-ray-intersection ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int) (arg4 (inline-array vector)) (arg5 int)) + 1.0 + (let ((v0-0 -1)) + (vector-float*! (new 'stack-no-clear 'vector) arg1 arg2) + (let ((v1-3 0)) + (b! #t cfg-18 :delay (nop!)) + (label cfg-1) + (b! (logtest? arg5 (ash 1 v1-3)) cfg-17 :delay (empty-form)) + (let* ((t4-0 arg0) + (t3-1 arg1) + (f0-2 arg2) + (t2-6 (-> arg4 v1-3)) + (f2-1 (- (-> t2-6 x) (-> t4-0 x))) + (f1-2 (- (-> t2-6 z) (-> t4-0 z))) + ) + (b! + (not (when (< (fabs (- (* (-> t3-1 z) f2-1) (* (-> t3-1 x) f1-2))) (-> t2-6 w)) + (let ((f3-7 (+ (* (-> t3-1 x) f2-1) (* (-> t3-1 z) f1-2)))) + (cond + ((< f3-7 0.0) + (let ((f0-5 (+ (* f2-1 f2-1) (* f1-2 f1-2))) + (f1-5 (-> t2-6 w)) + ) + (< f0-5 (* f1-5 f1-5)) + ) + ) + ((< f0-2 f3-7) + (let* ((f1-9 (- (-> t2-6 x) (+ (-> t4-0 x) (* (-> t3-1 x) f0-2)))) + (f2-5 (- (-> t2-6 z) (+ (-> t4-0 z) (* (-> t3-1 z) f0-2)))) + (f0-10 (+ (* f1-9 f1-9) (* f2-5 f2-5))) + (f1-12 (-> t2-6 w)) + ) + (< f0-10 (* f1-12 f1-12)) + ) + ) + (else + #t + ) + ) + ) + ) + ) + cfg-17 + :delay (empty-form) + ) + ) + (set! v0-0 v1-3) + (b! #t cfg-20 :delay (nop!)) + (label cfg-17) + (+! v1-3 1) + (label cfg-18) + (b! (< v1-3 arg3) cfg-1) + ) + (label cfg-20) + v0-0 + ) + ) + +;; definition for function compute-dir-parm +(defun compute-dir-parm ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((a2-1 (the-as number (vector-dot arg0 arg2))) + (a3-1 #xffffffff80000000) + (v1-2 #x3f800000) + ) + (* (the-as float (logior (logand (the-as uint a2-1) a3-1) v1-2)) (- 1.0 (vector-dot arg0 arg1))) + ) + ) + +;; definition for method 18 of type nav-control +;; INFO: Used lq/sq +(defmethod avoid-spheres-1! ((this nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (set! (-> s5-0 i-inside-sphere) -1) + (set! (-> s5-0 inside-sphere-dist) 0.0) + (let ((f0-10 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-10 f0-10)) + ) + (dotimes (v1-10 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-10))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-14 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-14 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-10)) + ) + (set! (-> s5-0 inside-dist) (- (-> a0-13 r) (sqrtf (-> s5-0 dist2)))) + (when (< (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + (set! (-> s5-0 i-inside-sphere) v1-10) + (set! (-> s5-0 inside-sphere-dist) (-> s5-0 inside-dist)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> this sphere-count) + (-> this sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-13 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-13) cfg-13 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-43 :delay (nop!)) + (label cfg-13) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-17 (-> this sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-17 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-20 2) + (let ((a0-28 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-20)))) + (shift-arith-right-32 a0-29 a0-28 31) + ) + (let ((a0-30 (logand a0-29 1)) + (f0-27 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-20)))) + ) + (set! (-> s5-0 best-dir a0-30 quad) (-> s5-0 temp-dir v1-20 quad)) + (set! (-> s5-0 best-dir-angle a0-30) f0-27) + ) + ) + 0 + (set! (-> s5-0 sign) 1.0) + (let ((s3-0 0)) + (b! #t cfg-34 :delay (nop!)) + (label cfg-20) + (-> s5-0 i-first-sphere) + (set! (-> s5-0 dir-update) (the-as basic #t)) + (set! (-> s5-0 ignore-mask) (-> s5-0 initial-ignore-mask)) + (b! #t cfg-30 :delay (nop!)) + (label cfg-21) + (+! (-> s5-0 ignore-mask) (ash 1 v1-28)) + (circle-tangent-directions + (-> arg0 current-pos) + (-> this sphere-array v1-28) + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + (set! (-> s5-0 dir-update) #f) + (dotimes (v1-30 2) + (let* ((f0-29 (-> s5-0 sign)) + (a1-31 (-> s5-0 temp-dir v1-30)) + (a0-39 (-> s5-0 in-dir)) + (a2-14 (-> s5-0 right-dir)) + (a3-7 (the-as number (vector-dot a1-31 a2-14))) + (t0-1 #xffffffff80000000) + (a2-16 #x3f800000) + (f0-30 (* f0-29 (* (the-as float (logior (logand (the-as uint a3-7) (the-as uint t0-1)) a2-16)) + (- 1.0 (vector-dot a1-31 a0-39)) + ) + ) + ) + ) + (when (< (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 best-dir s3-0 quad) (-> s5-0 temp-dir v1-30 quad)) + (set! (-> s5-0 best-dir-angle s3-0) f0-30) + (set! (-> s5-0 dir-update) (the-as basic #t)) + ) + ) + ) + (label cfg-30) + (when (-> s5-0 dir-update) + (set! v1-28 (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 best-dir s3-0) + (-> s5-0 travel-len) + (-> this sphere-count) + (-> this sphere-array) + (the-as int (-> s5-0 ignore-mask)) + ) + ) + (b! (!= v1-28 -1) cfg-21 :delay (nop!)) + ) + (set! (-> s5-0 sign) (* -1.0 (-> s5-0 sign))) + (+! s3-0 1) + (label cfg-34) + (b! (< s3-0 2) cfg-20) + ) + (when (!= (-> s5-0 i-inside-sphere) -1) + (let ((s4-1 (-> this sphere-array (-> s5-0 i-inside-sphere)))) + (vector-! (-> s5-0 away-dir) (-> arg0 current-pos) (the-as vector s4-1)) + (set! (-> s5-0 away-dir y) 0.0) + (when (>= 40.96 (vector-length (-> s5-0 away-dir))) + (set! (-> s5-0 rand-angle) (* 65536.0 (rand-vu))) + (set! (-> s5-0 away-dir x) (cos (-> s5-0 rand-angle))) + (set! (-> s5-0 away-dir z) (sin (-> s5-0 rand-angle))) + ) + (let ((v1-51 (-> s5-0 away-dir))) + (let ((f0-42 1.0)) + (.lvf vf1 (&-> v1-51 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-60 f0-42)) + (.mov vf3 a0-60) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-51 quad) vf1) + ) + (let ((f0-44 (/ (-> s5-0 inside-sphere-dist) (-> s4-1 r)))) + (let ((v1-52 (-> s5-0 best-dir))) + (let ((a0-61 (-> s5-0 best-dir)) + (a1-39 (-> s5-0 away-dir)) + (f1-19 f0-44) + ) + (.lvf vf1 (&-> a0-61 0 quad)) + (.lvf vf2 (&-> a1-39 quad)) + (let ((a0-62 f1-19)) + (.mov vf4 a0-62) + ) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-52 0 quad) vf3) + ) + (let ((v1-53 (-> s5-0 best-dir 1))) + (let ((a0-63 (-> s5-0 best-dir 1)) + (a1-40 (-> s5-0 away-dir)) + ) + (.lvf vf1 (&-> a0-63 quad)) + (.lvf vf2 (&-> a1-40 quad)) + ) + (let ((a0-64 f0-44)) + (.mov vf4 a0-64) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-53 quad) vf3) + ) + ) + ) + (let ((v1-54 (-> s5-0 best-dir))) + (let ((f0-45 1.0)) + (.lvf vf1 (&-> v1-54 0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-66 f0-45)) + (.mov vf3 a0-66) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-54 0 quad) vf1) + ) + (let ((v1-55 (-> s5-0 best-dir 1))) + (let ((f0-46 1.0)) + (.lvf vf1 (&-> v1-55 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-68 f0-46)) + (.mov vf3 a0-68) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-55 quad) vf1) + ) + ) + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-52 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-41 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-52) + 0 + 1 + ) + ) + (v1-65 (- 1 a1-41)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-41) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-65) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-43) + (-> arg0 avoiding-sphere?) + ) + ) + +;; definition for method 19 of type nav-control +;; INFO: Used lq/sq +(defmethod avoid-spheres-2! ((this nav-control) (arg0 nav-avoid-spheres-params)) + (local-vars (a0-32 int) (a1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (set! (-> s5-0 in-dir y) 0.0) + (let ((v1-1 (-> s5-0 in-dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-1)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) + (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) + (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) + (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (set! (-> s5-0 best-dir-angle 0) 0.0) + (set! (-> s5-0 best-dir-angle 1) 0.0) + (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) + (let ((f0-9 65536.0)) + (set! (-> arg0 closest-sphere-dist2) (* f0-9 f0-9)) + ) + (dotimes (v1-9 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-9))) + (let ((a1-2 (-> arg0 current-pos)) + (a2-0 a0-13) + ) + (.lvf vf2 (&-> a1-2 quad)) + (.lvf vf3 (&-> a2-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a1-3 vf1) + (set! (-> s5-0 dist2) a1-3) + (let ((f0-13 (-> arg0 closest-sphere-dist2)) + (f1-0 (-> s5-0 dist2)) + (f2-0 (-> a0-13 r)) + ) + (set! (-> arg0 closest-sphere-dist2) (fmin f0-13 (- f1-0 (* f2-0 f2-0)))) + ) + (when (< (-> arg0 closest-sphere-dist2) 0.0) + (vector-! (the-as vector (-> s5-0 temp-dir)) (-> arg0 current-pos) (the-as vector a0-13)) + (set! (-> s5-0 temp-dir 0 y) 0.0) + (if (< 0.0 (vector-dot (the-as vector (-> s5-0 temp-dir)) (-> s5-0 in-dir))) + (+! (-> s5-0 initial-ignore-mask) (ash 1 v1-9)) + ) + ) + ) + ) + (set! (-> s5-0 i-first-sphere) (find-closest-circle-ray-intersection + (-> arg0 current-pos) + (-> s5-0 in-dir) + (-> s5-0 travel-len) + (-> this sphere-count) + (-> this sphere-array) + (the-as int (-> s5-0 initial-ignore-mask)) + ) + ) + (let ((v1-12 -1)) + (b! (!= (-> s5-0 i-first-sphere) v1-12) cfg-11 :delay (empty-form)) + ) + (set! (-> arg0 out-travel 0 quad) (-> arg0 travel quad)) + (set! (-> arg0 out-travel 1 quad) (the-as uint128 0)) + (set! (-> arg0 avoiding-sphere?) #f) + (b! #t cfg-21 :delay (nop!)) + (label cfg-11) + (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) + (let ((a1-15 (-> this sphere-array (-> s5-0 i-first-sphere)))) + (circle-tangent-directions + (-> arg0 current-pos) + a1-15 + (the-as vector (-> s5-0 temp-dir)) + (-> s5-0 temp-dir 1) + ) + ) + (dotimes (v1-19 2) + (let ((a0-31 (vector-dot (-> s5-0 right-dir) (-> s5-0 temp-dir v1-19)))) + (shift-arith-right-32 a0-32 a0-31 31) + ) + (let ((a0-33 (logand a0-32 1)) + (f0-22 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-19)))) + ) + (set! (-> s5-0 best-dir a0-33 quad) (-> s5-0 temp-dir v1-19 quad)) + (set! (-> s5-0 best-dir-angle a0-33) f0-22) + ) + ) + 0 + (vector-dot (-> s5-0 in-dir) (the-as vector (-> s5-0 best-dir))) + (vector-dot (-> s5-0 in-dir) (-> s5-0 best-dir 1)) + (let* ((f0-28 (vector-dot (-> arg0 pref-dir) (the-as vector (-> s5-0 best-dir)))) + (a1-25 (if (< (vector-dot (-> arg0 pref-dir) (-> s5-0 best-dir 1)) f0-28) + 0 + 1 + ) + ) + (v1-32 (- 1 a1-25)) + ) + (vector-float*! (the-as vector (-> arg0 out-travel)) (-> s5-0 best-dir a1-25) (-> s5-0 travel-len)) + (vector-float*! (-> arg0 out-travel 1) (-> s5-0 best-dir v1-32) (-> s5-0 travel-len)) + ) + ) + 0 + (set! (-> arg0 avoiding-sphere?) #t) + (label cfg-21) + (-> arg0 avoiding-sphere?) + ) + ) + +;; definition for method 21 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 clamp-travel-vector-to-mesh-return-info) + ) + (clamp-vector-to-mesh-no-gaps (-> this state mesh) arg0 arg1 arg2 arg3) + 0 + (none) + ) + +;; definition for method 21 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) + (local-vars + (v1-12 symbol) + (sv-112 nav-ray) + (sv-116 vector) + (sv-120 symbol) + (sv-124 nav-mesh-work) + (sv-128 int) + (sv-136 int) + (sv-144 nav-mesh-work) + (sv-148 nav-poly) + (sv-152 uint) + (sv-156 (pointer int8)) + (sv-160 (pointer int8)) + (sv-164 float) + (sv-168 float) + (sv-172 vector) + (sv-176 vector) + (sv-180 float) + (sv-184 float) + (sv-188 uint) + (sv-192 vector) + (sv-196 vector) + (sv-200 float) + (sv-204 float) + (sv-208 float) + (sv-212 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg3 found-boundary) #f) + (set! (-> arg3 gap-poly) #f) + (set! sv-112 (new 'stack-no-clear 'nav-ray)) + (set! sv-116 (new 'stack-no-clear 'vector)) + (set! sv-120 (the-as symbol #f)) + (set! sv-124 (-> this work)) + (vector-! sv-116 arg0 (the-as vector (-> this bounds))) + (set! (-> sv-112 current-poly) arg1) + (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) + (vector+! (-> sv-112 dest-pos) sv-116 arg2) + (let* ((t2-0 this) + (v1-11 (-> sv-112 dest-pos)) + (a1-4 (-> arg1 vertex-count)) + (a2-1 (-> arg1 vertex)) + (t1-4 (-> t2-0 work vert0-table)) + (t2-2 (-> t2-0 work vert1-table)) + ) + (dotimes (t3-0 (the-as int a1-4)) + (let* ((t4-3 (-> a2-1 (-> t1-4 t3-0))) + (t5-3 (-> a2-1 (-> t2-2 t3-0))) + (f0-1 (- (-> t4-3 z) (-> t5-3 z))) + (f1-2 (- (-> t5-3 x) (-> t4-3 x))) + (f2-2 (- (-> v1-11 x) (-> t4-3 x))) + (f3-2 (- (-> v1-11 z) (-> t4-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-12 #f) + (goto cfg-7) + ) + ) + ) + ) + (set! v1-12 #t) + (label cfg-7) + (b! v1-12 cfg-41 :delay (nop!)) + (set! sv-128 0) + (let ((v1-16 sv-112)) + (vector-! (-> v1-16 dir) (-> v1-16 dest-pos) (-> v1-16 current-pos)) + (set! (-> v1-16 dir y) 0.0) + (let ((a1-6 (-> v1-16 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> a1-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a2-4 f0-5)) + (.mov vf3 a2-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-6 quad) vf1) + ) + (set! (-> v1-16 next-poly) #f) + (set! (-> v1-16 len) 0.0) + (set! (-> v1-16 last-edge) -1) + (set! (-> v1-16 terminated) #f) + (set! (-> v1-16 reached-dest) #f) + (set! (-> v1-16 hit-boundary) #f) + (set! (-> v1-16 hit-gap) #f) + (set! (-> v1-16 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= sv-128 15) (-> sv-112 terminated)) + (set! sv-128 (+ sv-128 1)) + (let ((a1-9 this) + (v1-20 sv-112) + ) + (set! sv-136 -1) + (set! sv-144 (-> a1-9 work)) + (set! sv-148 (-> v1-20 current-poly)) + (set! sv-152 (-> v1-20 current-poly vertex-count)) + (set! sv-156 (-> a1-9 work vert0-table)) + (set! sv-160 (-> a1-9 work vert1-table)) + (set! sv-164 (- (-> v1-20 dest-pos x) (-> v1-20 current-pos x))) + (set! sv-168 (- (-> v1-20 dest-pos z) (-> v1-20 current-pos z))) + (dotimes (a2-14 (the-as int sv-152)) + (set! sv-172 (-> sv-148 vertex (-> sv-156 a2-14))) + (set! sv-176 (-> sv-148 vertex (-> sv-160 a2-14))) + (set! sv-180 (- (-> sv-172 z) (-> sv-176 z))) + (set! sv-184 (- (-> sv-176 x) (-> sv-172 x))) + (let ((f0-17 (+ (* sv-164 sv-180) (* sv-168 sv-184)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-180 (- (-> sv-172 x) (-> v1-20 current-pos x))) + (* sv-184 (- (-> sv-172 z) (-> v1-20 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-136 a2-14) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-164 (* sv-164 f0-19)) + (set! sv-168 (* sv-168 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-164 (-> v1-20 dir x)) (* sv-168 (-> v1-20 dir z))))) + (+! (-> v1-20 len) f0-23) + ) + 0 + (set! (-> v1-20 next-poly) #f) + (cond + ((= sv-136 -1) + (set! (-> v1-20 current-pos quad) (-> v1-20 dest-pos quad)) + (set! (-> v1-20 reached-dest) #t) + (set! (-> v1-20 terminated) #t) + ) + (else + (+! (-> v1-20 current-pos x) sv-164) + (+! (-> v1-20 current-pos z) sv-168) + (set! sv-188 (-> sv-148 adj-poly sv-136)) + (if (!= sv-188 255) + (set! (-> v1-20 next-poly) (-> a1-9 poly-array sv-188)) + ) + (cond + ((and (-> v1-20 next-poly) (not (logtest? (-> v1-20 next-poly pat) (-> v1-20 ignore)))) + (set! (-> v1-20 current-poly) (-> v1-20 next-poly)) + ) + (else + (set! (-> v1-20 last-edge) sv-136) + (if (-> v1-20 next-poly) + (set! (-> v1-20 hit-gap) #t) + (set! (-> v1-20 hit-boundary) #t) + ) + (set! (-> v1-20 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + (cond + ((or (-> sv-112 hit-boundary) (-> sv-112 hit-gap)) + (set! sv-192 (-> sv-112 current-poly vertex (-> sv-124 vert0-table (-> sv-112 last-edge)))) + (set! sv-196 (-> sv-112 current-poly vertex (-> sv-124 vert1-table (-> sv-112 last-edge)))) + (set! sv-200 (- (-> sv-192 z) (-> sv-196 z))) + (set! sv-204 (- (-> sv-196 x) (-> sv-192 x))) + (set! sv-208 (-> arg2 x)) + (set! sv-212 (-> arg2 z)) + (let* ((f0-35 sv-200) + (f0-37 (* f0-35 f0-35)) + (f1-27 sv-204) + (f0-39 (sqrtf (+ f0-37 (* f1-27 f1-27)))) + (f0-41 (/ 1.0 f0-39)) + ) + (set! sv-200 (* sv-200 f0-41)) + (set! sv-204 (* sv-204 f0-41)) + ) + (set! (-> arg3 found-boundary) #t) + (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (the-as vector (-> this bounds))) + (set! (-> arg3 boundary-normal x) sv-200) + (set! (-> arg3 boundary-normal y) 0.0) + (set! (-> arg3 boundary-normal z) sv-204) + (set! (-> arg3 poly) (-> sv-112 current-poly)) + (set! (-> arg3 edge) (-> sv-112 last-edge)) + (vector+! (-> arg3 vert-0) sv-192 (the-as vector (-> this bounds))) + (vector+! (-> arg3 vert-1) sv-196 (the-as vector (-> this bounds))) + (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) + (if (-> sv-112 hit-gap) + (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) + ) + ) + (else + ) + ) + (vector-! arg2 (-> sv-112 current-pos) sv-116) + 0 + (label cfg-41) + 0 + (none) + ) + ) + +;; definition for method 23 of type nav-mesh +;; WARN: Return type mismatch object vs none. +;; WARN: Function (method 23 nav-mesh) has a return type of none, but the expression builder found a return statement. +(defmethod find-adjacent-bounds-one ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) + (local-vars (sv-16 nav-poly)) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) + ) + (set! sv-16 arg1) + (let ((s2-0 (-> sv-16 vertex arg2)) + (s3-0 sv-16) + (s1-0 100) + ) + (while (begin (label cfg-21) (nonzero? s1-0)) + (+! s1-0 -1) + (if (nonzero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 arg3 (-> s3-0 vertex-count))) (-> s3-0 vertex-count)))) + ) + (let ((v1-12 (-> s3-0 adj-poly arg2))) + (cond + ((= v1-12 255) + (if (zero? arg3) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> s3-0 vertex-count)))) + ) + (vector+! arg0 (-> s3-0 vertex arg2) (the-as vector (-> this bounds))) + (return #f) + ) + (else + (set! s3-0 (-> this poly-array v1-12)) + (when (= s3-0 sv-16) + (format 0 "ERROR: find-adjacent-bounds-one cur-poly = start-poly after step~%") + (return #f) + ) + (dotimes (s0-0 (the-as int (-> s3-0 vertex-count))) + (when (vector= (-> s3-0 vertex s0-0) s2-0) + (set! arg2 s0-0) + (goto cfg-21) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one couldn't match vertex~%") + (return #f) + ) + ) + ) + ) + ) + (format 0 "ERROR: find-adjacent-bounds-one took too many steps~%") + (none) + ) + +;; definition for method 22 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod set-normals-from-adjacent-bounds ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) + (find-adjacent-bounds-one this (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) + (find-adjacent-bounds-one this (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) + (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) + (vector-! (-> arg0 next-normal) (-> arg0 vert-next) (-> arg0 vert-1)) + (vector-normalize! (-> arg0 prev-normal) 1.0) + (vector-normalize! (-> arg0 next-normal) 1.0) + (let ((f0-0 (-> arg0 prev-normal x))) + (set! (-> arg0 prev-normal x) (-> arg0 prev-normal z)) + (set! (-> arg0 prev-normal z) f0-0) + ) + (let ((f0-1 (-> arg0 next-normal x))) + (set! (-> arg0 next-normal x) (-> arg0 next-normal z)) + (set! (-> arg0 next-normal z) f0-1) + ) + (set! (-> arg0 prev-normal x) (- (-> arg0 prev-normal x))) + (set! (-> arg0 next-normal x) (- (-> arg0 next-normal x))) + 0 + (none) + ) + +;; definition for method 20 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (local-vars + (v1-11 symbol) + (v1-22 symbol) + (sv-96 nav-ray) + (sv-100 symbol) + (sv-104 int) + (sv-112 nav-mesh-work) + (sv-120 int) + (sv-128 int) + (sv-136 nav-mesh-work) + (sv-140 nav-poly) + (sv-144 uint) + (sv-148 (pointer int8)) + (sv-152 (pointer int8)) + (sv-156 float) + (sv-160 float) + (sv-164 vector) + (sv-168 vector) + (sv-172 float) + (sv-176 float) + (sv-180 uint) + (sv-184 vector) + (sv-188 vector) + (sv-192 float) + (sv-196 float) + (sv-200 float) + (sv-204 float) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when arg5 + (set! (-> arg5 found-boundary) #f) + (set! (-> arg5 gap-poly) #f) + ) + (set! sv-96 (new 'stack-no-clear 'nav-ray)) + (set! sv-100 (the-as symbol #f)) + (set! sv-104 0) + (set! sv-112 (-> this work)) + (set! (-> sv-96 current-poly) arg1) + (set! (-> sv-96 current-pos quad) (-> arg0 quad)) + (vector+! (-> sv-96 dest-pos) arg0 arg2) + (let* ((t6-0 this) + (t4-2 arg1) + (v1-10 (-> sv-96 dest-pos)) + (t3-3 (-> t4-2 vertex-count)) + (t4-3 (-> t4-2 vertex)) + (t5-1 (-> t6-0 work vert0-table)) + (t6-2 (-> t6-0 work vert1-table)) + ) + (dotimes (t7-0 (the-as int t3-3)) + (let* ((t8-3 (-> t4-3 (-> t5-1 t7-0))) + (t9-3 (-> t4-3 (-> t6-2 t7-0))) + (f0-1 (- (-> t8-3 z) (-> t9-3 z))) + (f1-2 (- (-> t9-3 x) (-> t8-3 x))) + (f2-2 (- (-> v1-10 x) (-> t8-3 x))) + (f3-2 (- (-> v1-10 z) (-> t8-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (when (< 0.0 f0-3) + (set! v1-11 #f) + (goto cfg-9) + ) + ) + ) + ) + (set! v1-11 #t) + (label cfg-9) + (b! v1-11 cfg-62 :delay (nop!)) + (until sv-100 + (set! sv-120 0) + (let ((v1-15 sv-96)) + (vector-! (-> v1-15 dir) (-> v1-15 dest-pos) (-> v1-15 current-pos)) + (set! (-> v1-15 dir y) 0.0) + (let ((t3-5 (-> v1-15 dir))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> t3-5 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t4-6 f0-5)) + (.mov vf3 t4-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t3-5 quad) vf1) + ) + (set! (-> v1-15 next-poly) #f) + (set! (-> v1-15 len) 0.0) + (set! (-> v1-15 last-edge) -1) + (set! (-> v1-15 terminated) #f) + (set! (-> v1-15 reached-dest) #f) + (set! (-> v1-15 hit-boundary) #f) + (set! (-> v1-15 hit-gap) #f) + (set! (-> v1-15 ignore) (the-as uint 3)) + ) + 0 + (until v1-22 + (set! sv-120 (+ sv-120 1)) + (let ((t3-8 this) + (v1-19 sv-96) + ) + (set! sv-128 -1) + (set! sv-136 (-> t3-8 work)) + (set! sv-140 (-> v1-19 current-poly)) + (set! sv-144 (-> v1-19 current-poly vertex-count)) + (set! sv-148 (-> t3-8 work vert0-table)) + (set! sv-152 (-> t3-8 work vert1-table)) + (set! sv-156 (- (-> v1-19 dest-pos x) (-> v1-19 current-pos x))) + (set! sv-160 (- (-> v1-19 dest-pos z) (-> v1-19 current-pos z))) + (dotimes (t4-16 (the-as int sv-144)) + (set! sv-164 (-> sv-140 vertex (-> sv-148 t4-16))) + (set! sv-168 (-> sv-140 vertex (-> sv-152 t4-16))) + (set! sv-172 (- (-> sv-164 z) (-> sv-168 z))) + (set! sv-176 (- (-> sv-168 x) (-> sv-164 x))) + (let ((f0-17 (+ (* sv-156 sv-172) (* sv-160 sv-176)))) + (when (< 0.0 f0-17) + (let ((f1-15 (+ (* sv-172 (- (-> sv-164 x) (-> v1-19 current-pos x))) + (* sv-176 (- (-> sv-164 z) (-> v1-19 current-pos z))) + ) + ) + ) + (when (< f1-15 f0-17) + (set! sv-128 t4-16) + (let ((f0-19 (fmax 0.0 (/ f1-15 f0-17)))) + (set! sv-156 (* sv-156 f0-19)) + (set! sv-160 (* sv-160 f0-19)) + ) + ) + ) + ) + ) + ) + (let ((f0-23 (+ (* sv-156 (-> v1-19 dir x)) (* sv-160 (-> v1-19 dir z))))) + (+! (-> v1-19 len) f0-23) + ) + 0 + (set! (-> v1-19 next-poly) #f) + (cond + ((= sv-128 -1) + (set! (-> v1-19 current-pos quad) (-> v1-19 dest-pos quad)) + (set! (-> v1-19 reached-dest) #t) + (set! (-> v1-19 terminated) #t) + ) + (else + (+! (-> v1-19 current-pos x) sv-156) + (+! (-> v1-19 current-pos z) sv-160) + (set! sv-180 (-> sv-140 adj-poly sv-128)) + (if (!= sv-180 255) + (set! (-> v1-19 next-poly) (-> t3-8 poly-array sv-180)) + ) + (cond + ((and (-> v1-19 next-poly) (not (logtest? (-> v1-19 next-poly pat) (-> v1-19 ignore)))) + (set! (-> v1-19 current-poly) (-> v1-19 next-poly)) + ) + (else + (set! (-> v1-19 last-edge) sv-128) + (if (-> v1-19 next-poly) + (set! (-> v1-19 hit-gap) #t) + (set! (-> v1-19 hit-boundary) #t) + ) + (set! (-> v1-19 terminated) #t) + ) + ) + ) + ) + ) + 0 + (set! v1-22 (or (>= sv-120 15) (or (>= (-> sv-96 len) (fmax 20480.0 arg3)) (-> sv-96 terminated)))) + ) + (cond + ((and (-> sv-96 hit-boundary) (and (< (-> sv-96 len) arg3) (!= (-> sv-96 last-edge) -1) (< sv-104 1))) + (set! sv-104 (+ sv-104 1)) + (set! sv-184 (-> arg1 vertex (-> sv-112 vert0-table (-> sv-96 last-edge)))) + (set! sv-188 (-> arg1 vertex (-> sv-112 vert1-table (-> sv-96 last-edge)))) + (set! sv-192 (- (-> sv-184 z) (-> sv-188 z))) + (set! sv-196 (- (-> sv-188 x) (-> sv-184 x))) + (set! sv-200 (-> arg2 x)) + (set! sv-204 (-> arg2 z)) + (let* ((f0-37 sv-192) + (f0-39 (* f0-37 f0-37)) + (f1-30 sv-196) + (f0-41 (sqrtf (+ f0-39 (* f1-30 f1-30)))) + (f0-43 (/ 1.0 f0-41)) + ) + (set! sv-192 (* sv-192 f0-43)) + (set! sv-196 (* sv-196 f0-43)) + ) + (when arg5 + (set! (-> arg5 found-boundary) #t) + (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (the-as vector (-> this bounds))) + (set! (-> arg5 boundary-normal x) sv-192) + (set! (-> arg5 boundary-normal y) 0.0) + (set! (-> arg5 boundary-normal z) sv-196) + (set! (-> arg5 poly) (-> sv-96 current-poly)) + (set! (-> arg5 edge) (-> sv-96 last-edge)) + (vector+! (-> arg5 vert-0) sv-184 (the-as vector (-> this bounds))) + (vector+! (-> arg5 vert-1) sv-188 (the-as vector (-> this bounds))) + ) + (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) + (cond + (arg4 + (let ((f0-49 (* 1.01 (+ (* sv-192 sv-200) (* sv-196 sv-204))))) + (set! sv-200 (- sv-200 (* sv-192 f0-49))) + (set! sv-204 (- sv-204 (* sv-196 f0-49))) + ) + (+! (-> sv-96 dest-pos x) sv-200) + (+! (-> sv-96 dest-pos z) sv-204) + ) + (else + (set! sv-100 #t) + ) + ) + ) + ((-> sv-96 hit-gap) + (if arg5 + (set! (-> arg5 gap-poly) (-> sv-96 next-poly)) + ) + (set! sv-100 #t) + ) + (else + (set! sv-100 #t) + ) + ) + ) + (vector-! arg2 (-> sv-96 current-pos) arg0) + 0 + (label cfg-62) + 0 + (none) + ) + ) + +;; definition for method 22 of type nav-control +(defmethod find-first-sphere-and-update-avoid-params ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s2-1 + (vector-! (new 'stack-no-clear 'vector) (-> this root-nav-sphere) (the-as vector (-> this state mesh bounds))) + ) + (f30-0 -1.0) + ) + (let ((s3-0 -1)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) + (f0-2 (ray-circle-intersect s2-1 arg0 s0-0 (+ -409.6 (-> s0-0 r)))) + ) + (when (>= f0-2 0.0) + (let ((v1-5 (new 'stack-no-clear 'vector))) + (vector-! v1-5 (the-as vector s0-0) s2-1) + (when (>= (vector-dot v1-5 arg0) 0.0) + (when (or (< f30-0 0.0) (< f0-2 f30-0)) + (set! f30-0 f0-2) + (set! s3-0 s1-0) + ) + ) + ) + ) + ) + ) + (when arg1 + (set! (-> arg1 current-pos x) f30-0) + (when (>= f30-0 0.0) + (vector+float*! (-> arg1 travel) (-> this root-nav-sphere) arg0 f30-0) + (let ((a0-9 (-> this sphere-array s3-0)) + (v1-19 (new 'stack-no-clear 'vector)) + ) + (vector+! v1-19 (the-as vector a0-9) (the-as vector (-> this state mesh bounds))) + (vector-! (-> arg1 pref-dir) (-> arg1 travel) v1-19) + ) + (set! (-> arg1 pref-dir w) 1.0) + (let ((v1-21 (-> arg1 pref-dir))) + (let ((f0-6 1.0)) + (.lvf vf1 (&-> v1-21 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-12 f0-6)) + (.mov vf3 a0-12) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-21 quad) vf1) + ) + ) + ) + ) + f30-0 + ) + ) + ) + +;; definition for method 24 of type nav-control +(defmethod add-root-sphere-to-hash! ((this nav-control) (arg0 vector) (arg1 int)) + (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) + (find-nav-sphere-ids + (-> this state mesh sphere-hash) + (the-as find-nav-sphere-ids-params arg0) + (logand arg1 255) + (the-as int (-> this root-sphere-id)) + ) + ) + ) + +;; definition for method 48 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod reset! ((this nav-state) (arg0 nav-control)) + (set! (-> this nav) arg0) + (set! (-> this flags) (nav-state-flag)) + (set! (-> this current-poly) #f) + (set! (-> this next-poly) #f) + (set! (-> this target-poly) #f) + (set! (-> this user-poly) #f) + 0 + (none) + ) + +;; definition for method 7 of type nav-state +(defmethod relocate ((this nav-state) (offset int)) + (break!) + (&+! (-> this nav) offset) + this + ) + +;; definition for method 12 of type nav-state +;; INFO: Used lq/sq +(defmethod get-velocity ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this velocity quad)) + arg0 + ) + +;; definition for method 14 of type nav-state +;; INFO: Used lq/sq +(defmethod get-heading ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this heading quad)) + arg0 + ) + +;; definition for method 15 of type nav-state +;; INFO: Used lq/sq +(defmethod get-target-pos ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this target-pos quad)) + arg0 + ) + +;; definition for method 19 of type nav-state +(defmethod get-current-poly ((this nav-state)) + (-> this current-poly) + ) + +;; definition for method 16 of type nav-state +(defmethod get-speed ((this nav-state)) + (-> this speed) + ) + +;; definition for method 17 of type nav-state +(defmethod get-rotation-rate ((this nav-state)) + (-> this rotation-rate) + ) + +;; definition for method 13 of type nav-state +;; INFO: Used lq/sq +(defmethod get-travel ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this travel quad)) + arg0 + ) + +;; definition for method 45 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-velocity! ((this nav-state) (arg0 vector)) + (set! (-> this velocity quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 46 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-heading! ((this nav-state) (arg0 vector)) + (set! (-> this heading quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 47 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod set-speed! ((this nav-state) (arg0 meters)) + (set! (-> this speed) arg0) + 0 + (none) + ) + +;; definition for method 42 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-target-pos! ((this nav-state) (arg0 vector)) + (logclear! (-> this flags) (nav-state-flag directional-mode)) + (logior! (-> this flags) (nav-state-flag target-poly-dirty)) + (set! (-> this target-pos quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 43 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-virtual-cur-pos! ((this nav-state) (arg0 vector)) + (logior! (-> this flags) (nav-state-flag use-position)) + (set! (-> this virtual-current-pos-local quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 44 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-travel! ((this nav-state) (arg0 vector)) + (logior! (-> this flags) (nav-state-flag directional-mode)) + (set! (-> this travel quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 20 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod copy-nav-state! ((this nav-state) (arg0 (pointer nav-state))) + (mem-copy! (the-as pointer this) arg0 176) + 0 + (none) + ) + +;; definition for method 10 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-10 ((this nav-state)) + 0 + (none) + ) + +;; definition for method 9 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this nav-state)) + (let ((s5-0 (-> this mesh))) + (if (-> this next-poly) + (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) + ) + (if (-> this target-poly) + (debug-draw-poly s5-0 (-> this target-poly) *color-yellow*) + ) + (if (-> this current-poly) + (debug-draw-poly s5-0 (-> this current-poly) *color-red*) + ) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-pos) *color-yellow*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> this current-pos) + (-> this travel) + (meters 0.00024414062) + *color-white* + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + (-> this mesh work debug) + (set! (-> s5-1 quad) (-> this current-pos quad)) + (let ((f30-0 (-> s5-1 y))) + (set! (-> s5-1 y) (+ 2048.0 f30-0)) + (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> this heading) (meters 1) *color-yellow*) + (set! (-> s5-1 y) (+ 4096.0 f30-0)) + ) + ) + 0 + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (vector+! (new 'stack-no-clear 'vector) (-> this current-pos) (-> this travel)) + *color-white* + ) + 0 + (none) + ) + +;; definition for method 38 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod set-current-poly! ((this nav-state) (arg0 nav-poly)) + (set! (-> this current-poly) arg0) + 0 + (none) + ) + +;; definition for method 41 of type nav-state +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-state) (arg0 vector)) + (when (-> this current-poly) + (clamp-vector-to-mesh-cross-gaps + (-> this nav) + (-> this current-pos) + (-> this current-poly) + arg0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + #t + ) + ) + +;; definition for method 40 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod do-navigation-to-destination ((this nav-state) (arg0 vector)) + (local-vars (v1-15 symbol)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (cond + ((-> this current-poly) + (let ((s3-0 (-> this mesh)) + (s4-0 (new 'stack-no-clear 'nav-ray)) + ) + (let ((s2-0 0)) + (set! (-> s4-0 current-poly) (-> this current-poly)) + (vector-! (-> s4-0 current-pos) (-> this current-pos) (the-as vector (-> s3-0 bounds))) + (vector-! (-> s4-0 dest-pos) arg0 (the-as vector (-> s3-0 bounds))) + (b! (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) + (b! #t cfg-17 :delay (nop!)) + (label cfg-3) + (let ((v1-10 s4-0)) + (vector-! (-> v1-10 dir) (-> v1-10 dest-pos) (-> v1-10 current-pos)) + (set! (-> v1-10 dir y) 0.0) + (let ((a0-6 (-> v1-10 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-6 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-8 f0-1)) + (.mov vf3 a1-8) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-6 quad) vf1) + ) + (set! (-> v1-10 next-poly) #f) + (set! (-> v1-10 len) 0.0) + (set! (-> v1-10 last-edge) -1) + (set! (-> v1-10 terminated) #f) + (set! (-> v1-10 reached-dest) #f) + (set! (-> v1-10 hit-boundary) #f) + (set! (-> v1-10 hit-gap) #f) + (set! (-> v1-10 ignore) (the-as uint 3)) + ) + 0 + (set! (-> s4-0 ignore) (the-as uint 1)) + (until v1-15 + (+! s2-0 1) + (advance-ray-to-nearest-poly-edge-or-dest! s3-0 s4-0) + (set! v1-15 (or (>= s2-0 15) (-> s4-0 terminated))) + ) + ) + (set! (-> this current-poly) (-> s4-0 current-poly)) + (when (-> s4-0 reached-dest) + (if (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) + (set! (-> s4-0 reached-dest) #f) + ) + ) + (cond + ((-> s4-0 reached-dest) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) + ) + (else + (logclear! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) + (let ((s4-1 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-1 point) arg0 (the-as vector (-> this mesh bounds))) + (set! (-> s4-1 y-threshold) (-> this nav nearest-y-threshold)) + (set! (-> s4-1 ignore) (the-as uint 1)) + (nav-mesh-method-46 (-> this mesh) (the-as nav-poly s4-1)) + (set! (-> this current-poly) (-> s4-1 poly)) + ) + 0 + ) + ) + ) + ) + (else + (set! (-> this current-pos quad) (-> arg0 quad)) + (let ((s4-2 (new 'stack 'nav-find-poly-parms))) + (vector-! (-> s4-2 point) arg0 (the-as vector (-> this mesh bounds))) + (set! (-> s4-2 y-threshold) (-> this nav nearest-y-threshold)) + (set! (-> s4-2 ignore) (the-as uint 1)) + (nav-mesh-method-46 (-> this mesh) (the-as nav-poly s4-2)) + (set! (-> this current-poly) (-> s4-2 poly)) + (logclear! (-> this flags) (nav-state-flag in-mesh)) + (if (-> s4-2 point-inside?) + (logior! (-> this flags) (nav-state-flag in-mesh)) + ) + ) + ) + ) + (label cfg-17) + 0 + (none) + ) + ) + +;; definition for method 18 of type nav-state +(defmethod try-projecting-to-current-poly ((this nav-state) (arg0 vector) (arg1 vector) (arg2 vector)) + (cond + ((-> this current-poly) + (let ((s5-0 (-> this nav)) + (v1-1 (-> this current-poly)) + (gp-0 arg0) + ) + (let ((t1-0 arg1) + (a1-1 arg2) + ) + (project-point-onto-plane-of-poly-local + (-> s5-0 state mesh) + v1-1 + gp-0 + t1-0 + (vector-! (new 'stack-no-clear 'vector) a1-1 (the-as vector (-> s5-0 state mesh bounds))) + ) + ) + (vector+! gp-0 gp-0 (the-as vector (-> s5-0 state mesh bounds))) + ) + 0 + #t + ) + (else + #f + ) + ) + ) + +;; definition for method 20 of type nav-control +;; WARN: Return type mismatch int vs none. +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (the-as vector (-> this state mesh bounds))) + (clamp-vector-to-mesh-cross-gaps (-> this state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-control +;; WARN: Return type mismatch float vs nav-poly. +(defmethod closest-point-on-mesh ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-poly))) + (set! (-> gp-0 vertex1 z) (the-as float arg2)) + (vector-! (the-as vector (-> gp-0 vertex)) arg1 (the-as vector (-> this state mesh bounds))) + (when (or (not (-> gp-0 vertex1 z)) + (not (point-in-poly? (-> this state mesh) (the-as nav-poly (-> gp-0 vertex1 z)) (the-as vector (-> gp-0 vertex))) + ) + ) + (set! (-> gp-0 vertex1 x) (-> this nearest-y-threshold)) + (set! (-> gp-0 data 20) (the-as uint 3)) + (nav-mesh-method-46 (-> this state mesh) gp-0) + ) + (when (-> gp-0 vertex1 z) + (project-point-into-poly-2d + (-> this state mesh) + (the-as nav-poly (-> gp-0 vertex1 z)) + sv-16 + (the-as vector (-> gp-0 vertex)) + ) + (vector+! sv-16 sv-16 (the-as vector (-> this state mesh bounds))) + ) + (the-as nav-poly (-> gp-0 vertex1 z)) + ) + ) + +;; definition for function vector-rotate-y-sincos! +(defun vector-rotate-y-sincos! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (let ((f0-0 (-> arg1 x)) + (f1-0 (-> arg1 z)) + ) + (set! (-> arg0 x) (+ (* arg3 f0-0) (* arg2 f1-0))) + (set! (-> arg0 y) (-> arg1 y)) + (set! (-> arg0 z) (- (* arg3 f1-0) (* arg2 f0-0))) + ) + ) + +;; definition for method 39 of type nav-state +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 39 nav-state)" 39 nav-state) + +;; definition for method 51 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-51 ((this nav-state)) + 0 + (none) + ) + +;; definition for function test-xz-point-on-line-segment? +(defun test-xz-point-on-line-segment? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 float) (v1-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let* ((f0-0 arg3) + (f0-2 (* f0-0 f0-0)) + ) + (let ((v1-1 arg0) + (t0-0 arg1) + ) + (.lvf vf2 (&-> v1-1 quad)) + (.lvf vf3 (&-> t0-0 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-2 vf1) + (let ((f1-0 v1-2)) + (let ((v1-3 arg0) + (t0-1 arg2) + ) + (.lvf vf2 (&-> v1-3 quad)) + (.lvf vf3 (&-> t0-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-4 vf1) + (let ((v0-0 (>= f0-2 (fmin f1-0 v1-4)))) + (when (not v0-0) + (let* ((f0-4 (- (-> arg2 x) (-> arg1 x))) + (f1-4 (- (-> arg2 z) (-> arg1 z))) + (f2-2 f0-4) + (f2-4 (* f2-2 f2-2)) + (f3-0 f1-4) + (f2-6 (sqrtf (+ f2-4 (* f3-0 f3-0)))) + (f3-3 f2-6) + (f3-5 (/ 1.0 f3-3)) + (f5-0 (* f3-5 (- f1-4))) + (f6-0 (* f3-5 f0-4)) + (f3-7 (- (-> arg0 x) (-> arg1 x))) + (f4-4 (- (-> arg0 z) (-> arg1 z))) + ) + (when (>= arg3 (fabs (+ (* f3-7 f5-0) (* f4-4 f6-0)))) + (let ((f0-6 (+ (* f3-7 f0-4) (* f4-4 f1-4)))) + (set! v0-0 (and (>= f0-6 0.0) (>= (* f2-6 f2-6) f0-6))) + ) + ) + ) + ) + v0-0 + ) + ) + ) + ) + ) + +;; definition for method 52 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-route-portals ((this nav-state)) + (local-vars + (v1-117 float) + (sv-112 vector) + (sv-116 nav-route-portal) + (sv-120 (inline-array vector)) + (sv-124 symbol) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> this virtual-current-poly) (-> this current-poly)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! sv-116 (new 'stack-no-clear 'nav-route-portal)) + (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) + (set! sv-124 (the-as symbol #f)) + (vector-! (-> this current-pos-local) (-> this current-pos) (the-as vector (-> this mesh bounds))) + (set! (-> this virtual-current-pos-local quad) (-> this current-pos-local quad)) + (set! (-> sv-116 next-poly) #f) + (when (not (logtest? (-> this flags) (nav-state-flag directional-mode))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'nav-poly))) + (vector-! s5-0 (-> this target-pos) (the-as vector (-> this mesh bounds))) + (when (or (logtest? (-> this flags) (nav-state-flag target-poly-dirty)) (not (-> this target-poly))) + (set! (-> s4-0 vertex 0 quad) (-> s5-0 quad)) + (set! (-> s4-0 vertex1 x) (-> this nav nearest-y-threshold)) + (set! (-> s4-0 data 20) (the-as uint 3)) + (nav-mesh-method-46 (-> this mesh) s4-0) + (set! (-> this target-poly) (the-as nav-poly (-> s4-0 vertex1 z))) + (if (not (-> this target-poly)) + (set! (-> this target-poly) (-> this current-poly)) + ) + (logclear! (-> this flags) (nav-state-flag target-poly-dirty)) + ) + ) + (project-point-into-poly-2d (-> this mesh) (-> this target-poly) sv-112 s5-0) + ) + (set! (-> sv-112 y) (-> this current-pos-local y)) + (vector-! (-> this travel) sv-112 (-> this current-pos-local)) + (set! (-> this travel y) 0.0) + (let* ((v1-32 (-> this travel)) + (f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z)))) + (f1-3 4096.0) + ) + (if (< f0-6 (* f1-3 f1-3)) + (logior! (-> this flags) (nav-state-flag at-target)) + ) + ) + (get-route-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-116) + ) + (cond + ((not (-> sv-116 next-poly)) + (set! (-> this next-poly) #f) + ) + (else + (set! (-> this next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (set! sv-124 #t) + (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? + (-> this current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + 409.59998 + ) + ) + (when #t + #t + (vector-segment-distance-point! + (-> this current-pos-local) + (the-as vector (-> sv-116 vertex)) + (-> sv-116 vertex 1) + (-> this virtual-current-pos-local) + ) + (vector-! (-> this travel) sv-112 (-> this virtual-current-pos-local)) + (set! (-> this travel y) 0.0) + 0 + ) + (set! (-> this virtual-current-poly) (-> sv-116 next-poly)) + (cond + ((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116) + (set! (-> this next-poly) (-> sv-116 next-poly)) + (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) + (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + 0 + ) + (else + (set! (-> this next-poly) #f) + (set! sv-124 (the-as symbol #f)) + ) + ) + ) + ) + ) + (when sv-124 + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (vector-! (-> s5-1 rvec) (-> sv-120 1) (-> sv-120 0)) + (vector-normalize! (-> s5-1 rvec) 409.6) + (vector+! (-> sv-120 0) (-> sv-120 0) (-> s5-1 rvec)) + (vector-! (-> sv-120 1) (-> sv-120 1) (-> s5-1 rvec)) + ) + (when (not (ray-ccw-line-segment-intersection? + (-> this virtual-current-pos-local) + (-> this travel) + (-> sv-120 0) + (-> sv-120 1) + ) + ) + (let ((s5-2 -1)) + (let* ((f0-8 (cos 8192.0)) + (f0-10 (* f0-8 f0-8)) + (v1-93 (new 'stack-no-clear 'vector)) + (a0-39 (-> this travel)) + (f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z)))) + ) + (countdown (a0-41 2) + (vector-! v1-93 (-> sv-120 a0-41) (-> this virtual-current-pos-local)) + (let ((f2-5 (vector-dot (-> this travel) v1-93))) + (when (< 0.0 f2-5) + (let* ((f2-7 (* f2-5 f2-5)) + (a1-26 v1-93) + (f2-8 (/ f2-7 (* f1-9 (+ (* (-> a1-26 x) (-> a1-26 x)) (* (-> a1-26 z) (-> a1-26 z)))))) + ) + (when (< f0-10 f2-8) + (set! f0-10 f2-8) + (set! s5-2 a0-41) + ) + ) + ) + ) + ) + ) + (when (= s5-2 -1) + (let ((f30-0 (the-as float #x7f800000)) + (s3-0 (new 'stack-no-clear 'nav-route-portal)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) s3-0) + (cond + ((-> s3-0 next-poly) + (vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1))) + (vector-float*! s4-1 s4-1 0.5) + ) + (else + (set! (-> s4-1 quad) (-> sv-112 quad)) + ) + ) + (countdown (s3-1 2) + (let* ((s2-0 (-> sv-120 s3-1)) + (f0-13 (+ (vector-vector-xz-distance-squared (-> this virtual-current-pos-local) s2-0) + (vector-vector-xz-distance-squared s4-1 s2-0) + ) + ) + ) + (when (< f0-13 f30-0) + (set! f30-0 f0-13) + (set! s5-2 s3-1) + ) + ) + ) + ) + ) + (vector-! (-> this travel) (-> sv-120 s5-2) (-> this virtual-current-pos-local)) + ) + (set! (-> this travel y) 0.0) + ) + ) + (.lvf vf1 (&-> (-> this travel) 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-117 vf1) + (let ((f0-15 v1-117) + (f1-10 (-> this nav nav-cull-radius)) + ) + (if (< (* f1-10 f1-10) f0-15) + (vector-float*! (-> this travel) (-> this travel) (/ (-> this nav nav-cull-radius) (sqrtf f0-15))) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 50 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-use-existing-avoid-spheres ((this nav-state) (arg0 nav-avoid-spheres-params)) + (local-vars + (sv-96 int) + (sv-104 nav-mesh-work) + (sv-108 nav-poly) + (sv-112 uint) + (sv-116 (pointer int8)) + (sv-120 (pointer int8)) + (sv-124 float) + (sv-128 float) + (sv-132 vector) + (sv-136 vector) + (sv-140 float) + (sv-144 float) + (sv-148 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when (-> arg0 avoiding-sphere?) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> arg0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + (let ((v1-10 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-10 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-10 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-10 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) + (let ((a2-5 0)) + (let ((a3-3 v1-10)) + (vector-! (-> a3-3 dir) (-> a3-3 dest-pos) (-> a3-3 current-pos)) + (set! (-> a3-3 dir y) 0.0) + (let ((t0-3 (-> a3-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> t0-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t1-2 f0-2)) + (.mov vf3 t1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> t0-3 quad) vf1) + ) + (set! (-> a3-3 next-poly) #f) + (set! (-> a3-3 len) 0.0) + (set! (-> a3-3 last-edge) -1) + (set! (-> a3-3 terminated) #f) + (set! (-> a3-3 reached-dest) #f) + (set! (-> a3-3 hit-boundary) #f) + (set! (-> a3-3 hit-gap) #f) + (set! (-> a3-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a2-5 15) (-> v1-10 terminated)) + (+! a2-5 1) + (let ((t0-6 (-> this mesh)) + (a3-5 v1-10) + ) + (set! sv-96 -1) + (set! sv-104 (-> t0-6 work)) + (set! sv-108 (-> a3-5 current-poly)) + (set! sv-112 (-> a3-5 current-poly vertex-count)) + (set! sv-116 (-> t0-6 work vert0-table)) + (set! sv-120 (-> t0-6 work vert1-table)) + (set! sv-124 (- (-> a3-5 dest-pos x) (-> a3-5 current-pos x))) + (set! sv-128 (- (-> a3-5 dest-pos z) (-> a3-5 current-pos z))) + (dotimes (t1-12 (the-as int sv-112)) + (set! sv-132 (-> sv-108 vertex (-> sv-116 t1-12))) + (set! sv-136 (-> sv-108 vertex (-> sv-120 t1-12))) + (set! sv-140 (- (-> sv-132 z) (-> sv-136 z))) + (set! sv-144 (- (-> sv-136 x) (-> sv-132 x))) + (let ((f0-14 (+ (* sv-124 sv-140) (* sv-128 sv-144)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-140 (- (-> sv-132 x) (-> a3-5 current-pos x))) (* sv-144 (- (-> sv-132 z) (-> a3-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-96 t1-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-124 (* sv-124 f0-16)) + (set! sv-128 (* sv-128 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-124 (-> a3-5 dir x)) (* sv-128 (-> a3-5 dir z))))) + (+! (-> a3-5 len) f0-20) + ) + 0 + (set! (-> a3-5 next-poly) #f) + (cond + ((= sv-96 -1) + (set! (-> a3-5 current-pos quad) (-> a3-5 dest-pos quad)) + (set! (-> a3-5 reached-dest) #t) + (set! (-> a3-5 terminated) #t) + ) + (else + (+! (-> a3-5 current-pos x) sv-124) + (+! (-> a3-5 current-pos z) sv-128) + (set! sv-148 (-> sv-108 adj-poly sv-96)) + (if (!= sv-148 255) + (set! (-> a3-5 next-poly) (-> t0-6 poly-array sv-148)) + ) + (cond + ((and (-> a3-5 next-poly) (not (logtest? (-> a3-5 next-poly pat) (-> a3-5 ignore)))) + (set! (-> a3-5 current-poly) (-> a3-5 next-poly)) + ) + (else + (set! (-> a3-5 last-edge) sv-96) + (if (-> a3-5 next-poly) + (set! (-> a3-5 hit-gap) #t) + (set! (-> a3-5 hit-boundary) #t) + ) + (set! (-> a3-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + ) + (else + (set! (-> this travel quad) (-> arg0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 53 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 ((this nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + quad + ) + ) + (avoid-spheres-1! (-> this nav) s5-0) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + (let ((v1-15 (new 'stack-no-clear 'nav-ray))) + (set! (-> v1-15 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-15 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-15 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) + (let ((a0-15 0)) + (let ((a1-4 v1-15)) + (vector-! (-> a1-4 dir) (-> a1-4 dest-pos) (-> a1-4 current-pos)) + (set! (-> a1-4 dir y) 0.0) + (let ((a2-3 (-> a1-4 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a2-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a3-2 f0-2)) + (.mov vf3 a3-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a2-3 quad) vf1) + ) + (set! (-> a1-4 next-poly) #f) + (set! (-> a1-4 len) 0.0) + (set! (-> a1-4 last-edge) -1) + (set! (-> a1-4 terminated) #f) + (set! (-> a1-4 reached-dest) #f) + (set! (-> a1-4 hit-boundary) #f) + (set! (-> a1-4 hit-gap) #f) + (set! (-> a1-4 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a0-15 15) (-> v1-15 terminated)) + (+! a0-15 1) + (let ((a2-6 (-> this mesh)) + (a1-6 v1-15) + ) + (set! sv-192 -1) + (set! sv-200 (-> a2-6 work)) + (set! sv-204 (-> a1-6 current-poly)) + (set! sv-208 (-> a1-6 current-poly vertex-count)) + (set! sv-212 (-> a2-6 work vert0-table)) + (set! sv-216 (-> a2-6 work vert1-table)) + (set! sv-220 (- (-> a1-6 dest-pos x) (-> a1-6 current-pos x))) + (set! sv-224 (- (-> a1-6 dest-pos z) (-> a1-6 current-pos z))) + (dotimes (a3-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 a3-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 a3-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a1-6 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a1-6 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 a3-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a1-6 dir x)) (* sv-224 (-> a1-6 dir z))))) + (+! (-> a1-6 len) f0-20) + ) + 0 + (set! (-> a1-6 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a1-6 current-pos quad) (-> a1-6 dest-pos quad)) + (set! (-> a1-6 reached-dest) #t) + (set! (-> a1-6 terminated) #t) + ) + (else + (+! (-> a1-6 current-pos x) sv-220) + (+! (-> a1-6 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a1-6 next-poly) (-> a2-6 poly-array sv-244)) + ) + (cond + ((and (-> a1-6 next-poly) (not (logtest? (-> a1-6 next-poly pat) (-> a1-6 ignore)))) + (set! (-> a1-6 current-poly) (-> a1-6 next-poly)) + ) + (else + (set! (-> a1-6 last-edge) sv-192) + (if (-> a1-6 next-poly) + (set! (-> a1-6 hit-gap) #t) + (set! (-> a1-6 hit-boundary) #t) + ) + (set! (-> a1-6 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> this travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + 0 + 0 + (none) + ) + ) + +;; definition for method 54 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-within-poly ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> this target-dir quad) (-> this travel quad)) + (let ((v1-1 (-> this target-dir))) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-4 f0-0)) + (.mov vf3 a0-4) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (cond + ((logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (let ((s5-0 (nav-state-method-39 this))) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-8 (-> this travel)) + ) + (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-9 f0-5)) + (.mov vf3 a0-9) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + ) + (let ((f0-6 (find-first-sphere-and-update-avoid-params + (-> this nav) + (-> this travel) + (the-as nav-avoid-spheres-params #f) + ) + ) + ) + (when (>= f0-6 0.0) + (vector-float*! (-> this travel) (-> this travel) f0-6) + (let ((f0-7 (* f0-6 (-> this nav nav-cull-radius)))) + (if (and (not s5-0) (>= 40.96 f0-7)) + (logior! (-> this flags) (nav-state-flag blocked)) + ) + ) + ) + ) + ) + ) + (else + (let* ((f0-8 40.96) + (f0-10 (* f0-8 f0-8)) + (v1-26 (-> this travel)) + ) + (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-30 (-> this heading))) + (let ((f0-12 1.0)) + (.lvf vf1 (&-> v1-30 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-15 f0-12)) + (.mov vf3 a0-15) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-30 quad) vf1) + ) + ) + ) + ) + ) + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +;; definition for method 55 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod clamp-travel-vector ((this nav-state)) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) + (not (or (logtest? (-> this nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s5-0 + ) + (when (-> s5-0 gap-poly) + (set! (-> this next-poly) (-> s5-0 gap-poly)) + (let* ((v1-12 (-> this travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> this flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> this virtual-current-pos-local) (-> this current-pos-local)) + (vector+! (-> this travel) (-> this travel) v1-19) + ) + (set! (-> this travel y) 0.0) + 0 + (none) + ) + +;; definition for method 11 of type nav-state +;; INFO: Used lq/sq +(defmethod plan-over-pat1-polys-using-route ((this nav-state) (arg0 nav-gap-info)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 number)) + (let ((a1-1 (-> this next-poly))) + (when (logtest? (-> a1-1 pat) 1) + (while (and a1-1 (logtest? (-> a1-1 pat) 1)) + (set! a1-1 (lookup-poly-on-route-to-target (-> this mesh) a1-1 (-> this target-poly))) + ) + (when (and a1-1 (!= a1-1 (-> this current-poly))) + (set! (-> arg0 poly) a1-1) + (-> this mesh) + (let ((s3-0 (-> arg0 poly)) + (s4-0 (-> arg0 dest)) + ) + (let ((s2-0 (-> this current-pos-local))) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 10000000000000000000000000000000000000.0) + (let* ((s1-0 (-> s3-0 vertex-count)) + (v1-13 (the-as int (+ s1-0 -1))) + ) + (dotimes (s0-0 (the-as int s1-0)) + (let ((f0-1 (vector-segment-distance-point! s2-0 (-> s3-0 vertex v1-13) (-> s3-0 vertex s0-0) sv-48))) + (when (< f0-1 (the-as float sv-56)) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-13 s0-0) + ) + ) + ) + (set! (-> s4-0 quad) (-> sv-52 quad)) + ) + (vector+! (-> arg0 dest) (-> arg0 dest) (the-as vector (-> this mesh bounds))) + #t + ) + ) + ) + ) + +;; definition for method 24 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod turn-and-navigate-to-destination ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> this rotation-rate) (-> this nav max-rotation-rate)) + (if (< 0.0 (-> this speed)) + (set! (-> this rotation-rate) + (fmin + (-> this rotation-rate) + (* (/ (-> this nav turning-acceleration) (-> this speed)) (-> this mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> this heading) (-> this nav shape quat)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> this flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> this nav shape trans quad)) + ) + (if (or (not (-> this current-poly)) + (!= (-> this current-pos x) (-> v1-13 0 x)) + (!= (-> this current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination this (-> v1-13 0)) + ) + ) + (logclear! + (-> this flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + 0 + (none) + ) + ) + +;; definition for method 25 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-route-portals-wrapper ((this nav-state)) + (navigate-using-route-portals this) + 0 + (none) + ) + +;; definition for method 26 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper ((this nav-state)) + (navigate-using-best-dir-recompute-avoid-spheres-1 this) + 0 + (none) + ) + +;; definition for method 27 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod navigate-within-poly-wrapper ((this nav-state)) + (navigate-within-poly this) + 0 + (none) + ) + +;; definition for method 28 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod compute-travel-speed ((this nav-state)) + (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) + (let ((s5-0 this)) + (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> s5-0 mesh) + (-> s5-0 virtual-current-pos-local) + (-> s5-0 virtual-current-poly) + (-> s5-0 travel) + (-> s5-0 mesh work nav-poly-min-dist) + (not (or (logtest? (-> s5-0 nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> s5-0 nav flags) (nav-control-flag limit-rotation-rate)) + ) + ) + s4-0 + ) + (when (-> s4-0 gap-poly) + (set! (-> s5-0 next-poly) (-> s4-0 gap-poly)) + (let* ((v1-12 (-> s5-0 travel)) + (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) + (f1-3 1024.0) + ) + (if (< f0-4 (* f1-3 f1-3)) + (logior! (-> s5-0 flags) (nav-state-flag at-gap)) + ) + ) + ) + ) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (vector-! v1-19 (-> s5-0 virtual-current-pos-local) (-> s5-0 current-pos-local)) + (vector+! (-> s5-0 travel) (-> s5-0 travel) v1-19) + ) + (set! (-> s5-0 travel y) 0.0) + ) + 0 + (cond + ((logtest? (-> this nav flags) (nav-control-flag use-momentum)) + (set! sv-192 (-> this nav target-speed)) + (if (not (logtest? (-> this nav flags) (nav-control-flag momentum-ignore-heading))) + (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> this heading) (-> this target-dir))))) + ) + (set! sv-196 (- sv-192 (-> this speed))) + (set! sv-200 (* (-> this nav sec-per-frame) (-> this nav acceleration))) + (set! sv-204 (fmin sv-200 (fabs sv-196))) + (if (< sv-196 0.0) + (set! (-> this speed) (- (-> this speed) sv-204)) + (+! (-> this speed) sv-204) + ) + ) + (else + (set! (-> this speed) (-> this nav target-speed)) + ) + ) + (let* ((f0-22 (/ (vector-length (-> this travel)) (-> this nav sec-per-frame))) + (f1-18 (fmin (* (-> this nav speed-scale) (-> this speed)) f0-22)) + ) + (set! sv-224 (new 'stack-no-clear 'vector)) + (when (< f0-22 (-> this speed)) + (set! (-> this prev-speed) (-> this speed)) + (set! (-> this speed) (/ f0-22 (-> this nav speed-scale))) + ) + (vector-normalize-copy! sv-224 (-> this travel) f1-18) + ) + (set! (-> this velocity x) (-> sv-224 x)) + (set! (-> this velocity z) (-> sv-224 z)) + 0 + (none) + ) + +;; definition for method 34 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-v1! ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 this)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + ) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) + (!= (-> s5-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination s5-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + (navigate-using-route-portals this) + 0 + (let* ((v1-20 (-> this nav)) + (a0-18 (-> v1-20 state mesh sphere-hash sphere-array)) + (a1-9 (-> v1-20 sphere-id-array)) + (a2-1 (-> v1-20 state mesh bounds)) + (a3-0 (-> v1-20 root-nav-sphere)) + (t0-0 (-> v1-20 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-18 (-> a1-9 t1-0))) + (t2-4 (-> v1-20 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-1)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-1 this) + 0 + (navigate-within-poly this) + 0 + (compute-travel-speed this) + 0 + (none) + ) + ) + +;; definition for method 35 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod reset-target! ((this nav-state)) + (vector-reset! (-> this target-dir)) + 0 + (none) + ) + +;; definition for method 36 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod add-offset-to-target! ((this nav-state) (arg0 vector)) + (vector+! (-> this target-dir) (-> this target-dir) arg0) + 0 + (none) + ) + +;; definition for method 29 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-29 ((this nav-state)) + 0 + (none) + ) + +;; definition for method 30 of type nav-state +;; WARN: Return type mismatch int vs none. +(defmethod nav-state-method-30 ((this nav-state)) + 0 + (none) + ) + +;; definition for method 31 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 ((this nav-state)) + (local-vars + (sv-192 int) + (sv-200 nav-mesh-work) + (sv-204 nav-poly) + (sv-208 uint) + (sv-212 (pointer int8)) + (sv-216 (pointer int8)) + (sv-220 float) + (sv-224 float) + (sv-228 vector) + (sv-232 vector) + (sv-236 float) + (sv-240 float) + (sv-244 uint) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + quad + ) + ) + (avoid-spheres-2! (-> this nav) s5-0) + (let ((v1-5 this)) + (when (-> s5-0 avoiding-sphere?) + (logior! (-> v1-5 flags) (nav-state-flag avoiding-sphere)) + (let ((f0-0 (-> s5-0 closest-sphere-dist2)) + (f1-0 512.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (logior! (-> v1-5 flags) (nav-state-flag touching-sphere)) + ) + ) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (let ((a0-20 (new 'stack-no-clear 'nav-ray))) + (set! (-> a0-20 current-pos quad) (-> v1-5 virtual-current-pos-local quad)) + (set! (-> a0-20 current-poly) (-> v1-5 virtual-current-poly)) + (vector+! (-> a0-20 dest-pos) (-> v1-5 virtual-current-pos-local) (-> v1-5 travel)) + (let ((a1-6 0)) + (let ((a2-3 a0-20)) + (vector-! (-> a2-3 dir) (-> a2-3 dest-pos) (-> a2-3 current-pos)) + (set! (-> a2-3 dir y) 0.0) + (let ((a3-3 (-> a2-3 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a3-3 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((t0-2 f0-2)) + (.mov vf3 t0-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a3-3 quad) vf1) + ) + (set! (-> a2-3 next-poly) #f) + (set! (-> a2-3 len) 0.0) + (set! (-> a2-3 last-edge) -1) + (set! (-> a2-3 terminated) #f) + (set! (-> a2-3 reached-dest) #f) + (set! (-> a2-3 hit-boundary) #f) + (set! (-> a2-3 hit-gap) #f) + (set! (-> a2-3 ignore) (the-as uint 3)) + ) + 0 + (until (or (>= a1-6 15) (-> a0-20 terminated)) + (+! a1-6 1) + (let ((a3-6 (-> v1-5 mesh)) + (a2-5 a0-20) + ) + (set! sv-192 -1) + (set! sv-200 (-> a3-6 work)) + (set! sv-204 (-> a2-5 current-poly)) + (set! sv-208 (-> a2-5 current-poly vertex-count)) + (set! sv-212 (-> a3-6 work vert0-table)) + (set! sv-216 (-> a3-6 work vert1-table)) + (set! sv-220 (- (-> a2-5 dest-pos x) (-> a2-5 current-pos x))) + (set! sv-224 (- (-> a2-5 dest-pos z) (-> a2-5 current-pos z))) + (dotimes (t0-12 (the-as int sv-208)) + (set! sv-228 (-> sv-204 vertex (-> sv-212 t0-12))) + (set! sv-232 (-> sv-204 vertex (-> sv-216 t0-12))) + (set! sv-236 (- (-> sv-228 z) (-> sv-232 z))) + (set! sv-240 (- (-> sv-232 x) (-> sv-228 x))) + (let ((f0-14 (+ (* sv-220 sv-236) (* sv-224 sv-240)))) + (when (< 0.0 f0-14) + (let ((f1-13 + (+ (* sv-236 (- (-> sv-228 x) (-> a2-5 current-pos x))) (* sv-240 (- (-> sv-228 z) (-> a2-5 current-pos z)))) + ) + ) + (when (< f1-13 f0-14) + (set! sv-192 t0-12) + (let ((f0-16 (fmax 0.0 (/ f1-13 f0-14)))) + (set! sv-220 (* sv-220 f0-16)) + (set! sv-224 (* sv-224 f0-16)) + ) + ) + ) + ) + ) + ) + (let ((f0-20 (+ (* sv-220 (-> a2-5 dir x)) (* sv-224 (-> a2-5 dir z))))) + (+! (-> a2-5 len) f0-20) + ) + 0 + (set! (-> a2-5 next-poly) #f) + (cond + ((= sv-192 -1) + (set! (-> a2-5 current-pos quad) (-> a2-5 dest-pos quad)) + (set! (-> a2-5 reached-dest) #t) + (set! (-> a2-5 terminated) #t) + ) + (else + (+! (-> a2-5 current-pos x) sv-220) + (+! (-> a2-5 current-pos z) sv-224) + (set! sv-244 (-> sv-204 adj-poly sv-192)) + (if (!= sv-244 255) + (set! (-> a2-5 next-poly) (-> a3-6 poly-array sv-244)) + ) + (cond + ((and (-> a2-5 next-poly) (not (logtest? (-> a2-5 next-poly pat) (-> a2-5 ignore)))) + (set! (-> a2-5 current-poly) (-> a2-5 next-poly)) + ) + (else + (set! (-> a2-5 last-edge) sv-192) + (if (-> a2-5 next-poly) + (set! (-> a2-5 hit-gap) #t) + (set! (-> a2-5 hit-boundary) #t) + ) + (set! (-> a2-5 terminated) #t) + ) + ) + ) + ) + ) + 0 + ) + ) + (cond + ((or (-> a0-20 reached-dest) (-> a0-20 hit-gap) (>= (-> a0-20 len) 4096.0)) + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + ) + (else + (set! (-> v1-5 travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> v1-5 flags) (nav-state-flag trapped-by-sphere)) + ) + ) + ) + ) + ) + ) + 0 + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) + ) + 0 + (none) + ) + ) + +;; definition for method 32 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update-travel-dir-from-spheres ((this nav-state)) + (local-vars (v1-11 float) (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) + (vector-reset! (-> s5-0 in-dir)) + (set! (-> s5-0 best-dir 0 quad) (-> this travel quad)) + (set! (-> s5-0 best-dir 0 y) 0.0) + (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> this nav target-speed)) + (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> this velocity)) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + (dotimes (s4-0 (-> this nav sphere-count)) + (let ((s3-0 (-> this nav sphere-array s4-0))) + (vector-! (-> s5-0 right-dir) (-> this current-pos-local) (the-as vector s3-0)) + (.lvf vf1 (&-> (-> s5-0 right-dir) 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-11 vf1) + (let ((f30-0 v1-11)) + (vector-normalize! (-> s5-0 right-dir) 2.0) + (let* ((f0-4 (+ (-> this nav root-nav-sphere w) (-> s3-0 r))) + (f1-1 (* f0-4 f0-4)) + (f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1))) + ) + (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) (* 81920.0 f0-7)) + ) + ) + ) + (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) + ) + (vector+! (-> this target-dir) (-> this target-dir) (-> s5-0 in-dir)) + ) + (set! (-> this target-dir y) 0.0) + (vector+float*! (-> this velocity) (-> this velocity) (-> this target-dir) (-> this nav sec-per-frame)) + (.lvf vf1 (&-> (-> this velocity) 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-25 vf1) + (let ((f0-11 v1-25) + (f1-4 (-> this nav target-speed)) + ) + (if (< (* f1-4 f1-4) f0-11) + (vector-float*! (-> this velocity) (-> this velocity) (/ (-> this nav target-speed) (sqrtf f0-11))) + ) + ) + (vector-float*! (-> this travel) (-> this velocity) (-> this nav sec-per-frame)) + 0 + (none) + ) + ) + +;; definition for method 33 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod compute-speed-simple ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-cross-gaps + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) + #t + s5-0 + ) + (if (-> s5-0 gap-poly) + (set! (-> this next-poly) (-> s5-0 gap-poly)) + ) + ) + (let* ((f0-1 40.96) + (f0-3 (* f0-1 f0-1)) + (v1-9 (-> this travel)) + ) + (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-13 (-> this heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-13 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-5 f0-5)) + (.mov vf3 a0-5) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-13 quad) vf1) + ) + ) + ) + (vector-float*! (-> this velocity) (-> this travel) (/ 1.0 (-> this nav sec-per-frame))) + (set! (-> this speed) (vector-length (-> this velocity))) + (vector-reset! (-> this target-dir)) + 0 + (none) + ) + ) + +;; definition for method 37 of type nav-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod navigate-v2! ((this nav-state)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 this)) + (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) + (if (< 0.0 (-> s5-0 speed)) + (set! (-> s5-0 rotation-rate) + (fmin + (-> s5-0 rotation-rate) + (* (/ (-> s5-0 nav turning-acceleration) (-> s5-0 speed)) (-> s5-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> s5-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> s5-0 heading) (-> s5-0 nav shape quat)) + (set! (-> s5-0 heading y) 0.0) + (let ((v1-12 (-> s5-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + ) + (if (or (not (-> s5-0 current-poly)) + (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) + (!= (-> s5-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination s5-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> s5-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + (navigate-using-route-portals this) + 0 + (let* ((v1-20 (-> this nav)) + (a0-18 (-> v1-20 state mesh sphere-hash sphere-array)) + (a1-9 (-> v1-20 sphere-id-array)) + (a2-1 (-> v1-20 state mesh bounds)) + (a3-0 (-> v1-20 root-nav-sphere)) + (t0-0 (-> v1-20 sphere-count)) + ) + (dotimes (t1-0 t0-0) + (let ((t3-0 (-> a0-18 (-> a1-9 t1-0))) + (t2-4 (-> v1-20 sphere-array t1-0)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-1)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 this) + (update-travel-dir-from-spheres this) + (compute-speed-simple this) + 0 + (none) + ) + ) + +;; definition for symbol *null-nav-callback-info*, type nav-callback-info +(define *null-nav-callback-info* (new 'static 'nav-callback-info)) + +;; definition for symbol *default-nav-callback-info*, type nav-callback-info +(define *default-nav-callback-info* + (new 'static 'nav-callback-info + :callback-count 5 + :callback-array (new 'static 'array (function object nav-control none) 10 + (lambda ((arg0 object) (arg1 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg1 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-12 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + ) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) + (!= (-> gp-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination gp-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + 0 + (none) + ) + ) + (lambda ((arg0 object) (arg1 nav-control)) (navigate-using-route-portals (-> arg1 state)) 0 0 (none)) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-1 (-> arg1 state)) + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (navigate-within-poly (-> arg1 state)) + 0 + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) (compute-travel-speed (-> arg1 state)) 0 (none)) + ) + ) + ) + +;; definition for symbol *physics-nav-callback-info*, type nav-callback-info +(define *physics-nav-callback-info* + (new 'static 'nav-callback-info + :callback-count 5 + :callback-array (new 'static 'array (function object nav-control none) 10 + (lambda ((arg0 object) (arg1 nav-control)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg1 state))) + (set! (-> gp-0 rotation-rate) (-> gp-0 nav max-rotation-rate)) + (if (< 0.0 (-> gp-0 speed)) + (set! (-> gp-0 rotation-rate) + (fmin + (-> gp-0 rotation-rate) + (* (/ (-> gp-0 nav turning-acceleration) (-> gp-0 speed)) (-> gp-0 mesh work rad-to-deg)) + ) + ) + ) + (when (logtest? (-> gp-0 nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> gp-0 heading) (-> gp-0 nav shape quat)) + (set! (-> gp-0 heading y) 0.0) + (let ((v1-12 (-> gp-0 heading))) + (let ((f0-5 1.0)) + (.lvf vf1 (&-> v1-12 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-3 f0-5)) + (.mov vf3 a0-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-12 quad) vf1) + ) + ) + (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) + (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) + (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) + (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + ) + (if (or (not (-> gp-0 current-poly)) + (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) + (!= (-> gp-0 current-pos z) (-> v1-13 0 z)) + ) + (do-navigation-to-destination gp-0 (-> v1-13 0)) + ) + ) + (logclear! + (-> gp-0 flags) + (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap use-position) + ) + ) + 0 + 0 + (none) + ) + ) + (lambda ((arg0 object) (arg1 nav-control)) (navigate-using-route-portals (-> arg1 state)) 0 0 (none)) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg1 state)) + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) + (let* ((v1-0 arg1) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a2-0 (-> v1-0 sphere-id-array)) + (a3-1 (-> v1-0 state mesh bounds)) + (t0-0 (-> v1-0 root-nav-sphere)) + (t1-0 (-> v1-0 sphere-count)) + ) + (dotimes (t2-0 t1-0) + (let ((t4-0 (-> a0-3 (-> a2-0 t2-0))) + (t3-4 (-> v1-0 sphere-array t2-0)) + ) + (vector-! (the-as vector t3-4) (the-as vector t4-0) (the-as vector a3-1)) + (set! (-> t3-4 r) (+ (-> t4-0 r) (-> t0-0 w))) + ) + ) + ) + 0 + (update-travel-dir-from-spheres (-> arg1 state)) + 0 + (none) + ) + (lambda ((arg0 object) (arg1 nav-control)) (compute-speed-simple (-> arg1 state)) 0 (none)) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc index 069278a221..8474f68ee8 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc @@ -175,36 +175,36 @@ debug-control ) (:methods - (nav-enemy-method-160 (_type_) none) - (nav-enemy-method-161 (_type_) none) + (normalize-heading! (_type_ nav-control) none) + (nav-enemy-method-161 (_type_ nav-control) none) (nav-enemy-method-162 (_type_) none) (nav-enemy-method-163 (_type_) none) (nav-enemy-method-164 (_type_) none) - (nav-enemy-method-165 (_type_) none) - (nav-enemy-method-166 (_type_) none) - (nav-enemy-method-167 (_type_) none) - (nav-enemy-method-168 (_type_) none) - (nav-enemy-method-169 (_type_) none) - (nav-enemy-method-170 (_type_) none) + (nav-enemy-method-165 (_type_ vector vector) none) + (nav-enemy-method-166 (_type_ vector vector) vector) + (nav-enemy-method-167 (_type_) vector) + (nav-enemy-method-168 (_type_ vector) nav-poly) + (nav-enemy-method-169 (_type_ vector) object) + (is-notice-point-in-mesh? (_type_ vector) symbol) (nav-enemy-method-171 (_type_) none) (nav-enemy-method-172 (_type_) none) (nav-enemy-method-173 (_type_) none) - (nav-enemy-method-174 (_type_) none) + (nav-enemy-method-174 (_type_) symbol) (nav-enemy-method-175 (_type_) none) (nav-enemy-method-176 (_type_) none) (nav-enemy-method-177 (_type_) none) (nav-enemy-method-178 (_type_) none) (nav-enemy-method-179 (_type_) none) - (nav-enemy-method-180 (_type_) none) + (nav-enemy-method-180 (_type_ float float) none) (nav-enemy-method-181 (_type_) none) (nav-enemy-method-182 (_type_) none) (nav-enemy-method-183 (_type_) none) (nav-enemy-method-184 (_type_) none) - (nav-enemy-method-185 (_type_) none) - (nav-enemy-method-186 (_type_) none) + (nav-enemy-method-185 (_type_) symbol) + (nav-enemy-method-186 (_type_) symbol) (nav-enemy-method-187 (_type_) none) (nav-enemy-method-188 (_type_) none) - (nav-enemy-method-189 (_type_) none) + (copy-nav-state-vel! (_type_ vector) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc new file mode 100644 index 0000000000..55ed505827 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc @@ -0,0 +1,2534 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 10 of type nav-enemy-info +;; WARN: Return type mismatch int vs none. +(defmethod copy! ((this nav-enemy-info) (arg0 nav-enemy-info)) + (mem-copy! (&-> this type) (&-> arg0 type) 524) + 0 + (none) + ) + +;; definition for method 68 of type nav-enemy +(defmethod get-enemy-aware ((this nav-enemy) (arg0 enemy-aware)) + (let* ((t9-0 (method-of-type enemy get-enemy-aware)) + (s5-0 (t9-0 this arg0)) + ) + (if (and (>= 1 (the-as int (-> this focus aware))) (< 1 (the-as int s5-0))) + (nav-enemy-method-172 this) + ) + s5-0 + ) + ) + +;; definition for method 82 of type nav-enemy +(defmethod event-handler ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('nav-mesh-kill) + (deactivate this) + #t + ) + (('nav-mesh-new) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) + #t + ) + (('change-nav-mesh) + (let ((a0-6 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor (the-as int (-> arg3 param 0))))) + (if a0-6 + (change-to a0-6 this) + ) + ) + ) + (('debug-control-on) + (go (method-of-object this debug-control)) + ) + (('debug-control-off) + (go-best-state this) + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for symbol *nav-enemy-dummy-shadow-control*, type shadow-control +(define *nav-enemy-dummy-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x28)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 4096.0) + :top-plane (new 'static 'plane :y 1.0 :w -4096.0) + ) + ) + ) + +;; definition for method 164 of type nav-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-164 ((this nav-enemy)) + (cond + ((zero? (-> this path)) + (go process-drawable-art-error "no path") + ) + (else + (let ((s4-0 (-> this path curve num-cverts))) + (if (<= s4-0 0) + (go process-drawable-art-error "no path") + ) + (let ((s2-0 (rnd-int this s4-0)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s3-0 s4-0) + (get-point-in-path! (-> this path) s5-0 (the float s2-0) 'interp) + (if (< 4096.0 (vector-vector-xz-distance s5-0 (-> this root trans))) + (goto cfg-11) + ) + (set! s2-0 (mod (+ s2-0 1) s4-0)) + ) + (label cfg-11) + (let ((v1-19 (-> this nav state))) + (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-19 target-pos quad) (-> s5-0 quad)) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 165 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-165 ((this nav-enemy) (arg0 vector) (arg1 vector)) + (closest-point-on-mesh (-> this nav) arg0 arg1 (the-as nav-poly #f)) + 0 + (none) + ) + +;; definition for method 166 of type nav-enemy +;; INFO: Used lq/sq +(defmethod nav-enemy-method-166 ((this nav-enemy) (arg0 vector) (arg1 vector)) + (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> this root transv))) + (s2-1 (vector-! (new 'stack-no-clear 'vector) v1-1 arg1)) + (s1-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + (f26-0 7281.778) + (f24-0 f26-0) + ) + (set! (-> s2-1 y) 0.0) + (vector-normalize-copy! s1-0 s2-1 1.0) + (let ((f28-0 0.0) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (s0-0 7) + (vector-rotate-y! s2-1 s1-0 f30-0) + (vector-normalize! s2-1 (-> this enemy-info run-travel-speed)) + (vector+! s2-1 s2-1 (-> this root trans)) + (nav-enemy-method-165 this arg0 s2-1) + (let ((f0-2 (vector-vector-xz-distance arg1 arg0))) + (when (< f28-0 f0-2) + (set! f28-0 f0-2) + (set! (-> s3-0 quad) (-> arg0 quad)) + ) + ) + (set! f30-0 (cond + ((= (logand s0-0 1) 1) + (+! f30-0 f24-0) + f30-0 + ) + (else + (- f30-0 f24-0) + ) + ) + ) + (+! f24-0 f26-0) + ) + (when (and (!= f28-0 0.0) (< 4096.0 (vector-vector-xz-distance (-> this root trans) s3-0))) + (set! (-> arg0 quad) (-> s3-0 quad)) + arg0 + ) + ) + ) + ) + +;; definition for method 167 of type nav-enemy +(defmethod nav-enemy-method-167 ((this nav-enemy)) + (let ((v1-2 (handle->process (-> this focus handle)))) + (if v1-2 + (nav-enemy-method-166 this (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable v1-2) 0)) + ) + ) + ) + +;; definition for method 109 of type nav-enemy +;; INFO: Used lq/sq +(defmethod enemy-method-109 ((this nav-enemy)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) + ) + (do-navigation-to-destination s3-0 (-> gp-0 trans)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ) + (else + (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) + (let ((f0-0 32768.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (-> gp-0 trans))) + ) + (< (- (-> gp-0 trans y) (-> s5-0 y)) -8192.0) + ) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 59 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod enemy-common-post ((this nav-enemy)) + (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-draw-time)) + ) + (update-focus this) + (when *target* + (if *target* + (look-at! + (-> *target* neck) + (the-as vector (-> this root root-prim prim-core)) + (if (logtest? (-> this enemy-flags) (enemy-flag cam-attack-mode)) + 'attacking + ) + this + ) + ) + ) + (when (nonzero? (-> this neck)) + (cond + ((logtest? (-> this enemy-flags) (enemy-flag look-at-focus)) + (let ((a0-7 (handle->process (-> this focus handle)))) + (if a0-7 + (target-set! (-> this neck) (get-trans (the-as process-focusable a0-7) 2)) + ) + ) + ) + ((logtest? (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (let ((s5-1 (-> this move-dest)) + (v1-39 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info neck-joint))) + ) + (a1-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-6 x) (-> s5-1 x)) + (set! (-> a1-6 y) (-> v1-39 y)) + (set! (-> a1-6 z) (-> s5-1 z)) + (set! (-> a1-6 w) 1.0) + (target-set! (-> this neck) a1-6) + ) + ) + ) + ) + (when (and (logtest? (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) + (time-elapsed? (-> this auto-reset-penetrate-time) (seconds 0.1)) + ) + (logclear! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (let ((v1-54 0)) + (if (logtest? (penetrate knocked) (-> this root penetrate-using)) + (set! v1-54 (logior (shl 2 32) v1-54)) + ) + (set! (-> this root penetrate-using) (the-as penetrate v1-54)) + ) + ) + (if (logtest? (-> this enemy-flags) (enemy-flag victory)) + (check-victory this) + ) + (if (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) + (check-water this) + ) + (let ((v1-65 (-> this restore-nav-radius-time))) + (when (nonzero? v1-65) + (when (>= (current-time) v1-65) + (set! (-> this restore-nav-radius-time) 0) + (set! (-> this root nav-radius) (-> this nav-radius-backup)) + ) + ) + ) + (if (and *debug-segment* (-> this enemy-info debug-draw-neck) (nonzero? (-> this neck))) + (joint-mod-debug-draw (-> this neck)) + ) + (ja-post) + 0 + (none) + ) + +;; definition for method 139 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod move-above-ground! ((this nav-enemy) (arg0 vector) (arg1 move-above-ground-params)) + (let ((t9-0 (method-of-type enemy move-above-ground!))) + (t9-0 this arg0 arg1) + ) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + 0 + (none) + ) + +;; definition for method 188 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-188 ((this nav-enemy)) + (let ((v1-2 (-> this nav state current-poly))) + (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) + (let ((v1-6 (-> this nav state mesh link-array (-> v1-2 link) dest-mesh))) + (if v1-6 + (change-to v1-6 this) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 187 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-187 ((this nav-enemy)) + (nav-enemy-method-188 this) + (cond + ((nav-enemy-method-185 this) + (let ((s5-0 (-> this nav))) + (when (logtest? (-> s5-0 state flags) (nav-state-flag at-gap)) + (let ((s4-0 (new 'stack-no-clear 'nav-gap-info))) + (when (plan-over-pat1-polys-using-route (-> s5-0 state) s4-0) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag jump-check-blocked) (-> this enemy-flags))) + ) + (send-event this 'jump 1 (-> s4-0 dest)) + ) + ) + ) + (cond + ((logtest? (enemy-flag ef39) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) + ) + (else + (when (not (logtest? (enemy-flag ef43) (-> this enemy-flags))) + (normalize-heading! this s5-0) + (nav-enemy-method-161 this s5-0) + ) + ) + ) + (cond + ((logtest? (-> s5-0 state flags) (nav-state-flag blocked)) + (if (zero? (-> this blocked-start-time)) + (set-time! (-> this blocked-start-time)) + ) + ) + (else + (set! (-> this blocked-start-time) 0) + 0 + ) + ) + ) + ) + (else + (set! (-> this blocked-start-time) 0) + 0 + ) + ) + (enemy-common-post this) + (update-transforms (-> this root)) + 0 + (none) + ) + +;; definition for method 163 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-163 ((this nav-enemy)) + (navigate-v1! (-> this nav state)) + 0 + (none) + ) + +;; definition for method 160 of type nav-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this nav-enemy) (arg0 nav-control)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 (-> arg0 state))) + (set! (-> s5-0 quad) (-> a1-1 heading quad)) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (quaternion-set! (-> this root quat) 0.0 (-> s5-0 x) 0.0 (+ 1.0 (-> s5-0 z))) + ) + (quaternion-normalize! (-> this root quat)) + 0 + (none) + ) + +;; definition for method 189 of type nav-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod copy-nav-state-vel! ((this nav-enemy) (arg0 vector)) + (set! (-> arg0 quad) (-> this nav state velocity quad)) + (none) + ) + +;; definition for method 161 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-161 ((this nav-enemy) (arg0 nav-control)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (copy-nav-state-vel! this s5-0) + (let ((v1-3 (-> this root transv))) + (set! (-> v1-3 x) (-> s5-0 x)) + (set! (-> v1-3 z) (-> s5-0 z)) + ) + ) + (cond + ((should-move-to-ground? this) + (if (focus-test? this under-water) + (accelerate-fall! this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) + ) + (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) + (let ((v1-17 (-> this enemy-info))) + (set! (-> a2-0 gnd-collide-with) (-> this gnd-collide-with)) + (set! (-> a2-0 popup) 8192.0) + (set! (-> a2-0 dont-move-if-overlaps?) #t) + (set! (-> a2-0 hover-if-no-ground?) (-> v1-17 hover-if-no-ground)) + (set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2)) + (set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-17 overlaps-others-collide-with-filter)) + ) + (set! (-> a2-0 overlaps-params tlist) *touching-list*) + (-> a2-0 overlaps-params) + (move-above-ground! this (-> this root transv) a2-0) + ) + ) + (else + (let ((a2-1 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a2-1 options) (overlaps-others-options oo0)) + (set! (-> a2-1 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) + (set! (-> a2-1 tlist) *touching-list*) + (integrate-for-enemy-no-mtg (-> this root) (-> this root transv) a2-1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 181 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-181 ((this nav-enemy)) + (if (not (logtest? (enemy-flag ef37) (-> this enemy-flags))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> this enemy-flags)))) + ) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> this enemy-flags)))) + (set! (-> this nav callback-info) (-> this enemy-info callback-info)) + 0 + (none) + ) + +;; definition for method 182 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-182 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef37)))) + (set! (-> this nav callback-info) *null-nav-callback-info*) + 0 + (none) + ) + +;; definition for method 183 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-183 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> this enemy-flags)))) + 0 + (none) + ) + +;; definition for method 184 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-184 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef38)))) + 0 + (none) + ) + +;; definition for method 185 of type nav-enemy +(defmethod nav-enemy-method-185 ((this nav-enemy)) + (logtest? (enemy-flag ef37) (-> this enemy-flags)) + ) + +;; definition for method 186 of type nav-enemy +(defmethod nav-enemy-method-186 ((this nav-enemy)) + (logtest? (enemy-flag ef38) (-> this enemy-flags)) + ) + +;; definition for method 168 of type nav-enemy +(defmethod nav-enemy-method-168 ((this nav-enemy) (arg0 vector)) + (let ((v1-0 (-> this nav)) + (a0-1 arg0) + (a1-1 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-1 vertex)) a0-1 (the-as vector (-> v1-0 state mesh bounds))) + (set! (-> a1-1 vertex1 x) (-> v1-0 nearest-y-threshold)) + (set! (-> a1-1 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> v1-0 state mesh) a1-1) + ) + ) + +;; definition for method 169 of type nav-enemy +(defmethod nav-enemy-method-169 ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) + (f0-0 (-> arg0 y)) + (v1-1 (-> this fact)) + ) + (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) + (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) + (let ((v1-3 (-> this nav)) + (a0-1 arg0) + (a1-1 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-1 vertex)) a0-1 (the-as vector (-> v1-3 state mesh bounds))) + (set! (-> a1-1 vertex1 x) (-> v1-3 nearest-y-threshold)) + (set! (-> a1-1 data 20) (the-as uint 2)) + (nav-mesh-method-45 (-> v1-3 state mesh) a1-1) + ) + ) + ) + ) + ) + +;; definition for method 170 of type nav-enemy +(defmethod is-notice-point-in-mesh? ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) + (f0-0 (-> arg0 y)) + (v1-1 (-> this fact)) + ) + (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) + (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) + (is-in-mesh? (-> this nav) arg0 (-> this enemy-info notice-nav-radius)) + ) + ) + ) + ) + +;; definition for method 107 of type nav-enemy +(defmethod is-pfoc-in-mesh? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) + (if (and arg0 (not arg1)) + (set! arg1 (get-trans arg0 1)) + ) + (when arg1 + (let* ((f0-0 (-> arg1 y)) + (v1-4 (-> this root)) + (f1-0 (-> v1-4 trans y)) + (a0-2 (-> this fact)) + ) + (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) + (let* ((f30-0 (-> this enemy-info notice-nav-radius)) + (f0-1 f30-0) + ) + (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) + (is-in-mesh? (-> this nav) arg1 f30-0) + ) + ) + ) + ) + ) + ) + +;; definition for method 172 of type nav-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-172 ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef40)))) + (set-time! (-> this frustration-time)) + (let ((v1-7 (handle->process (-> this focus handle)))) + (if v1-7 + (set! (-> this frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) + ) + ) + 0 + (none) + ) + +;; definition for method 171 of type nav-enemy +;; WARN: Return type mismatch object vs none. +(defmethod nav-enemy-method-171 ((this nav-enemy)) + (let ((s5-0 (handle->process (-> this focus handle)))) + (cond + ((or (not s5-0) + (< 6144.0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 1) (-> this frustration-point))) + (< (-> this enemy-info frustration-distance) + (vector-vector-xz-distance (get-trans (the-as process-focusable s5-0) 0) (-> this root trans)) + ) + ) + (nav-enemy-method-172 this) + ) + (else + (when (time-elapsed? (-> this frustration-time) (+ (-> this reaction-time) (-> this enemy-info frustration-time))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef40) (-> this enemy-flags)))) + 0 + ) + ) + ) + ) + (none) + ) + +;; definition for method 173 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-173 ((this nav-enemy)) + (set! (-> this blocked-start-time) 0) + 0 + (none) + ) + +;; definition for method 174 of type nav-enemy +(defmethod nav-enemy-method-174 ((this nav-enemy)) + (let ((v1-0 (-> this blocked-start-time))) + (and (nonzero? v1-0) (time-elapsed? v1-0 (-> this enemy-info blocked-time))) + ) + ) + +;; definition for method 175 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-175 ((this nav-enemy)) + (if (-> this enemy-info use-momentum) + (logior! (-> this nav flags) (nav-control-flag use-momentum)) + (logclear! (-> this nav flags) (nav-control-flag use-momentum)) + ) + 0 + (none) + ) + +;; definition for method 178 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-178 ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) 0.0) + ) + 0 + (let ((v1-3 (-> this nav state))) + (set! (-> v1-3 speed) 0.0) + ) + 0 + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 acceleration) (-> this enemy-info walk-acceleration)) + ) + 0 + 0 + (none) + ) + +;; definition for method 176 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-176 ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info walk-travel-speed)) + ) + 0 + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info walk-acceleration)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) + ) + 0 + 0 + (none) + ) + +;; definition for method 177 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-177 ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info run-travel-speed)) + ) + 0 + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info run-acceleration)) + ) + 0 + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info run-turning-acceleration)) + ) + 0 + 0 + (none) + ) + +;; definition for method 118 of type nav-enemy +;; WARN: Return type mismatch float vs none. +(defmethod init-enemy-info! ((this nav-enemy) (arg0 enemy-info)) + (set! (-> this enemy-info) (the-as nav-enemy-info arg0)) + (set! (-> (the-as nav-enemy-info arg0) callback-info) *default-nav-callback-info*) + (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) + ) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) + ) + (none) + ) + +;; definition for method 119 of type nav-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 enemy-info)) + (local-vars (sv-16 res-tag)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (coin-flip? this) + (let ((a0-2 (-> this node-list data 2))) + (set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!)) + (set! (-> a0-2 param1) #f) + (set! (-> a0-2 param2) #f) + ) + (logior! (-> this enemy-flags) (enemy-flag drawn-mirrored)) + ) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this nav-radius-backup) (-> this root nav-radius)) + (init-enemy-info! this arg0) + (set! (-> this enemy-info callback-info) *default-nav-callback-info*) + (set! (-> this ragdoll-proc) (the-as handle #f)) + (let ((a1-2 (-> this enemy-info idle-anim-script))) + (if a1-2 + (init! (-> this idle-anim-player) a1-2) + ) + ) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + (-> this enemy-info shadow-min-y) + (-> this enemy-info shadow-max-y) + (-> this enemy-info shadow-locus-dist) + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) + ) + (get-nav-control this (-> (the-as nav-enemy-info arg0) nav-mesh)) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) + (let ((v1-32 this)) + (set! (-> v1-32 enemy-flags) (the-as enemy-flag (logclear (-> v1-32 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-32 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-35 this)) + (set! (-> v1-35 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-35 enemy-flags)))) + ) + 0 + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate)) + (logior! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef44) (-> this enemy-flags)))) + (let ((v1-46 (-> this nav))) + (set! (-> v1-46 target-speed) 0.0) + ) + 0 + (let ((v1-48 (-> this nav))) + (set! (-> v1-48 acceleration) (-> this enemy-info walk-acceleration)) + ) + 0 + (let ((v1-50 (-> this nav))) + (set! (-> v1-50 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) + ) + 0 + (let ((v1-52 (-> this nav))) + (set! (-> v1-52 max-rotation-rate) (-> this enemy-info maximum-rotation-rate)) + ) + 0 + (nav-enemy-method-175 this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (when (and (zero? (-> this path curve num-cverts)) (-> this entity)) + (set! (-> this path curve num-cverts) 3) + (set! (-> this path curve cverts) (-> (new 'process 'vector-array 3) data)) + (logclear! (-> this path flags) (path-control-flag not-found)) + (let ((v1-69 (-> this path curve cverts 0))) + (let ((a0-33 (-> this entity trans))) + (let ((a1-9 *x-vector*)) + (let ((a2-4 6144.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a1-9 quad)) + ) + (.lvf vf4 (&-> a0-33 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-69 quad) vf6) + ) + (let ((v1-72 (-> this path curve cverts 1))) + (let ((a0-35 (-> this entity trans))) + (let ((a1-10 *x-vector*)) + (let ((a2-6 -6144.0)) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a1-10 quad)) + ) + (.lvf vf4 (&-> a0-35 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-72 quad) vf6) + ) + (let ((v1-75 (-> this path curve cverts 2))) + (let ((a0-37 (-> this entity trans))) + (let ((a1-11 *z-vector*)) + (let ((a2-8 6144.0)) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-37 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-75 quad) vf6) + ) + ) + (if (and (nonzero? (-> this path)) (nonzero? (-> this path curve num-cverts))) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! (-> this hit-points) (* 2.0 (-> this enemy-info default-hit-points))) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + ) + (let* ((v1-91 *game-info*) + (a0-42 (+ (-> v1-91 attack-id) 1)) + ) + (set! (-> v1-91 attack-id) a0-42) + (set! (-> this attack-id) a0-42) + ) + (let* ((v1-92 *game-info*) + (a0-44 (+ (-> v1-92 attack-id) 1)) + ) + (set! (-> v1-92 attack-id) a0-44) + (set! (-> this persistent-attack-id) a0-44) + ) + (set! (-> this gnd-collide-with) (-> this enemy-info gnd-collide-with)) + (set! (-> this fact) (new 'process 'fact-info-enemy this (the-as (pointer float) (-> arg0 fact-defaults)))) + (let ((cspec (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options)) + (the-as collide-spec (collide-spec jak bot player-list jak-vehicle)) + (the-as collide-spec (collide-spec jak player-list jak-vehicle)) + ) + ) + ) + (reset-to-collide-spec (-> this focus) (the-as collide-spec cspec)) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-101 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-101 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-101)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair)) + (set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile pair)) + (set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death pair)) + (if (-> this on-notice) + (logior! (-> this enemy-flags) (enemy-flag enable-on-notice)) + ) + (if (-> this on-active) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active)) + ) + (if (-> this on-hostile) + (logior! (-> this enemy-flags) (enemy-flag enable-on-hostile)) + ) + (set! (-> this incoming attacker-handle) (the-as handle #f)) + (let ((s4-0 (-> this root))) + (set! (-> this penetrated-by-all) (-> this root penetrated-by)) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (set! (-> s4-0 event-self) 'touched) + ) + (set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch)) + (set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked)) + (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.8))) + (let* ((v1-132 (-> this enemy-flags)) + (a0-61 (-> this fact enemy-options)) + (v1-133 + (logior (enemy-flag vulnerable vulnerable-backup use-notice-distance attackable-backup trackable trackable-backup) + v1-132 + ) + ) + ) + (if (logtest? (enemy-option multi-focus) a0-61) + (set! v1-133 (logior (enemy-flag multi-focus) v1-133)) + ) + (if (logtest? (enemy-option has-trigger) a0-61) + (set! v1-133 (logior (enemy-flag use-trigger) v1-133)) + ) + (set! (-> this enemy-flags) v1-133) + ) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (if (and (should-move-to-ground? this) + (not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) + ) + (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + ) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) + ) + 0 + (none) + ) + ) + +;; definition for method 11 of type nav-enemy +;; WARN: Return type mismatch int vs object. +(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) + (let ((a1-2 (res-lump-struct arg0 'art-level structure))) + (when a1-2 + (let ((a0-3 (level-get *level* (the-as symbol a1-2)))) + (if a0-3 + (set! (-> this level) a0-3) + ) + ) + ) + ) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (init-enemy! this) + (enemy-setup-gem) + (let ((v1-10 (-> this fact enemy-options))) + (cond + ((logtest? (enemy-option spawner) v1-10) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die-fast)) + ) + (*debug-view-anims* + (go (method-of-object this view-anims)) + ) + ((logtest? (enemy-option dormant) v1-10) + (let ((v1-18 (-> this root root-prim))) + (set! (-> v1-18 prim-core collide-as) (collide-spec)) + (set! (-> v1-18 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant)) + ) + ((logtest? (enemy-option dormant-aware) v1-10) + (let ((v1-28 (-> this root root-prim))) + (set! (-> v1-28 prim-core collide-as) (collide-spec)) + (set! (-> v1-28 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant-aware)) + ) + (else + (go-idle2 this) + ) + ) + ) + 0 + ) + +;; definition for function nav-enemy-simple-post +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-simple-post nav-enemy () + (enemy-common-post self) + (update-transforms (-> self root)) + 0 + (none) + ) + +;; definition for function nav-enemy-die-falling-post +(defbehavior nav-enemy-die-falling-post nav-enemy () + (enemy-die-falling-post) + (none) + ) + +;; definition for function nav-enemy-travel-post +(defbehavior nav-enemy-travel-post nav-enemy () + (nav-enemy-method-187 self) + (none) + ) + +;; definition for function nav-enemy-patrol-post +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-patrol-post nav-enemy () + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) (nav-enemy-method-174 self)) + (nav-enemy-method-164 self) + (nav-enemy-method-173 self) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + +;; definition for function nav-enemy-chase-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-chase-post nav-enemy () + (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) 1)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + ) + 0 + ) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + +;; definition for function nav-enemy-flee-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-flee-post nav-enemy () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (-> self move-dest))) + (if (or (not (nav-enemy-method-166 self gp-0 (get-trans (the-as process-focusable a0-1) 0))) + (nav-enemy-method-174 self) + ) + (go-stare2 self) + ) + (let ((a0-7 (-> self nav state)) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 quad) (-> a0-7 target-pos quad)) + (when (< 2048.0 (vector-vector-xz-distance gp-0 a1-3)) + (let ((v1-18 (-> self nav state))) + (logclear! (-> v1-18 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-18 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-18 target-pos quad) (-> gp-0 quad)) + ) + 0 + ) + ) + ) + ) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + +;; definition for function nav-enemy-face-focus-post +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-face-focus-post nav-enemy () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (let ((a0-4 (handle->process (-> self focus handle)))) + (if a0-4 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-4) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + ) + (nav-enemy-simple-post) + 0 + (none) + ) + +;; definition for method 180 of type nav-enemy +;; WARN: Return type mismatch float vs none. +(defmethod nav-enemy-method-180 ((this nav-enemy) (arg0 float) (arg1 float)) + (if arg1 + (set! (-> this nav-radius-backup) arg0) + ) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) arg0) + ) + (none) + ) + +;; definition for method 179 of type nav-enemy +;; WARN: Return type mismatch float vs none. +(defmethod nav-enemy-method-179 ((this nav-enemy)) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) (-> this nav-radius-backup)) + ) + (none) + ) + +;; definition for method 162 of type nav-enemy +;; WARN: Return type mismatch int vs none. +(defmethod nav-enemy-method-162 ((this nav-enemy)) + (set! (-> this root nav-radius) 4.096) + (set! (-> this restore-nav-radius-time) + (the-as + time-frame + (max (-> this restore-nav-radius-time) (+ (current-time) (set-reaction-time! this (seconds 5) (seconds 8)))) + ) + ) + (none) + ) + +;; definition for function nav-enemy-stare-post +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-stare-post nav-enemy () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (let ((a0-4 (handle->process (-> self focus handle)))) + (if a0-4 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-4) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + ) + (nav-enemy-method-187 self) + (if (and (nav-enemy-method-174 self) + (zero? (-> self restore-nav-radius-time)) + (time-elapsed? (-> self blocked-start-time) (seconds 4)) + ) + (nav-enemy-method-162 self) + ) + 0 + (none) + ) + +;; definition for function nav-enemy-falling-post +(defbehavior nav-enemy-falling-post nav-enemy () + (enemy-falling-post) + (none) + ) + +;; definition for function nav-enemy-turn-to-face-dir +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-turn-to-face-dir nav-enemy ((arg0 vector) (arg1 float)) + (local-vars (v1-18 symbol)) + (let ((s4-0 (current-time))) + (ja :group! (-> self draw art-group data (-> self enemy-info turn-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (until v1-18 + (seek-toward-heading-vec! (-> self root) arg0 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (loop! 0.75)) + (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (enemy-method-103 self arg0 arg1))) + ) + ) + (forward-up->quaternion (-> self root quat) arg0 *y-vector*) + 0 + (none) + ) + +;; definition for function nav-enemy-turn-to-face-point +;; WARN: Return type mismatch int vs none. +(defbehavior nav-enemy-turn-to-face-point nav-enemy ((arg0 vector) (arg1 float)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root trans)))) + (set! (-> gp-1 y) 0.0) + (when (< 0.0 (vector-length gp-1)) + (vector-normalize! gp-1 1.0) + (nav-enemy-turn-to-face-dir gp-1 arg1) + ) + ) + 0 + (none) + ) + +;; definition for method 76 of type nav-enemy +(defmethod go-stare2 ((this nav-enemy)) + (if (!= (-> this enemy-info taunt-anim) -1) + (go (method-of-object this taunt)) + ) + (go (method-of-object this stare)) + ) + +;; definition for method 75 of type nav-enemy +(defmethod go-stare ((this nav-enemy)) + (let ((s5-0 (-> this focus aware))) + (cond + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) + (nav-enemy-method-174 this) + ) + (go-stare2 this) + ) + ((and (= s5-0 (enemy-aware ea3)) (-> this enemy-info use-circling)) + (go (method-of-object this circling)) + ) + ((= s5-0 (enemy-aware ea4)) + (go-flee this) + ) + (else + (go-stare2 this) + ) + ) + ) + ) + +;; definition for method 78 of type nav-enemy +(defmethod go-hostile ((this nav-enemy)) + (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) + (nav-enemy-method-174 this) + ) + (go-stare2 this) + (go (method-of-object this hostile)) + ) + ) + +;; definition for method 79 of type nav-enemy +(defmethod go-flee ((this nav-enemy)) + (if (nav-enemy-method-167 this) + (go (method-of-object this flee)) + (go (method-of-object this stare)) + ) + ) + +;; definition for symbol *nav-enemy-debug-control-info*, type nav-enemy-debug-control-info +(define *nav-enemy-debug-control-info* (new 'static 'nav-enemy-debug-control-info)) + +;; definition for function nav-enemy-debug-control-post +;; INFO: Used lq/sq +(defbehavior nav-enemy-debug-control-post nav-enemy () + (let ((gp-0 *nav-enemy-debug-control-info*)) + (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0))) + (seek! (-> gp-0 steering) (fmax -1.0 (fmin 1.0 f30-0)) (seconds-per-frame)) + (if (cpad-hold? 0 x) + (set! (-> gp-0 throttle) 1.0) + (set! (-> gp-0 throttle) 0.0) + ) + (format *stdcon* "input-x ~f steering ~f throttle ~f~%" f30-0 (-> gp-0 steering) (-> gp-0 throttle)) + ) + (format *stdcon* "target-speed ~M, speed ~M~%" (-> self nav target-speed) (-> self nav state speed)) + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) (* 24576.0 (-> gp-0 throttle))) + ) + 0 + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((a1-4 (-> self nav state))) + (set! (-> s4-0 quad) (-> a1-4 heading quad)) + ) + (vector-rotate-y! s4-0 s4-0 (* 1820.4445 (-> gp-0 steering))) + (vector-float*! s4-0 s4-0 20480.0) + (vector+! s5-0 (-> self root trans) s4-0) + (let ((v1-26 (-> self nav state))) + (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-26 target-pos quad) (-> s5-0 quad)) + ) + ) + ) + 0 + (nav-enemy-method-187 self) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy idle) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self state-timeout) (seconds 1)) + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-7 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + ) + +;; failed to figure out what this is: +(defstate dormant (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy dormant) 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 ef38)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + ) + +;; failed to figure out what this is: +(defstate dormant-aware (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy dormant) enter) + ) + +;; failed to figure out what this is: +(defstate active (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self state-timeout) (seconds 1)) + (logior! (-> self nav state flags) (nav-state-flag at-target)) + (let ((v1-8 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-8 enemy-flags))) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-8 enemy-flags)))) + ) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-8 enemy-flags)))) + (set! (-> v1-8 nav callback-info) (-> v1-8 enemy-info callback-info)) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-11 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (when (enemy-method-134 self 0.2) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (let ((v1-37 self)) + (set! (-> v1-37 enemy-flags) (the-as enemy-flag (logclear (-> v1-37 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-37 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-101 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-101 enemy-flags))) + (set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-101 enemy-flags)))) + ) + (set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-101 enemy-flags)))) + (set! (-> v1-101 nav callback-info) (-> v1-101 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-176 self) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + :post nav-enemy-patrol-post + ) + +;; failed to figure out what this is: +(defstate notice (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (-> self nav state)) + (v1-11 (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-pos quad) (-> v1-11 quad)) + ) + 0 + ) + ) + (let ((v1-14 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-14 enemy-flags))) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-14 enemy-flags)))) + ) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-14 enemy-flags)))) + (set! (-> v1-14 nav callback-info) (-> v1-14 enemy-info callback-info)) + ) + 0 + (let ((v1-17 self)) + (set! (-> v1-17 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-17 enemy-flags)))) + ) + 0 + (let ((v1-19 (-> self nav))) + (set! (-> v1-19 target-speed) 0.0) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (let ((a1-9 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-9 travel quad)) + ) + (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate hostile (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) + (go-stare self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + (when (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags))) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-stare self) + ) + ) + ) + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate stop-chase (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (let ((a2-0 (-> self nav state))) + (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + ) + (let ((f0-0 (vector-vector-distance (-> self root trans) a1-0))) + (set! (-> self state-timeout) + (the-as + time-frame + (the int (+ (lerp-scale 300.0 1200.0 f0-0 32768.0 122880.0) (rnd-float-range self 0.0 30.0))) + ) + ) + ) + ) + (nav-enemy-method-176 self) + (let ((v1-10 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-10 enemy-flags))) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-10 enemy-flags)))) + ) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-10 enemy-flags)))) + (set! (-> v1-10 nav callback-info) (-> v1-10 enemy-info callback-info)) + ) + 0 + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-13 enemy-flags)))) + ) + 0 + (logclear! (-> self mask) (process-mask actor-pause)) + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) + (go-virtual active) + ) + ) + ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + (go-hostile self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + (else + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) + (go-stare self) + ) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate stare (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef43) (-> self enemy-flags)))) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (let ((v1-9 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-9 enemy-flags))) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-9 enemy-flags)))) + ) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-9 enemy-flags)))) + (set! (-> v1-9 nav callback-info) (-> v1-9 enemy-info callback-info)) + ) + 0 + (let ((v1-12 self)) + (set! (-> v1-12 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-12 enemy-flags)))) + ) + 0 + (nav-enemy-method-178 self) + (vector-reset! (-> self root transv)) + (set-time! (-> self starting-time)) + ) + :exit (behavior () + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (let ((v1-4 (-> self nav state))) + (set! (-> v1-4 speed) 0.0) + ) + 0 + (vector-reset! (-> self root transv)) + (if (logtest? (enemy-flag ef44) (-> 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)) + ) + (when (and (logtest? (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (not (nav-enemy-method-174 self)) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! gp-0 (-> self root quat)) + (set! (-> gp-0 y) 0.0) + (let ((v1-23 gp-0)) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> v1-23 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-9 f0-2)) + (.mov vf3 a0-9) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-23 quad) vf1) + ) + (set! (-> self nav state heading quad) (-> gp-0 quad)) + ) + 0 + ) + ) + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (let ((gp-0 (-> self focus aware))) + (if (< (the-as int gp-0) 2) + (set-time! (-> self starting-time)) + ) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-174 self))) + (cond + ((>= 1 (the-as int gp-0)) + (go-virtual active) + ) + ((= gp-0 (enemy-aware ea3)) + (if (and (get-focus! self) + (not (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags)))) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) + ) + (go-hostile self) + ) + (if (-> self enemy-info use-circling) + (go-virtual circling) + ) + ) + ((and (= gp-0 (enemy-aware ea4)) (nav-enemy-method-167 self)) + (go-flee self) + ) + ((and (= gp-0 (enemy-aware ea2)) + (-> self enemy-info use-pacing) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) + ) + (go-virtual pacing) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-stare-post + ) + +;; failed to figure out what this is: +(defstate taunt (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy stare) enter)) + (let ((gp-0 (handle->process (-> self focus handle)))) + (when (not gp-0) + (if (nav-enemy-method-174 self) + (go-virtual stare) + (go-virtual active) + ) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + ) + :exit (-> (method-of-type nav-enemy stare) exit) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-174 self))) + (let ((v1-6 (-> self focus aware))) + (cond + ((>= 1 (the-as int v1-6)) + (go-virtual active) + ) + ((and (= v1-6 (enemy-aware ea3)) (get-focus! self)) + (go-virtual hostile) + ) + ) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (s5-0 (current-time)) + (f28-0 f30-0) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (loop! f28-0) + :frame-num 0.0 + ) + (until (time-elapsed? s5-0 gp-0) + (suspend) + (ja :num! (loop! f28-0)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info taunt-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual stare) + ) + :post nav-enemy-stare-post + ) + +;; failed to figure out what this is: +(defstate pacing (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-look-at-mode! self 1) + (logior! (-> self enemy-flags) (enemy-flag cam-attack-mode)) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self move-dest quad) (-> self root trans quad)) + (set! (-> self state-timeout) (set-reaction-time! self (seconds 7) (seconds 11))) + (set-time! (-> self starting-time)) + (if (zero? (rnd-int self 2)) + (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef41) (-> self enemy-flags)))) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef41)))) + ) + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-virtual active) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (if a0-1 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + ) + ) + (let ((gp-1 (-> self focus aware))) + (if (or (!= gp-1 3) (not (get-focus! self))) + (set-time! (-> self starting-time)) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (>= 1 (the-as int gp-1)) + (go-virtual active) + ) + (when (= gp-1 (enemy-aware ea3)) + (when (and (get-focus! self) (time-elapsed? (-> self starting-time) (-> self reaction-time))) + (nav-enemy-method-172 self) + (go-virtual hostile) + ) + (if (-> self enemy-info use-circling) + (go-virtual circling) + ) + ) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) + (nav-enemy-method-172 self) + (go-stare2 self) + ) + ) + ) + (when (>= 1024.0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (zero? (rnd-int self 3))) + (nav-enemy-method-172 self) + (go-stare2 self) + ) + (countdown (gp-4 2) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (f30-1 16384.0) + (v1-70 (-> self enemy-flags)) + (s5-0 (-> self move-dest)) + ) + (let ((v1-71 (logxor (shl 512 32) (the-as int v1-70)))) + (set! (-> self enemy-flags) (the-as enemy-flag v1-71)) + (if (logtest? (shl 512 32) v1-71) + (set! f30-1 (- f30-1)) + ) + ) + (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-! s4-0 (-> self root trans) s5-0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 (rnd-float-range self 16384.0 49152.0)) + (vector-rotate-around-y! s4-0 s4-0 f30-1) + (vector+! s5-0 s5-0 s4-0) + (if (and (closest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f)) + (< 4096.0 (vector-vector-xz-distance s5-0 (-> self root trans))) + ) + (return #f) + ) + ) + ) + (go-stare2 self) + ) + ) + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info walk-anim))) + ) + (let ((v1-8 (ja-group))) + (if (not (and v1-8 (= v1-8 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :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-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate circling (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-look-at-mode! self 1) + (logior! (-> self enemy-flags) (enemy-flag cam-attack-mode)) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-11 enemy-flags)))) + ) + 0 + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-virtual active) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (let ((f30-0 (-> self enemy-info circle-dist-lo)) + (f28-0 (-> self enemy-info circle-dist-hi)) + ) + (if (zero? (rnd-int self 4)) + (set! (-> self desired-angle) (rnd-float-range self f30-0 f28-0)) + (set! (-> self desired-angle) + (fmax (fmin (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)) f28-0) f30-0) + ) + ) + ) + (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 512 32) (the-as int (-> self enemy-flags))))) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef42)))) + (set-time! (-> self starting-time)) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (if a0-1 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + ) + ) + (let ((gp-1 (-> self focus aware))) + (if (or (!= gp-1 3) (not (get-focus! self))) + (set-time! (-> self starting-time)) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (cond + ((>= 1 (the-as int gp-1)) + (nav-enemy-method-172 self) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((and (= gp-1 (enemy-aware ea3)) + (get-focus! self) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) + ) + (nav-enemy-method-172 self) + (go-hostile self) + ) + ((= gp-1 (enemy-aware ea2)) + (go-stare self) + ) + ((= gp-1 (enemy-aware ea4)) + (go-flee self) + ) + ((or (nav-enemy-method-174 self) (logtest? (enemy-flag ef42) (-> self enemy-flags))) + (go-stare2 self) + ) + ) + ) + ) + ) + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info walk-anim))) + ) + (let ((v1-8 (ja-group))) + (if (not (and v1-8 (= v1-8 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef37) (-> a0-0 enemy-flags)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((f30-0 16384.0)) + (if (logtest? (enemy-flag ef41) (-> self enemy-flags)) + (set! f30-0 (- f30-0)) + ) + (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-! gp-0 (-> self root trans) s5-0) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 (-> self desired-angle)) + (vector+! s5-0 s5-0 gp-0) + (vector-rotate-around-y! gp-0 gp-0 f30-0) + ) + (vector-normalize! gp-0 16384.0) + (vector+! s5-0 s5-0 gp-0) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (closest-point-on-mesh (-> self nav) gp-1 s5-0 (the-as nav-poly #f)) + (if (< (vector-vector-xz-distance gp-1 (-> self root trans)) 409.6) + (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef42) (-> self enemy-flags)))) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef42)))) + ) + (let ((v1-28 (-> self nav state))) + (logclear! (-> v1-28 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-28 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-28 target-pos quad) (-> gp-1 quad)) + ) + ) + ) + 0 + ) + ) + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate flee (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy flee) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + (let ((v1-6 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags))) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags)))) + ) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags)))) + (set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info)) + ) + 0 + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + (nav-enemy-method-173 self) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (let ((v1-3 (-> self focus aware))) + (if (!= v1-3 (enemy-aware ea4)) + (go-stare self) + ) + ) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info run-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post nav-enemy-flee-post + ) + +;; failed to figure out what this is: +(defstate victory (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy victory) 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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + (vector-reset! (-> self root transv)) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate hit (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy hit) 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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + ) + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-39 enemy-flag) (v1-41 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (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 vulnerable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag vulnerable))) + (set! v1-37 (logclear v1-36 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? v1-38 (enemy-flag attackable-backup)) + (set! v1-39 (logior v1-38 (enemy-flag attackable))) + (set! v1-39 (logclear v1-38 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (let ((v1-40 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-40) + (set! v1-41 (logior (enemy-flag trackable) v1-40)) + (set! v1-41 (logclear v1-40 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-41) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-hostile self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate knocked (nav-enemy) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy knocked) 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 ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-9 self)) + (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-9 enemy-flags)))) + ) + 0 + ) + :post nav-enemy-falling-post + ) + +;; failed to figure out what this is: +(defstate die (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy die) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate die-falling (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + :post nav-enemy-die-falling-post + ) + +;; definition for method 91 of type nav-enemy +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs object. +(defmethod enemy-method-91 ((this nav-enemy) (arg0 enemy-jump-info)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x100068) + ) + ) + +;; definition for method 101 of type nav-enemy +;; WARN: Return type mismatch quaternion vs none. +(defmethod enemy-method-101 ((this nav-enemy) (arg0 int) (arg1 enemy-jump-info)) + (let ((v1-0 arg0)) + (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) + (let ((a1-4 this)) + (if (logtest? (enemy-flag ef38) (-> a1-4 enemy-flags)) + (seek-to-point-toward-point! (-> this root) (-> arg1 dest-pos) (-> this nav max-rotation-rate) (seconds 0.02)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate jump (nav-enemy) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy jump) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (logclear! (-> self nav state flags) (nav-state-flag at-gap)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 (-> self nav))) + (logclear! (-> v1-4 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'enemy-jump-info))) + (let ((s5-0 0)) + (init-jump-info! self gp-0) + (if (and (-> self enemy-info use-jump-blocked) + (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) + (enemy-method-91 self gp-0) + ) + (go-virtual jump-blocked) + ) + (let* ((v1-13 (-> self nav)) + (a1-2 (-> gp-0 dest-pos)) + (f0-0 (-> v1-13 extra-nav-sphere w)) + ) + (set! (-> v1-13 extra-nav-sphere quad) (-> a1-2 quad)) + (set! (-> v1-13 extra-nav-sphere w) f0-0) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 extra-nav-sphere w) (-> self nav-radius-backup)) + ) + 0 + (let ((v1-18 (-> self nav))) + (logior! (-> v1-18 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (when (logtest? (-> gp-0 flags) (enemy-jump-flags ejf0)) + (until #f + (if (jump-anim-handler self s5-0 gp-0) + (goto cfg-12) + ) + (in-jump-handler self s5-0 gp-0) + (enemy-method-101 self s5-0 gp-0) + (suspend) + (set! s5-0 1) + ) + #f + ) + ) + (label cfg-12) + (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) + (let ((s5-1 2)) + (logior! (-> self focus-status) (focus-status in-air)) + (until (on-ground? self) + (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) + (jump-anim-handler self s5-1 gp-0) + (in-jump-handler self s5-1 gp-0) + (enemy-method-101 self s5-1 gp-0) + (suspend) + (set! s5-1 3) + ) + ) + (logclear! (-> self focus-status) (focus-status in-air)) + (let ((v1-51 (-> self nav))) + (logclear! (-> v1-51 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (let ((v1-55 (-> self nav state))) + (set! (-> v1-55 current-poly) (the-as nav-poly #f)) + ) + 0 + (logclear! (-> self nav state flags) (nav-state-flag at-target)) + (move-to-gspot! self) + (let ((s5-2 4)) + (until #f + (if (jump-anim-handler self s5-2 gp-0) + (goto cfg-19) + ) + (in-jump-handler self s5-2 gp-0) + (enemy-method-101 self s5-2 gp-0) + (suspend) + (set! s5-2 5) + ) + ) + #f + (label cfg-19) + (if (logtest? (enemy-flag directed) (-> self enemy-flags)) + ((lambda :behavior nav-enemy + ((arg0 enemy-jump-info)) + (send-event (ppointer->process (-> self parent)) 'child-jumped) + (none) + ) + gp-0 + ) + ) + ) + (go-directed2 self) + ) + :post (behavior () + (let ((a0-0 self)) + (cond + ((logtest? (enemy-flag ef37) (-> a0-0 enemy-flags)) + (nav-enemy-method-187 self) + ) + (else + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options)) + (set! (-> a1-2 collide-with-filter) (-> self enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-2) + ) + (nav-enemy-simple-post) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate jump-blocked (nav-enemy) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type enemy jump-blocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-4 enemy-flags)))) + ) + 0 + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-6 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate directed (nav-enemy) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag directed-ready)) + ((-> (method-of-type nav-enemy idle) enter)) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +;; failed to figure out what this is: +(defstate view-anims (nav-enemy) + :virtual #t + :enter (behavior () + (when (-> self nav) + (let ((v1-1 self)) + (set! (-> v1-1 enemy-flags) (the-as enemy-flag (logclear (-> v1-1 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-3 nav callback-info) *null-nav-callback-info*) + ) + 0 + ) + ) + ) + +;; failed to figure out what this is: +(defstate debug-control (nav-enemy) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((v1-0 *nav-enemy-debug-control-info*)) + (set! (-> v1-0 steering) 0.0) + (set! (-> v1-0 throttle) 0.0) + ) + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-debug-control-post + ) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-engine_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-engine_REF.gc new file mode 100644 index 0000000000..206e41155f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/nav/nav-engine_REF.gc @@ -0,0 +1,619 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type nav-engine-spr-buffer +(deftype nav-engine-spr-buffer (structure) + ((mem-addr (pointer nav-mesh)) + (mem-nav uint32 :overlay-at mem-addr) + (spr-addr (inline-array nav-control)) + (spr-nav uint32 :overlay-at spr-addr) + (q-size uint32) + (i-nav uint8) + (done int8) + (nav-count int8) + (i-pass int8) + ) + :pack-me + ) + +;; definition for method 3 of type nav-engine-spr-buffer +(defmethod inspect ((this nav-engine-spr-buffer)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nav-engine-spr-buffer) + (format #t "~1Tmem-addr: ~D~%" (-> this mem-addr)) + (format #t "~1Tmem-nav: #x~X~%" (-> this mem-addr)) + (format #t "~1Tspr-addr: ~D~%" (-> this spr-addr)) + (format #t "~1Tspr-nav: #x~X~%" (-> this spr-addr)) + (format #t "~1Tq-size: ~D~%" (-> this q-size)) + (format #t "~1Ti-nav: ~D~%" (-> this i-nav)) + (format #t "~1Tdone: ~D~%" (-> this done)) + (format #t "~1Tnav-count: ~D~%" (-> this nav-count)) + (format #t "~1Ti-pass: ~D~%" (-> this i-pass)) + (label cfg-4) + this + ) + +;; definition of type nav-engine +(deftype nav-engine (structure) + ((spr-addr uint32) + (nav-work-addr uint32) + (nav-mesh-addr nav-mesh) + (poly-array-addr uint32) + (hash-sphere-addr uint32) + (hash-buckets-addr uint32) + (buf-nav-control-count int8) + (max-pass-count int8) + (output-sphere-hash uint8) + (work-buf-array nav-engine-spr-buffer 3 :inline) + (spr-work nav-mesh-work :overlay-at nav-work-addr) + (mem-work nav-mesh-work) + (spr-mesh nav-mesh :overlay-at nav-mesh-addr) + (mem-mesh nav-mesh) + (spr-poly-array uint32 :overlay-at poly-array-addr) + (mem-poly-array (inline-array nav-poly)) + (hash-sphere-list uint32 :overlay-at hash-sphere-addr) + (hash-buckets uint32 :overlay-at hash-buckets-addr) + (to-spr-wait uint32) + (from-spr-wait uint32) + ) + (:methods + (inc-spr-addr! (_type_ uint) uint) + (lay-out-spad-memory (_type_ nav-mesh) none) + (set-up-mem-work (_type_) none) + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none) + (add-all-spheres (_type_) none) + (do-sphere-lookups (_type_) none) + (update-nav-controls-pipelined-in-spr (_type_) none) + (update-nav-controls-in-spr (_type_) none) + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none) + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none) + (do-callbacks (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none) + ) + ) + +;; definition for method 3 of type nav-engine +(defmethod inspect ((this nav-engine)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nav-engine) + (format #t "~1Tspr-addr: ~D~%" (-> this spr-addr)) + (format #t "~1Tnav-work-addr: ~D~%" (-> this nav-work-addr)) + (format #t "~1Tnav-mesh-addr: ~D~%" (-> this nav-mesh-addr)) + (format #t "~1Tpoly-array-addr: ~D~%" (-> this poly-array-addr)) + (format #t "~1Thash-sphere-addr: ~D~%" (-> this hash-sphere-addr)) + (format #t "~1Thash-buckets-addr: ~D~%" (-> this hash-buckets-addr)) + (format #t "~1Tbuf-nav-control-count: ~D~%" (-> this buf-nav-control-count)) + (format #t "~1Tmax-pass-count: ~D~%" (-> this max-pass-count)) + (format #t "~1Toutput-sphere-hash: ~D~%" (-> this output-sphere-hash)) + (format #t "~1Twork-buf-array[3] @ #x~X~%" (-> this work-buf-array)) + (format #t "~1Tspr-work: #~%" (-> this nav-work-addr)) + (format #t "~1Tmem-work: #~%" (-> this mem-work)) + (format #t "~1Tspr-mesh: ~A~%" (-> this nav-mesh-addr)) + (format #t "~1Tmem-mesh: ~A~%" (-> this mem-mesh)) + (format #t "~1Tspr-poly-array: #x~X~%" (-> this poly-array-addr)) + (format #t "~1Tmem-poly-array: #x~X~%" (-> this mem-poly-array)) + (format #t "~1Thash-sphere-list: #x~X~%" (-> this hash-sphere-addr)) + (format #t "~1Thash-buckets: #x~X~%" (-> this hash-buckets-addr)) + (format #t "~1Tto-spr-wait: ~D~%" (-> this to-spr-wait)) + (format #t "~1Tfrom-spr-wait: ~D~%" (-> this from-spr-wait)) + (label cfg-4) + this + ) + +;; definition for method 9 of type nav-engine +(defmethod inc-spr-addr! ((this nav-engine) (arg0 uint)) + (let ((v0-0 (-> this spr-addr))) + (+! (-> this spr-addr) arg0) + v0-0 + ) + ) + +;; definition for method 10 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod lay-out-spad-memory ((this nav-engine) (arg0 nav-mesh)) + (let ((s5-0 0)) + (set! (-> this spr-addr) (the-as uint #x70000060)) + (let* ((v1-1 this) + (a1-1 320) + (a0-1 (-> v1-1 spr-addr)) + ) + (+! (-> v1-1 spr-addr) a1-1) + (set! (-> this nav-work-addr) a0-1) + ) + (let* ((v1-2 this) + (a1-3 112) + (a0-2 (-> v1-2 spr-addr)) + ) + (+! (-> v1-2 spr-addr) a1-3) + (set! (-> this nav-mesh-addr) (the-as nav-mesh a0-2)) + ) + (if (and (= (-> arg0 work polys-in-scratch) 1) (< (-> arg0 poly-count) (the-as uint 64))) + (set! s5-0 (the-as int (-> arg0 poly-count))) + ) + (let* ((v1-10 this) + (a1-5 (* s5-0 64)) + (a0-4 (-> v1-10 spr-addr)) + ) + (+! (-> v1-10 spr-addr) a1-5) + (set! (-> this poly-array-addr) a0-4) + ) + (let* ((v1-11 this) + (a1-7 (* (-> arg0 sphere-hash max-object-count) 16)) + (a0-7 (-> v1-11 spr-addr)) + ) + (+! (-> v1-11 spr-addr) a1-7) + (set! (-> this hash-sphere-addr) a0-7) + ) + (let* ((v1-12 this) + (a1-9 0) + (a0-8 (-> v1-12 spr-addr)) + ) + (+! (-> v1-12 spr-addr) a1-9) + (set! (-> this hash-buckets-addr) a0-8) + ) + (set! (-> this buf-nav-control-count) 7) + (dotimes (v1-14 3) + (let ((a0-11 (-> this work-buf-array v1-14))) + (let* ((a1-11 this) + (a3-0 2048) + (a2-5 (-> a1-11 spr-addr)) + ) + (+! (-> a1-11 spr-addr) a3-0) + (set! (-> a0-11 spr-addr) (the-as (inline-array nav-control) a2-5)) + ) + (set! (-> a0-11 mem-addr) (the-as (pointer nav-mesh) 0)) + (set! (-> a0-11 q-size) (the-as uint 0)) + (set! (-> a0-11 nav-count) 0) + (set! (-> a0-11 i-pass) -1) + ) + ) + (set! (-> this output-sphere-hash) (the-as uint 0)) + (set! (-> this mem-mesh) arg0) + (cond + ((= (-> arg0 work mesh-struct-in-scratch) 1) + (set! (-> this nav-mesh-addr) (the-as nav-mesh (&-> (-> this nav-mesh-addr) poly-array))) + (mem-copy! (&-> (-> this nav-mesh-addr) type) (&-> arg0 type) 112) + ) + (else + (set! (-> this nav-mesh-addr) arg0) + ) + ) + (set! (-> this mem-work) (-> arg0 work)) + (if (= (-> arg0 work work-struct-in-scratch) 1) + (quad-copy! (the-as pointer (-> this nav-work-addr)) (the-as pointer (-> this mem-work)) 20) + (set! (-> this nav-work-addr) (the-as uint (-> arg0 work))) + ) + (set! (-> this nav-mesh-addr work) (the-as nav-mesh-work (-> this nav-work-addr))) + (set! (-> this mem-poly-array) (-> arg0 poly-array)) + (when (> s5-0 0) + (quad-copy! (the-as pointer (-> this poly-array-addr)) (the-as pointer (-> this mem-poly-array)) (* s5-0 4)) + (set! (-> this nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> this poly-array-addr))) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod set-up-mem-work ((this nav-engine)) + (let ((v1-0 (-> this mem-mesh))) + (set! (-> v1-0 poly-array) (-> this mem-poly-array)) + (set! (-> v1-0 work) (-> this mem-work)) + ) + 0 + (none) + ) + +;; definition for method 12 of type nav-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-spheres-from-mesh-user-list ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) + (countdown (s3-0 (-> arg1 static-sphere-count)) + (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) + ) + (let* ((s4-1 (-> arg1 user-list)) + (v1-6 (-> s4-1 alive-list next0)) + (s3-1 (-> (the-as connection v1-6) next0)) + ) + (while (!= v1-6 (-> s4-1 alive-list-end)) + (let ((a0-4 (-> (the-as connection v1-6) param1)) + (s2-0 (the-as object (-> (the-as connection v1-6) param3))) + ) + (cond + ((-> (the-as connection v1-6) param2) + (let ((s1-0 (-> (the-as process-focusable a0-4) nav))) + (set! (-> s1-0 sec-per-frame) (-> (the-as process-focusable a0-4) clock seconds-per-frame)) + (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) + (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) + (set! (-> this output-sphere-hash) (the-as uint 1)) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (set! (-> s1-0 root-sphere-id) + (the-as uint (add-a-sphere-with-flag + arg0 + (-> s1-0 root-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-extra-sphere)) + (add-a-sphere-with-flag + arg0 + (-> s1-0 extra-nav-sphere) + (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)) + ) + ) + ) + ) + (else + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (set! (-> a1-5 quad) (-> (the-as collide-shape s2-0) trans quad)) + (set! (-> a1-5 w) (-> (the-as collide-shape s2-0) nav-radius)) + (add-a-sphere-with-flag arg0 a1-5 (the-as int (-> (the-as collide-shape s2-0) backup-collide-as))) + ) + ) + ) + ) + (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-child-spheres)) + (let ((s2-1 (-> (the-as collide-shape s2-0) root-prim)) + (s1-1 1) + ) + (when (zero? (-> s2-1 prim-core prim-type)) + (let ((v1-35 s2-1)) + (set! s2-1 (-> (the-as collide-shape-prim-group v1-35) child 0)) + (set! s1-1 (the-as int (-> v1-35 specific 0))) + ) + ) + (while (nonzero? s1-1) + (+! s1-1 -1) + (when (and (logtest? (collide-action nav-sphere) (-> s2-1 prim-core action)) (= (-> s2-1 prim-core prim-type) -1)) + (let ((a1-6 (new 'stack-no-clear 'vector))) + (set! (-> a1-6 quad) (-> s2-1 prim-core world-sphere quad)) + (set! (-> a1-6 w) (-> (the-as collide-shape-prim-sphere s2-1) nav-radius)) + (add-a-sphere-with-flag arg0 a1-6 (the-as int (-> s2-1 prim-core collide-as))) + ) + ) + (&+! s2-1 80) + ) + ) + ) + ) + (set! v1-6 s3-1) + (set! s3-1 (-> s3-1 next0)) + ) + ) + 0 + (none) + ) + +;; definition for method 13 of type nav-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-all-spheres ((this nav-engine)) + (let ((s4-0 (-> this nav-mesh-addr)) + (gp-0 (-> this nav-mesh-addr sphere-hash)) + ) + (clear-objects! gp-0) + (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> this hash-buckets-addr))) + (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> this hash-sphere-addr))) + (when *target* + (let ((a1-0 (new 'stack-no-clear 'vector))) + (let ((v1-8 (-> *target* control))) + (set! (-> a1-0 quad) (-> v1-8 trans quad)) + (set! (-> a1-0 w) (-> v1-8 nav-radius)) + ) + (add-a-sphere-with-flag gp-0 a1-0 2) + ) + ) + (add-spheres-from-mesh-user-list this gp-0 s4-0) + (let ((s3-0 (the-as nav-mesh (-> s4-0 next-nav-mesh)))) + (while (and s3-0 (nonzero? s3-0)) + (add-spheres-from-mesh-user-list this gp-0 s3-0) + (set! s3-0 (the-as nav-mesh (-> s3-0 next-nav-mesh))) + ) + ) + (let ((s4-1 (the-as nav-mesh (-> s4-0 prev-nav-mesh)))) + (while (and s4-1 (nonzero? s4-1)) + (add-spheres-from-mesh-user-list this gp-0 s4-1) + (set! s4-1 (the-as nav-mesh (-> s4-1 prev-nav-mesh))) + ) + ) + (update-from-spheres gp-0) + ) + 0 + (none) + ) + +;; definition for method 14 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod do-sphere-lookups ((this nav-engine)) + (let ((s5-0 (-> this nav-mesh-addr))) + (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) + (let ((a0-3 (-> s5-0 nav-control-array s4-0))) + (when (-> a0-3 process) + (set! (-> a0-3 sphere-count) 0) + (set! (-> a0-3 state mesh) (-> this nav-mesh-addr)) + (set! (-> this mem-work nav) (the-as basic a0-3)) + (find-sphere-ids-from-sphere-hash a0-3 #f) + (set! (-> this mem-work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function nav-dma-send-to-spr-no-flush +;; INFO: function output is handled by mips2c +(def-mips2c nav-dma-send-to-spr-no-flush (function pointer pointer int none)) + +;; definition for function nav-dma-send-from-spr-no-flush +;; INFO: function output is handled by mips2c +(def-mips2c nav-dma-send-from-spr-no-flush (function pointer pointer int none)) + +;; definition for function inc-mod3 +(defun inc-mod3 ((arg0 int)) + (local-vars (v0-1 int) (v1-1 int)) + (let ((v0-0 (+ arg0 1))) + (let ((v1-0 2)) + (set-on-less-than v1-1 v1-0 v0-0) + ) + (move-if-not-zero v0-1 0 v1-1 v0-0) + ) + v0-1 + ) + +;; definition for function nav-state-patch-pointers +;; INFO: function output is handled by mips2c +(def-mips2c nav-state-patch-pointers (function nav-state int none)) + +;; definition for method 17 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 17 nav-engine)" 17 nav-engine) + +;; definition for method 18 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 18 nav-engine)" 18 nav-engine) + +;; definition for method 19 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod do-callbacks ((this nav-engine) (arg0 nav-engine-spr-buffer)) + (local-vars (sv-16 nav-callback-info)) + (with-pp + (dotimes (s4-0 (-> arg0 nav-count)) + (let* ((a1-1 (-> arg0 spr-addr s4-0)) + (a0-3 (-> a1-1 process)) + ) + (set! sv-16 (-> a1-1 callback-info)) + (when a0-3 + (set! (-> a1-1 state nav) a1-1) + (when (and (logtest? (-> a1-1 flags) (nav-control-flag kernel-run)) sv-16) + (let ((s3-0 pp)) + (set! pp a0-3) + (set! (-> this mem-mesh work nav) (the-as basic a1-1)) + (let ((v1-10 (-> sv-16 callback-count))) + (set! (-> this max-pass-count) (max (-> this max-pass-count) v1-10)) + (if (< (-> arg0 i-pass) v1-10) + ((-> sv-16 callback-array (-> arg0 i-pass)) a0-3 a1-1) + ) + ) + (set! pp s3-0) + ) + (set! (-> this mem-mesh work nav) #f) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 20 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 20 nav-engine)" 20 nav-engine) + +;; definition for method 21 of type nav-engine +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 21 nav-engine)" 21 nav-engine) + +;; definition for method 15 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-controls-pipelined-in-spr ((this nav-engine)) + (local-vars + (v1-33 int) + (v1-45 int) + (v1-66 int) + (a0-14 int) + (a0-19 int) + (a0-26 int) + (sv-16 symbol) + (sv-24 int) + (sv-32 int) + (sv-40 uint) + (sv-44 (inline-array nav-control)) + (sv-48 nav-engine-spr-buffer) + ) + (flush-cache 0) + (set! (-> this max-pass-count) 3) + (set! sv-16 (the-as symbol #f)) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 (-> this nav-mesh-addr nav-control-count)) + (set! sv-44 (-> this nav-mesh-addr nav-control-array)) + (let ((s5-0 2) + (s3-0 1) + (s4-0 0) + ) + (while (not sv-16) + (let ((s2-0 (-> this work-buf-array s5-0))) + (set! (-> s2-0 i-nav) (the-as uint sv-32)) + (set! (-> s2-0 nav-count) (min (-> this buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) + (set! (-> s2-0 i-pass) sv-24) + (set! (-> s2-0 mem-addr) (the-as (pointer nav-mesh) (-> sv-44 sv-32))) + (set! (-> s2-0 q-size) (the-as uint (* 18 (-> s2-0 nav-count)))) + (set! (-> s2-0 done) 0) + (when (>= sv-24 (-> this max-pass-count)) + (set! (-> s2-0 nav-count) 0) + 0 + ) + (if (> (-> s2-0 nav-count) 0) + (upload-nav-to-spr this s2-0) + (dma-sync (the-as pointer #x1000d400) 0 0) + ) + (set! sv-32 (+ sv-32 (-> s2-0 nav-count))) + (when (>= sv-32 (the-as int sv-40)) + (set! sv-32 0) + (set! sv-24 (+ sv-24 1)) + (if (= sv-24 (-> this max-pass-count)) + (set! (-> s2-0 done) 1) + ) + ) + ) + (let ((v1-32 (+ s5-0 1))) + (let ((a0-13 2)) + (set-on-less-than a0-14 a0-13 v1-32) + ) + (move-if-not-zero v1-33 0 a0-14 v1-32) + ) + (set! s5-0 v1-33) + (let ((s2-1 (-> this work-buf-array s4-0))) + (when (> (-> s2-1 nav-count) 0) + (download-nav-from-spr this s2-1) + (when (= (-> s2-1 done) 1) + (dma-sync (the-as pointer #x1000d000) 0 0) + (set! sv-16 #t) + ) + ) + ) + (let ((v1-44 (+ s4-0 1))) + (let ((a0-18 2)) + (set-on-less-than a0-19 a0-18 v1-44) + ) + (move-if-not-zero v1-45 0 a0-19 v1-44) + ) + (set! s4-0 v1-45) + (set! sv-48 (-> this work-buf-array s3-0)) + (when (> (-> sv-48 nav-count) 0) + (if (zero? (-> sv-48 i-pass)) + (reloc-ptrs-to-spad this sv-48) + ) + (do-callbacks this sv-48) + (if (= (-> sv-48 i-pass) (+ (-> this max-pass-count) -1)) + (reloc-ptrs-to-mem this sv-48) + ) + ) + (let ((v1-65 (+ s3-0 1))) + (let ((a0-25 2)) + (set-on-less-than a0-26 a0-25 v1-65) + ) + (move-if-not-zero v1-66 0 a0-26 v1-65) + ) + (set! s3-0 v1-66) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type nav-engine +;; WARN: Return type mismatch int vs none. +(defmethod update-nav-controls-in-spr ((this nav-engine)) + (flush-cache 0) + (set! (-> this max-pass-count) 1) + (let ((gp-0 (-> this work-buf-array))) + (set! (-> gp-0 0 i-nav) (the-as uint 0)) + (set! (-> gp-0 0 nav-count) (the-as int (-> this nav-mesh-addr nav-control-count))) + (set! (-> gp-0 0 i-pass) 0) + (set! (-> gp-0 0 mem-addr) (the-as (pointer nav-mesh) (-> this nav-mesh-addr nav-control-array))) + (set! (-> gp-0 0 q-size) (the-as uint (* 18 (-> gp-0 0 nav-count)))) + (set! (-> gp-0 0 done) 0) + (when (> (-> gp-0 0 nav-count) 0) + (upload-nav-to-spr this (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d400) 0 0) + (reloc-ptrs-to-spad this (the-as nav-engine-spr-buffer gp-0)) + (while (< (-> gp-0 0 i-pass) (-> this max-pass-count)) + (do-callbacks this (the-as nav-engine-spr-buffer gp-0)) + (+! (-> gp-0 0 i-pass) 1) + ) + (reloc-ptrs-to-mem this (the-as nav-engine-spr-buffer gp-0)) + (dotimes (s4-0 (-> gp-0 0 nav-count)) + (let ((a2-1 (-> gp-0 0 spr-addr s4-0 state mesh))) + (when (>= (the-as uint a2-1) (the-as uint #x70000000)) + (format 0 "nav-engine::update-nav-controls-in-spr: (pre-dma) bad mesh pointer found (#x0~x)~%" a2-1) + (break!) + 0 + ) + ) + ) + (download-nav-from-spr this (the-as nav-engine-spr-buffer gp-0)) + (dma-sync (the-as pointer #x1000d000) 0 0) + (dotimes (s5-1 (-> gp-0 0 nav-count)) + (let ((a2-3 (-> (&+ (-> gp-0 0 mem-addr) (* 288 s5-1)) 31))) + (when (>= (the-as uint a2-3) (the-as uint #x70000000)) + (format 0 "nav-engine::update-nav-controls-in-spr: (post-dma) bad mesh pointer found (#x0~x)~%" a2-3) + (break!) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod update-navigation ((this nav-mesh)) + (local-vars (sp-0 int)) + (when (zero? (-> this next-nav-mesh)) + (set! (-> this next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'next-actor 0))) + (set! (-> this prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'prev-actor 0))) + ) + (when (> (-> this nav-control-count) 0) + (the-as none sp-0) + (set! sp-0 #x70003fc0) + (set! (-> this work mesh) this) + (let ((s4-0 (the-as nav-engine #x70000000))) + (lay-out-spad-memory s4-0 this) + (add-all-spheres s4-0) + (do-sphere-lookups s4-0) + (when (nonzero? (-> s4-0 output-sphere-hash)) + (let ((s3-0 (-> s4-0 nav-mesh-addr sphere-hash))) + (quad-copy! (-> s3-0 mem-bucket-array) (-> s3-0 bucket-array) (/ (-> s3-0 bucket-memory-size) 16)) + (quad-copy! + (the-as pointer (-> s3-0 mem-sphere-array)) + (the-as pointer (-> s3-0 sphere-array)) + (-> s3-0 object-count) + ) + (set! (-> s3-0 bucket-array) (-> s3-0 mem-bucket-array)) + (set! (-> s3-0 sphere-array) (the-as (inline-array sphere) (-> s3-0 mem-sphere-array))) + ) + ) + (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> this nav-control-count)) + (update-nav-controls-pipelined-in-spr s4-0) + (update-nav-controls-in-spr s4-0) + ) + (set-up-mem-work s4-0) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc index 3a0f8627e1..2d71394df0 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc @@ -382,47 +382,47 @@ Based on the implementation of point-poly-intersection?, these should likely be (pad2 uint32 7) ) (:methods - (nav-mesh-method-9 () none) - (nav-mesh-method-10 () none) - (nav-mesh-method-11 () none) - (nav-mesh-method-12 () none) - (nav-mesh-method-13 () none) - (nav-mesh-method-14 () none) - (nav-mesh-method-15 () none) - (nav-mesh-method-16 () none) - (nav-mesh-method-17 () none) + (debug-draw (_type_) none) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly) + (nav-mesh-method-11 (_type_ vector) none) + (nav-mesh-method-12 (_type_ vector float nav-poly) symbol) + (poly-centroid (_type_ nav-poly vector) vector) + (poly-centroid-local (_type_ nav-poly vector) vector) + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly) + (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex)) + (initialize-mesh! (_type_) none) (advance-ray-to-nearest-poly-edge-or-dest! (_type_ nav-ray) none) - (nav-mesh-method-19 () none) - (nav-mesh-method-20 () none) - (nav-mesh-method-21 () none) - (nav-mesh-method-22 () none) - (nav-mesh-method-23 () none) + (try-move-along-ray (_type_ nav-poly vector vector float) meters) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none) + (find-adjacent-bounds-one (_type_ vector nav-poly int int) none) (compute-bounding-box-from-vertices (_type_ vector vector) none) - (nav-mesh-method-25 () none) - (nav-mesh-method-26 () none) - (nav-mesh-method-27 () none) - (nav-mesh-method-28 () none) - (nav-mesh-method-29 () none) - (nav-mesh-method-30 () none) - (nav-mesh-method-31 () none) - (nav-mesh-method-32 () none) - (nav-mesh-method-33 () none) - (nav-mesh-method-34 () none) - (nav-mesh-method-35 () none) - (nav-mesh-method-36 () none) - (nav-mesh-method-37 () none) - (nav-mesh-method-38 () none) - (nav-mesh-method-39 () none) + (init-from-entity (_type_ entity-nav-mesh) none) + (handle-birth (_type_) none) + (handle-kill (_type_) none) + (update-navigation (_type_) none) + (new-nav-control (_type_) nav-control) + (remove-nav-control (_type_ nav-control) none) + (add-process-drawable-to-nav-mesh (_type_ process-drawable symbol) none) + (remove-process-drawable (_type_ process-drawable) none) + (change-to (_type_ process-drawable) none) + (link-by-id (_type_ uint) symbol) + (unlink-by-id (_type_ uint) symbol) + (nav-mesh-method-36 (_type_ vector vector float) float) + (nav-mesh-method-37 (_type_ vector vector float) float) + (nav-mesh-method-38 (_type_ nav-poly) none) + (debug-draw-poly (_type_ nav-poly rgba) none) (point-in-poly? (_type_ nav-poly vector) symbol) - (nav-mesh-method-41 () none) + (nav-mesh-method-41 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector) (closest-point-on-boundary (_type_ nav-poly vector vector) vector) - (nav-mesh-method-43 () none) + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none) (project-point-into-poly-2d (_type_ nav-poly vector vector) vector) - (nav-mesh-method-45 () none) - (nav-mesh-method-46 () none) - (nav-mesh-method-47 () none) - (nav-mesh-method-48 () none) - (nav-mesh-method-49 () none) + (nav-mesh-method-45 (_type_ nav-poly) nav-poly) + (nav-mesh-method-46 (_type_ nav-poly) nav-poly) + (is-in-mesh-local? (_type_ vector float float) symbol) + (link-to-other-mesh (_type_ nav-mesh-link) symbol) + (unlink-mesh (_type_ nav-mesh-link) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc new file mode 100644 index 0000000000..a2e54acd65 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc @@ -0,0 +1,2249 @@ +;;-*-Lisp-*- +(in-package goal) + +(rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf)) +(init-vf0-vector) + +;; definition for symbol *debug-nav-control-output*, type symbol +(define *debug-nav-control-output* #f) + +;; definition for symbol *debug-nav-control*, type symbol +(define *debug-nav-control* #f) + +;; definition for symbol *debug-nav-mesh-output*, type symbol +(define *debug-nav-mesh-output* #f) + +;; definition for symbol *debug-nav-ray*, type nav-ray +(define *debug-nav-ray* (the-as nav-ray #f)) + +;; definition for symbol *debug-ray-offset*, type vector +(define *debug-ray-offset* (new 'static 'vector)) + +;; definition for symbol *debug-offset*, type vector +(define *debug-offset* (new 'static 'vector :y 4096.0 :w 1.0)) + +;; definition for symbol *nav-mesh-work*, type nav-mesh-work +(define *nav-mesh-work* (new 'static 'nav-mesh-work + :vert0-table (new 'static 'array int8 4 0 1 2 3) + :vert1-table (new 'static 'array int8 4 1 2 3 0) + :edge-mask-table (new 'static 'array uint8 3 #x1 #x2 #x4) + :deg-to-rad 0.000095873795 + :rad-to-deg 10430.379 + :nav-poly-min-dist 204.8 + :nav-poly-epsilon 40.96 + :debug (new 'static 'nav-mesh-work-debug) + :work-struct-in-scratch 1 + :mesh-struct-in-scratch 1 + :polys-in-scratch 1 + ) + ) + +;; definition for symbol *default-nav-mesh*, type nav-mesh +(define *default-nav-mesh* (new 'static 'nav-mesh + :poly-array (new 'static 'inline-array nav-poly 1 + (new 'static 'nav-poly + :vertex (new 'static 'inline-array vector 4 + (new 'static 'vector :w -175458100000000000000000000000000000000.0) + (new 'static 'vector :w (the-as float #xffffffff)) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + ) + :poly-count #x1 + :max-nav-control-count #x80 + :nav-control-array (new 'static 'inline-array nav-control 128 + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + (new 'static 'nav-control) + ) + ) + ) + +;; failed to figure out what this is: +(kmemopen global "nav-mesh") + +;; failed to figure out what this is: +(let ((gp-0 *default-nav-mesh*)) + (set! (-> gp-0 work) *nav-mesh-work*) + (if (zero? (-> gp-0 user-list)) + (set! (-> gp-0 user-list) (new 'global 'engine 'nav-engine 128 connection)) + ) + (when (zero? (-> gp-0 poly-hash)) + (set! (-> gp-0 poly-hash) (new 'global 'grid-hash 16)) + (let ((v1-12 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (vector-reset! (-> v1-12 0)) + (vector-reset! (-> v1-12 1)) + (let ((a1-3 (-> v1-12 0))) + (let ((a0-5 (-> v1-12 0))) + (let ((a2-3 -4096.0)) + (.mov vf6 a2-3) + ) + (.lvf vf4 (&-> a0-5 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-3 quad) vf5) + ) + (let ((a1-4 (-> v1-12 1))) + (let ((a0-6 (-> v1-12 1))) + (let ((a2-5 4096.0)) + (.mov vf6 a2-5) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a1-4 quad) vf5) + ) + (update-grid-for-objects-in-box + (-> gp-0 poly-hash) + (the-as int (-> gp-0 poly-count)) + (-> v1-12 0) + (-> v1-12 1) + ) + ) + ) + ) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function nav-mesh-connect-from-ent +(defun nav-mesh-connect-from-ent ((arg0 process-drawable)) + (let ((s5-0 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0))) + (cond + (s5-0 + (if (zero? (-> s5-0 user-list)) + (format 0 "nav-mesh-connect-from-ent: nav mesh not initialized!~%") + ) + (if (add-connection (-> s5-0 user-list) arg0 nothing arg0 #f (-> arg0 root)) + #t + ) + ) + (else + (if (-> arg0 entity) + (logior! (-> arg0 entity extra perm status) (entity-perm-status error)) + ) + #f + ) + ) + ) + ) + +;; definition (debug) for function connection-validate +;; WARN: Return type mismatch int vs none. +(defun-debug connection-validate ((arg0 connection)) + (when (zero? arg0) + (break!) + 0 + ) + (when (zero? (-> arg0 next1)) + (break!) + 0 + ) + (when (zero? (-> arg0 prev1)) + (break!) + 0 + ) + (when (-> arg0 next1) + (when (!= arg0 (-> arg0 next1 prev1)) + (break!) + 0 + ) + ) + (when (-> arg0 prev1) + (when (!= arg0 (-> arg0 prev1 next1)) + (break!) + 0 + ) + ) + 0 + (none) + ) + +;; definition (debug) for function connection-list-validate +(defun-debug connection-list-validate ((arg0 (inline-array connection))) + (let ((gp-0 (the-as object (&-> arg0 3 prev1)))) + (while gp-0 + (connection-validate (the-as connection gp-0)) + (set! gp-0 (-> (the-as connection gp-0) next1)) + ) + ) + #f + ) + +;; definition (debug) for function nav-control-validate +;; WARN: Return type mismatch int vs none. +(defun-debug nav-control-validate ((arg0 process-drawable)) + (let ((s5-0 (the-as object (-> arg0 nav)))) + (when (and (-> arg0 nav) (!= arg0 (-> arg0 nav process))) + (format 0 "process pointing to wrong nav-control!~%") + (break!) + 0 + ) + (let ((s4-0 (-> arg0 nav state mesh))) + (when (or (not s4-0) (zero? s4-0)) + (format 0 "nav control has invalid mesh~%") + (break!) + 0 + ) + (let ((v1-12 (- (the-as int s5-0) (the-as uint (the-as int (-> s4-0 nav-control-array 0)))))) + (when (or (< (the-as uint v1-12) 0) + (< (the-as uint (* (the-as uint 288) (-> s4-0 nav-control-count))) (the-as uint v1-12)) + ) + (format 0 "nav control (~,,8x) is not in the mesh's nav-control-array!~%" (the-as nav-control s5-0)) + (inspect s4-0) + (break!) + 0 + ) + ) + ) + ) + (connection-list-validate (the-as (inline-array connection) arg0)) + 0 + (none) + ) + +;; definition (debug) for function debug-validate-nav-poly +;; WARN: Return type mismatch int vs none. +(defun-debug debug-validate-nav-poly ((arg0 nav-mesh-link) (arg1 nav-poly)) + (set! (-> *nav-mesh-work* poly1) (-> *nav-mesh-work* poly0)) + (set! (-> *nav-mesh-work* poly0) arg1) + (when arg1 + (let ((a2-1 arg1) + (a3-0 (+ (-> arg0 dest-mesh-id) 0)) + (t0-0 (+ (-> arg0 dest-mesh-id) (* (+ (-> arg0 src-switch-poly-id) -1) 64))) + ) + (when (or (< (the-as uint a2-1) a3-0) (< t0-0 (the-as uint a2-1))) + (format 0 "validate-nav-poly: bad poly pointer ~x range ~x ~x~%" a2-1 a3-0 t0-0) + (break!) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type entity-nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod initialize-nav-mesh! ((this entity-nav-mesh)) + "Initialize the nav-mesh in this entity." + (let ((v1-0 (-> this nav-mesh))) + (if (nonzero? v1-0) + (init-from-entity v1-0 this) + ) + ) + 0 + (none) + ) + +;; definition for method 22 of type entity-nav-mesh +(defmethod birth! ((this entity-nav-mesh)) + (let ((a0-1 (-> this nav-mesh))) + (if (nonzero? a0-1) + (handle-birth a0-1) + ) + ) + this + ) + +;; definition for method 23 of type entity-nav-mesh +(defmethod kill! ((this entity-nav-mesh)) + (if (-> this nav-mesh) + (handle-kill (-> this nav-mesh)) + ) + this + ) + +;; definition for method 28 of type entity-nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this entity-nav-mesh)) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> this nav-mesh bounds) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this nav-mesh bounds quad)) + (let ((a0-6 (new 'stack 'random-generator))) + (set! (-> a0-6 seed) (-> this aid)) + (let* ((v1-4 (rand-uint31-gen a0-6)) + (f30-0 (* 182.04445 (the float (logand v1-4 #xffff)))) + ) + (+! (-> s5-0 x) (* 4096.0 (cos f30-0))) + (+! (-> s5-0 z) (* 4096.0 (sin f30-0))) + ) + ) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + (res-lump-struct this 'name string) + s5-0 + (font-color white) + (new 'static 'vector2h :y 8) + ) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 577) + ) + (format (clear *temp-string*) "aid ~D" (-> this aid)) + (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* s5-0 (font-color white) (new 'static 'vector2h :y 16)) + ) + ) + (debug-draw (-> this nav-mesh)) + 0 + (none) + ) + +;; definition for method 31 of type entity-actor +;; INFO: Used lq/sq +(defmethod get-simple-travel-vector ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) + (local-vars (at-0 int) (at-1 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) + (cond + (gp-0 + (let ((v1-0 arg0)) + (.lvf vf1 (&-> arg2 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-0 quad) vf1) + ) + (let ((s3-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> s3-1 point) arg1 (the-as vector (-> gp-0 bounds))) + (set! (-> s3-1 y-threshold) 40960.0) + (set! (-> s3-1 ignore) (the-as uint 3)) + (let ((a2-2 (nav-mesh-method-45 gp-0 (the-as nav-poly s3-1)))) + (cond + (a2-2 + (clamp-vector-to-mesh-cross-gaps + gp-0 + (-> s3-1 point) + a2-2 + arg0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (let ((v1-7 arg0)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-1 f0-2) + ) + (.mov vf2 at-1) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-7 quad) vf1) + ) + ) + (else + (set! (-> arg0 x) (* (-> arg0 x) (- arg4))) + (set! (-> arg0 y) (* (-> arg0 y) (-> pp clock frames-per-second))) + (set! (-> arg0 z) (* (-> arg0 z) (- arg4))) + ) + ) + ) + ) + gp-0 + ) + (else + (set! (-> arg0 quad) (-> arg2 quad)) + (the-as nav-mesh #f) + ) + ) + ) + ) + ) + ) + +;; definition for method 32 of type entity-actor +;; INFO: Used lq/sq +(defmethod project-point-to-nav-mesh ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) + (local-vars (sv-16 vector)) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) + (cond + (gp-0 + (set! sv-16 arg0) + (let ((s5-1 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> s5-1 poly) arg2) + (vector-! (-> s5-1 point) arg1 (the-as vector (-> gp-0 bounds))) + (when (or (not (-> s5-1 poly)) (not (point-in-poly? gp-0 (-> s5-1 poly) (-> s5-1 point)))) + (set! (-> s5-1 y-threshold) arg3) + (set! (-> s5-1 ignore) (the-as uint 3)) + (nav-mesh-method-46 gp-0 (the-as nav-poly s5-1)) + (when (-> s5-1 poly) + (project-point-into-poly-2d gp-0 (-> s5-1 poly) sv-16 (-> s5-1 point)) + (vector+! sv-16 sv-16 (the-as vector (-> gp-0 bounds))) + ) + ) + (-> s5-1 poly) + ) + ) + (else + (set! (-> arg0 quad) (-> arg1 quad)) + (the-as nav-poly #f) + ) + ) + ) + ) + +;; definition for method 4 of type nav-mesh +;; WARN: Return type mismatch uint vs int. +(defmethod length ((this nav-mesh)) + (the-as int (-> this poly-count)) + ) + +;; definition for method 39 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) + (set! (-> gp-0 0 quad) (-> this bounds quad)) + (if (logtest? (-> arg0 pat) 15) + (+! (-> gp-0 0 y) 409.6) + ) + (let ((v1-7 (the-as int (+ (-> arg0 vertex-count) -1)))) + (dotimes (s2-0 (the-as int (-> arg0 vertex-count))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (vector+! (-> gp-0 1) (-> gp-0 0) (-> arg0 vertex s2-0)) + (vector+! (-> gp-0 2) (-> gp-0 0) (-> arg0 vertex v1-7)) + arg1 + #f + (the-as rgba -1) + ) + (set! v1-7 s2-0) + ) + ) + (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> this link-count))) + (poly-centroid this arg0 (-> gp-0 1)) + (let ((s5-1 (-> this link-array (-> arg0 link)))) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 577) + ) + (format (clear *temp-string*) "link ~D" (-> s5-1 id)) + (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* (-> gp-0 1) (font-color pink) (new 'static 'vector2h :y 8)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 29 of type nav-mesh +(defmethod new-nav-control ((this nav-mesh)) + (let ((gp-0 (the-as nav-control #f))) + (let ((v1-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a1-1 (-> this nav-control-array v1-0))) + (b! (-> a1-1 process) cfg-3 :delay (empty-form)) + (set! gp-0 a1-1) + ) + (set! (-> gp-0 process) (the-as process 0)) + (set! (-> gp-0 state mesh) this) + (b! #t cfg-8 :delay (nop!)) + (label cfg-3) + (+! v1-0 1) + (label cfg-4) + (b! (< v1-0 (the-as int (-> this nav-control-count))) cfg-1) + ) + (let ((v1-3 (-> this nav-control-count))) + (cond + ((< v1-3 (-> this max-nav-control-count)) + (+! (-> this nav-control-count) 1) + (set! gp-0 (-> this nav-control-array v1-3)) + (set! (-> gp-0 state mesh) this) + ) + (else + (format + 0 + "nav-mesh::new-nav-control: too many users for nav-mesh ~s~%" + (res-lump-struct (-> this entity) 'name structure) + ) + ) + ) + ) + (label cfg-8) + gp-0 + ) + ) + +;; definition for method 30 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod remove-nav-control ((this nav-mesh) (arg0 nav-control)) + (set! (-> arg0 process) #f) + (let ((v1-1 (+ (-> this nav-control-count) -1))) + (while (and (>= v1-1 0) (not (-> this nav-control-array v1-1 process))) + (+! v1-1 -1) + ) + (set! (-> this nav-control-count) (+ v1-1 1)) + ) + 0 + (none) + ) + +;; definition for method 31 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod add-process-drawable-to-nav-mesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) + (if arg1 + (change-to this arg0) + (add-connection (-> this user-list) arg0 nothing arg0 #f (-> arg0 root)) + ) + 0 + (none) + ) + +;; definition for method 32 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod remove-process-drawable ((this nav-mesh) (arg0 process-drawable)) + (remove-from-process (-> this user-list) arg0) + (let ((a1-2 (-> arg0 nav))) + (when (nonzero? a1-2) + (remove-nav-control this a1-2) + (set! (-> arg0 nav) #f) + ) + ) + 0 + (none) + ) + +;; definition for method 33 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod change-to ((this nav-mesh) (arg0 process-drawable)) + (local-vars (s3-0 nav-control)) + (cond + ((zero? (-> this user-list)) + (go process-drawable-art-error "nav mesh not initialized") + ) + ((not arg0) + (go process-drawable-art-error "nav mesh proc pointer is #f") + ) + ((begin + (set! s3-0 (-> arg0 nav)) + (if (zero? s3-0) + (set! s3-0 (the-as nav-control #f)) + ) + (or (not s3-0) (!= this (-> s3-0 state mesh))) + ) + (let ((s4-0 (new-nav-control this))) + (b! s4-0 cfg-14 :delay (empty-form)) + (b! (not *debug-segment*) cfg-13 :delay (empty-form)) + (format 0 "ERROR: nav-mesh::change-to: unable to allocate nav-mesh for ~s~%" arg0) + (label cfg-13) + (b! #t cfg-20 :delay (nop!)) + (label cfg-14) + (cond + (s3-0 + (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 18) + (set! (-> s4-0 state mesh) this) + (set! (-> s4-0 state nav) s4-0) + (set! (-> s4-0 state current-poly) #f) + (set! (-> s4-0 state virtual-current-poly) #f) + (set! (-> s4-0 state next-poly) #f) + (set! (-> s4-0 state user-poly) #f) + (set! (-> s4-0 state target-poly) #f) + (let ((s2-0 (-> s3-0 state mesh))) + (remove-nav-control s2-0 s3-0) + (remove-from-process (-> s2-0 user-list) arg0) + ) + ) + (else + (init! s4-0 (the-as collide-shape (-> arg0 root))) + ) + ) + (set-nearest-y-thres! s4-0 (-> this nearest-y-threshold)) + (set! (-> arg0 nav) s4-0) + ) + (add-connection (-> this user-list) arg0 nothing arg0 #t (-> arg0 root)) + (send-event arg0 'nav-mesh-new :from arg0) + ) + ) + (label cfg-20) + 0 + (none) + ) + +;; definition for method 48 of type nav-mesh +(defmethod link-to-other-mesh ((this nav-mesh) (arg0 nav-mesh-link)) + (when (not (-> arg0 dest-mesh)) + (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) + (v1-1 (if (type? s4-0 entity-nav-mesh) + s4-0 + ) + ) + ) + (when v1-1 + (let ((a0-3 (-> v1-1 nav-mesh)) + (v1-2 (the-as nav-mesh-link #f)) + ) + (let ((a1-2 0)) + (b! #t cfg-8 :delay (nop!)) + (label cfg-5) + (let ((a2-1 (-> a0-3 link-array a1-2))) + (let ((a3-1 (-> arg0 id))) + (b! (!= (-> a2-1 id) a3-1) cfg-7 :delay (empty-form)) + ) + (set! v1-2 a2-1) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-7) + (+! a1-2 1) + (label cfg-8) + (b! (< a1-2 (the-as int (-> a0-3 link-count))) cfg-5) + ) + (label cfg-10) + (when v1-2 + (set! (-> arg0 dest-mesh) a0-3) + (set! (-> v1-2 dest-mesh) this) + (set! (-> arg0 dest-link-poly-id) (-> v1-2 src-switch-poly-id)) + (set! (-> arg0 dest-switch-poly-id) (-> v1-2 src-link-poly-id)) + (set! (-> v1-2 dest-link-poly-id) (-> arg0 src-switch-poly-id)) + (set! (-> v1-2 dest-switch-poly-id) (-> arg0 src-link-poly-id)) + #t + ) + ) + ) + ) + ) + ) + +;; definition for method 49 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod unlink-mesh ((this nav-mesh) (arg0 nav-mesh-link)) + (let ((a0-1 (-> arg0 dest-mesh))) + (b! (not a0-1) cfg-9 :delay (empty-form)) + (let ((v1-0 (the-as nav-mesh-link #f))) + (let ((a2-1 0)) + (b! #t cfg-5 :delay (nop!)) + (label cfg-2) + (let ((a3-1 (-> a0-1 link-array a2-1))) + (let ((t0-1 (-> arg0 id))) + (b! (!= (-> a3-1 id) t0-1) cfg-4 :delay (empty-form)) + ) + (set! v1-0 a3-1) + ) + (b! #t cfg-7 :delay (nop!)) + (label cfg-4) + (+! a2-1 1) + (label cfg-5) + (b! (< a2-1 (the-as int (-> a0-1 link-count))) cfg-2) + ) + (label cfg-7) + (when v1-0 + (set! (-> arg0 dest-mesh) #f) + (set! (-> v1-0 dest-mesh) #f) + ) + ) + ) + (label cfg-9) + 0 + (none) + ) + +;; definition for method 34 of type nav-mesh +(defmethod link-by-id ((this nav-mesh) (arg0 uint)) + (let ((v1-0 (the-as nav-mesh-link #f))) + (let ((a2-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a3-1 (-> this link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! a2-0 1) + (label cfg-4) + (b! (< a2-0 (the-as int (-> this link-count))) cfg-1) + ) + (label cfg-6) + (if v1-0 + (link-to-other-mesh this v1-0) + ) + ) + ) + +;; definition for method 35 of type nav-mesh +(defmethod unlink-by-id ((this nav-mesh) (arg0 uint)) + (let ((v1-0 (the-as nav-mesh-link #f))) + (let ((a2-0 0)) + (b! #t cfg-4 :delay (nop!)) + (label cfg-1) + (let ((a3-1 (-> this link-array a2-0))) + (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) + (set! v1-0 a3-1) + ) + (b! #t cfg-6 :delay (nop!)) + (label cfg-3) + (+! a2-0 1) + (label cfg-4) + (b! (< a2-0 (the-as int (-> this link-count))) cfg-1) + ) + (label cfg-6) + (when v1-0 + (unlink-mesh this v1-0) + #t + ) + ) + ) + +;; definition for method 25 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-from-entity ((this nav-mesh) (arg0 entity-nav-mesh)) + (local-vars (sv-16 res-tag)) + (set! (-> this entity) arg0) + (set! (-> this work) *nav-mesh-work*) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data arg0 'nav-mesh-sphere (inline-array sphere) :tag-ptr (& sv-16)))) + (when v1-2 + (set! (-> this static-sphere-count) (-> sv-16 elt-count)) + (set! (-> this static-sphere) v1-2) + ) + ) + (set! (-> this nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) + (set! (-> this flags) (res-lump-value arg0 'nav-mesh-flags nav-mesh-flag :time -1000000000.0)) + (set! (-> this water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) + (if (nonzero? (-> this poly-hash)) + (set! (-> this poly-hash work) *grid-hash-work*) + ) + (let ((s5-0 (new 'stack-no-clear 'nav-stack-type2))) + (set! (-> s5-0 word00) + (res-lump-value arg0 'nav-max-users int :default (the-as uint128 64) :time -1000000000.0) + ) + (set! (-> this user-list) (new 'loading-level 'engine 'nav-engine (-> s5-0 word00) connection)) + (set! (-> this nav-control-array) + (the-as (inline-array nav-control) (malloc 'loading-level (* 288 (-> s5-0 word00)))) + ) + (set! (-> this nav-control-count) (the-as uint 0)) + (set! (-> this max-nav-control-count) (the-as uint (-> s5-0 word00))) + (set! (-> s5-0 word01) (/ (+ (-> s5-0 word00) 7) 8)) + (dotimes (v1-16 3) + (set! (-> (the-as (pointer float) (+ (* v1-16 4) (the-as int s5-0)))) + (- (-> this poly-hash box-max v1-16) (-> this poly-hash box-min v1-16)) + ) + ) + (set! (-> s5-0 word02) + (the int + (+ 1.0 (* (fmax 1.0 (* 0.000015258789 (-> s5-0 float00))) (fmax 1.0 (* 0.000015258789 (-> s5-0 float01))))) + ) + ) + (set! (-> s5-0 word03) (min 4096 (* (-> s5-0 word01) (-> s5-0 word02)))) + (set! (-> this sphere-hash) + (new 'loading-level 'sphere-hash (-> s5-0 word03) (+ (-> s5-0 word00) (-> this static-sphere-count))) + ) + ) + (initialize-mesh! this) + 0 + (none) + ) + +;; definition for method 26 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod handle-birth ((this nav-mesh)) + (dotimes (s5-0 (the-as int (-> this link-count))) + (let ((a1-0 (-> this link-array s5-0))) + (if (not (-> a1-0 dest-mesh)) + (link-to-other-mesh this a1-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod handle-kill ((this nav-mesh)) + (when (nonzero? (-> this user-list)) + (countdown (s5-0 (-> this nav-control-count)) + (let* ((v1-3 (-> this nav-control-array s5-0)) + (s4-0 (-> v1-3 process)) + ) + (when s4-0 + (when (not (send-event (-> v1-3 process) 'nav-mesh-kill)) + (format 0 "ERROR: object ~A did not accept nav-mesh kill~%" s4-0) + (deactivate s4-0) + ) + ) + ) + ) + (remove-all (-> this user-list)) + (dotimes (s5-1 (the-as int (-> this link-count))) + (let ((a1-2 (-> this link-array s5-1))) + (if (-> a1-2 dest-mesh) + (unlink-mesh this a1-2) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this nav-mesh)) + (local-vars (sv-32 vector) (sv-36 int)) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 16) + (add-debug-sphere + (logtest? sv-36 4) + (bucket-id debug) + (-> this bounds) + (-> this bounds r) + (new 'static 'rgba :r #xff :g #xff :a #x20) + ) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *x-vector* (meters 1) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *z-vector* (meters 1) *color-blue*) + (when (logtest? sv-36 16) + (dotimes (s5-0 (the-as int (-> this static-sphere-count))) + (add-debug-sphere + #t + (bucket-id debug) + (-> this static-sphere s5-0) + (-> this static-sphere s5-0 r) + *color-light-blue* + ) + (let ((s4-0 add-debug-text-3d) + (s3-0 #t) + (s2-0 577) + ) + (format (clear *temp-string*) "~D" s5-0) + (s4-0 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + (-> this static-sphere s5-0) + (font-color cyan) + (the-as vector2h #f) + ) + ) + ) + (dotimes (s5-1 (the-as int (-> this poly-count))) + (let ((s4-1 (-> this poly-array s5-1))) + (debug-draw-poly this s4-1 (cond + ((logtest? (-> s4-1 pat) 1) + *color-black* + ) + ((logtest? (-> s4-1 pat) 2) + *color-gray* + ) + ((logtest? (-> s4-1 pat) 4) + (if (-> this link-array (-> s4-1 link) dest-mesh) + *color-green* + *color-light-red* + ) + ) + ((logtest? (-> s4-1 pat) 8) + *color-magenta* + ) + (else + *color-cyan* + ) + ) + ) + (when (logtest? sv-36 32) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 577) + ) + (format (clear *temp-string*) "~D" (-> s4-1 id)) + (s3-1 + s2-1 + (the-as bucket-id s1-1) + *temp-string* + (poly-centroid this s4-1 sv-32) + (font-color cyan) + (the-as vector2h #f) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type nav-mesh +(defmethod poly-centroid-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-reset! v1-0) + (dotimes (a0-2 (the-as int (-> arg0 vertex-count))) + (vector+! v1-0 v1-0 (-> arg0 vertex a0-2)) + ) + (vector-float*! arg1 v1-0 (/ 1.0 (the float (-> arg0 vertex-count)))) + ) + ) + +;; definition for method 13 of type nav-mesh +(defmethod poly-centroid ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (poly-centroid-local this arg0 arg1) + (vector+! arg1 arg1 (the-as vector (-> this bounds))) + ) + +;; definition for function vu-point-triangle-intersection? +(defun vu-point-triangle-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (v1-0 float) (v1-1 int) (v1-3 int) (a0-1 float) (a0-2 int) (a0-4 int) (a1-1 float) (a1-2 int)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.sub.vf vf1 vf1 vf1 :mask #b1010) + (.lvf vf3 (&-> arg3 quad)) + (.sub.vf vf2 vf2 vf2 :mask #b1010) + (.lvf vf12 (&-> arg0 quad)) + (.sub.vf vf3 vf3 vf3 :mask #b1010) + (.sub.vf vf4 vf2 vf1) + (.sub.vf vf9 vf1 vf12) + (.sub.vf vf5 vf3 vf2) + (.sub.vf vf10 vf2 vf12) + (.sub.vf vf6 vf1 vf3) + (.sub.vf vf11 vf3 vf12) + (.outer.product.a.vf acc vf9 vf4) + (.outer.product.b.vf vf13 vf4 vf9 acc) + (.outer.product.a.vf acc vf10 vf5) + (.outer.product.b.vf vf14 vf5 vf10 acc) + (.outer.product.a.vf acc vf11 vf6) + (.outer.product.b.vf vf15 vf6 vf11 acc) + (.mov v1-0 vf13) + (.mov a1-1 vf14) + (.mov a0-1 vf15) + (set-on-less-than v1-1 v1-0 0) + (set-on-less-than a1-2 a1-1 0) + (set-on-less-than a0-2 a0-1 0) + (let ((a0-3 (logxor a1-2 a0-2)) + (v1-2 (logxor v1-1 a1-2)) + ) + (set-on-less-than a0-4 a0-3 1) + (set-on-less-than v1-3 v1-2 1) + ) + (logtest? v1-3 a0-4) + ) + ) + +;; definition for function poly-in-height-range? +(defun poly-in-height-range? ((arg0 nav-poly) (arg1 float) (arg2 float)) + (and (>= (+ (-> arg0 vertex3 w) arg2) arg1) (>= arg1 (- (-> arg0 vertex2 w) arg2))) + ) + +;; definition for method 45 of type nav-mesh +(defmethod nav-mesh-method-45 ((this nav-mesh) (arg0 nav-poly)) + (local-vars (v1-15 int) (sv-16 nav-poly)) + (let ((s4-0 (search-for-point (-> this poly-hash) (the-as vector (-> arg0 vertex)))) + (s3-0 (-> this poly-hash bucket-size)) + (s2-0 0) + ) + (until (zero? v1-15) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s4-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + (let ((v1-2 (logand s0-0 1))) + (nop!) + (b! (zero? v1-2) cfg-16 :delay (nop!)) + ) + (set! sv-16 (-> this poly-array s1-0)) + (let ((v1-5 sv-16) + (f0-0 (-> arg0 vertex0 y)) + (f1-0 (-> arg0 vertex1 x)) + ) + (when (and (and (>= (+ (-> v1-5 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-5 vertex2 w) f1-0))) + (not (logtest? (-> sv-16 pat) (-> arg0 data 20))) + ) + (if (point-in-poly? this sv-16 (the-as vector (-> arg0 vertex))) + (return sv-16) + ) + ) + ) + (label cfg-16) + (set! s0-0 (/ (the-as int s0-0) 2)) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s4-0 (&-> s4-0 1)) + (set-on-less-than v1-15 s2-0 s3-0) + (nop!) + ) + ) + 0 + (the-as nav-poly #f) + ) + +;; definition for method 47 of type nav-mesh +;; INFO: Used lq/sq +(defmethod is-in-mesh-local? ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) + (local-vars (sv-16 float) (sv-20 vector) (sv-24 float)) + (set! sv-16 arg2) + (set! sv-20 arg0) + (set! sv-24 arg1) + (let* ((f0-3 (+ sv-24 (-> this bounds r))) + (f0-5 (* f0-3 f0-3)) + (v1-1 sv-20) + ) + (when (>= f0-5 (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) + (let ((s5-0 (new 'stack-no-clear 'nav-poly))) + (set! (-> s5-0 vertex 0 quad) (-> sv-20 quad)) + (set! (-> s5-0 vertex1 x) sv-16) + (set! (-> s5-0 data 20) (the-as uint 2)) + (nav-mesh-method-46 this s5-0) + (cond + ((-> s5-0 vertex2 x) + #t + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + (project-point-into-poly-2d this (the-as nav-poly (-> s5-0 vertex1 z)) s4-0 sv-20) + (let ((f0-7 (vector-vector-xz-distance-squared s4-0 sv-20)) + (f1-5 sv-24) + ) + (< f0-7 (* f1-5 f1-5)) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function init-ray-local +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun init-ray-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (set! (-> arg0 dest-pos quad) (-> arg3 quad)) + (set! (-> arg0 current-poly) arg1) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-3 f0-1)) + (.mov vf3 a1-3) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +;; definition for function init-ray-dir-local +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun init-ray-dir-local ((arg0 nav-ray) (arg1 nav-poly) (arg2 vector) (arg3 vector) (arg4 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 current-poly) arg1) + (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (let ((a1-3 (-> arg0 dest-pos))) + (let ((v1-1 (-> arg0 current-pos))) + (let ((a2-1 arg3)) + (let ((a3-1 arg4)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> v1-1 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-3 quad) vf6) + ) + (let ((v1-2 arg0)) + (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) + (set! (-> v1-2 dir y) 0.0) + (let ((a0-2 (-> v1-2 dir))) + (let ((f0-2 1.0)) + (.lvf vf1 (&-> a0-2 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-6 f0-2)) + (.mov vf3 a1-6) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a0-2 quad) vf1) + ) + (set! (-> v1-2 next-poly) #f) + (set! (-> v1-2 len) 0.0) + (set! (-> v1-2 last-edge) -1) + (set! (-> v1-2 terminated) #f) + (set! (-> v1-2 reached-dest) #f) + (set! (-> v1-2 hit-boundary) #f) + (set! (-> v1-2 hit-gap) #f) + (set! (-> v1-2 ignore) (the-as uint 3)) + ) + 0 + (none) + ) + ) + +;; definition for method 19 of type nav-mesh +(defmethod try-move-along-ray ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) + (local-vars (v1-2 symbol)) + (let ((gp-0 (new 'stack-no-clear 'nav-ray))) + (let ((s4-0 0)) + (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) + (until v1-2 + (+! s4-0 1) + (advance-ray-to-nearest-poly-edge-or-dest! this gp-0) + (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) + ) + ) + (-> gp-0 len) + ) + ) + +;; definition for function nav-ray-test +(defun nav-ray-test ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector) (arg3 vector)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> arg0 bounds)))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg2)) + ) + 0.0 + (set! (-> s3-1 y) 0.0) + (let ((f30-0 (vector-vector-xz-distance arg2 arg3))) + (vector-xz-normalize! s3-1 1.0) + (try-move-along-ray arg0 arg1 s4-1 s3-1 f30-0) + ) + ) + ) + +;; definition for function point-poly-distance-min +(defun point-poly-distance-min ((arg0 nav-mesh-work) (arg1 nav-poly) (arg2 float) (arg3 nav-poly)) + (let ((t0-0 (-> arg3 vertex-count)) + (a3-1 (-> arg3 vertex)) + (f0-0 arg2) + ) + (let ((v1-0 0)) + (let ((f1-0 (-> arg1 vertex0 x)) + (f2-0 (-> arg1 vertex0 z)) + (a1-1 0) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-1) + (let* ((t2-0 (-> a3-1 (-> arg0 vert0-table a1-1))) + (t1-6 (-> a3-1 (-> arg0 vert1-table a1-1))) + (f5-0 (- (-> t1-6 x) (-> t2-0 x))) + (f6-0 (- (-> t1-6 z) (-> t2-0 z))) + (f4-2 (- f1-0 (-> t2-0 x))) + (f3-4 (- f2-0 (-> t2-0 z))) + (f7-1 (- (* f5-0 f3-4) (* f6-0 f4-2))) + ) + (b! (>= 0.0 f7-1) cfg-9 :delay #f) + (+! v1-0 1) + (let* ((f8-2 f5-0) + (f8-4 (* f8-2 f8-2)) + (f9-0 f6-0) + (f8-5 (+ f8-4 (* f9-0 f9-0))) + ) + (let* ((f9-3 arg2) + (f9-6 (* f8-5 (* f9-3 f9-3))) + (f10-0 f7-1) + ) + (b! (< f9-6 (* f10-0 f10-0)) cfg-13) + ) + (let ((f5-2 (+ (* f5-0 f4-2) (* f6-0 f3-4)))) + arg2 + (b! (>= f5-2 0.0) cfg-5) + (let ((f3-8 (sqrtf (+ (* f4-2 f4-2) (* f3-4 f3-4))))) + (b! #t cfg-8 :delay (nop!)) + (label cfg-5) + (b! (>= f8-5 f5-2) cfg-7) + (let* ((f3-10 (- f1-0 (-> t1-6 x))) + (f3-12 (* f3-10 f3-10)) + (f4-6 (- f2-0 (-> t1-6 z))) + ) + (set! f3-8 (sqrtf (+ f3-12 (* f4-6 f4-6)))) + ) + (b! #t cfg-8 :delay (nop!)) + (label cfg-7) + (set! f0-0 (/ f7-1 (sqrtf f8-5))) + (b! #t cfg-13 :delay (nop!)) + (label cfg-8) + (set! f0-0 (fmin f0-0 f3-8)) + ) + ) + ) + ) + (label cfg-9) + (+! a1-1 1) + (label cfg-10) + (b! (< a1-1 (the-as int t0-0)) cfg-1) + ) + (if (zero? v1-0) + (set! f0-0 0.0) + ) + ) + (label cfg-13) + f0-0 + ) + ) + +;; definition for method 46 of type nav-mesh +(defmethod nav-mesh-method-46 ((this nav-mesh) (arg0 nav-poly)) + (local-vars + (v1-16 int) + (v1-31 int) + (sv-16 nav-poly) + (sv-20 (pointer uint8)) + (sv-24 nav-poly) + (sv-28 float) + (sv-32 int) + (sv-40 int) + (sv-48 nav-poly) + (sv-52 float) + ) + (set! sv-16 (the-as nav-poly #f)) + (set! sv-20 (search-for-sphere (-> this poly-hash) (the-as vector (-> arg0 vertex)) 12288.0)) + (set! (-> arg0 vertex2 x) (the-as float #f)) + (let ((s4-0 (-> this poly-hash bucket-size)) + (s3-0 sv-20) + (s2-0 0) + ) + (nop!) + (until (zero? v1-16) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-17 :delay (nop!)) + (let ((v1-3 (logand s0-0 1))) + (nop!) + (b! (zero? v1-3) cfg-16 :delay (nop!)) + ) + (set! sv-24 (-> this poly-array s1-0)) + (let ((v1-6 sv-24) + (f0-0 (-> arg0 vertex0 y)) + (f1-0 (-> arg0 vertex1 x)) + ) + (when (and (and (>= (+ (-> v1-6 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-6 vertex2 w) f1-0))) + (not (logtest? (-> sv-24 pat) (-> arg0 data 20))) + ) + (when (point-in-poly? this sv-24 (the-as vector (-> arg0 vertex))) + (set! (-> arg0 vertex2 x) (the-as float #t)) + (set! (-> arg0 vertex1 w) 0.0) + (set! sv-16 sv-24) + (goto cfg-38) + ) + ) + ) + (label cfg-16) + (set! s0-0 (/ (the-as int s0-0) 2)) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-17) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-16 s2-0 s4-0) + (nop!) + ) + ) + (set! sv-28 (the-as float 10000000000000000000000000000000000000.0)) + (set! sv-32 0) + (set! sv-40 0) + (let ((s4-1 (-> this poly-hash bucket-size)) + (s3-1 sv-20) + (s2-1 0) + ) + (until (zero? v1-31) + (let ((s1-1 (* s2-1 8)) + (s0-1 (-> s3-1 0)) + ) + (b! (zero? s0-1) cfg-34 :delay (nop!)) + (let ((v1-19 (logand s0-1 1))) + (nop!) + (b! (zero? v1-19) cfg-33 :delay (nop!)) + ) + (set! sv-48 (-> this poly-array s1-1)) + (let ((v1-22 sv-48) + (f0-3 (-> arg0 vertex0 y)) + (f1-2 (-> arg0 vertex1 x)) + ) + (when (and (and (>= (+ (-> v1-22 vertex3 w) f1-2) f0-3) (>= f0-3 (- (-> v1-22 vertex2 w) f1-2))) + (not (logtest? (-> sv-48 pat) (-> arg0 data 20))) + ) + (set! sv-40 (+ sv-40 1)) + (set! sv-52 (point-poly-distance-min (-> this work) (the-as nav-poly (-> arg0 vertex)) sv-28 sv-48)) + (when (< sv-52 sv-28) + (set! sv-28 sv-52) + (set! sv-16 sv-48) + (nop!) + ) + ) + ) + (label cfg-33) + (set! s0-1 (/ (the-as int s0-1) 2)) + (nop!) + (b! (nonzero? s0-1) cfg-20 :delay (set! s1-1 (+ s1-1 1))) + ) + (label cfg-34) + (+! s2-1 1) + (set! s3-1 (&-> s3-1 1)) + (set-on-less-than v1-31 s2-1 s4-1) + (nop!) + ) + ) + (if (not sv-16) + (set! sv-16 (-> this poly-array 0)) + ) + (set! (-> arg0 vertex1 w) sv-28) + (label cfg-38) + (set! (-> arg0 vertex1 z) (the-as float sv-16)) + arg0 + ) + +;; definition for function nav-mesh-route-table-bit-index +(defun nav-mesh-route-table-bit-index ((arg0 nav-mesh) (arg1 uint) (arg2 int)) + (* (+ arg2 (* arg1 (-> arg0 poly-count))) 2) + ) + +;; definition for method 16 of type nav-mesh +;; INFO: Used lq/sq +(defmethod get-route-portal ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) + (set! (-> arg2 next-poly) #f) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a1-1 this) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a1-1 poly-count))) 2)) + (s3-0 + (logand (the-as int (ash (the-as int (-> this route (shr v1-4 3))) (- (the-as int (logand v1-4 7))))) 3) + ) + ) + (set! (-> arg2 edge-index) -1) + (let ((s2-0 (-> arg0 adj-poly s3-0))) + (when (= s2-0 255) + (format 0 "nav-mesh::get-route-portal: data error in nav mesh~%") + (break!) + 0 + ) + (set! (-> arg2 edge-index) s3-0) + (set! (-> arg2 next-poly) (-> this poly-array s2-0)) + ) + (let ((a0-7 s3-0) + (v1-16 (+ s3-0 1)) + ) + (if (>= (the-as uint v1-16) (-> arg0 vertex-count)) + (set! v1-16 0) + ) + (set! (-> arg2 vertex 1 quad) (-> arg0 vertex a0-7 quad)) + (let ((v0-1 (-> arg2 vertex))) + (set! (-> v0-1 0 quad) (-> arg0 vertex v1-16 quad)) + v0-1 + ) + ) + ) + ) + (else + (the-as (inline-array nav-vertex) #f) + ) + ) + ) + +;; definition for method 15 of type nav-mesh +(defmethod lookup-poly-on-route-to-target ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) + (cond + ((and arg0 arg1 (!= arg0 arg1)) + (let* ((a3-0 this) + (v1-1 (-> arg0 id)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a3-0 poly-count))) 2)) + (v1-9 (logand (ash (the-as int (-> this route (shr v1-4 3))) (- (the-as int (logand v1-4 7)))) 3)) + (a2-5 (new 'stack-no-clear 'array 'int8 4)) + ) + (set! (-> a2-5 0) (the-as int (-> arg0 adj-poly0))) + (set! (-> a2-5 1) (the-as int (-> arg0 adj-poly1))) + (set! (-> a2-5 2) (the-as int (-> arg0 adj-poly2))) + (set! (-> a2-5 3) (the-as int (-> arg0 adj-poly3))) + (let ((v1-11 (-> (the-as (pointer uint8) (&+ a2-5 v1-9))))) + (if (= v1-11 255) + (the-as nav-poly #f) + (-> this poly-array v1-11) + ) + ) + ) + ) + (else + (the-as nav-poly #f) + ) + ) + ) + +;; definition for method 24 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod compute-bounding-box-from-vertices ((this nav-mesh) (arg0 vector) (arg1 vector)) + (let ((f0-0 10000000000000000000000000000000000000.0) + (f1-0 -10000000000000000000000000000000000000.0) + ) + (set! (-> arg0 x) f0-0) + (set! (-> arg0 y) f0-0) + (set! (-> arg0 z) f0-0) + (set! (-> arg1 x) f1-0) + (set! (-> arg1 y) f1-0) + (set! (-> arg1 z) f1-0) + ) + (dotimes (v1-3 (the-as int (-> this poly-count))) + (let ((a3-1 (-> this poly-array v1-3))) + (dotimes (t0-1 (the-as int (-> a3-1 vertex-count))) + (let ((t1-2 (-> a3-1 vertex t0-1))) + (set! (-> arg0 x) (fmin (-> arg0 x) (-> t1-2 x))) + (set! (-> arg0 y) (fmin (-> arg0 y) (-> t1-2 y))) + (set! (-> arg0 z) (fmin (-> arg0 z) (-> t1-2 z))) + (set! (-> arg1 x) (fmax (-> arg1 x) (-> t1-2 x))) + (set! (-> arg1 y) (fmax (-> arg1 y) (-> t1-2 y))) + (set! (-> arg1 z) (fmax (-> arg1 z) (-> t1-2 z))) + ) + ) + ) + ) + (vector+! arg0 arg0 (the-as vector (-> this bounds))) + (vector+! arg1 arg1 (the-as vector (-> this bounds))) + 0 + (none) + ) + +;; definition for method 17 of type nav-mesh +;; WARN: Return type mismatch int vs none. +(defmethod initialize-mesh! ((this nav-mesh)) + (local-vars + (sv-32 vector) + (sv-36 uint) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-64 symbol) + (sv-68 (inline-array vector)) + (sv-72 vector) + (sv-76 vector) + ) + (with-pp + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! sv-32 (new 'stack-no-clear 'vector)) + (set! sv-36 (-> this poly-count)) + (set! sv-40 0) + (set! sv-48 0) + (set! sv-56 0) + (set! sv-64 (the-as symbol #f)) + (countdown (s5-0 sv-36) + (let ((v1-3 (-> this poly-array s5-0))) + (if (logtest? (-> v1-3 pat) 1) + (set! sv-56 (+ sv-56 1)) + ) + (set! sv-68 (-> v1-3 vertex)) + (set! sv-72 (-> v1-3 vertex1)) + (set! sv-76 (-> v1-3 vertex2)) + ) + (vector-3pt-cross! sv-32 (the-as vector sv-68) sv-72 sv-76) + (cond + ((= (vector-length sv-32) 0.0) + (set! sv-40 (+ sv-40 1)) + ) + (else + (let ((v1-9 sv-32)) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-9 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a0-11 f0-1)) + (.mov vf3 a0-11) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-9 quad) vf1) + ) + (if (>= 0.0 (-> sv-32 y)) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + (when (zero? sv-36) + (format #t "WARNING: nav-mesh has no triangles. ") + (set! sv-64 #t) + ) + (when (> sv-40 0) + (format #t "WARNING: nav-mesh has ~D triangles with zero area (out of ~D triangles). " sv-40 sv-36) + (set! sv-64 #t) + ) + (when (> sv-48 0) + (format #t "WARNING: nav-mesh has ~D triangles with inverted normals (out of ~D triangles). " sv-48 sv-36) + (set! sv-64 #t) + ) + (when (< (the-as uint 255) sv-36) + (format #t "WARNING: nav-mesh has ~D triangles (only up to ~D are allowed). " sv-36 255) + (set! sv-64 #t) + ) + (when (= sv-56 sv-36) + (format #t "WARNING: nav-mesh only contains gap triangles (~D triangles total). " sv-36) + (set! sv-64 #t) + ) + (when sv-64 + (if pp + (format #t "current process is ~A~%" (-> pp name)) + (format #t "(no current process).~%") + ) + ) + 0 + (none) + ) + ) + ) + +;; definition for function ray-ccw-line-segment-intersection? +(defun ray-ccw-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f0-2 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f2-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f3-4 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (v0-0 #f) + ) + (let ((f1-7 (- f2-4 f0-2)) + (f2-5 (- f2-4 f3-4)) + (f3-5 (- f3-4 f0-2)) + ) + (when (and (>= (fabs f1-7) (fmax (fabs f3-5) (fabs f2-5))) (!= f1-7 0.0)) + (let ((f0-7 (+ (* (-> arg1 x) (- (-> arg3 z) (-> arg2 z))) (* (-> arg1 z) (- (-> arg2 x) (-> arg3 x)))))) + (set! v0-0 (< 0.0 f0-7)) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function ray-line-segment-intersection? +(defun ray-line-segment-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f1-3 (- (* (-> arg2 x) (-> arg1 z)) (* (-> arg2 z) (-> arg1 x)))) + (f0-4 (- (* (-> arg3 x) (-> arg1 z)) (* (-> arg3 z) (-> arg1 x)))) + (f2-6 (- (* (-> arg0 x) (-> arg1 z)) (* (-> arg0 z) (-> arg1 x)))) + (gp-0 #f) + ) + (let ((f30-0 (- f0-4 f1-3)) + (f0-5 (- f0-4 f2-6)) + (f1-4 (- f2-6 f1-3)) + ) + (when (and (>= (fabs f30-0) (fmax (fabs f1-4) (fabs f0-5))) (!= f30-0 0.0)) + (let ((f2-11 (+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 z) (-> arg1 z)))) + (f3-11 (+ (* (-> arg3 x) (-> arg1 x)) (* (-> arg3 z) (-> arg1 z)))) + (f28-0 (+ (* (-> arg0 x) (-> arg1 x)) (* (-> arg0 z) (-> arg1 z)))) + ) + (if (>= (* (+ (* f2-11 f0-5) (* f3-11 f1-4)) (sign f30-0)) (* f28-0 (fabs f30-0))) + (set! gp-0 #t) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 41 of type nav-mesh +;; INFO: Used lq/sq +(defmethod nav-mesh-method-41 ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) + (local-vars + (s1-0 vector) + (sv-16 int) + (sv-24 nav-mesh-work) + (sv-28 uint) + (sv-32 (pointer int8)) + (sv-36 (pointer int8)) + (sv-40 vector) + (sv-44 vector) + ) + (set! sv-16 -1) + (set! sv-24 (-> this work)) + (set! sv-28 (-> arg0 vertex-count)) + (set! sv-32 (-> sv-24 vert0-table)) + (set! sv-36 (-> sv-24 vert1-table)) + (set! (-> arg2 quad) (-> arg3 quad)) + (dotimes (v1-8 (the-as int sv-28)) + (set! sv-40 (-> arg0 vertex (-> sv-32 v1-8))) + (set! sv-44 (-> arg0 vertex (-> sv-36 v1-8))) + (let* ((f0-1 (- (-> sv-40 z) (-> sv-44 z))) + (f1-2 (- (-> sv-44 x) (-> sv-40 x))) + (f2-4 (+ (* f0-1 (- (-> sv-40 x) (-> arg1 x))) (* f1-2 (- (-> sv-40 z) (-> arg1 z))))) + (f0-3 (+ (* (-> arg2 x) f0-1) (* (-> arg2 z) f1-2))) + ) + (when (< f2-4 f0-3) + (set! sv-16 v1-8) + (let ((f0-4 (/ f2-4 f0-3))) + (set! (-> arg2 x) (* (-> arg2 x) f0-4)) + (set! (-> arg2 z) (* (-> arg2 z) f0-4)) + ) + ) + ) + ) + (when arg4 + (cond + ((= sv-16 -1) + (set! (-> arg4 0) #f) + ) + (else + (while (!= sv-16 -1) + (let ((v1-16 (-> arg0 adj-poly sv-16))) + (cond + ((!= v1-16 255) + (set! (-> arg4 0) (-> this poly-array v1-16)) + (set! sv-16 -1) + ) + ((let ((a1-1 (-> arg0 vertex (-> sv-32 sv-16)))) + (set! s1-0 (-> arg0 vertex (-> sv-36 sv-16))) + (< (vector-vector-xz-distance arg1 a1-1) (-> this work nav-poly-min-dist)) + ) + (set! sv-16 (+ sv-16 -1)) + (if (< sv-16 0) + (set! sv-16 (the-as int (+ sv-28 -1))) + ) + ) + ((< (vector-vector-xz-distance arg1 s1-0) (-> this work nav-poly-min-dist)) + (set! sv-16 (+ sv-16 1)) + (when (>= sv-16 (the-as int sv-28)) + (set! sv-16 0) + 0 + ) + ) + (else + (set! (-> arg4 0) #f) + (set! sv-16 -1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> arg2 y) (-> arg1 y)) + arg2 + ) + +;; definition for function plane-height-at-xz-point +(defun plane-height-at-xz-point ((arg0 plane) (arg1 vector)) + (/ (- (+ (* (-> arg1 x) (-> arg0 x)) (* (-> arg1 z) (-> arg0 z)) (-> arg0 w))) (-> arg0 y)) + ) + +;; definition for function nav-normal-from-3-points +;; WARN: Return type mismatch int vs none. +(defun nav-normal-from-3-points ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (normal-of-plane arg0 arg1 arg2 arg3) + 0 + (none) + ) + +;; definition for method 43 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod project-point-onto-plane-of-poly-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (cond + ((= (-> arg0 vertex-count) 3) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ((let* ((v1-2 (-> arg0 vertex2)) + (a0-3 (-> arg0 vertex)) + (f0-1 (- (-> a0-3 0 x) (-> v1-2 x))) + (f1-2 (- (-> a0-3 0 z) (-> v1-2 z))) + (f2-2 (- (-> arg3 x) (-> v1-2 x))) + (f0-3 (- (* f0-1 (- (-> arg3 z) (-> v1-2 z))) (* f1-2 f2-2))) + ) + (< 0.0 f0-3) + ) + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex2) (-> arg0 vertex3)) + ) + (else + (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) + ) + ) + (set! (-> arg2 quad) (-> s4-0 quad)) + (set! (-> s4-0 w) (- (vector-dot s4-0 (the-as vector (-> arg0 vertex))))) + (set! (-> s5-0 quad) (-> arg3 quad)) + (set! (-> s5-0 y) (/ (- (+ (* (-> arg3 x) (-> s4-0 x)) (* (-> arg3 z) (-> s4-0 z)) (-> s4-0 w))) (-> s4-0 y))) + ) + (set! (-> arg1 quad) (-> s5-0 quad)) + ) + 0 + (none) + ) + +;; definition for method 8 of type nav-mesh +;; WARN: Return type mismatch int vs nav-mesh. +(defmethod mem-usage ((this nav-mesh) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 47 (-> usage length))) + (set! (-> usage data 46 name) "nav-mesh") + (+! (-> usage data 46 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 46 used) v1-6) + (+! (-> usage data 46 total) (logand -16 (+ v1-6 15))) + ) + (set! (-> usage length) (max 47 (-> usage length))) + (set! (-> usage data 46 name) "nav-mesh") + (+! (-> usage data 46 count) 1) + (let ((v1-16 (* (-> this poly-count) 64))) + (+! (-> usage data 46 used) v1-16) + (+! (-> usage data 46 total) (logand -16 (+ v1-16 15))) + ) + (set! (-> usage length) (max 47 (-> usage length))) + (set! (-> usage data 46 name) "nav-mesh") + (+! (-> usage data 46 count) 1) + (let* ((v1-25 (-> this poly-count)) + (v1-27 (shr (* v1-25 v1-25) 2)) + ) + (+! (-> usage data 46 used) v1-27) + (+! (-> usage data 46 total) (logand -16 (+ v1-27 15))) + ) + (the-as nav-mesh 0) + ) + +;; definition for function get-nav-mesh +(defun get-nav-mesh ((arg0 actor-id)) + (let ((gp-0 (the-as nav-mesh #f))) + (let* ((s5-0 (entity-nav-mesh-by-aid arg0)) + (v1-0 (if (type? s5-0 entity-nav-mesh) + s5-0 + ) + ) + ) + (if v1-0 + (set! gp-0 (-> v1-0 nav-mesh)) + ) + ) + gp-0 + ) + ) + +;; definition for function find-nearest-nav-mesh +(defun find-nearest-nav-mesh ((arg0 vector) (arg1 float)) + (local-vars (v1-15 float) (sv-64 nav-find-poly-parms) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-64 (new 'stack-no-clear 'nav-find-poly-parms)) + (set! sv-68 (the-as nav-mesh #f)) + (set! sv-72 arg1) + (set! sv-76 arg0) + (set! (-> sv-64 ignore) (the-as uint 7)) + (dotimes (gp-0 (-> *level* length)) + (let ((v1-5 (-> *level* level gp-0))) + (when (= (-> v1-5 status) 'active) + (let ((s5-0 (-> v1-5 bsp nav-meshes))) + (when (nonzero? s5-0) + (dotimes (s4-0 (-> s5-0 length)) + (let ((s3-0 (-> s5-0 s4-0 nav-mesh))) + (when s3-0 + (vector-! (-> sv-64 point) sv-76 (the-as vector (-> s3-0 bounds))) + (.lvf vf1 (&-> (-> sv-64 point) 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-15 vf1) + (let ((f0-1 v1-15) + (f1-0 (-> s3-0 bounds r)) + ) + (when (< f0-1 (* f1-0 f1-0)) + (set! (-> sv-64 y-threshold) (-> s3-0 nearest-y-threshold)) + (nav-mesh-method-46 s3-0 (the-as nav-poly sv-64)) + (when (>= sv-72 (-> sv-64 dist)) + (set! sv-72 (-> sv-64 dist)) + (set! sv-68 s3-0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + sv-68 + ) + ) + +;; definition for method 10 of type nav-mesh +(defmethod nav-mesh-method-10 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) + (local-vars (sv-16 vector)) + (set! sv-16 arg0) + (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (set! (-> gp-0 poly) arg2) + (vector-! (-> gp-0 point) arg1 (the-as vector (-> this bounds))) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? this (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) + (set! (-> gp-0 ignore) (the-as uint 3)) + (nav-mesh-method-46 this (the-as nav-poly gp-0)) + (when (-> gp-0 poly) + (project-point-into-poly-2d this (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (the-as vector (-> this bounds))) + ) + ) + (-> gp-0 poly) + ) + ) + +;; definition for function point-to-poly-boundary +;; INFO: Used lq/sq +(defun point-to-poly-boundary ((arg0 nav-poly) (arg1 vector) (arg2 vector)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (set! (-> gp-0 4 x) (the-as float #x7f800000)) + (let* ((s2-0 (-> arg0 vertex-count)) + (v1-1 (the-as int (+ s2-0 -1))) + ) + (dotimes (s1-0 (the-as int s2-0)) + (when (= (-> arg0 adj-poly v1-1) 255) + (set! (-> gp-0 2 quad) (-> arg0 vertex v1-1 quad)) + (set! (-> gp-0 3 quad) (-> arg0 vertex s1-0 quad)) + (set! (-> gp-0 2 y) (-> arg2 y)) + (set! (-> gp-0 3 y) (-> arg2 y)) + (set! (-> gp-0 2 w) 1.0) + (set! (-> gp-0 3 w) 1.0) + (let ((f0-5 (vector-segment-distance-point! arg2 (-> gp-0 2) (-> gp-0 3) (-> gp-0 0)))) + (when (< f0-5 (-> gp-0 4 x)) + (set! (-> gp-0 4 x) f0-5) + (set! (-> gp-0 1 quad) (-> gp-0 0 quad)) + ) + ) + ) + (set! v1-1 s1-0) + ) + ) + (set! (-> arg1 quad) (-> gp-0 1 quad)) + (-> gp-0 4 x) + ) + ) + +;; definition for method 36 of type nav-mesh +;; INFO: Used lq/sq +(defmethod nav-mesh-method-36 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (local-vars (v1-13 int) (sv-80 vector) (sv-84 (pointer uint8))) + (let ((gp-0 (new 'stack-no-clear 'nav-poly))) + (set! sv-80 arg0) + (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) + (set! (-> gp-0 vertex3 x) arg2) + (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) + (set! sv-84 (search-for-sphere (-> this poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) + (let ((s4-0 (-> this poly-hash bucket-size)) + (s3-0 sv-84) + (s2-0 0) + ) + (until (zero? v1-13) + (let ((s1-0 (* s2-0 8)) + (s0-0 (-> s3-0 0)) + ) + (b! (zero? s0-0) cfg-14 :delay (nop!)) + (let ((v1-5 (logand s0-0 1))) + (nop!) + (b! (zero? v1-5) cfg-13 :delay (nop!)) + ) + (let* ((a0-5 (-> this poly-array s1-0)) + (v1-7 a0-5) + (f0-3 (-> gp-0 vertex1 y)) + (f1-0 (-> this nearest-y-threshold)) + ) + (if (and (>= (+ (-> v1-7 vertex3 w) f1-0) f0-3) (>= f0-3 (- (-> v1-7 vertex2 w) f1-0))) + (set! (-> gp-0 vertex3 z) (point-to-poly-boundary a0-5 (-> gp-0 vertex2) (-> gp-0 vertex1))) + ) + ) + (when (< (-> gp-0 vertex3 z) (-> gp-0 vertex3 y)) + (set! (-> gp-0 vertex3 y) (-> gp-0 vertex3 z)) + (set! (-> gp-0 vertex 0 quad) (-> gp-0 vertex2 quad)) + (nop!) + ) + (label cfg-13) + (set! s0-0 (/ (the-as int s0-0) 2)) + (nop!) + (b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1))) + ) + (label cfg-14) + (+! s2-0 1) + (set! s3-0 (&-> s3-0 1)) + (set-on-less-than v1-13 s2-0 s4-0) + (nop!) + ) + ) + 0 + (set! (-> sv-80 quad) (-> gp-0 vertex 0 quad)) + (-> gp-0 vertex3 y) + ) + ) + +;; definition for method 37 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: new jak 2 until loop case, check carefully +(defmethod nav-mesh-method-37 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) + (set! (-> gp-0 2 vertex3 y) arg2) + (vector-! (the-as vector (-> gp-0 0)) arg0 (the-as vector (-> this bounds))) + (vector-! (-> gp-0 0 vertex1) arg1 (the-as vector (-> this bounds))) + (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) + (set! (-> gp-0 2 vertex2 x) (-> this nearest-y-threshold)) + (set! (-> gp-0 2 data 36) (the-as uint 3)) + (let ((a1-4 (nav-mesh-method-45 this (the-as nav-poly (-> gp-0 2 vertex1))))) + (cond + (a1-4 + (init-ray-local (the-as nav-ray (-> gp-0 1)) a1-4 (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex1)) + (until #f + (set! (-> gp-0 2 vertex3 z) + (nav-mesh-method-36 this (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) + ) + (when (< (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) + (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) + (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) + ) + (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) + (advance-ray-to-nearest-poly-edge-or-dest! this (the-as nav-ray (-> gp-0 1))) + ) + #f + (label cfg-6) + (if (-> gp-0 2 vertex0 z) + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + (else + (set! (-> gp-0 2 vertex3 y) (the-as float #xff800000)) + ) + ) + ) + (-> gp-0 2 vertex3 y) + ) + ) + +;; definition for method 11 of type nav-mesh +;; WARN: Return type mismatch nav-poly vs none. +(defmethod nav-mesh-method-11 ((this nav-mesh) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) + (vector-! (-> v1-0 point) arg0 (the-as vector (-> this bounds))) + (set! (-> v1-0 y-threshold) 4096000000.0) + (set! (-> v1-0 ignore) (the-as uint 2)) + (nav-mesh-method-45 this (the-as nav-poly (-> v1-0 point))) + ) + (none) + ) + +;; definition of type nav-find-clear-spot-work +(deftype nav-find-clear-spot-work (structure) + ((id-array int8 16) + (sphere-array sphere 16 :inline) + ) + ) + +;; definition for method 3 of type nav-find-clear-spot-work +(defmethod inspect ((this nav-find-clear-spot-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nav-find-clear-spot-work) + (format #t "~1Tid-array[16] @ #x~X~%" (-> this id-array)) + (format #t "~1Tsphere-array[16] @ #x~X~%" (-> this sphere-array)) + (label cfg-4) + this + ) + +;; definition for method 12 of type nav-mesh +;; INFO: Used lq/sq +(defmethod nav-mesh-method-12 ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 nav-poly)) + (let ((gp-0 (new 'stack-no-clear 'nav-stack-type))) + (set! (-> gp-0 byte03) 0) + (set! (-> gp-0 byte04) 3) + (set! (-> gp-0 vec3 y) arg1) + (set! (-> gp-0 byte02) 0) + (set! (-> gp-0 vec1 quad) (-> arg0 quad)) + (b! #t cfg-9 :delay (nop!)) + (label cfg-1) + (set! (-> gp-0 nav-id-params bsphere quad) (-> gp-0 vec1 quad)) + (set! (-> gp-0 nav-id-params bsphere r) (-> gp-0 vec3 y)) + (set! (-> gp-0 nav-id-params max-len) 16) + (set! (-> gp-0 nav-id-params mask) (the-as uint 255)) + (set! (-> gp-0 nav-id-params array) (-> gp-0 byte-arr)) + (set! (-> gp-0 nav-id-params y-threshold) 4096000000.0) + (sphere-hash-method-29 (-> this sphere-hash) (-> gp-0 nav-id-params)) + (set! (-> gp-0 byte01) (-> gp-0 nav-id-params len)) + (b! (nonzero? (-> gp-0 byte01)) cfg-3 :delay (empty-form)) + (set! (-> arg2 vertex0 quad) (-> gp-0 vec1 quad)) + (set! (-> gp-0 byte03) 1) + (b! #t cfg-11 :delay (nop!)) + (label cfg-3) + (dotimes (v1-15 (-> gp-0 byte01)) + (let ((a1-2 (-> gp-0 byte-arr v1-15))) + (set! (-> gp-0 vec4 quad) (-> this sphere-hash sphere-array a1-2 quad)) + ) + (vector-! (-> gp-0 vec5) (-> gp-0 vec1) (-> gp-0 vec4)) + (set! (-> gp-0 vec5 y) 0.0) + (let ((a0-9 (-> gp-0 vec5))) + (set! (-> gp-0 vec3 z) (+ (* (-> a0-9 x) (-> a0-9 x)) (* (-> a0-9 z) (-> a0-9 z)))) + ) + (let ((f0-8 (-> gp-0 vec3 z)) + (f1-4 (+ (-> gp-0 vec3 y) (-> gp-0 vec4 w))) + ) + (when (< f0-8 (* f1-4 f1-4)) + (set! (-> gp-0 vec2 quad) (-> gp-0 vec1 quad)) + (set! (-> gp-0 vec3 w) (sqrtf (-> gp-0 vec3 z))) + (vector-float*! (-> gp-0 vec6) (-> gp-0 vec5) (/ 1.0 (-> gp-0 vec3 w))) + (vector+float*! + (-> gp-0 vec1) + (-> gp-0 vec1) + (-> gp-0 vec6) + (+ (- 410.0 (-> gp-0 vec3 w)) (-> gp-0 vec4 w) (-> gp-0 vec3 y)) + ) + 0 + ) + ) + ) + (+! (-> gp-0 byte02) 1) + (label cfg-9) + (b! (< (-> gp-0 byte02) (-> gp-0 byte04)) cfg-1) + (label cfg-11) + (= (-> gp-0 byte03) 1) + ) + ) + +;; definition for method 38 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod nav-mesh-method-38 ((this nav-mesh) (arg0 nav-poly)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector arg0) (the-as vector (-> this bounds))))) + (countdown (s3-0 (-> this nav-control-count)) + (let ((v1-2 (-> this nav-control-array s3-0))) + (if (-> v1-2 process) + (send-event (-> v1-2 process) 'nav-mesh-moved s4-1 arg0) + ) + ) + ) + ) + (set! (-> this bounds quad) (-> arg0 vertex0 quad)) + 0 + (none) + ) + +;; failed to figure out what this is: +(none) + +) + + + diff --git a/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc b/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc index e0bf7b9b13..c6599b7dbb 100644 --- a/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/ragdoll-h_REF.gc @@ -237,7 +237,7 @@ (get-max-angle-for-joint-idx (_type_ int) degrees) (ragdoll-method-23 (_type_ vector vector float symbol) none) (ragdoll-method-24 (_type_ vector int) none) - (ragdoll-method-25 (_type_ process-drawable) none) + (enable-ragdoll! (_type_ process-drawable) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc b/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc index 8ba407c39b..f9d07a1c89 100644 --- a/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc @@ -450,7 +450,7 @@ ;; definition for method 25 of type ragdoll ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ragdoll-method-25 ((this ragdoll) (proc process-drawable)) +(defmethod enable-ragdoll! ((this ragdoll) (proc process-drawable)) (let ((s4-0 (-> this ragdoll-joints))) (logior! (-> proc skel status) (joint-control-status no-joint-callbacks)) (do-joint-math (-> proc draw) (-> proc node-list) (-> proc skel)) diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc index 3cf0bbdc2b..b7987d645b 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body-h_REF.gc @@ -292,9 +292,9 @@ (rigid-body-object-method-43 (_type_) none) (impulse-handler (_type_) none) (go-active (_type_) object) - (rigid-body-object-method-46 (_type_) none) + (apply-damage (_type_ float rigid-body-impact) none) (impulse-force<-penetrate (_type_ rigid-body-impact attack-info penetrate) none) - (rigid-body-object-method-48 (_type_) none) + (on-impact (_type_ rigid-body-impact) none) (rbody-event-handler (_type_ process int symbol event-message-block) object) (attack-handler (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol) (touch-handler (_type_ process-focusable touching-shapes-entry) symbol) @@ -365,7 +365,7 @@ (:methods (init-queue! (_type_ process) none) (rigid-body-queue-method-10 (_type_) none) - (rigid-body-queue-method-11 (_type_ process int) none) + (rigid-body-queue-method-11 (_type_ process) none) (rigid-body-queue-method-12 (_type_ int int) none) (rigid-body-queue-method-13 (_type_ int process) none) (rigid-body-queue-method-14 (_type_ int) none) @@ -390,3 +390,7 @@ ;; failed to figure out what this is: 0 + + + + diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body-queue_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body-queue_REF.gc index dc47bdc4e8..f9c5d308bf 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body-queue_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body-queue_REF.gc @@ -122,18 +122,18 @@ ;; definition for method 11 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 process) (arg1 int)) +(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 process)) (let ((v1-0 -1)) - (let ((a2-1 0)) + (let ((a2-0 0)) (b! #t cfg-9 :delay (nop!)) (label cfg-1) - (b! (handle->process (-> this array a2-1)) cfg-8 :delay (empty-form)) - (set! v1-0 a2-1) + (b! (handle->process (-> this array a2-0)) cfg-8 :delay (empty-form)) + (set! v1-0 a2-0) (b! #t cfg-11 :delay (nop!)) (label cfg-8) - (+! a2-1 1) + (+! a2-0 1) (label cfg-9) - (b! (< a2-1 (-> this count)) cfg-1) + (b! (< a2-0 (-> this count)) cfg-1) ) (label cfg-11) (cond diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc index d8634fd375..2a2f487a48 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc @@ -1226,14 +1226,14 @@ ;; definition for method 46 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-46 ((this rigid-body-object)) +(defmethod apply-damage ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) ;; definition for method 48 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-48 ((this rigid-body-object)) +(defmethod on-impact ((this rigid-body-object) (arg0 rigid-body-impact)) 0 (none) ) @@ -1304,7 +1304,7 @@ ) (set! (-> arg0 impulse) (* f0-1 (-> this info extra attack-force-scale))) ) - (rigid-body-object-method-46 this) + (apply-damage this f1-1 arg0) 0 (none) ) @@ -1338,8 +1338,8 @@ (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s5-0 point) s4-1 (meters 0.00024414062) *color-blue*) ) ) + (on-impact this s5-0) ) - (rigid-body-object-method-48 this) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (go-active this) ) @@ -1393,7 +1393,7 @@ *color-blue* ) ) - (rigid-body-object-method-48 this) + (on-impact this s5-0) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (go-active this) ) @@ -1409,11 +1409,12 @@ (defmethod rbody-event-handler ((this rigid-body-object) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) - (-> arg3 param 0) - (if (!= this arg0) - (impulse-handler this) - ) - (rigid-body-object-method-48 this) + (let ((s5-1 (-> arg3 param 0))) + (if (!= this arg0) + (impulse-handler this) + ) + (on-impact this (the-as rigid-body-impact s5-1)) + ) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (go-active this) ) diff --git a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc index 4934134e9c..fca2e2eb7a 100644 --- a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc @@ -345,16 +345,19 @@ ) ) (when s4-1 - (cond - (((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1) - (let ((t9-4 (method-of-type nav-control nav-control-method-20))) - #x45000000 - (t9-4) - ) - ) - (else - (set! (-> arg0 quad) (the-as uint128 0)) - ) + (let ((a2-3 ((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1))) + (if a2-3 + ((method-of-type nav-control clamp-vector-to-mesh-cross-gaps) + (the-as nav-control s4-1) + arg1 + a2-3 + arg0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (set! (-> arg0 quad) (the-as uint128 0)) + ) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc index 647afa2f6e..52ce85b796 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc @@ -588,7 +588,7 @@ ) (let ((a0-3 (-> this nav))) (if (and a0-3 (nonzero? a0-3)) - ((method-of-type nav-control nav-control-method-41)) + (remove! a0-3) ) ) (let* ((s5-0 (-> this root)) @@ -2372,7 +2372,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc index 34a21838a4..7e6f694f8c 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc @@ -381,7 +381,7 @@ ) :code (behavior () (if (-> self skel effect) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) ) (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 1)) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc index f079c36f28..ab8ad2e884 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc @@ -134,23 +134,12 @@ ) (logclear! (-> self mask) (process-mask actor-pause enemy)) (set! (-> self event-hook) simple-nav-sphere-event-handler) - (cond - (arg2 - (let ((t9-5 (method-of-object arg2 nav-mesh-method-31))) - self - (t9-5) - ) - ) - (else + (if arg2 + (add-process-drawable-to-nav-mesh arg2 self #f) (nav-mesh-connect-from-ent self) ) - ) (if (>= (-> self track-joint) 0) (go-virtual active) (go-virtual idle) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc index 5ef1fcb458..c3a0065b18 100644 --- a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc @@ -2049,9 +2049,10 @@ ;; definition for function scene-player-init ;; WARN: Return type mismatch object vs none. +;; INFO: Process stack size was changed from 512 to 1024 (defbehavior scene-player-init scene-player ((arg0 object) (arg1 symbol) (arg2 string)) (process-entity-set! self (the-as entity #f)) - (stack-size-set! (-> self main-thread) 512) + (stack-size-set! (-> self main-thread) 1024) (set! (-> self root) (new 'process 'trsqv)) (case (rtype-of arg0) ((array) diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc index 73245226eb..0db4e4e9eb 100644 --- a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc @@ -143,8 +143,8 @@ O(n^2) 'check everybody against everybody' collision loop." (add-a-sphere (_type_ vector) int) (add-a-sphere-with-flag (_type_ vector int) int) (update-from-spheres (_type_) none) - (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none) - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none) + (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) (add-sphere-with-mask-and-id (_type_ vector int int) symbol) (sphere-hash-method-32 (_type_ sphere int) symbol) ) diff --git a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc index 0dd505d50a..eef083e244 100644 --- a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc @@ -1492,9 +1492,9 @@ ) ) (spawn (-> self board effect-part) (-> self control trans)) - (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + (do-effect (-> self skel effect) "effect-board-poof" 0.0 -1) (if (< (-> self board shock-offset) -2048.0) - (do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1) + (do-effect (-> self skel effect) "effect-board-poof" 0.0 -1) ) ) (vector-lerp! (-> self board slow-transv) (-> self board slow-transv) (-> self control transv) 0.2) diff --git a/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc index 01d62053c6..f90b91b170 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc @@ -499,7 +499,7 @@ ) ) ) - (do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1) + (do-effect (-> self skel effect) "death-default" 0.0 -1) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) @@ -638,7 +638,3 @@ 'normal ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc index 4b1c1a0bee..0784e47ebe 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc @@ -2664,7 +2664,7 @@ (set! (-> self control last-attack-end-time) 0) (set! (-> self control mod-surface) *flut-air-attack-mods*) (sound-play "flop-land" :pitch -0.4) - (do-effect (-> self skel effect) (the-as symbol "group-flut-attack-strike-ground") (ja-frame-num 0) 0) + (do-effect (-> self skel effect) "group-flut-attack-strike-ground" (ja-frame-num 0) 0) (let ((gp-2 (process-spawn touch-tracker diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc index 980fba9f7a..a1af617ea2 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc @@ -1948,12 +1948,12 @@ ) (dotimes (gp-1 4) (set! (-> self lt-array gp-1) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> self lt-array gp-1) 12 6 *blue-light-test*) + (init! (-> self lt-array gp-1) 12 6 *blue-light-test*) ) (set! (-> self lt-array 4) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> self lt-array 4) 12 5 *blue-light-test-big*) + (init! (-> self lt-array 4) 12 5 *blue-light-test-big*) (set! (-> self lt-array 5) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> self lt-array 5) 12 5 *blue-light-test-big*) + (init! (-> self lt-array 5) 12 5 *blue-light-test-big*) (set! (-> self revolve-angle) 0.0) (set! (-> self sway-angle) 0.0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 107) self)) diff --git a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc index c35dd3fd6f..98cd3eaaab 100644 --- a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc @@ -3092,7 +3092,7 @@ (set! (-> this game) *game-info*) (set! (-> this ext-geo-control) *target-geo-control*) (set! (-> this pending-ext-geo) - (if (and (logtest? (game-feature feature56) (-> this game features)) + (if (and (logtest? (game-feature jakc) (-> this game features)) (not (logtest? (game-secrets commentary) (-> *game-info* secrets))) ) (target-geo jakc) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc index 5a5cfa5a83..aa7df41efc 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc @@ -705,8 +705,8 @@ (set! (-> self mech state-impact? 0) s3-2) (set-forward-vel (-> self mech forward-vel)) (when (< 20480.0 (vector-length (-> self control transv))) - (do-effect (-> self skel effect) (the-as symbol "effect-slide-poof") (ja-frame-num 0) 49) - (do-effect (-> self skel effect) (the-as symbol "effect-slide-poof") (ja-frame-num 0) 43) + (do-effect (-> self skel effect) "effect-slide-poof" (ja-frame-num 0) 49) + (do-effect (-> self skel effect) "effect-slide-poof" (ja-frame-num 0) 43) ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) f30-4))) @@ -2780,7 +2780,3 @@ (target-no-ja-move-post) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc b/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc new file mode 100644 index 0000000000..3e966fc2ec --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc @@ -0,0 +1,1178 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate target-pilot-start (target) + :event target-pilot-handler + :exit target-pilot-exit + :code (behavior ((arg0 handle) (arg1 symbol) (arg2 symbol)) + (target-pilot-init arg0 arg2) + (suspend) + (remove-exit) + (if arg1 + (go target-pilot-stance) + (go target-pilot-get-on) + ) + ) + :post target-post + ) + +;; definition for function target-pilot-bike-anim-loop +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-bike-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-pilot-bike-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-bike-turn-front-ja) + (ja :chan 2 :group! jakb-pilot-bike-up-down-ja) + (until #f + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (- 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((f0-3 (fmax 0.0 (fmin 1.0 (* 0.5 (+ 1.0 (* 1.42 (+ -0.3 (-> gp-0 front-back-interp))))))))) + (ja :chan 1 + :frame-interp0 f0-3 + :frame-interp1 f0-3 + :num-func num-func-identity + :frame-num (ja-aframe f30-0 1) + ) + ) + ) + (let ((f0-6 (* 5.0 (- 1.0 (-> gp-0 up-down-interp)))) + (s5-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> gp-0 up-down-interp)))) + (set! (-> s5-2 frame-interp 1) f1-7) + (set! (-> s5-2 frame-interp 0) f1-7) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe f0-6 2)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; definition for function target-pilot-car-anim-loop +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-car-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-pilot-car-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-car-turn-front-ja) + (ja :chan 2 :group! jakb-pilot-car-up-down-ja) + (until #f + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (+ 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-3) + (set! (-> s5-1 frame-interp 0) f0-3) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let ((f0-6 (* 10.0 (- 1.0 (-> gp-0 up-down-interp)))) + (s5-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> gp-0 up-down-interp)))) + (set! (-> s5-2 frame-interp 1) f1-7) + (set! (-> s5-2 frame-interp 0) f1-7) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe f0-6 2)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; definition for function target-pilot-wcar-anim-loop +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-wcar-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-pilot-wcar-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-wcar-turn-front-ja) + (ja :chan 2 :group! jakb-pilot-car-up-down-ja) + (until #f + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (+ 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-3) + (set! (-> s5-1 frame-interp 0) f0-3) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let ((f0-6 (* 10.0 (- 1.0 (-> gp-0 up-down-interp)))) + (s5-2 (-> self skel root-channel 2)) + ) + (let ((f1-7 (fabs (-> gp-0 up-down-interp)))) + (set! (-> s5-2 frame-interp 1) f1-7) + (set! (-> s5-2 frame-interp 0) f1-7) + ) + (set! (-> s5-2 num-func) num-func-identity) + (set! (-> s5-2 frame-num) (ja-aframe f0-6 2)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; definition for function target-pilot-glider-anim-loop +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-pilot-glider-anim-loop target () + (ja-channel-push! 2 (seconds 0.1)) + (ja :group! jakb-pilot-glider-turn-back-ja) + (ja :chan 1 :group! jakb-pilot-glider-turn-front-ja) + (until #f + (let* ((gp-0 (-> self pilot)) + (f30-0 (* 5.0 (- 1.0 (-> gp-0 left-right-interp)))) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-3 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-3) + (set! (-> s5-1 frame-interp 0) f0-3) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; definition for function target-daxter-pilot-car-anim-loop +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior target-daxter-pilot-car-anim-loop target () + (ja-channel-push! 3 (seconds 0.1)) + (ja :group! jakb-wings-lightjak-stance-ja) + (ja :chan 1 :group! jakb-wings-lightjak-get-on-land-ja) + (ja :chan 2 :group! jakb-wings-lightjak-swoop-fall-loop-ja) + (until #f + (when (or (-> self pilot jumping?) (let ((v1-14 (ja-group))) + (and v1-14 (= v1-14 jakb-wings-lightjak-swoop1-ja)) + ) + ) + (let ((v1-20 (ja-group))) + (if (not (and v1-20 (= v1-20 jakb-wings-lightjak-swoop1-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja :group! jakb-wings-lightjak-swoop1-ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 3 (seconds 0.3)) + (ja :group! jakb-wings-lightjak-stance-ja) + (ja :chan 1 :group! jakb-wings-lightjak-get-on-land-ja) + (ja :chan 2 :group! jakb-wings-lightjak-swoop-fall-loop-ja) + (set! (-> self pilot jumping?) #f) + ) + ) + (when (and (not (-> self pilot jumping?)) (let ((v1-57 (ja-group))) + (not (and v1-57 (= v1-57 jakb-wings-lightjak-swoop1-ja))) + ) + ) + (let ((gp-0 (-> self pilot))) + (let ((f30-0 (* 5.0 (+ 1.0 (-> gp-0 left-right-interp))))) + (ja :num-func num-func-identity :frame-num (ja-aframe f30-0 0)) + (let ((s5-1 (-> self skel root-channel 1))) + (let ((f0-6 (* 0.5 (+ 1.0 (-> gp-0 front-back-interp))))) + (set! (-> s5-1 frame-interp 1) f0-6) + (set! (-> s5-1 frame-interp 0) f0-6) + ) + (set! (-> s5-1 num-func) num-func-identity) + (set! (-> s5-1 frame-num) (ja-aframe f30-0 1)) + ) + ) + (let* ((f30-1 (* 10.0 (- 1.0 (-> gp-0 up-down-interp)))) + (f0-9 (ja-aframe-num 2)) + (f28-0 (-> self skel root-channel 2 frame-interp 0)) + (f30-2 (seek f0-9 f30-1 (* 30.0 (seconds-per-frame)))) + (f0-16 (seek f28-0 (fabs (-> gp-0 up-down-interp)) (* 4.0 (seconds-per-frame)))) + ) + (ja :chan 2 + :frame-interp0 f0-16 + :frame-interp1 f0-16 + :num-func num-func-identity + :frame-num (ja-aframe f30-2 2) + ) + ) + ) + ) + (can-play-stance-amibent?) + (suspend) + ) + #f + (none) + ) + +;; definition for function target-pilot-trans +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior target-pilot-trans target () + (let ((gp-0 (-> self pilot))) + (process-drawable-set-riding self #t) + (let* ((v1-0 (-> gp-0 vehicle)) + (a0-1 (the-as object (l32-false-check v1-0))) + (s5-0 (and (nonzero? (the-as int a0-1)) + (begin (set! a0-1 (-> v1-0 process 0)) (if (= (-> v1-0 pid) (-> (the-as process a0-1) pid)) + (the-as vehicle a0-1) + ) + ) + ) + ) + ) + (cond + ((not s5-0) + (ja-channel-set! 0) + (go target-falling #f) + ) + (#t + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (set! (-> gp-0 accel-array 7 quad) (-> gp-0 accel-array 6 quad)) + (set! (-> gp-0 accel-array 6 quad) (-> gp-0 accel-array 5 quad)) + (set! (-> gp-0 accel-array 5 quad) (-> gp-0 accel-array 4 quad)) + (set! (-> gp-0 accel-array 4 quad) (-> gp-0 accel-array 3 quad)) + (set! (-> gp-0 accel-array 3 quad) (-> gp-0 accel-array 2 quad)) + (set! (-> gp-0 accel-array 2 quad) (-> gp-0 accel-array 1 quad)) + (set! (-> gp-0 accel-array 1 quad) (-> gp-0 accel-array 0 quad)) + (get-linear-accel! s5-0 (the-as vector (-> gp-0 accel-array))) + (vector-reset! (-> s4-0 rvec)) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (the-as vector (-> gp-0 accel-array)) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 1) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 2) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 3) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 4) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 5) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 6) 1.0) + (vector+float*! (-> s4-0 rvec) (-> s4-0 rvec) (-> gp-0 accel-array 7) 1.0) + (vector-float*! (-> s4-0 rvec) (-> s4-0 rvec) 0.5) + (matrix-transpose! (the-as matrix (-> s4-0 uvec)) (-> self node-list data 0 bone transform)) + (vector-rotate*! (-> gp-0 local-accel) (-> s4-0 rvec) (the-as matrix (-> s4-0 uvec))) + ) + (copy-vehicle-controls! s5-0 (-> gp-0 controls)) + (let ((f30-0 (* 182.04445 (* 0.6 (the float (current-time))))) + (s5-1 (-> gp-0 local-accel)) + ) + (let ((f1-6 + (+ (-> gp-0 controls steering) + (-> gp-0 left-right-bias) + (* 0.03 (sin f30-0)) + (* -1.0 (-> s5-1 x) (-> gp-0 left-right-accel-factor)) + ) + ) + ) + (set! (-> gp-0 left-right-interp) + (fmax + (fmin + (+ (-> gp-0 left-right-interp) (* 8.0 (- f1-6 (-> gp-0 left-right-interp)) (seconds-per-frame))) + (-> gp-0 left-right-max) + ) + (-> gp-0 left-right-min) + ) + ) + ) + (let ((f3-1 + (+ (-> gp-0 controls lean-z) (* 0.03 (cos f30-0)) (* -1.0 (-> s5-1 z) (-> gp-0 front-back-accel-factor))) + ) + ) + (set! (-> gp-0 front-back-interp) + (fmax + -1.0 + (fmin 1.0 (+ (-> gp-0 front-back-interp) (* 8.0 (- f3-1 (-> gp-0 front-back-interp)) (seconds-per-frame)))) + ) + ) + ) + (let ((f3-5 (+ (* 0.03 (cos f30-0)) (* -1.0 (-> s5-1 y) (-> gp-0 up-down-accel-factor))))) + (set! (-> gp-0 up-down-interp) + (fmax + -1.0 + (fmin 1.0 (+ (-> gp-0 up-down-interp) (* 8.0 (- f3-5 (-> gp-0 up-down-interp)) (seconds-per-frame)))) + ) + ) + ) + ) + (when (and (-> self next-state) (= (-> self next-state name) 'target-pilot-stance)) + (let* ((v1-65 (-> gp-0 accel-array)) + (f0-30 (+ (* (-> v1-65 0 x) (-> v1-65 0 x)) (* (-> v1-65 0 z) (-> v1-65 0 z)))) + ) + (if (or (and (-> self pilot as-daxter?) (let ((f1-25 1024000.0)) + (< (* f1-25 f1-25) f0-30) + ) + ) + (let ((f1-28 2048000.0)) + (< (* f1-28 f1-28) f0-30) + ) + ) + (go target-pilot-impact) + ) + ) + ) + ) + (else + (go target-pilot-get-off (the-as handle a0-1)) + ) + ) + ) + ) + (none) + ) + +;; definition for function target-pilot-signal-ready +(defbehavior target-pilot-signal-ready target () + (when (not (focus-test? self pilot-riding)) + (logior! (-> self focus-status) (focus-status pilot-riding)) + (let ((gp-0 (handle->process (-> self pilot vehicle)))) + (when gp-0 + (if (logtest? #x80000 (-> (the-as vehicle gp-0) info flags)) + (set-setting! 'cloth #f 0.0 0) + ) + (if (logtest? #x100000 (-> (the-as vehicle gp-0) info flags)) + (set-setting! 'armor #f 0.0 0) + ) + (send-event gp-0 'pilot-on (-> self pilot seat-index)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-pilot-stance (target) + :event target-pilot-handler + :exit target-pilot-exit + :trans (behavior () + (target-pilot-trans) + ) + :code (behavior () + (local-vars (v1-9 uint)) + (target-pilot-signal-ready) + (logior! (-> self target-flags) (target-flags tf6)) + (set! (-> self control mod-surface) *pilot-mods*) + (logior! (-> self control status) (collide-status on-surface on-ground)) + (cond + ((-> self pilot as-daxter?) + (target-daxter-pilot-car-anim-loop) + ) + ((begin (set! v1-9 (-> self pilot stance)) (zero? v1-9)) + (target-pilot-bike-anim-loop) + ) + ((= v1-9 1) + (target-pilot-car-anim-loop) + ) + ((= v1-9 2) + (target-pilot-wcar-anim-loop) + ) + ((= v1-9 3) + (target-pilot-glider-anim-loop) + ) + (else + (until #f + (suspend) + ) + #f + ) + ) + ) + :post (behavior () + (target-pilot-post) + ) + ) + +;; failed to figure out what this is: +(defstate target-pilot-impact (target) + :event target-pilot-handler + :exit target-pilot-exit + :trans target-pilot-trans + :code (behavior () + (local-vars (v1-1 float) (v1-196 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> self pilot))) + (.lvf vf1 (&-> (-> gp-0 local-accel) 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-1 vf1) + (let ((f0-0 v1-1) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> gp-0 local-accel quad)) + (set! (-> s5-0 x) (* 4.0 (-> s5-0 x))) + (vector-float*! s5-0 s5-0 (/ 1.0 (sqrtf f0-0))) + (let ((s4-0 (cond + ((< 0.707 (-> s5-0 x)) + 5 + ) + ((< (-> s5-0 x) -0.707) + 4 + ) + ((< 0.707 (-> s5-0 y)) + 3 + ) + ((< (-> s5-0 y) -0.707) + 2 + ) + ((< 0.707 (-> s5-0 z)) + 1 + ) + ((< (-> s5-0 z) -0.707) + 0 + ) + (else + 6 + ) + ) + ) + ) + (cond + ((-> self pilot as-daxter?) + (ja-channel-push! 1 (seconds 0.05)) + (when (and (not (or (= s4-0 4) (= s4-0 5))) (!= s4-0 6)) + (if (< 0.0 (-> s5-0 x)) + (set! s4-0 5) + (set! s4-0 4) + ) + ) + (cond + ((= s4-0 4) + (ja-no-eval :group! jakb-wings-lightjak-swoop-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= s4-0 5) + (ja-no-eval :group! jakb-shield-shield-lod0-jg :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (else + (let ((v1-73 (-> self pilot stance))) + (cond + ((zero? v1-73) + (ja-channel-push! 1 (seconds 0.05)) + (let ((v1-74 s4-0)) + (cond + ((= v1-74 4) + (ja-no-eval :group! jakb-pilot-bike-smack-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= v1-74 5) + (ja-no-eval :group! jakb-pilot-bike-smack-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((zero? v1-74) + (ja-no-eval :group! jakb-pilot-bike-smack-front-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= v1-74 1) + (ja-no-eval :group! jakb-pilot-bike-smack-back-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-pilot-bike-smack-shock-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ((= v1-73 3) + (suspend) + 0 + ) + ((begin (ja-channel-push! 1 (seconds 0.05)) (set! v1-196 s4-0) (= v1-196 4)) + (ja-no-eval :group! jakb-pilot-car-smack-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= v1-196 5) + (ja-no-eval :group! jakb-pilot-car-smack-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((zero? v1-196) + (ja-no-eval :group! jakb-pilot-car-smack-front-ja :num! (seek! max 1.3) :frame-num (ja-aframe 4.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.3)) + ) + ) + ((= v1-196 1) + (ja-no-eval :group! jakb-pilot-car-smack-back-ja :num! (seek!) :frame-num (ja-aframe 2.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! jakb-pilot-car-smack-shock-ja :num! (seek!) :frame-num (ja-aframe 0.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + ) + ) + (.svf (&-> (-> gp-0 accel-array) 0 quad) vf0) + ) + (go target-pilot-stance) + ) + ) + :post target-pilot-post + ) + +;; failed to figure out what this is: +(defstate target-pilot-daxter-perch (target) + :event target-pilot-handler + :exit target-pilot-exit + :trans target-pilot-trans + :code (behavior () + (set! (-> self control unknown-word04) (the-as uint #f)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! jakb-pilot-wcar-snake-in-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (loop + (ja-no-eval :group! jakb-pilot-wcar-snake-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (-> self control unknown-spool-anim00) + (goto cfg-11) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (label cfg-11) + (ja-no-eval :group! jakb-pilot-wcar-snake-out-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go target-pilot-stance) + ) + :post target-pilot-post + ) + +;; failed to figure out what this is: +(let ((v1-12 (copy *empty-mods* 'loading-level))) + (set! (-> v1-12 flags) (surface-flag)) + (set! *pilot-get-on-mods* v1-12) + ) + +;; failed to figure out what this is: +(defstate target-pilot-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('end-mode) + (let ((v1-1 (-> block param 0)) + (a0-1 'pilot) + ) + (when (= v1-1 a0-1) + (cond + ((focus-test? self pilot-riding) + (go target-pilot-get-off (the-as handle a0-1)) + ) + (else + (ja-channel-set! 0) + (go target-falling #f) + ) + ) + ) + ) + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :exit target-pilot-exit + :trans (behavior () + (let* ((s5-0 (handle->process (-> self pilot vehicle))) + (t9-0 type?) + (a0-3 s5-0) + (gp-0 (if (t9-0 a0-3 vehicle) + s5-0 + ) + ) + ) + (cond + ((not gp-0) + (ja-channel-set! 0) + (go target-falling #f) + ) + ((focus-test? (the-as process-focusable gp-0) dead) + (go target-pilot-get-off (the-as handle a0-3)) + ) + (else + (vehicle-method-66 (the-as vehicle gp-0) (-> self control unknown-vector38) (-> self pilot seat-index)) + (set! (-> self control unknown-vector40 quad) (-> (the-as vehicle gp-0) root quat quad)) + ) + ) + ) + ) + :code (behavior () + (logior! (-> self focus-status) (focus-status pilot)) + (logior! (-> self target-flags) (target-flags tf6)) + (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (sound-play "jump") + (let ((gp-1 (if (zero? (-> self pilot stance)) + jakb-pilot-bike-get-on-ja + jakb-pilot-car-get-on-ja + ) + ) + ) + (ja-channel-set! 1) + (set! (-> self control mod-surface) *pilot-get-on-mods*) + (send-event (ppointer->process (-> self manipy)) 'draw #t) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (ja :group! gp-1 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (let ((f30-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 10.0)))) + (let ((f28-0 (lerp-scale 0.0 1.0 (ja-aframe-num 0) 0.0 10.0))) + (vector-lerp! + (-> self control trans) + (-> self control unknown-vector37) + (-> self control unknown-vector38) + f30-0 + ) + (set! (-> self control trans y) + (lerp (-> self control unknown-vector37 y) (-> self control unknown-vector38 y) f28-0) + ) + ) + (quaternion-slerp! + (-> self control quat-for-control) + (the-as quaternion (-> self control unknown-vector39)) + (the-as quaternion (-> self control unknown-vector40)) + f30-0 + ) + ) + (rot->dir-targ! (-> self control)) + (if (>= (ja-aframe-num 0) 20.5) + (target-pilot-signal-ready) + ) + (suspend) + (let ((a1-8 (handle->process (-> self pilot vehicle)))) + (if a1-8 + (set! (-> self alt-cam-pos quad) (-> (the-as vehicle a1-8) rbody position quad)) + ) + ) + (ja :num! (seek!)) + ) + (go target-pilot-stance) + ) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(let ((v1-15 (copy *forward-jump-mods* 'loading-level))) + (set! (-> v1-15 fric) 0.0) + (set! (-> v1-15 nonlin-fric-dist) 0.0) + (set! (-> v1-15 turnv) 0.0) + (set! (-> v1-15 turnvv) 0.0) + (set! (-> v1-15 tiltv) 131072.0) + (set! (-> v1-15 tiltvf) 30.0) + (set! (-> v1-15 mult-hook) + (the-as + (function surface surface surface int none) + (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (case arg3 + ((1) + (persist-with-delay *setting-control* 'rapid-tracking (seconds 0.05) 'rapid-tracking #f 0.0 0) + ) + ) + ) + ) + ) + (set! *pilot-get-off-mods* v1-15) + ) + +;; failed to figure out what this is: +(defstate target-pilot-get-off (target) + :event target-standard-event-handler + :exit target-pilot-exit + :trans (behavior () + (let ((gp-0 (handle->process (-> self pilot vehicle)))) + (when (not (if (type? gp-0 vehicle) + gp-0 + ) + ) + (ja-channel-set! 0) + (go target-falling #f) + ) + ) + ) + :code (behavior ((arg0 handle)) + (local-vars (f30-0 float)) + (let ((v1-1 (-> self control root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self control backup-collide-with)) + ) + (logclear! (-> self focus-status) (focus-status pilot-riding)) + (set! (-> self control mod-surface) *pilot-get-off-mods*) + (rot->dir-targ! (-> self control)) + (send-event *camera* 'set-dist #f #f) + (set! (-> self neck flex-blend) 0.0) + (persist-with-delay *setting-control* 'mode-name (seconds 0.05) 'mode-name 'cam-decel 0.0 0) + (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'hi 0.0 0) + (persist-with-delay *setting-control* 'interp-time (seconds 0.1) 'interp-time 'lo 300.0 0) + (persist-with-delay + *setting-control* + 'immediate-string-min-max + (seconds 0.05) + 'immediate-string-min-max + #f + 0.0 + 0 + ) + 0.0 + (let ((gp-0 (cond + ((zero? (-> self pilot stance)) + (set! f30-0 7.2) + jakb-pilot-bike-get-off-ja + ) + (else + (set! f30-0 15.2) + jakb-pilot-car-get-off-ja + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! gp-0 :num! (seek! (ja-aframe f30-0 0) 2.0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe f30-0 0) 2.0)) + ) + (let ((v1-37 (camera-matrix)) + (gp-2 (new 'stack-no-clear 'matrix)) + ) + (set! (-> gp-2 rvec quad) (-> v1-37 rvec quad)) + (set! (-> gp-2 uvec quad) (-> v1-37 fvec quad)) + (set! (-> gp-2 uvec y) 0.0) + (vector-normalize! (-> gp-2 uvec) 1.0) + (vector-reset! (-> gp-2 fvec)) + (vector+float*! + (-> gp-2 fvec) + (-> gp-2 fvec) + (-> gp-2 rvec) + (* 16384.0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + ) + (vector+float*! + (-> gp-2 fvec) + (-> gp-2 fvec) + (-> gp-2 uvec) + (* 16384.0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) + ) + (vector+! (-> self control transv) (-> self control transv) (-> gp-2 fvec)) + ) + (let* ((f0-12 (vector-normalize-ret-len! (-> self control transv) 1.0)) + (f0-13 (fmin 122880.0 f0-12)) + ) + (vector-float*! (-> self control transv) (-> self control transv) f0-13) + ) + (go target-jump 10240.0 10240.0 *pilot-get-off-mods*) + ) + :post target-pilot-post + ) + +;; failed to figure out what this is: +(defstate target-pilot-grab (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (cond + ((and (= message 'query) (= (-> block param 0) 'mode)) + (-> self state name) + ) + (else + (case message + (('end-mode) + (case (-> block param 0) + (('grab) + (go target-pilot-stance) + ) + (('gun) + (target-gun-end-mode #t) + ) + ) + ) + (('clone-anim) + (go target-pilot-clone-anim (process->handle (the-as process (-> block param 0)))) + ) + (('vehicle-crash) + (go target-grab 'stance) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self control mod-surface) *grab-mods*) + (set! (-> self neck flex-blend) 0.0) + (logior! (-> self target-flags) (target-flags tf2)) + (logior! (-> self focus-status) (focus-status grabbed)) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags tf2)) + (logclear! (-> self focus-status) (focus-status grabbed)) + (logclear! (-> self water flags) (water-flag jump-out)) + ((-> target-pilot-start exit)) + ) + :code (behavior () + (until #f + (set-forward-vel 0.0) + (suspend) + ) + #f + ) + :post target-pilot-post + ) + +;; failed to figure out what this is: +(defstate target-pilot-clone-anim (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'trans) (= (-> block param 0) 'restore)) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ((-> target-pilot-grab event) proc argc message block) + ) + :enter (-> target-clone-anim enter) + :exit (behavior () + (set! (-> self control draw-offset y) (the-as float (-> self control unknown-word04))) + (set! (-> self control cspace-offset y) (-> self control draw-offset y)) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + ((-> target-clone-anim exit)) + ((-> target-pilot-start exit)) + (vector-reset! (-> self control transv)) + ) + :code (behavior ((arg0 handle)) + (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) + (set! (-> self control draw-offset y) 0.0) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim) + (clone-anim arg0 #t "") + (go target-pilot-stance) + ) + :post (behavior () + (vector+! (-> self pilot pilot-trans) (-> self control trans) (-> self control cspace-offset)) + (quaternion-copy! (the-as quaternion (-> self pilot pilot-quat)) (-> self control quat)) + (set! (-> self pilot pilot-scale quad) (-> self control scale quad)) + (target-no-ja-move-post) + ) + ) + +;; failed to figure out what this is: +(defstate target-pilot-edge-grab (target) + :event (-> target-edge-grab event) + :enter (behavior ((arg0 pilot-edge-grab-info)) + (set! (-> self control status) (collide-status)) + (let ((gp-0 *edge-grab-info*)) + (mem-copy! (the-as pointer (-> gp-0 pilot-edge-grab)) (the-as pointer arg0) 40) + (set! (-> gp-0 pilot-grab-interp) 0.0) + (set! (-> gp-0 pilot-start-grab-pos quad) (-> self control trans quad)) + (set! (-> gp-0 actor-handle) (-> arg0 handle)) + ((-> target-edge-grab enter)) + (let* ((s5-1 (handle->process (-> gp-0 actor-handle))) + (a0-9 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (set! (-> gp-0 pilot-edge-grab?) + (if (and a0-9 + (< 24576.0 (fabs (- (-> (get-trans (the-as process-focusable a0-9) 0) y) (-> self control trans y)))) + ) + 'target-double-jump + 'target-jump + ) + ) + ) + ) + ) + :exit (-> target-edge-grab exit) + :trans (-> target-edge-grab trans) + :code (-> target-edge-grab code) + :post target-no-move-post + ) + +;; failed to figure out what this is: +(defstate target-pilot-hit (target) + :event target-generic-event-handler + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-death))) + (logclear! (-> self focus-status) (focus-status dead hit)) + ) + ((-> target-pilot-start exit)) + ) + :code (behavior ((arg0 symbol) (arg1 attack-info)) + (local-vars (sv-16 attack-info)) + (set-time! (-> self state-time)) + (set! (-> self neck flex-blend) 0.0) + (set! sv-16 (-> self attack-info)) + (let ((v1-4 sv-16)) + (set! (-> v1-4 attacker) (the-as handle #f)) + (set! (-> v1-4 mode) 'generic) + (set! (-> v1-4 shove-back) 6144.0) + (set! (-> v1-4 shove-up) 4915.2) + (set! (-> v1-4 angle) #f) + (set! (-> v1-4 trans quad) (-> self control trans quad)) + (set! (-> v1-4 control) 0.0) + (set! (-> v1-4 invinc-time) (-> *TARGET-bank* hit-invulnerable-timeout)) + (set! (-> v1-4 damage) (-> *FACT-bank* health-default-inc)) + ) + (combine! sv-16 arg1 self) + (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) + (go target-pilot-death (-> sv-16 mode)) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(defstate target-pilot-death (target) + :event (-> target-death event) + :exit (behavior () + ((-> target-pilot-start exit)) + ((-> target-death exit)) + ) + :code (behavior ((arg0 symbol)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set! (-> self control did-move-to-pole-or-max-jump-height) + (the-as float (send-event (handle->process (-> self attack-info attacker)) 'target 'die arg0)) + ) + (set! (-> self neck flex-blend) 0.0) + (target-timed-invulnerable-off self 0) + (let ((s5-0 (-> self child))) + (while s5-0 + (send-event (ppointer->process s5-0) 'notice 'die) + (set! s5-0 (-> s5-0 0 brother)) + ) + ) + (set! (-> self death-resetter continue) #f) + (set! (-> self death-resetter node) (game-task-node none)) + (set! (-> self death-resetter reset-mode) 'life) + (set! (-> self death-resetter execute) #f) + (case arg0 + (('bot) + (set-setting! 'process-mask 'set 0.0 (process-mask platform projectile death)) + ) + (('endlessfall 'instant-death 'lava 'dark-eco-pool 'melt 'explode 'grenade 'drown-death) + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + ) + (else + (set-setting! 'process-mask 'set 0.0 (process-mask enemy platform projectile death)) + (when (using-gun? self) + (send-event (ppointer->process (-> self gun gun)) 'notice 'die) + (target-gun-end-mode #f) + ) + ) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (apply-settings *setting-control*) + (set! (-> self control transv quad) (the-as uint128 0)) + (logior! (-> self focus-status) (focus-status dead)) + (case arg0 + (('melt 'grenade 'explode) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.2)) + (suspend) + ) + ) + (case arg0 + (('dark-eco-pool) + (sound-play "death-darkeco") + (cond + ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) + ) + ) + ) + (('grenade 'explode) + (sound-play "explosion") + (cond + ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 65)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 65)) + ) + ) + ) + (('lava 'melt) + (sound-play "death-melt") + (cond + ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) + ) + ) + ) + ) + (let ((v1-158 (-> self control root-prim))) + (set! (-> v1-158 prim-core collide-as) (collide-spec)) + (set! (-> v1-158 prim-core collide-with) (collide-spec)) + ) + 0 + (ja-channel-set! 0) + (let ((s5-11 (current-time))) + (until (time-elapsed? s5-11 (seconds 1.8)) + (suspend) + ) + ) + ) + (('endlessfall) + (sound-play "death-fall") + (if (not (-> self pilot as-daxter?)) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) + ) + ) + (sound-params-set! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2 -1.0) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((f0-5 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-word04) (the-as uint f0-5)) + (let ((v1-179 (new-stack-vector0))) + (let ((f1-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-179 (-> self control transv) (vector-float*! v1-179 (-> self control dynam gravity-normal) f1-3)) + ) + (let* ((f1-4 (vector-length v1-179)) + (f2-1 f1-4) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-5) + (vector-float*! v1-179 v1-179 (/ f1-4 f2-1)) + ) + ) + ) + ) + (let ((s5-13 (current-time))) + (until (time-elapsed? s5-13 (seconds 0.5)) + (suspend) + ) + ) + ) + (('drown-death) + (logclear! (-> self water flags) (water-flag swim-ground)) + (let ((f0-8 (fmin -4096.0 (- (-> self control ground-impact-vel))))) + (set! (-> self control unknown-word04) (the-as uint f0-8)) + (let ((v1-190 (new-stack-vector0))) + (let ((f1-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-190 (-> self control transv) (vector-float*! v1-190 (-> self control dynam gravity-normal) f1-8)) + ) + (let* ((f1-9 (vector-length v1-190)) + (f2-3 f1-9) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-8) + (vector-float*! v1-190 v1-190 (/ f1-9 f2-3)) + ) + ) + ) + ) + (let ((s5-14 (current-time))) + (until (time-elapsed? s5-14 (seconds 2)) + (suspend) + ) + ) + ) + (('bot) + (set! (-> self trans-hook) #f) + (while (not (-> self control unknown-spool-anim00)) + (set-forward-vel 0.0) + (suspend) + ) + ) + (('big-explosion) + (let ((s5-15 (current-time))) + (until (time-elapsed? s5-15 (seconds 2)) + (suspend) + ) + ) + ) + (else + ) + ) + (target-death-reset arg0 #f) + ) + :post target-pilot-post + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc index cca43c6201..aea5332d64 100644 --- a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc @@ -474,7 +474,7 @@ (set! (-> this bolts) (new 'process 'boxed-array lightning-bolt 3)) (dotimes (s5-0 (-> this bolts length)) (set! (-> this bolts s5-0) (new 'process 'lightning-bolt)) - (lightning-bolt-method-9 (-> this bolts s5-0) 2 16 *darkjak-ball-lightning*) + (init! (-> this bolts s5-0) 2 16 *darkjak-ball-lightning*) ) (set! (-> this fire-sound) (new-sound-id)) (let ((a0-13 (-> this root transv))) diff --git a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc index 019a10af8e..2da1155c7e 100644 --- a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc @@ -1249,8 +1249,8 @@ (ja-no-eval :group! jakb-jump-ja :num! (seek!) :frame-num 0.0) (when (= (-> arg0 angle) 'air) (sound-play "smack-surface") - (do-effect (-> self skel effect) (the-as symbol "group-smack-surface") 0.0 6) - (do-effect (-> self skel effect) (the-as symbol "group-smack-surface-dizzy") 0.0 9) + (do-effect (-> self skel effect) "group-smack-surface" 0.0 6) + (do-effect (-> self skel effect) "group-smack-surface-dizzy" 0.0 9) ) ) ((= v1-0 'shove) diff --git a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc index ab8840fbde..9efc596126 100644 --- a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc @@ -250,14 +250,14 @@ target-mech-stance (target-mech-start handle float symbol) target-mech-walk - target-pilot-clone-anim + (target-pilot-clone-anim handle) target-pilot-daxter-perch - target-pilot-death + (target-pilot-death symbol) (target-pilot-edge-grab pilot-edge-grab-info) - target-pilot-get-off + (target-pilot-get-off handle) target-pilot-get-on target-pilot-grab - target-pilot-hit + (target-pilot-hit symbol attack-info) target-pilot-impact target-pilot-stance (target-pilot-start handle symbol symbol) diff --git a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc index 28b56b3c4c..1890020e64 100644 --- a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc @@ -515,7 +515,7 @@ ) ) (else - (do-effect (-> self skel effect) (the-as symbol "group-spin-hit") -1.0 49) + (do-effect (-> self skel effect) "group-spin-hit" -1.0 49) ) ) (play-effect-sound @@ -647,7 +647,7 @@ ) ) ) - (do-effect (-> self skel effect) (the-as symbol "group-uppercut-hit") -1.0 28) + (do-effect (-> self skel effect) "group-uppercut-hit" -1.0 28) (play-effect-sound (-> self skel effect) (the-as symbol "sound") @@ -659,8 +659,8 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) ) ((or (= v1-57 'flop) (= v1-57 'flop-down)) - (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 28) - (do-effect (-> self skel effect) (the-as symbol "group-flop-hit") -1.0 19) + (do-effect (-> self skel effect) "group-flop-hit" -1.0 28) + (do-effect (-> self skel effect) "group-flop-hit" -1.0 19) (play-effect-sound (-> self skel effect) (the-as symbol "sound") @@ -908,11 +908,11 @@ v0-0 ) (('do-effect) - (do-effect (-> self skel effect) (the-as symbol (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) + (do-effect (-> self skel effect) (the-as string (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1) (if (-> self sidekick) (do-effect (-> self sidekick 0 skel effect) - (the-as symbol (-> arg3 param 0)) + (the-as string (-> arg3 param 0)) (the-as float (-> arg3 param 1)) -1 ) @@ -1178,7 +1178,7 @@ ;; definition for function target-standard-event-handler ;; INFO: Used lq/sq (defbehavior target-standard-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (at-0 int) (v1-317 object) (a2-5 symbol)) + (local-vars (at-0 int) (v1-317 object)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -1347,12 +1347,7 @@ (go target-board-start (process->handle (the-as process (-> arg3 param 1)))) ) ) - ((begin (set! a2-5 (= v1-63 'pilot)) (or a2-5 - (begin (set! a2-5 (= v1-63 'pilot-race)) a2-5) - (begin (set! a2-5 (= v1-63 'pilot-daxter)) a2-5) - (= v1-63 'pilot-race-daxter) - ) - ) + ((or (= v1-63 'pilot) (= v1-63 'pilot-race) (= v1-63 'pilot-daxter) (= v1-63 'pilot-race-daxter)) (let ((s5-1 (the-as object (-> arg3 param 1)))) (when (not (the-as uint s5-1)) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) @@ -1371,13 +1366,7 @@ (set! (-> s4-0 position quad) (-> self control trans quad)) (quaternion-copy! (-> s4-0 rotation) (-> self control quat)) (set! (-> s4-0 id) (the-as uint 0)) - (let ((v1-101 (vehicle-spawn - (the-as process (-> arg3 param 2)) - (the-as type s4-0) - (the-as traffic-object-spawn-params a2-5) - ) - ) - ) + (let ((v1-101 (vehicle-spawn (the-as vehicle-type (-> arg3 param 2)) s4-0))) (if v1-101 (set! s5-1 v1-101) ) @@ -1386,13 +1375,13 @@ ) (when s5-1 (let* ((v1-102 (-> arg3 param 0)) - (a2-6 (if (or (= v1-102 'pilot-daxter) (= v1-102 'pilot-race-daxter)) + (a2-8 (if (or (= v1-102 'pilot-daxter) (= v1-102 'pilot-race-daxter)) #t #f ) ) ) - (go target-pilot-start (process->handle s5-1) (the-as symbol (-> arg3 param 3)) a2-6) + (go target-pilot-start (process->handle s5-1) (the-as symbol (-> arg3 param 3)) a2-8) ) ) ) @@ -1936,3 +1925,7 @@ (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) (none) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/target-part_REF.gc b/test/decompiler/reference/jak3/engine/target/target-part_REF.gc index 4882cfaf9e..d96aa98808 100644 --- a/test/decompiler/reference/jak3/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-part_REF.gc @@ -888,7 +888,7 @@ ;; definition for function spt-birth-func-part-land-droppings-for (defun spt-birth-func-part-land-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object) (arg4 object)) (spt-birth-func-brightness-part-droppings-for arg0 arg1 arg2 arg3 arg4) - (birth-func-texture-group-2d arg0 arg1 (the-as sparticle-launchinfo arg2)) + (birth-func-texture-group-2d arg0 arg1 (the-as sparticle-launchinfo arg2) arg3 arg4) (none) ) @@ -1793,7 +1793,7 @@ ;; definition for function spt-birth-func-part-droppings-for (defun spt-birth-func-part-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) (spt-birth-func-brightness-part-droppings-for arg0 arg1 (the-as sprite-vec-data-2d arg2) arg3 arg4) - (birth-func-texture-group-2d arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) (none) ) @@ -2066,7 +2066,7 @@ arg3 arg4 ) - (birth-func-texture-group-2d arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) (none) ) @@ -2338,7 +2338,7 @@ arg3 arg4 ) - (birth-func-texture-group-2d arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) (none) ) @@ -4540,7 +4540,3 @@ (:rotate-y (degrees 0)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/target-pilot_REF.gc b/test/decompiler/reference/jak3/engine/target/target-pilot_REF.gc new file mode 100644 index 0000000000..28799376a0 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-pilot_REF.gc @@ -0,0 +1,513 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *pilot-mods*, type surface +(define *pilot-mods* (new 'static 'surface :name 'empty :seek0 1.0 :seek90 1.0 :seek180 1.0 :fric 1.0)) + +;; definition for function target-pilot-handler +;; WARN: disable def twice: 203. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior target-pilot-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (cond + ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + 'pilot + ) + (else + (case arg2 + (('end-mode) + (case (-> arg3 param 0) + (('pilot) + (let ((v1-5 (-> self pilot))) + (when (nonzero? v1-5) + (let ((a0-7 (handle->process (-> v1-5 vehicle)))) + (if a0-7 + (put-rider-in-seat (the-as vehicle a0-7) (-> v1-5 seat-index) (the-as process #f)) + ) + ) + ) + ) + (go target-pilot-get-off (process->handle arg0)) + ) + (('fldax) + (when (and (-> self next-state) (= (-> self next-state name) 'target-pilot-daxter-perch)) + (let ((v0-0 (the-as object #t))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + ) + (('gun) + (target-gun-end-mode #t) + ) + ) + ) + (('change-mode) + (case (-> arg3 param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> arg3 param 1)) + #t + (go target-pilot-grab) + ) + ) + ) + (('flut) + (go + target-flut-start + (process->handle (the-as process (-> arg3 param 1))) + (the-as symbol (if (>= arg1 2) + (-> arg3 param 2) + 'normal + ) + ) + (if (>= arg1 4) + (the-as int (-> arg3 param 3)) + -1 + ) + ) + ) + (('normal) + (go target-pilot-get-off (process->handle arg0)) + ) + (('gun) + (when (logtest? (-> self game features) (game-feature gun)) + (let ((gp-1 (-> arg3 param 2))) + (cond + ((using-gun? self) + (when (nonzero? gp-1) + (set! (-> self gun using-gun-type) (the-as pickup-type gp-1)) + gp-1 + ) + ) + (else + (target-gun-init (the-as pickup-type gp-1)) + ) + ) + ) + ) + ) + (('fldax) + (if (and (-> self next-state) (let ((v1-33 (-> self next-state name))) + (or (= v1-33 'target-pilot-stance) (= v1-33 'target-pilot-impact)) + ) + ) + (go target-pilot-daxter-perch) + ) + ) + ) + ) + (('swim) + #f + ) + (('clone-anim) + (go target-pilot-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + ) + (('get-vehicle) + (if (nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) + ) + ) + (('kill-vehicle) + (if (nonzero? (-> self pilot)) + (send-event (handle->process (-> self pilot vehicle)) 'go-die) + ) + ) + (('attack 'attack-or-shove 'attack-invinc) + (set-vector! (-> self draw color-mult) 0.25 0.25 0.25 1.0) + (target-attacked + arg2 + (the-as attack-info (-> arg3 param 1)) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + target-pilot-hit + ) + ) + (('vehicle-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type race-daxter-hit) + (speech-type race-jak-hit) + ) + ) + ) + (('vehicle-got-hit) + (speech-control-method-12 *speech-control* self (if (-> self pilot as-daxter?) + (speech-type race-daxter-got-hit) + (speech-type race-jak-got-hit) + ) + ) + ) + (else + (target-standard-event-handler arg0 arg1 arg2 arg3) + ) + ) + ) + ) + ) + +;; definition for function target-pilot-pidax-enter +(defbehavior target-pilot-pidax-enter target () + (set! (-> self pilot art-group-backup) (-> self draw art-group)) + (set! (-> self draw art-group) (-> self sidekick 0 draw art-group)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds2)) + (send-event (ppointer->process (-> self sidekick)) 'matrix 'indax) + ) + +;; definition for function target-pilot-pidax-exit +(defbehavior target-pilot-pidax-exit target () + (ja-channel-set! 0) + (set! (-> self draw art-group) (-> self pilot art-group-backup)) + (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) + (send-event (ppointer->process (-> self sidekick)) 'matrix #f) + ) + +;; definition for function target-pilot-exit +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior target-pilot-exit target () + (when (not (and (-> self next-state) (let ((v1-3 (-> self next-state name))) + (or (= v1-3 'target-pilot-stance) + (= v1-3 'target-pilot-impact) + (= v1-3 'target-pilot-daxter-perch) + (= v1-3 'target-pilot-get-off) + (= v1-3 'target-pilot-grab) + (= v1-3 'target-pilot-clone-anim) + (= v1-3 'target-pilot-hit) + (= v1-3 'target-pilot-death) + ) + ) + ) + ) + (let ((v1-4 (-> self manipy))) + (when v1-4 + (deactivate (-> v1-4 0)) + (set! (-> self manipy) (the-as (pointer manipy) #f)) + ) + ) + (process-drawable-set-riding self #f) + (when (-> self pilot as-daxter?) + (format 0 "Pidax exit~%") + (target-pilot-pidax-exit) + ) + (let ((gp-0 (-> self pilot))) + (when (nonzero? gp-0) + (set! (-> self control nav-radius) (-> gp-0 backup-nav-radius)) + (let ((s5-0 (handle->process (-> gp-0 vehicle)))) + (when s5-0 + (send-event *traffic-manager* 'player-exit-vehicle (-> (the-as vehicle s5-0) info object-type)) + (remove-riders (the-as vehicle s5-0) (the-as handle self)) + (send-event s5-0 'player-get-off) + (when (nonzero? (-> gp-0 hud-health)) + (send-event (handle->process (-> gp-0 hud-health)) 'hide-and-die) + (set! (-> gp-0 hud-health) (new 'static 'handle)) + 0 + ) + (when (nonzero? (-> gp-0 hud-turbo)) + (send-event (handle->process (-> gp-0 hud-turbo)) 'hide-and-die) + (set! (-> gp-0 hud-turbo) (new 'static 'handle)) + 0 + ) + ) + ) + ) + ) + (set! (-> self neck flex-blend) 1.0) + (let ((v1-49 (-> self control root-prim))) + (set! (-> v1-49 prim-core collide-as) (-> self control backup-collide-as)) + (set! (-> v1-49 prim-core collide-with) (-> self control backup-collide-with)) + ) + (logclear! (-> self focus-status) (focus-status pilot-riding pilot)) + (logclear! (-> self control root-prim prim-core action) (collide-action stuck-wall-escape)) + (set! (-> self control mod-surface) *walk-mods*) + (logclear! (-> self target-flags) (target-flags tf6)) + (remove-setting! 'cloth) + (remove-setting! 'armor) + (enable-set! (-> self arm-ik 0) #f) + (enable-set! (-> self arm-ik 1) #f) + (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) + (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) + (let ((v1-74 (-> self node-list data))) + (set! (-> v1-74 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) + (set! (-> v1-74 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-74 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (target-collide-set! 'normal 0.0) + (set! (-> self control reaction) target-collision-reaction) + (vector-identity! (-> self draw color-mult)) + (set! (-> self control cspace-offset quad) (the-as uint128 0)) + (logior! (-> self water flags) (water-flag find-water)) + (target-exit) + ) + ) + +;; definition for function target-pilot-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch water-flag vs object. +(defbehavior target-pilot-init target ((arg0 handle) (arg1 symbol)) + (target-exit) + (target-lightjak-end-mode #f) + (target-darkjak-end-mode #f) + (if (zero? (-> self pilot)) + (set! (-> self pilot) (new 'process 'pilot-info)) + ) + (let ((s5-0 (-> self pilot))) + (set! (-> s5-0 backup-nav-radius) (-> self control nav-radius)) + (set! (-> s5-0 gun?) #t) + (set! (-> s5-0 enable-cam-side-shift) #f) + (set! (-> s5-0 as-daxter?) arg1) + (set! (-> s5-0 entity) #f) + (set! (-> s5-0 cam-side-shift) 0.0) + (if (-> self pilot as-daxter?) + (target-pilot-pidax-enter) + ) + (cond + ((handle->process arg0) + (set! (-> s5-0 vehicle) arg0) + ) + (else + (break!) + 0 + ) + ) + (let ((s4-1 (handle->process (-> s5-0 vehicle)))) + (when s4-1 + (send-event *traffic-manager* 'player-enter-vehicle (-> (the-as vehicle s4-1) info object-type)) + (set! (-> self game current-vehicle) (the-as game-vehicle-u8 (-> (the-as vehicle s4-1) info vehicle-type))) + (set! (-> s5-0 entity) (-> (the-as vehicle s4-1) entity)) + (set! (-> s5-0 gun?) (logtest? (-> (the-as vehicle s4-1) info flags) 32)) + (set! (-> s5-0 enable-cam-side-shift) (logtest? (-> (the-as vehicle s4-1) info flags) 128)) + (if (logtest? (-> (the-as vehicle s4-1) info flags) 256) + (set! (-> s5-0 hud-health) (process->handle (hud-vehicle-health-spawn (the-as vehicle s4-1)))) + ) + (if (logtest? (-> (the-as vehicle s4-1) info flags) 512) + (set! (-> s5-0 hud-turbo) (process->handle (hud-vehicle-turbo-spawn (the-as vehicle s4-1)))) + ) + (set! (-> s5-0 left-right-bias) (-> (the-as vehicle s4-1) info handling player-turn-anim-bias)) + (set! (-> s5-0 left-right-min) (-> (the-as vehicle s4-1) info handling player-turn-anim-min)) + (set! (-> s5-0 left-right-max) (-> (the-as vehicle s4-1) info handling player-turn-anim-max)) + (send-event + (ppointer->process (-> (the-as vehicle s4-1) parent)) + 'player-got-on-vehicle-child + (the-as vehicle s4-1) + ) + (set! (-> s5-0 stance) (the-as uint (vehicle-method-70 (the-as vehicle s4-1)))) + (let ((s3-0 (vehicle-method-65 (the-as vehicle s4-1)))) + (dotimes (s2-0 s3-0) + (let ((a0-35 (get-rider-in-seat (the-as vehicle s4-1) s2-0))) + (if (and a0-35 (send-event a0-35 'knocked-off)) + (put-rider-in-seat (the-as vehicle s4-1) s2-0 (the-as process #f)) + ) + ) + ) + ) + (let ((v1-68 (get-best-seat (the-as vehicle s4-1) (-> self control trans) (vehicle-seat-flag vsf0) 1))) + (set! (-> s5-0 seat-index) (max 0 v1-68)) + ) + (cond + ((-> s5-0 as-daxter?) + (set! (-> s5-0 left-right-accel-factor) 0.0000012207031) + (set! (-> s5-0 front-back-accel-factor) 0.0000012207031) + (set! (-> s5-0 up-down-accel-factor) 0.00000061035155) + ) + ((zero? (-> s5-0 stance)) + (set! (-> s5-0 left-right-accel-factor) 0.0000012207031) + (set! (-> s5-0 front-back-accel-factor) 0.0000012207031) + (set! (-> s5-0 up-down-accel-factor) 0.00000051879886) + ) + (else + (set! (-> s5-0 left-right-accel-factor) 0.0000012207031) + (set! (-> s5-0 front-back-accel-factor) 0.0000012207031) + (set! (-> s5-0 up-down-accel-factor) 0.00000061035155) + ) + ) + (set! (-> s5-0 left-right-accel-factor) + (* (-> s5-0 left-right-accel-factor) (-> (the-as vehicle s4-1) info handling pilot-x-accel-factor)) + ) + (set! (-> s5-0 up-down-accel-factor) + (* (-> s5-0 up-down-accel-factor) (-> (the-as vehicle s4-1) info handling pilot-y-accel-factor)) + ) + (set! (-> s5-0 front-back-accel-factor) + (* (-> s5-0 front-back-accel-factor) (-> (the-as vehicle s4-1) info handling pilot-z-accel-factor)) + ) + ) + ) + (when (not (-> s5-0 gun?)) + (if arg1 + (logior! (-> self control current-surface flags) (surface-flag gun-fast-exit)) + ) + (target-gun-end-mode arg1) + ) + ) + (set! (-> self board latch?) #f) + (set! (-> self control reaction) target-collision-reaction) + (set! (-> self control transv quad) (the-as uint128 0)) + (set! (-> self control ctrl-xz-vel) 0.0) + (logior! (-> self focus-status) (focus-status pilot)) + (set! (-> self control bend-target) 0.0) + (let ((v1-102 (-> self node-list data))) + (set! (-> v1-102 0 param0) (the-as (function cspace transformq none) cspace<-transformq+world-trans!)) + (set! (-> v1-102 0 param1) (the-as basic (-> self control trans))) + (set! (-> v1-102 0 param2) (the-as basic (-> self control cspace-offset))) + ) + (let ((v1-104 (-> self control root-prim))) + (set! (-> v1-104 prim-core collide-as) (collide-spec)) + (set! (-> v1-104 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self control root-prim prim-core collide-as) (collide-spec jak-vehicle)) + (set! (-> self control root-prim prim-core collide-with) + (collide-spec hit-by-player-list hit-by-others-list player-list collectable) + ) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control status) (collide-status)) + (let ((v0-16 (logclear (-> self water flags) (water-flag active find-water)))) + (set! (-> self water flags) v0-16) + v0-16 + ) + ) + +;; definition for function pilot-on-ground? +(defbehavior pilot-on-ground? target () + (logtest? (-> self control status) (collide-status on-surface)) + ) + +;; definition for function target-pilot-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-pilot-post target () + (local-vars (a0-45 int) (a0-47 int)) + (let* ((v1-1 (-> *perf-stats* data 17)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) + (while (nonzero? gp-1) + (+! gp-1 -1) + (set! (-> self control remaining-ctrl-iterations) gp-1) + (flag-setup) + (build-conversions (-> self control transv)) + (do-rotations1) + (do-rotations2) + (reverse-conversions (-> self control transv)) + (vector-! + (-> self control cspace-offset) + (-> self control draw-offset) + (-> self control anim-collide-offset-world) + ) + (let ((a1-5 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-5 options) (overlaps-others-options oo0)) + (set! (-> a1-5 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-5 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-5) + ) + (post-flag-setup) + ) + ) + (update-rates! (-> self clock) f30-0) + ) + (let* ((gp-2 (-> self pilot)) + (s5-0 (handle->process (-> gp-2 vehicle))) + ) + (when s5-0 + (vehicle-method-66 (the-as vehicle s5-0) (-> self control trans) (-> gp-2 seat-index)) + (set! (-> self control transv quad) (-> (the-as vehicle s5-0) root transv quad)) + (quaternion-copy! (-> self control quat) (-> (the-as vehicle s5-0) root quat)) + (quaternion-copy! (-> self control quat-for-control) (-> self control quat)) + (quaternion-copy! (-> self control dir-targ) (-> self control quat)) + (let ((s4-0 (-> self alt-cam-pos))) + (when (not (focus-test? self dead)) + (let ((s3-0 (new 'stack-no-clear 'cquery-with-5vec))) + (set! (-> s3-0 vec 2 x) 0.0) + (set! (-> s3-0 vec 2 y) 20480.0) + (let ((a0-18 (-> self node-list data 0 bone transform))) + (set! (-> s3-0 vec 1 quad) (-> a0-18 fvec quad)) + ) + (set! (-> s3-0 vec 1 y) 0.0) + (vector-rotate90-around-y! (-> s3-0 vec 1) (-> s3-0 vec 1)) + (vector-normalize! (-> s3-0 vec 1) 1.0) + (set! (-> s3-0 vec 0 quad) (-> self control trans quad)) + (when (-> gp-2 enable-cam-side-shift) + (dotimes (s2-0 2) + (let ((v1-48 (-> s3-0 cquery))) + (set! (-> v1-48 radius) 2048.0) + (set! (-> v1-48 collide-with) (collide-spec backgnd)) + (set! (-> v1-48 ignore-process0) #f) + (set! (-> v1-48 ignore-process1) #f) + (set! (-> v1-48 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-48 action-mask) (collide-action solid)) + ) + (set! (-> s3-0 cquery start-pos quad) (-> s3-0 vec 0 quad)) + (vector-float*! (-> s3-0 cquery move-dist) (-> s3-0 vec 1) (-> s3-0 vec 2 y)) + (let ((f0-10 (fill-and-probe-using-line-sphere *collide-cache* (-> s3-0 cquery)))) + (when (and (>= f0-10 0.0) (= (-> s3-0 cquery best-other-tri pat mode) (pat-mode wall))) + (+! (-> s3-0 vec 2 x) (* -1.0 (-> s3-0 vec 2 y) (- 1.0 f0-10))) + 0 + ) + ) + (set! (-> s3-0 vec 2 y) (* -1.0 (-> s3-0 vec 2 y))) + ) + (set! (-> s3-0 vec 2 x) + (* (-> s3-0 vec 2 x) (fmax 0.25 (fmin 1.0 (* 0.000008138021 (vector-length (-> self control transv)))))) + ) + (seek! (-> gp-2 cam-side-shift) (-> s3-0 vec 2 x) (* 16384.0 (seconds-per-frame))) + ) + (set! (-> s4-0 x) (+ (-> s3-0 vec 0 x) (* (-> gp-2 cam-side-shift) (-> s3-0 vec 1 x)))) + (set! (-> s4-0 z) (+ (-> s3-0 vec 0 z) (* (-> gp-2 cam-side-shift) (-> s3-0 vec 1 z)))) + (if (type? s5-0 h-warf) + (set! (-> s4-0 y) (-> s3-0 vec 0 y)) + (set! (-> s4-0 y) (fmax (fmin (-> s4-0 y) (+ 2048.0 (-> s3-0 vec 0 y))) (+ -2048.0 (-> s3-0 vec 0 y)))) + ) + ) + 0 + ) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix))) + (vehicle-method-113 (the-as vehicle s5-0) (-> s4-1 rvec) (-> gp-2 seat-index) 0) + (vehicle-method-113 (the-as vehicle s5-0) (-> s4-1 uvec) (-> gp-2 seat-index) 1) + (enable-set! (-> self arm-ik 0) #t) + (enable-set! (-> self arm-ik 1) #t) + (set-ik-target! (-> self arm-ik 0) (-> s4-1 rvec)) + (set-ik-target! (-> self arm-ik 1) (-> s4-1 uvec)) + ) + ) + ) + (ja-post) + (joint-points) + (update-transforms (-> self control)) + (do-target-gspot) + (target-powerup-process) + (let ((v1-95 (-> *perf-stats* data 17))) + (b! (zero? (-> v1-95 ctrl)) cfg-31 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-45 pcr0) + (+! (-> v1-95 accum0) a0-45) + (.mfpc a0-47 pcr1) + (+! (-> v1-95 accum1) a0-47) + ) + (label cfg-31) + 0 + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/target_REF.gc b/test/decompiler/reference/jak3/engine/target/target_REF.gc index 018460f2ac..a786cc8f1f 100644 --- a/test/decompiler/reference/jak3/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target_REF.gc @@ -2379,7 +2379,7 @@ ) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 49) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 49) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -2681,7 +2681,7 @@ ) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 28) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -3104,7 +3104,7 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 43) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 43) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (talker-spawn-func (-> *talker-speech* 47) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -3420,7 +3420,7 @@ ) (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-spinkick") (ja-frame-num 0) 28) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) 28) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) (if (and (= (-> self control danger-mode) 'uppercut) @@ -3625,7 +3625,7 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (if (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect (-> self skel effect) (the-as symbol "group-red-eco-strike-ground") (ja-frame-num 0) 0) + (do-effect (-> self skel effect) "group-red-eco-strike-ground" (ja-frame-num 0) 0) ) (let ((v1-56 (process-spawn @@ -3655,15 +3655,11 @@ ) ) (when (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (do-effect - (-> self skel effect) - (the-as symbol "group-red-eco-spinkick") - (ja-frame-num 0) - (if (rand-vu-percent? 0.5) - 28 - 19 - ) - ) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) (when (and (not (-> self control danger-mode)) @@ -3860,15 +3856,11 @@ (when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) - (do-effect - (-> self skel effect) - (the-as symbol "group-red-eco-spinkick") - (ja-frame-num 0) - (if (rand-vu-percent? 0.5) - 28 - 19 - ) - ) + (do-effect (-> self skel effect) "group-red-eco-spinkick" (ja-frame-num 0) (if (rand-vu-percent? 0.5) + 28 + 19 + ) + ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) (let ((v1-37 (ja-group))) diff --git a/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc b/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc index 0af6ccf710..c4982b019e 100644 --- a/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/bigmap-h_REF.gc @@ -81,7 +81,7 @@ (tpage external-art-buffer) (tpage2 basic) (progress-minimap texture-page) - (progress-minimap2 basic) + (progress-minimap2 texture-page) (load-index uint32) (x0 int32) (y0 int32) @@ -105,7 +105,7 @@ (new (symbol type) _type_) (bigmap-method-9 () none) (update (_type_) none) - (draw (_type_ int int int int) int) + (bigmap-method-11 (_type_) symbol) (bigmap-method-12 () none) (bigmap-method-13 () none) (enable-drawing (_type_) none) diff --git a/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc b/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc index 977d923648..57260c4bbd 100644 --- a/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/minimap-h_REF.gc @@ -4,13 +4,13 @@ ;; definition of type minimap-table-entry (deftype minimap-table-entry (structure) ((corner vector :inline) - (level-name basic) - (tex-name basic) + (level-name symbol) + (tex-name string) (meters-per-texel float) (pos-scale float) (min-inv-scale float) (max-inv-scale float) - (switch-immediate basic) + (switch-immediate symbol) ) ) @@ -37,14 +37,14 @@ (deftype minimap-class-node (structure) ((default-position vector :inline) (flags minimap-flag) - (name basic) + (name string) (icon-xy vector2ub :inline) (class minimap-class) (scale float) (color rgba) ) (:methods - (minimap-class-node-method-9 () none) + (minimap-class-node-method-9 (_type_) symbol) ) ) @@ -703,7 +703,7 @@ (format #t "[~8x] ~A~%" this 'connection-minimap) (format #t "~1Tnext: #~%" (-> this next)) (format #t "~1Tkey: ~A~%" (-> this key)) - (format #t "~1Tupdate-time: ~D~%" (-> this update-time)) + (format #t "~1Tupdate-time: ~D~%" (-> this handle)) (format #t "~1Tparam[4] @ #x~X~%" (-> this param)) (dotimes (s5-0 4) (format #t "~T [~D]~1Tparam: ~A~%" s5-0 (-> this param s5-0)) @@ -721,7 +721,7 @@ (format #t "~T [~D]~1Tparam-float: ~f~%" s5-3 (the-as float (-> this param s5-3))) ) (format #t "~1Tparam-quat: #x~X~%" (-> this param-quat)) - (format #t "~1Thandle: ~D~%" (-> this update-time)) + (format #t "~1Thandle: ~D~%" (-> this handle)) (format #t "~1Tposition: #~%" (-> this position)) (format #t "~1Talpha: ~f~%" (-> this alpha)) (format #t "~1Tflags: #x~X : (minimap-flag " (-> this flags)) @@ -842,7 +842,7 @@ ) (:methods (get-distance-with-path (_type_ vector vector) float) - (minimap-trail-method-10 () none) + (reset (_type_) none) ) ) @@ -930,24 +930,24 @@ (frustum-alpha float) ) (:methods - (minimap-method-9 () none) + (debug-draw (_type_) none) (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) - (minimap-method-11 () none) + (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol) (add-icon! (_type_ process uint int vector int) connection-minimap) - (minimap-method-13 () none) - (minimap-method-14 () none) + (free-trail-by-connection (_type_ connection-minimap) none) + (update-trails (_type_) none) (draw-1 (_type_ dma-buffer vector4w symbol) none) - (minimap-method-16 () none) - (minimap-method-17 () none) - (minimap-method-18 () none) - (minimap-method-19 () none) + (draw-connection (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none) + (sub-draw-1-2 (_type_ minimap-draw-work) none) (update! (_type_) symbol) - (minimap-method-21 () none) - (minimap-method-22 () none) - (minimap-method-23 () none) + (sub-draw-1-1 (_type_ minimap-draw-work) none) + (set-color (_type_ vector) none) + (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none) (draw-sprite2 (_type_ dma-buffer vector4w symbol) none) (set-race-texture (_type_ texture float level) none) - (minimap-method-26 () none) + (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none) (set-race-corner (_type_ float float) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc new file mode 100644 index 0000000000..2bd56aa9c3 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc @@ -0,0 +1,4003 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type minimap-texture-name-array +(deftype minimap-texture-name-array (structure) + ((data string 35) + ) + ) + +;; definition for method 3 of type minimap-texture-name-array +(defmethod inspect ((this minimap-texture-name-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'minimap-texture-name-array) + (format #t "~1Tdata[35] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type minimap-corner-array +(deftype minimap-corner-array (structure) + ((data vector 35 :inline) + ) + ) + +;; definition for method 3 of type minimap-corner-array +(defmethod inspect ((this minimap-corner-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'minimap-corner-array) + (format #t "~1Tdata[35] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition for symbol *minimap-texture-name-array*, type minimap-texture-name-array +(define *minimap-texture-name-array* + (new 'static 'minimap-texture-name-array :data (new 'static 'array string 35 + #f + #f + "map-stadium" + "map-ctyslumc" + #f + #f + "map-ctygena" + "map-ctygenb" + "map-ctyslumb" + #f + #f + "map-ctyfarma" + "map-ctygenc" + #f + "map-ctysluma" + #f + "map-ctymarka" + "map-ctypala" + "map-ctymarkb" + "map-ctyindb" + #f + "map-ctyfarmb" + "map-ctypalb" + #f + "map-ctyinda" + #f + "map-ctyporta" + "map-ctyportb" + "map-ctyportc" + #f + #f + "map-ctyportd" + "map-ctyporte" + "map-ctyportf" + #f + ) + ) + ) + +;; definition for symbol *minimap-corner-array*, type minimap-corner-array +(define *minimap-corner-array* + (new 'static 'minimap-corner-array :data (new 'static 'inline-array vector 35 + (new 'static 'vector :x -4456448.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z -4456448.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z -2883584.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z -1310720.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 262144.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 1835008.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 3407872.0 :w 1.0) + (new 'static 'vector :x -4456448.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x -2883584.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x -1310720.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x 262144.0 :z 4980736.0 :w 1.0) + (new 'static 'vector :x 1835008.0 :z 4980736.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *minimap*, type minimap +(define *minimap* (new 'static 'minimap + :draw-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x908a400000008001 #x535353531) + ) + :draw2-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x900a400000008001 #x525252521) + ) + :draw3-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x90aa400000008001 #x535353531) + ) + :draw4-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x902a400000008001 #x525252521) + ) + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x53531) + ) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) + ) + :color (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :offset (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :last-name #f + :last-tex #f + :engine #f + :engine-key #x800 + :race-tex #f + :race-scale 16384.0 + :race-level #f + :sprite2-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x502b400000008001 #x52521) + ) + :frustum-alpha 1.0 + ) + ) + +;; failed to figure out what this is: +(kmemopen global "minimap-engines") + +;; definition for symbol *minimap-class-list*, type (inline-array minimap-class-node) +(define *minimap-class-list* (new 'static 'inline-array minimap-class-node 177 + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap) + :name "none" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3190784.0 :y 32768.0 :z 765952.0 :w 1.0) + :flags (minimap-flag trail bigmap) + :name "onintent" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4505600.0 :z 4505600.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "vinroom" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x5)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4197499.0 :y -34734.08 :z 4187750.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "sewer-kg" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 775413.75 :y 32727.04 :z -1279795.2 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "sewer-genb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3148021.8 :y 8847.36 :z -1200209.9 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "sewer-slumb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "hiphog" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1465712.6 :y 36085.76 :z 5251563.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "gungame" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1843200.0 :y 34816.0 :z 5275648.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "gun-yellow" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x2)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9143050.0 :y 89169.92 :z 9106391.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-nest-entrance" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "guard" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "parking-spot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap goal) + :name "goal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "goal-no-trail" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "goal-no-trail-bigmap" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3906355.2 :y 100352.0 :z 3732922.2 :w 1.0) + :flags (minimap-flag trail bigmap goal ctywide) + :name "cty-sniper-vicinity" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x4c :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -2105467.0 :y 118906.88 :z 3788431.2 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "forest" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6583542.0 :y 262021.12 :z -1945067.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wascity-gungame" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1523712.0 :z 7372800.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only ctywide) + :name "city-transport" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 839680.0 :z 3756032.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wascity-leaper-race" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6039716.0 :y 109895.68 :z -1498153.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wascity-pre-game" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 10678272.0 :z 524288.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-transport" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 86016.0 :z 7151616.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "waspal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1458176.0 :z -1499136.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "stadium" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2895872.0 :z -1855488.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wasteland-arena" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag frustum) + :name "guard-frustum" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9286615.0 :y 125091.84 :z 653434.9 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1843200.0 :y 34816.0 :z 5275648.0 :w 1.0) + :flags (minimap-flag trail bigmap) + :name "gun-dark" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x2)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3137536.0 :y 34324.48 :z -2962923.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport desert) + :name "spargus-city" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag racer) + :name "racer" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag racer) + :name "racer-target" + :scale 1.0 + :color (new 'static 'rgba :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag racer) + :name "racer-errol" + :scale 1.0 + :color (new 'static 'rgba :r #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 166871.05 :y 49192.96 :z -2900009.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "monk-temple" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 15650816.0 :y 149913.6 :z 2943385.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3550003.2 :y 321126.4 :z 5485773.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 5525913.5 :y 369049.6 :z 3343564.8 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desa" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12869222.0 :y 158105.6 :z 10319053.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12833587.0 :y 79052.8 :z 14444954.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desh" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6352077.0 :y 331366.4 :z 7294976.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2684108.8 :y 63488.0 :z 10600858.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11691622.0 :y 116326.4 :z 674611.2 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6981632.0 :y 56115.2 :z 378470.4 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desa-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 832307.2 :y 185958.4 :z 6533529.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12394496.0 :y 206438.4 :z 12609126.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 8704819.0 :y 148684.8 :z 5840896.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11052646.0 :y 106086.4 :z 11750605.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 876134.4 :y 251494.4 :z 12136038.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 556646.4 :y 184320.0 :z 15724134.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16105472.0 :y 54886.4 :z 5789696.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 15939994.0 :y 135168.0 :z 1683456.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9377382.0 :y 93798.4 :z 92160.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9970483.0 :y 93388.8 :z 104448.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 10326016.0 :y 131481.6 :z -862208.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9631334.0 :y 88473.6 :z -1377075.2 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 7608729.5 :y 109772.8 :z -1456128.0 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 7272038.5 :y 371507.2 :z -410828.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 5833523.0 :y 110592.0 :z -1670758.4 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6916915.0 :y 389939.2 :z -420659.2 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12718080.0 :y 141312.0 :z 10554573.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desg-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6378701.0 :y 364134.4 :z -371507.2 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6380749.0 :y 156876.8 :z -1238630.4 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-6" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2466611.2 :y 372326.4 :z 2169241.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desa-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 8616755.0 :y 108953.6 :z -924876.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11712922.0 :y 240435.2 :z 3998105.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 10091315.0 :y 263782.4 :z 3800678.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desd-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4193894.5 :y 33177.6 :z 858521.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-sluma-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 792576.0 :y 33177.6 :z -570982.4 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1705984.0 :y 8192.0 :z -1542963.2 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2126643.2 :y 8192.0 :z -919552.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4290560.0 :y 411238.4 :z 7154483.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3999744.0 :y 45465.6 :z 4032512.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2407219.2 :y 394035.2 :z 9599795.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6369689.5 :y 128204.8 :z 7754137.5 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desc-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11148493.0 :y 130662.4 :z 1211596.8 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9161114.0 :y 140492.8 :z 355532.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasa-6" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6171853.0 :y 226508.8 :z -1021132.8 :w 1.0) + :flags (minimap-flag bigmap local-only wasall waswide) + :name "bbush-wasb-7" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4068556.8 :y 45465.6 :z 2008678.4 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-indb-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4970496.0 :y 108953.6 :z 13683098.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desf" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 86016.0 :y 44236.8 :z 7160217.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1570406.4 :y 45875.2 :z -1356185.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1308672.0 :y 45056.0 :z -833536.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 505036.8 :y 45465.6 :z -144588.8 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-genb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1736294.4 :y 20480.0 :z -799129.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2141388.8 :y 7782.4 :z -1939865.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumc-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2992128.0 :y 315801.6 :z 13929677.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-dese-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2893824.0 :y 188006.4 :z 14871757.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-post-game" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2445721.5 :y 20070.4 :z -2903654.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-slumc-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4145152.0 :y 45056.0 :z 1143193.6 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-sluma-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3572121.5 :y 45056.0 :z 1372160.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-sluma-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3889152.0 :y 45056.0 :z 1889075.2 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-indb-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4385997.0 :y 45056.0 :z 2440396.8 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-indb-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3716710.5 :y 45056.0 :z 3579494.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4198809.5 :y 45056.0 :z 4518297.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4687462.5 :y 45056.0 :z 4294246.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 3675750.5 :y 32768.0 :z 4731289.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-inda-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2622750.8 :y 43950.08 :z 6559170.5 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1377894.4 :y 45056.0 :z 7051264.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-5" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -1053491.2 :y 45056.0 :z 6554419.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-6" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -27852.8 :y 43827.2 :z 5318656.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-7" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1216512.0 :y 45056.0 :z 5433344.0 :w 1.0) + :flags (minimap-flag bigmap local-only ctywide) + :name "bbush-port-8" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9130394.0 :y 122060.8 :z 3092480.0 :w 1.0) + :flags (minimap-flag bigmap local-only desert) + :name "bbush-desb-4" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1542847.2 :y 196168.9 :z -4314233.0 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "atoll-valve" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2277804.5 :y 217672.9 :z -4571725.5 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "atoll-ashelin" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -3100565.5 :y 547275.56 :z 1190112.5 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "mountain-lens" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -2833539.0 :y 496445.44 :z 11345.101 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "mountain-shard" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -3448408.5 :y 567047.8 :z 1029759.4 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "mountain-gear" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 4357507.5 :y 205120.72 :z -2286701.2 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "ruins-hut" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -2575550.8 :y 156067.02 :z 3728844.8 :w 1.0) + :flags (minimap-flag bigmap goal) + :name "forest-samos" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "metalhead" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9633792.0 :y 32768.0 :z -1470464.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "kleever-arena" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9181552.0 :y 28517.172 :z -227204.7 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "seem-wascitya" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6039716.0 :y 109895.68 :z -1498153.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "seem-wascityb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9279857.0 :y 126115.84 :z 725073.94 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "kleever-wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9344532.0 :y 126484.48 :z 712171.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "damus-wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 8197611.5 :y 1009336.3 :z -1705738.2 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "damus-waspal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9527296.0 :y 225280.0 :z -1642496.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "damus-arena" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6533816.5 :y 86671.36 :z -1681449.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "kleever-wascityb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "red-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :name "tiny-red-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16954164.0 :y 495984.62 :z 17066476.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-temple" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x5 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2539761.8 :y 74191.26 :z 10381844.0 :w 1.0) + :flags (minimap-flag clamp bigmap local-only transport wasall) + :name "desert-oasis" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x1 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 12359188.0 :y 90439.68 :z 11306598.0 :w 1.0) + :flags (minimap-flag clamp bigmap local-only transport wasall) + :name "desert-corral" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 9344532.0 :y 126484.48 :z 712171.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "sig-wasdoors" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x3)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2669486.0 :y 14131.2 :z -2278359.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "freehq" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x5)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "green-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp trail bigmap) + :name "nest-cocoon" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp trail bigmap) + :name "nest-bridge" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 0.8 + :color (new 'static 'rgba :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 2866749.5 :y 10117.12 :z -2174484.5 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "factory" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x0)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-orange-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x33 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-red-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-green-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "big-purple-flashing-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag bigmap) + :name "medium-purple-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "parked-vehicle" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1603706.9 :y 32522.24 :z -194478.08 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport ctywide) + :name "samos-genb" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp flash) + :name "projectile" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0) + :flags (minimap-flag trail bigmap goal local-only transport wasall) + :name "desertb-race" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap goal) + :name "big-red-flashing-trail-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag trail bigmap goal) + :name "big-green-flashing-trail-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag frustum) + :name "robot-frustum" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 6036357.0 :y 99532.8 :z 12370657.0 :w 1.0) + :flags (minimap-flag trail bigmap local-only transport wasall) + :name "desert-marauder-village" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x3 #x5)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "gray-clamped-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -898404.4 :y 450727.94 :z -570347.1 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "volcano-monk" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 226181.53 :y -85.1968 :z 239582.4 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "volcano-collapsing-rock" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -377453.78 :y 83010.766 :z 401777.88 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "volcano-stone-lid" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -364009.06 :y 4519.936 :z -1827779.0 :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "volcano-dark-maker-idol" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :g #x27 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag bigmap) + :name "medium-green-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag bigmap goal) + :name "big-red-flashing-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "factory-clamped-target" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "factory-clamped-tower" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "desglide-ring-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "desglide-thermal-dot" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -338150.6 :y 344064.0 :z -341446.25 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "mine-elevator" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -1054895.8 :y 279489.75 :z -77204.69 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "mine-armor" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "mine-sign-up" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "mine-sign-down" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 1078071.8 :y 418296.62 :z -450073.4 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "mine-door" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "ruins-elec-gate" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 791688.4 :y 92675.27 :z 1785077.8 :w 1.0) + :flags (minimap-flag clamp bigmap goal) + :name "ruins-goal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp) + :name "dp-bipedal" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp) + :name "neo-wasp" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x1)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :w 1.0) + :flags (minimap-flag clamp bigmap) + :name "dark-maker" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17319976.0 :y 488816.62 :z 16711188.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templea-door" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16893830.0 :y 187146.23 :z 17766400.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-watchers" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17029612.0 :y 189808.64 :z 19156910.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-regen" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16982508.0 :y 180674.56 :z 19045868.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-warpgate" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16956294.0 :y 504422.4 :z 16792166.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only) + :name "templex-darkmaker" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x2 #x4)) + :scale 1.0 + :color (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16744653.0 :y 181903.36 :z 17680548.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-tests-door" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16833126.0 :y 189808.64 :z 19508510.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-freeze" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17827010.0 :y 317647.66 :z 18464536.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-elev" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 386252.8 :y 1760583.6 :z 207462.4 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "factoryc-vehicle" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17238630.0 :y 189808.64 :z 19509616.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "templeb-defend" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17585848.0 :y 389857.28 :z 18208850.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only) + :name "templeb-seem" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x4 #x2)) + :scale 1.0 + :color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 16891248.0 :y 182435.84 :z 17934050.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-defend-door-1" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17123000.0 :y 199475.2 :z 18286838.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-defend-door-2" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x 17571308.0 :y 181125.12 :z 19067166.0 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "temple-defend-door-3" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 0.5 + :color (new 'static 'rgba :r #x40 :a #x80) + ) + (new 'static 'minimap-class-node + :default-position (new 'static 'vector :x -592445.44 :y 20111.36 :z -1443553.2 :w 1.0) + :flags (minimap-flag clamp bigmap-only goal) + :name "palace-ruins" + :icon-xy (new 'static 'vector2ub :data (new 'static 'array uint8 2 #x0 #x4)) + :scale 1.0 + :color (new 'static 'rgba :g #x40 :a #x80) + ) + ) + ) + +;; failed to figure out what this is: +(let ((gp-0 *minimap*)) + (set! (-> gp-0 engine) (new 'global 'engine-minimap '*minimap* 64 connection-minimap)) + (countdown (v1-9 6) + (set! (-> gp-0 trail v1-9 used-by) #f) + ) + ) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for method 9 of type minimap +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this minimap)) + (when *trail-graph* + (dotimes (s5-0 6) + (let ((s4-0 (-> this trail s5-0))) + (when (and (-> s4-0 used-by) + (>= (-> s4-0 node-count) 0) + (not (time-elapsed? (the-as int (-> s4-0 last-updated)) (seconds 5))) + ) + (let* ((a3-0 (target-pos 0)) + (v1-12 s5-0) + (t1-0 (cond + ((zero? v1-12) + *color-green* + ) + ((= v1-12 1) + *color-blue* + ) + ((= v1-12 2) + *color-white* + ) + ((= v1-12 3) + *color-red* + ) + (else + *color-magenta* + ) + ) + ) + ) + (trail-graph-method-16 + *trail-graph* + (-> s4-0 node-count) + (-> s4-0 node-id) + a3-0 + (-> s4-0 cached-info orig-goal-pos) + t1-0 + (* 1024.0 (the float s5-0)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type minimap +;; WARN: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defmethod update-trails ((this minimap)) + (let ((s5-0 *trail-graph*)) + (when s5-0 + (.mtc0 Count 0) + (let ((v1-1 0)) + (while (< (the-as uint v1-1) (the-as uint #x605a)) + (let ((v1-2 (-> s5-0 mode))) + (cond + ((= v1-2 1) + (trail-graph-method-31 s5-0 #x605a) + ) + ((zero? v1-2) + (let ((v1-5 -1)) + (let ((a0-5 0)) + (countdown (a1-1 6) + (let* ((a2-3 (-> this trail a1-1)) + (a3-0 (-> a2-3 used-by)) + ) + (when (and a3-0 (and (< 0.0 (-> a3-0 alpha)) (or (< v1-5 0) (< (the-as int (-> a2-3 last-updated)) a0-5)))) + (set! v1-5 a1-1) + (set! a0-5 (the-as int (-> a2-3 last-updated))) + ) + ) + ) + (let ((a1-5 (current-time))) + (if (or (< v1-5 0) (= a0-5 a1-5)) + (goto cfg-68) + ) + ) + ) + (let ((s4-0 (-> this trail v1-5)) + (s3-0 (the-as vector #f)) + ) + (let* ((v1-9 (-> s4-0 used-by)) + (s2-0 (the-as structure (-> v1-9 position))) + ) + (set! s3-0 (cond + ((= (the-as vector s2-0) #t) + (let* ((s2-1 (handle->process (-> v1-9 handle))) + (v1-13 (if (type? s2-1 process-drawable) + s2-1 + ) + ) + ) + (if v1-13 + (set! s3-0 (-> (the-as process-drawable v1-13) root trans)) + ) + ) + s3-0 + ) + ((and (= (logand (the-as int s2-0) 7) 4) (= (-> (the-as basic s2-0) type) entity-actor)) + (let* ((v1-19 (the-as structure s2-0)) + (s3-1 (if (the-as vector v1-19) + (-> (the-as entity-actor v1-19) extra process) + ) + ) + (v1-21 (if (type? s3-1 process-drawable) + s3-1 + ) + ) + ) + (if v1-21 + (set! s3-0 (-> (the-as process-drawable v1-21) root trans)) + (set! s3-0 (-> (the-as entity-actor s2-0) extra trans)) + ) + ) + s3-0 + ) + (else + (the-as vector s2-0) + ) + ) + ) + ) + (when s3-0 + (let* ((s2-2 s5-0) + (s1-0 (method-of-object s2-2 trail-graph-method-29)) + ) + (target-pos 0) + (-> s4-0 cached-info) + (s1-0 s2-2) + ) + (set! (-> s4-0 search-id) (-> s5-0 search-id)) + ) + ) + ) + ) + ((or (= v1-2 3) (= v1-2 2)) + (countdown (v1-33 6) + (let ((s4-1 (-> this trail v1-33))) + (when (and (= (-> s4-1 search-id) (-> s5-0 search-id)) (-> s4-1 used-by)) + (let* ((a0-29 s5-0) + (t9-5 (method-of-object a0-29 trail-graph-method-21)) + ) + (-> s4-1 node-id) + 64 + (&-> s4-1 goal-node-id) + (&-> s4-1 node-path-dist) + (set! (-> s4-1 node-count) (the-as int (t9-5 a0-29))) + ) + (set! (-> s4-1 last-updated) (the-as uint (current-time))) + (goto cfg-64) + ) + ) + ) + (label cfg-64) + (trail-graph-method-26 s5-0) + ) + ) + ) + (.mfc0 v1-1 Count) + ) + ) + (label cfg-68) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type minimap +(defmethod get-trail-for-connection ((this minimap) (arg0 connection-minimap) (arg1 symbol)) + (local-vars (gp-0 minimap-trail)) + (countdown (v1-0 6) + (let ((a3-3 (-> this trail v1-0))) + (when (= (-> a3-3 used-by) arg0) + (set! gp-0 a3-3) + (goto cfg-14) + ) + ) + ) + (when arg1 + (dotimes (v1-4 6) + (let ((a3-7 (-> this trail v1-4))) + (when (not (-> a3-7 used-by)) + (set! (-> a3-7 used-by) arg0) + (set! gp-0 a3-7) + (goto cfg-14) + ) + ) + ) + ) + (set! gp-0 (the-as minimap-trail #f)) + (label cfg-14) + (if (and gp-0 arg1) + (reset gp-0) + ) + gp-0 + ) + +;; definition for method 13 of type minimap +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 13 minimap) has a return type of none, but the expression builder found a return statement. +(defmethod free-trail-by-connection ((this minimap) (arg0 connection-minimap)) + (countdown (v1-0 6) + (let ((a2-3 (-> this trail v1-0))) + (when (= (-> a2-3 used-by) arg0) + (set! (-> a2-3 used-by) #f) + (reset a2-3) + (return #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type minimap-trail +;; WARN: Return type mismatch int vs none. +(defmethod reset ((this minimap-trail)) + (set! (-> this node-count) -1) + (set! (-> this search-id) (the-as uint 0)) + (set! (-> this last-updated) (the-as uint 0)) + (set! (-> this cached-info goal-conn-id) -1) + (none) + ) + +;; definition for method 11 of type minimap +;; INFO: Used lq/sq +(defmethod get-icon-draw-pos ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (vector-reset! (-> s5-0 2)) + (vector-reset! (-> s5-0 1)) + (let ((s1-0 0)) + (while (>= (-> arg1 node-count) s1-0) + (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) + (cond + ((< s1-0 (-> arg1 node-count)) + (trail-graph-method-20 *trail-graph* (-> arg1 node-id s1-0) (-> s5-0 1)) + (+! s1-0 1) + (vector-! (-> s5-0 1) (-> s5-0 1) arg2) + (set! (-> s5-0 1 x) (* (-> s5-0 1 x) arg3)) + (set! (-> s5-0 1 z) (* (-> s5-0 1 z) arg3)) + (set! (-> s5-0 1 y) 0.0) + (set! (-> s5-0 1 w) 1.0) + ) + (else + (vector-negate! (-> s5-0 1) arg4) + (+! s1-0 1) + ) + ) + (let ((v1-12 (-> s5-0 1))) + (when (>= (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) 50.0) + (vector-! (-> s5-0 3) (-> s5-0 0) (-> s5-0 1)) + (let* ((f1-6 (ray-sphere-intersect (-> s5-0 1) (-> s5-0 3) (-> s5-0 2) 50.0)) + (f0-12 (fmax 0.0 (fmin 1.0 f1-6))) + ) + (vector-float*! arg4 (-> s5-0 3) f0-12) + ) + (vector+! arg4 arg4 (-> s5-0 1)) + (vector-negate! arg4 arg4) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 9 of type minimap-trail +(defmethod get-distance-with-path ((this minimap-trail) (arg0 vector) (arg1 vector)) + (local-vars (f30-1 float)) + 0.0 + (let ((s5-0 *trail-graph*)) + (cond + ((and s5-0 (> (-> this node-count) 0)) + (let ((f30-0 (-> this node-path-dist)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (trail-graph-method-20 s5-0 (-> this node-id 0) s3-0) + (set! f30-1 (+ f30-0 (vector-vector-xz-distance arg0 s3-0))) + (trail-graph-method-20 s5-0 (the-as uint (-> this goal-node-id)) s3-0) + ) + ) + (else + (set! f30-1 (vector-vector-xz-distance arg0 arg1)) + ) + ) + ) + f30-1 + ) + +;; definition for method 2 of type connection-minimap +(defmethod print ((this connection-minimap)) + (format + #t + "#" + (-> this class name) + (-> this flags) + (handle->process (-> this handle)) + this + ) + this + ) + +;; definition for method 3 of type engine-minimap +(defmethod inspect ((this engine-minimap)) + (call-parent-method this) + (let ((s5-0 0) + (s4-0 (-> *minimap* engine alive-list)) + ) + (while s4-0 + (let ((a3-0 s4-0)) + (format #t "~2T~3D: ~`connection-minimap`P~%" s5-0 a3-0) + ) + (+! s5-0 1) + (set! s4-0 (-> s4-0 next)) + ) + ) + this + ) + +;; definition for method 14 of type engine-minimap +;; WARN: Return type mismatch int vs none. +(defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame)) + "Run updates if they scheduled. If something is found that has no pending update, kill it. + Note that we won't kill things on this call if they fail to update their `update-time`. + They will survive until the next call to `run-pending-updates`! + (or you can modify their `update-time` before that to prevent them from being killed.)" + (let ((s2-0 (&-> this alive-list)) + (s3-0 (-> this alive-list)) + ) + (while s3-0 + (let ((s4-0 (-> s3-0 next))) + (when (or (bigmap-method-11 *bigmap*) (not (paused?))) + (cond + ((logtest? (-> s3-0 flags) (minimap-flag fade-out)) + (logclear! (-> s3-0 flags) (minimap-flag fade-in)) + (seek! (-> s3-0 alpha) 0.0 (seconds-per-frame)) + ) + ((and (logtest? (-> s3-0 flags) (minimap-flag task-graph)) + (not (logtest? (-> *setting-control* user-current minimap) 32)) + ) + (logior! (-> s3-0 flags) (minimap-flag fade-in)) + (seek! (-> s3-0 alpha) 0.0 (seconds-per-frame)) + ) + ((logtest? (-> s3-0 flags) (minimap-flag fade-in)) + (let ((f30-0 1.0)) + (when (logtest? (-> s3-0 class flags) (minimap-flag trail)) + (let ((v1-29 (get-trail-for-connection *minimap* s3-0 #f))) + (if (or (not v1-29) (time-elapsed? (the-as int (-> v1-29 last-updated)) (seconds 5))) + (set! f30-0 0.0001) + ) + ) + ) + (seek! (-> s3-0 alpha) f30-0 (seconds-per-frame)) + ) + (if (= (-> s3-0 alpha) 1.0) + (logclear! (-> s3-0 flags) (minimap-flag fade-in)) + ) + ) + ) + ) + (cond + ((and (logtest? (-> s3-0 flags) (minimap-flag fade-out)) (= (-> s3-0 alpha) 0.0)) + (kill-callback this s3-0) + (set! (-> s2-0 0) (-> s3-0 next)) + (set! (-> s3-0 next) (-> this dead-list)) + (set! (-> this dead-list) s3-0) + (+! (-> this length) -1) + ) + ((and (handle->process (-> s3-0 handle)) + (not (and (= (logand (the-as int (-> s3-0 position)) 7) 4) + (= (-> (the-as entity-actor (-> s3-0 position)) type) entity-actor) + (logtest? (-> (the-as entity-actor (-> s3-0 position)) extra perm status) + (entity-perm-status dead subtask-complete bit-12) + ) + ) + ) + ) + (update-callback this) + (set! s2-0 (&-> s3-0 next)) + ) + (else + (logior! (-> s3-0 flags) (minimap-flag fade-out)) + (update-callback this) + (set! s2-0 (&-> s3-0 next)) + ) + ) + (set! s3-0 s4-0) + ) + ) + ) + (set! (-> this execute-time) arg0) + 0 + (none) + ) + +;; definition for method 12 of type minimap +;; INFO: Used lq/sq +(defmethod add-icon! ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) + (when (not arg2) + (let ((v1-3 (+ (-> *minimap* engine-key) 1))) + (set! (-> *minimap* engine-key) v1-3) + (set! arg2 (the-as int v1-3)) + ) + ) + (let ((s3-0 (the-as connection-minimap (schedule-callback (-> this engine) arg2 0)))) + (let ((s2-1 (-> *minimap-class-list* arg1))) + (when s3-0 + (when (not (logtest? (-> s3-0 flags) (minimap-flag active))) + (set! (-> s3-0 class) s2-1) + (set! (-> s3-0 last-world-pos quad) (-> s2-1 default-position quad)) + (vector-! (-> s3-0 last-relative-pos) (target-pos 0) (-> s3-0 last-world-pos)) + (set! (-> s3-0 edge-ry) -131072) + ) + (set! (-> s3-0 handle) (process->handle arg0)) + (set! arg3 (cond + (arg3 + (empty) + arg3 + ) + (else + (-> s2-1 default-position) + ) + ) + ) + (set! (-> s3-0 position) arg3) + (set! (-> s3-0 flags) (minimap-flag active fade-in)) + (set! (-> s3-0 node) (the-as uint arg4)) + ) + ) + s3-0 + ) + ) + +;; definition for method 10 of type engine-minimap +;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. +(defmethod kill-callback ((this engine-minimap) (arg0 connection-pers)) + "Called when a connection is removed." + (if (not arg0) + (return #f) + ) + (if (logtest? (-> (the-as connection-minimap arg0) class flags) (minimap-flag trail)) + (free-trail-by-connection *minimap* (the-as connection-minimap arg0)) + ) + (set! (-> arg0 update-time) (the-as time-frame #f)) + ((method-of-type engine-pers kill-callback) this arg0) + (none) + ) + +;; definition for function lookup-minimap-texture-by-name +;; INFO: Used lq/sq +(defun lookup-minimap-texture-by-name ((arg0 string) (arg1 string) (arg2 (pointer texture-page))) + (local-vars (sv-16 texture-page)) + (dotimes (s3-0 11) + (let ((s2-0 (-> *level* level s3-0))) + (when (or (= (-> s2-0 status) 'active) (= (-> s2-0 status) 'reserved)) + (set! sv-16 (-> s2-0 texture-page 8)) + (when (and sv-16 (or (not arg1) (string= (-> sv-16 name) arg1))) + (dotimes (s1-0 (-> sv-16 length)) + (let ((s0-0 (-> sv-16 data s1-0))) + (when (and s0-0 (string= (-> s0-0 name) arg0)) + (if arg2 + (set! (-> arg2 0) sv-16) + ) + (set! (-> s2-0 texture-mask 8 mask quad) (-> s0-0 masks data 0 mask quad)) + (return s0-0) + ) + ) + ) + ) + ) + ) + ) + (the-as texture #f) + ) + +;; definition for symbol *minimap-table-entry-array*, type (array minimap-table-entry) +(define *minimap-table-entry-array* (new 'static 'boxed-array :type minimap-table-entry + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 5270364.0 :z -3660800.0) + :level-name 'waswide + :tex-name "map-wascity" + :meters-per-texel 22118.4 + :pos-scale 5662310.5 + :min-inv-scale 0.5 + :max-inv-scale 1.0 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -2048000.0 :z -2338816.0) + :level-name 'desert + :tex-name "map-desert" + :meters-per-texel 40960.0 + :pos-scale 20971520.0 + :min-inv-scale 1.0 + :max-inv-scale 1.0 + :switch-immediate #f + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 5270364.0 :z -3660800.0) + :level-name 'wasdoors + :tex-name "map-wasdoors" + :meters-per-texel 22118.4 + :pos-scale 5662310.5 + :min-inv-scale 0.5 + :max-inv-scale 0.5 + :switch-immediate #f + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 4505600.0 :z 3442688.0) + :level-name 'lwassig + :tex-name "map-nst-lower" + :meters-per-texel 25600.0 + :pos-scale 6553600.0 + :min-inv-scale 0.5 + :max-inv-scale 0.5 + :switch-immediate #f + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x 1662976.0 :z 163840.0) + :level-name 'nsta + :tex-name "map-nst-upper" + :meters-per-texel 25600.0 + :pos-scale 6553600.0 + :min-inv-scale 0.5 + :max-inv-scale 0.5 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -1433600.0 :z -1433600.0) + :level-name 'factoryb + :tex-name "map-factoryb" + :meters-per-texel 20480.0 + :pos-scale 5242880.0 + :min-inv-scale 0.4 + :max-inv-scale 0.4 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -3909755.0 :z 3309977.5) + :level-name 'foresta + :tex-name "map-forest" + :meters-per-texel 8519.68 + :pos-scale 2181038.0 + :min-inv-scale 0.15 + :max-inv-scale 0.15 + :switch-immediate #t + ) + (new 'static 'minimap-table-entry + :corner (new 'static 'vector :x -2129920.0 :z -2338816.0) + :level-name 'jakx + :tex-name "map-desert" + :meters-per-texel 40960.0 + :pos-scale 20971520.0 + :min-inv-scale 1.0 + :max-inv-scale 1.0 + :switch-immediate #t + ) + ) + ) + +;; definition for method 20 of type minimap +;; INFO: Used lq/sq +(defmethod update! ((this minimap)) + (set! (-> this map-bits) (the-as uint 0)) + (let* ((s5-0 (the-as level #f)) + (s4-0 *minimap-table-entry-array*) + (v1-0 (-> s4-0 length)) + (s3-0 99) + ) + (let ((a0-2 (-> *setting-control* user-current minimap-level))) + (dotimes (a1-0 (-> *level* length)) + (let ((a2-3 (-> *level* level a1-0))) + (when (= (-> a2-3 status) 'active) + (set! (-> this map-bits) (logior (the-as city-map-bits (-> this map-bits)) (-> a2-3 info city-map-bits))) + (dotimes (a3-5 v1-0) + (cond + (a0-2 + (when (= a0-2 (-> s4-0 a3-5 level-name)) + (set! s3-0 a3-5) + (set! s5-0 a2-3) + ) + ) + ((and (= (-> a2-3 name) (-> s4-0 a3-5 level-name)) (< a3-5 s3-0)) + (set! s3-0 a3-5) + (set! s5-0 a2-3) + ) + ) + ) + ) + ) + ) + ) + (cond + (s5-0 + (when (not (paused?)) + (seek! (-> this min-inv-scale) (-> s4-0 s3-0 min-inv-scale) (* 0.5 (seconds-per-frame))) + (seek! (-> this max-inv-scale) (-> s4-0 s3-0 max-inv-scale) (* 0.5 (seconds-per-frame))) + ) + (when (or (-> s4-0 s3-0 switch-immediate) + (and (= (-> this min-inv-scale) (-> s4-0 s3-0 min-inv-scale)) + (= (-> this max-inv-scale) (-> s4-0 s3-0 max-inv-scale)) + ) + ) + (set! (-> this last-name) (-> s4-0 s3-0 tex-name)) + (set! (-> this minimap-corner quad) (-> s4-0 s3-0 corner quad)) + (set! (-> this meters-per-texel) (-> s4-0 s3-0 meters-per-texel)) + (set! (-> this pos-scale) (-> s4-0 s3-0 pos-scale)) + (set! (-> this level) s5-0) + (set! (-> this ctywide) s5-0) + (cond + ((= (-> this level name) 'lwassig) + (if (level-get *level* 'nsta) + (set! (-> this map-bits) (the-as uint 1)) + ) + ) + (else + (set! (-> this map-bits) (the-as uint 1)) + ) + ) + ) + ) + (else + (set! (-> this ctywide) (level-get *level* 'ctywide)) + (let ((s5-1 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) x))))) + (s4-1 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) z))))) + ) + (set! (-> this meters-per-texel) 16384.0) + (set! (-> this pos-scale) (* 256.0 (-> this meters-per-texel))) + (when (not (paused?)) + (seek! (-> this min-inv-scale) 0.25 (* 0.5 (seconds-per-frame))) + (seek! (-> this max-inv-scale) 0.5 (* 0.5 (seconds-per-frame))) + ) + (when (and (< s5-1 5) (< s4-1 7) (logtest? (-> this map-bits) (ash 1 (+ (* 5 s4-1) s5-1)))) + (let ((a0-23 (-> *minimap-texture-name-array* data (+ (* 5 s4-1) s5-1)))) + (when a0-23 + (set! (-> this last-name) a0-23) + (set! (-> this minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 s4-1) s5-1) quad)) + (dotimes (v1-69 (-> *level* length)) + (let ((a0-34 (-> *level* level v1-69))) + (when (= (-> a0-34 status) 'active) + (if (logtest? (-> a0-34 info city-map-bits) (ash 1 (+ (* 5 s4-1) s5-1))) + (set! (-> this level) a0-34) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + ((string= (-> this last-name) "map-nst-upper") + (cond + ((or (and (task-node-closed? (game-task-node nest-eggs-introduction)) + (not (task-node-closed? (game-task-node nest-eggs-gas))) + ) + (and (task-node-closed? (game-task-node nest-hunt-introduction)) + (not (task-node-closed? (game-task-node nest-hunt-resolution))) + ) + ) + (if (task-node-closed? (game-task-node nest-eggs-resolution)) + (set! (-> this last-name) "map-nst-upper-2") + ) + ) + (else + (set! (-> this last-name) #f) + ) + ) + ) + ((string= (-> this last-name) "map-forest") + (if (not (or (and (task-node-closed? (game-task-node forest-kill-plants-introduction)) + (not (task-node-closed? (game-task-node forest-kill-plants-resolution))) + ) + (and (task-node-closed? (game-task-node forest-turn-on-machine-introduction)) + (not (task-node-closed? (game-task-node precursor-tour-introduction))) + ) + ) + ) + (set! (-> this last-name) #f) + ) + ) + ) + (set! (-> this last-tex) + (lookup-minimap-texture-by-name (-> this last-name) (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (let ((f30-2 (seconds-per-frame))) + (let ((v1-84 (-> this last-tex))) + (cond + ((or (not (-> this level)) (zero? (-> this level)) (!= (-> this level status) 'active) (not v1-84)) + (set! (-> this offset w) 0.0) + ) + ((not (logtest? (-> *setting-control* user-current minimap) 128)) + (seek! (-> this offset w) 0.0 f30-2) + ) + ((and *target* (nonzero? (-> this map-bits))) + (set! (-> this offset w) (fmin 0.5 (+ (-> this offset w) f30-2))) + ) + (else + (set! (-> this offset w) 0.0) + ) + ) + ) + (cond + ((and *target* (or (focus-test? *target* board pilot) (= (-> this min-inv-scale) (-> this max-inv-scale)))) + (let ((f0-40 0.000008138021) + (f1-10 122880.0) + (v1-105 (-> *target* control transv)) + ) + (set! (-> this target-inv-scale) + (fmax + (fmin + (* f0-40 (fmin f1-10 (sqrtf (+ (* (-> v1-105 x) (-> v1-105 x)) (* (-> v1-105 z) (-> v1-105 z)))))) + (-> this max-inv-scale) + ) + (-> this min-inv-scale) + ) + ) + ) + ) + (else + (set! (-> this target-inv-scale) 0.5) + ) + ) + (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) + ) + (set! (-> this icon-inv-scale) (/ (* 32768.0 (-> this offset y)) (-> this meters-per-texel))) + (set! (-> this map-inv-scale) + (/ (* 256.0 (-> this meters-per-texel) (-> this icon-inv-scale)) (-> this pos-scale)) + ) + (set! (-> this icon-inv-scale) (* 1.1428572 (-> this icon-inv-scale))) + (run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter)) + (when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0))) + (update-trails this) + (if *display-trail-graph* + (debug-draw this) + ) + #t + ) + ) + +;; definition for method 23 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-racer-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (local-vars + (sv-16 process) + (sv-20 dma-buffer) + (sv-208 pointer) + (sv-212 vector) + (sv-216 vector) + (sv-220 vector) + (sv-224 matrix) + (sv-228 matrix) + ) + (let ((s3-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (set! sv-20 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-208 (-> sv-20 base)) + (set! sv-212 (new 'stack-no-clear 'vector)) + (set! sv-216 (new 'stack-no-clear 'vector)) + (set! sv-220 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'matrix)) + (set! sv-228 (new 'stack-no-clear 'matrix)) + (set! (-> sv-216 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-216 y) 0.0) + (vector-normalize! sv-216 1.0) + (vector-z-quaternion! sv-220 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-220 1.0) + (set! (-> sv-220 y) 0.0) + (set! (-> sv-220 w) 0.0) + (vector-! sv-212 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) + (let ((f0-4 (/ (-> sv-212 x) (* (-> this meters-per-texel) (-> this icon-inv-scale)))) + (f1-3 (/ (-> sv-212 z) (* (-> this meters-per-texel) (-> this icon-inv-scale)))) + ) + (set-vector! (-> sv-224 rvec) (-> sv-216 z) 0.0 (- (-> sv-216 x)) 0.0) + (set-vector! (-> sv-224 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-224 fvec) (-> sv-216 x) 0.0 (-> sv-216 z) 0.0) + (set-vector! (-> sv-224 trans) 164.0 0.0 164.0 1.0) + (set-vector! (-> sv-228 rvec) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) + (set-vector! (-> sv-228 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-228 fvec) (-> sv-220 x) 0.0 (-> sv-220 z) 0.0) + (set-vector! (-> sv-228 trans) f0-4 0.0 f1-3 1.0) + ) + (let ((v1-42 (-> sv-228 trans))) + (when (< (sqrtf (+ (* (-> v1-42 x) (-> v1-42 x)) (* (-> v1-42 z) (-> v1-42 z)))) 50.0) + (matrix*! sv-228 sv-228 sv-224) + (let ((f0-12 7.0)) + (set-vector! (-> arg0 corner 0) 0.0 0.0 (- f0-12) 1.0) + (set-vector! (-> arg0 corner 1) f0-12 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 2) (- f0-12) 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 3) 0.0 0.0 f0-12 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-228) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-228) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-228) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-228) + (let* ((a0-38 (-> arg1 class color)) + (a0-45 (copy-and-set-field a0-38 r (shr (* (-> a0-38 r) (the-as uint (-> this color x))) 7))) + (a0-52 (copy-and-set-field a0-45 g (shr (* (-> a0-45 g) (the-as uint (-> this color y))) 7))) + (v1-59 + (copy-and-set-field + (copy-and-set-field a0-52 b (shr (* (-> a0-52 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((a0-65 (-> this draw4-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208)) a0-65) + ) + (let ((a0-66 (-> this draw4-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 1) a0-66) + ) + (set-vector! + (-> (the-as (inline-array vector4w) sv-208) 2) + (the-as int (-> v1-59 r)) + (the-as int (-> v1-59 g)) + (the-as int (-> v1-59 b)) + (the-as int (-> v1-59 a)) + ) + ) + (let ((v1-62 (the-as object (&+ sv-208 48)))) + (set! (-> (the-as (inline-array vector) v1-62) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-62) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-62) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-62) 0 w) 0.0) + ) + (let ((v1-64 (the-as object (&+ sv-208 64)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 w) 0) + ) + (let ((v1-66 (the-as object (&+ sv-208 80)))) + (set! (-> (the-as (inline-array vector) v1-66) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 w) 0.0) + ) + (let ((v1-68 (the-as object (&+ sv-208 96)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 w) 0) + ) + (let ((v1-70 (the-as object (&+ sv-208 112)))) + (set! (-> (the-as (inline-array vector) v1-70) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 w) 0.0) + ) + (let ((v1-72 (the-as object (&+ sv-208 128)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 w) 0) + ) + (let ((v1-74 (the-as object (&+ sv-208 144)))) + (set! (-> (the-as (inline-array vector) v1-74) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 w) 0.0) + ) + (let ((v1-76 (the-as object (&+ sv-208 160)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 w) 0) + ) + (&+! (-> sv-20 base) 176) + ) + ) + ) + (none) + ) + +;; definition for method 26 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-racer-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) + (local-vars + (sv-16 process) + (sv-20 float) + (sv-24 dma-buffer) + (sv-128 pointer) + (sv-132 vector) + (sv-136 vector) + (sv-140 matrix) + ) + (let ((s0-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s0-0 process-drawable) + s0-0 + ) + ) + ) + (set! sv-20 (-> *video-params* relative-x-scale)) + (set! sv-24 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-128 (-> sv-24 base)) + (set! sv-132 (new 'stack-no-clear 'vector)) + (set! sv-136 (new 'stack-no-clear 'vector)) + (set! sv-140 (new 'stack-no-clear 'matrix)) + (vector-z-quaternion! sv-136 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-136 -1.0) + (set! (-> sv-136 y) 0.0) + (set! (-> sv-136 w) 0.0) + (vector-! sv-132 (-> (the-as process-drawable sv-16) root trans) (-> this race-corner)) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (let ((f0-4 (+ arg3 (* (- 128.0 (/ (-> sv-132 x) arg2)) sv-20))) + (f1-4 (+ arg4 (/ (-> sv-132 z) arg2))) + ) + (set-vector! (-> sv-140 rvec) (-> sv-136 z) 0.0 (-> sv-136 x) 0.0) + (set-vector! (-> sv-140 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-140 fvec) (- (-> sv-136 x)) 0.0 (-> sv-136 z) 0.0) + (set-vector! (-> sv-140 trans) f0-4 0.0 f1-4 1.0) + ) + ) + (else + (let ((f0-8 (+ arg3 (* (/ (-> sv-132 x) arg2) sv-20))) + (f1-9 (+ arg4 (/ (-> sv-132 z) arg2))) + ) + (set-vector! (-> sv-140 rvec) (-> sv-136 z) 0.0 (- (-> sv-136 x)) 0.0) + (set-vector! (-> sv-140 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-140 fvec) (-> sv-136 x) 0.0 (-> sv-136 z) 0.0) + (set-vector! (-> sv-140 trans) f0-8 0.0 f1-9 1.0) + ) + ) + ) + (let ((f0-11 7.0)) + (set-vector! (-> arg0 corner 0) 0.0 0.0 (- f0-11) 1.0) + (set-vector! (-> arg0 corner 1) f0-11 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 2) (- f0-11) 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 3) 0.0 0.0 f0-11 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-140) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-140) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-140) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-140) + (let* ((a0-33 (-> arg1 class color)) + (a0-40 (copy-and-set-field a0-33 r (shr (* (-> a0-33 r) (the-as uint (-> this color x))) 7))) + (a0-47 (copy-and-set-field a0-40 g (shr (* (-> a0-40 g) (the-as uint (-> this color y))) 7))) + (v1-57 (copy-and-set-field + (copy-and-set-field a0-47 b (shr (* (-> a0-47 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((a0-60 (-> this draw4-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-128)) a0-60) + ) + (let ((a0-61 (-> this draw4-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-128) 1) a0-61) + ) + (let ((a0-63 (the-as object (&+ sv-128 32)))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 x) (the-as int (-> v1-57 r))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 y) (the-as int (-> v1-57 g))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 z) (the-as int (-> v1-57 b))) + (set! (-> (the-as (inline-array vector4w) a0-63) 0 w) (the-as int (-> v1-57 a))) + ) + ) + (let ((v1-60 (the-as object (&+ sv-128 48)))) + (set! (-> (the-as (inline-array vector) v1-60) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-60) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-60) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-60) 0 w) 0.0) + ) + (let ((v1-62 (the-as object (&+ sv-128 64)))) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-62) 0 w) 0) + ) + (let ((v1-64 (the-as object (&+ sv-128 80)))) + (set! (-> (the-as (inline-array vector) v1-64) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-64) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-64) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-64) 0 w) 0.0) + ) + (let ((v1-66 (the-as object (&+ sv-128 96)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 w) 0) + ) + (let ((v1-68 (the-as object (&+ sv-128 112)))) + (set! (-> (the-as (inline-array vector) v1-68) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-68) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-68) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-68) 0 w) 0.0) + ) + (let ((v1-70 (the-as object (&+ sv-128 128)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 w) 0) + ) + (let ((v1-72 (the-as object (&+ sv-128 144)))) + (set! (-> (the-as (inline-array vector) v1-72) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-72) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-72) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-72) 0 w) 0.0) + ) + (let ((v1-74 (the-as object (&+ sv-128 160)))) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-74) 0 w) 0) + ) + (&+! (-> sv-24 base) 176) + ) + (none) + ) + +;; definition for method 17 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-frustum-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (local-vars + (sv-16 process) + (sv-20 dma-buffer) + (sv-208 pointer) + (sv-212 texture) + (sv-216 vector) + (sv-220 vector) + (sv-224 vector) + (sv-228 matrix) + (sv-232 matrix) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (let ((s3-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (set! sv-20 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-208 (-> sv-20 base)) + (set! sv-212 (get-texture map-guard-frustum level-default-minimap)) + (set! sv-216 (new 'stack-no-clear 'vector)) + (set! sv-220 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! sv-228 (new 'stack-no-clear 'matrix)) + (set! sv-232 (new 'stack-no-clear 'matrix)) + (when sv-212 + (set! (-> sv-220 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-220 y) 0.0) + (vector-normalize! sv-220 1.0) + (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-224 1.0) + (set! (-> sv-224 y) 0.0) + (set! (-> sv-224 w) 0.0) + (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) + (let ((f0-4 (/ (-> sv-216 x) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + (f1-3 (/ (-> sv-216 z) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + ) + (set-vector! (-> sv-228 rvec) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) + (set-vector! (-> sv-228 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-228 fvec) (-> sv-220 x) 0.0 (-> sv-220 z) 0.0) + (set-vector! (-> sv-228 trans) 164.0 0.0 164.0 1.0) + (set-vector! (-> sv-232 rvec) (-> sv-224 z) 0.0 (- (-> sv-224 x)) 0.0) + (set-vector! (-> sv-232 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-232 fvec) (-> sv-224 x) 0.0 (-> sv-224 z) 0.0) + (set-vector! (-> sv-232 trans) f0-4 0.0 f1-3 1.0) + ) + (matrix*! sv-232 sv-232 sv-228) + (let ((f0-8 (/ -10.0 (-> this map-inv-scale)))) + (set-vector! (-> arg0 corner 0) 0.0 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 1) (- f0-8) 0.0 f0-8 1.0) + (set-vector! (-> arg0 corner 2) f0-8 0.0 f0-8 1.0) + (set-vector! (-> arg0 corner 3) 0.0 0.0 (* 2.0 f0-8) 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-232) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-232) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-232) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-232) + (let ((v1-47 (new 'stack-no-clear 'vector)) + (a0-40 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 corner 0 quad)) + (.lvf vf2 (&-> arg0 corner 1 quad)) + (.lvf vf3 (&-> arg0 corner 2 quad)) + (.lvf vf4 (&-> arg0 corner 3 quad)) + (.min.vf vf5 vf1 vf2) + (.min.vf vf5 vf5 vf3) + (.min.vf vf5 vf5 vf4) + (.max.vf vf6 vf1 vf2) + (.max.vf vf6 vf6 vf3) + (.max.vf vf6 vf6 vf4) + (.svf (&-> v1-47 quad) vf5) + (.svf (&-> a0-40 quad) vf6) + (when (and (< (-> a0-40 x) 228.0) (< (-> a0-40 z) 228.0) (< 100.0 (-> v1-47 x)) (< 100.0 (-> v1-47 z))) + (let* ((a0-46 (-> arg1 class color)) + (a0-53 (copy-and-set-field a0-46 r (shr (* (-> a0-46 r) (the-as uint (-> this color x))) 7))) + (a0-60 (copy-and-set-field a0-53 g (shr (* (-> a0-53 g) (the-as uint (-> this color y))) 7))) + (s4-1 (copy-and-set-field + (copy-and-set-field a0-60 b (shr (* (-> a0-60 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> this frustum-alpha) (-> arg1 alpha))) + ) + ) + ) + (let ((v1-58 (-> this adgif-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208) 0) v1-58) + ) + (let ((v1-59 (-> this adgif-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 1) v1-59) + ) + (adgif-shader<-texture-simple! (the-as adgif-shader (&+ sv-208 32)) sv-212) + (let ((v1-61 (-> this draw4-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208) 7) v1-61) + ) + (let ((v1-62 (-> this draw4-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 8) v1-62) + ) + (let ((v1-64 (the-as object (&+ sv-208 144)))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 x) (the-as int (-> s4-1 r))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 y) (the-as int (-> s4-1 g))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 z) (the-as int (-> s4-1 b))) + (set! (-> (the-as (inline-array vector4w) v1-64) 0 w) (the-as int (-> s4-1 a))) + ) + ) + (let ((v1-66 (the-as object (&+ sv-208 160)))) + (set! (-> (the-as (inline-array vector) v1-66) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-66) 0 w) 0.0) + ) + (let ((v1-68 (the-as object (&+ sv-208 176)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 w) 0) + ) + (let ((v1-70 (the-as object (&+ sv-208 192)))) + (set! (-> (the-as (inline-array vector) v1-70) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-70) 0 w) 0.0) + ) + (let ((v1-72 (the-as object (&+ sv-208 208)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 w) 0) + ) + (let ((v1-74 (the-as object (&+ sv-208 224)))) + (set! (-> (the-as (inline-array vector) v1-74) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-74) 0 w) 0.0) + ) + (let ((v1-76 (the-as object (&+ sv-208 240)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-76) 0 w) 0) + ) + (let ((v1-78 (the-as object (&+ sv-208 256)))) + (set! (-> (the-as (inline-array vector) v1-78) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-78) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-78) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-78) 0 w) 0.0) + ) + (let ((v1-80 (the-as object (&+ sv-208 272)))) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-80) 0 w) 0) + ) + (&+! (-> sv-20 base) 288) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 18 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-frustum-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (local-vars + (sv-16 process) + (sv-20 dma-buffer) + (sv-208 pointer) + (sv-212 texture) + (sv-216 vector) + (sv-220 vector) + (sv-224 vector) + (sv-228 matrix) + (sv-232 matrix) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (let ((s3-0 (handle->process (-> arg1 handle)))) + (set! sv-16 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (set! sv-20 (-> arg0 buf)) + (when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root))) + (set! sv-208 (-> sv-20 base)) + (set! sv-212 (get-texture map-guard-frustum level-default-minimap)) + (set! sv-216 (new 'stack-no-clear 'vector)) + (set! sv-220 (new 'stack-no-clear 'vector)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! sv-228 (new 'stack-no-clear 'matrix)) + (set! sv-232 (new 'stack-no-clear 'matrix)) + (when sv-212 + (set! (-> sv-220 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-220 y) 0.0) + (vector-normalize! sv-220 1.0) + (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) + (vector-xz-normalize! sv-224 1.0) + (set! (-> sv-224 y) 0.0) + (set! (-> sv-224 w) 0.0) + (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) + (let ((f0-4 (/ (-> sv-216 x) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + (f1-3 (/ (-> sv-216 z) (* (-> this meters-per-texel) (-> this map-inv-scale)))) + ) + (set-vector! (-> sv-228 rvec) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) + (set-vector! (-> sv-228 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-228 fvec) (-> sv-220 x) 0.0 (-> sv-220 z) 0.0) + (set-vector! (-> sv-228 trans) 164.0 0.0 164.0 1.0) + (set-vector! (-> sv-232 rvec) (-> sv-224 z) 0.0 (- (-> sv-224 x)) 0.0) + (set-vector! (-> sv-232 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> sv-232 fvec) (-> sv-224 x) 0.0 (-> sv-224 z) 0.0) + (set-vector! (-> sv-232 trans) f0-4 0.0 f1-3 1.0) + ) + (matrix*! sv-232 sv-232 sv-228) + (let ((f0-7 12.0)) + (set-vector! (-> arg0 corner 0) (- f0-7) 0.0 0.0 1.0) + (set-vector! (-> arg0 corner 1) 0.0 0.0 f0-7 1.0) + (set-vector! (-> arg0 corner 2) 0.0 0.0 (- f0-7) 1.0) + (set-vector! (-> arg0 corner 3) f0-7 0.0 0.0 1.0) + ) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) sv-232) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) sv-232) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-232) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-232) + (let ((v1-47 (new 'stack-no-clear 'vector)) + (a0-39 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 corner 0 quad)) + (.lvf vf2 (&-> arg0 corner 1 quad)) + (.lvf vf3 (&-> arg0 corner 2 quad)) + (.lvf vf4 (&-> arg0 corner 3 quad)) + (.min.vf vf5 vf1 vf2) + (.min.vf vf5 vf5 vf3) + (.min.vf vf5 vf5 vf4) + (.max.vf vf6 vf1 vf2) + (.max.vf vf6 vf6 vf3) + (.max.vf vf6 vf6 vf4) + (.svf (&-> v1-47 quad) vf5) + (.svf (&-> a0-39 quad) vf6) + (when (and (< (-> a0-39 x) 228.0) (< (-> a0-39 z) 228.0) (< 100.0 (-> v1-47 x)) (< 100.0 (-> v1-47 z))) + (let* ((a3-0 (-> arg1 class color)) + (a2-6 (+ (* (the-as uint 320) (-> arg1 class icon-xy x)) 8)) + (a1-14 (+ (* (the-as uint 320) (-> arg1 class icon-xy y)) 8)) + (v1-54 (+ a2-6 304)) + (a0-49 (+ a1-14 304)) + ) + (let* ((t0-2 (copy-and-set-field a3-0 r (shr (* (-> a3-0 r) (the-as uint (-> this color x))) 7))) + (t0-9 (copy-and-set-field t0-2 g (shr (* (-> t0-2 g) (the-as uint (-> this color y))) 7))) + (a3-13 (copy-and-set-field + (copy-and-set-field t0-9 b (shr (* (-> t0-9 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((t0-22 (-> this draw3-tmpl dma-vif quad))) + (set! (-> (the-as (pointer uint128) sv-208) 0) t0-22) + ) + (let ((t0-23 (-> this draw3-tmpl quad 1))) + (set! (-> (the-as (pointer uint128) sv-208) 1) t0-23) + ) + (let ((t0-25 (the-as (object object) (&-> (the-as (pointer uint128) sv-208) 2)))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 x) (the-as int (-> a3-13 r))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 y) (the-as int (-> a3-13 g))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 z) (the-as int (-> a3-13 b))) + (set! (-> (the-as (inline-array vector4w) t0-25) 0 w) (the-as int (-> a3-13 a))) + ) + ) + (let ((a3-16 (the-as (inline-array vector4w) (&+ sv-208 48)))) + (set! (-> a3-16 0 x) a2-6) + (set! (-> a3-16 0 y) a1-14) + (set! (-> a3-16 0 z) 0) + (set! (-> a3-16 0 w) 0) + ) + (let ((a3-18 (the-as object (&+ sv-208 64)))) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) a3-18) 0 w) 0) + ) + (let ((a3-20 (the-as (inline-array vector4w) (&+ sv-208 80)))) + (set! (-> a3-20 0 x) a2-6) + (set! (-> a3-20 0 y) a0-49) + (set! (-> a3-20 0 z) 0) + (set! (-> a3-20 0 w) 0) + ) + (let ((a2-8 (the-as object (&+ sv-208 96)))) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) a2-8) 0 w) 0) + ) + (let ((a2-10 (the-as (inline-array vector4w) (&+ sv-208 112)))) + (set! (-> a2-10 0 x) v1-54) + (set! (-> a2-10 0 y) a1-14) + (set! (-> a2-10 0 z) 0) + (set! (-> a2-10 0 w) 0) + ) + (let ((a1-16 (the-as object (&+ sv-208 128)))) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 x) (the int (* 16.0 (-> arg0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 y) (the int (* 16.0 (-> arg0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) a1-16) 0 w) 0) + ) + (let ((a1-18 (the-as (inline-array vector4w) (&+ sv-208 144)))) + (set! (-> a1-18 0 x) v1-54) + (set! (-> a1-18 0 y) a0-49) + (set! (-> a1-18 0 z) 0) + (set! (-> a1-18 0 w) 0) + ) + ) + (let ((v1-56 (the-as object (&+ sv-208 160)))) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 x) (the int (* 16.0 (-> arg0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 y) (the int (* 16.0 (-> arg0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-56) 0 w) 0) + ) + (&+! (-> sv-20 base) 176) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 21 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod sub-draw-1-1 ((this minimap) (arg0 minimap-draw-work)) + (let ((s5-0 (-> arg0 buf))) + (set-display-gs-state s5-0 (the-as int (-> *map-texture-base* vram-page)) 128 128 0 0) + (let ((s3-0 (-> s5-0 base))) + (set! (-> (the-as (pointer uint128) s3-0) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-0) 1) (-> this adgif-tmpl quad 1)) + (let ((a1-2 (-> this last-tex))) + (if (not a1-2) + (set! a1-2 (get-texture common-white common)) + ) + (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s3-0 32)) (the-as texture a1-2)) + ) + ) + (&+! (-> s5-0 base) 112) + (dma-buffer-add-gs-set s5-0 + (clamp-1 (new 'static 'gs-clamp)) + (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) + (texa (new 'static 'gs-texa :ta1 #x80)) + ) + (let ((s3-1 (-> s5-0 base))) + (let ((f30-0 (-> *video-params* relative-x-scale))) + (set! (-> (the-as (pointer uint128) s3-1) 0) (-> this draw2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-1) 1) (-> this draw2-tmpl quad 1)) + (let ((s2-0 (new-stack-vector0))) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 quad) (-> (matrix-local->world #f #f) fvec quad)) + (set! (-> s1-0 y) 0.0) + (vector-normalize! s1-0 1.0) + (let ((v1-16 (-> arg0 mat))) + (set! (-> v1-16 rvec x) (* (-> s1-0 z) f30-0)) + (set! (-> v1-16 rvec y) 0.0) + (set! (-> v1-16 rvec z) (- (-> s1-0 x))) + (set! (-> v1-16 rvec w) 0.0) + ) + (set-vector! (-> arg0 mat uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> arg0 mat fvec) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0) + ) + (vector-! s2-0 (target-pos 0) (-> this minimap-corner)) + (set! (-> s2-0 x) (/ (-> s2-0 x) (-> this pos-scale))) + (set! (-> s2-0 z) (/ (-> s2-0 z) (-> this pos-scale))) + (vector+! (-> arg0 mat trans) s2-0 (-> this offset)) + ) + ) + (set! (-> arg0 mat trans y) 0.0) + (set! (-> arg0 corner 0 x) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 0 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 0 w) 1.0) + (set! (-> arg0 corner 1 x) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 1 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 1 w) 1.0) + (set! (-> arg0 corner 2 x) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 2 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 2 w) 1.0) + (set! (-> arg0 corner 3 x) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 3 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 3 w) 1.0) + (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) + (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) + (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) (-> arg0 mat)) + (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) (-> arg0 mat)) + (let ((v1-33 (the-as object (&+ s3-1 32)))) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 x) 128) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 y) 128) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 z) 128) + (set! (-> (the-as (inline-array vector4w) v1-33) 0 w) 128) + ) + (let ((v1-34 (the-as object (&+ s3-1 48)))) + (set! (-> (the-as (inline-array vector) v1-34) 0 x) (-> arg0 corner 0 x)) + (set! (-> (the-as (inline-array vector) v1-34) 0 y) (-> arg0 corner 0 z)) + (set! (-> (the-as (inline-array vector) v1-34) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 w) 1.0) + ) + (let ((v1-35 (the-as (inline-array vector4w) (&+ s3-1 64)))) + (set! (-> v1-35 0 x) 0) + (set! (-> v1-35 0 y) 0) + (set! (-> v1-35 0 z) #xffffff) + (set! (-> v1-35 0 w) 0) + ) + (let ((v1-36 (the-as object (&+ s3-1 80)))) + (set! (-> (the-as (inline-array vector) v1-36) 0 x) (-> arg0 corner 1 x)) + (set! (-> (the-as (inline-array vector) v1-36) 0 y) (-> arg0 corner 1 z)) + (set! (-> (the-as (inline-array vector) v1-36) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-36) 0 w) 1.0) + ) + (let ((v1-37 (the-as object (&+ s3-1 96)))) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 y) 0) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-37) 0 w) 0) + ) + (let ((v1-38 (the-as object (&+ s3-1 112)))) + (set! (-> (the-as (inline-array vector) v1-38) 0 x) (-> arg0 corner 2 x)) + (set! (-> (the-as (inline-array vector) v1-38) 0 y) (-> arg0 corner 2 z)) + (set! (-> (the-as (inline-array vector) v1-38) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-38) 0 w) 1.0) + ) + (let ((v1-39 (the-as (inline-array vector4w) (&+ s3-1 128)))) + (set! (-> v1-39 0 x) 0) + (set! (-> v1-39 0 y) 2048) + (set! (-> v1-39 0 z) #xffffff) + (set! (-> v1-39 0 w) 0) + ) + (let ((v1-40 (the-as object (&+ s3-1 144)))) + (set! (-> (the-as (inline-array vector) v1-40) 0 x) (-> arg0 corner 3 x)) + (set! (-> (the-as (inline-array vector) v1-40) 0 y) (-> arg0 corner 3 z)) + (set! (-> (the-as (inline-array vector) v1-40) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-40) 0 w) 1.0) + ) + (let ((v1-41 (the-as object (&+ s3-1 160)))) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 y) 2048) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-41) 0 w) 0) + ) + ) + (&+! (-> s5-0 base) 176) + (let ((f0-57 1.0)) + (when *target* + (if (focus-test? *target* pilot) + (set! f0-57 0.0) + ) + ) + (seek! (-> this frustum-alpha) f0-57 (seconds-per-frame)) + ) + (dma-buffer-add-gs-set s5-0 (xyoffset-1 (new 'static 'gs-xy-offset :ofx #x640 :ofy #x640))) + (when (!= (-> this frustum-alpha) 0.0) + (let ((s3-2 (-> *minimap* engine alive-list))) + (while s3-2 + (let ((a2-6 s3-2)) + (if (logtest? (-> a2-6 class flags) (minimap-flag frustum)) + (draw-frustum-1 this arg0 a2-6) + ) + ) + (set! s3-2 (-> s3-2 next)) + ) + ) + ) + (let ((s2-1 (-> arg0 buf base)) + (s3-3 (get-texture mini-map-icons level-default-minimap)) + ) + (when s3-3 + (set! (-> (the-as (pointer uint128) s2-1) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s2-1) 2)) s3-3) + (&+! (-> arg0 buf base) 112) + ) + (if (not s3-3) + (format *stdebug* "minimap: mini-map-icons texture is #f~%") + ) + ) + (let ((s3-4 (-> *minimap* engine alive-list))) + (while s3-4 + (let ((a2-7 s3-4)) + (if (logtest? (-> a2-7 class flags) (minimap-flag frustum)) + (draw-frustum-2 this arg0 a2-7) + ) + ) + (set! s3-4 (-> s3-4 next)) + ) + ) + (let ((s3-5 (-> arg0 buf base)) + (a1-37 (get-texture map-target-marker level-default-minimap)) + ) + (when a1-37 + (set! (-> (the-as (pointer uint128) s3-5) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-5) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-5) 2)) a1-37) + (&+! (-> arg0 buf base) 112) + ) + ) + (let ((s3-6 (-> *minimap* engine alive-list))) + (while s3-6 + (let ((a2-8 s3-6)) + (if (logtest? (-> a2-8 class flags) (minimap-flag racer)) + (draw-racer-2 this arg0 a2-8) + ) + ) + (set! s3-6 (-> s3-6 next)) + ) + ) + (dma-buffer-add-gs-set s5-0 + (frame-1 (new 'static 'gs-frame :fbw #x2 :fbmsk #xffffff :fbp (-> *map-texture-base* vram-page))) + (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) + (xyoffset-1 (new 'static 'gs-xy-offset)) + ) + (let ((s3-7 (-> s5-0 base))) + (set! (-> (the-as (pointer uint128) s3-7) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! + (the-as adgif-shader (&-> (the-as (pointer uint128) s3-7) 2)) + (get-texture minimap-mask level-default-minimap) + ) + (set! (-> (the-as (pointer uint128) s3-7) 7) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 8) (-> this sprite-tmpl quad 1)) + (let ((v1-110 (the-as object (&+ s3-7 144)))) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 x) 128) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 y) 128) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 z) 128) + (set! (-> (the-as (inline-array vector4w) v1-110) 0 w) 128) + ) + (let ((v1-111 (the-as (inline-array vector4w) (&+ s3-7 160)))) + (set! (-> v1-111 0 x) 0) + (set! (-> v1-111 0 y) 0) + (set! (-> v1-111 0 z) 0) + (set! (-> v1-111 0 w) 0) + ) + (let ((v1-112 (the-as (inline-array vector4w) (&+ s3-7 176)))) + (set! (-> v1-112 0 x) 0) + (set! (-> v1-112 0 y) 0) + (set! (-> v1-112 0 z) #xffffff) + (set! (-> v1-112 0 w) 0) + ) + (let ((v1-113 (the-as object (&+ s3-7 192)))) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 x) 1024) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 y) 1024) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-113) 0 w) 0) + ) + (let ((v1-114 (the-as object (&+ s3-7 208)))) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 y) 2048) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-114) 0 w) 0) + ) + ) + (&+! (-> s5-0 base) 224) + (set! (-> arg0 buf) s5-0) + ) + 0 + (none) + ) + +;; definition for method 19 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod sub-draw-1-2 ((this minimap) (arg0 minimap-draw-work)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 vector) (sv-64 int) (sv-80 int)) + (let ((s5-0 (-> arg0 buf))) + (reset-display-gs-state *display* s5-0) + (dma-buffer-add-gs-set s5-0 + (test-1 (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))) + (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) + (tex0-1 (new 'static 'gs-tex0 + :tbw #x2 + :tcc #x1 + :th (log2 128) + :tw (log2 128) + :tbp0 (-> *map-texture-base* vram-block) + ) + ) + (tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (clamp-1 (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) + (texflush 0) + ) + (let ((f30-0 (-> *video-params* relative-x-scale))) + (let ((s3-1 (the-as object (-> s5-0 base))) + (v1-22 (the int (* 112.0 f30-0))) + ) + 0 + 0 + (let ((s0-0 (* (+ (-> arg0 draw-pos y) 1840) 16)) + (s2-1 (* (+ (-> arg0 draw-pos y) 1952) 16)) + (s1-2 (-> arg0 draw-pos z)) + ) + (cond + ((-> arg0 justify-right) + (set! sv-64 (* (+ (- 1792 v1-22) (-> arg0 draw-pos x)) 16)) + (set! sv-80 (* (+ (-> arg0 draw-pos x) 1792) 16)) + sv-80 + ) + (else + (set! sv-64 (* (+ (-> arg0 draw-pos x) 1792) 16)) + (set! sv-80 (* (+ v1-22 1792 (-> arg0 draw-pos x)) 16)) + sv-80 + ) + ) + (set! (-> (the-as (inline-array vector4w) s3-1) 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) s3-1) 1 quad) (-> this sprite-tmpl quad 1)) + (let ((v1-36 (-> this color quad))) + (set! (-> (the-as (inline-array vector4w) s3-1) 2 quad) v1-36) + ) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 3) 0 0 0 0) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 4) sv-80 s0-0 s1-2 0) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 5) 2048 2048 0 0) + (set-vector! (-> (the-as (inline-array vector4w) s3-1) 6) sv-64 s2-1 s1-2 0) + ) + (else + (let ((v1-42 (the-as (inline-array vector4w) (&+ (the-as pointer s3-1) 48)))) + (set! (-> v1-42 0 x) 0) + (set! (-> v1-42 0 y) 0) + (set! (-> v1-42 0 z) 0) + (set! (-> v1-42 0 w) 0) + ) + (let ((a0-31 (the-as object (&+ (the-as pointer s3-1) 64)))) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 x) sv-64) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 y) s0-0) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 z) s1-2) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 w) 0) + ) + (let ((v1-44 (the-as object (&+ (the-as pointer s3-1) 80)))) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 x) 2048) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 y) 2048) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-44) 0 w) 0) + ) + (let ((v1-45 (the-as object (&+ (the-as pointer s3-1) 96)))) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 x) sv-80) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 y) s2-1) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 z) s1-2) + (set! (-> (the-as (inline-array vector4w) v1-45) 0 w) 0) + ) + ) + ) + ) + ) + (&+! (-> s5-0 base) 112) + (dma-buffer-add-gs-set s5-0 + (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest greater) :zte #x1 :ztst (gs-ztest always))) + ) + (set! sv-48 (new-stack-vector0)) + (set! sv-52 (new-stack-vector0)) + (set! sv-56 (target-pos 0)) + (set! (-> sv-52 quad) (-> (matrix-world->local #f #f) fvec quad)) + (set! (-> sv-52 y) 0.0) + (vector-normalize! sv-52 1.0) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (let ((v1-57 (-> arg0 mat))) + (set! (-> v1-57 rvec x) (* (-> sv-52 z) (- f30-0))) + (set! (-> v1-57 rvec y) 0.0) + (set! (-> v1-57 rvec z) (- (-> sv-52 x))) + (set! (-> v1-57 rvec w) 0.0) + ) + (set-vector! (-> arg0 mat uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> arg0 mat fvec) (* (-> sv-52 x) (- f30-0)) 0.0 (-> sv-52 z) 0.0) + (set-vector! (-> arg0 mat trans) 0.0 0.0 (the float (+ (-> arg0 draw-pos y) 1896)) 1.0) + ) + (else + (let ((v1-61 (-> arg0 mat))) + (set! (-> v1-61 rvec x) (* (-> sv-52 z) f30-0)) + (set! (-> v1-61 rvec y) 0.0) + (set! (-> v1-61 rvec z) (- (-> sv-52 x))) + (set! (-> v1-61 rvec w) 0.0) + ) + (set-vector! (-> arg0 mat uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> arg0 mat fvec) (* (-> sv-52 x) f30-0) 0.0 (-> sv-52 z) 0.0) + (set-vector! (-> arg0 mat trans) 0.0 0.0 (the float (+ (-> arg0 draw-pos y) 1896)) 1.0) + ) + ) + (let ((v1-66 (the int (* 56.0 f30-0)))) + (if (-> arg0 justify-right) + (set! (-> arg0 mat trans x) (the float (+ (- 1792 v1-66) (-> arg0 draw-pos x)))) + (set! (-> arg0 mat trans x) (the float (+ v1-66 1792 (-> arg0 draw-pos x)))) + ) + ) + ) + (set! (-> arg0 buf) s5-0) + ) + 0 + (none) + ) + +;; definition for method 16 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch pointer vs none. +(defmethod draw-connection ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) + (let ((s1-0 (target-pos 0))) + (cond + ((= (-> arg1 position) #t) + (let* ((s3-0 (handle->process (-> arg1 handle))) + (v1-4 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (when (and v1-4 (nonzero? (-> (the-as process-drawable v1-4) root))) + (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable v1-4) root trans quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + ) + ) + ((and (= (logand (the-as int (-> arg1 position)) 7) 4) + (= (-> (the-as entity-actor (-> arg1 position)) type) entity-actor) + ) + (let* ((v1-15 (the-as structure (-> arg1 position))) + (s3-1 (if (the-as vector v1-15) + (-> (the-as entity-actor v1-15) extra process) + ) + ) + (a0-16 (if (type? s3-1 process-drawable) + s3-1 + ) + ) + ) + (cond + (a0-16 + (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable a0-16) root trans quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + (else + (set! (-> arg1 last-world-pos quad) (-> (the-as entity-actor (-> arg1 position)) extra trans quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + ) + ) + ) + (else + (set! (-> arg1 last-world-pos quad) (-> arg1 position quad)) + (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) + ) + ) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s2-0 #f) + ) + 1.0 + 0.0 + (let ((f30-0 (/ 1.0 (* (-> this icon-inv-scale) (-> this meters-per-texel))))) + (set! (-> s3-2 quad) (-> arg1 last-relative-pos quad)) + (set! (-> s3-2 x) (* (-> s3-2 x) f30-0)) + (set! (-> s3-2 z) (* (-> s3-2 z) f30-0)) + (set! (-> s3-2 y) 0.0) + (set! (-> s3-2 w) 1.0) + (let* ((v1-29 s3-2) + (f28-0 (sqrtf (+ (* (-> v1-29 x) (-> v1-29 x)) (* (-> v1-29 z) (-> v1-29 z))))) + ) + (if (or (and (logtest? (minimap-flag local-only) (-> arg1 class flags)) + (not (logtest? (the-as minimap-flag (logand #x3c0000 (-> arg0 global-flags))) (-> arg1 class flags))) + ) + (logtest? (-> arg1 class flags) (minimap-flag bigmap-only)) + ) + (set! s2-0 #t) + ) + (cond + ((logtest? (-> arg1 class flags) (minimap-flag trail)) + (cond + (*trail-graph* + (let ((a2-2 (get-trail-for-connection this arg1 #f))) + (cond + ((not a2-2) + (when (!= (-> arg1 alpha) 0.0) + (when (not (get-trail-for-connection this arg1 #t)) + (let ((s2-1 (-> *minimap* engine alive-list))) + (while s2-1 + (let ((a1-15 s2-1)) + (if (and (= (-> a1-15 alpha) 0.0) (logtest? (-> arg1 class flags) (minimap-flag trail))) + (free-trail-by-connection *minimap* a1-15) + ) + ) + (set! s2-1 (-> s2-1 next)) + ) + ) + ) + ) + (set! s2-0 #t) + (set! (-> arg1 edge-ry) -131072) + ) + ((time-elapsed? (the-as int (-> a2-2 last-updated)) (seconds 5)) + (set! s2-0 #t) + (set! (-> arg1 edge-ry) -131072) + ) + ((< 50.0 f28-0) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! (-> s0-0 quad) (-> s3-2 quad)) + (let ((s1-1 (get-icon-draw-pos *minimap* arg1 a2-2 s1-0 f30-0 s3-2))) + (if (not s1-1) + (vector-normalize-copy! s3-2 s0-0 50.0) + ) + (let ((f30-1 (atan (-> s3-2 x) (-> s3-2 z)))) + (let ((f28-1 (the float (-> arg1 edge-ry)))) + (when (!= f28-1 -131072.0) + (let* ((f0-20 (deg- f30-1 f28-1)) + (f1-7 (fabs f0-20)) + (f2-3 (* 16384.0 (seconds-per-frame))) + ) + (when (< f2-3 f1-7) + (set! f30-1 (+ f28-1 (if (>= f0-20 0.0) + f2-3 + (- f2-3) + ) + ) + ) + (set-vector! s3-2 (sin f30-1) 0.0 (cos f30-1) 1.0) + (vector-normalize! s3-2 (if s1-1 + 50.0 + 66.0 + ) + ) + ) + ) + ) + ) + (set! (-> arg1 edge-ry) (the int f30-1)) + ) + ) + ) + ) + (else + (set! (-> arg1 edge-ry) (the int (atan (-> s3-2 x) (-> s3-2 z)))) + ) + ) + ) + ) + (else + (set! s2-0 #t) + (set! (-> arg1 edge-ry) -131072) + ) + ) + ) + ((logtest? (-> arg1 class flags) (minimap-flag clamp)) + (cond + ((< 50.0 f28-0) + (let ((a1-22 (new 'stack-no-clear 'vector))) + (set! (-> a1-22 quad) (-> s3-2 quad)) + (vector-normalize-copy! s3-2 a1-22 54.0) + ) + (let ((f30-2 (atan (-> s3-2 x) (-> s3-2 z)))) + (let ((f28-2 (the float (-> arg1 edge-ry)))) + (when (!= f28-2 -131072.0) + (let* ((f0-37 (deg- f30-2 f28-2)) + (f1-9 (fabs f0-37)) + (f2-5 (* 16384.0 (seconds-per-frame))) + ) + (when (< f2-5 f1-9) + (set! f30-2 (+ f28-2 (if (>= f0-37 0.0) + f2-5 + (- f2-5) + ) + ) + ) + (set-vector! s3-2 (sin f30-2) 0.0 (cos f30-2) 1.0) + (vector-normalize! s3-2 54.0) + ) + ) + ) + ) + (set! (-> arg1 edge-ry) (the int f30-2)) + ) + ) + (else + (set! (-> arg1 edge-ry) (the int (atan (-> s3-2 x) (-> s3-2 z)))) + ) + ) + ) + (else + (if (< 50.0 f28-0) + (set! s2-0 #t) + ) + ) + ) + ) + ) + (if (or (logtest? (-> arg1 class flags) (minimap-flag frustum)) + (logtest? (-> arg1 class flags) (minimap-flag racer)) + (and (logtest? (-> arg1 class flags) (minimap-flag flash)) + (< (logand (-> *display* base-clock integral-frame-counter) 15) (seconds 0.027)) + ) + ) + (set! s2-0 #t) + ) + (if (logtest? (-> arg1 class flags) (minimap-flag goal)) + (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> this goal-time)) 6))) + ) + (when (not s2-0) + (vector-matrix*! s3-2 s3-2 (-> arg0 mat)) + (let ((v1-122 (-> arg0 buf base))) + (let* ((f0-52 (-> arg1 class scale)) + (a1-28 (-> arg1 class color)) + (a1-35 (copy-and-set-field a1-28 r (shr (* (-> a1-28 r) (the-as uint (-> this color x))) 7))) + (a1-42 (copy-and-set-field a1-35 g (shr (* (-> a1-35 g) (the-as uint (-> this color y))) 7))) + (a0-78 (copy-and-set-field + (copy-and-set-field a1-42 b (shr (* (-> a1-42 b) (the-as uint (-> this color z))) 7)) + a + (the int (* 128.0 (-> arg1 alpha))) + ) + ) + ) + (let ((f1-16 (* 20.0 (-> *video-params* relative-x-scale) f0-52)) + (f0-53 (* 20.0 f0-52)) + ) + (set! (-> arg0 corner 0 x) (the float (the int (- (-> s3-2 x) (* 0.5 f1-16))))) + (set! (-> arg0 corner 0 z) (the float (the int (- (-> s3-2 z) (* 0.5 f0-53))))) + (set! (-> arg0 corner 1 x) (+ (-> arg0 corner 0 x) f1-16)) + (set! (-> arg0 corner 1 z) (+ (-> arg0 corner 0 z) f0-53)) + ) + (let* ((a3-1 (+ (* (the-as uint 320) (-> arg1 class icon-xy x)) 8)) + (t0-1 (+ (* (the-as uint 320) (-> arg1 class icon-xy y)) 8)) + (a1-65 (+ a3-1 312)) + (a2-14 (+ t0-1 312)) + ) + (set! (-> (the-as (pointer uint128) v1-122) 0) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-122) 1) (-> this sprite-tmpl quad 1)) + (let ((t1-3 (the-as object (&+ v1-122 32)))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 x) (the-as int (-> a0-78 r))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 y) (the-as int (-> a0-78 g))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 z) (the-as int (-> a0-78 b))) + (set! (-> (the-as (inline-array vector4w) t1-3) 0 w) (the-as int (-> a0-78 a))) + ) + (let ((a0-80 (the-as (inline-array vector4w) (&+ v1-122 48)))) + (set! (-> a0-80 0 x) a3-1) + (set! (-> a0-80 0 y) t0-1) + (set! (-> a0-80 0 z) 0) + (set! (-> a0-80 0 w) 0) + ) + (let ((a0-81 (the-as object (&+ v1-122 64)))) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 x) (the int (* 16.0 (-> arg0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 y) (the int (* 16.0 (-> arg0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) a0-81) 0 w) 0) + ) + (let ((a0-82 (the-as (inline-array vector4w) (&+ v1-122 80)))) + (set! (-> a0-82 0 x) a1-65) + (set! (-> a0-82 0 y) a2-14) + (set! (-> a0-82 0 z) 0) + (set! (-> a0-82 0 w) 0) + ) + ) + ) + (let ((v1-123 (the-as object (&+ v1-122 96)))) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 x) (the int (* 16.0 (-> arg0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 y) (the int (* 16.0 (-> arg0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-123) 0 w) 0) + ) + ) + (&+! (-> arg0 buf base) 112) + ) + ) + ) + (none) + ) + +;; definition for method 15 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-1 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) + (local-vars (v1-35 uint128)) + (let ((gp-0 (new 'stack-no-clear 'minimap-draw-work))) + (set! (-> gp-0 buf) arg0) + (set! (-> gp-0 draw-pos quad) (-> arg1 quad)) + (set! (-> gp-0 justify-right) arg2) + (set! (-> gp-0 global-flags) (the-as uint 0)) + (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (logior! (-> gp-0 global-flags) #x40000) + ) + (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (logior! (-> gp-0 global-flags) #x100000) + ) + (if (= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (logior! (-> gp-0 global-flags) #x80000) + ) + (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (logior! (-> gp-0 global-flags) #x200000) + ) + (sub-draw-1-1 this gp-0) + (sub-draw-1-2 this gp-0) + (when #t + (let ((s1-0 (-> gp-0 buf base)) + (s3-4 (get-texture mini-map-icons level-default-minimap)) + (s2-0 (-> *level* level-default texture-mask 8)) + ) + (cond + (s3-4 + (set! (-> (the-as (pointer uint128) s1-0) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s1-0) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s1-0) 2)) s3-4) + (&+! (-> gp-0 buf base) 112) + (let ((v1-34 (-> s2-0 mask quad)) + (a0-15 (-> s3-4 masks data 0 mask quad)) + ) + (.por v1-35 v1-34 a0-15) + ) + (set! (-> s2-0 mask quad) v1-35) + ) + (else + (format *stdebug* "minimap: mini-map-icons texture is #f~%") + ) + ) + ) + ) + (let ((s3-5 (-> *minimap* engine alive-list))) + (while s3-5 + (let ((a2-5 s3-5)) + (draw-connection this gp-0 a2-5) + ) + (set! s3-5 (-> s3-5 next)) + ) + ) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (f30-0 (-> *video-params* relative-x-scale)) + ) + (when *target* + (vector-z-quaternion! s0-0 (-> *target* control quat)) + (vector-xz-normalize! s0-0 1.0) + (set! (-> s0-0 y) 0.0) + (set! (-> s0-0 w) 0.0) + (vector-matrix*! s0-0 s0-0 (-> gp-0 mat)) + (let ((s3-6 (-> arg0 base)) + (s2-1 (get-texture map-target-marker level-default-minimap)) + (s1-1 (new 'stack-no-clear 'matrix)) + (v1-48 (the int (* 56.0 f30-0))) + ) + (when s2-1 + (set-vector! (-> s1-1 rvec) (* (-> s0-0 z) f30-0) 0.0 (- (-> s0-0 x)) 0.0) + (set-vector! (-> s1-1 uvec) 0.0 1.0 0.0 0.0) + (set-vector! (-> s1-1 fvec) (* (-> s0-0 x) f30-0) 0.0 (-> s0-0 z) 1.0) + (set-vector! (-> s1-1 trans) 0.0 0.0 (the float (+ (-> gp-0 draw-pos y) 1896)) 1.0) + (if (-> gp-0 justify-right) + (set! (-> s1-1 trans x) (the float (+ (- 1792 v1-48) (-> gp-0 draw-pos x)))) + (set! (-> s1-1 trans x) (the float (+ v1-48 1792 (-> gp-0 draw-pos x)))) + ) + (let ((f0-29 7.0)) + (set-vector! (-> gp-0 corner 0) 0.0 0.0 (- f0-29) 1.0) + (set-vector! (-> gp-0 corner 1) f0-29 0.0 0.0 1.0) + (set-vector! (-> gp-0 corner 2) (- f0-29) 0.0 0.0 1.0) + (set-vector! (-> gp-0 corner 3) 0.0 0.0 f0-29 1.0) + ) + (vector-matrix*! (the-as vector (-> gp-0 corner)) (the-as vector (-> gp-0 corner)) s1-1) + (vector-matrix*! (-> gp-0 corner 1) (-> gp-0 corner 1) s1-1) + (vector-matrix*! (-> gp-0 corner 2) (-> gp-0 corner 2) s1-1) + (vector-matrix*! (-> gp-0 corner 3) (-> gp-0 corner 3) s1-1) + (set! (-> (the-as (pointer uint128) s3-6) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-6) 1) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-6) 2)) s2-1) + (set! (-> (the-as (pointer uint128) s3-6) 7) (-> this draw-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-6) 8) (-> this draw-tmpl quad 1)) + (let ((v1-64 (the-as (inline-array vector4w) (&+ s3-6 144)))) + (set! (-> v1-64 0 x) 0) + (set! (-> v1-64 0 y) 255) + (set! (-> v1-64 0 z) 255) + (set! (-> v1-64 0 w) 128) + ) + (let ((v1-65 (the-as (inline-array vector4w) (&+ s3-6 160)))) + (set! (-> v1-65 0 x) 0) + (set! (-> v1-65 0 y) 0) + (set! (-> v1-65 0 z) #xffffff) + (set! (-> v1-65 0 w) 0) + ) + (let ((v1-66 (the-as object (&+ s3-6 176)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 x) (the int (* 16.0 (-> gp-0 corner 0 x)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 y) (the int (* 16.0 (-> gp-0 corner 0 z)))) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-66) 0 w) 0) + ) + (let ((v1-67 (the-as object (&+ s3-6 192)))) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 x) 256) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 y) 0) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 w) 0) + ) + (let ((v1-68 (the-as object (&+ s3-6 208)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 x) (the int (* 16.0 (-> gp-0 corner 1 x)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 y) (the int (* 16.0 (-> gp-0 corner 1 z)))) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-68) 0 w) 0) + ) + (let ((v1-69 (the-as (inline-array vector4w) (&+ s3-6 224)))) + (set! (-> v1-69 0 x) 0) + (set! (-> v1-69 0 y) 256) + (set! (-> v1-69 0 z) #xffffff) + (set! (-> v1-69 0 w) 0) + ) + (let ((v1-70 (the-as object (&+ s3-6 240)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 x) (the int (* 16.0 (-> gp-0 corner 2 x)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 y) (the int (* 16.0 (-> gp-0 corner 2 z)))) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-70) 0 w) 0) + ) + (let ((v1-71 (the-as object (&+ s3-6 256)))) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 x) 256) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 y) 256) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 z) #xffffff) + (set! (-> (the-as (inline-array vector4w) v1-71) 0 w) 0) + ) + (let ((v1-72 (the-as object (&+ s3-6 272)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 x) (the int (* 16.0 (-> gp-0 corner 3 x)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 y) (the int (* 16.0 (-> gp-0 corner 3 z)))) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 z) 0) + (set! (-> (the-as (inline-array vector4w) v1-72) 0 w) 0) + ) + (&+! (-> arg0 base) 288) + ) + ) + ) + ) + (if (not (paused?)) + (+! (-> this goal-time) (* 14.0 (seconds-per-frame))) + ) + (reset-display-gs-state *display* (-> gp-0 buf)) + ) + 0 + (none) + ) + +;; definition for method 24 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-sprite2 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) + (local-vars (v1-47 uint128) (a0-8 uint128) (sv-176 int) (sv-192 int)) + (when (-> this race-tex) + (let ((s5-0 (new 'stack-no-clear 'minimap-draw-work))) + (set! (-> s5-0 buf) arg0) + (set! (-> s5-0 draw-pos quad) (-> arg1 quad)) + (set! (-> s5-0 justify-right) arg2) + (let ((v1-4 (the-as object (-> s5-0 buf base))) + (s3-0 (-> this race-tex)) + (s2-0 (-> this race-level texture-mask 8)) + ) + (when s3-0 + (set! (-> (the-as adgif-shader v1-4) quad 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as adgif-shader v1-4) quad 1 quad) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as adgif-shader v1-4) miptbp1)) s3-0) + (&+! (-> s5-0 buf base) 112) + (let ((v1-8 (-> s2-0 mask quad)) + (a0-7 (-> s3-0 masks data 0 mask quad)) + ) + (.por a0-8 v1-8 a0-7) + ) + (set! (-> s2-0 mask quad) a0-8) + ) + ) + (let* ((f0-0 (-> *video-params* relative-x-scale)) + (s3-1 (-> arg0 base)) + (v1-11 (the int (* 128.0 f0-0))) + ) + 0 + 0 + (let ((s0-0 (* (+ (-> s5-0 draw-pos y) 1840) 16)) + (s2-1 (* (+ (-> s5-0 draw-pos y) 1968) 16)) + (s1-0 (-> s5-0 draw-pos z)) + ) + (cond + ((-> s5-0 justify-right) + (set! sv-176 (* (+ (- 1792 v1-11) (-> s5-0 draw-pos x)) 16)) + (set! sv-192 (* (+ (-> s5-0 draw-pos x) 1792) 16)) + sv-192 + ) + (else + (set! sv-176 (* (+ (-> s5-0 draw-pos x) 1792) 16)) + (set! sv-192 (* (+ v1-11 1792 (-> s5-0 draw-pos x)) 16)) + sv-192 + ) + ) + (set! (-> s5-0 draw-pos x) sv-176) + (set! (-> s5-0 draw-pos y) s0-0) + (set! (-> (the-as (pointer uint128) s3-1) 0) (-> this sprite2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-1) 1) (-> this sprite2-tmpl quad 1)) + (let ((v1-26 (-> this color quad))) + (set! (-> (the-as (pointer uint128) (&+ s3-1 32))) v1-26) + ) + (cond + ((get-horizontal-flip-flag *blit-displays-work*) + (let ((v1-28 (the-as object (&+ s3-1 48)))) + (set! (-> (the-as (inline-array vector) v1-28) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-28) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-28) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-28) 0 w) 0.0) + ) + (let ((a0-25 (the-as object (&+ s3-1 64)))) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 x) sv-192) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 y) s0-0) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) a0-25) 0 w) 0) + ) + (let ((v1-30 (the-as object (&+ s3-1 80)))) + (set! (-> (the-as (inline-array vector) v1-30) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-30) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-30) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-30) 0 w) 0.0) + ) + (let ((v1-31 (the-as object (&+ s3-1 96)))) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 x) sv-176) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 y) s2-1) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) v1-31) 0 w) 0) + ) + ) + (else + (let ((v1-32 (the-as object (&+ s3-1 48)))) + (set! (-> (the-as (inline-array vector) v1-32) 0 x) 0.0) + (set! (-> (the-as (inline-array vector) v1-32) 0 y) 0.0) + (set! (-> (the-as (inline-array vector) v1-32) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-32) 0 w) 0.0) + ) + (let ((a0-31 (the-as object (&+ s3-1 64)))) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 x) sv-176) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 y) s0-0) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) a0-31) 0 w) 0) + ) + (let ((v1-34 (the-as object (&+ s3-1 80)))) + (set! (-> (the-as (inline-array vector) v1-34) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v1-34) 0 w) 0.0) + ) + (let ((v1-35 (the-as object (&+ s3-1 96)))) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 x) sv-192) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 y) s2-1) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 z) s1-0) + (set! (-> (the-as (inline-array vector4w) v1-35) 0 w) 0) + ) + ) + ) + ) + ) + (&+! (-> arg0 base) 112) + (let ((s2-2 (the-as object (-> s5-0 buf base))) + (s4-1 (get-texture map-target-marker level-default-minimap)) + (s3-2 (-> this ctywide texture-mask 8)) + ) + (when s4-1 + (set! (-> (the-as (pointer uint128) s2-2)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as adgif-shader s2-2) quad 1 quad) (-> this adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as adgif-shader s2-2) miptbp1)) s4-1) + (&+! (-> s5-0 buf base) 112) + (let ((v1-46 (-> s3-2 mask quad)) + (a0-39 (-> s4-1 masks data 0 mask quad)) + ) + (.por v1-47 v1-46 a0-39) + ) + (set! (-> s3-2 mask quad) v1-47) + ) + ) + (let ((f30-0 (the float (/ (-> s5-0 draw-pos x) 16))) + (f28-0 (the float (/ (-> s5-0 draw-pos y) 16))) + (s4-2 (the-as connection-minimap #f)) + ) + (let ((s3-3 (-> *minimap* engine alive-list))) + (while s3-3 + (let ((s2-3 s3-3)) + (when (logtest? (-> s2-3 class flags) (minimap-flag racer)) + (if (string= (-> s2-3 class name) "racer-target") + (set! s4-2 s2-3) + (draw-racer-1 this s5-0 s2-3 (-> this race-scale) f30-0 f28-0) + ) + ) + ) + (set! s3-3 (-> s3-3 next)) + ) + ) + (if s4-2 + (draw-racer-1 this s5-0 s4-2 (-> this race-scale) f30-0 f28-0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 25 of type minimap +;; WARN: Return type mismatch int vs none. +(defmethod set-race-texture ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) + (set! (-> this race-tex) arg0) + (set! (-> this race-scale) arg1) + (set! (-> this race-level) arg2) + 0 + (none) + ) + +;; definition for method 27 of type minimap +;; WARN: Return type mismatch int vs none. +(defmethod set-race-corner ((this minimap) (arg0 float) (arg1 float)) + (set! (-> this race-corner x) arg0) + (set! (-> this race-corner z) arg1) + 0 + (none) + ) + +;; definition for method 22 of type minimap +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-color ((this minimap) (arg0 vector)) + (set! (-> this color quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 9 of type minimap-class-node +(defmethod minimap-class-node-method-9 ((this minimap-class-node)) + (let ((gp-0 (-> this flags))) + (when (and (logtest? (minimap-flag local-only) gp-0) (not (logtest? (minimap-flag transport) gp-0))) + (cond + ((and (logtest? (minimap-flag ctywide) gp-0) + (!= (status-of-level-and-borrows *level* 'ctywide 'ignore-borrow) 'active) + ) + (return #f) + ) + ((and (logtest? (minimap-flag wasall) gp-0) + (!= (status-of-level-and-borrows *level* 'wasall 'ignore-borrow) 'active) + ) + (return #f) + ) + ((and (logtest? (minimap-flag waswide) gp-0) + (!= (status-of-level-and-borrows *level* 'waswide 'ignore-borrow) 'active) + ) + (return #f) + ) + ((and (logtest? (minimap-flag desert) gp-0) + (!= (status-of-level-and-borrows *level* 'desert 'ignore-borrow) 'active) + ) + (return #f) + ) + ) + ) + ) + #t + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc index a9134191be..f54f7f7382 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc @@ -2546,21 +2546,17 @@ ;; definition for method 10 of type menu-sound-slider-option ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-sound-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) - (let* ((gp-0 arg0) - (s5-0 arg1) - (s4-0 arg2) - (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> gp-0 menu-transition))))) - ) - (set! (-> s5-0 alpha) f30-0) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (set! (-> arg1 alpha) f30-0) (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 gp-0 s5-0) + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) ) (else (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) (progress-method-52 - gp-0 - s5-0 + arg0 + arg1 (lookup-text! *common-text* (-> this name) #f) f30-0 (-> this offset-y) @@ -2571,8 +2567,8 @@ ) ) ) - (if (zero? s4-0) - (progress-method-46 gp-0 s5-0 f30-0 30) + (if (zero? arg2) + (progress-method-46 arg0 arg1 f30-0 30) ) ) 0 @@ -2583,99 +2579,94 @@ ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (s5-0 int)) - (let* ((s3-0 arg0) - (gp-0 arg1) - (s2-0 arg2) - (s1-0 arg3) - (f28-0 (fmax 0.0 (* 2.0 (- 0.5 (-> s3-0 menu-transition))))) - ) - (let ((v1-2 gp-0)) + (let ((f28-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (let ((v1-2 arg1)) (set! (-> v1-2 scale) 0.65) ) - (set! (-> gp-0 alpha) f28-0) - (let ((a0-2 gp-0)) + (set! (-> arg1 alpha) f28-0) + (let ((a0-2 arg1)) (set! (-> a0-2 flags) (font-flags kerning middle large)) ) (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 s3-0 gp-0) + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) ) ((begin - (progress-method-38 s3-0 gp-0 (-> this offset-y)) + (progress-method-38 arg0 arg1 (-> this offset-y)) (set! s5-0 (-> *setting-control* user-default stereo-mode)) - s1-0 + arg3 ) (let ((f30-2 (fmax (fmax - (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-mono) #f) gp-0) length) - (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-stereo) #f) gp-0) length) + (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-mono) #f) arg1) length) + (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-stereo) #f) arg1) length) ) - (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-surround) #f) gp-0) length) + (-> (get-string-length (lookup-text! *common-text* (text-id progress-sound-surround) #f) arg1) length) ) ) ) - (let ((a0-12 gp-0)) + (let ((a0-12 arg1)) (set! (-> a0-12 color) (font-color font-color-34)) ) - (progress-method-40 s3-0 gp-0 (the int (+ -1.0 (-> gp-0 origin y))) 42 f28-0) + (progress-method-40 arg0 arg1 (the int (+ -1.0 (-> arg1 origin y))) 42 f28-0) (let ((s3-1 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) - (s3-1 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s3-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) - (+! (-> gp-0 origin y) 22.0) - (let ((v1-23 gp-0)) + (+! (-> arg1 origin y) 22.0) + (let ((v1-23 arg1)) (set! (-> v1-23 scale) 0.5) ) - (let ((a0-19 gp-0)) + (let ((a0-19 arg1)) (set! (-> a0-19 color) (font-color font-color-33)) ) - (let ((a0-20 gp-0)) + (let ((a0-20 arg1)) (set! (-> a0-20 flags) (font-flags kerning middle large)) ) (print-game-text (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f) - gp-0 + arg1 #f 44 (bucket-id hud-draw-hud-alpha) ) - (let ((a0-23 gp-0)) + (let ((a0-23 arg1)) (set! (-> a0-23 color) (font-color font-color-32)) ) - (set! (-> gp-0 origin x) (- (-> gp-0 origin x) (the float (the int (* 0.5 f30-2))))) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (the int (* 0.5 f30-2))))) (let ((s5-1 print-game-text)) (format (clear *temp-string*) "~33L~C" 163) - (s5-1 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s5-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) - (+! (-> gp-0 origin x) (the float (the int f30-2))) + (+! (-> arg1 origin x) (the float (the int f30-2))) ) (let ((s5-2 print-game-text)) (format (clear *temp-string*) "~33L~C" 161) - (s5-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s5-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) (else - (if (= (-> s3-0 option-index) s2-0) - (progress-method-40 s3-0 gp-0 (the int (-> gp-0 origin y)) 21 f28-0) + (if (= (-> arg0 option-index) arg2) + (progress-method-40 arg0 arg1 (the int (-> arg1 origin y)) 21 f28-0) ) (let ((s3-2 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) - (s3-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s3-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) - (+! (-> gp-0 origin y) 22.0) - (let ((v1-38 gp-0)) + (+! (-> arg1 origin y) 22.0) + (let ((v1-38 arg1)) (set! (-> v1-38 scale) 0.5) ) - (let ((a0-36 gp-0)) + (let ((a0-36 arg1)) (set! (-> a0-36 color) (font-color font-color-32)) ) - (let ((a0-37 gp-0)) + (let ((a0-37 arg1)) (set! (-> a0-37 flags) (font-flags kerning middle large)) ) (print-game-text (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f) - gp-0 + arg1 #f 44 (bucket-id hud-draw-hud-alpha) @@ -2690,39 +2681,31 @@ ;; definition for method 10 of type menu-picture-slider-option ;; WARN: Return type mismatch int vs none. (defmethod draw-option ((this menu-picture-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) - (let ((s5-0 arg1) - (s4-0 arg2) - (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) - ) - (set! (-> s5-0 alpha) f30-0) - (let* ((a0-1 arg0) - (t9-0 (method-of-object a0-1 progress-method-33)) - (a1-1 (-> *progress-work* body)) - ) - (t9-0 a0-1 a1-1) - (cond - ((not (draw *bigmap* (the-as int a1-1) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 arg0 s5-0) - ) - (else - (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) - (progress-method-52 - arg0 - s5-0 - (lookup-text! *common-text* (-> this name) #f) - f30-0 - (-> this offset-y) - 0.9 - f28-0 - (the-as float #f) - ) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))) + (set! (-> arg1 alpha) f30-0) + (progress-method-33 arg0 (-> *progress-work* body)) + (cond + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) + ) + (else + (let ((f28-0 (-> (the-as (pointer float) (&+ (the-as pointer *setting-control*) (-> this setting-offset)))))) + (progress-method-52 + arg0 + arg1 + (lookup-text! *common-text* (-> this name) #f) + f30-0 + (-> this offset-y) + 0.9 + f28-0 + (the-as float #f) ) ) ) ) - (when (zero? s4-0) + (when (zero? arg2) (let ((s4-1 (get-scissor-stack-top arg0))) - (progress-method-46 arg0 s5-0 f30-0 1520) + (progress-method-46 arg0 arg1 f30-0 1520) (draw-icon-array! (-> *progress-icon-arrays* 75) 256 @@ -2887,62 +2870,59 @@ (sv-176 (function string font-context symbol int bucket-id float)) (sv-192 (function _varargs_ object)) ) - (let* ((s5-0 arg0) - (gp-0 arg1) - (s4-0 arg2) - (f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> s5-0 menu-transition))))) - (f28-0 (if (= (-> s5-0 current) 'select-save-title) - 0.2 - 0.25 - ) - ) - (s3-0 *progress-work*) - (f24-0 (-> *video-params* relative-x-scale)) - ) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (f28-0 (if (= (-> arg0 current) 'select-save-title) + 0.2 + 0.25 + ) + ) + (s3-0 *progress-work*) + (f24-0 (-> *video-params* relative-x-scale)) + ) (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 s5-0 gp-0) + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) ) (else - (set! (-> gp-0 alpha) f30-0) - (let ((v1-8 gp-0)) + (set! (-> arg1 alpha) f30-0) + (let ((v1-8 arg1)) (set! (-> v1-8 scale) 0.6) ) - (progress-method-33 s5-0 (-> s3-0 body)) - (let* ((s3-1 (get-scissor-stack-top s5-0)) + (progress-method-33 arg0 (-> s3-0 body)) + (let* ((s3-1 (get-scissor-stack-top arg0)) (s0-0 (new 'stack 'hud-box)) (f0-4 (* (- (-> s3-1 w) (-> s3-1 y)) f28-0)) - (f26-0 (+ (-> s3-1 y) (* f0-4 (the float s4-0)))) + (f26-0 (+ (-> s3-1 y) (* f0-4 (the float arg2)))) (f28-1 (+ f26-0 f0-4)) (s1-0 (the int (+ (-> s3-1 x) (* 0.7 (- (-> s3-1 z) (-> s3-1 x))) (* -48.0 f24-0)))) ) (set! sv-160 (the int (+ 32.0 (-> s3-1 y)))) (let ((s2-0 *progress-save-info*)) - (let ((v1-16 gp-0) + (let ((v1-16 arg1) (f1-12 (+ 10.0 (-> s3-1 x))) - (f2-13 (+ f26-0 (* 0.5 (- f0-4 (* 32.0 (-> gp-0 scale)))))) + (f2-13 (+ f26-0 (* 0.5 (- f0-4 (* 32.0 (-> arg1 scale)))))) ) (set! (-> v1-16 origin x) f1-12) (set! (-> v1-16 origin y) f2-13) ) - (set! (-> gp-0 height) f0-4) - (let ((a0-11 gp-0)) + (set! (-> arg1 height) f0-4) + (let ((a0-11 arg1)) (set! (-> a0-11 flags) (font-flags kerning large)) ) (when (and s2-0 (= (-> s2-0 formatted) 1) (= (-> s2-0 inited) 1)) (cond - ((= (-> s2-0 file s4-0 present) 1) + ((= (-> s2-0 file arg2 present) 1) (set! sv-48 print-game-text) (set! sv-64 format) (set! sv-80 (clear *temp-string*)) (set! sv-96 "~S ~D") (let ((a2-2 (lookup-text! *common-text* (text-id text-0073) #f)) - (a3-1 (+ s4-0 1)) + (a3-1 (+ arg2 1)) ) (sv-64 sv-80 sv-96 a2-2 a3-1) ) (let ((a0-21 *temp-string*) - (a1-6 gp-0) + (a1-6 arg1) (a2-3 #f) (a3-2 44) (t0-1 579) @@ -2950,10 +2930,10 @@ (sv-48 a0-21 a1-6 a2-3 a3-2 (the-as bucket-id t0-1)) ) ) - ((zero? (-> s2-0 file s4-0 present)) + ((zero? (-> s2-0 file arg2 present)) (set! sv-112 print-game-text) (let ((a0-23 (lookup-text! *common-text* (text-id progress-empty) #f)) - (a1-8 gp-0) + (a1-8 arg1) (a2-5 #f) (a3-3 44) (t0-2 579) @@ -2962,8 +2942,8 @@ ) ) ) - (when (= s4-0 (-> s5-0 option-index)) - (let ((v1-39 gp-0)) + (when (= arg2 (-> arg0 option-index)) + (let ((v1-39 arg1)) (set! (-> v1-39 scale) 0.8) ) (set! sv-128 (-> *display* frames (-> *display* on-screen) global-buf)) @@ -3007,9 +2987,9 @@ ) ) ) - (when (= (-> s2-0 file s4-0 present) 1) - (when (= s4-0 (-> s5-0 option-index)) - (let* ((a0-49 (-> *progress-icon-arrays* (-> s2-0 file s4-0 level-index))) + (when (= (-> s2-0 file arg2 present) 1) + (when (= arg2 (-> arg0 option-index)) + (let* ((a0-49 (-> *progress-icon-arrays* (-> s2-0 file arg2 level-index))) (t9-16 (method-of-object a0-49 draw-icon-array!)) (a3-5 1.0) (t0-3 1.0) @@ -3018,22 +2998,22 @@ ) (t9-16 a0-49 s1-0 sv-160 a3-5 t0-3 (the-as rgba t1-0) t2-0) ) - (let ((v1-84 gp-0)) + (let ((v1-84 arg1)) (set! (-> v1-84 scale) 0.6) ) - (let ((a0-51 gp-0)) + (let ((a0-51 arg1)) (set! (-> a0-51 color) (font-color font-color-32)) ) - (progress-method-38 s5-0 gp-0 0.675) - (let ((a0-53 gp-0)) + (progress-method-38 arg0 arg1 0.675) + (let ((a0-53 arg1)) (set! (-> a0-53 flags) (font-flags kerning right large)) ) - (let* ((v1-91 (-> s2-0 file s4-0 game-time0)) - (v1-92 (logior (shl (-> s2-0 file s4-0 game-time1) 32) v1-91)) + (let* ((v1-91 (-> s2-0 file arg2 game-time0)) + (v1-92 (logior (shl (-> s2-0 file arg2 game-time1) 32) v1-91)) (s1-1 (/ (the-as int v1-92) #x107ac0)) (s0-1 (/ (mod (the-as int v1-92) #x107ac0) #x4650)) ) - (set! (-> gp-0 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) + (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) (set! sv-176 print-game-text) (set! sv-192 format) (let ((a0-63 (clear *temp-string*)) @@ -3043,7 +3023,7 @@ ) ) (let ((a0-64 *temp-string*) - (a1-17 gp-0) + (a1-17 arg1) (a2-10 #f) (a3-7 44) (t0-4 579) @@ -3053,67 +3033,67 @@ (draw-icon-array! (-> *progress-icon-arrays* 66) (the int (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (-> gp-0 origin y)) + (the int (-> arg1 origin y)) 0.65 0.65 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (set! (-> gp-0 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) + (set! (-> arg1 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) (let ((s1-2 print-game-text)) - (format (clear *temp-string*) "~D%" (the int (-> s2-0 file s4-0 completion-percentage))) - (s1-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (format (clear *temp-string*) "~D%" (the int (-> s2-0 file arg2 completion-percentage))) + (s1-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (draw-icon-array! (-> *progress-icon-arrays* 67) (the int (+ -8.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (-> gp-0 origin y)) + (the int (-> arg1 origin y)) 0.7 0.7 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (progress-method-38 s5-0 gp-0 0.83) - (set! (-> gp-0 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) + (progress-method-38 arg0 arg1 0.83) + (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.675 (- (-> s3-1 z) (-> s3-1 x))))) (let ((s1-3 print-game-text)) - (format (clear *temp-string*) "~D" (the int (-> s2-0 file s4-0 skill-count))) - (s1-3 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (format (clear *temp-string*) "~D" (the int (-> s2-0 file arg2 skill-count))) + (s1-3 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (draw-icon-array! (-> *progress-icon-arrays* 68) (the int (+ 10.0 (* 0.4 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (+ -2.0 (-> gp-0 origin y))) + (the int (+ -2.0 (-> arg1 origin y))) 0.7 0.7 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (set! (-> gp-0 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) + (set! (-> arg1 origin x) (+ (- (+ -10.0 (-> s3-1 z)) (-> s3-1 x)) (-> s3-1 x))) (let ((s1-4 print-game-text)) - (format (clear *temp-string*) "~D" (the int (-> s2-0 file s4-0 gem-count))) - (s1-4 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (format (clear *temp-string*) "~D" (the int (-> s2-0 file arg2 gem-count))) + (s1-4 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) (draw-icon-array! (-> *progress-icon-arrays* 69) (the int (+ -14.0 (* 0.75 (- (-> s3-1 z) (-> s3-1 x))) (-> s3-1 x))) - (the int (-> gp-0 origin y)) + (the int (-> arg1 origin y)) 0.5 0.5 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) f30-0 ) - (when (logtest? (-> s2-0 file s4-0 secrets) 1) - (let ((a0-79 gp-0)) + (when (logtest? (-> s2-0 file arg2 secrets) 1) + (let ((a0-79 arg1)) (set! (-> a0-79 flags) (font-flags kerning middle large)) ) - (set! (-> gp-0 origin x) (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x))))) - (set! (-> gp-0 origin y) (+ 8.0 (-> s3-1 y))) - (let ((v1-140 gp-0)) + (set! (-> arg1 origin x) (+ (-> s3-1 x) (* 0.4 (- (-> s3-1 z) (-> s3-1 x))))) + (set! (-> arg1 origin y) (+ 8.0 (-> s3-1 y))) + (let ((v1-140 arg1)) (set! (-> v1-140 width) (* 0.6 (- (-> s3-1 z) (-> s3-1 x)))) ) (let ((s3-2 print-game-text)) (format (clear *temp-string*) "~S" (lookup-text! *common-text* (text-id progress-secrets-hero-mode) #f)) - (s3-2 *temp-string* gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + (s3-2 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ) @@ -3121,17 +3101,17 @@ ) ) ) - (progress-method-34 s5-0) - (when (zero? s4-0) - (case (-> s5-0 current) + (progress-method-34 arg0) + (when (zero? arg2) + (case (-> arg0 current) (('select-load) - (progress-method-46 s5-0 gp-0 f30-0 45) + (progress-method-46 arg0 arg1 f30-0 45) ) (('select-save-hero) - (progress-method-46 s5-0 gp-0 f30-0 2198) + (progress-method-46 arg0 arg1 f30-0 2198) ) (else - (progress-method-46 s5-0 gp-0 f30-0 44) + (progress-method-46 arg0 arg1 f30-0 44) ) ) ) @@ -4819,448 +4799,444 @@ (sv-400 (function _varargs_ object)) (sv-416 (function _varargs_ object)) ) - (let ((gp-0 arg0) - (s5-0 arg1) - ) - (set! sv-16 (fmax 0.0 (* 2.0 (- 0.5 (-> gp-0 menu-transition))))) - (set! sv-24 (the int (-> *game-info* skill))) - (set! (-> s5-0 alpha) sv-16) - (cond - ((not (draw *bigmap* (the-as int arg0) (the-as int arg1) arg2 (the-as int arg3))) - (progress-method-51 gp-0 s5-0) - ) - (else - (new 'stack 'hud-sprite) - (let ((s2-0 (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x11)))) - (when (and s2-0 (not (-> this available-title))) - (progress-method-33 gp-0 (-> *progress-work* sub-header)) - (let ((s3-0 (get-scissor-stack-top gp-0))) - (let* ((f0-5 0.64) - (f30-0 (+ 10.0 (* (the float (-> s2-0 w)) f0-5 (-> *video-params* relative-x-scale)))) - ) - (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) - (+ (- (- -20.0 f30-0) (-> s3-0 x)) (-> s3-0 z)) - (set! t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) - (draw-icon-array! - (-> *progress-icon-arrays* 68) - (the int (+ 10.0 (-> s3-0 x))) - (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) - f0-5 - f0-5 - (the-as rgba t1-0) - sv-16 - ) + (set! sv-16 (fmax 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (set! sv-24 (the int (-> *game-info* skill))) + (set! (-> arg1 alpha) sv-16) + (cond + ((not (bigmap-method-11 *bigmap*)) + (progress-method-51 arg0 arg1) + ) + (else + (new 'stack 'hud-sprite) + (let ((s2-0 (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x11)))) + (when (and s2-0 (not (-> this available-title))) + (progress-method-33 arg0 (-> *progress-work* sub-header)) + (let ((s3-0 (get-scissor-stack-top arg0))) + (let* ((f0-5 0.64) + (f30-0 (+ 10.0 (* (the float (-> s2-0 w)) f0-5 (-> *video-params* relative-x-scale)))) + ) + (let ((f1-5 (* (the float (-> s2-0 h)) f0-5))) + (+ (- (- -20.0 f30-0) (-> s3-0 x)) (-> s3-0 z)) + (set! t1-0 (logior #x808080 (shr (shl (the int (* 128.0 sv-16)) 56) 32))) + (draw-icon-array! + (-> *progress-icon-arrays* 68) + (the int (+ 10.0 (-> s3-0 x))) + (the int (+ (-> s3-0 y) (* 0.5 (- 28.0 f1-5)))) + f0-5 + f0-5 + (the-as rgba t1-0) + sv-16 ) - (let ((v1-26 s5-0)) - (set! (-> v1-26 height) 28.0) + ) + (let ((v1-26 arg1)) + (set! (-> v1-26 height) 28.0) + ) + (let ((a0-13 arg1)) + (set! (-> a0-13 flags) (font-flags kerning large)) + ) + (let ((f28-0 0.45)) + (let ((a0-14 arg1)) + (set! (-> a0-14 color) (font-color font-color-34)) ) - (let ((a0-13 s5-0)) - (set! (-> a0-13 flags) (font-flags kerning large)) - ) - (let ((f28-0 0.45)) - (let ((a0-14 s5-0)) - (set! (-> a0-14 color) (font-color font-color-34)) - ) - (cond - ((-> this buy-menu) - (let ((s2-1 format) - (s1-0 (clear *temp-string*)) - (s0-0 "x~D ~S") - ) - (set! sv-96 (-> *menu-secrets-array* (-> this selected-index) cost)) - (let ((a3-2 (lookup-text! *common-text* (text-id progress-secrets-price) #f))) - (s2-1 s1-0 s0-0 sv-96 a3-2) + (cond + ((-> this buy-menu) + (let ((s2-1 format) + (s1-0 (clear *temp-string*)) + (s0-0 "x~D ~S") ) + (set! sv-96 (-> *menu-secrets-array* (-> this selected-index) cost)) + (let ((a3-2 (lookup-text! *common-text* (text-id progress-secrets-price) #f))) + (s2-1 s1-0 s0-0 sv-96 a3-2) ) - (set! a0-19 *temp-string*) + ) + (set! a0-19 *temp-string*) + ) + (else + (let ((s2-2 format) + (s1-1 (clear *temp-string*)) + (s0-1 "x~D ~S") + ) + (set! sv-112 sv-24) + (let ((a3-3 (lookup-text! *common-text* (text-id progress-secrets-orbs-available) #f))) + (s2-2 s1-1 s0-1 sv-112 a3-3) + ) + ) + (set! a0-19 *temp-string*) + ) + ) + (let ((v1-42 arg1)) + (set! (-> v1-42 scale) f28-0) + ) + (let ((v1-43 arg1) + (f0-10 (+ (-> s3-0 x) f30-0)) + (f1-11 (+ (-> s3-0 y) (* 0.5 (- 28.0 (* 32.0 f28-0))))) + ) + (set! (-> v1-43 origin x) f0-10) + (set! (-> v1-43 origin y) f1-11) + ) + ) + ) + (print-game-text a0-19 arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + (let ((a0-23 arg1)) + (set! (-> a0-23 flags) (font-flags kerning right large)) + ) + (set! (-> arg1 origin x) (+ -10.0 (-> s3-0 z))) + ) + (let ((s3-1 print-game-text)) + (let ((s2-3 format) + (s1-2 (clear *temp-string*)) + (s0-2 "~D/600 ~S") + ) + (set! sv-128 (the int (-> *game-info* skill-total))) + (let ((a3-5 (lookup-text! *common-text* (text-id progress-secrets-orbs-collected) #f))) + (s2-3 s1-2 s0-2 sv-128 a3-5) + ) + ) + (let ((a0-27 *temp-string*) + (a1-15 arg1) + (a2-9 #f) + (a3-6 44) + ) + (set! arg3 (the-as symbol 579)) + (s3-1 a0-27 a1-15 a2-9 a3-6 (the-as bucket-id arg3)) + ) + ) + (progress-method-34 arg0) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) 0.42) + ) + (cond + ((-> this available-title) + (progress-method-33 arg0 (-> *progress-work* body-footer)) + (progress-method-53 arg0 arg1) + (let ((a0-32 arg1)) + (set! (-> a0-32 color) (font-color font-color-32)) + ) + (let ((a0-33 arg1)) + (set! (-> a0-33 flags) (font-flags kerning middle middle-vert large)) + ) + (let ((s4-1 print-game-text)) + (let* ((s3-2 format) + (s2-4 (clear *temp-string*)) + (a0-35 *common-text*) + (t9-22 (method-of-object a0-35 lookup-text!)) + (a1-18 128) + (a2-10 #f) + ) + (s3-2 s2-4 (t9-22 a0-35 (the-as text-id a1-18) a2-10) (the-as none a2-10)) + ) + (s4-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (progress-method-34 arg0) + (progress-method-33 arg0 (-> *progress-work* footer)) + (let ((a0-40 arg1)) + (set! (-> a0-40 flags) (font-flags kerning middle large)) + ) + (progress-method-38 arg0 arg1 0.1) + (let ((a0-42 arg1)) + (set! (-> a0-42 color) (font-color font-color-33)) + ) + (let ((f0-16 (print-game-text + (lookup-text! *common-text* (text-id progress-continue) #f) + arg1 + #f + 32 + (bucket-id hud-draw-hud-alpha) + ) + ) + ) + (progress-method-40 arg0 arg1 (the int (+ -2.0 (-> arg1 origin y))) (the int (+ 4.0 f0-16)) (-> arg1 alpha)) + ) + (progress-method-34 arg0) + ) + ((-> this buy-menu) + (progress-method-33 arg0 (-> *progress-work* body)) + (progress-method-38 arg0 arg1 0.45) + (progress-method-50 + arg0 + arg1 + (-> *menu-secrets-array* (-> this selected-index) name) + (text-id progress-secrets-buy) + (text-id progress-secrets-cancel) + #t + #t + 0.65 + ) + (let ((s4-3 *progress-work*)) + (progress-method-46 arg0 arg1 sv-16 84) + (progress-method-41 arg0 (-> s4-3 sub-header) (* 128.0 sv-16)) + ) + (progress-method-34 arg0) + ) + (else + (progress-method-33 arg0 (-> *progress-work* sub-body-footer)) + (let* ((s3-3 (get-scissor-stack-top arg0)) + (f22-0 (- (-> s3-3 w) (-> s3-3 y))) + (f30-1 (+ 10.0 (* 24.0 (-> *video-params* relative-x-scale) (-> arg1 scale)))) + (f28-1 (+ (- -10.0 (-> s3-3 x)) (-> s3-3 z))) + (s2-5 get-string-length) + ) + (let ((s1-3 format) + (s0-3 (clear *temp-string*)) + ) + (set! sv-144 "~32L~S~44L ~S") + (set! sv-160 (lookup-text! *common-text* (text-id progress-on) #f)) + (let ((a3-12 (lookup-text! *common-text* (text-id progress-off) #f))) + (s1-3 s0-3 sv-144 sv-160 a3-12 (the-as none arg3) (the-as none t1-0)) + ) + ) + (let* ((f0-27 (-> (s2-5 *temp-string* arg1) length)) + (f26-0 (- (- (- f28-1 f30-1) f0-27) f30-1)) + ) + (- f28-1 f26-0) + (let ((a0-60 arg1)) + (set! (-> a0-60 flags) (font-flags kerning large)) + ) + (let ((v1-100 arg1)) + (set! (-> v1-100 width) f26-0) + ) + (let ((s2-6 *menu-secrets-array*) + (s1-5 (max 0 (the int (-> this current-index)))) + ) + (let* ((a0-61 (-> s2-6 s1-5)) + (s0-4 (-> a0-61 name)) + ) + (case (secret-item-option-method-12 a0-61) + ((4) + (set! sv-192 "?????????") ) (else - (let ((s2-2 format) - (s1-1 (clear *temp-string*)) - (s0-1 "x~D ~S") + (set! sv-192 (lookup-text! *common-text* s0-4 #f)) + ) + ) + ) + (let ((s0-5 print-game-text)) + (set! sv-176 format) + (let ((a0-65 (clear *temp-string*)) + (a1-37 "~S") + ) + (sv-176 a0-65 a1-37 sv-192) + ) + (let ((f24-0 (s0-5 *temp-string* arg1 #t 40 (bucket-id hud-draw-hud-alpha)))) + (let ((f0-33 4.0) + (f1-25 (-> this current-index)) + ) + (set! (-> arg1 origin y) + (+ (- f0-33 (* f24-0 (- f1-25 (* (the float (the int (/ f1-25 1.0))) 1.0)))) (-> s3-3 y)) ) - (set! sv-112 sv-24) - (let ((a3-3 (lookup-text! *common-text* (text-id progress-secrets-orbs-available) #f))) - (s2-2 s1-1 s0-1 sv-112 a3-3) - ) - ) - (set! a0-19 *temp-string*) ) - ) - (let ((v1-42 s5-0)) - (set! (-> v1-42 scale) f28-0) - ) - (let ((v1-43 s5-0) - (f0-10 (+ (-> s3-0 x) f30-0)) - (f1-11 (+ (-> s3-0 y) (* 0.5 (- 28.0 (* 32.0 f28-0))))) - ) - (set! (-> v1-43 origin x) f0-10) - (set! (-> v1-43 origin y) f1-11) - ) - ) - ) - (print-game-text a0-19 s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) - (let ((a0-23 s5-0)) - (set! (-> a0-23 flags) (font-flags kerning right large)) - ) - (set! (-> s5-0 origin x) (+ -10.0 (-> s3-0 z))) - ) - (let ((s3-1 print-game-text)) - (let ((s2-3 format) - (s1-2 (clear *temp-string*)) - (s0-2 "~D/600 ~S") - ) - (set! sv-128 (the int (-> *game-info* skill-total))) - (let ((a3-5 (lookup-text! *common-text* (text-id progress-secrets-orbs-collected) #f))) - (s2-3 s1-2 s0-2 sv-128 a3-5) - ) - ) - (let ((a0-27 *temp-string*) - (a1-15 s5-0) - (a2-9 #f) - (a3-6 44) - ) - (set! arg3 (the-as symbol 579)) - (s3-1 a0-27 a1-15 a2-9 a3-6 (the-as bucket-id arg3)) - ) - ) - (progress-method-34 gp-0) - ) - ) - (let ((v1-52 s5-0)) - (set! (-> v1-52 scale) 0.42) - ) - (cond - ((-> this available-title) - (progress-method-33 gp-0 (-> *progress-work* body-footer)) - (progress-method-53 gp-0 s5-0) - (let ((a0-32 s5-0)) - (set! (-> a0-32 color) (font-color font-color-32)) - ) - (let ((a0-33 s5-0)) - (set! (-> a0-33 flags) (font-flags kerning middle middle-vert large)) - ) - (let ((s4-1 print-game-text)) - (let* ((s3-2 format) - (s2-4 (clear *temp-string*)) - (a0-35 *common-text*) - (t9-22 (method-of-object a0-35 lookup-text!)) - (a1-18 128) - (a2-10 #f) - ) - (s3-2 s2-4 (t9-22 a0-35 (the-as text-id a1-18) a2-10) (the-as none a2-10)) - ) - (s4-1 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) - ) - (progress-method-34 gp-0) - (progress-method-33 gp-0 (-> *progress-work* footer)) - (let ((a0-40 s5-0)) - (set! (-> a0-40 flags) (font-flags kerning middle large)) - ) - (progress-method-38 gp-0 s5-0 0.1) - (let ((a0-42 s5-0)) - (set! (-> a0-42 color) (font-color font-color-33)) - ) - (let ((f0-16 (print-game-text - (lookup-text! *common-text* (text-id progress-continue) #f) - s5-0 - #f - 32 - (bucket-id hud-draw-hud-alpha) - ) - ) - ) - (progress-method-40 gp-0 s5-0 (the int (+ -2.0 (-> s5-0 origin y))) (the int (+ 4.0 f0-16)) (-> s5-0 alpha)) - ) - (progress-method-34 gp-0) - ) - ((-> this buy-menu) - (progress-method-33 gp-0 (-> *progress-work* body)) - (progress-method-38 gp-0 s5-0 0.45) - (progress-method-50 - gp-0 - s5-0 - (-> *menu-secrets-array* (-> this selected-index) name) - (text-id progress-secrets-buy) - (text-id progress-secrets-cancel) - #t - #t - 0.65 - ) - (let ((s4-3 *progress-work*)) - (progress-method-46 gp-0 s5-0 sv-16 84) - (progress-method-41 gp-0 (-> s4-3 sub-header) (* 128.0 sv-16)) - ) - (progress-method-34 gp-0) - ) - (else - (progress-method-33 gp-0 (-> *progress-work* sub-body-footer)) - (let* ((s3-3 (get-scissor-stack-top gp-0)) - (f22-0 (- (-> s3-3 w) (-> s3-3 y))) - (f30-1 (+ 10.0 (* 24.0 (-> *video-params* relative-x-scale) (-> s5-0 scale)))) - (f28-1 (+ (- -10.0 (-> s3-3 x)) (-> s3-3 z))) - (s2-5 get-string-length) - ) - (let ((s1-3 format) - (s0-3 (clear *temp-string*)) - ) - (set! sv-144 "~32L~S~44L ~S") - (set! sv-160 (lookup-text! *common-text* (text-id progress-on) #f)) - (let ((a3-12 (lookup-text! *common-text* (text-id progress-off) #f))) - (s1-3 s0-3 sv-144 sv-160 a3-12 (the-as none arg3) (the-as none t1-0)) - ) - ) - (let* ((f0-27 (-> (s2-5 *temp-string* s5-0) length)) - (f26-0 (- (- (- f28-1 f30-1) f0-27) f30-1)) - ) - (- f28-1 f26-0) - (let ((a0-60 s5-0)) - (set! (-> a0-60 flags) (font-flags kerning large)) - ) - (let ((v1-100 s5-0)) - (set! (-> v1-100 width) f26-0) - ) - (let ((s2-6 *menu-secrets-array*) - (s1-5 (max 0 (the int (-> this current-index)))) - ) - (let* ((a0-61 (-> s2-6 s1-5)) - (s0-4 (-> a0-61 name)) - ) - (case (secret-item-option-method-12 a0-61) - ((4) - (set! sv-192 "?????????") - ) - (else - (set! sv-192 (lookup-text! *common-text* s0-4 #f)) - ) - ) - ) - (let ((s0-5 print-game-text)) - (set! sv-176 format) - (let ((a0-65 (clear *temp-string*)) - (a1-37 "~S") - ) - (sv-176 a0-65 a1-37 sv-192) - ) - (let ((f24-0 (s0-5 *temp-string* s5-0 #t 40 (bucket-id hud-draw-hud-alpha)))) - (let ((f0-33 4.0) - (f1-25 (-> this current-index)) - ) - (set! (-> s5-0 origin y) - (+ (- f0-33 (* f24-0 (- f1-25 (* (the float (the int (/ f1-25 1.0))) 1.0)))) (-> s3-3 y)) + (set! (-> arg1 height) f22-0) + (while (and (< (-> arg1 origin y) (-> s3-3 w)) (< s1-5 (-> *menu-secrets-array* length))) + (let ((s0-6 (-> s2-6 s1-5))) + (set! sv-208 (-> s2-6 s1-5 name)) + (set! sv-288 (secret-item-option-method-12 s0-6)) + (case sv-288 + ((4) + (set! sv-240 "?????????") + ) + (else + (let* ((a0-69 *common-text*) + (t9-51 (method-of-object a0-69 lookup-text!)) + (a2-27 #f) + ) + (set! sv-240 (t9-51 a0-69 sv-208 a2-27)) ) - ) - (set! (-> s5-0 height) f22-0) - (while (and (< (-> s5-0 origin y) (-> s3-3 w)) (< s1-5 (-> *menu-secrets-array* length))) - (let ((s0-6 (-> s2-6 s1-5))) - (set! sv-208 (-> s2-6 s1-5 name)) - (set! sv-288 (secret-item-option-method-12 s0-6)) - (case sv-288 - ((4) - (set! sv-240 "?????????") + ) + ) + (cond + ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0)) + (set! (-> arg1 origin x) (+ 10.0 (-> s3-3 x))) + (let ((v1-130 arg1)) + (set! (-> v1-130 width) f28-1) ) - (else - (let* ((a0-69 *common-text*) - (t9-51 (method-of-object a0-69 lookup-text!)) - (a2-27 #f) + (let ((a0-70 arg1)) + (set! (-> a0-70 color) (font-color font-color-34)) + ) + (let ((a0-71 arg1)) + (set! (-> a0-71 flags) (font-flags kerning large)) + ) + (let ((f22-1 (-> arg1 origin y)) + (s0-7 print-game-text) + ) + (set! sv-224 format) + (let ((a0-73 (clear *temp-string*)) + (a1-40 "~S") + ) + (sv-224 a0-73 a1-40 sv-240) + ) + (set! (-> arg1 origin y) (+ f22-1 (s0-7 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)))) + ) + ) + ((not (and (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf4)) + (or (nonzero? (-> *setting-control* user-current subtitle-language)) + (nonzero? (-> *setting-control* user-current language)) + (nonzero? (-> *setting-control* user-current audio-language)) + ) ) - (set! sv-240 (t9-51 a0-69 sv-208 a2-27)) ) - ) - ) - (cond - ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0)) - (set! (-> s5-0 origin x) (+ 10.0 (-> s3-3 x))) - (let ((v1-130 s5-0)) - (set! (-> v1-130 width) f28-1) - ) - (let ((a0-70 s5-0)) - (set! (-> a0-70 color) (font-color font-color-34)) - ) - (let ((a0-71 s5-0)) - (set! (-> a0-71 flags) (font-flags kerning large)) - ) - (let ((f22-1 (-> s5-0 origin y)) - (s0-7 print-game-text) + (set! (-> arg1 origin x) (+ (-> s3-3 x) f30-1)) + (let ((v1-147 arg1)) + (set! (-> v1-147 width) f26-0) + ) + (let ((v1-148 sv-288)) + (cond + ((or (= v1-148 4) (= v1-148 3)) + (let ((a0-79 arg1)) + (set! (-> a0-79 flags) (font-flags kerning large ff7)) + ) + (let ((v1-150 arg1)) + (set! (-> v1-150 color) (font-color font-color-44)) + ) + ) + ((zero? v1-148) + (let ((a0-81 arg1)) + (set! (-> a0-81 flags) (font-flags kerning large)) + ) + (let ((v1-152 arg1)) + (set! (-> v1-152 color) (font-color font-color-34)) + ) + ) + (else + (let ((a0-83 arg1)) + (set! (-> a0-83 flags) (font-flags kerning large)) + ) + (let ((v1-154 arg1)) + (set! (-> v1-154 color) (font-color font-color-32)) ) - (set! sv-224 format) - (let ((a0-73 (clear *temp-string*)) - (a1-40 "~S") - ) - (sv-224 a0-73 a1-40 sv-240) ) - (set! (-> s5-0 origin y) (+ f22-1 (s0-7 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)))) ) ) - ((not (and (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf4)) - (or (nonzero? (-> *setting-control* user-current subtitle-language)) - (nonzero? (-> *setting-control* user-current language)) - (nonzero? (-> *setting-control* user-current audio-language)) + (let ((f22-2 (-> arg1 origin y))) + (set! sv-256 print-game-text) + (set! sv-272 format) + (let ((a0-86 (clear *temp-string*)) + (a1-44 "~S") + (a2-30 sv-240) + ) + (sv-272 a0-86 a1-44 a2-30) + ) + (let* ((a0-87 *temp-string*) + (a1-45 arg1) + (a2-31 #f) + (a3-15 40) + (t0-9 579) + (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-9))) + ) + (when (not (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0))) + (set! (-> arg1 origin x) (+ (-> s3-3 x) f28-1)) + (let ((a0-88 arg1)) + (set! (-> a0-88 flags) (font-flags kerning right large)) + ) + (set! sv-352 (lookup-text! *common-text* (text-id progress-on) #f)) + (set! sv-368 (lookup-text! *common-text* (text-id progress-off) #f)) + (cond + ((or (zero? sv-288) (= sv-288 3)) + (set! sv-304 print-game-text) + (set! sv-320 format) + (let ((a0-93 (clear *temp-string*)) + (a1-48 "~d") + (a2-34 (-> s0-6 cost)) + ) + (sv-320 a0-93 a1-48 a2-34) + ) + (let ((a0-94 *temp-string*) + (a1-49 arg1) + (a2-35 #f) + (a3-16 40) + (t0-10 579) + ) + (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-10)) + ) + ) + ((= sv-288 1) + (cond + ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) + (let ((s0-8 print-game-text)) + (set! sv-336 format) + (let ((a0-97 (clear *temp-string*)) + (a1-50 "~32L~S~44L ~S") + ) + (sv-336 a0-97 a1-50 sv-352 sv-368 (the-as none t0-9) (the-as none t1-0)) ) + (s0-8 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) + ) ) - ) - (set! (-> s5-0 origin x) (+ (-> s3-3 x) f30-1)) - (let ((v1-147 s5-0)) - (set! (-> v1-147 width) f26-0) - ) - (let ((v1-148 sv-288)) - (cond - ((or (= v1-148 4) (= v1-148 3)) - (let ((a0-79 s5-0)) - (set! (-> a0-79 flags) (font-flags kerning large ff7)) - ) - (let ((v1-150 s5-0)) - (set! (-> v1-150 color) (font-color font-color-44)) - ) - ) - ((zero? v1-148) - (let ((a0-81 s5-0)) - (set! (-> a0-81 flags) (font-flags kerning large)) - ) - (let ((v1-152 s5-0)) - (set! (-> v1-152 color) (font-color font-color-34)) - ) - ) - (else - (let ((a0-83 s5-0)) - (set! (-> a0-83 flags) (font-flags kerning large)) - ) - (let ((v1-154 s5-0)) - (set! (-> v1-154 color) (font-color font-color-32)) - ) - ) - ) - ) - (let ((f22-2 (-> s5-0 origin y))) - (set! sv-256 print-game-text) - (set! sv-272 format) - (let ((a0-86 (clear *temp-string*)) - (a1-44 "~S") - (a2-30 sv-240) - ) - (sv-272 a0-86 a1-44 a2-30) - ) - (let* ((a0-87 *temp-string*) - (a1-45 s5-0) - (a2-31 #f) - (a3-15 40) - (t0-9 579) - (f20-0 (sv-256 a0-87 a1-45 a2-31 a3-15 (the-as bucket-id t0-9))) - ) - (when (not (logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf0))) - (set! (-> s5-0 origin x) (+ (-> s3-3 x) f28-1)) - (let ((a0-88 s5-0)) - (set! (-> a0-88 flags) (font-flags kerning right large)) - ) - (set! sv-352 (lookup-text! *common-text* (text-id progress-on) #f)) - (set! sv-368 (lookup-text! *common-text* (text-id progress-off) #f)) - (cond - ((or (zero? sv-288) (= sv-288 3)) - (set! sv-304 print-game-text) - (set! sv-320 format) - (let ((a0-93 (clear *temp-string*)) - (a1-48 "~d") - (a2-34 (-> s0-6 cost)) - ) - (sv-320 a0-93 a1-48 a2-34) - ) - (let ((a0-94 *temp-string*) - (a1-49 s5-0) - (a2-35 #f) - (a3-16 40) - (t0-10 579) - ) - (sv-304 a0-94 a1-49 a2-35 a3-16 (the-as bucket-id t0-10)) - ) - ) - ((= sv-288 1) - (cond - ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) - (let ((s0-8 print-game-text)) - (set! sv-336 format) - (let ((a0-97 (clear *temp-string*)) - (a1-50 "~32L~S~44L ~S") - ) - (sv-336 a0-97 a1-50 sv-352 sv-368 (the-as none t0-9) (the-as none t1-0)) - ) - (s0-8 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) - ) - ) - (else - (let ((s0-9 print-game-text)) - (set! sv-384 format) - (let ((a0-100 (clear *temp-string*)) - (a1-52 "~S") - (a2-38 sv-352) - ) - (sv-384 a0-100 a1-52 a2-38) - ) - (s0-9 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) + (else + (let ((s0-9 print-game-text)) + (set! sv-384 format) + (let ((a0-100 (clear *temp-string*)) + (a1-52 "~S") + (a2-38 sv-352) + ) + (sv-384 a0-100 a1-52 a2-38) ) + (s0-9 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) ) ) - ((= sv-288 2) - (cond - ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) - (let ((s0-10 print-game-text)) - (set! sv-400 format) - (let ((a0-104 (clear *temp-string*)) - (a1-54 "~44L~S ~32L~S~1L") - (a2-40 sv-352) - (a3-20 sv-368) - ) - (sv-400 a0-104 a1-54 a2-40 a3-20 (the-as none t0-9) (the-as none t1-0)) - ) - (s0-10 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + ((= sv-288 2) + (cond + ((logtest? (-> s2-6 s1-5 flags) (secret-item-option-flags sf1)) + (let ((s0-10 print-game-text)) + (set! sv-400 format) + (let ((a0-104 (clear *temp-string*)) + (a1-54 "~44L~S ~32L~S~1L") + (a2-40 sv-352) + (a3-20 sv-368) + ) + (sv-400 a0-104 a1-54 a2-40 a3-20 (the-as none t0-9) (the-as none t1-0)) ) + (s0-10 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) - (else - (let ((s0-11 print-game-text)) - (set! sv-416 format) - (let ((a0-107 (clear *temp-string*)) - (a1-56 "~S") - (a2-42 sv-368) - ) - (sv-416 a0-107 a1-56 a2-42) - ) - (s0-11 *temp-string* s5-0 #f 40 (bucket-id hud-draw-hud-alpha)) + ) + (else + (let ((s0-11 print-game-text)) + (set! sv-416 format) + (let ((a0-107 (clear *temp-string*)) + (a1-56 "~S") + (a2-42 sv-368) + ) + (sv-416 a0-107 a1-56 a2-42) ) + (s0-11 *temp-string* arg1 #f 40 (bucket-id hud-draw-hud-alpha)) ) ) ) - ) + ) ) - (+! (-> s5-0 origin y) f20-0) - (if (= s1-5 (-> this selected-index)) - (progress-method-40 gp-0 s5-0 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) - ) ) + (+! (-> arg1 origin y) f20-0) + (if (= s1-5 (-> this selected-index)) + (progress-method-40 arg0 arg1 (the int (+ -2.0 f22-2)) (the int (+ 3.0 f20-0)) sv-16) + ) ) ) - ) + ) ) - (+! s1-5 1) ) - (seek! (-> this current-index) (-> this target-index) (* (/ 600.0 f24-0) (seconds-per-frame))) + (+! s1-5 1) ) + (seek! (-> this current-index) (-> this target-index) (* (/ 600.0 f24-0) (seconds-per-frame))) ) ) ) ) - (progress-method-34 gp-0) - (let ((s3-4 *progress-work*)) - (progress-method-46 gp-0 s5-0 sv-16 84) - (progress-method-41 gp-0 (-> s3-4 sub-header) (* 128.0 sv-16)) - (progress-method-42 gp-0 (-> s3-4 footer) (* 64.0 sv-16)) - (progress-method-41 gp-0 (-> s3-4 footer) (* 128.0 sv-16)) - ) - (progress-method-47 - gp-0 - s5-0 - (!= (-> this current-index) 0.0) - (!= (-> this current-index) (the float (+ (-> *menu-secrets-array* length) -1))) - ) + ) + (progress-method-34 arg0) + (let ((s3-4 *progress-work*)) + (progress-method-46 arg0 arg1 sv-16 84) + (progress-method-41 arg0 (-> s3-4 sub-header) (* 128.0 sv-16)) + (progress-method-42 arg0 (-> s3-4 footer) (* 64.0 sv-16)) + (progress-method-41 arg0 (-> s3-4 footer) (* 128.0 sv-16)) + ) + (progress-method-47 + arg0 + arg1 + (!= (-> this current-index) 0.0) + (!= (-> this current-index) (the float (+ (-> *menu-secrets-array* length) -1))) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc index bc6852ba54..620d1710e2 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress-static_REF.gc @@ -3320,7 +3320,7 @@ :icon (inventory-icon pass-wascity) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.225 0.05)) - :item (game-items pass-wascity) + :item (game-items pass-front-gate) ) ) ) @@ -3364,7 +3364,7 @@ :icon (inventory-icon pass-factory) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.825 0.05)) - :item (game-items pass-factory) + :item (game-items cypher-gliph) ) ) ) @@ -3393,7 +3393,7 @@ :icon (inventory-icon artifact-beam-generator) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.225 0.35)) - :item (game-items artifact-beam-generator) + :item (game-items artifact-av-generator) ) ) ) @@ -3408,7 +3408,7 @@ :icon (inventory-icon artifact-prism) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.425 0.35)) - :item (game-items artifact-prism) + :item (game-items artifact-av-prism) ) ) ) @@ -3423,7 +3423,7 @@ :icon (inventory-icon artifact-quantum-reflector) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.625 0.35)) - :item (game-items artifact-quantum-reflector) + :item (game-items artifact-av-reflector) ) ) ) @@ -3438,7 +3438,7 @@ :icon (inventory-icon artifact-time-map) :icon-scale 1.0 :offset (new 'static 'vector2 :data (new 'static 'array float 2 0.825 0.35)) - :item (game-items artifact-time-map) + :item (game-items artifact-av-map) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc index 86eca38658..02f0aac5e0 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc @@ -1946,108 +1946,96 @@ ) ;; definition for method 9 of type menu-slider-option -;; ERROR: Function may read a register that is not set: a3 -;; ERROR: Function may read a register that is not set: t0 (defmethod respond-progress ((this menu-slider-option) (arg0 progress) (arg1 symbol)) - (local-vars (a3-0 none) (t0-0 none)) (with-pp - (let ((gp-0 arg0)) - (when (draw *bigmap* (the-as int arg0) (the-as int arg1) (the-as int a3-0) (the-as int t0-0)) - (let ((s5-0 (&+ (the-as (pointer float) *setting-control*) (-> this setting-offset))) - (s3-0 #f) - ) - (let ((f30-0 (* 0.02 (-> pp clock time-adjust-ratio))) - (f28-0 0.0) - ) - (when (type? this menu-picture-slider-option) - (set! f30-0 (* 0.005 (-> pp clock time-adjust-ratio))) - (set! f28-0 0.25) - ) - (cond - ((cpad-hold? 0 left l-analog-left) - (seek! (-> s5-0 0) f28-0 f30-0) - (if (!= (-> s5-0 0) 0.0) - (set! s3-0 #t) - ) - ) - ((cpad-hold? 0 right l-analog-right) - (seek! (-> s5-0 0) 1.0 f30-0) - (if (!= (-> s5-0 0) 1.0) - (set! s3-0 #t) - ) - ) - ) + (when (bigmap-method-11 *bigmap*) + (let ((s5-0 (&+ (the-as (pointer float) *setting-control*) (-> this setting-offset))) + (s3-0 #f) ) - (when s3-0 - (let ((f30-1 1.0)) - (case (-> this name) - (((text-id progress-music-volume) (text-id progress-speech-volume)) - (set! f30-1 (-> s5-0 0)) + (let ((f30-0 (* 0.02 (-> pp clock time-adjust-ratio))) + (f28-0 0.0) + ) + (when (type? this menu-picture-slider-option) + (set! f30-0 (* 0.005 (-> pp clock time-adjust-ratio))) + (set! f28-0 0.25) + ) + (cond + ((cpad-hold? 0 left l-analog-left) + (seek! (-> s5-0 0) f28-0 f30-0) + (if (!= (-> s5-0 0) 0.0) + (set! s3-0 #t) ) - ) - (when (< (seconds 0.03) (- (current-time) (-> gp-0 last-sound))) - (set-time! (-> gp-0 last-sound)) - (sound-play-by-name - (static-sound-name "menu-slide") - (new-sound-id) - (the int (* 1024.0 f30-1)) - 0 - 0 - (sound-group) - #t - ) + ) + ((cpad-hold? 0 right l-analog-right) + (seek! (-> s5-0 0) 1.0 f30-0) + (if (!= (-> s5-0 0) 1.0) + (set! s3-0 #t) + ) + ) + ) + ) + (when s3-0 + (let ((f30-1 1.0)) + (case (-> this name) + (((text-id progress-music-volume) (text-id progress-speech-volume)) + (set! f30-1 (-> s5-0 0)) + ) + ) + (when (< (seconds 0.03) (- (current-time) (-> arg0 last-sound))) + (set-time! (-> arg0 last-sound)) + (sound-play-by-name + (static-sound-name "menu-slide") + (new-sound-id) + (the int (* 1024.0 f30-1)) + 0 + 0 + (sound-group) + #t ) ) ) ) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) ) 0 ) ) ;; definition for method 9 of type menu-stereo-mode-sound-option -;; ERROR: Function may read a register that is not set: a3 -;; ERROR: Function may read a register that is not set: t0 (defmethod respond-progress ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) - (local-vars (a3-0 none) (t0-0 none)) - (let ((gp-0 arg0) - (s5-0 arg1) - ) - (when (draw *bigmap* (the-as int arg0) (the-as int arg1) (the-as int a3-0) (the-as int t0-0)) - (let ((a0-2 (-> *setting-control* user-default stereo-mode)) - (v1-4 #f) + (when (bigmap-method-11 *bigmap*) + (let ((a0-2 (-> *setting-control* user-default stereo-mode)) + (v1-4 #f) + ) + (let ((a2-1 2)) + (cond + (arg1 + (cond + ((cpad-pressed? 0 left l-analog-left) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 -1) 0 a2-1)) + (set! v1-4 #t) + ) + ((cpad-pressed? 0 right l-analog-right) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 1) 0 a2-1)) + (set! v1-4 #t) + ) + ((cpad-pressed? 0 triangle) + (set! (-> *setting-control* user-default stereo-mode) (-> arg0 stereo-mode-backup)) + ) + ) ) - (let ((a2-1 2)) - (cond - (s5-0 - (cond - ((cpad-pressed? 0 left l-analog-left) - (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 -1) 0 a2-1)) - (set! v1-4 #t) - ) - ((cpad-pressed? 0 right l-analog-right) - (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-2 1) 0 a2-1)) - (set! v1-4 #t) - ) - ((cpad-pressed? 0 triangle) - (set! (-> *setting-control* user-default stereo-mode) (-> gp-0 stereo-mode-backup)) - ) + (else + (if (cpad-pressed? 0 confirm) + (set! (-> arg0 stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) ) - ) - (else - (if (cpad-pressed? 0 confirm) - (set! (-> gp-0 stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) - ) - ) ) ) - (if v1-4 - (sound-play "generic-beep") - ) ) + (if v1-4 + (sound-play "generic-beep") + ) ) ) 0 @@ -2300,57 +2288,50 @@ ) ;; definition for method 9 of type menu-memcard-slot-option -;; ERROR: Function may read a register that is not set: a3 -;; ERROR: Function may read a register that is not set: t0 (defmethod respond-progress ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) - (local-vars (a3-0 none) (t0-0 none)) (memcard-unlocked-secrets? arg0 #t) - (let* ((a1-3 (get-state-check-card arg0 (-> arg0 current))) - (a0-3 arg0) - (t9-2 (method-of-object a0-3 set-next-state)) - (a2-1 0) - ) - (t9-2 a0-3 a1-3 a2-1) - (set! (-> arg0 selected-option) #f) - (when (draw *bigmap* (the-as int a1-3) a2-1 (the-as int a3-0) (the-as int t0-0)) - (cond - ((cpad-pressed? 0 triangle) - ) - ((cpad-pressed? 0 confirm) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) - (let ((s5-0 #f)) - *progress-save-info* - (set! (-> arg0 which-slot) (-> arg0 option-index)) - (cond - ((= (-> arg0 current) 'select-load) - (when (= (-> *progress-save-info* file (-> arg0 option-index) present) 1) - (set! s5-0 #t) - (set-next-state arg0 'loading 0) - ) - ) - ((and (= (-> arg0 current) 'select-save-hero) - (-> *setting-control* user-default auto-save) - (= (-> *game-info* auto-save-card) (-> *progress-save-info* handle)) - (= (-> *game-info* auto-save-which) (-> arg0 which-slot)) - ) - (sound-play "generic-beep" :pitch -0.6) - ) - ((= (-> *progress-save-info* file (-> arg0 which-slot) present) 1) + (let ((a1-3 (get-state-check-card arg0 (-> arg0 current)))) + (set-next-state arg0 a1-3 0) + ) + (set! (-> arg0 selected-option) #f) + (when (bigmap-method-11 *bigmap*) + (cond + ((cpad-pressed? 0 triangle) + ) + ((cpad-pressed? 0 confirm) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (let ((s5-0 #f)) + *progress-save-info* + (set! (-> arg0 which-slot) (-> arg0 option-index)) + (cond + ((= (-> arg0 current) 'select-load) + (when (= (-> *progress-save-info* file (-> arg0 option-index) present) 1) (set! s5-0 #t) - (set-next-state arg0 'already-exists 0) + (set-next-state arg0 'loading 0) ) - (else - (set! s5-0 #t) - (set-next-state arg0 'saving 0) - ) + ) + ((and (= (-> arg0 current) 'select-save-hero) + (-> *setting-control* user-default auto-save) + (= (-> *game-info* auto-save-card) (-> *progress-save-info* handle)) + (= (-> *game-info* auto-save-which) (-> arg0 which-slot)) + ) + (sound-play "generic-beep" :pitch -0.6) + ) + ((= (-> *progress-save-info* file (-> arg0 which-slot) present) 1) + (set! s5-0 #t) + (set-next-state arg0 'already-exists 0) + ) + (else + (set! s5-0 #t) + (set-next-state arg0 'saving 0) ) - (if s5-0 - (sound-play "generic-beep") - ) ) + (if s5-0 + (sound-play "generic-beep") + ) ) - ) + ) ) ) 0 diff --git a/test/decompiler/reference/jak3/levels/city/common/trail-h_REF.gc b/test/decompiler/reference/jak3/levels/city/common/trail-h_REF.gc index 3045f6570d..b4b240e387 100644 --- a/test/decompiler/reference/jak3/levels/city/common/trail-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/trail-h_REF.gc @@ -15,10 +15,11 @@ (flags trail-node-flag) (conn-count uint8) ) + :pack-me (:methods - (trail-node-method-9 () none) - (trail-node-method-10 () none) - (trail-node-method-11 () none) + (get-dist-score (_type_ vector) uint) + (debug-draw (_type_ int) none) + (get-position (_type_ vector) vector) ) ) @@ -96,8 +97,9 @@ (visgroup-id uint8) (cost uint16) ) + :pack-me (:methods - (trail-conn-method-9 () none) + (debug-draw (_type_ trail-graph int) none) ) ) @@ -124,6 +126,7 @@ (pov-count uint8) (first-pov uint16) ) + :pack-me ) ;; definition for method 3 of type trail-conn-hash-cell @@ -284,31 +287,31 @@ (closed-bits vector16ub 2 :inline :overlay-at closed-quads) ) (:methods - (trail-graph-method-9 () none) - (trail-graph-method-10 () none) - (trail-graph-method-11 () none) - (trail-graph-method-12 () none) - (trail-graph-method-13 () none) + (trail-graph-method-9 (_type_ int) none) + (trail-graph-method-10 (_type_ int) none) + (trail-graph-method-11 (_type_ int int) trail-node) + (trail-graph-method-12 (_type_) none) + (trail-graph-method-13 (_type_ vector vector) none) (debug-draw (_type_) none) - (trail-graph-method-15 () none) - (trail-graph-method-16 () none) - (trail-graph-method-17 () none) - (trail-graph-method-18 () none) - (trail-graph-method-19 () none) - (trail-graph-method-20 () none) - (trail-graph-method-21 () none) - (trail-graph-method-22 () none) - (trail-graph-method-23 () none) - (trail-graph-method-24 () none) - (trail-graph-method-25 () none) - (trail-graph-method-26 () none) - (trail-graph-method-27 () none) - (trail-graph-method-28 () none) - (trail-graph-method-29 () none) - (trail-graph-method-30 () none) - (trail-graph-method-31 () none) - (trail-graph-method-32 () none) - (trail-graph-method-33 () none) + (trail-graph-method-15 (_type_ int) none) + (trail-graph-method-16 (_type_ int (pointer uint16) vector vector rgba float) none) + (trail-graph-method-17 (_type_) none) + (trail-graph-method-18 (_type_ vector) int) + (trail-graph-method-19 (_type_) none) + (trail-graph-method-20 (_type_ uint vector) none) + (trail-graph-method-21 (_type_) none) + (trail-graph-method-22 (_type_) none) + (trail-graph-method-23 (_type_) none) + (trail-graph-method-24 (_type_) none) + (trail-graph-method-25 (_type_ int) none) + (trail-graph-method-26 (_type_) none) + (trail-graph-method-27 (_type_) none) + (trail-graph-method-28 (_type_) none) + (trail-graph-method-29 (_type_) none) + (trail-graph-method-30 (_type_) none) + (trail-graph-method-31 (_type_ int) none) + (trail-graph-method-32 (_type_) none) + (trail-graph-method-33 (_type_) none) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc new file mode 100644 index 0000000000..33ada10397 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc @@ -0,0 +1,452 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 38 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-38 ((this vehicle)) + (cond + ((< 0.0 (-> this scrape-sound-envelope)) + (if (zero? (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new-sound-id)) + ) + (sound-play-by-name + (-> this info sound scrape-sound) + (-> this scrape-sound-id) + (the int (* 1024.0 (-> this scrape-sound-envelope))) + 0 + 0 + (sound-group) + (-> this impact-pos) + ) + ) + (else + (when (nonzero? (-> this scrape-sound-id)) + (sound-stop (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for function calc-fade-vals +;; WARN: Return type mismatch object vs none. +(defun calc-fade-vals ((arg0 float)) + (let* ((f1-1 (* 0.00024414062 arg0)) + (f0-3 (- f1-1 (the float (the int f1-1)))) + (f1-3 (* 4096.0 (- f1-1 f0-3))) + (f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3))) + (f0-4 (/ f0-3 (- 1.0 f0-3))) + ) + (format #t ":fade-a ~,,10f~%:fade-b ~,,10f~%" f1-5 f0-4) + ) + (none) + ) + +;; definition for symbol *vehicle-headlight-glow-template*, type sprite-glow-data +(define *vehicle-headlight-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 8192.0) + :size-probe 163.84 + :z-offset 819.2 + :size-y 8192.0 + :color (new 'static 'rgbaf :x 255.0 :y 128.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xd :page #x4) + ) + ) + +;; definition for symbol *vehicle-taillight-glow-template*, type sprite-glow-data +(define *vehicle-taillight-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 3072.0) + :size-probe 122.88 + :z-offset 409.6 + :size-y 3072.0 + :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xe :page #x4) + ) + ) + +;; definition for symbol *vehicle-thruster-glow-template*, type sprite-glow-data +(define *vehicle-thruster-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 4096.0) + :size-probe 102.4 + :size-y 4096.0 + :color (new 'static 'rgbaf :x 255.0 :y 64.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xf :page #x4) + ) + ) + +;; definition for method 9 of type vehicle-particle-common-info +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this vehicle-particle-common-info)) + (set! (-> this sp-system2d) *sp-particle-system-2d*) + (set! (-> this sp-system3d) *sp-particle-system-3d*) + (set! (-> this part-quat) *particle-quat*) + (set! (-> this part-vel) *particle-vel*) + (set! (-> this part-thruster) (-> *part-id-table* 922)) + (set! (-> this part-thruster-x) (-> *part-id-table* 922 init-specs 2)) + (set! (-> this part-spec2) (-> *part-id-table* 922 init-specs 3)) + (set! (-> this headlight-glow-template) *vehicle-headlight-glow-template*) + (set! (-> this taillight-glow-template) *vehicle-taillight-glow-template*) + (set! (-> this thruster-glow-template) *vehicle-thruster-glow-template*) + 0 + (none) + ) + +;; definition for symbol *vehicle-particle-common-info*, type vehicle-particle-common-info +(define *vehicle-particle-common-info* (new 'static 'vehicle-particle-common-info)) + +;; failed to figure out what this is: +(init! *vehicle-particle-common-info*) + +;; definition for method 78 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-78 ((this vehicle)) + (local-vars (sv-224 sparticle-launcher) (sv-228 sparticle-launcher)) + (let ((a1-0 (-> this clock)) + (a0-1 (-> this traffic-priority-id)) + ) + (when (not (logtest? (logxor a0-1 (-> a1-0 integral-frame-counter)) 31)) + (let ((f0-1 + (+ (-> *time-of-day-context* time) (* 0.048387095 (the float (logand (-> this traffic-priority-id) 31)))) + ) + ) + (cond + ((and (logtest? (-> this v-flags) (vehicle-flag riding)) (or (< f0-1 7.0) (< 19.0 f0-1))) + (if (not (logtest? (vehicle-flag lights-on) (-> this v-flags))) + (vehicle-method-125 this) + ) + ) + (else + (if (logtest? (vehicle-flag lights-on) (-> this v-flags)) + (vehicle-method-126 this) + ) + ) + ) + ) + ) + ) + (when (logtest? (vehicle-flag lights-update) (-> this v-flags)) + (let ((f30-0 (if (logtest? (vehicle-flag lights-on) (-> this v-flags)) + 1.0 + 0.0 + ) + ) + ) + (seek! (-> this lights-factor) f30-0 (* 2.0 (seconds-per-frame))) + (if (= (-> this lights-factor) f30-0) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag lights-update)))) + ) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vehicle-stack-type3))) + (let* ((v1-38 (-> s5-0 mat0)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-14 (-> a3-0 rvec quad)) + (a1-3 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-38 rvec quad) a0-14) + (set! (-> v1-38 uvec quad) a1-3) + (set! (-> v1-38 fvec quad) a2-1) + (set! (-> v1-38 trans quad) a3-1) + ) + (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) + (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat0)) + (set! (-> this fog-fade) (calc-fade-from-fog (-> this root trans))) + (set! (-> s5-0 float1) (* (-> this fog-fade) (-> this lights-factor))) + (when (< 0.0 (-> s5-0 float1)) + (dotimes (s4-0 (-> this info particles headlight-count)) + (quad-copy! + (the-as pointer (-> s5-0 glow)) + (the-as pointer (-> this info particle-common headlight-glow-template)) + 4 + ) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles headlight-local-pos s4-0) (-> s5-0 mat0)) + (let* ((v1-46 (-> s5-0 glow)) + (a1-8 (-> s5-0 vec0)) + (f0-15 (-> v1-46 position w)) + ) + (set! (-> v1-46 position quad) (-> a1-8 quad)) + (set! (-> v1-46 position w) f0-15) + ) + 0 + (set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> s5-0 glow color x) 255.0) + (set! (-> s5-0 glow color y) (rand-vu-float-range 192.0 255.0)) + (set! (-> s5-0 glow color w) (* (-> s5-0 float1) (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + (let ((f0-22 (-> this camera-dist2)) + (f1-7 245760.0) + ) + (when (< f0-22 (* f1-7 f1-7)) + (let ((f0-23 3276.8)) + (set! (-> s5-0 glow position w) f0-23) + (set! (-> s5-0 glow size-y) f0-23) + ) + (set! (-> s5-0 glow fade-a) -0.00001356) + (set! (-> s5-0 glow fade-b) 2.3332994) + (set! (-> s5-0 glow color z) (rand-vu-float-range 128.0 160.0)) + (set! (-> s5-0 glow color w) (* (-> s5-0 float1) (rand-vu-float-range 32.0 36.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + ) + ) + ) + (quad-copy! + (the-as pointer (-> s5-0 glow)) + (the-as pointer (-> this info particle-common taillight-glow-template)) + 4 + ) + (dotimes (s4-1 (-> this info particles taillight-count)) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles taillight-local-pos s4-1) (-> s5-0 mat0)) + (let* ((v1-70 (-> s5-0 glow)) + (a1-20 (-> s5-0 vec0)) + (f0-29 (-> v1-70 position w)) + ) + (set! (-> v1-70 position quad) (-> a1-20 quad)) + (set! (-> v1-70 position w) f0-29) + ) + 0 + (set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -4.0 4.0))) + (set! (-> s5-0 glow color y) (* 64.0 (rand-vu))) + (set! (-> s5-0 glow color w) (* (-> s5-0 float1) (rand-vu-float-range 16.0 21.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + ) + ) + (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (set! (-> *part-id-table* 923 init-specs 2 initial-valuef) + (* 6.0 (+ 0.25 (-> this engine-power-factor)) (rand-vu)) + ) + (let* ((f0-39 1.0) + (f1-12 (-> this engine-power-factor)) + (f0-40 (- f0-39 (* f1-12 f1-12))) + ) + (set! (-> *part-id-table* 923 init-specs 9 initial-valuef) (* 16.0 f0-40)) + (set! (-> *part-id-table* 923 init-specs 9 random-rangef) (* 48.0 f0-40)) + ) + (set! (-> s5-0 float0) + (* 0.2 (-> this info handling max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) + ) + (let ((s4-2 (-> *part-id-table* 923))) + (dotimes (s3-0 2) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles exhaust-local-pos s3-0) (-> s5-0 mat0)) + (vector-rotate*! (-> s5-0 vec1) (-> this info particles exhaust-local-dir s3-0) (-> s5-0 mat0)) + (vector+float*! (-> s5-0 vec2) (-> this rbody lin-velocity) (-> s5-0 vec1) (-> s5-0 float0)) + (let ((v1-116 (-> this info particle-common part-vel)) + (a0-40 (-> s5-0 vec2)) + (f0-46 300.0) + ) + (vector-float*! v1-116 a0-40 (/ 1.0 f0-46)) + ) + (set! (-> s4-2 birthaccum) (the-as float (-> this exhaust-part-accum s3-0))) + (let ((t9-23 sp-launch-particles-var) + (a0-41 (-> this info particle-common sp-system2d)) + (a1-33 s4-2) + (a2-9 *launch-matrix*) + ) + (set! (-> a2-9 trans quad) (-> s5-0 vec0 quad)) + (t9-23 a0-41 a1-33 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (set! (-> this exhaust-part-accum s3-0) (the-as sparticle-launch-control (-> s4-2 birthaccum))) + ) + ) + ) + (when (< (-> this hit-points) 0.75) + (let* ((f28-1 (+ -32768.0 (* 32768.0 (rand-vu)))) + (f24-0 (* 65536.0 (rand-vu))) + (f30-10 (cos f28-1)) + (f28-2 (sin f28-1)) + (f26-0 (cos f24-0)) + ) + (set! (-> s5-0 vec3 x) (* f30-10 (sin f24-0))) + (set! (-> s5-0 vec3 y) f28-2) + (set! (-> s5-0 vec3 z) (* f30-10 f26-0)) + ) + (set! sv-224 (the-as sparticle-launcher #f)) + (set! sv-228 (the-as sparticle-launcher #f)) + (cond + ((< (-> this hit-points) 0.25) + (set! sv-224 (-> *part-id-table* 925)) + (set! sv-228 (-> *part-id-table* 921)) + ) + ((< (-> this hit-points) 0.5) + (set! sv-224 (-> *part-id-table* 928)) + ) + (else + (if (< (rand-vu) 0.05) + (set! sv-224 (-> *part-id-table* 930)) + ) + ) + ) + (when sv-224 + (set! (-> s5-0 byte0) 0) + (dotimes (s4-3 2) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles smoke-local-pos s4-3) (-> s5-0 mat0)) + (vector-rotate*! (-> s5-0 vec2) (-> this info particles smoke-local-vel s4-3) (-> s5-0 mat0)) + (vector+! (-> s5-0 vec2) (-> s5-0 vec2) (-> this rbody lin-velocity)) + (vector+float*! (-> s5-0 vec2) (-> s5-0 vec2) (-> s5-0 vec3) (* 24576.0 (rand-vu))) + (let ((v1-155 (-> this info particle-common part-vel)) + (a0-50 (-> s5-0 vec2)) + (f0-63 300.0) + ) + (vector-float*! v1-155 a0-50 (/ 1.0 f0-63)) + ) + (when (and sv-228 (< (rand-vu) 0.005)) + (let ((t9-35 sp-launch-particles-var) + (a0-51 (-> this info particle-common sp-system2d)) + (a1-43 sv-228) + (a2-12 *launch-matrix*) + ) + (set! (-> a2-12 trans quad) (-> s5-0 vec0 quad)) + (t9-35 a0-51 a1-43 a2-12 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (+! (-> s5-0 byte0) 1) + ) + (set! (-> sv-224 birthaccum) (the-as float (-> this smoke-part-accum s4-3))) + (let ((t9-36 sp-launch-particles-var) + (a0-52 (-> this info particle-common sp-system2d)) + (a1-44 sv-224) + (a2-13 *launch-matrix*) + ) + (set! (-> a2-13 trans quad) (-> s5-0 vec0 quad)) + (t9-36 a0-52 a1-44 a2-13 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (set! (-> this smoke-part-accum s4-3) (the-as sparticle-launch-control (-> sv-224 birthaccum))) + ) + (if (> (-> s5-0 byte0) 0) + (sound-play "damage-zaps" :id (-> this damage-zap-sound-id)) + ) + ) + ) + (when (>= (-> this scrape-sound-envelope) 0.75) + (let ((a1-46 (-> *part-id-table* 920)) + (t9-38 sp-launch-particles-var) + (a0-55 (-> this info particle-common sp-system2d)) + (a2-15 *launch-matrix*) + ) + (set! (-> a2-15 trans quad) (-> this impact-pos quad)) + (t9-38 a0-55 a1-46 a2-15 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function vehicle-draw-thruster +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun vehicle-draw-thruster ((arg0 vehicle-particle-common-info) (arg1 vehicle-draw-thruster-params)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'vehicle-thruster-work))) + (set! (-> s5-0 vec2 quad) (-> arg1 trans quad)) + (quaternion-copy! (-> s5-0 quat1) (-> arg1 quat)) + (quaternion-rotate-local-x! (-> s5-0 quat1) (-> s5-0 quat1) 32768.0) + (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) + (set! (-> s5-0 vec4 quad) (-> s5-0 vec0 quad)) + (let ((f0-0 (rand-vu-float-range 1.0 1.33))) + (set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust))) + (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (* 0.5 (-> s5-0 float0)))) + ) + (let ((a1-5 (-> s5-0 vec3))) + (let ((v1-4 (-> arg1 trans))) + (let ((a0-9 (-> s5-0 vec4))) + (let ((a2-2 (* 0.25 (-> s5-0 float0)))) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-4 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-5 quad) vf6) + ) + (quad-copy! (the-as pointer (-> s5-0 glow)) (the-as pointer (-> arg0 thruster-glow-template)) 4) + (let* ((v1-5 (-> s5-0 glow)) + (a1-7 (-> s5-0 vec3)) + (f0-5 (-> v1-5 position w)) + ) + (set! (-> v1-5 position quad) (-> a1-7 quad)) + (set! (-> v1-5 position w) f0-5) + ) + 0 + (set! (-> s5-0 glow color y) (rand-vu-float-range 0.0 64.0)) + (set! (-> s5-0 glow color w) (* (-> arg1 fog-fade) (+ (* 16.0 (-> arg1 thrust)) (* 4.0 (rand-vu))))) + (let ((f0-13 (* 4.0 (-> s5-0 float1)))) + (set! (-> s5-0 glow position w) f0-13) + (set! (-> s5-0 glow size-y) f0-13) + (set! (-> s5-0 glow size-probe) (* 0.025 f0-13)) + ) + (add! *simple-sprite-system* (-> s5-0 glow)) + (let ((v1-15 (-> s5-0 vec3))) + (let ((a0-14 (-> arg1 trans))) + (let ((a1-11 (-> s5-0 vec4))) + (let ((a2-5 (* 0.5 (-> s5-0 float0)))) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-14 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-15 quad) vf6) + ) + (set! (-> arg0 part-thruster-x initial-valuef) (-> s5-0 float1)) + (set! (-> arg0 part-spec2 initial-valuef) (-> s5-0 float0)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (launch-particles + :system (-> arg0 sp-system3d) + (-> arg0 part-thruster) + (the-as matrix (-> s5-0 quat0)) + :origin-is-matrix #t + ) + (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) + (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (launch-particles + :system (-> arg0 sp-system3d) + (-> arg0 part-thruster) + (the-as matrix (-> s5-0 quat0)) + :origin-is-matrix #t + ) + (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) + (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) + (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (launch-particles + :system (-> arg0 sp-system3d) + (-> arg0 part-thruster) + (the-as matrix (-> s5-0 quat0)) + :origin-is-matrix #t + ) + ) + 0 + (none) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc new file mode 100644 index 0000000000..c6be22d4dc --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc @@ -0,0 +1,1462 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vehicle-info +(deftype vehicle-info (structure) + ((handle-by-vehicle-type handle 44) + ) + ) + +;; definition for method 3 of type vehicle-info +(defmethod inspect ((this vehicle-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-info) + (format #t "~1Thandle-by-vehicle-type[44] @ #x~X~%" (-> this handle-by-vehicle-type)) + (label cfg-4) + this + ) + +;; definition of type vehicle-lookup-info +(deftype vehicle-lookup-info (structure) + ((turn-radius meters) + (throttle-turning float) + (throttle-straight float) + ) + ) + +;; definition for method 3 of type vehicle-lookup-info +(defmethod inspect ((this vehicle-lookup-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-lookup-info) + (format #t "~1Tturn-radius: (meters ~m)~%" (-> this turn-radius)) + (format #t "~1Tthrottle-turning: ~f~%" (-> this throttle-turning)) + (format #t "~1Tthrottle-straight: ~f~%" (-> this throttle-straight)) + (label cfg-4) + this + ) + +;; definition of type vehicle-control-point +(deftype vehicle-control-point (structure) + ((local-pos vector :inline) + (normal vector :inline) + ) + ) + +;; definition for method 3 of type vehicle-control-point +(defmethod inspect ((this vehicle-control-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-control-point) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (label cfg-4) + this + ) + +;; definition of type vehicle-attach-point +(deftype vehicle-attach-point (structure) + ((local-pos vector :inline) + (rot vector :inline) + ) + ) + +;; definition for method 3 of type vehicle-attach-point +(defmethod inspect ((this vehicle-attach-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-attach-point) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Trot: #~%" (-> this rot)) + (label cfg-4) + this + ) + +;; definition of type vehicle-wheel-info +(deftype vehicle-wheel-info (structure) + ((local-pos vector :inline) + (flags vehicle-wheel-flag) + (callback (function rigid-body-object vehicle-wheel-state vehicle-wheel-info none)) + (inertia float) + (radius float) + (susp-arm-length float) + (steer-arm-length float) + (scale float) + (travel float) + (probe-y-offset float) + (width float) + (suspension-spring float) + (suspension-damping float) + (forward-grip float) + (side-grip float) + (max-brake-torque float) + (camber float) + (settle-pos float) + (probe-radius float) + (tread-texture string) + (tread-tid texture-id) + ) + ) + +;; definition for method 3 of type vehicle-wheel-info +(defmethod inspect ((this vehicle-wheel-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-wheel-info) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tcallback: ~A~%" (-> this callback)) + (format #t "~1Tinertia: ~f~%" (-> this inertia)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tsusp-arm-length: ~f~%" (-> this susp-arm-length)) + (format #t "~1Tsteer-arm-length: ~f~%" (-> this steer-arm-length)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Ttravel: ~f~%" (-> this travel)) + (format #t "~1Tprobe-y-offset: ~f~%" (-> this probe-y-offset)) + (format #t "~1Twidth: ~f~%" (-> this width)) + (format #t "~1Tsuspension-spring: ~f~%" (-> this suspension-spring)) + (format #t "~1Tsuspension-damping: ~f~%" (-> this suspension-damping)) + (format #t "~1Tforward-grip: ~f~%" (-> this forward-grip)) + (format #t "~1Tside-grip: ~f~%" (-> this side-grip)) + (format #t "~1Tmax-brake-torque: ~f~%" (-> this max-brake-torque)) + (format #t "~1Tcamber: ~f~%" (-> this camber)) + (format #t "~1Tsettle-pos: ~f~%" (-> this settle-pos)) + (format #t "~1Tprobe-radius: ~f~%" (-> this probe-radius)) + (format #t "~1Ttread-texture: ~A~%" (-> this tread-texture)) + (format #t "~1Ttread-tid: ~D~%" (-> this tread-tid)) + (label cfg-4) + this + ) + +;; definition of type vehicle-engine-info +(deftype vehicle-engine-info (structure) + ((max-torque float) + (inertia float) + (drag float) + (idle-rpm float) + (clutch-min-rpm float) + (clutch-max-rpm float) + (min-rpm float) + (max-rpm float) + (peak-torque-rpm float) + (powerband-width-rpm float) + ) + :pack-me + ) + +;; definition for method 3 of type vehicle-engine-info +(defmethod inspect ((this vehicle-engine-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-engine-info) + (format #t "~1Tmax-torque: ~f~%" (-> this max-torque)) + (format #t "~1Tinertia: ~f~%" (-> this inertia)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tidle-rpm: ~f~%" (-> this idle-rpm)) + (format #t "~1Tclutch-min-rpm: ~f~%" (-> this clutch-min-rpm)) + (format #t "~1Tclutch-max-rpm: ~f~%" (-> this clutch-max-rpm)) + (format #t "~1Tmin-rpm: ~f~%" (-> this min-rpm)) + (format #t "~1Tmax-rpm: ~f~%" (-> this max-rpm)) + (format #t "~1Tpeak-torque-rpm: ~f~%" (-> this peak-torque-rpm)) + (format #t "~1Tpowerband-width-rpm: ~f~%" (-> this powerband-width-rpm)) + (label cfg-4) + this + ) + +;; definition of type vehicle-transmission-info +(deftype vehicle-transmission-info (structure) + ((inertia float) + (upshift-rpm float) + (downshift-rpm float) + (final-drive-ratio float) + (gear-ratio-array float 8) + (gear-count int8) + ) + ) + +;; definition for method 3 of type vehicle-transmission-info +(defmethod inspect ((this vehicle-transmission-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-transmission-info) + (format #t "~1Tinertia: ~f~%" (-> this inertia)) + (format #t "~1Tupshift-rpm: ~f~%" (-> this upshift-rpm)) + (format #t "~1Tdownshift-rpm: ~f~%" (-> this downshift-rpm)) + (format #t "~1Tfinal-drive-ratio: ~f~%" (-> this final-drive-ratio)) + (format #t "~1Tgear-ratio-array[8] @ #x~X~%" (-> this gear-ratio-array)) + (format #t "~1Tgear-count: ~D~%" (-> this gear-count)) + (label cfg-4) + this + ) + +;; definition of type vehicle-handling-info +(deftype vehicle-handling-info (structure) + ((max-engine-thrust meters) + (inv-max-engine-thrust float) + (engine-response-rate float) + (engine-intake-factor float) + (brake-factor float) + (turbo-boost-factor float) + (turbo-boost-duration uint16) + (max-xz-speed meters) + (player-turn-anim-bias float) + (player-turn-anim-min float) + (player-turn-anim-max float) + (pilot-x-accel-factor float) + (pilot-y-accel-factor float) + (pilot-z-accel-factor float) + (ground-probe-distance meters) + (ground-probe-offset meters) + (cos-ground-effect-angle float) + (spring-lift-factor float) + (air-steering-factor float) + (air-drag-factor float) + (steering-fin-angle float) + (steering-thruster-factor float) + (steering-thruster-max-gain float) + (steering-thruster-half-gain-speed meters) + (tire-steering-angle float) + (tire-steering-speed-factor float) + (tire-steering-speed-bias float) + (ackermann-factor float) + (tire-friction-factor float) + (tire-static-friction float) + (tire-static-friction-speed meters) + (tire-dynamic-friction float) + (tire-dynamic-friction-speed meters) + (tire-inv-max-friction-speed float) + (airfoil-factor float) + (drag-force-factor float) + (rolling-resistance float) + (speed-scrubbing-drag float) + (speed-limiting-drag float) + (pitch-control-factor float) + (roll-control-factor float) + (roll-angle float) + (jump-thrust-factor float) + (buoyancy-factor float) + (water-drag-factor float) + (player-weight float) + (player-shift-x meters) + (player-shift-z meters) + (air-roll-torque float) + (air-pitch-torque float) + (air-angular-damping float) + (hop-turn-torque float) + (ground-torque-scale float) + (ai-steering-factor float) + (ai-throttle-factor float) + ) + :pack-me + ) + +;; definition for method 3 of type vehicle-handling-info +(defmethod inspect ((this vehicle-handling-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-handling-info) + (format #t "~1Tmax-engine-thrust: (meters ~m)~%" (-> this max-engine-thrust)) + (format #t "~1Tinv-max-engine-thrust: ~f~%" (-> this inv-max-engine-thrust)) + (format #t "~1Tengine-response-rate: ~f~%" (-> this engine-response-rate)) + (format #t "~1Tengine-intake-factor: ~f~%" (-> this engine-intake-factor)) + (format #t "~1Tbrake-factor: ~f~%" (-> this brake-factor)) + (format #t "~1Tturbo-boost-factor: ~f~%" (-> this turbo-boost-factor)) + (format #t "~1Tturbo-boost-duration: ~D~%" (-> this turbo-boost-duration)) + (format #t "~1Tmax-xz-speed: (meters ~m)~%" (-> this max-xz-speed)) + (format #t "~1Tplayer-turn-anim-bias: ~f~%" (-> this player-turn-anim-bias)) + (format #t "~1Tplayer-turn-anim-min: ~f~%" (-> this player-turn-anim-min)) + (format #t "~1Tplayer-turn-anim-max: ~f~%" (-> this player-turn-anim-max)) + (format #t "~1Tpilot-x-accel-factor: ~f~%" (-> this pilot-x-accel-factor)) + (format #t "~1Tpilot-y-accel-factor: ~f~%" (-> this pilot-y-accel-factor)) + (format #t "~1Tpilot-z-accel-factor: ~f~%" (-> this pilot-z-accel-factor)) + (format #t "~1Tground-probe-distance: (meters ~m)~%" (-> this ground-probe-distance)) + (format #t "~1Tground-probe-offset: (meters ~m)~%" (-> this ground-probe-offset)) + (format #t "~1Tcos-ground-effect-angle: ~f~%" (-> this cos-ground-effect-angle)) + (format #t "~1Tspring-lift-factor: ~f~%" (-> this spring-lift-factor)) + (format #t "~1Tair-steering-factor: ~f~%" (-> this air-steering-factor)) + (format #t "~1Tair-drag-factor: ~f~%" (-> this air-drag-factor)) + (format #t "~1Tsteering-fin-angle: ~f~%" (-> this steering-fin-angle)) + (format #t "~1Tsteering-thruster-factor: ~f~%" (-> this steering-thruster-factor)) + (format #t "~1Tsteering-thruster-max-gain: ~f~%" (-> this steering-thruster-max-gain)) + (format #t "~1Tsteering-thruster-half-gain-speed: (meters ~m)~%" (-> this steering-thruster-half-gain-speed)) + (format #t "~1Ttire-steering-angle: ~f~%" (-> this tire-steering-angle)) + (format #t "~1Ttire-steering-speed-factor: ~f~%" (-> this tire-steering-speed-factor)) + (format #t "~1Ttire-steering-speed-bias: ~f~%" (-> this tire-steering-speed-bias)) + (format #t "~1Tackermann-factor: ~f~%" (-> this ackermann-factor)) + (format #t "~1Ttire-friction-factor: ~f~%" (-> this tire-friction-factor)) + (format #t "~1Ttire-static-friction: ~f~%" (-> this tire-static-friction)) + (format #t "~1Ttire-static-friction-speed: (meters ~m)~%" (-> this tire-static-friction-speed)) + (format #t "~1Ttire-dynamic-friction: ~f~%" (-> this tire-dynamic-friction)) + (format #t "~1Ttire-dynamic-friction-speed: (meters ~m)~%" (-> this tire-dynamic-friction-speed)) + (format #t "~1Ttire-inv-max-friction-speed: ~f~%" (-> this tire-inv-max-friction-speed)) + (format #t "~1Tairfoil-factor: ~f~%" (-> this airfoil-factor)) + (format #t "~1Tdrag-force-factor: ~f~%" (-> this drag-force-factor)) + (format #t "~1Trolling-resistance: ~f~%" (-> this rolling-resistance)) + (format #t "~1Tspeed-scrubbing-drag: ~f~%" (-> this speed-scrubbing-drag)) + (format #t "~1Tspeed-limiting-drag: ~f~%" (-> this speed-limiting-drag)) + (format #t "~1Tpitch-control-factor: ~f~%" (-> this pitch-control-factor)) + (format #t "~1Troll-control-factor: ~f~%" (-> this roll-control-factor)) + (format #t "~1Troll-angle: ~f~%" (-> this roll-angle)) + (format #t "~1Tjump-thrust-factor: ~f~%" (-> this jump-thrust-factor)) + (format #t "~1Tbuoyancy-factor: ~f~%" (-> this buoyancy-factor)) + (format #t "~1Twater-drag-factor: ~f~%" (-> this water-drag-factor)) + (format #t "~1Tplayer-weight: ~f~%" (-> this player-weight)) + (format #t "~1Tplayer-shift-x: (meters ~m)~%" (-> this player-shift-x)) + (format #t "~1Tplayer-shift-z: (meters ~m)~%" (-> this player-shift-z)) + (format #t "~1Tair-roll-torque: ~f~%" (-> this air-roll-torque)) + (format #t "~1Tair-pitch-torque: ~f~%" (-> this air-pitch-torque)) + (format #t "~1Tair-angular-damping: ~f~%" (-> this air-angular-damping)) + (format #t "~1Thop-turn-torque: ~f~%" (-> this hop-turn-torque)) + (format #t "~1Tground-torque-scale: ~f~%" (-> this ground-torque-scale)) + (format #t "~1Tai-steering-factor: ~f~%" (-> this ai-steering-factor)) + (format #t "~1Tai-throttle-factor: ~f~%" (-> this ai-throttle-factor)) + (label cfg-4) + this + ) + +;; definition of type vehicle-physics-model-info +(deftype vehicle-physics-model-info (structure) + ((lift-thruster-count int8) + (roll-thruster-count int8) + (stabilizer-count int8) + (inv-lift-thruster-count float) + (lift-thruster-array vehicle-attach-point 4 :inline) + (roll-thruster-array vehicle-attach-point 2 :inline) + (stabilizer-array vehicle-attach-point 6 :inline) + (engine-thrust-local-pos vector :inline) + (brake-local-pos vector :inline) + (wheel-count int8) + (drive-wheel-count int8) + (front-wheel vehicle-wheel-info :inline) + (rear-wheel vehicle-wheel-info :inline) + ) + ) + +;; definition for method 3 of type vehicle-physics-model-info +(defmethod inspect ((this vehicle-physics-model-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-physics-model-info) + (format #t "~1Tlift-thruster-count: ~D~%" (-> this lift-thruster-count)) + (format #t "~1Troll-thruster-count: ~D~%" (-> this roll-thruster-count)) + (format #t "~1Tstabilizer-count: ~D~%" (-> this stabilizer-count)) + (format #t "~1Tinv-lift-thruster-count: ~f~%" (-> this inv-lift-thruster-count)) + (format #t "~1Tlift-thruster-array[4] @ #x~X~%" (-> this lift-thruster-array)) + (format #t "~1Troll-thruster-array[2] @ #x~X~%" (-> this roll-thruster-array)) + (format #t "~1Tstabilizer-array[6] @ #x~X~%" (-> this stabilizer-array)) + (format #t "~1Tengine-thrust-local-pos: #~%" (-> this engine-thrust-local-pos)) + (format #t "~1Tbrake-local-pos: #~%" (-> this brake-local-pos)) + (format #t "~1Twheel-count: ~D~%" (-> this wheel-count)) + (format #t "~1Tdrive-wheel-count: ~D~%" (-> this drive-wheel-count)) + (format #t "~1Tfront-wheel: #~%" (-> this front-wheel)) + (format #t "~1Trear-wheel: #~%" (-> this rear-wheel)) + (label cfg-4) + this + ) + +;; definition of type vehicle-camera-info +(deftype vehicle-camera-info (structure) + ((string-min-height meters) + (string-max-height meters) + (string-min-length meters) + (string-max-length meters) + (min-fov float) + (max-fov float) + (head-offset float) + (foot-offset float) + (normal-max-angle-offset float) + (air-max-angle-offset float) + (max-lookaround-speed float) + (look-pos-array vector 4 :inline) + (look-front vector :inline :overlay-at (-> look-pos-array 0)) + (look-left vector :inline :overlay-at (-> look-pos-array 1)) + (look-right vector :inline :overlay-at (-> look-pos-array 2)) + (look-rear vector :inline :overlay-at (-> look-pos-array 3)) + ) + ) + +;; definition for method 3 of type vehicle-camera-info +(defmethod inspect ((this vehicle-camera-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-camera-info) + (format #t "~1Tstring-min-height: (meters ~m)~%" (-> this string-min-height)) + (format #t "~1Tstring-max-height: (meters ~m)~%" (-> this string-max-height)) + (format #t "~1Tstring-min-length: (meters ~m)~%" (-> this string-min-length)) + (format #t "~1Tstring-max-length: (meters ~m)~%" (-> this string-max-length)) + (format #t "~1Tmin-fov: ~f~%" (-> this min-fov)) + (format #t "~1Tmax-fov: ~f~%" (-> this max-fov)) + (format #t "~1Thead-offset: ~f~%" (-> this head-offset)) + (format #t "~1Tfoot-offset: ~f~%" (-> this foot-offset)) + (format #t "~1Tnormal-max-angle-offset: ~f~%" (-> this normal-max-angle-offset)) + (format #t "~1Tair-max-angle-offset: ~f~%" (-> this air-max-angle-offset)) + (format #t "~1Tmax-lookaround-speed: ~f~%" (-> this max-lookaround-speed)) + (format #t "~1Tlook-pos-array[4] @ #x~X~%" (-> this look-pos-array)) + (format #t "~1Tlook-front: #~%" (-> this look-pos-array)) + (format #t "~1Tlook-left: #~%" (-> this look-left)) + (format #t "~1Tlook-right: #~%" (-> this look-right)) + (format #t "~1Tlook-rear: #~%" (-> this look-rear)) + (label cfg-4) + this + ) + +;; definition of type vehicle-sound-loop-info +(deftype vehicle-sound-loop-info (structure) + ((sound sound-name) + (speed float) + (min-speed float) + (max-speed float) + (pitch-offset float) + (pitch-scale float) + (min-pitch float) + (max-pitch float) + ) + ) + +;; definition for method 3 of type vehicle-sound-loop-info +;; INFO: Used lq/sq +(defmethod inspect ((this vehicle-sound-loop-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-sound-loop-info) + (format #t "~1Tsound: ~D~%" (-> this sound)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tmin-speed: ~f~%" (-> this min-speed)) + (format #t "~1Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~1Tpitch-offset: ~f~%" (-> this pitch-offset)) + (format #t "~1Tpitch-scale: ~f~%" (-> this pitch-scale)) + (format #t "~1Tmin-pitch: ~f~%" (-> this min-pitch)) + (format #t "~1Tmax-pitch: ~f~%" (-> this max-pitch)) + (label cfg-4) + this + ) + +;; definition of type vehicle-sound-info +(deftype vehicle-sound-info (structure) + ((engine-pitch-scale float) + (engine-pitch-offset float) + (engine-pitch-mod-amp float) + (engine-sound-select int8) + (thrust-sound sound-name :offset 16) + (scrape-sound sound-name) + (glance-sound sound-name) + (impact-sound sound-name) + (impact2-sound sound-name) + (explode-sound sound-name) + (explode2-sound sound-name) + (extra-sound sound-name) + (water-sound sound-name) + (jump-sound sound-name) + (turbo-sound sound-name) + (damage-sound sound-name) + (bank-replace pair) + (idle-rpm float) + (idle-pitch-scale float) + (idle-crossover-rpm float) + (engine-rpm float) + (engine-crossover-rpm float) + (start-sound sound-name :offset 240) + (stop-sound sound-name) + (idle-sound sound-name) + (engine-sound sound-name) + (engine-load-sound sound-name) + (susp-creak-sound sound-name) + (susp-bottom-out-sound sound-name) + (susp-speed-threshold float) + (tire-roll-sounds vehicle-sound-loop-info 4 :inline) + (tire-slide-sounds vehicle-sound-loop-info 2 :inline) + (tire-roll-hum-sound vehicle-sound-loop-info :inline :overlay-at (-> tire-roll-sounds 0)) + (tire-roll-dirt-sound vehicle-sound-loop-info :inline :offset 416) + (tire-roll-sand-sound vehicle-sound-loop-info :inline :offset 464) + (tire-roll-knobby-sound vehicle-sound-loop-info :inline :offset 512) + (tire-slide-road-sound vehicle-sound-loop-info :inline :overlay-at (-> tire-slide-sounds 0)) + (tire-slide-dirt-sound vehicle-sound-loop-info :inline :offset 608) + ) + ) + +;; definition for method 3 of type vehicle-sound-info +;; INFO: Used lq/sq +(defmethod inspect ((this vehicle-sound-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-sound-info) + (format #t "~1Tengine-pitch-scale: ~f~%" (-> this engine-pitch-scale)) + (format #t "~1Tengine-pitch-offset: ~f~%" (-> this engine-pitch-offset)) + (format #t "~1Tengine-pitch-mod-amp: ~f~%" (-> this engine-pitch-mod-amp)) + (format #t "~1Tengine-sound-select: ~D~%" (-> this engine-sound-select)) + (format #t "~1Tthrust-sound: ~g~%" (-> this thrust-sound)) + (format #t "~1Tscrape-sound: ~g~%" (-> this scrape-sound)) + (format #t "~1Tglance-sound: ~g~%" (-> this glance-sound)) + (format #t "~1Timpact-sound: ~g~%" (-> this impact-sound)) + (format #t "~1Timpact2-sound: ~g~%" (-> this impact2-sound)) + (format #t "~1Texplode-sound: ~g~%" (-> this explode-sound)) + (format #t "~1Texplode2-sound: ~g~%" (-> this explode2-sound)) + (format #t "~1Textra-sound: ~g~%" (-> this extra-sound)) + (format #t "~1Twater-sound: ~g~%" (-> this water-sound)) + (format #t "~1Tjump-sound: ~g~%" (-> this jump-sound)) + (format #t "~1Tturbo-sound: ~g~%" (-> this turbo-sound)) + (format #t "~1Tdamage-sound: ~g~%" (-> this damage-sound)) + (format #t "~1Tbank-replace: ~A~%" (-> this bank-replace)) + (format #t "~1Tidle-rpm: ~f~%" (-> this idle-rpm)) + (format #t "~1Tidle-pitch-scale: ~f~%" (-> this idle-pitch-scale)) + (format #t "~1Tidle-crossover-rpm: ~f~%" (-> this idle-crossover-rpm)) + (format #t "~1Tengine-rpm: ~f~%" (-> this engine-rpm)) + (format #t "~1Tengine-crossover-rpm: ~f~%" (-> this engine-crossover-rpm)) + (format #t "~1Tstart-sound: ~g~%" (-> this start-sound)) + (format #t "~1Tstop-sound: ~g~%" (-> this stop-sound)) + (format #t "~1Tidle-sound: ~g~%" (-> this idle-sound)) + (format #t "~1Tengine-sound: ~g~%" (-> this engine-sound)) + (format #t "~1Tengine-load-sound: ~g~%" (-> this engine-load-sound)) + (format #t "~1Tsusp-creak-sound: ~g~%" (-> this susp-creak-sound)) + (format #t "~1Tsusp-bottom-out-sound: ~g~%" (-> this susp-bottom-out-sound)) + (format #t "~1Tsusp-speed-threshold: ~f~%" (-> this susp-speed-threshold)) + (format #t "~1Ttire-roll-sounds[4] @ #x~X~%" (-> this tire-roll-sounds)) + (format #t "~1Ttire-slide-sounds[2] @ #x~X~%" (-> this tire-slide-sounds)) + (format #t "~1Ttire-roll-hum-sound: #~%" (-> this tire-roll-sounds)) + (format #t "~1Ttire-roll-dirt-sound: #~%" (-> this tire-roll-dirt-sound)) + (format #t "~1Ttire-roll-sand-sound: #~%" (-> this tire-roll-sand-sound)) + (format #t "~1Ttire-roll-knobby-sound: #~%" (-> this tire-roll-knobby-sound)) + (format #t "~1Ttire-slide-road-sound: #~%" (-> this tire-slide-sounds)) + (format #t "~1Ttire-slide-dirt-sound: #~%" (-> this tire-slide-dirt-sound)) + (label cfg-4) + this + ) + +;; definition of type vehicle-particle-info +(deftype vehicle-particle-info (structure) + ((headlight-count int8) + (taillight-count int8) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (headlight-local-pos vector 3 :inline) + (taillight-local-pos vector 2 :inline) + ) + ) + +;; definition for method 3 of type vehicle-particle-info +(defmethod inspect ((this vehicle-particle-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-particle-info) + (format #t "~1Theadlight-count: ~D~%" (-> this headlight-count)) + (format #t "~1Ttaillight-count: ~D~%" (-> this taillight-count)) + (format #t "~1Tthruster-flame-width: (meters ~m)~%" (-> this thruster-flame-width)) + (format #t "~1Tthruster-flame-length: (meters ~m)~%" (-> this thruster-flame-length)) + (format #t "~1Tthruster-local-pos[2] @ #x~X~%" (-> this thruster-local-pos)) + (format #t "~1Texhaust-local-pos[2] @ #x~X~%" (-> this exhaust-local-pos)) + (format #t "~1Texhaust-local-dir[2] @ #x~X~%" (-> this exhaust-local-dir)) + (format #t "~1Tsmoke-local-pos[2] @ #x~X~%" (-> this smoke-local-pos)) + (format #t "~1Tsmoke-local-vel[2] @ #x~X~%" (-> this smoke-local-vel)) + (format #t "~1Theadlight-local-pos[3] @ #x~X~%" (-> this headlight-local-pos)) + (format #t "~1Ttaillight-local-pos[2] @ #x~X~%" (-> this taillight-local-pos)) + (label cfg-4) + this + ) + +;; definition of type vehicle-section-info +(deftype vehicle-section-info (structure) + ((damage-seg-array uint64 3) + (damage-seg-count int8) + ) + :pack-me + ) + +;; definition for method 3 of type vehicle-section-info +(defmethod inspect ((this vehicle-section-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-section-info) + (format #t "~1Tdamage-seg-array[3] @ #x~X~%" (-> this damage-seg-array)) + (format #t "~1Tdamage-seg-count: ~D~%" (-> this damage-seg-count)) + (label cfg-4) + this + ) + +;; definition of type vehicle-damage-info +(deftype vehicle-damage-info (structure) + ((inv-toughness-factor float) + (hit-points float) + (inv-hit-points float) + (hit-threshold float) + (hit-small float) + (hit-big float) + (hit-deadly float) + (impact-damage-factor float) + (section-count int8) + (section-array vehicle-section-info 4 :inline) + (section-bike-front vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-bike-rear vehicle-section-info :inline :offset 72) + (section-car-front-left vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-car-rear-left vehicle-section-info :inline :overlay-at section-bike-rear) + (section-car-front-right vehicle-section-info :inline :offset 104) + (section-car-rear-right vehicle-section-info :inline :offset 136) + ) + ) + +;; definition for method 3 of type vehicle-damage-info +(defmethod inspect ((this vehicle-damage-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-damage-info) + (format #t "~1Tinv-toughness-factor: ~f~%" (-> this inv-toughness-factor)) + (format #t "~1Thit-points: ~f~%" (-> this hit-points)) + (format #t "~1Tinv-hit-points: ~f~%" (-> this inv-hit-points)) + (format #t "~1Thit-threshold: ~f~%" (-> this hit-threshold)) + (format #t "~1Thit-small: ~f~%" (-> this hit-small)) + (format #t "~1Thit-big: ~f~%" (-> this hit-big)) + (format #t "~1Thit-deadly: ~f~%" (-> this hit-deadly)) + (format #t "~1Timpact-damage-factor: ~f~%" (-> this impact-damage-factor)) + (format #t "~1Tsection-count: ~D~%" (-> this section-count)) + (format #t "~1Tsection-array[4] @ #x~X~%" (-> this section-array)) + (format #t "~1Tsection-bike-front: #~%" (-> this section-array)) + (format #t "~1Tsection-bike-rear: #~%" (-> this section-bike-rear)) + (format #t "~1Tsection-car-front-left: #~%" (-> this section-array)) + (format #t "~1Tsection-car-rear-left: #~%" (-> this section-bike-rear)) + (format #t "~1Tsection-car-front-right: #~%" (-> this section-car-front-right)) + (format #t "~1Tsection-car-rear-right: #~%" (-> this section-car-rear-right)) + (label cfg-4) + this + ) + +;; definition of type vehicle-setup-info +(deftype vehicle-setup-info (structure) + ((settle-height float) + (settle-rot-x float) + (shadow-bot-clip float) + (shadow-locus-dist float) + (look-select uint8) + (color-option-count int8) + (color-option-select int8) + (color vector) + (gun-yaw-min float) + (gun-yaw-max float) + (gun-pitch-min float) + (gun-pitch-max float) + (gun-z-offset float) + ) + :pack-me + ) + +;; definition for method 3 of type vehicle-setup-info +(defmethod inspect ((this vehicle-setup-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-setup-info) + (format #t "~1Tsettle-height: ~f~%" (-> this settle-height)) + (format #t "~1Tsettle-rot-x: ~f~%" (-> this settle-rot-x)) + (format #t "~1Tshadow-bot-clip: ~f~%" (-> this shadow-bot-clip)) + (format #t "~1Tshadow-locus-dist: ~f~%" (-> this shadow-locus-dist)) + (format #t "~1Tlook-select: ~D~%" (-> this look-select)) + (format #t "~1Tcolor-option-count: ~D~%" (-> this color-option-count)) + (format #t "~1Tcolor-option-select: ~D~%" (-> this color-option-select)) + (format #t "~1Tgun-yaw-min: ~f~%" (-> this gun-yaw-min)) + (format #t "~1Tgun-yaw-max: ~f~%" (-> this gun-yaw-max)) + (format #t "~1Tgun-pitch-min: ~f~%" (-> this gun-pitch-min)) + (format #t "~1Tgun-pitch-max: ~f~%" (-> this gun-pitch-max)) + (format #t "~1Tgun-z-offset: ~f~%" (-> this gun-z-offset)) + (label cfg-4) + this + ) + +;; definition of type vehicle-seat-info +(deftype vehicle-seat-info (structure) + ((data uint8 16) + (position vector :inline :overlay-at (-> data 0)) + (pos-x float :overlay-at (-> data 0)) + (pos-y float :overlay-at (-> data 4)) + (pos-z float :overlay-at (-> data 8)) + (angle int16 :overlay-at (-> data 12)) + (flags vehicle-seat-flag :overlay-at (-> data 14)) + ) + ) + +;; definition for method 3 of type vehicle-seat-info +(defmethod inspect ((this vehicle-seat-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-seat-info) + (format #t "~1Tdata[16] @ #x~X~%" (-> this position)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tpos-x: ~f~%" (-> this position x)) + (format #t "~1Tpos-y: ~f~%" (-> this position y)) + (format #t "~1Tpos-z: ~f~%" (-> this position z)) + (format #t "~1Tangle: ~D~%" (-> this angle)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition of type vehicle-grab-rail-info +(deftype vehicle-grab-rail-info (structure) + ((local-pos vector 2 :inline) + (normal vector :inline) + ) + ) + +;; definition for method 3 of type vehicle-grab-rail-info +(defmethod inspect ((this vehicle-grab-rail-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-grab-rail-info) + (format #t "~1Tlocal-pos[2] @ #x~X~%" (-> this local-pos)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (label cfg-4) + this + ) + +;; definition of type vehicle-rider-info +(deftype vehicle-rider-info (structure) + ((seat-count int8) + (rider-stance uint8) + (grab-rail-count int8) + (attach-point-count int8) + (grab-rail-array (pointer vehicle-grab-rail-info)) + (seat-array vehicle-seat-info 4 :inline) + (rider-hand-offset vector 2 :inline) + (attach-point-array (inline-array vehicle-attach-point)) + ) + ) + +;; definition for method 3 of type vehicle-rider-info +(defmethod inspect ((this vehicle-rider-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-rider-info) + (format #t "~1Tseat-count: ~D~%" (-> this seat-count)) + (format #t "~1Trider-stance: ~D~%" (-> this rider-stance)) + (format #t "~1Tgrab-rail-count: ~D~%" (-> this grab-rail-count)) + (format #t "~1Tattach-point-count: ~D~%" (-> this attach-point-count)) + (format #t "~1Tgrab-rail-array: #x~X~%" (-> this grab-rail-array)) + (format #t "~1Tseat-array[4] @ #x~X~%" (-> this seat-array)) + (format #t "~1Trider-hand-offset[2] @ #x~X~%" (-> this rider-hand-offset)) + (format #t "~1Tattach-point-array: #x~X~%" (-> this attach-point-array)) + (label cfg-4) + this + ) + +;; definition of type vehicle-explosion-info +(deftype vehicle-explosion-info (joint-exploder-static-params) + ((skel skeleton-group) + (skel-name string) + (anim int32) + ) + ) + +;; definition for method 3 of type vehicle-explosion-info +;; INFO: Used lq/sq +(defmethod inspect ((this vehicle-explosion-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjoints: ~A~%" (-> this joints)) + (format #t "~1Tcollide-spec: ~D~%" (-> this collide-spec)) + (format #t "~1Tart-level: ~A~%" (-> this art-level)) + (format #t "~1Tcollide-sound: ~D~%" (-> this collide-sound)) + (format #t "~1Tcollide-sound-interval: ~D~%" (-> this collide-sound-interval)) + (format #t "~1Tskel: ~A~%" (-> this skel)) + (format #t "~1Tskel-name: ~A~%" (-> this skel-name)) + (format #t "~1Tanim: ~D~%" (-> this anim)) + (label cfg-4) + this + ) + +;; definition of type vehicle-particle-common-info +(deftype vehicle-particle-common-info (structure) + ((sp-system2d sparticle-system) + (sp-system3d sparticle-system) + (part-thruster sparticle-launcher) + (part-thruster-x sp-field-init-spec) + (part-spec2 sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) + (headlight-glow-template sprite-glow-data) + (taillight-glow-template sprite-glow-data) + (thruster-glow-template sprite-glow-data) + ) + (:methods + (init! (_type_) none) + ) + ) + +;; definition for method 3 of type vehicle-particle-common-info +(defmethod inspect ((this vehicle-particle-common-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-particle-common-info) + (format #t "~1Theadlight-glow-template: #~%" (-> this headlight-glow-template)) + (format #t "~1Ttaillight-glow-template: #~%" (-> this taillight-glow-template)) + (format #t "~1Tthruster-glow-template: #~%" (-> this thruster-glow-template)) + (label cfg-4) + this + ) + +;; definition of type rigid-body-vehicle-constants +(deftype rigid-body-vehicle-constants (rigid-body-object-constants) + ((flags uint32) + (object-type uint8) + (guard-type uint8) + (vehicle-type vehicle-type-u8) + (engine vehicle-engine-info :inline) + (transmission vehicle-transmission-info :inline) + (handling vehicle-handling-info :inline) + (target-speed-offset meters) + (turning-accel meters) + (camera vehicle-camera-info :inline) + (sound vehicle-sound-info :inline) + (particles vehicle-particle-info :inline) + (damage vehicle-damage-info :inline) + (physics-model vehicle-physics-model-info :inline) + (setup vehicle-setup-info :inline) + (rider vehicle-rider-info :inline) + (explosion vehicle-explosion-info) + (explosion-part int32) + (debris debris-static-params) + (name-text text-id) + (particle-common vehicle-particle-common-info) + ) + (:methods + (init-part! (_type_) none) + ) + ) + +;; definition for method 3 of type rigid-body-vehicle-constants +(defmethod inspect ((this rigid-body-vehicle-constants)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'rigid-body-vehicle-constants) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tmass: ~f~%" (-> this info mass)) + (format #t "~1Tinv-mass: ~f~%" (-> this info inv-mass)) + (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> this info cm-offset-joint x)) + (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> this info cm-offset-joint y)) + (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> this info cm-offset-joint z)) + (format #t "~1Tlinear-damping: ~f~%" (-> this info linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> this info angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> this info bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> this info friction-factor)) + (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> this inertial-tensor-x)) + (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> this inertial-tensor-y)) + (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> this inertial-tensor-z)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tmax-time-step: ~f~%" (-> this extra max-time-step)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this extra gravity)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> this extra idle-distance)) + (format #t "~1Tattack-force-scale: ~f~%" (-> this extra attack-force-scale)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~1Tvehicle-type: ~D~%" (-> this vehicle-type)) + (format #t "~1Tengine: #~%" (-> this engine)) + (format #t "~1Ttransmission: #~%" (-> this transmission)) + (format #t "~1Thandling: #~%" (-> this handling)) + (format #t "~1Ttarget-speed-offset: (meters ~m)~%" (-> this target-speed-offset)) + (format #t "~1Tturning-accel: (meters ~m)~%" (-> this turning-accel)) + (format #t "~1Tcamera: #~%" (-> this camera)) + (format #t "~1Tsound: #~%" (-> this sound)) + (format #t "~1Tparticles: #~%" (-> this particles)) + (format #t "~1Tdamage: #~%" (-> this damage)) + (format #t "~1Tphysics-model: #~%" (-> this physics-model)) + (format #t "~1Tsetup: #~%" (-> this setup)) + (format #t "~1Trider: #~%" (-> this rider)) + (format #t "~1Texplosion: ~A~%" (-> this explosion)) + (format #t "~1Texplosion-part: ~D~%" (-> this explosion-part)) + (format #t "~1Tdebris: ~A~%" (-> this debris)) + (format #t "~1Tname-text: ~D~%" (-> this name-text)) + (format #t "~1Tparticle-common: #~%" (-> this particle-common)) + (label cfg-4) + this + ) + +;; definition of type vehicle-section +(deftype vehicle-section (structure) + ((damage float) + ) + :allow-misaligned + ) + +;; definition for method 3 of type vehicle-section +(defmethod inspect ((this vehicle-section)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-section) + (format #t "~1Tdamage: ~f~%" (-> this damage)) + (label cfg-4) + this + ) + +;; definition of type vehicle +(deftype vehicle (rigid-body-object) + ((info rigid-body-vehicle-constants :override) + (v-flags vehicle-flag :overlay-at flags) + (unknown-flags vehicle-flag :offset 296) + (squad squad-control) + (control-hook (function vehicle vehicle-controls)) + (controls vehicle-controls :inline) + (prev-controls vehicle-controls :inline) + (engine-power-factor float) + (force-scale float) + (target-distance2 meters) + (water-flags uint32) + (target-acceleration vector :inline) + (impact-pos vector :inline) + (impact-local-pos vector :inline) + (lin-acceleration vector :inline) + (hit-points float) + (damage-factor float) + (crash-level int8) + (force-level int8) + (traffic-hash-id int8) + (traffic-priority-id int8) + (power-fluctuation-factor float) + (power-level float) + (overlap-player-counter uint8) + (physics-counter uint8) + (cam-view int8) + (brake-factor float) + (cam-speed-interp float) + (camera-dist2 float) + (player-dist2 float) + (bound-radius float) + (rider-array handle 4) + (impact-proc handle) + (impact-pat uint32) + (impact-time uint32) + (prev-impact-time uint32) + (sent-attack-time uint32) + (air-time uint32) + (water-time uint32) + (offscreen-time uint32) + (crash-time uint32) + (turbo-boost-time uint32) + (player-dismount-time uint32) + (crash-duration uint16) + (turbo-boost-duration uint16) + (turbo-boost-factor float) + (crash-impulse float) + (water-height float) + (lights-factor float) + (outgoing-attack-id uint32) + (fog-fade float) + (scrape-sound-id sound-id) + (damage-zap-sound-id sound-id) + (scrape-sound-envelope float) + (exhaust-part-accum sparticle-launch-control 2) + (smoke-part-accum sparticle-launch-control 2) + (section-array vehicle-section 4 :inline) + ) + (:state-methods + inactive + waiting + player-control + crash + explode + die + ) + (:methods + (vehicle-method-62 (_type_) none) + (vehicle-method-63 (_type_) none) + (vehicle-method-64 (_type_) none) + (vehicle-method-65 (_type_) int) + (vehicle-method-66 (_type_ vector int) none) + (get-rider-in-seat (_type_ int) process) + (vehicle-method-68 (_type_) none) + (put-rider-in-seat (_type_ int process) none) + (vehicle-method-70 (_type_) none) + (get-best-seat (_type_ vector vehicle-seat-flag int) int) + (remove-riders (_type_ handle) none) + (vehicle-method-73 (_type_) none) + (vehicle-method-74 (_type_ int time-frame) none) + (vehicle-method-75 (_type_) none) + (vehicle-method-76 (_type_) none) + (vehicle-method-77 (_type_) none) + (vehicle-method-78 (_type_) none) + (vehicle-method-79 (_type_) none) + (vehicle-method-80 (_type_) none) + (vehicle-method-81 (_type_) none) + (vehicle-method-82 (_type_) none) + (vehicle-method-83 (_type_) none) + (vehicle-method-84 (_type_) none) + (vehicle-method-85 (_type_) none) + (vehicle-method-86 (_type_) none) + (vehicle-method-87 (_type_) none) + (vehicle-method-88 (_type_ vehicle-controls) none) + (init-reverse (_type_ vehicle-controls) none) + (control-hook-ai (_type_ vehicle-controls) none) + (control-hook-player (_type_ vehicle-controls) none) + (vehicle-method-92 (_type_ vehicle-controls) none) + (vehicle-method-93 (_type_) none) + (vehicle-method-94 (_type_) none) + (vehicle-method-95 (_type_ vector float) none) + (vehicle-method-96 (_type_ float) none) + (vehicle-method-97 (_type_ float vehicle-physics-work) none) + (vehicle-method-98 (_type_) none) + (vehicle-method-99 (_type_) none) + (vehicle-method-100 (_type_) none) + (vehicle-method-101 (_type_) none) + (vehicle-method-102 (_type_) symbol) + (vehicle-method-103 (_type_) none) + (vehicle-method-104 (_type_) none) + (vehicle-method-105 (_type_) none) + (vehicle-method-106 (_type_) none) + (vehicle-method-107 (_type_ int process) none) + (vehicle-method-108 (_type_ int) none) + (vehicle-method-109 (_type_) none) + (vehicle-method-110 (_type_) none) + (get-linear-accel! (_type_ vector) none) + (copy-vehicle-controls! (_type_ vehicle-controls) none) + (vehicle-method-113 (_type_ vector int int) none) + (vehicle-method-114 (_type_ int) none) + (vehicle-method-115 (_type_) none) + (vehicle-method-116 (_type_ symbol) none) + (vehicle-method-117 (_type_) none) + (vehicle-method-118 (_type_) none) + (vehicle-method-119 (_type_) none) + (apply-gravity (_type_ float) none) + (apply-gravity1 (_type_ float) none) + (vehicle-method-122 (_type_) none) + (vehicle-method-123 (_type_) none) + (vehicle-method-124 (_type_) none) + (vehicle-method-125 (_type_) none) + (vehicle-method-126 (_type_) none) + (check-player-get-on (_type_ process-focusable) symbol) + (vehicle-method-128 (_type_) symbol) + (vehicle-method-129 (_type_) none) + (vehicle-method-130 (_type_) none) + (vehicle-method-131 (_type_) none) + (vehicle-method-132 (_type_ traffic-object-spawn-params) none) + (vehicle-method-133 (_type_) none) + (vehicle-method-134 (_type_) none) + (vehicle-method-135 (_type_) none) + (vehicle-method-136 (_type_) none) + (vehicle-method-137 (_type_) none) + (vehicle-method-138 (_type_) none) + (vehicle-method-139 (_type_) none) + (vehicle-method-140 (_type_) none) + (vehicle-method-141 (_type_) symbol) + (vehicle-method-142 (_type_) none) + (vehicle-method-143 (_type_ process) object) + (vehicle-method-144 (_type_) none) + (vehicle-method-145 (_type_) none) + (vehicle-method-146 (_type_ vector) none) + (vehicle-method-147 (_type_) none) + (vehicle-method-148 (_type_) none) + (vehicle-method-149 (_type_) none) + (vehicle-method-150 (_type_) none) + (set-hit-points (_type_ float) none) + ) + ) + +;; definition for method 3 of type vehicle +(defmethod inspect ((this vehicle)) + (when (not this) + (set! this this) + (goto cfg-108) + ) + (let ((t9-0 (method-of-type rigid-body-object inspect))) + (t9-0 this) + ) + (format #t "~2Tflags: #x~X : (vehicle-flag " (-> this v-flags)) + (let ((s5-0 (-> this v-flags))) + (if (= (logand (vehicle-flag lights-update) s5-0) (shl 512 32)) + (format #t "lights-update ") + ) + (if (= (logand (vehicle-flag camera-bike-mode) s5-0) (vehicle-flag camera-bike-mode)) + (format #t "camera-bike-mode ") + ) + (if (= (logand s5-0 (vehicle-flag dead)) (vehicle-flag dead)) + (format #t "dead ") + ) + (if (= (logand s5-0 (vehicle-flag impact)) (vehicle-flag impact)) + (format #t "impact ") + ) + (if (= (logand (vehicle-flag waiting-for-player) s5-0) (vehicle-flag waiting-for-player)) + (format #t "waiting-for-player ") + ) + (if (= (logand (vehicle-flag no-hijack) s5-0) (shl 2048 32)) + (format #t "no-hijack ") + ) + (if (= (logand (vehicle-flag turbo-boost) s5-0) (vehicle-flag turbo-boost)) + (format #t "turbo-boost ") + ) + (if (= (logand (vehicle-flag in-pursuit) s5-0) (shl 4 32)) + (format #t "in-pursuit ") + ) + (if (= (logand (vehicle-flag traffic-managed) s5-0) (vehicle-flag traffic-managed)) + (format #t "traffic-managed ") + ) + (if (= (logand s5-0 (vehicle-flag damaged)) (vehicle-flag damaged)) + (format #t "damaged ") + ) + (if (= (logand s5-0 (vehicle-flag player-contact-force)) (vehicle-flag player-contact-force)) + (format #t "player-contact-force ") + ) + (if (= (logand (vehicle-flag camera-look-mode) s5-0) (shl 1 32)) + (format #t "camera-look-mode ") + ) + (if (= (logand s5-0 (vehicle-flag player-grabbed)) (vehicle-flag player-grabbed)) + (format #t "player-grabbed ") + ) + (if (= (logand (vehicle-flag flight-level-transition-ending) s5-0) (vehicle-flag flight-level-transition-ending)) + (format #t "flight-level-transition-ending ") + ) + (if (= (logand (vehicle-flag alert) s5-0) (shl 2 32)) + (format #t "alert ") + ) + (if (= (logand s5-0 (vehicle-flag disturbed)) (vehicle-flag disturbed)) + (format #t "disturbed ") + ) + (if (= (logand s5-0 (vehicle-flag enable-collision)) (vehicle-flag enable-collision)) + (format #t "enable-collision ") + ) + (if (= (logand s5-0 (vehicle-flag player-edge-grabbing)) (vehicle-flag player-edge-grabbing)) + (format #t "player-edge-grabbing ") + ) + (if (= (logand (vehicle-flag lights-on) s5-0) (shl 256 32)) + (format #t "lights-on ") + ) + (if (= (logand (vehicle-flag reverse-gear) s5-0) (vehicle-flag reverse-gear)) + (format #t "reverse-gear ") + ) + (if (= (logand (vehicle-flag net-player-driving) s5-0) (vehicle-flag net-player-driving)) + (format #t "net-player-driving ") + ) + (if (= (logand (vehicle-flag ai-driving) s5-0) (vehicle-flag ai-driving)) + (format #t "ai-driving ") + ) + (if (= (logand s5-0 (vehicle-flag persistent)) (vehicle-flag persistent)) + (format #t "persistent ") + ) + (if (= (logand s5-0 (vehicle-flag riding)) (vehicle-flag riding)) + (format #t "riding ") + ) + (if (= (logand s5-0 (vehicle-flag on-flight-level)) (vehicle-flag on-flight-level)) + (format #t "on-flight-level ") + ) + (if (= (logand (vehicle-flag nav-spheres) s5-0) (vehicle-flag nav-spheres)) + (format #t "nav-spheres ") + ) + (if (= (logand (vehicle-flag particles) s5-0) (shl 64 32)) + (format #t "particles ") + ) + (if (= (logand (vehicle-flag player-driving) s5-0) (vehicle-flag player-driving)) + (format #t "player-driving ") + ) + (if (= (logand (vehicle-flag camera-rapid-tracking-mode) s5-0) (vehicle-flag camera-rapid-tracking-mode)) + (format #t "camera-rapid-tracking-mode ") + ) + (if (= (logand (vehicle-flag ignore-damage) s5-0) (shl #x10000 32)) + (format #t "ignore-damage ") + ) + (if (= (logand (vehicle-flag ignition) s5-0) (vehicle-flag ignition)) + (format #t "ignition ") + ) + (if (= (logand (vehicle-flag ignore-impulse) s5-0) (shl #x20000 32)) + (format #t "ignore-impulse ") + ) + (if (= (logand (vehicle-flag tracking-mode) s5-0) (shl 8192 32)) + (format #t "tracking-mode ") + ) + (if (= (logand s5-0 (vehicle-flag on-ground)) (vehicle-flag on-ground)) + (format #t "on-ground ") + ) + (if (= (logand (vehicle-flag flight-level-transition) s5-0) (vehicle-flag flight-level-transition)) + (format #t "flight-level-transition ") + ) + (if (= (logand (vehicle-flag sounds) s5-0) (shl 32 32)) + (format #t "sounds ") + ) + (if (= (logand (vehicle-flag joints) s5-0) (shl 128 32)) + (format #t "joints ") + ) + (if (= (logand (vehicle-flag lights-dead) s5-0) (shl 1024 32)) + (format #t "lights-dead ") + ) + (if (= (logand s5-0 (vehicle-flag player-touching)) (vehicle-flag player-touching)) + (format #t "player-touching ") + ) + (if (= (logand (vehicle-flag target-in-sight) s5-0) (shl 8 32)) + (format #t "target-in-sight ") + ) + (if (= (logand s5-0 (vehicle-flag in-air)) (vehicle-flag in-air)) + (format #t "in-air ") + ) + (if (= (logand (vehicle-flag player-killed) s5-0) (shl #x40000 32)) + (format #t "player-killed ") + ) + (if (= (logand (vehicle-flag player-dismounting) s5-0) (vehicle-flag player-dismounting)) + (format #t "player-dismounting ") + ) + (if (= (logand (vehicle-flag draw-marks) s5-0) (shl #x80000 32)) + (format #t "draw-marks ") + ) + (if (= (logand (vehicle-flag camera) s5-0) (vehicle-flag camera)) + (format #t "camera ") + ) + (if (= (logand s5-0 (vehicle-flag player-standing-on)) (vehicle-flag player-standing-on)) + (format #t "player-standing-on ") + ) + (if (= (logand (vehicle-flag overturned) s5-0) (shl #x4000 32)) + (format #t "overturned ") + ) + (if (= (logand s5-0 (vehicle-flag player-impulse-force)) (vehicle-flag player-impulse-force)) + (format #t "player-impulse-force ") + ) + (if (= (logand (vehicle-flag unique) s5-0) (shl 4096 32)) + (format #t "unique ") + ) + (if (= (logand (vehicle-flag rammed-target) s5-0) (shl 16 32)) + (format #t "rammed-target ") + ) + (if (= (logand (vehicle-flag camera-inside-view) s5-0) (shl #x8000 16)) + (format #t "camera-inside-view ") + ) + (if (= (logand (vehicle-flag gun-dark-2-zero-g) s5-0) (shl #x8000 32)) + (format #t "gun-dark-2-zero-g ") + ) + ) + (format #t ")~%") + (format #t "~2Tsquad: ~A~%" (-> this squad)) + (format #t "~2Tcontrol-hook: ~A~%" (-> this control-hook)) + (format #t "~2Tcontrols: #~%" (-> this controls)) + (format #t "~2Tprev-controls: #~%" (-> this prev-controls)) + (format #t "~2Tengine-power-factor: ~f~%" (-> this engine-power-factor)) + (format #t "~2Tforce-scale: ~f~%" (-> this force-scale)) + (format #t "~2Ttarget-distance2: (meters ~m)~%" (-> this target-distance2)) + (format #t "~2Twater-flags: ~D~%" (-> this water-flags)) + (format #t "~2Ttarget-acceleration: #~%" (-> this target-acceleration)) + (format #t "~2Timpact-pos: #~%" (-> this impact-pos)) + (format #t "~2Timpact-local-pos: #~%" (-> this impact-local-pos)) + (format #t "~2Tlin-acceleration: #~%" (-> this lin-acceleration)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tdamage-factor: ~f~%" (-> this damage-factor)) + (format #t "~2Tcrash-level: ~D~%" (-> this crash-level)) + (format #t "~2Tforce-level: ~D~%" (-> this force-level)) + (format #t "~2Ttraffic-hash-id: ~D~%" (-> this traffic-hash-id)) + (format #t "~2Ttraffic-priority-id: ~D~%" (-> this traffic-priority-id)) + (format #t "~2Tpower-fluctuation-factor: ~f~%" (-> this power-fluctuation-factor)) + (format #t "~2Tpower-level: ~f~%" (-> this power-level)) + (format #t "~2Toverlap-player-counter: ~D~%" (-> this overlap-player-counter)) + (format #t "~2Tphysics-counter: ~D~%" (-> this physics-counter)) + (format #t "~2Tcam-view: ~D~%" (-> this cam-view)) + (format #t "~2Tbrake-factor: ~f~%" (-> this brake-factor)) + (format #t "~2Tcam-speed-interp: ~f~%" (-> this cam-speed-interp)) + (format #t "~2Tcamera-dist2: ~f~%" (-> this camera-dist2)) + (format #t "~2Tplayer-dist2: ~f~%" (-> this player-dist2)) + (format #t "~2Tbound-radius: ~f~%" (-> this bound-radius)) + (format #t "~2Trider-array[4] @ #x~X~%" (-> this rider-array)) + (format #t "~2Timpact-proc: ~D~%" (-> this impact-proc)) + (format #t "~2Timpact-pat: ~D~%" (-> this impact-pat)) + (format #t "~2Timpact-time: ~D~%" (-> this impact-time)) + (format #t "~2Tprev-impact-time: ~D~%" (-> this prev-impact-time)) + (format #t "~2Tsent-attack-time: ~D~%" (-> this sent-attack-time)) + (format #t "~2Tair-time: ~D~%" (-> this air-time)) + (format #t "~2Twater-time: ~D~%" (-> this water-time)) + (format #t "~2Toffscreen-time: ~D~%" (-> this offscreen-time)) + (format #t "~2Tcrash-time: ~D~%" (-> this crash-time)) + (format #t "~2Tturbo-boost-time: ~D~%" (-> this turbo-boost-time)) + (format #t "~2Tplayer-dismount-time: ~D~%" (-> this player-dismount-time)) + (format #t "~2Tcrash-duration: ~D~%" (-> this crash-duration)) + (format #t "~2Tturbo-boost-duration: ~D~%" (-> this turbo-boost-duration)) + (format #t "~2Tturbo-boost-factor: ~f~%" (-> this turbo-boost-factor)) + (format #t "~2Tcrash-impulse: ~f~%" (-> this crash-impulse)) + (format #t "~2Twater-height: ~f~%" (-> this water-height)) + (format #t "~2Tlights-factor: ~f~%" (-> this lights-factor)) + (format #t "~2Toutgoing-attack-id: ~D~%" (-> this outgoing-attack-id)) + (format #t "~2Tfog-fade: ~f~%" (-> this fog-fade)) + (format #t "~2Tscrape-sound-id: ~D~%" (-> this scrape-sound-id)) + (format #t "~2Tdamage-zap-sound-id: ~D~%" (-> this damage-zap-sound-id)) + (format #t "~2Tscrape-sound-envelope: ~f~%" (-> this scrape-sound-envelope)) + (format #t "~2Texhaust-part-accum[2] @ #x~X~%" (-> this exhaust-part-accum)) + (format #t "~2Tsmoke-part-accum[2] @ #x~X~%" (-> this smoke-part-accum)) + (format #t "~2Tsection-array[4] @ #x~X~%" (-> this section-array)) + (label cfg-108) + this + ) + +;; definition of type vehicle-probe-work +(deftype vehicle-probe-work (structure) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (probe-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (velocity vector :inline) + (tire-force vector :inline) + (wheel-axis vector :inline) + ) + ) + +;; definition for method 3 of type vehicle-probe-work +(defmethod inspect ((this vehicle-probe-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-probe-work) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-normal: #~%" (-> this local-normal)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Tprobe-pos: #~%" (-> this probe-pos)) + (format #t "~1Tground-pos: #~%" (-> this ground-pos)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Ttire-force: #~%" (-> this tire-force)) + (format #t "~1Twheel-axis: #~%" (-> this wheel-axis)) + (label cfg-4) + this + ) + +;; definition of type vehicle-physics-work +(deftype vehicle-physics-work (structure) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (lift-dir vector :inline) + (normal vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal vector :inline) + (impulse float) + (vel-dot-norm float) + (friction-coef float) + (speed-factor float) + (probe-work-array vehicle-probe-work 4 :inline) + ) + ) + +;; definition for method 3 of type vehicle-physics-work +(defmethod inspect ((this vehicle-physics-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-physics-work) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tforce: #~%" (-> this force)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tsteering-axis: #~%" (-> this steering-axis)) + (format #t "~1Tlift-dir: #~%" (-> this lift-dir)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Ttmp: #~%" (-> this tmp)) + (format #t "~1Tp-body: #~%" (-> this p-body)) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Timpulse: ~f~%" (-> this impulse)) + (format #t "~1Tvel-dot-norm: ~f~%" (-> this vel-dot-norm)) + (format #t "~1Tfriction-coef: ~f~%" (-> this friction-coef)) + (format #t "~1Tspeed-factor: ~f~%" (-> this speed-factor)) + (format #t "~1Tprobe-work-array[4] @ #x~X~%" (-> this probe-work-array)) + (label cfg-4) + this + ) + +;; definition of type vehicle-draw-thruster-params +(deftype vehicle-draw-thruster-params (structure) + ((quat quaternion :inline) + (trans vector :inline) + (thrust float) + (width float) + (length float) + (fog-fade float) + ) + ) + +;; definition for method 3 of type vehicle-draw-thruster-params +(defmethod inspect ((this vehicle-draw-thruster-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-draw-thruster-params) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tthrust: ~f~%" (-> this thrust)) + (format #t "~1Twidth: ~f~%" (-> this width)) + (format #t "~1Tlength: ~f~%" (-> this length)) + (format #t "~1Tfog-fade: ~f~%" (-> this fog-fade)) + (label cfg-4) + this + ) + +;; definition for function meters-per-sec->mph +(defun meters-per-sec->mph ((arg0 float)) + (* 0.00031568037 arg0) + ) + +;; definition of type debug-vehicle-work +(deftype debug-vehicle-work (basic) + ((impact-time time-frame) + (impact rigid-body-impact :inline) + (prim-sphere1 sphere :inline) + (prim-sphere2 sphere :inline) + ) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-part_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-part_REF.gc new file mode 100644 index 0000000000..51831fb418 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-part_REF.gc @@ -0,0 +1,752 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 916 + :init-specs ((:texture (common-white common)) + (:birth-func 'birth-func-laser-pointer) + (:num 1.0) + (:scale-x (meters 0.075) (meters 0.05)) + (:scale-y (meters 40)) + (:r 255.0) + (:g 0.0) + (:b :copy g) + (:a 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 917 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.15)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b :copy g) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 918 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0) + (:b :copy g) + (:a 48.0 16.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 919 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.025)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 32.0) + (:b :copy g) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 920 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0 2.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.025) (meters 0.01)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375) (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -0.85 -0.85) + (:fade-g -1.7 -1.7) + (:fade-b -8.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 921 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0 2.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.025) (meters 0.01)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375) (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -0.85 -0.85) + (:fade-g -1.7 -1.7) + (:fade-b -8.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 922 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y (meters 3)) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b :copy g) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 923 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 0.1 0.2) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 160.0) + (:b 96.0) + (:a 1.0 1.0) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.64) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.94) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.167)) + (:next-launcher 924) + ) + ) + +;; failed to figure out what this is: +(defpart 924 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 925 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 1.0 0.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 64.0 32.0) + (:vel-y (meters 0.00033333333) (meters 0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1)) + (:next-launcher 926) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 926 + :init-specs ((:scalevel-x (meters 0.005)) + (:scalevel-y :copy scalevel-x) + (:fade-r -8.5) + (:fade-g -4.266667) + (:fade-b 0.0) + (:next-time (seconds 0.1)) + (:next-launcher 927) + ) + ) + +;; failed to figure out what this is: +(defpart 927 + :init-specs ((:r 0.0 64.0) + (:g :copy r) + (:b :copy g) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.24615385 -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 928 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 0.4) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:vel-y (meters 0.00033333333) (meters 0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667 -4.266667) + (:fade-g :copy fade-r) + (:fade-b :copy fade-g) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1)) + (:next-launcher 929) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 929 + :init-specs ((:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.24615385 -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 930 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 1.0 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:vel-y (meters 0.00033333333) (meters 0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667 -4.266667) + (:fade-g :copy fade-r) + (:fade-b :copy fade-g) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.1)) + (:next-launcher 929) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-vehicle-explosion + :id 224 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 931 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 932 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 933 :period (seconds 3) :length (seconds 0.05)) + (sp-item 934 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 935 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 936 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 937 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 932 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 938) + ) + ) + +;; failed to figure out what this is: +(defpart 938 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 937 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 939) + (:conerot-x '*sp-temp*) + ) + ) + +;; failed to figure out what this is: +(defpart 936 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 939) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 939 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 940)) + ) + +;; failed to figure out what this is: +(defpart 940 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 941) + ) + ) + +;; failed to figure out what this is: +(defpart 941 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 942) + ) + ) + +;; failed to figure out what this is: +(defpart 942 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 931 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 943) + ) + ) + +;; failed to figure out what this is: +(defpart 943 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +;; failed to figure out what this is: +(defpart 935 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 944) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 944 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 945) + ) + ) + +;; failed to figure out what this is: +(defpart 945 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +;; failed to figure out what this is: +(defpart 933 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 946) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +;; failed to figure out what this is: +(defpart 946 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 947) + ) + ) + +;; failed to figure out what this is: +(defpart 947 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 934 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-vehicle-engine-start + :id 225 + :duration (seconds 0.535) + :linger-duration (seconds 1) + :flags (sp0 sp4 sp6) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 948 :flags (sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.535)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.335)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.235)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.135)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.067)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.05)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.035)) + (sp-item 949 :flags (sp7) :period (seconds 1) :length (seconds 0.017)) + (sp-item 950 :flags (sp7) :period (seconds 1) :length (seconds 0.035)) + (sp-item 951 :period (seconds 1) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 951 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:scalevel-x (meters 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -6.4) + (:fade-b -12.75) + (:fade-a -1.6) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 950 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 3.0 3.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.025) (meters 0.01)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375) (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -0.85 -0.85) + (:fade-g -1.7 -1.7) + (:fade-b -8.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 948 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 160.0) + (:b 96.0) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.0) + (:fade-g -1.0) + (:fade-b 1.0) + (:fade-a -0.21333334 -0.85333335) + (:accel-y (meters 0.00033333333) (meters 0.0005)) + (:friction 0.92 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.085)) + (:next-launcher 952) + (:conerot-x (degrees -30) (degrees 30)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 952 + :init-specs ((:fade-r 0.0 -0.85333335) (:fade-g :copy fade-r) (:fade-b :copy fade-g)) + ) + +;; failed to figure out what this is: +(defpart 949 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 160.0) + (:b 96.0) + (:a 32.0 32.0) + (:vel-y (meters 0.006666667) (meters 0.013333334)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.0) + (:fade-g -1.0) + (:fade-b 1.0) + (:fade-a -0.21333334 -0.85333335) + (:accel-y (meters 0.00033333333) (meters 0.0005)) + (:friction 0.92 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.085)) + (:next-launcher 952) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc new file mode 100644 index 0000000000..6632f520db --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc @@ -0,0 +1,92 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 95 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-95 ((this vehicle) (arg0 vector) (arg1 float)) + (let ((f0-1 (- (-> arg0 y) (-> arg0 w)))) + (when (< f0-1 (-> this water-height)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 rvec quad) (-> arg0 quad)) + (let ((s3-0 (-> this info)) + (f1-3 (fmin (-> this water-height) (+ (-> arg0 y) (-> arg0 w)))) + ) + 0.0 + (let* ((f2-4 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> arg0 y)) (-> arg0 w))))) + (f30-0 (+ 0.5 (* -0.25 f2-4 f2-4 f2-4) (* 0.75 f2-4))) + ) + (set! (-> s5-0 rvec y) (* 0.5 (+ f0-1 f1-3))) + (rigid-body-control-method-23 (-> this rbody) (-> s5-0 rvec) (-> s5-0 fvec)) + (let* ((f0-8 + (* 0.025132721 (vector-length (-> s5-0 fvec)) (-> s3-0 handling water-drag-factor) (-> s3-0 info mass) f30-0) + ) + (f1-7 (-> arg0 w)) + (f0-9 (* f0-8 (* f1-7 f1-7))) + (f1-10 68719480000.0) + (f0-11 (fmin (* f0-9 (/ 1.0 f1-10)) (* 0.125 (/ 1.0 arg1) (-> s3-0 info mass)))) + ) + (vector-float*! (-> s5-0 uvec) (-> s5-0 fvec) (* -1.0 f0-11)) + ) + (apply-impact! (-> this rbody) (-> s5-0 rvec) (-> s5-0 uvec)) + (vector-reset! (-> s5-0 uvec)) + (let ((f0-18 (* 514718.12 (-> s3-0 handling buoyancy-factor) f30-0 (-> arg0 w) (-> arg0 w) (-> arg0 w))) + (f1-21 68719480000.0) + ) + (set! (-> s5-0 uvec y) (* f0-18 (/ 1.0 f1-21))) + ) + ) + ) + (apply-impact! (-> this rbody) (-> s5-0 rvec) (-> s5-0 uvec)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 96 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-96 ((this vehicle) (arg0 float)) + (let ((s4-0 (-> this root root-prim)) + (s3-0 1) + ) + (when (< (-> this rbody position y) (+ (-> this water-height) (-> s4-0 local-sphere w))) + (when (zero? (-> s4-0 prim-core prim-type)) + (let ((v1-5 s4-0)) + (set! s4-0 (-> (the-as collide-shape-prim-group v1-5) child 0)) + (set! s3-0 (the-as int (-> v1-5 specific 0))) + ) + ) + (while (nonzero? s3-0) + (+! s3-0 -1) + (when (= (-> s4-0 prim-core prim-type) -1) + (let ((a1-1 (-> s4-0 prim-core))) + (if (< (- (-> a1-1 world-sphere y) (-> a1-1 world-sphere w)) (-> this water-height)) + (vehicle-method-95 this (the-as vector a1-1) arg0) + ) + ) + ) + (&+! s4-0 80) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 120 of type vehicle +(defmethod apply-gravity ((this vehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) + +;; definition for method 121 of type vehicle +(defmethod apply-gravity1 ((this vehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-states_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-states_REF.gc new file mode 100644 index 0000000000..cdfe6ff059 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-states_REF.gc @@ -0,0 +1,384 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate idle (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (disable-physics! self) + (go-virtual waiting) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate inactive (vehicle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('nav-mesh-kill 'traffic-activate 'traffic-off-force 'traffic-off 'rider-on 'rider-off) + (rbody-event-handler self proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self focus-status) (focus-status disable inactive)) + (disable-physics! self) + (rigid-body-object-method-43 self) + (vehicle-method-81 self) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (rigid-body-object-method-42 self) + (logclear! (-> self focus-status) (focus-status disable inactive)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate waiting (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-method-136 self) + (logior! (-> self v-flags) (vehicle-flag waiting-for-player nav-spheres)) + (logclear! (-> self v-flags) (vehicle-flag riding player-driving)) + (update-transforms (-> self root)) + (vehicle-method-140 self) + (let ((v1-13 (find-prim-by-id-logtest (-> self root) (the-as uint 32)))) + (when v1-13 + (set! (-> v1-13 prim-core collide-with) (collide-spec)) + (set! (-> v1-13 prim-core collide-as) (collide-spec)) + 0 + ) + ) + ) + :exit (behavior () + (logclear! (-> self v-flags) (vehicle-flag waiting-for-player)) + (let ((v1-3 (find-prim-by-id-logtest (-> self root) (the-as uint 32)))) + (when v1-3 + (set! (-> v1-3 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (vehicle-method-118 self) + ) + ) + +;; failed to figure out what this is: +(defstate player-control (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (when (!= (-> arg0 prim-core prim-type) 1) + (logior! (-> arg0 prim-core collide-as) (collide-spec jak)) + (logior! (-> arg0 prim-core collide-with) (collide-spec blocking-plane)) + ) + (none) + ) + ) + (vehicle-method-135 self) + (logior! (-> self v-flags) (vehicle-flag riding player-driving nav-spheres)) + (set! (-> self v-flags) + (the-as + vehicle-flag + (logclear (-> self v-flags) (vehicle-flag reverse-gear camera-inside-view camera-look-mode)) + ) + ) + (set! (-> self unknown-flags) + (the-as vehicle-flag (logclear (-> self unknown-flags) (vehicle-flag camera-inside-view))) + ) + (set! (-> self controls flags) (vehicle-controls-flag)) + (set! (-> self controls prev-flags) (vehicle-controls-flag)) + (set! (-> self control-hook) + (the-as (function vehicle vehicle-controls) (method-of-object self control-hook-player)) + ) + (set! (-> self max-time-step) 0.02) + (apply-momentum! self) + (vehicle-method-99 self) + (vehicle-method-80 self) + (logior! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) + 0 + ) + :exit (behavior () + (logclear! (-> self root penetrated-by) (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (when (!= (-> arg0 prim-core prim-type) 1) + (logclear! (-> arg0 prim-core collide-as) (collide-spec jak)) + (logclear! (-> arg0 prim-core collide-with) (collide-spec blocking-plane)) + ) + (none) + ) + ) + (if (and (not (logtest? (-> self info flags) 9216)) + (not (-> *setting-control* user-current pilot-death)) + (= (send-event *target* 'query 'mode) 'pilot) + ) + (send-event *target* 'end-mode 'pilot) + ) + (set! (-> self max-time-step) 0.033333335) + (vehicle-method-81 self) + (impulse-handler self) + (set! (-> self v-flags) + (the-as + vehicle-flag + (logclear (-> self v-flags) (vehicle-flag player-driving reverse-gear camera-inside-view camera-look-mode)) + ) + ) + (set! (-> self controls flags) (vehicle-controls-flag)) + (set! (-> self controls prev-flags) (vehicle-controls-flag)) + (remove-setting! 'sound-flava) + ) + :trans (behavior () + (set! (-> self v-flags) (the-as vehicle-flag (logclear (-> self v-flags) (vehicle-flag gun-dark-2-zero-g)))) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (not *target*) + (go-virtual waiting) + ) + (when (and (cpad-pressed? 0 triangle) (and (not (logtest? (-> self info flags) 1024)) + (-> *setting-control* user-current pilot-exit) + (not (focus-test? *target* dead hit grabbed)) + (!= (-> self crash-level) 3) + (< (-> self water-height) (-> self rbody position y)) + ) + ) + (when (send-event *target* 'end-mode 'pilot) + (let ((v1-32 (find-prim-by-id-logtest (-> self root) (the-as uint 64)))) + (if v1-32 + (set! (-> v1-32 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ) + (logior! (-> self v-flags) (vehicle-flag player-dismounting)) + (set! (-> self player-dismount-time) (the-as uint (current-time))) + (go-virtual waiting) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (local-vars (a0-3 int) (a0-5 int)) + (let* ((v1-1 (-> *perf-stats* data 18)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (vehicle-method-119 self) + (let ((v1-6 (-> *perf-stats* data 18))) + (b! (zero? (-> v1-6 ctrl)) cfg-4 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-3 pcr0) + (+! (-> v1-6 accum0) a0-3) + (.mfpc a0-5 pcr1) + (+! (-> v1-6 accum1) a0-5) + ) + (label cfg-4) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate crash (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (logclear! (-> self v-flags) (vehicle-flag player-driving net-player-driving)) + (set-time! (-> self state-time)) + (vehicle-method-124 self) + (set! (-> self crash-level) 3) + (vehicle-method-81 self) + (dotimes (gp-0 (-> self info rider seat-count)) + (send-event (handle->process (-> self rider-array gp-0)) 'vehicle-crash) + ) + ) + :trans (behavior () + (set! (-> self hit-points) (- (-> self hit-points) (* 0.5 (seconds-per-frame)))) + (if (and (time-elapsed? (-> self state-time) 1) (< (-> self hit-points) -0.25)) + (go-virtual explode) + ) + ) + :code sleep-code + :post (behavior () + (vehicle-method-117 self) + ) + ) + +;; definition for function vehicle-explode-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior vehicle-explode-post vehicle () + (local-vars (v1-42 float) (v1-47 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> self camera-dist2) (vector-vector-distance-squared (-> self root trans) (camera-pos))) + (set! (-> self player-dist2) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) + (cond + ((logtest? (-> self draw status) (draw-control-status on-screen)) + (set! (-> self offscreen-time) (the-as uint (current-time))) + ) + (else + (let ((v1-7 (new 'stack-no-clear 'array 'uint32 1))) + (set! (-> v1-7 0) (the-as uint (current-time))) + (if (or (>= (- (-> v1-7 0) (-> self offscreen-time)) (the-as uint 1500)) + (let ((f0-2 409600.0)) + (< (* f0-2 f0-2) (-> self camera-dist2)) + ) + ) + (go-virtual die) + ) + ) + ) + ) + (let ((f0-5 819200.0)) + (if (< (* f0-5 f0-5) (-> self camera-dist2)) + (go-virtual die) + ) + ) + (cond + ((logtest? (-> self rbody flags) (rigid-body-flag enable-physics)) + (vehicle-method-117 self) + (when (and (logtest? (-> self v-flags) (vehicle-flag disturbed)) (logtest? (-> self v-flags) (vehicle-flag impact))) + (let* ((f0-9 (* 0.0033333334 (the float (- (current-time) (-> self disturbed-time))))) + (f0-12 (* f0-9 f0-9 (-> self camera-dist2))) + (f1-5 0.000016276043) + (f0-13 (* f0-12 (* f1-5 f1-5))) + ) + (.lvf vf1 (&-> (-> self rbody ang-velocity) 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-42 vf1) + (if (and (< v1-42 f0-13) (begin + (.lvf vf1 (&-> (-> self rbody lin-velocity) 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-47 vf1) + (let ((f1-9 v1-47) + (f2-0 614.4) + ) + (< f1-9 (* f0-13 (* f2-0 f2-0))) + ) + ) + ) + (logclear! (-> self v-flags) (vehicle-flag disturbed)) + ) + ) + ) + (when (not (vehicle-method-102 self)) + (disable-physics! self) + (let ((gp-2 (-> self rbody))) + (logclear! (-> gp-2 flags) (rigid-body-flag enable-physics active)) + (vehicle-method-142 self) + (set! (-> gp-2 force quad) (the-as uint128 0)) + (set! (-> gp-2 torque quad) (the-as uint128 0)) + ) + 0 + (logior! (-> self v-flags) (vehicle-flag nav-spheres)) + (vehicle-method-140 self) + ) + ) + (else + (rigid-body-object-method-30 self) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate explode (vehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-method-116 self 'big-explosion) + (logior! (-> self focus-status) (focus-status dead)) + (set! (-> self crash-level) 3) + (set! (-> self force-level) 3) + (logclear! (-> self v-flags) (vehicle-flag persistent player-driving net-player-driving)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-dead) (-> self v-flags)))) + (vehicle-method-126 self) + (sound-play-by-name (-> self info sound explode-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + (sound-play-by-name (-> self info sound explode2-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + (vehicle-method-106 self) + (vehicle-method-136 self) + (vehicle-method-100 self) + ) + :code sleep-code + :post (behavior () + (vehicle-explode-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (vehicle) + :virtual #t + :code (behavior () + (cond + ((logtest? (vehicle-flag traffic-managed) (-> self v-flags)) + (send-event (ppointer->process (-> self parent)) 'child-killed) + (vehicle-method-109 self) + ) + (else + (cleanup-for-death self) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc new file mode 100644 index 0000000000..6e10be9b17 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -0,0 +1,1449 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type rigid-body-vehicle-constants +;; WARN: Return type mismatch int vs none. +(defmethod init-part! ((this rigid-body-vehicle-constants)) + (set! (-> this particle-common) *vehicle-particle-common-info*) + (init! (-> this particle-common)) + 0 + (none) + ) + +;; definition of type vehicle-hud-request +(deftype vehicle-hud-request (structure) + ((handle handle) + (hack-handle-init symbol :overlay-at handle) + (priority float) + ) + :pack-me + ) + +;; definition for method 3 of type vehicle-hud-request +(defmethod inspect ((this vehicle-hud-request)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-hud-request) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Thack-handle-init: ~A~%" (-> this hack-handle-init)) + (format #t "~1Tpriority: ~f~%" (-> this priority)) + (label cfg-4) + this + ) + +;; definition of type vehicle-hud-requests +(deftype vehicle-hud-requests (structure) + ((time time-frame) + (requests vehicle-hud-request 4 :inline) + ) + :pack-me + (:methods + (vehicle-hud-requests-method-9 (_type_) none) + (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) + (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request) + ) + ) + +;; definition for method 3 of type vehicle-hud-requests +(defmethod inspect ((this vehicle-hud-requests)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-hud-requests) + (format #t "~1Ttime: ~D~%" (-> this time)) + (format #t "~1Trequests[4] @ #x~X~%" (-> this requests)) + (label cfg-4) + this + ) + +;; definition for method 9 of type vehicle-hud-requests +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-hud-requests-method-9 ((this vehicle-hud-requests)) + (dotimes (v1-0 4) + (let ((a1-2 (-> this requests v1-0))) + (set! (-> a1-2 handle) (the-as handle #f)) + (set! (-> a1-2 priority) 0.0) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type vehicle-hud-requests +(defmethod vehicle-hud-requests-method-10 ((this vehicle-hud-requests)) + (let ((v1-0 0)) + (let ((f0-0 0.0)) + (countdown (a1-0 4) + (let ((a2-2 (-> this requests a1-0))) + (when (and (handle->process (-> a2-2 handle)) (< f0-0 (-> a2-2 priority))) + (set! v1-0 a1-0) + (set! f0-0 (-> a2-2 priority)) + ) + ) + ) + ) + (-> this requests v1-0) + ) + ) + +;; definition for method 11 of type vehicle-hud-requests +(defmethod vehicle-hud-requests-method-11 ((this vehicle-hud-requests)) + (let ((v1-0 0)) + (let ((f0-0 (the-as float #x7f800000)) + (a1-1 4) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-1) + (+! a1-1 -1) + (let ((a2-2 (-> this requests a1-1))) + (b! (handle->process (-> a2-2 handle)) cfg-8 :delay (empty-form)) + (set! v1-0 a1-1) + (set! (-> a2-2 priority) 0.0) + (b! #t cfg-12 :delay (nop!)) + (label cfg-8) + (when (< (-> a2-2 priority) f0-0) + (set! v1-0 a1-1) + (set! f0-0 (-> a2-2 priority)) + ) + ) + (label cfg-10) + (b! (nonzero? a1-1) cfg-1 :delay (nop!)) + ) + (label cfg-12) + (-> this requests v1-0) + ) + ) + +;; definition of type vehicle-hud-chooser +(deftype vehicle-hud-chooser (structure) + ((cur vehicle-hud-requests :inline) + (last vehicle-hud-requests :inline) + ) + (:methods + (vehicle-hud-chooser-method-9 (_type_ handle float) symbol) + ) + ) + +;; definition for method 3 of type vehicle-hud-chooser +(defmethod inspect ((this vehicle-hud-chooser)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-hud-chooser) + (format #t "~1Tcur: #~%" (-> this cur)) + (format #t "~1Tlast: #~%" (-> this last)) + (label cfg-4) + this + ) + +;; definition for method 9 of type vehicle-hud-chooser +(defmethod vehicle-hud-chooser-method-9 ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) + (let ((s3-0 (current-time))) + (when (!= s3-0 (-> this cur time)) + (if (zero? (-> this cur time)) + (vehicle-hud-requests-method-9 (-> this cur)) + ) + (mem-copy! (the-as pointer (-> this last)) (the-as pointer (-> this cur)) 72) + (set! (-> this cur time) s3-0) + (vehicle-hud-requests-method-9 (-> this cur)) + ) + ) + (let ((v1-10 (vehicle-hud-requests-method-11 (-> this cur)))) + (when (< (-> v1-10 priority) arg1) + (set! (-> v1-10 handle) arg0) + (set! (-> v1-10 priority) arg1) + ) + ) + (let ((s4-1 #f)) + (let ((v1-12 (vehicle-hud-requests-method-10 (-> this last)))) + (if (and (handle->process arg0) (= (-> v1-12 handle) arg0)) + (set! s4-1 #t) + ) + ) + s4-1 + ) + ) + +;; definition for symbol *vehicle-hud-chooser*, type vehicle-hud-chooser +(define *vehicle-hud-chooser* (new 'static 'vehicle-hud-chooser)) + +;; definition for symbol *pilot-edge-grab-info*, type pilot-edge-grab-info +(define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info)) + +;; definition for method 10 of type vehicle +(defmethod deactivate ((this vehicle)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (vehicle-method-106 this) + (call-parent-method this) + (none) + ) + +;; definition for method 11 of type vehicle +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition for method 37 of type vehicle +(defmethod rigid-body-object-method-37 ((this vehicle)) + (let ((t9-0 (method-of-type rigid-body-object rigid-body-object-method-37))) + (t9-0 this) + ) + (cond + ((logtest? #x10000 (-> this info flags)) + (set! (-> this rbody force-callback) (method-of-object this apply-gravity)) + ) + ((logtest? #x20000 (-> this info flags)) + (set! (-> this rbody force-callback) (method-of-object this apply-gravity1)) + ) + ) + (vehicle-method-62 this) + (init-part! (-> this info)) + (none) + ) + +;; definition for method 127 of type vehicle +(defmethod check-player-get-on ((this vehicle) (arg0 process-focusable)) + (with-pp + (and (not (focus-test? arg0 dead grabbed in-head under-water pole flut tube pilot)) + (or (not (focus-test? arg0 edge-grab)) (logtest? (-> this v-flags) (vehicle-flag player-edge-grabbing))) + (-> *setting-control* user-current pilot) + (let ((v1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-8 from) (process->ppointer pp)) + (set! (-> v1-8 num-params) 1) + (set! (-> v1-8 message) 'query) + (set! (-> v1-8 param 0) (the-as uint 'mode)) + (let ((v1-9 (send-event-function arg0 v1-8))) + (and (or (= v1-9 #f) (= v1-9 'board)) (or (logtest? (vehicle-flag waiting-for-player) (-> this v-flags)) + (-> *setting-control* user-current vehicle-hijacking) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 128 of type vehicle +(defmethod vehicle-method-128 ((this vehicle)) + #t + ) + +;; definition for method 129 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-129 ((this vehicle)) + (let ((f0-0 (-> this player-dist2)) + (f1-0 102400.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type0))) + (set! (-> s5-0 floats 4) (+ 8192.0 (-> this root root-prim local-sphere w))) + (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) + (set! (-> s5-0 floats 4) (* 1.5 (-> s5-0 floats 4))) + ) + (set! (-> s5-0 mat 0 uvec quad) (-> (target-pos 0) quad)) + (+! (-> s5-0 mat 0 uvec y) 8192.0) + (let* ((v1-14 (-> s5-0 mat 1)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-5 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-14 rvec quad) a0-5) + (set! (-> v1-14 uvec quad) a1-0) + (set! (-> v1-14 fvec quad) a2-0) + (set! (-> v1-14 trans quad) a3-1) + ) + (set! (-> s5-0 mat 0 fvec quad) (-> s5-0 mat 1 trans quad)) + (set! (-> s5-0 floats 2) (- (-> s5-0 mat 0 uvec y) (-> s5-0 mat 0 fvec y))) + (let ((f0-9 (vector-vector-xz-distance-squared (-> s5-0 mat 0 uvec) (-> s5-0 mat 0 fvec))) + (f1-7 (-> s5-0 floats 4)) + ) + (when (and (< f0-9 (* f1-7 f1-7)) + (< -81920.0 (-> s5-0 floats 2)) + (and (< (-> s5-0 floats 2) 20480.0) *target* (check-player-get-on this *target*)) + ) + (let ((s2-0 #f) + (s4-1 #f) + (s3-0 #f) + ) + (let ((a2-2 (get-best-seat this (-> s5-0 mat 0 uvec) (vehicle-seat-flag vsf0) 0))) + (when (!= a2-2 -1) + (vehicle-method-66 this (-> s5-0 mat 0 fvec) a2-2) + (vector+float*! (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 fvec) (-> s5-0 mat 1 uvec) 4096.0) + ) + ) + (set! (-> s5-0 floats 1) (vector-vector-distance-squared (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 uvec))) + (let ((f0-14 (-> s5-0 floats 1)) + (f1-12 81920.0) + ) + (when (< f0-14 (* f1-12 f1-12)) + (set! (-> s5-0 cquery start-pos quad) (-> s5-0 mat 0 uvec quad)) + (vector-! (-> s5-0 cquery move-dist) (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 uvec)) + (let ((v1-38 (-> s5-0 cquery))) + (set! (-> v1-38 radius) 4096.0) + (set! (-> v1-38 collide-with) + (collide-spec + backgnd + crate + civilian + enemy + obstacle + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + ) + ) + (set! (-> v1-38 ignore-process0) this) + (set! (-> v1-38 ignore-process1) #f) + (set! (-> v1-38 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-38 action-mask) (collide-action solid)) + ) + (set! s2-0 (< (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)) 0.0)) + 0 + ) + ) + (when s2-0 + (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> this v-flags) (vehicle-flag player-edge-grabbing))) + (not (logtest? (vehicle-flag no-hijack gun-dark-2-zero-g) (-> this v-flags))) + ) + (set! s4-1 #t) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) + ) + (when (and (not s4-1) + (and (< (-> s5-0 floats 2) -8192.0) (not (logtest? (-> *target* focus-status) (focus-status edge-grab)))) + ) + (matrix-4x4-inverse! (-> s5-0 mat 2) (-> s5-0 mat 1)) + (vector-matrix*! (the-as vector (-> s5-0 mat)) (-> s5-0 mat 0 uvec) (-> s5-0 mat 2)) + (set! (-> s5-0 floats 0) 81920.0) + (dotimes (s2-1 (-> this info rider grab-rail-count)) + (let ((s1-0 (&+ (-> this info rider grab-rail-array) (* 48 s2-1)))) + (vector-! (-> s5-0 mat 0 trans) (the-as vector (-> s5-0 mat)) (the-as vector (&+ s1-0 0))) + (when #t + (let ((f30-0 (vector-segment-distance-point! + (the-as vector (-> s5-0 mat)) + (the-as vector (&+ s1-0 0)) + (the-as vector (&+ s1-0 16)) + (-> s5-0 mat 0 trans) + ) + ) + ) + (when (< f30-0 (-> s5-0 floats 0)) + (set! (-> s5-0 floats 0) f30-0) + (set! (-> s5-0 vec 0 quad) (-> s5-0 mat 0 trans quad)) + (vector-! (-> s5-0 vec 1) (the-as vector (&+ s1-0 16)) (the-as vector (&+ s1-0 0))) + (vector-normalize! (-> s5-0 vec 1) 1.0) + (set! s3-0 #t) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 f30-0))) + ) + ) + ) + ) + 0 + ) + ) + (set! s3-0 (or s4-1 s3-0)) + (when (and s3-0 (and (vehicle-hud-chooser-method-9 *vehicle-hud-chooser* (process->handle this) (-> s5-0 floats 3)) + (can-display-query? this "vehicle" (/ 1.0 (-> s5-0 floats 3))) + ) + ) + (cond + ((vehicle-method-128 this) + (vehicle-method-144 this) + (when (cpad-pressed? 0 triangle) + (cond + (s4-1 + (when (send-event *target* 'change-mode 'pilot this 0 #f) + (logior! (-> this v-flags) (vehicle-flag player-driving)) + (logclear! (-> this v-flags) (vehicle-flag ai-driving)) + (vehicle-method-80 this) + ) + ) + (else + (set! (-> s5-0 proc 0) (process->handle this)) + (mem-copy! (the-as pointer *pilot-edge-grab-info*) (the-as pointer (-> s5-0 vec)) 40) + (if (send-event *target* 'pilot-edge-grab *pilot-edge-grab-info*) + (format 0 "vehicle::check-player-get-on: (send-event *target* 'pilot-edge-grab self)~%") + ) + ) + ) + ) + ) + (else + (vehicle-method-145 this) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (cond + ((and (logtest? (vehicle-flag player-driving) (-> this v-flags)) *target* (!= (-> this crash-level) 3)) + (if (focus-test? *target* pilot-riding) + (vehicle-method-134 this) + ) + ) + (else + (vehicle-method-81 this) + ) + ) + 0 + (none) + ) + +;; definition for method 144 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-144 ((this vehicle)) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 22 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((v1-1 gp-0)) + (set! (-> v1-1 width) (the float 350)) + ) + (let ((v1-2 gp-0)) + (set! (-> v1-2 height) (the float 80)) + ) + (let ((v1-3 gp-0) + (a0-5 (-> *setting-control* user-default language)) + ) + (set! (-> v1-3 scale) (if (or (= a0-5 (language-enum korean)) (= a0-5 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text + (lookup-text! *common-text* (text-id text-0083) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + 0 + (none) + ) + +;; definition for method 145 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-145 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 106 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-106 ((this vehicle)) + (sound-stop (-> this scrape-sound-id)) + (set! (-> this scrape-sound-envelope) 0.0) + 0 + (none) + ) + +;; definition for method 63 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-63 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 64 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-64 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 65 of type vehicle +(defmethod vehicle-method-65 ((this vehicle)) + (-> this info rider seat-count) + ) + +;; definition for method 66 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-66 ((this vehicle) (arg0 vector) (arg1 int)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> this info rider seat-array arg1 position quad)) + (set! (-> v1-0 w) 1.0) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) + ) + 0 + (none) + ) + +;; definition for method 67 of type vehicle +(defmethod get-rider-in-seat ((this vehicle) (arg0 int)) + (let ((v0-0 (the-as process #f))) + (if (< arg0 (-> this info rider seat-count)) + (set! v0-0 (handle->process (-> this rider-array arg0))) + ) + v0-0 + ) + ) + +;; definition for method 68 of type vehicle +;; WARN: Return type mismatch process vs none. +(defmethod vehicle-method-68 ((this vehicle)) + (let ((gp-0 (the-as process #f))) + (countdown (s4-0 (-> this info rider seat-count)) + (when (logtest? (-> this info rider seat-array s4-0 flags) (vehicle-seat-flag vsf0)) + (let ((v1-7 (get-rider-in-seat this s4-0))) + (if v1-7 + (set! gp-0 v1-7) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 71 of type vehicle +(defmethod get-best-seat ((this vehicle) (arg0 vector) (arg1 vehicle-seat-flag) (arg2 int)) + (let ((gp-0 -1)) + (let ((f30-0 (the-as float #x7f800000)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s0-0 (-> this info rider seat-count)) + (when (logtest? arg1 (-> this info rider seat-array s0-0 flags)) + (let ((v1-7 arg2)) + (when (cond + ((zero? v1-7) + #t + ) + ((= v1-7 1) + (not (get-rider-in-seat this s0-0)) + ) + ((= v1-7 2) + (get-rider-in-seat this s0-0) + ) + (else + #f + ) + ) + (vehicle-method-66 this s1-0 s0-0) + (let ((f0-0 (vector-vector-distance-squared arg0 s1-0))) + (when (< f0-0 f30-0) + (set! f30-0 f0-0) + (set! gp-0 s0-0) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 72 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod remove-riders ((this vehicle) (arg0 handle)) + (let ((v1-1 (-> this info rider seat-count))) + (dotimes (a2-0 v1-1) + (if (= arg0 (handle->process (-> this rider-array a2-0))) + (set! (-> this rider-array a2-0) (the-as handle #f)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 69 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod put-rider-in-seat ((this vehicle) (arg0 int) (arg1 process)) + (if (< arg0 (-> this info rider seat-count)) + (set! (-> this rider-array arg0) (process->handle arg1)) + ) + 0 + (none) + ) + +;; definition for method 113 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-113 ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector+! + v1-0 + (the-as vector (-> this info rider seat-array arg1)) + (-> this info rider rider-hand-offset arg2) + ) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) + ) + 0 + (none) + ) + +;; definition for method 70 of type vehicle +;; WARN: Return type mismatch uint vs none. +(defmethod vehicle-method-70 ((this vehicle)) + (-> this info rider rider-stance) + (none) + ) + +;; definition for method 73 of type vehicle +;; WARN: Return type mismatch float vs none. +(defmethod vehicle-method-73 ((this vehicle)) + (-> this controls steering) + (none) + ) + +;; definition for method 111 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod get-linear-accel! ((this vehicle) (arg0 vector)) + (set! (-> arg0 quad) (-> this lin-acceleration quad)) + 0 + (none) + ) + +;; definition for method 112 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod copy-vehicle-controls! ((this vehicle) (arg0 vehicle-controls)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> this controls)) 24) + 0 + (none) + ) + +;; definition for method 150 of type vehicle +;; WARN: Return type mismatch float vs none. +(defmethod vehicle-method-150 ((this vehicle)) + (-> this hit-points) + (none) + ) + +;; definition for method 151 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod set-hit-points ((this vehicle) (arg0 float)) + (set! (-> this hit-points) arg0) + 0 + (none) + ) + +;; definition for method 46 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod apply-damage ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) + (case (-> arg1 pat event) + (((pat-event melt)) + (set! arg0 (* 10.0 arg0)) + (format #t "vehicle::apply-damage: hit melt (damage ~f)~%" arg0) + ) + ) + (if (logtest? (vehicle-flag ignore-damage) (-> this v-flags)) + (set! arg0 0.0) + ) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (if (or (and (logtest? (game-secrets invulnerable) (-> *game-info* secrets)) (logtest? #x200000 (-> this info flags))) + *debug-player-vehicle-unkillable* + ) + (set! arg0 0.0) + ) + (if (logtest? (game-secrets vehicle-hit-points) (-> *game-info* secrets)) + (set! arg0 (* 0.5 arg0)) + ) + ) + (set! (-> this hit-points) (- (-> this hit-points) (* arg0 (-> this damage-factor)))) + (when (< (-> this hit-points) 0.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this crash-level) 3) + ) + (let ((s4-1 (-> arg1 prim-id)) + (s3-0 0) + ) + (while (nonzero? s4-1) + (when (and (logtest? s4-1 1) (< s3-0 (-> this info damage section-count))) + (let ((v1-37 (-> this section-array s3-0))) + (+! (-> v1-37 damage) (* 4.0 (-> this damage-factor) arg0)) + ) + (vehicle-method-114 this s3-0) + ) + (set! s4-1 (shr s4-1 1)) + (+! s3-0 1) + ) + ) + 0 + (none) + ) + +;; definition for method 114 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-114 ((this vehicle) (arg0 int)) + (let* ((v1-2 (-> this section-array arg0)) + (s4-0 (-> this info damage section-array arg0)) + (s5-1 + (max + 0 + (min (the int (* (-> v1-2 damage) (the float (-> s4-0 damage-seg-count)))) (+ (-> s4-0 damage-seg-count) -1)) + ) + ) + ) + (let ((a2-0 0)) + (dotimes (v1-6 (-> s4-0 damage-seg-count)) + (if (!= v1-6 s5-1) + (set! a2-0 (logior a2-0 (-> s4-0 damage-seg-array v1-6))) + ) + ) + (setup-masks (-> this draw) 0 a2-0) + ) + (setup-masks (-> this draw) (the-as int (-> s4-0 damage-seg-array s5-1)) 0) + (when (> s5-1 0) + (if (not (logtest? (vehicle-flag lights-dead) (-> this v-flags))) + (sound-play "headlight-pop") + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-dead) (-> this v-flags)))) + (vehicle-method-126 this) + ) + ) + 0 + (none) + ) + +;; definition for method 76 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-76 ((this vehicle)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag + disturbed + damaged + dead + player-touching + player-edge-grabbing + player-standing-on + persistent + impact + in-air + riding + player-driving + net-player-driving + ai-driving + waiting-for-player + ignition + turbo-boost + reverse-gear + flight-level-transition + alert + in-pursuit + target-in-sight + rammed-target + lights-on + lights-update + lights-dead + ) + ) + ) + ) + (set! (-> this unknown-flags) (-> this v-flags)) + (logior! (-> this rbody flags) (rigid-body-flag active)) + (logclear! (-> this focus-status) (focus-status disable dead inactive)) + (rigid-body-object-method-37 this) + (disable-physics! this) + (set! (-> this hit-points) 1.0) + (set! (-> this damage-factor) (-> this info damage inv-hit-points)) + (set! (-> this crash-level) 0) + (set! (-> this power-fluctuation-factor) 0.02) + (set! (-> this power-level) 1.0) + (set! (-> this lights-factor) 0.0) + (set-time! (-> this state-time)) + (let ((v1-19 (-> this info setup))) + (let ((a1-0 (-> v1-19 color-option-select))) + (set! (-> this draw color-mult quad) + (-> (the-as (pointer uint128) (+ (the-as uint (-> v1-19 color)) (* a1-0 16)))) + ) + ) + (+! (-> v1-19 color-option-select) 1) + (when (>= (-> v1-19 color-option-select) (-> v1-19 color-option-count)) + (set! (-> v1-19 color-option-select) 0) + 0 + ) + ) + (dotimes (s5-0 (-> this info damage section-count)) + (let ((v1-22 (-> this section-array s5-0))) + (set! (-> v1-22 damage) 0.0) + ) + (vehicle-method-114 this s5-0) + ) + 0 + (none) + ) + +;; definition for method 98 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-98 ((this vehicle)) + (set! (-> this hit-points) 1.0) + 0 + (none) + ) + +;; definition for method 130 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-130 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 74 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-74 ((this vehicle) (arg0 int) (arg1 time-frame)) + (when (< (-> this crash-level) arg0) + (set! (-> this crash-level) arg0) + (set! (-> this crash-duration) (the-as uint arg1)) + (set! (-> this crash-time) (the-as uint (current-time))) + (set! (-> this force-scale) 0.0) + ) + (when (and (>= 0.0 (-> this hit-points)) (!= (-> this crash-level) 3)) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this crash-level) 3) + (set! (-> this crash-duration) (the-as uint 1500)) + (set! (-> this crash-time) (the-as uint (current-time))) + ) + 0 + (none) + ) + +;; definition for method 75 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-75 ((this vehicle)) + (set! (-> this crash-level) 0) + 0 + (none) + ) + +;; definition for method 125 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-125 ((this vehicle)) + (if (not (logtest? (vehicle-flag lights-dead) (-> this v-flags))) + (set! (-> this v-flags) + (the-as vehicle-flag (logior (vehicle-flag lights-on lights-update) (-> this v-flags))) + ) + ) + 0 + (none) + ) + +;; definition for method 126 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-126 ((this vehicle)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag lights-on)))) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag lights-update) (-> this v-flags)))) + 0 + (none) + ) + +;; definition for method 135 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-135 ((this vehicle)) + (when (not (logtest? (vehicle-flag ignition) (-> this v-flags))) + (logior! (-> this v-flags) (vehicle-flag ignition)) + (sound-play-by-name (-> this info sound start-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + (let ((s5-1 (-> this node-list data 0 bone transform)) + (s4-1 (new 'stack-no-clear 'inline-array 'matrix 2)) + ) + (set-vector! (-> s4-1 0 fvec) 0.0 1.0 0.0 1.0) + (mem-copy! (the-as pointer (-> s4-1 1)) (the-as pointer s5-1) 64) + (dotimes (s3-0 2) + (vector-matrix*! (the-as vector (-> s4-1 0)) (-> this info particles exhaust-local-pos s3-0) s5-1) + (vector-rotate*! (-> s4-1 0 uvec) (-> this info particles exhaust-local-dir s3-0) s5-1) + (vector-cross! (-> s4-1 0 trans) (-> s4-1 0 uvec) (-> s4-1 0 fvec)) + (vector-normalize! (-> s4-1 0 trans) 1.0) + (vector-cross! (-> s4-1 1 fvec) (-> s4-1 0 trans) (-> s4-1 0 uvec)) + (set! (-> s4-1 1 rvec quad) (-> s4-1 0 trans quad)) + (set! (-> s4-1 1 uvec quad) (-> s4-1 0 uvec quad)) + (set! (-> s4-1 1 fvec quad) (-> s4-1 0 fvec quad)) + (set! (-> s4-1 1 trans quad) (-> s4-1 0 rvec quad)) + (if (logtest? (-> *part-group-id-table* 225 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 225) + :mat-joint (-> s4-1 1) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 225) + :mat-joint (-> s4-1 1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 136 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-136 ((this vehicle)) + (if (logtest? (vehicle-flag ignition) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag ignition)) + ) + 0 + (none) + ) + +;; definition for method 137 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-137 ((this vehicle)) + (let ((a0-2 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) + (when a0-2 + (add-process-drawable-to-nav-mesh a0-2 this #t) + (vehicle-method-139 this) + ) + ) + 0 + (none) + ) + +;; definition for method 139 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-139 ((this vehicle)) + (logior! (-> this nav flags) (nav-control-flag display-marks)) + 0 + (none) + ) + +;; definition for method 138 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-138 ((this vehicle)) + (let ((v1-0 (-> this nav))) + (when v1-0 + (remove-process-drawable (-> v1-0 state mesh) this) + (set! (-> this nav) #f) + ) + ) + 0 + (none) + ) + +;; definition for method 141 of type vehicle +(defmethod vehicle-method-141 ((this vehicle)) + (or (logtest? (vehicle-flag dead waiting-for-player) (-> this v-flags)) + (and (logtest? (vehicle-flag player-driving net-player-driving ai-driving) (-> this v-flags)) + (not (logtest? (-> this v-flags) (vehicle-flag on-flight-level))) + ) + ) + ) + +;; definition for method 140 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-140 ((this vehicle)) + (let ((v1-1 (vehicle-method-141 this)) + (s5-0 (-> this nav)) + ) + (cond + (v1-1 + (cond + (s5-0 + (do-navigation-to-destination (-> s5-0 state) (-> this root trans)) + (when (not (logtest? (-> s5-0 state flags) (nav-state-flag in-mesh))) + (let ((a0-4 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) + (when (and a0-4 (!= a0-4 (-> s5-0 state mesh))) + (change-to a0-4 this) + (logclear! (-> this nav flags) (nav-control-flag output-sphere-hash)) + ) + ) + ) + ) + (else + (vehicle-method-137 this) + ) + ) + ) + (else + (if s5-0 + (vehicle-method-138 this) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 80 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-80 ((this vehicle)) + (when (not (logtest? (vehicle-flag camera) (-> this v-flags))) + (vehicle-method-82 this) + (logior! (-> this v-flags) (vehicle-flag camera)) + ) + 0 + (none) + ) + +;; definition for method 81 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-81 ((this vehicle)) + (when (logtest? (vehicle-flag camera) (-> this v-flags)) + (vehicle-method-83 this) + (logclear! (-> this v-flags) (vehicle-flag camera)) + ) + 0 + (none) + ) + +;; definition for method 82 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-82 ((this vehicle)) + (logclear! (-> this v-flags) (vehicle-flag camera-bike-mode camera-rapid-tracking-mode)) + (set! (-> this cam-speed-interp) 0.0) + (set-setting! 'string-min-height 'abs (-> this info camera string-min-height) 0) + (set-setting! 'string-max-height 'abs (-> this info camera string-max-height) 0) + (set-setting! 'head-offset 'abs (-> this info camera head-offset) 0) + (set-setting! 'foot-offset 'abs (-> this info camera foot-offset) 0) + (set-setting! 'target-height 'abs (meters 0) 0) + (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) + (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) + 0 + (none) + ) + +;; definition for method 83 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-83 ((this vehicle)) + (remove-setting! 'bike-mode) + (remove-setting! 'rapid-tracking) + (remove-setting! 'fov) + (remove-setting! 'string-camera-ceiling) + (remove-setting! 'string-camera-floor) + (remove-setting! 'string-min-height) + (remove-setting! 'string-max-height) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'extra-follow-height) + (remove-setting! 'head-offset) + (remove-setting! 'foot-offset) + (remove-setting! 'target-height) + (remove-setting! 'slave-options) + (remove-setting! 'vertical-follow-matches-camera) + (remove-setting! 'mode-name) + (remove-setting! 'butt-handle) + (remove-setting! 'lock-sound-camera-to-target) + (remove-setting! 'interp-time) + (vehicle-method-148 this) + 0 + (none) + ) + +;; definition for method 84 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-84 ((this vehicle)) + (when (not (logtest? (vehicle-flag camera-bike-mode) (-> this v-flags))) + (logior! (-> this v-flags) (vehicle-flag camera-bike-mode)) + (set-setting! 'bike-mode #f 0.0 0) + ) + 0 + (none) + ) + +;; definition for method 85 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-85 ((this vehicle)) + (when (logtest? (vehicle-flag camera-bike-mode) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag camera-bike-mode)) + (remove-setting! 'bike-mode) + ) + 0 + (none) + ) + +;; definition for method 86 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-86 ((this vehicle)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logior! (-> this v-flags) (vehicle-flag camera-rapid-tracking-mode)) + (set-setting! 'rapid-tracking #f 0.0 0) + ) + 0 + (none) + ) + +;; definition for method 87 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-87 ((this vehicle)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag camera-rapid-tracking-mode)) + (remove-setting! 'rapid-tracking) + ) + 0 + (none) + ) + +;; definition for method 42 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-42 ((this vehicle)) + (logior! (-> this v-flags) (vehicle-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> this root backup-collide-with)) + ) + 0 + (none) + ) + +;; definition for method 43 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-43 ((this vehicle)) + (logclear! (-> this v-flags) (vehicle-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + 0 + (none) + ) + +;; definition for method 99 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-99 ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + 0 + (none) + ) + +;; definition for method 100 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-100 ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) + (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + 0 + (none) + ) + +;; definition for method 148 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-148 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 147 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-147 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 40 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-momentum! ((this vehicle)) + (let ((s5-0 (-> this rbody))) + (when (not (logtest? (-> s5-0 flags) (rigid-body-flag enable-physics))) + (logior! (-> s5-0 flags) (rigid-body-flag enable-physics)) + (rigid-body-control-method-28 s5-0 (-> this root trans) (-> this root quat)) + (set! (-> s5-0 lin-velocity quad) (-> this root transv quad)) + (vector-float*! (-> s5-0 lin-momentum) (-> s5-0 lin-velocity) (-> this info info mass)) + (vector-reset! (-> s5-0 ang-momentum)) + (vector-reset! (-> this lin-acceleration)) + ) + ) + 0 + (none) + ) + +;; definition for method 41 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod disable-physics! ((this vehicle)) + (set! (-> this force-scale) 1.0) + (logclear! (-> this rbody flags) (rigid-body-flag enable-physics)) + (vehicle-method-106 this) + 0 + (none) + ) + +;; definition for method 107 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-107 ((this vehicle) (arg0 int) (arg1 process)) + (let ((a0-1 (-> this squad))) + (when (and a0-1 arg1) + (if #t + (squad-control-method-18 a0-1 arg0 arg1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 108 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-108 ((this vehicle) (arg0 int)) + (set-alert-level0 (-> this squad) arg0) + 0 + (none) + ) + +;; definition for method 44 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod impulse-handler ((this vehicle)) + (if (and (not (focus-test? this inactive)) + (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + ) + ((method-of-type rigid-body-object impulse-handler) this) + ) + 0 + (none) + ) + +;; definition for method 109 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-109 ((this vehicle)) + (vehicle-method-122 this) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) + 0 + (none) + ) + +;; definition for method 110 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-110 ((this vehicle)) + (if (focus-test? this inactive) + (vehicle-method-123 this) + ) + (go (method-of-object this active)) + 0 + (none) + ) + +;; definition for method 45 of type vehicle +;; WARN: Return type mismatch int vs object. +(defmethod go-active ((this vehicle)) + (go (method-of-object this waiting)) + 0 + ) + +;; definition for method 134 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-134 ((this vehicle)) + (go (method-of-object this player-control)) + 0 + (none) + ) + +;; definition for method 132 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-132 ((this vehicle) (arg0 traffic-object-spawn-params)) + (let ((v1-0 (-> arg0 behavior))) + (cond + ((= v1-0 1) + (vehicle-method-131 this) + (vehicle-method-109 this) + ) + ((zero? v1-0) + (go (method-of-object this idle)) + ) + ((= v1-0 4) + (go (method-of-object this player-control)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 124 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-124 ((this vehicle)) + (if (= this *debug-actor*) + (format #t "hook-dead~%") + ) + (logior! (-> this focus-status) (focus-status dead)) + (vehicle-method-136 this) + (set! (-> this v-flags) + (the-as vehicle-flag (logclear + (-> this v-flags) + (vehicle-flag riding player-driving net-player-driving in-pursuit target-in-sight) + ) + ) + ) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + 0 + (none) + ) + +;; definition for method 133 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-133 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 102 of type vehicle +(defmethod vehicle-method-102 ((this vehicle)) + (logtest? (vehicle-flag disturbed player-touching player-driving in-pursuit) (-> this v-flags)) + ) + +;; definition for method 142 of type vehicle +(defmethod vehicle-method-142 ((this vehicle)) + (reset-momentum! (-> this rbody)) + (none) + ) + +;; definition for method 103 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-103 ((this vehicle)) + (local-vars (v1-8 float) (v1-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) + (let* ((f0-0 (-> this camera-dist2)) + (f1-0 0.000024414063) + (f0-1 (* f0-0 (* f1-0 f1-0))) + ) + (.lvf vf1 (&-> (-> this rbody ang-velocity) 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-8 vf1) + (when (and (< v1-8 f0-1) (begin + (.lvf vf1 (&-> (-> this rbody lin-velocity) 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-13 vf1) + (let ((f1-4 v1-13) + (f2-0 614.4) + ) + (< f1-4 (* f0-1 (* f2-0 f2-0))) + ) + ) + ) + (logclear! (-> this v-flags) (vehicle-flag disturbed)) + (vehicle-method-142 this) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 79 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 115 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-115 ((this vehicle)) + (dotimes (s5-0 (-> this info rider seat-count)) + (let ((s4-0 (handle->process (-> this rider-array s5-0)))) + (when (and s4-0 (focus-test? (the-as process-focusable s4-0) pilot-riding)) + (vehicle-method-66 this (-> (the-as process-focusable s4-0) root trans) s5-0) + (set! (-> (the-as process-focusable s4-0) root transv quad) (-> this root transv quad)) + (let ((f0-1 (the float (-> this info rider seat-array s5-0 angle)))) + (quaternion-rotate-local-y! (-> (the-as process-focusable s4-0) root quat) (-> this root quat) f0-1) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 146 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-146 ((this vehicle) (arg0 vector)) + 0 + (none) + ) + +;; definition for method 149 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-149 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 62 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this vehicle)) + (let ((v1-1 (-> this root root-prim)) + (f0-0 0.0) + ) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a1-3 (-> (the-as collide-shape-prim-group v1-1) child a0-1 local-sphere))) + (set! f0-0 (fmax f0-0 (+ (vector-length a1-3) (-> a1-3 w)))) + ) + ) + (vector-reset! (-> v1-1 local-sphere)) + (set! (-> v1-1 local-sphere w) f0-0) + ) + 0 + (none) + ) + +;; definition for method 116 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-116 ((this vehicle) (arg0 symbol)) + (dotimes (s4-0 (-> this info rider seat-count)) + (let* ((s3-0 (handle->process (-> this rider-array s4-0))) + (a0-5 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (send-event + a0-5 + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode arg0)) + ) + ) + ) + (put-rider-in-seat this s4-0 (the-as process #f)) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc new file mode 100644 index 0000000000..c0bb7de206 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc @@ -0,0 +1,1408 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *debug-vehicle-work*, type debug-vehicle-work +(define *debug-vehicle-work* (new 'static 'debug-vehicle-work)) + +;; failed to figure out what this is: +(defskelgroup skel-vehicle-explosion vehicle-explosion vehicle-explosion-lod0-jg vehicle-explosion-idle-ja + ((vehicle-explosion-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +;; definition for symbol *vehicle-shadow-control*, type shadow-control +(define *vehicle-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #xa)) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +;; definition for symbol *vehicle-shadow-control-disabled*, type shadow-control +(define *vehicle-shadow-control-disabled* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x2a)) + :shadow-dir (new 'static 'vector :y -1.0 :w 163840.0) + :bot-plane (new 'static 'plane :y 1.0 :w 40960.0) + :top-plane (new 'static 'plane :y 1.0 :w 2048.0) + ) + ) + ) + +;; definition for function vehicle-event-handler +(defbehavior vehicle-event-handler vehicle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (rbody-event-handler self arg0 arg1 arg2 arg3) + ) + +;; definition for method 48 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod on-impact ((this vehicle) (arg0 rigid-body-impact)) + (local-vars (v1-79 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (logior! (-> this v-flags) (vehicle-flag impact)) + (set! (-> this impact-pos quad) (-> arg0 point quad)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (matrix-inverse-of-rot-trans! (the-as matrix (-> s4-0 rvec)) (-> this rbody matrix)) + (vector-matrix*! (-> this impact-local-pos) (-> this impact-pos) (the-as matrix (-> s4-0 rvec))) + ) + (set! (-> this prev-impact-time) (-> this impact-time)) + (set! (-> this impact-time) (the-as uint (current-time))) + (set! (-> this impact-pat) (the-as uint (-> arg0 pat))) + (set! (-> this impact-proc) (the-as handle #f)) + (let ((a0-5 (-> arg0 process))) + (if a0-5 + (set! (-> this impact-proc) (process->handle a0-5)) + ) + ) + (let ((s4-1 (-> this info)) + (f0-0 1.0) + ) + (let ((v1-14 (-> arg0 prim-id))) + (if (logtest? v1-14 512) + (set! f0-0 (* 1.5 f0-0)) + ) + (if (logtest? v1-14 1024) + (set! f0-0 (* 2.0 f0-0)) + ) + (if (logtest? v1-14 2048) + (set! f0-0 (* 4.0 f0-0)) + ) + (if (logtest? v1-14 256) + (set! f0-0 (/ 1.0 f0-0)) + ) + ) + (let ((f30-0 (* (-> arg0 impulse) f0-0 (-> s4-1 info inv-mass) (-> s4-1 damage inv-toughness-factor)))) + (set! (-> this crash-impulse) (-> arg0 impulse)) + (cond + ((< f30-0 (-> s4-1 damage hit-threshold)) + ) + ((>= f30-0 (-> s4-1 damage hit-deadly)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1)) + 0 + ) + (apply-damage this (* 2.0 (-> s4-1 damage hit-points)) arg0) + (vehicle-method-74 this 2 (seconds 1)) + ) + ((>= f30-0 (-> s4-1 damage hit-big)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + 0 + ) + (apply-damage this (* 10.0 (-> s4-1 damage impact-damage-factor)) arg0) + (vehicle-method-74 this 1 (seconds 0.25)) + ) + ((>= f30-0 (-> s4-1 damage hit-small)) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25)) + 0 + ) + (apply-damage this (* 5.0 (-> s4-1 damage impact-damage-factor)) arg0) + (vehicle-method-74 this 1 (seconds 0.25)) + ) + (else + (let* ((f0-14 0.0) + (f1-10 40.0) + (f2-0 16384000.0) + (f0-15 (fmax f0-14 (* f1-10 (/ 1.0 f2-0) (- f30-0 (-> s4-1 damage hit-threshold))))) + ) + (apply-damage this (* f0-15 (-> s4-1 damage impact-damage-factor)) arg0) + ) + (when (< 32768.0 f30-0) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + ) + ) + ) + ) + (let* ((f0-18 1.0) + (f1-14 61440.0) + (f28-0 (fmin f0-18 (* f30-0 (/ 1.0 f1-14)))) + ) + (cond + ((>= f30-0 (-> s4-1 damage hit-small)) + (sound-play-by-name + (-> this info sound impact-sound) + (new-sound-id) + (the int (* 1024.0 f28-0)) + 0 + 0 + (sound-group) + #t + ) + (logclear! (-> this v-flags) (vehicle-flag turbo-boost)) + ) + ((< 0.1 f28-0) + (sound-play-by-name + (-> this info sound glance-sound) + (new-sound-id) + (the int (* 1024.0 f28-0)) + 0 + 0 + (sound-group) + #t + ) + ) + ) + ) + ) + ) + (let ((a0-39 (new 'stack-no-clear 'vector))) + (vector+float*! + a0-39 + (-> arg0 velocity) + (-> arg0 normal) + (- (vector-dot (-> arg0 velocity) (-> arg0 normal))) + ) + (.lvf vf1 (&-> a0-39 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-79 vf1) + (let ((f0-30 v1-79) + (f1-18 12288.0) + ) + (when (< (* f1-18 f1-18) f0-30) + (set! (-> this scrape-sound-envelope) 1.0) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.05)) + ) + ) + ) + (if (>= 0.0 (-> this hit-points)) + (vehicle-method-74 this 2 (seconds 1)) + ) + 0 + (none) + ) + ) + +;; definition for method 92 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-92 ((this vehicle) (arg0 vehicle-controls)) + (seek! (-> this controls steering) (-> arg0 steering) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 lean-z) (* 8.0 (seconds-per-frame))) + (let ((f0-10 (-> arg0 throttle)) + (f30-0 (-> arg0 brake)) + ) + (seek! (-> this controls throttle) f0-10 (* 4.0 (seconds-per-frame))) + (+! (-> this controls brake) (* (- f30-0 (-> this controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) + ) + (set! (-> this controls prev-flags) (-> this controls flags)) + (set! (-> this controls flags) (-> arg0 flags)) + 0 + (none) + ) + +;; definition for method 88 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-88 ((this vehicle) (arg0 vehicle-controls)) + 0 + (none) + ) + +;; definition for method 91 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod control-hook-player ((this vehicle) (arg0 vehicle-controls)) + (let ((gp-0 (new 'stack-no-clear 'vehicle-controls))) + (mem-set32! (&-> gp-0 steering) 6 0) + (cond + ((or (logtest? (-> this v-flags) (vehicle-flag player-grabbed)) + (and *target* (focus-test? *target* dead grabbed)) + (-> *setting-control* user-current stop-vehicle?) + ) + (set! (-> gp-0 steering) 0.0) + (set! (-> gp-0 lean-z) 0.0) + (set! (-> gp-0 throttle) 0.0) + (set! (-> gp-0 brake) 1.0) + (set! (-> gp-0 handbrake) 0.0) + (set! (-> this v-flags) + (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag reverse-gear camera-look-mode))) + ) + ) + (else + (vehicle-method-88 this (the-as vehicle-controls (&-> gp-0 steering))) + ) + ) + (vehicle-method-92 this (the-as vehicle-controls (&-> gp-0 steering))) + ) + 0 + (none) + ) + +;; definition for method 93 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-93 ((this vehicle)) + (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type2))) + (set! (-> s5-0 time) (the-as uint (current-time))) + (when (and *target* (logtest? (vehicle-flag ignition) (-> this v-flags))) + (when (and (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (zero? (-> this root num-riders)) + (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))) + (focus-test? *target* teleporting) + ) + ) + ) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + (set! (-> this controls lean-z) 0.0) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 24) + ) + ) + (cond + ((zero? (-> this crash-level)) + (seek! (-> this force-scale) 1.0 (seconds-per-frame)) + ) + ((< (-> this crash-level) 3) + (set! (-> s5-0 word01) (- (-> s5-0 time) (-> this crash-time))) + (when (>= (-> s5-0 word01) (-> this crash-duration)) + (if (or (>= (-> this rbody matrix uvec y) (cos 18204.445)) (>= (-> s5-0 word01) (the-as uint 900))) + (vehicle-method-75 this) + ) + ) + ) + ) + (set! (-> this force-level) (-> this crash-level)) + (cond + ((>= (-> this hit-points) 0.9) + (set! (-> this power-fluctuation-factor) 0.01) + ) + ((>= (-> this hit-points) 0.75) + (set! (-> this power-fluctuation-factor) 0.02) + ) + ((>= (-> this hit-points) 0.5) + (set! (-> this power-fluctuation-factor) 0.04) + ) + ((>= (-> this hit-points) 0.3) + (set! (-> this power-fluctuation-factor) 0.08) + ) + ((>= (-> this hit-points) 0.15) + (set! (-> this power-fluctuation-factor) 0.16) + ) + ((>= (-> this hit-points) 0.05) + (set! (-> this power-fluctuation-factor) 0.32) + ) + (else + (set! (-> this power-fluctuation-factor) 0.5) + ) + ) + (let ((f1-6 0.0)) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (let ((f0-23 (- 1.0 (* (rand-vu) (-> this power-fluctuation-factor))))) + (set! f1-6 (* f0-23 f0-23)) + ) + (if (not (logtest? (-> this v-flags) (vehicle-flag riding))) + (set! f1-6 (* 0.5 f1-6)) + ) + ) + (+! (-> this power-level) + (* (- f1-6 (-> this power-level)) + (fmin 1.0 (* (+ 1.0 (* 50.0 (-> this power-fluctuation-factor))) (seconds-per-frame))) + ) + ) + ) + (when (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (set! (-> s5-0 word00) (- (-> s5-0 time) (-> this turbo-boost-time))) + (if (or (>= (-> s5-0 word00) (-> this turbo-boost-duration)) + (and (>= (-> s5-0 word00) (the-as uint 30)) (>= (-> this controls brake) 0.75)) + ) + (logclear! (-> this v-flags) (vehicle-flag turbo-boost)) + ) + ) + ) + (if (logtest? (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (set! (-> this air-time) (the-as uint (current-time))) + ) + 0 + (none) + ) + +;; definition for method 94 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-94 ((this vehicle)) + (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type1))) + (set! (-> s5-0 word02) (the-as uint (current-time))) + (cond + ((logtest? (-> this v-flags) (vehicle-flag in-air)) + (when (or (< 55296.0 (-> this rbody lin-velocity y)) (>= (- (-> s5-0 word02) (-> this air-time)) (the-as uint 225))) + (set-setting! 'extra-follow-height 'abs (meters -4) 0) + (send-event *camera* 'set-max-angle-offset (-> this info camera air-max-angle-offset)) + ) + ) + (else + (remove-setting! 'extra-follow-height) + (send-event *camera* 'set-max-angle-offset (-> this info camera normal-max-angle-offset)) + ) + ) + (let ((f0-4 (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec)))) + (cond + ((= (-> this crash-level) 2) + (vehicle-method-85 this) + ) + ((< f0-4 (-> this info camera max-lookaround-speed)) + (vehicle-method-85 this) + ) + ((< (+ 4096.0 (-> this info camera max-lookaround-speed)) f0-4) + (vehicle-method-84 this) + ) + ) + ) + (when (not (logtest? (vehicle-flag flight-level-transition) (-> this v-flags))) + (let* ((f0-5 1.0) + (v1-49 (-> this rbody lin-velocity)) + (f0-6 (fmin f0-5 (/ (sqrtf (+ (* (-> v1-49 x) (-> v1-49 x)) (* (-> v1-49 z) (-> v1-49 z)))) + (-> this info handling max-xz-speed) + ) + ) + ) + ) + (seek! (-> this cam-speed-interp) f0-6 (* 0.1 (seconds-per-frame))) + ) + ) + (let ((f30-0 (-> this cam-speed-interp))) + (if #f + (set! f30-0 + (fmax 0.0 (fmin 1.0 (analog-input (the-as int (-> *cpad-list* cpads 1 righty)) 128.0 48.0 110.0 -1.0))) + ) + ) + (set! (-> s5-0 float00) + (lerp-scale (-> this info camera min-fov) (-> this info camera max-fov) f30-0 0.0 1.0) + ) + (set-setting! 'fov 'abs (-> s5-0 float00) 0) + (let ((f30-2 (lerp-scale 1.0 0.6 f30-0 0.0 1.0))) + (set-setting! 'string-min-length 'abs (* f30-2 (-> this info camera string-min-length)) 0) + (set-setting! 'string-max-length 'abs (* f30-2 (-> this info camera string-max-length)) 0) + ) + ) + (when *target* + (set! (-> s5-0 vec0 quad) (-> *target* draw shadow-ctrl settings shadow-dir quad)) + (let ((v1-75 (-> this draw shadow-ctrl settings shadow-dir))) + (set! (-> s5-0 vec0 w) (-> v1-75 w)) + (set! (-> v1-75 quad) (-> s5-0 vec0 quad)) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'collide-query 2))) + (let* ((v1-76 (-> s4-0 1)) + (a3-7 (-> this rbody matrix)) + (a0-29 (-> a3-7 rvec quad)) + (a1-11 (-> a3-7 uvec quad)) + (a2-9 (-> a3-7 fvec quad)) + (a3-8 (-> a3-7 trans quad)) + ) + (set! (-> v1-76 best-other-tri vertex 0 quad) a0-29) + (set! (-> v1-76 best-other-tri vertex 1 quad) a1-11) + (set! (-> v1-76 best-other-tri vertex 2 quad) a2-9) + (set! (-> v1-76 best-other-tri intersect quad) a3-8) + ) + (cond + ((logtest? (vehicle-flag camera-look-mode) (-> this v-flags)) + (let ((a0-31 *camera*)) + (when a0-31 + (let ((s3-0 (-> a0-31 slave))) + (when s3-0 + (set! (-> s3-0 0 fov) (-> s5-0 float00)) + (let ((v1-83 (-> this cam-view))) + (cond + ((zero? v1-83) + (vector-matrix*! + (the-as vector (-> s4-0 1 bbox)) + (the-as vector (-> this info camera look-pos-array)) + (the-as matrix (-> s4-0 1)) + ) + ) + ((= v1-83 1) + (vector-matrix*! (the-as vector (-> s4-0 1 bbox)) (-> this info camera look-rear) (the-as matrix (-> s4-0 1))) + (matrix-rotate-yx! (the-as matrix (-> s4-0 1 best-other-tri normal)) 32768.0 3640.889) + (matrix*! + (the-as matrix (-> s4-0 1)) + (the-as matrix (-> s4-0 1 best-other-tri normal)) + (the-as matrix (-> s4-0 1)) + ) + ) + ((= v1-83 2) + (vector-matrix*! (the-as vector (-> s4-0 1 bbox)) (-> this info camera look-left) (the-as matrix (-> s4-0 1))) + (matrix-rotate-yx! (the-as matrix (-> s4-0 1 best-other-tri normal)) 16384.0 3640.889) + (matrix*! + (the-as matrix (-> s4-0 1)) + (the-as matrix (-> s4-0 1 best-other-tri normal)) + (the-as matrix (-> s4-0 1)) + ) + ) + ((= v1-83 3) + (vector-matrix*! + (the-as vector (-> s4-0 1 bbox)) + (-> this info camera look-right) + (the-as matrix (-> s4-0 1)) + ) + (matrix-rotate-yx! (the-as matrix (-> s4-0 1 best-other-tri normal)) -16384.0 3640.889) + (matrix*! + (the-as matrix (-> s4-0 1)) + (the-as matrix (-> s4-0 1 best-other-tri normal)) + (the-as matrix (-> s4-0 1)) + ) + ) + (else + (vector-matrix*! + (the-as vector (-> s4-0 1 bbox)) + (the-as vector (-> this info camera look-pos-array)) + (the-as matrix (-> s4-0 1)) + ) + ) + ) + ) + (when (nonzero? (-> this cam-view)) + (let ((v1-96 (-> s4-0 0))) + (set! (-> v1-96 radius) 2048.0) + (set! (-> v1-96 collide-with) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-96 ignore-process0) this) + (set! (-> v1-96 ignore-process1) #f) + (set! (-> v1-96 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-96 action-mask) (collide-action solid)) + ) + (set! (-> s4-0 0 start-pos quad) (-> this rbody position quad)) + (vector-! (-> s4-0 0 move-dist) (the-as vector (-> s4-0 1 bbox)) (-> s4-0 0 start-pos)) + (let ((f0-23 (fill-and-probe-using-line-sphere *collide-cache* (-> s4-0 0)))) + (if (>= f0-23 0.0) + (vector+float*! (the-as vector (-> s4-0 1 bbox)) (-> s4-0 0 start-pos) (-> s4-0 0 move-dist) f0-23) + ) + ) + ) + (set! (-> s3-0 0 saved-pt quad) (-> s4-0 1 bbox min quad)) + (let ((v1-107 (-> s3-0 0 tracking))) + (set! (-> v1-107 inv-mat rvec quad) (-> s4-0 1 best-other-tri vertex 0 quad)) + (set! (-> v1-107 inv-mat uvec quad) (-> s4-0 1 best-other-tri vertex 1 quad)) + (set! (-> v1-107 inv-mat fvec quad) (-> s4-0 1 best-other-tri vertex 2 quad)) + ) + ) + ) + ) + ) + (if (zero? (-> this cam-view)) + (vehicle-method-147 this) + (vehicle-method-148 this) + ) + (when (not (logtest? (vehicle-flag camera-look-mode) (-> this unknown-flags))) + (set-setting! 'interp-time 'abs 3.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'lock-sound-camera-to-target #t 0.0 0) + ) + ) + (else + (when (logtest? (vehicle-flag camera-look-mode) (-> this unknown-flags)) + (vehicle-method-148 this) + (let ((v1-130 *camera*)) + (when v1-130 + (when (-> v1-130 slave) + (let ((s5-1 (new 'static 'vector))) + (let ((v1-132 (new 'stack-no-clear 'inline-array 'matrix 2))) + (let ((a0-72 (-> v1-132 1))) + (set! (-> a0-72 rvec x) 0.0) + (set! (-> a0-72 rvec y) 0.0) + (set! (-> a0-72 rvec z) -1.0) + (set! (-> a0-72 rvec w) 1.0) + ) + (let* ((a0-73 (-> v1-132 0)) + (t0-10 (-> this rbody matrix)) + (a1-37 (-> t0-10 rvec quad)) + (a2-24 (-> t0-10 uvec quad)) + (a3-12 (-> t0-10 fvec quad)) + (t0-11 (-> t0-10 trans quad)) + ) + (set! (-> a0-73 rvec quad) a1-37) + (set! (-> a0-73 uvec quad) a2-24) + (set! (-> a0-73 fvec quad) a3-12) + (set! (-> a0-73 trans quad) t0-11) + ) + (vector-rotate*! s5-1 (the-as vector (-> v1-132 1)) (-> v1-132 0)) + ) + (persist-with-delay + *setting-control* + 'string-startup-vector + (seconds 0.05) + 'string-startup-vector + 'abs + (the-as float s5-1) + 0 + ) + ) + ) + ) + ) + (set-setting! 'interp-time 'abs 0.0 0) + (remove-setting! 'mode-name) + (remove-setting! 'lock-sound-camera-to-target) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 101 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-101 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 30 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-30 ((this vehicle)) + (cond + ((logtest? (vehicle-flag sounds) (-> this v-flags)) + (rigid-body-object-method-38 this) + ) + (else + (if (logtest? (vehicle-flag sounds) (-> this unknown-flags)) + (vehicle-method-106 this) + ) + ) + ) + (if (logtest? (vehicle-flag particles) (-> this v-flags)) + (vehicle-method-78 this) + ) + (if (logtest? (vehicle-flag joints) (-> this v-flags)) + (vehicle-method-79 this) + ) + (when (logtest? (vehicle-flag player-dismounting) (-> this v-flags)) + (let ((a0-10 (new 'stack-no-clear 'array 'uint32 1))) + (set! (-> a0-10 0) (the-as uint (current-time))) + (when (< (the-as uint 150) (- (-> a0-10 0) (-> this player-dismount-time))) + (logclear! (-> this v-flags) (vehicle-flag player-dismounting)) + (let ((v1-32 (find-prim-by-id-logtest (-> this root) (the-as uint 64)))) + (if v1-32 + (set! (-> v1-32 prim-core collide-as) (collide-spec vehicle-sphere vehicle-mesh)) + ) + ) + ) + ) + ) + (set! (-> this unknown-flags) (-> this v-flags)) + (ja-post) + 0 + (none) + ) + +;; definition for method 54 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-54 ((this vehicle)) + (logclear! (-> this v-flags) (vehicle-flag impact)) + (let ((s5-0 (new 'stack-no-clear 'rigid-body-move-work))) + (set! (-> s5-0 mat trans w) -4096000.0) + (water-info-init! (-> this root) (the-as water-info (-> s5-0 mat)) (collide-action solid semi-solid)) + (set! (-> this water-flags) (the-as uint (-> s5-0 mat trans x))) + (if (and (logtest? (the-as int (-> s5-0 mat trans x)) 1) (logtest? #x20000000 (the-as int (-> s5-0 mat trans x)))) + (set! (-> s5-0 mat trans w) (-> s5-0 mat fvec x)) + ) + (set! (-> this water-height) (-> s5-0 mat trans w)) + (set! (-> s5-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-float*! (-> s5-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) + (let ((v1-15 (-> s5-0 cquery))) + (set! (-> v1-15 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-15 collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-15 ignore-process0) this) + (set! (-> v1-15 ignore-process1) #f) + (set! (-> v1-15 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-15 action-mask) (collide-action solid)) + ) + (if (focus-test? this dead) + (set! (-> s5-0 cquery ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + ) + (fill-using-line-sphere *collide-cache* (-> s5-0 cquery)) + ) + (rigid-body-control-method-10 (-> this rbody) this (-> this rbody time-remaining) (-> this max-time-step)) + 0 + (none) + ) + +;; definition for method 77 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-77 ((this vehicle)) + (vehicle-method-115 this) + (if (logtest? (vehicle-flag camera) (-> this v-flags)) + (vehicle-method-94 this) + ) + (if (logtest? (vehicle-flag nav-spheres) (-> this v-flags)) + (vehicle-method-140 this) + ) + (when (< (-> this hit-points) 0.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this crash-level) 3) + ) + (if (and (logtest? (-> this v-flags) (vehicle-flag dead)) + (not (logtest? (-> this focus-status) (focus-status dead))) + ) + (go (method-of-object this crash)) + ) + 0 + (none) + ) + +;; definition for method 55 of type vehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod clear-impulse-force-flag! ((this vehicle)) + (with-pp + (let ((v1-0 (new 'stack-no-clear 'matrix))) + (set! (-> v1-0 rvec quad) (-> this root transv quad)) + (vector-! (-> v1-0 uvec) (-> this rbody lin-velocity) (-> v1-0 rvec)) + (vector-float*! (-> this lin-acceleration) (-> v1-0 uvec) (-> pp clock frames-per-second)) + ) + (set! (-> this root transv quad) (-> this rbody lin-velocity quad)) + (quaternion-copy! (-> this root quat) (the-as quaternion (-> this rbody rot))) + (rigid-body-control-method-25 (-> this rbody) (-> this root trans)) + (let* ((v1-11 (-> this node-list data 0 bone transform)) + (a3-0 (-> this rbody matrix)) + (a0-12 (-> a3-0 rvec quad)) + (a1-8 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-11 rvec quad) a0-12) + (set! (-> v1-11 uvec quad) a1-8) + (set! (-> v1-11 fvec quad) a2-1) + (set! (-> v1-11 trans quad) a3-1) + ) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vehicle-method-77 this) + (rigid-body-object-method-30 this) + (update-transforms (-> this root)) + (seek! (-> this scrape-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 24) + (logclear! (-> this v-flags) (vehicle-flag player-impulse-force player-contact-force)) + 0 + (none) + ) + ) + +;; definition for method 117 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-117 ((this vehicle)) + (if (time-elapsed? (-> this player-touch-time) (seconds 0.1)) + (logclear! (-> this v-flags) (vehicle-flag player-touching player-edge-grabbing player-standing-on)) + ) + (when (logtest? (-> this v-flags) (vehicle-flag player-touching)) + (detect-riders! (-> this root)) + 0 + ) + (if (logtest? (vehicle-flag player-touching player-driving) (-> this v-flags)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + ) + (vehicle-method-93 this) + 0 + (none) + ) + +;; definition for method 39 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod rbody-post ((this vehicle)) + (local-vars (a0-14 int) (a0-16 int) (a0-19 int) (a0-21 int)) + (let* ((v1-1 (-> *perf-stats* data 37)) + (a0-1 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-1) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-1) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (cond + ((logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (if (not (vehicle-method-102 this)) + (disable-physics! this) + ) + ) + (else + (if (vehicle-method-102 this) + (apply-momentum! this) + ) + ) + ) + (cond + ((logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (vehicle-method-117 this) + (vehicle-method-103 this) + ) + (else + (let* ((v1-26 (-> *perf-stats* data 20)) + (a0-11 (-> v1-26 ctrl)) + ) + (+! (-> v1-26 count) 1) + (b! (zero? a0-11) cfg-12 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-11) + ) + (.sync.l) + (.sync.p) + (label cfg-12) + 0 + (rigid-body-object-method-30 this) + (let ((v1-31 (-> *perf-stats* data 20))) + (b! (zero? (-> v1-31 ctrl)) cfg-14 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-14 pcr0) + (+! (-> v1-31 accum0) a0-14) + (.mfpc a0-16 pcr1) + (+! (-> v1-31 accum1) a0-16) + ) + (label cfg-14) + 0 + ) + ) + (let ((v1-34 (-> *perf-stats* data 37))) + (b! (zero? (-> v1-34 ctrl)) cfg-17 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-19 pcr0) + (+! (-> v1-34 accum0) a0-19) + (.mfpc a0-21 pcr1) + (+! (-> v1-34 accum1) a0-21) + ) + (label cfg-17) + 0 + 0 + (none) + ) + +;; definition for method 89 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod init-reverse ((this vehicle) (arg0 vehicle-controls)) + (set! (-> arg0 steering) 0.0) + (set! (-> arg0 lean-z) 0.0) + (set! (-> arg0 throttle) 0.0) + (set! (-> arg0 brake) 1.0) + (set! (-> arg0 handbrake) 1.0) + (logclear! (-> this v-flags) (vehicle-flag reverse-gear)) + 0 + (none) + ) + +;; definition for method 118 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-118 ((this vehicle)) + (local-vars (a0-25 int) (a0-27 int)) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (b! + (not (and (logtest? (vehicle-flag traffic-managed) (-> this v-flags)) + (not (logtest? (-> this v-flags) (vehicle-flag persistent))) + ) + ) + cfg-20 + :delay (empty-form) + ) + (let ((f0-3 (fmin (-> this player-dist2) (-> this camera-dist2)))) + (let ((f1-1 819200.0)) + (b! (>= (* f1-1 f1-1) f0-3) cfg-8) + ) + (let ((f1-4 819200.0)) + (if (< (* f1-4 f1-4) f0-3) + (vehicle-method-109 this) + ) + ) + (b! #t cfg-19 :delay (nop!)) + (label cfg-8) + (let ((f1-7 81920.0)) + (b! (>= (* f1-7 f1-7) f0-3) cfg-18) + ) + (b! (not (logtest? (-> this draw status) (draw-control-status on-screen))) cfg-11 :delay (nop!)) + (set-time! (-> this state-time)) + (b! #t cfg-17 :delay (nop!)) + (label cfg-11) + (if (or (time-elapsed? (-> this state-time) (seconds 10)) (let ((f1-10 409600.0)) + (< (* f1-10 f1-10) f0-3) + ) + ) + (vehicle-method-109 this) + ) + ) + (label cfg-17) + (b! #t cfg-19 :delay (nop!)) + (label cfg-18) + (set-time! (-> this state-time)) + (label cfg-19) + 0 + (label cfg-20) + (vehicle-method-129 this) + (cond + ((logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (when (not (vehicle-method-102 this)) + (disable-physics! this) + (vehicle-method-142 this) + ) + ) + (else + (if (vehicle-method-102 this) + (apply-momentum! this) + ) + ) + ) + (b! (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) cfg-31 :delay (nop!)) + (vector-reset! (-> this target-acceleration)) + (when (logtest? (-> this v-flags) (vehicle-flag disturbed)) + (if (logtest? (-> this v-flags) (vehicle-flag in-air)) + (set-time! (-> this disturbed-time)) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'vehicle-controls))) + (mem-set32! (&-> s5-2 steering) 6 0) + (init-reverse this (the-as vehicle-controls (&-> s5-2 steering))) + (vehicle-method-92 this (the-as vehicle-controls (&-> s5-2 steering))) + ) + (vehicle-method-117 this) + (vehicle-method-103 this) + (b! #t cfg-36 :delay (nop!)) + (label cfg-31) + (let* ((v1-71 (-> *perf-stats* data 20)) + (a0-22 (-> v1-71 ctrl)) + ) + (+! (-> v1-71 count) 1) + (b! (zero? a0-22) cfg-33 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-22) + ) + (.sync.l) + (.sync.p) + (label cfg-33) + 0 + (rigid-body-object-method-30 this) + (let ((v1-76 (-> *perf-stats* data 20))) + (b! (zero? (-> v1-76 ctrl)) cfg-35 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-25 pcr0) + (+! (-> v1-76 accum0) a0-25) + (.mfpc a0-27 pcr1) + (+! (-> v1-76 accum1) a0-27) + ) + (label cfg-35) + 0 + (label cfg-36) + 0 + (none) + ) + +;; definition for method 119 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-119 ((this vehicle)) + (set! (-> this player-dist2) 0.0) + (set! (-> this camera-dist2) 0.0) + ((-> this control-hook) this) + (vehicle-method-117 this) + 0 + (none) + ) + +;; definition for method 33 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod alloc-rbody-control! ((this vehicle) (arg0 rigid-body-object-constants)) + (if (logtest? (-> (the-as rigid-body-vehicle-constants arg0) flags) 8) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh)) + ) + ((zero? v1-0) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere vehicle-mesh)) + ) + ) + ) + (none) + ) + ) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere vehicle-mesh)) + (none) + ) + ) + ) + (set! (-> this bound-radius) (-> this draw bounds w)) + (set! (-> this draw shadow-ctrl) + (new 'process 'shadow-control -61440.0 -2048.0 69632.0 (-> this root trans) (shadow-flags shdf03) 245760.0) + ) + (logior! (-> this root root-prim prim-core action) (collide-action pull-rider-can-collide)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + (set! (-> this root event-self) 'touched) + (let ((t9-3 (method-of-type rigid-body-object alloc-rbody-control!))) + (t9-3 this (the-as rigid-body-vehicle-constants arg0)) + ) + (logior! (-> this rbody flags) (rigid-body-flag enable-collision)) + (set! (-> this root max-iteration-count) (the-as uint 8)) + (set! (-> this max-time-step) 0.033333335) + (logior! (-> this mask) (process-mask vehicle)) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this nav) #f) + (set! (-> this squad) #f) + (let ((v1-29 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-29 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-29 prim-core collide-with)) + ) + (rigid-body-object-method-42 this) + (vehicle-method-76 this) + (set! (-> this power-level) 0.5) + (set! (-> this lights-factor) 0.0) + (set! (-> this turbo-boost-factor) 1.0) + (dotimes (v1-37 4) + (set! (-> this rider-array v1-37) (the-as handle #f)) + ) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) + (set! (-> this damage-zap-sound-id) (new-sound-id)) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 204800.0) + (set! (-> this draw lod-set lod 2 dist) 819200.0) + (set! (-> this event-hook) vehicle-event-handler) + 0 + (none) + ) + +;; definition for method 50 of type vehicle +;; INFO: Used lq/sq +(defmethod attack-handler ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'rigid-body-impact 2))) + (init-rbody-impact-from-tshape! this (-> s5-0 0) arg2) + (cond + ((logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (set! (-> s5-0 0 velocity quad) (-> arg1 attacker-velocity quad)) + ) + (else + (let ((s0-0 arg0)) + (cond + ((if (type? s0-0 process-focusable) + s0-0 + ) + (set! (-> s5-0 1 point quad) (-> (get-trans (the-as process-focusable arg0) 3) quad)) + (vector-! (-> s5-0 0 velocity) (the-as vector (-> s5-0 0)) (the-as vector (-> s5-0 1))) + ) + (else + (vector-! (-> s5-0 0 velocity) (the-as vector (-> s5-0 0)) (-> arg0 root trans)) + ) + ) + ) + ) + ) + (let ((f28-0 0.0)) + (let ((f30-0 0.0)) + (if (and (logtest? (penetrate jak-dark-nuke) arg3) + (not (logtest? (vehicle-flag ignore-damage) (-> this v-flags))) + ) + (send-event this 'traffic-off-force) + ) + (set! f28-0 + (cond + ((logtest? (penetrate jak-dark-blackhole) arg3) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag gun-dark-2-zero-g) (-> this v-flags)))) + f28-0 + ) + ((or (logtest? (penetrate dark-punch dark-bomb) arg3) + (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) + ) + (set! f30-0 (* 204800.0 (-> this info info mass))) + (* 0.2 (-> this info damage hit-points)) + ) + ((logtest? (penetrate jak-red-shockwave) arg3) + (case (-> arg1 mode) + (('eco-red-shove) + (set! f30-0 (* (lerp 4096.0 8192.0 (-> arg1 control)) (-> this info info mass))) + (set! f28-0 0.0) + ) + (('eco-red) + (let ((f0-6 (* (lerp 20480.0 122880.0 (-> arg1 control)) (-> this info info mass)))) + (set! f30-0 (* 2.0 f0-6)) + ) + (set! f28-0 (* 8.0 (-> arg1 control))) + ) + ) + f28-0 + ) + (else + (cond + ((logtest? arg3 (penetrate punch)) + (set! f30-0 40960.0) + (set! f28-0 4.0) + ) + ((logtest? arg3 (penetrate flop spin)) + (set! f30-0 20480.0) + (set! f28-0 2.0) + ) + ((logtest? (attack-mask vehicle-damage-factor) (-> arg1 mask)) + (set! f28-0 (* (-> arg1 damage) (-> arg1 vehicle-damage-factor))) + (set! f30-0 (* 49152.0 (-> arg1 vehicle-impulse-factor) (-> arg1 damage))) + 0 + ) + (else + (set! f30-0 8192.0) + (set! f28-0 2.0) + ) + ) + f28-0 + ) + ) + ) + (set! (-> s5-0 0 impulse) f30-0) + ) + (apply-damage this f28-0 (-> s5-0 0)) + ) + (when (not (logtest? (vehicle-flag ignore-impulse) (-> this v-flags))) + (impulse-handler this) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> s5-0 0 velocity quad)) + (vector-normalize! s3-1 1.0) + (vector-float*! s3-1 s3-1 (-> s5-0 0 impulse)) + (apply-impact! (-> this rbody) (the-as vector (-> s5-0 0)) s3-1) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + (when #f + (set-time! (-> *debug-vehicle-work* impact-time)) + (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer (-> s5-0 0)) 64) + (let ((v1-84 (-> arg2 head))) + (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-84 prim1 cprim prim-core world-sphere quad)) + (set! (-> *debug-vehicle-work* prim-sphere2 quad) (-> v1-84 prim2 cprim prim-core world-sphere quad)) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (the-as vector (-> s5-0 0)) *color-blue*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s5-0 0)) + s3-1 + (meters 0.00024414062) + *color-blue* + ) + ) + ) + ) + ) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) + ) + #t + ) + +;; definition for method 51 of type vehicle +(defmethod touch-handler ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) + #t + ) + +;; definition for method 49 of type vehicle +;; WARN: disable def twice: 317. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 331. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod rbody-event-handler ((this vehicle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-2 object)) + (when (and (= arg2 'touched) arg0 (logtest? (process-mask collectable) (-> arg0 mask))) + (dotimes (s1-0 4) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer arg0)) + (set! (-> a1-2 num-params) arg1) + (set! (-> a1-2 message) arg2) + (set! (-> a1-2 param 0) (-> arg3 param 0)) + (set! (-> a1-2 param 1) (-> arg3 param 1)) + (set! (-> a1-2 param 2) (-> arg3 param 2)) + (set! (-> a1-2 param 3) (-> arg3 param 3)) + (set! (-> a1-2 param 4) (-> arg3 param 4)) + (set! (-> a1-2 param 5) (-> arg3 param 5)) + (send-event-function (handle->process (-> this rider-array s1-0)) a1-2) + ) + ) + ) + (case arg2 + (('attack) + (let ((s3-1 (the-as object (-> arg3 param 1))) + (s2-1 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3)) + ) + (when (and (!= (-> (the-as attack-info s3-1) id) (-> this incoming-attack-id)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (or (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) + ) + ) + (set! (-> this incoming-attack-id) (-> (the-as attack-info s3-1) id)) + (when (and (logtest? (-> this info flags) 4) (logtest? (vehicle-flag ai-driving) (-> this v-flags))) + (let ((a1-6 (find-offending-process-focusable arg0 (the-as attack-info s3-1)))) + (if (and a1-6 (logtest? (-> a1-6 mask) (process-mask target))) + (vehicle-method-130 this) + ) + ) + ) + (attack-handler + this + (the-as process-drawable arg0) + (the-as attack-info s3-1) + (the-as touching-shapes-entry (-> arg3 param 0)) + s2-1 + ) + ) + ) + ) + (('apply-impulse) + (when (not (logtest? (vehicle-flag ignore-impulse) (-> this v-flags))) + (impulse-handler this) + (let ((a1-8 (-> arg3 param 0)) + (a2-3 (-> arg3 param 1)) + ) + (apply-impact! (-> this rbody) (the-as vector a1-8) (the-as vector a2-3)) + ) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + ) + ) + (('get-offending-focusable) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + *target* + ) + ) + (('pilot-on) + (let* ((s3-2 (-> arg3 param 0)) + (s2-2 arg0) + (s5-1 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + (when s5-1 + (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> this pid) (-> arg0 pid)) + (logior! (-> this v-flags) (vehicle-flag riding)) + (put-rider-in-seat this (the-as int s3-2) s5-1) + (if (logtest? (-> s5-1 mask) (process-mask target)) + (logior! (-> this v-flags) (vehicle-flag player-driving)) + ) + #t + ) + ) + ) + (('player-get-off) + (if (and (logtest? (vehicle-flag player-driving) (-> this v-flags)) (!= (-> this crash-level) 3)) + (go (method-of-object this waiting)) + ) + ) + (('nav-mesh-kill) + (vehicle-method-138 this) + #t + ) + (('go-hostile) + (let ((a1-13 (-> arg3 param 0))) + (vehicle-method-143 this (the-as process a1-13)) + ) + ) + (('go-die) + (let ((v1-71 (-> this root root-prim))) + (set! (-> v1-71 prim-core collide-as) (collide-spec)) + (set! (-> v1-71 prim-core collide-with) (collide-spec)) + ) + 0 + (go (method-of-object this die)) + ) + (('scale-max-hit-points) + (let ((f1-0 (the-as float (-> arg3 param 0)))) + (set! (-> this damage-factor) (* (-> this damage-factor) (/ 1.0 f1-0))) + ) + 0 + ) + (('push-trans) + (let ((a1-14 (-> arg3 param 0))) + (vehicle-method-146 this (the-as vector a1-14)) + ) + #t + ) + (('gun-dark-2-off) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag gun-dark-2-zero-g)))) + (let* ((f1-2 (the-as float (-> arg3 param 0))) + (f30-0 (fmin (-> this hit-points) (- 1.0 f1-2))) + (a2-6 (new 'stack 'rigid-body-impact)) + ) + (apply-damage this (* (-> this info damage hit-points) (- (-> this hit-points) f30-0)) a2-6) + ) + ) + (('set-control-hook-ai) + (set! v0-2 (method-of-object this control-hook-ai)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-2)) + v0-2 + ) + (('set-control-hook-player) + (set! v0-2 (method-of-object this control-hook-player)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-2)) + v0-2 + ) + (('ignore-damage) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag ignore-damage)))) + (when (-> arg3 param 0) + (set! v0-2 (logior (vehicle-flag ignore-damage) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-2)) + v0-2 + ) + ) + (('ignore-impulse) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag ignore-impulse)))) + (when (-> arg3 param 0) + (set! v0-2 (logior (vehicle-flag ignore-impulse) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-2)) + v0-2 + ) + ) + (else + ((method-of-type rigid-body-object rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 131 of type vehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-131 ((this vehicle)) + 0 + (none) + ) + +;; definition for method 143 of type vehicle +;; WARN: Return type mismatch int vs object. +(defmethod vehicle-method-143 ((this vehicle) (arg0 process)) + 0 + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/battle_REF.gc b/test/decompiler/reference/jak3/levels/common/battle_REF.gc new file mode 100644 index 0000000000..d4353b0b1f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/battle_REF.gc @@ -0,0 +1,1795 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type battle-info +(deftype battle-info (basic) + ((id int8) + (notice-spec uint64) + (pick-logic int8) + (notice-distance float) + (dont-spawn-initial-until-notice? symbol) + (play-battle-music symbol) + (min-battle-spawn-delay uint32) + (max-battle-spawn-delay uint32) + (min-spawner-notice-attack-delay uint32) + (max-spawner-notice-attack-delay uint32) + (spawner-blocked-by-player-xz float) + (spawner-blocked-by-collide-radius float) + (pick-spawner-max-dist float) + (max-count uint32) + (desired-alive-count uint8) + (spawner-collide-with collide-spec) + ) + ) + +;; definition for method 3 of type battle-info +(defmethod inspect ((this battle-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tnotice-spec: ~D~%" (-> this notice-spec)) + (format #t "~1Tpick-logic: ~D~%" (-> this pick-logic)) + (format #t "~1Tnotice-distance: ~f~%" (-> this notice-distance)) + (format #t "~1Tdont-spawn-initial-until-notice?: ~A~%" (-> this dont-spawn-initial-until-notice?)) + (format #t "~1Tplay-battle-music: ~A~%" (-> this play-battle-music)) + (format #t "~1Tmin-battle-spawn-delay: ~D~%" (-> this min-battle-spawn-delay)) + (format #t "~1Tmax-battle-spawn-delay: ~D~%" (-> this max-battle-spawn-delay)) + (format #t "~1Tmin-spawner-notice-attack-delay: ~D~%" (-> this min-spawner-notice-attack-delay)) + (format #t "~1Tmax-spawner-notice-attack-delay: ~D~%" (-> this max-spawner-notice-attack-delay)) + (format #t "~1Tspawner-blocked-by-player-xz: ~f~%" (-> this spawner-blocked-by-player-xz)) + (format #t "~1Tspawner-blocked-by-collide-radius: ~f~%" (-> this spawner-blocked-by-collide-radius)) + (format #t "~1Tpick-spawner-max-dist: ~f~%" (-> this pick-spawner-max-dist)) + (format #t "~1Tmax-count: ~D~%" (-> this max-count)) + (format #t "~1Tdesired-alive-count: ~D~%" (-> this desired-alive-count)) + (format #t "~1Tspawner-collide-with: ~D~%" (-> this spawner-collide-with)) + (label cfg-4) + this + ) + +;; definition of type battle-ally +(deftype battle-ally (structure) + ((entity entity-actor) + ) + ) + +;; definition for method 3 of type battle-ally +(defmethod inspect ((this battle-ally)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'battle-ally) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (label cfg-4) + this + ) + +;; definition of type battle-ally-array +(deftype battle-ally-array (inline-array-class) + ((data battle-ally :inline :dynamic) + ) + ) + +;; definition for method 3 of type battle-ally-array +(defmethod inspect ((this battle-ally-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> battle-ally-array heap-base) (the-as uint 16)) + +;; definition of type battle-breed +(deftype battle-breed (structure) + ((breed-type type) + (percent float) + ) + ) + +;; definition for method 3 of type battle-breed +(defmethod inspect ((this battle-breed)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'battle-breed) + (format #t "~1Tbreed-type: ~A~%" (-> this breed-type)) + (format #t "~1Tpercent: ~f~%" (-> this percent)) + (label cfg-4) + this + ) + +;; definition of type battle-breed-array +(deftype battle-breed-array (inline-array-class) + ((data battle-breed :inline :dynamic) + ) + ) + +;; definition for method 3 of type battle-breed-array +(defmethod inspect ((this battle-breed-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> battle-breed-array heap-base) (the-as uint 16)) + +;; definition of type battle-spawner +(deftype battle-spawner (structure) + ((flags battle-spawner-flags) + (entity entity-actor) + (breeds battle-breed-array) + (creature-index int8) + (ready-index int8) + (attack-index int8) + (mode uint8) + (intro-path path-control) + (notice-attack-delay uint32) + (creature handle) + (last-spawn-time time-frame) + (noticed-attack-time time-frame) + (attack-pos vector :inline) + ) + ) + +;; definition for method 3 of type battle-spawner +(defmethod inspect ((this battle-spawner)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'battle-spawner) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tbreeds: ~A~%" (-> this breeds)) + (format #t "~1Tcreature-index: ~D~%" (-> this creature-index)) + (format #t "~1Tready-index: ~D~%" (-> this ready-index)) + (format #t "~1Tattack-index: ~D~%" (-> this attack-index)) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~1Tnotice-attack-delay: ~D~%" (-> this notice-attack-delay)) + (format #t "~1Tcreature: ~D~%" (-> this creature)) + (format #t "~1Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + (format #t "~1Tnoticed-attack-time: ~D~%" (-> this noticed-attack-time)) + (format #t "~1Tattack-pos: #~%" (-> this attack-pos)) + (label cfg-4) + this + ) + +;; definition of type battle-spawner-array +(deftype battle-spawner-array (inline-array-class) + ((data battle-spawner :inline :dynamic) + ) + ) + +;; definition for method 3 of type battle-spawner-array +(defmethod inspect ((this battle-spawner-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> battle-spawner-array heap-base) (the-as uint 80)) + +;; definition of type battle +(deftype battle (process-drawable) + ((info battle-info) + (flags battle-flags) + (spawn-initial-creatures? symbol) + (next-spawn-delay uint32) + (on-notice basic) + (on-hostile basic) + (on-beaten basic) + (max-count uint32) + (count uint32) + (die-count uint32) + (stat-child-count uint16) + (cant-spawn-time time-frame) + (jammed-starting-time time-frame) + (spawners battle-spawner-array) + (allies battle-ally-array) + ) + (:state-methods + idle + undefined + notice + hostile + beaten + ) + (:methods + (spawner-blocked? (_type_ battle-spawner) symbol) + (spawner-blocked-by-collide? (_type_ battle-spawner) symbol) + (draw-battle-marks (_type_) none) + (initialize-enemy-lists (_type_) none) + (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none) + (get-spawner-for-enemy (_type_ process) battle-spawner) + (initialize-ally (_type_ battle-ally entity-actor) none) + (initialize-spawner (_type_ battle-spawner entity-actor) none) + (initialize-battle (_type_) none) + (init-go (_type_) int) + (get-spawn-delay (_type_) int) + (get-best-spawner (_type_) battle-spawner) + (spawner-free? (_type_ battle-spawner) symbol) + (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle) + (spawn-from-spawner (_type_ battle-spawner symbol) none) + (spawn-initial-creatures (_type_) none) + (get-random-breed (_type_ battle-spawner) battle-breed) + (spawner-hit (_type_ battle-spawner process) symbol) + (spawner-try-jump (_type_ battle-spawner enemy) symbol) + (spawner-do-jump (_type_ battle-spawner) int) + (spawner-hittable? (_type_ battle-spawner) symbol) + (spawner-in-intro? (_type_ battle-spawner) symbol) + (set-battle-music (_type_) none) + (unset-battle-music (_type_) none) + (update-allies-list (_type_) int) + (beaten? (_type_) symbol) + (spawner-active? (_type_ battle-spawner symbol) symbol) + (spawner-active-count (_type_) int) + ) + ) + +;; definition for method 3 of type battle +(defmethod inspect ((this battle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tspawn-initial-creatures?: ~A~%" (-> this spawn-initial-creatures?)) + (format #t "~2Tnext-spawn-delay: ~D~%" (-> this next-spawn-delay)) + (format #t "~2Ton-notice: ~A~%" (-> this on-notice)) + (format #t "~2Ton-hostile: ~A~%" (-> this on-hostile)) + (format #t "~2Ton-beaten: ~A~%" (-> this on-beaten)) + (format #t "~2Tmax-count: ~D~%" (-> this max-count)) + (format #t "~2Tcount: ~D~%" (-> this count)) + (format #t "~2Tdie-count: ~D~%" (-> this die-count)) + (format #t "~2Tstat-child-count: ~D~%" (-> this stat-child-count)) + (format #t "~2Tcant-spawn-time: ~D~%" (-> this cant-spawn-time)) + (format #t "~2Tjammed-starting-time: ~D~%" (-> this jammed-starting-time)) + (format #t "~2Tspawners: ~A~%" (-> this spawners)) + (format #t "~2Tallies: ~A~%" (-> this allies)) + (label cfg-4) + this + ) + +;; definition for symbol *battles*, type (array battle-info) +(define *battles* (new 'static 'boxed-array :type battle-info + (new 'static 'battle-info + :notice-spec #x2 + :notice-distance 163840.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x384 + :max-battle-spawn-delay #x708 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xa + :desired-alive-count #x2 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 1 + :notice-spec #x2 + :notice-distance 163840.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x4b0 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xf + :desired-alive-count #x2 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 2 + :notice-spec #x2 + :notice-distance 204800.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x4b0 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x11 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 3 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x1 + :desired-alive-count #x1 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 4 + :notice-spec #x2 + :notice-distance 245760.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x4b0 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x14 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 6 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x1e + :desired-alive-count #xf + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 7 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x3c + :max-battle-spawn-delay #x96 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x32 + :desired-alive-count #xf + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 8 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xc + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 9 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xc + :desired-alive-count #x3 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 10 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x8 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 11 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x32 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 12 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x1e + :desired-alive-count #x8 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 13 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x20000000 + :desired-alive-count #x8 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 14 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #xc + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 15 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x28 + :desired-alive-count #xf + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 16 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x12c + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x4 + :desired-alive-count #x3 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 17 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x7 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 18 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x8 + :desired-alive-count #x3 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 19 + :notice-spec #x1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x22 + :desired-alive-count #x4 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 20 + :notice-spec #x1 + :pick-logic 1 + :notice-distance 122880.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music #f + :min-battle-spawn-delay #x12c + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x14 + :desired-alive-count #x8 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 21 + :notice-spec #x2 + :notice-distance 1228800.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music 'wasfight + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x20000000 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + (new 'static 'battle-info + :id 22 + :notice-spec #x2 + :notice-distance 819200.0 + :dont-spawn-initial-until-notice? #f + :play-battle-music 'wasfight + :min-battle-spawn-delay #x96 + :max-battle-spawn-delay #x258 + :max-spawner-notice-attack-delay #x78 + :spawner-blocked-by-player-xz 24576.0 + :pick-spawner-max-dist 163840.0 + :max-count #x20000000 + :desired-alive-count #x6 + :spawner-collide-with (collide-spec enemy hit-by-others-list) + ) + ) + ) + +;; definition for function battle-event-handler +;; WARN: disable def twice: 9. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 19. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 29. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior battle-event-handler battle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('query) + (case (-> arg3 param 0) + (('beaten) + (and (-> self next-state) (= (-> self next-state name) 'beaten)) + ) + (('hostile) + (and (-> self next-state) (= (-> self next-state name) 'hostile)) + ) + (('idle) + (and (-> self next-state) (= (-> self next-state name) 'idle)) + ) + (('die-count) + (-> self die-count) + ) + (else + #f + ) + ) + ) + (('child-die) + (+! (-> self die-count) 1) + (let ((v1-14 (get-spawner-for-enemy self arg0))) + (when v1-14 + (set! (-> v1-14 creature) (the-as handle #f)) + #f + ) + ) + ) + (('child-hit) + (let ((a1-3 (get-spawner-for-enemy self arg0))) + (when a1-3 + (logior! (-> a1-3 flags) (battle-spawner-flags hit)) + (spawner-hit self a1-3 arg0) + ) + ) + ) + (('child-jumped) + (let ((a1-5 (get-spawner-for-enemy self arg0))) + (if a1-5 + (spawner-do-jump self a1-5) + ) + ) + ) + (('trigger) + (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + (go-virtual notice) + ) + ) + (('untrigger) + (if (not (and (-> self next-state) (= (-> self next-state name) 'idle))) + (go-virtual idle) + ) + ) + (('beaten) + (logior! (-> self flags) (battle-flags beaten)) + (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + (go-virtual beaten) + ) + ) + (('resume) + (logclear! (-> self flags) (battle-flags beaten)) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (if (and (-> self next-state) (= (-> self next-state name) 'beaten)) + (go-virtual hostile) + ) + ) + ) + ) + +;; definition for method 27 of type battle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-battle-marks ((this battle)) + (local-vars (sv-16 string) (sv-32 string)) + (let ((s4-0 (-> this root trans)) + (s5-0 (the-as int (-> this max-count))) + ) + (if (= (the-as uint s5-0) #x20000000) + (set! s5-0 0) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) s4-0 (new 'static 'rgba :g #xff :b #xff :a #x80)) + (let ((s3-0 add-debug-text-3d) + (s2-0 #t) + (s1-0 577) + ) + (format + (clear *temp-string*) + "~%~S~%count ~d/~d~%child ~d~%ally ~d~%die count ~d" + (-> this name) + (-> this count) + s5-0 + (-> this stat-child-count) + (-> this allies length) + (-> this die-count) + ) + (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color orange) (the-as vector2h #f)) + ) + ) + (dotimes (s5-1 (-> this spawners length)) + (let ((s4-1 (-> this spawners data s5-1))) + (let ((a0-6 (-> s4-1 intro-path))) + (if a0-6 + (debug-draw a0-6) + ) + ) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> s4-1 entity extra trans) + (new 'static 'rgba :g #xff :b #xff :a #x80) + ) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-1 577) + ) + (let ((s0-1 format)) + (set! sv-16 (clear *temp-string*)) + (set! sv-32 "~%spawner~%~S") + (let ((a2-5 (res-lump-struct (-> s4-1 entity) 'name structure))) + (s0-1 sv-16 sv-32 a2-5) + ) + ) + (s3-1 + s2-1 + (the-as bucket-id s1-1) + *temp-string* + (-> s4-1 entity extra trans) + (font-color yellow) + (the-as vector2h #f) + ) + ) + ) + 0 + ) + 0 + (none) + ) + +;; definition for method 26 of type battle +;; INFO: Used lq/sq +(defmethod spawner-blocked-by-collide? ((this battle) (arg0 battle-spawner)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f0-0 (-> this info spawner-blocked-by-collide-radius)) + ) + (set! (-> gp-0 quad) (-> arg0 attack-pos quad)) + (set! (-> gp-0 w) f0-0) + (let ((s5-0 (-> this info spawner-collide-with)) + (f30-0 (* f0-0 f0-0)) + ) + (set! *actor-list-length* 0) + (if (logtest? s5-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (the-as bounding-box gp-0) *actor-list* 256)) + ) + (when (logtest? s5-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-15 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-4 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s5-0 (-> a1-4 prim-core collide-as)) + (let ((a1-5 (-> a1-4 prim-core))) + (let ((a2-4 a1-5) + (a3-1 gp-0) + ) + (.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-1 (+ (-> a1-5 world-sphere w) (-> gp-0 w))) + ) + (when (< f0-2 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-15) + *collide-player-list* + (set! v1-15 (-> v1-15 next0)) + ) + ) + ) + ) + (when (logtest? s5-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-23 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-16 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? s5-0 (-> a1-16 prim-core collide-as)) + (let ((a1-17 (-> a1-16 prim-core))) + (let ((a2-11 a1-17) + (a3-2 gp-0) + ) + (.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-5 (+ (-> a1-17 world-sphere w) (-> gp-0 w))) + ) + (when (< f0-3 (* f1-5 f1-5)) + (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-23) + *collide-hit-by-player-list* + (set! v1-23 (-> v1-23 next0)) + ) + ) + ) + ) + (dotimes (s4-0 *actor-list-length*) + (let ((v1-28 (-> *actor-list* s4-0))) + (when (logtest? s5-0 (-> v1-28 root-prim prim-core collide-as)) + (if (>= f30-0 (vector-vector-xz-distance-squared gp-0 (-> v1-28 trans))) + (return #t) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 25 of type battle +(defmethod spawner-blocked? ((this battle) (arg0 battle-spawner)) + (when (not (logtest? (-> this flags) (battle-flags no-spawner-block))) + (let ((f0-0 (-> this info spawner-blocked-by-player-xz))) + (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) + (return #t) + ) + ) + (let ((f0-3 (-> this info spawner-blocked-by-collide-radius))) + (if (and (< 0.0 f0-3) (spawner-blocked-by-collide? this arg0)) + (return #t) + ) + ) + ) + #f + ) + +;; definition for method 37 of type battle +(defmethod spawner-free? ((this battle) (arg0 battle-spawner)) + (and (not (handle->process (-> arg0 creature))) + (and (not (-> *setting-control* user-current nuke-active?)) + (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? this arg0))) + ) + ) + ) + +;; definition for method 36 of type battle +(defmethod get-best-spawner ((this battle)) + (if (-> *setting-control* user-current nuke-active?) + (return (the-as battle-spawner #f)) + ) + (let ((s5-0 (-> this spawners length)) + (v1-6 (-> this info pick-logic)) + ) + (if (not *target*) + (set! v1-6 0) + ) + (cond + ((zero? v1-6) + (let ((s3-0 (rand-vu-int-count s5-0))) + (dotimes (s4-0 s5-0) + (let ((s2-0 (-> this spawners data s3-0))) + (if (spawner-free? this s2-0) + (return s2-0) + ) + ) + (set! s3-0 (mod (+ s3-0 1) s5-0)) + ) + ) + ) + ((= v1-6 1) + (let ((s4-1 0) + (f30-0 -1.0) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (let ((s3-1 (-> this spawners data s5-0))) + (when (spawner-free? this s3-1) + (let ((f0-0 (vector-vector-distance (target-pos 0) (-> s3-1 entity extra trans)))) + (when (and (>= (-> this info pick-spawner-max-dist) f0-0) (or (< f30-0 0.0) (< f0-0 f30-0))) + (set! s4-1 s5-0) + (set! f30-0 f0-0) + ) + ) + ) + ) + ) + (if (< 0.0 f30-0) + (return (-> this spawners data s4-1)) + ) + ) + ) + ) + ) + (the-as battle-spawner #f) + ) + +;; definition for method 41 of type battle +(defmethod get-random-breed ((this battle) (arg0 battle-spawner)) + (let ((f0-0 (rand-vu)) + (v1-0 0) + ) + (let ((a0-2 (-> arg0 breeds length))) + (dotimes (a1-1 a0-2) + (when (>= f0-0 0.0) + (set! f0-0 (- f0-0 (-> arg0 breeds data a1-1 percent))) + (if (< f0-0 0.0) + (set! v1-0 a1-1) + ) + ) + ) + ) + (-> arg0 breeds data v1-0) + ) + ) + +;; definition for method 38 of type battle +;; WARN: Return type mismatch int vs handle. +(defmethod spawn-from-breed ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) + (let* ((a1-1 (-> arg0 breed-type)) + (s4-0 (get-process *default-dead-pool* a1-1 #x4000 1)) + (v1-1 (when s4-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s4-0 this "battle-slave" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 enemy-init-by-other this arg1) + (-> s4-0 ppointer) + ) + ) + ) + (if (not v1-1) + (return (the-as handle #f)) + ) + (+! (-> this count) 1) + (the-as handle (ppointer->handle v1-1)) + ) + ) + +;; definition for method 39 of type battle +;; INFO: Used lq/sq +;; WARN: Return type mismatch handle vs none. +(defmethod spawn-from-spawner ((this battle) (arg0 battle-spawner) (arg1 symbol)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'quaternion)) + (s2-0 (-> arg0 intro-path)) + ) + (cond + (s2-0 + (let ((s1-0 0)) + (when arg1 + (set! s1-0 (-> arg0 ready-index)) + (set! s1-0 (cond + ((>= s1-0 0) + (empty) + s1-0 + ) + (else + (-> arg0 attack-index) + ) + ) + ) + ) + (set! (-> arg0 creature-index) s1-0) + (get-point-in-path! s2-0 s3-0 (the float s1-0) 'exact) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (displacement-between-two-points-normalized! s2-0 s0-0 (the float s1-0)) + (set! (-> s0-0 y) 0.0) + (vector-normalize! s0-0 1.0) + (forward-up->quaternion s4-0 s0-0 *up-vector*) + ) + ) + ) + (else + (set! (-> arg0 creature-index) 0) + (let ((v1-7 (-> arg0 entity))) + (set! (-> s3-0 quad) (-> v1-7 extra trans quad)) + (quaternion-copy! s4-0 (-> v1-7 quat)) + ) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'enemy-init-by-other-params)) + (s2-1 (!= s2-0 #f)) + (s0-1 (get-random-breed this arg0)) + ) + (set! (-> s1-1 trans quad) (-> s3-0 quad)) + (quaternion-copy! (-> s1-1 quat) s4-0) + (set! (-> s1-1 entity) (-> arg0 entity)) + (set! (-> s1-1 directed?) #t) + (set! (-> s1-1 no-initial-move-to-ground?) s2-1) + (set! (-> s1-1 art-level) #f) + (let ((v0-7 (spawn-from-breed this s0-1 s1-1))) + (when (handle->process v0-7) + (set! (-> arg0 creature) v0-7) + (set! (-> arg0 mode) (the-as uint 1)) + (set-time! (-> arg0 last-spawn-time)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 30 of type battle +(defmethod get-spawner-for-enemy ((this battle) (arg0 process)) + (let ((v1-0 (if (type? arg0 nav-enemy) + (the-as nav-enemy arg0) + ) + ) + ) + (when v1-0 + (dotimes (a0-3 (-> this spawners length)) + (let* ((a1-5 (-> this spawners data a0-3)) + (a2-2 (handle->process (-> a1-5 creature))) + ) + (when (and a2-2 (= a2-2 v1-0)) + (when (not (logtest? (enemy-flag directed) (-> (the-as nav-enemy a2-2) enemy-flags))) + (set! (-> a1-5 creature) (the-as handle #f)) + (set! a1-5 (the-as battle-spawner #f)) + ) + (return a1-5) + ) + ) + ) + ) + ) + (the-as battle-spawner #f) + ) + +;; definition for method 51 of type battle +(defmethod spawner-active? ((this battle) (arg0 battle-spawner) (arg1 symbol)) + (when (and (logtest? (-> this flags) (battle-flags active)) (not (logtest? (-> this flags) (battle-flags beaten)))) + (let ((v1-5 (-> arg0 noticed-attack-time))) + (cond + ((zero? v1-5) + (set-time! (-> arg0 noticed-attack-time)) + ) + (else + (if (time-elapsed? v1-5 (the-as time-frame (-> arg0 notice-attack-delay))) + (logior! (-> arg0 flags) (battle-spawner-flags hit)) + ) + ) + ) + ) + ) + (let ((s4-0 (handle->process (-> arg0 creature)))) + (when s4-0 + (when (not (logtest? (enemy-flag directed) (-> (the-as nav-enemy s4-0) enemy-flags))) + (set! (-> arg0 creature) (the-as handle #f)) + (return #f) + ) + (let ((v1-20 (-> arg0 mode))) + (cond + ((= v1-20 1) + (set! (-> arg0 mode) (the-as uint 0)) + 0 + ) + ((zero? v1-20) + (when (or (logtest? (enemy-flag directed-ready) (-> (the-as nav-enemy s4-0) enemy-flags)) (not arg1)) + (cond + ((spawner-in-intro? this arg0) + (if (not (spawner-try-jump this arg0 (the-as enemy s4-0))) + (return #t) + ) + ) + ((spawner-hittable? this arg0) + (spawner-hit this arg0 s4-0) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 46 of type battle +(defmethod spawner-in-intro? ((this battle) (arg0 battle-spawner)) + (when (-> arg0 intro-path) + (let ((v1-1 (-> arg0 creature-index)) + (a0-1 (-> arg0 attack-index)) + ) + (or (< v1-1 (-> arg0 ready-index)) (and (< v1-1 a0-1) (logtest? (-> arg0 flags) (battle-spawner-flags hit)))) + ) + ) + ) + +;; definition for method 43 of type battle +(defmethod spawner-try-jump ((this battle) (arg0 battle-spawner) (arg1 enemy)) + (let ((s3-0 (+ (-> arg0 creature-index) 1)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (if (and (= s3-0 (-> arg0 attack-index)) (spawner-blocked? this arg0)) + (return #f) + ) + (get-point-in-path! (-> arg0 intro-path) s4-0 (the float s3-0) 'exact) + (let ((s3-1 (-> arg0 mode))) + (set! (-> arg0 mode) (the-as uint 2)) + (set! (-> arg1 enemy-flags) + (the-as enemy-flag (logclear (-> arg1 enemy-flags) (enemy-flag jump-check-blocked))) + ) + (cond + ((send-event arg1 'jump 3 s4-0) + #t + ) + (else + (set! (-> arg0 mode) s3-1) + #f + ) + ) + ) + ) + ) + +;; definition for method 45 of type battle +(defmethod spawner-hittable? ((this battle) (arg0 battle-spawner)) + (when (logtest? (-> arg0 flags) (battle-spawner-flags hit)) + (if (-> arg0 intro-path) + (>= (-> arg0 creature-index) (-> arg0 attack-index)) + #t + ) + ) + ) + +;; definition for method 42 of type battle +(defmethod spawner-hit ((this battle) (arg0 battle-spawner) (arg1 process)) + (let ((s5-0 (-> arg0 creature))) + (set! (-> arg0 creature) (the-as handle #f)) + (cond + ((send-event arg1 'cue-chase) + #t + ) + (else + (set! (-> arg0 creature) s5-0) + #f + ) + ) + ) + ) + +;; definition for method 44 of type battle +(defmethod spawner-do-jump ((this battle) (arg0 battle-spawner)) + (when (= (-> arg0 mode) 2) + (+! (-> arg0 creature-index) 1) + (set! (-> arg0 mode) (the-as uint 0)) + (spawner-active? this arg0 #f) + ) + 0 + ) + +;; definition for method 52 of type battle +(defmethod spawner-active-count ((this battle)) + (let ((gp-0 0)) + (dotimes (s4-0 (-> this spawners length)) + (if (spawner-active? this (-> this spawners data s4-0) #t) + (+! gp-0 1) + ) + ) + gp-0 + ) + ) + +;; definition for method 40 of type battle +;; WARN: Return type mismatch int vs none. +(defmethod spawn-initial-creatures ((this battle)) + (set! (-> this spawn-initial-creatures?) #f) + (let ((s5-0 (-> this spawners))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((s3-0 (-> s5-0 data s4-0))) + (when (spawner-free? this s3-0) + (let ((v1-7 (res-lump-value (-> s3-0 entity) 'enemy-options uint128 :time -1000000000.0))) + (when (logtest? #x100000 v1-7) + (spawn-from-spawner this s3-0 #t) + (+! (-> this stat-child-count) 1) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 35 of type battle +(defmethod get-spawn-delay ((this battle)) + (let ((v1-0 (-> this info))) + (rand-vu-int-range + (the-as int (-> v1-0 min-battle-spawn-delay)) + (the-as int (-> v1-0 max-battle-spawn-delay)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (if (and (-> self spawn-initial-creatures?) (not (-> self info dont-spawn-initial-until-notice?))) + (spawn-initial-creatures self) + ) + (unset-battle-music self) + ) + :trans (behavior () + (let ((v1-1 (-> self info notice-spec))) + (when (not (logtest? v1-1 1)) + (let ((gp-0 #t)) + (if (and (logtest? v1-1 2) + (not (and *target* + (and (>= (-> self info notice-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) + ) + ) + ) + ) + (set! gp-0 #f) + ) + (if gp-0 + (go-virtual notice) + ) + ) + ) + ) + (if *display-battle-marks* + (draw-battle-marks self) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate notice (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval (the-as pair gp-0) :vector (-> self root trans)) + ) + ) + (set-battle-music self) + (if (-> self spawn-initial-creatures?) + (spawn-initial-creatures self) + ) + (if (logtest? (-> self flags) (battle-flags noticed)) + (go-virtual hostile) + ) + (logior! (-> self flags) (battle-flags noticed)) + ) + :trans (behavior () + (if *display-battle-marks* + (draw-battle-marks self) + ) + ) + :code (behavior () + (go-virtual hostile) + ) + ) + +;; definition for method 49 of type battle +(defmethod update-allies-list ((this battle)) + (with-pp + (let ((v1-0 (-> this allies)) + (gp-0 (-> this allies length)) + ) + (when (> gp-0 0) + (let* ((a1-4 (mod (-> pp clock integral-frame-counter) gp-0)) + (a3-0 (-> v1-0 data a1-4)) + ) + (when (logtest? (-> a3-0 entity extra perm status) (entity-perm-status dead)) + (+! (-> this die-count) 1) + (+! gp-0 -1) + (set! (-> v1-0 length) gp-0) + (if (and (nonzero? gp-0) (!= a1-4 gp-0)) + (mem-copy! (the-as pointer a3-0) (the-as pointer (-> v1-0 data gp-0)) 4) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +;; definition for method 50 of type battle +(defmethod beaten? ((this battle)) + (let ((s5-0 (spawner-active-count this)) + (v1-2 (update-allies-list this)) + (a1-0 (-> this child)) + (a0-3 0) + ) + (while a1-0 + (+! a0-3 1) + (set! a1-0 (-> a1-0 0 brother)) + (nop!) + (nop!) + ) + (set! (-> this stat-child-count) (the-as uint a0-3)) + (let ((a0-4 (+ v1-2 a0-3)) + (v1-4 (-> this max-count)) + ) + (if (>= (-> this die-count) v1-4) + (return #t) + ) + (logclear! (-> this flags) (battle-flags no-spawner-block)) + (cond + ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> this die-count))))) + (let ((a1-10 (-> this jammed-starting-time))) + (cond + ((zero? (-> this jammed-starting-time)) + (set-time! (-> this jammed-starting-time)) + ) + (else + (if (time-elapsed? a1-10 (seconds 3.5)) + (logior! (-> this flags) (battle-flags no-spawner-block)) + ) + ) + ) + ) + ) + (else + (set! (-> this jammed-starting-time) 0) + 0 + ) + ) + (cond + ((and (not (logtest? (-> this flags) (battle-flags beaten))) + (> (-> this spawners length) 0) + (< a0-4 (the-as int (-> this info desired-alive-count))) + (< (-> this count) v1-4) + ) + (when (time-elapsed? (-> this cant-spawn-time) (the-as time-frame (-> this next-spawn-delay))) + (let ((a1-25 (get-best-spawner this))) + (cond + (a1-25 + (spawn-from-spawner this a1-25 #f) + (set! (-> this next-spawn-delay) (the-as uint (get-spawn-delay this))) + (set-time! (-> this cant-spawn-time)) + ) + (else + (set-time! (-> this cant-spawn-time)) + ) + ) + ) + ) + ) + (else + (set-time! (-> this cant-spawn-time)) + ) + ) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate hostile (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self flags) (battle-flags active)) + (logclear! (-> self flags) (battle-flags no-spawner-block)) + (set! (-> self jammed-starting-time) 0) + (set! (-> self cant-spawn-time) 0) + (set! (-> self next-spawn-delay) (the-as uint 0)) + (set-battle-music self) + (let ((gp-0 (-> self on-hostile))) + (if gp-0 + (script-eval (the-as pair gp-0) :vector (-> self root trans)) + ) + ) + ) + :trans (behavior () + (if (beaten? self) + (go-virtual beaten) + ) + (if *display-battle-marks* + (draw-battle-marks self) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate beaten (battle) + :virtual #t + :event battle-event-handler + :enter (behavior () + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (let ((gp-0 (-> self on-beaten))) + (if gp-0 + (script-eval (the-as pair gp-0) :vector (-> self root trans)) + ) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (unset-battle-music self) + ) + :code sleep-code + ) + +;; definition for method 47 of type battle +;; WARN: Return type mismatch battle-flags vs none. +(defmethod set-battle-music ((this battle)) + (let ((a3-0 (-> this info play-battle-music))) + (when (and a3-0 (not (logtest? (-> this flags) (battle-flags battle-music-set)))) + (case a3-0 + (('sound-mode) + (set-setting! 'sound-mode #f 0.0 1) + ) + (else + (set-setting! 'music a3-0 0.0 0) + ) + ) + (logior! (-> this flags) (battle-flags battle-music-set)) + ) + ) + (none) + ) + +;; definition for method 48 of type battle +;; WARN: Return type mismatch int vs none. +(defmethod unset-battle-music ((this battle)) + (when (logtest? (-> this flags) (battle-flags battle-music-set)) + (remove-setting! 'sound-mode) + (remove-setting! 'music) + ) + 0 + (none) + ) + +;; definition for method 7 of type battle-spawner-array +(defmethod relocate ((this battle-spawner-array) (offset int)) + (dotimes (v1-0 (-> this length)) + (let ((a2-3 (-> this data v1-0))) + (&+! (-> a2-3 breeds) offset) + (if (-> a2-3 intro-path) + (&+! (-> a2-3 intro-path) offset) + ) + ) + ) + this + ) + +;; definition for method 7 of type battle +(defmethod relocate ((this battle) (offset int)) + (&+! (-> this spawners) offset) + (&+! (-> this allies) offset) + (call-parent-method this offset) + ) + +;; definition for method 29 of type battle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod initialize-spawner-breeds ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (let ((s2-0 0) + (s5-0 0) + (s4-0 0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((s1-0 (res-lump-data arg1 'spawn-types pointer :tag-ptr (& sv-16)))) + (dotimes (s0-0 2) + (set! s2-0 0) + (when s1-0 + (set! s4-0 (the-as int (-> sv-16 elt-count))) + (dotimes (v1-5 s4-0) + (let ((a0-4 (-> (the-as (pointer uint32) (&+ s1-0 (* v1-5 4)))))) + (when (nonzero? a0-4) + (set! s5-0 (logior s5-0 (ash 1 v1-5))) + (+! s2-0 1) + (when (= s0-0 1) + (let ((a1-10 (-> arg0 breeds data (+ s2-0 -1)))) + (set! (-> a1-10 breed-type) (the-as type a0-4)) + (set! (-> a1-10 percent) 1.0) + ) + ) + ) + ) + ) + ) + (if (zero? s0-0) + (set! (-> arg0 breeds) (new 'process 'battle-breed-array (max 1 s2-0))) + ) + ) + ) + (cond + ((zero? s2-0) + (let ((v1-15 (-> arg0 breeds data))) + (set! (-> v1-15 0 breed-type) (-> arg1 etype)) + (set! (-> v1-15 0 percent) 1.0) + ) + ) + (else + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-18 (res-lump-data arg1 'spawn-percs pointer :tag-ptr (& sv-32)))) + (when v1-18 + (let ((a0-16 (min (the-as int (-> sv-32 elt-count)) s4-0)) + (a1-14 0) + (a2-7 (-> arg0 breeds)) + ) + (dotimes (a3-2 a0-16) + (when (logtest? s5-0 (ash 1 a3-2)) + (let ((t0-8 (-> a2-7 data a1-14))) + (set! (-> t0-8 percent) (-> (the-as (pointer float) (&+ v1-18 (* a3-2 4))))) + ) + (+! a1-14 1) + ) + ) + ) + ) + ) + (let ((f30-0 0.0) + (s5-1 (-> arg0 breeds)) + ) + (dotimes (v1-20 (-> s5-1 length)) + (+! f30-0 (-> s5-1 data v1-20 percent)) + ) + (when (!= f30-0 1.0) + (format + 0 + "WARNING: battle spawner ~A has spawn percents that don't sum to 1.0.~%" + (res-lump-struct (-> arg0 entity) 'name structure) + ) + (dotimes (v1-26 (-> s5-1 length)) + (let ((a0-27 (-> s5-1 data v1-26))) + (set! (-> a0-27 percent) (/ (-> a0-27 percent) f30-0)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type battle +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod initialize-spawner ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) + (set! (-> arg0 flags) (battle-spawner-flags)) + (set! (-> arg0 entity) arg1) + (set! (-> arg0 creature-index) 0) + (set! (-> arg0 ready-index) -1) + (set! (-> arg0 attack-index) 0) + (set! (-> arg0 intro-path) #f) + (set! (-> arg0 notice-attack-delay) + (the-as uint (rand-vu-int-range + (the-as int (-> this info min-spawner-notice-attack-delay)) + (the-as int (-> this info max-spawner-notice-attack-delay)) + ) + ) + ) + (set! (-> arg0 creature) (the-as handle #f)) + (set! (-> arg0 last-spawn-time) 0) + (set! (-> arg0 noticed-attack-time) 0) + (initialize-spawner-breeds this arg0 arg1) + (let ((a0-4 (new 'process 'path-control this 'intro 0.0 arg1 #t))) + (cond + ((nonzero? a0-4) + (set! (-> arg0 intro-path) a0-4) + (logior! (-> a0-4 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s5-1 (-> a0-4 curve num-cverts))) + (let ((v1-9 (+ s5-1 -1))) + (set! (-> arg0 attack-index) v1-9) + (get-point-in-path! a0-4 (-> arg0 attack-pos) (the float v1-9) 'exact) + ) + (let ((v0-4 -1)) + (if (< 2 s5-1) + (set! v0-4 1) + ) + (set! (-> arg0 ready-index) v0-4) + ) + ) + ) + (else + (set! (-> arg0 attack-pos quad) (-> arg0 entity extra trans quad)) + ) + ) + ) + (none) + ) + +;; definition for method 31 of type battle +;; WARN: Return type mismatch int vs none. +(defmethod initialize-ally ((this battle) (arg0 battle-ally) (arg1 entity-actor)) + (set! (-> arg0 entity) arg1) + 0 + (none) + ) + +;; definition for method 28 of type battle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod initialize-enemy-lists ((this battle)) + (local-vars (v0-4 battle-ally-array) (sv-16 res-tag) (sv-32 entity)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v0-0 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (when (and v0-0 (nonzero? (-> sv-16 elt-count))) + (let* ((s5-0 (-> (the-as (pointer actor-group) v0-0) 0)) + (s4-0 (-> s5-0 length)) + ) + (dotimes (s3-0 2) + (let ((s1-0 0) + (s2-0 0) + ) + (dotimes (s0-0 s4-0) + (set! sv-32 (-> s5-0 data s0-0 actor)) + (when sv-32 + (let ((v0-1 (res-lump-value sv-32 'enemy-options uint128 :time -1000000000.0))) + (cond + ((logtest? #x80000 v0-1) + (+! s1-0 1) + (cond + ((zero? s3-0) + 0 + ) + (else + (let ((a1-2 (-> this spawners data (+ s1-0 -1)))) + (initialize-spawner this a1-2 (the-as entity-actor sv-32)) + ) + ) + ) + ) + (else + (when (not (logtest? (-> sv-32 extra perm status) (entity-perm-status dead))) + (+! s2-0 1) + (cond + ((zero? s3-0) + 0 + ) + (else + (let ((a1-3 (-> this allies data (+ s2-0 -1)))) + (initialize-ally this a1-3 (the-as entity-actor sv-32)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! v0-4 (when (zero? s3-0) + (set! (-> this spawners) (new 'process 'battle-spawner-array s1-0)) + (set! v0-4 (new 'process 'battle-ally-array s2-0)) + (set! (-> this allies) v0-4) + v0-4 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 33 of type battle +;; WARN: Return type mismatch int vs none. +(defmethod initialize-battle ((this battle)) + (set! (-> this spawn-initial-creatures?) #t) + (set! (-> this count) (the-as uint 0)) + (set! (-> this die-count) (the-as uint 0)) + (set! (-> this stat-child-count) (the-as uint 0)) + (let ((v1-2 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)) + (a0-2 *battles*) + ) + (dotimes (a1-1 (-> a0-2 length)) + (let ((a2-3 (-> a0-2 a1-1))) + (when (= (the-as uint v1-2) (-> a2-3 id)) + (set! (-> this info) a2-3) + (goto cfg-7) + ) + ) + ) + ) + (go process-drawable-art-error "bad battle id") + (label cfg-7) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice basic)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile basic)) + (set! (-> this on-beaten) (res-lump-struct (-> this entity) 'on-beaten basic)) + (initialize-enemy-lists this) + (+! (-> this count) (-> this allies length)) + (let ((v1-16 (-> this info max-count))) + (cond + ((and (= v1-16 #x20000000) (zero? (-> this spawners length))) + (set! v1-16 (-> this count)) + ) + ((< v1-16 (-> this count)) + (set! v1-16 (-> this count)) + ) + ) + (set! (-> this max-count) v1-16) + ) + 0 + (none) + ) + +;; definition for method 34 of type battle +(defmethod init-go ((this battle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this beaten)) + (go (method-of-object this idle)) + ) + 0 + ) + +;; definition for method 11 of type battle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defmethod init-from-entity! ((this battle) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'trsqv))) + (set! (-> this root) s4-0) + (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) + (vector-identity! (-> s4-0 scale)) + ) + (initialize-battle this) + (init-go this) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc new file mode 100644 index 0000000000..8144e7b4f6 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc @@ -0,0 +1,1074 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type elec-gate-params +(deftype elec-gate-params (structure) + ((bolt-spec lightning-spec) + (ring-spec lightning-spec) + (ring-radius-min float) + (ring-radius-max float) + (speed-mult float) + (min-dist float) + (max-dist float) + (plane-expand-xz float) + (plane-expand-y float) + (plane-shift-z float) + ) + ) + +;; definition for method 3 of type elec-gate-params +(defmethod inspect ((this elec-gate-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'elec-gate-params) + (format #t "~1Tbolt-spec: ~A~%" (-> this bolt-spec)) + (format #t "~1Tring-spec: ~A~%" (-> this ring-spec)) + (format #t "~1Tring-radius-min: ~f~%" (-> this ring-radius-min)) + (format #t "~1Tring-radius-max: ~f~%" (-> this ring-radius-max)) + (format #t "~1Tspeed-mult: ~f~%" (-> this speed-mult)) + (format #t "~1Tmin-dist: ~f~%" (-> this min-dist)) + (format #t "~1Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~1Tplane-expand-xz: ~f~%" (-> this plane-expand-xz)) + (format #t "~1Tplane-expand-y: ~f~%" (-> this plane-expand-y)) + (format #t "~1Tplane-shift-z: ~f~%" (-> this plane-shift-z)) + (label cfg-4) + this + ) + +;; definition of type elec-gate-bolt +(deftype elec-gate-bolt (structure) + ((ring lightning-control 2) + (bolt lightning-control) + (ring-radius float) + (pos float) + ) + ) + +;; definition for method 3 of type elec-gate-bolt +(defmethod inspect ((this elec-gate-bolt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'elec-gate-bolt) + (format #t "~1Tring[2] @ #x~X~%" (-> this ring)) + (format #t "~1Tbolt: ~A~%" (-> this bolt)) + (format #t "~1Tring-radius: ~f~%" (-> this ring-radius)) + (format #t "~1Tpos: ~f~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition of type elec-wall +(deftype elec-wall (structure) + ((pos vector :inline) + (dir vector :inline) + ) + ) + +;; definition for method 3 of type elec-wall +(defmethod inspect ((this elec-wall)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'elec-wall) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tdir: #~%" (-> this dir)) + (label cfg-4) + this + ) + +;; definition of type elec-gate +(deftype elec-gate (process-drawable) + ((params elec-gate-params) + (path-l path-control :overlay-at path) + (path-r path-control) + (l-bolt elec-gate-bolt 5 :inline) + (part-on sparticle-launch-control :overlay-at part) + (part-off sparticle-launch-control) + (part-spawner-left part-spawner) + (part-spawner-right part-spawner) + (on-start pair) + (on-stop pair) + (on-shutdown pair) + (on-trigger pair) + (dividing-wall elec-wall :inline) + (plane elec-wall 2 :inline) + (wall-y float) + (wall-xz float) + (lightning-quality float) + (quality-enabled? symbol) + ) + (:state-methods + idle + active + shutdown-camera + shutdown + ) + (:methods + (get-params (_type_) elec-gate-params) + (elec-gate-method-25 (_type_) none) + (elec-gate-method-26 (_type_) none) + (go-initial-state (_type_) object) + (spawn-particles (_type_ sparticle-launch-control) none) + (set-elec-scale! (_type_ float) none) + (elec-gate-method-30 (_type_ float) none) + ) + ) + +;; definition for method 3 of type elec-gate +(defmethod inspect ((this elec-gate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Tpath-l: ~A~%" (-> this path)) + (format #t "~2Tpath-r: ~A~%" (-> this path-r)) + (format #t "~2Tl-bolt[5] @ #x~X~%" (-> this l-bolt)) + (format #t "~2Tpart-on: ~A~%" (-> this part)) + (format #t "~2Tpart-off: ~A~%" (-> this part-off)) + (format #t "~2Tpart-spawner-left: ~A~%" (-> this part-spawner-left)) + (format #t "~2Tpart-spawner-right: ~A~%" (-> this part-spawner-right)) + (format #t "~2Ton-start: ~A~%" (-> this on-start)) + (format #t "~2Ton-stop: ~A~%" (-> this on-stop)) + (format #t "~2Ton-shutdown: ~A~%" (-> this on-shutdown)) + (format #t "~2Ton-trigger: ~A~%" (-> this on-trigger)) + (format #t "~2Tdividing-wall: #~%" (-> this dividing-wall)) + (format #t "~2Tplane[2] @ #x~X~%" (-> this plane)) + (format #t "~2Twall-y: ~f~%" (-> this wall-y)) + (format #t "~2Twall-xz: ~f~%" (-> this wall-xz)) + (format #t "~2Tlightning-quality: ~f~%" (-> this lightning-quality)) + (format #t "~2Tquality-enabled?: ~A~%" (-> this quality-enabled?)) + (label cfg-4) + this + ) + +;; definition for symbol *default-elec-gate-params*, type elec-gate-params +(define *default-elec-gate-params* (new 'static 'elec-gate-params + :bolt-spec (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8601.6 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + :ring-spec (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :rand-func #x3 + :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 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 12 + :box-size 3072.0 + :merge-factor 0.5 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + :ring-radius-min 1638.4 + :ring-radius-max 2867.2 + :speed-mult 1.0 + :min-dist 163840.0 + :max-dist 491520.0 + :plane-expand-xz 8192.0 + :plane-expand-y 81920.0 + ) + ) + +;; definition for function elec-gate-post +;; INFO: Used lq/sq +(defbehavior elec-gate-post elec-gate () + (local-vars (sv-96 lightning-control) (sv-112 vector)) + (let ((gp-0 (-> self params))) + (dotimes (s5-0 5) + (let* ((s2-0 (-> self l-bolt s5-0)) + (s4-0 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) (-> s2-0 pos) 'interp)) + (s3-0 (get-point-at-percent-along-path! (-> self path-r) (new 'stack-no-clear 'vector) (-> s2-0 pos) 'interp)) + ) + (let ((a0-2 (-> s2-0 bolt)) + (v1-4 s4-0) + ) + (set! (-> a0-2 state meet data 0 quad) (-> v1-4 quad)) + ) + (let ((a0-5 (-> s2-0 bolt)) + (v1-6 s3-0) + ) + (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-6 quad)) + ) + (when (-> gp-0 ring-spec) + (let ((s1-0 (-> gp-0 ring-spec num-points)) + (s0-0 (-> s2-0 ring 0)) + ) + (set! sv-96 (-> s2-0 ring 1)) + (set! sv-112 (new 'stack-no-clear 'vector)) + (set! (-> sv-112 x) 0.0) + (set! (-> sv-112 y) 0.0) + (set! (-> sv-112 z) (-> s2-0 ring-radius)) + (set! (-> sv-112 w) 0.0) + (let ((f30-0 (* 65536.0 (/ 1.0 (the float (+ s1-0 -1)))))) + (dotimes (s2-1 s1-0) + (set-point! s0-0 s2-1 (vector+! (new 'stack-no-clear 'vector) s4-0 sv-112)) + (set-point! sv-96 s2-1 (vector+! (new 'stack-no-clear 'vector) s3-0 sv-112)) + (vector-rotate-y! sv-112 sv-112 f30-0) + ) + ) + ) + ) + ) + ) + ) + (debug-draw (-> self path)) + (debug-draw (-> self path-r)) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (elec-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (let ((gp-0 (-> self on-trigger))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + (go-virtual active) + ) + ) + ) + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (dotimes (v1-0 5) + (let ((a0-3 (-> self l-bolt v1-0 bolt)) + (a1-1 0) + ) + (let ((a2-2 (!= a1-1 (-> a0-3 state mode)))) + (case a1-1 + ((3) + (if a2-2 + (set! (-> a0-3 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-3 state start-color) (-> a0-3 spec start-color)) + (set! (-> a0-3 state end-color) (-> a0-3 spec end-color)) + ) + ) + ) + (set! (-> a0-3 state mode) (the-as uint a1-1)) + ) + (when (-> self params ring-spec) + (let ((a0-9 (-> self l-bolt v1-0 ring 0)) + (a1-2 0) + ) + (let ((a2-12 (!= a1-2 (-> a0-9 state mode)))) + (case a1-2 + ((3) + (if a2-12 + (set! (-> a0-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-9 state start-color) (-> a0-9 spec start-color)) + (set! (-> a0-9 state end-color) (-> a0-9 spec end-color)) + ) + ) + ) + (set! (-> a0-9 state mode) (the-as uint a1-2)) + ) + (let ((a0-12 (-> self l-bolt v1-0 ring 1)) + (a1-3 0) + ) + (let ((a2-22 (!= a1-3 (-> a0-12 state mode)))) + (case a1-3 + ((3) + (if a2-22 + (set! (-> a0-12 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-12 state start-color) (-> a0-12 spec start-color)) + (set! (-> a0-12 state end-color) (-> a0-12 spec end-color)) + ) + ) + ) + (set! (-> a0-12 state mode) (the-as uint a1-3)) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (set-elec-scale! self 0.0) + (if (nonzero? (-> self part-off)) + (spawn-particles self (-> self part-off)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (elec-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('shutdown) + (go-virtual shutdown-camera) + ) + ) + ) + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (if (-> self on-start) + (script-eval (-> self on-start) :vector (-> self root trans)) + ) + (dotimes (v1-7 5) + (set! (-> self l-bolt v1-7 pos) (+ -1.0 (* 0.2 (the float v1-7)))) + (let ((a0-9 (-> self l-bolt v1-7 bolt)) + (a1-3 0) + ) + (let ((a2-3 (!= a1-3 (-> a0-9 state mode)))) + (case a1-3 + ((3) + (if a2-3 + (set! (-> a0-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-9 state start-color) (-> a0-9 spec start-color)) + (set! (-> a0-9 state end-color) (-> a0-9 spec end-color)) + ) + ) + ) + (set! (-> a0-9 state mode) (the-as uint a1-3)) + ) + (when (-> self params ring-spec) + (let ((a0-15 (-> self l-bolt v1-7 ring 0)) + (a1-4 0) + ) + (let ((a2-13 (!= a1-4 (-> a0-15 state mode)))) + (case a1-4 + ((3) + (if a2-13 + (set! (-> a0-15 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-15 state start-color) (-> a0-15 spec start-color)) + (set! (-> a0-15 state end-color) (-> a0-15 spec end-color)) + ) + ) + ) + (set! (-> a0-15 state mode) (the-as uint a1-4)) + ) + (let ((a0-18 (-> self l-bolt v1-7 ring 1)) + (a1-5 0) + ) + (let ((a2-23 (!= a1-5 (-> a0-18 state mode)))) + (case a1-5 + ((3) + (if a2-23 + (set! (-> a0-18 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-18 state start-color) (-> a0-18 spec start-color)) + (set! (-> a0-18 state end-color) (-> a0-18 spec end-color)) + ) + ) + ) + (set! (-> a0-18 state mode) (the-as uint a1-5)) + ) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 2))) + (dotimes (v1-10 2) + (set! (-> gp-0 v1-10 quad) (the-as uint128 0)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + (get-point-in-path! (-> self path) (-> gp-0 0) 0.0 'interp) + (get-point-in-path! (-> self path-r) (-> gp-0 1) 0.0 'interp) + (vector-! s5-0 (-> gp-0 1) (-> gp-0 0)) + (vector-normalize! s5-0 (+ (-> self params plane-expand-xz) (res-lump-float (-> self entity) 'width))) + (vector+! (-> gp-0 1) (-> gp-0 1) s5-0) + (vector-negate! s5-0 s5-0) + (vector+! (-> gp-0 0) (-> gp-0 0) s5-0) + (vector-! s5-0 (-> gp-0 1) (-> gp-0 0)) + (vector-normalize! s5-0 -1.0) + (vector-cross! s5-0 s5-0 *y-vector*) + (vector+float*! (-> gp-0 0) (-> gp-0 0) s5-0 (-> self params plane-shift-z)) + (vector+float*! (-> gp-0 1) (-> gp-0 1) s5-0 (-> self params plane-shift-z)) + (vector-normalize-copy! s5-0 *up-vector* -8192.0) + (vector+! (-> gp-0 0) (-> gp-0 0) s5-0) + (vector+! (-> gp-0 1) (-> gp-0 1) s5-0) + ) + (let ((f0-12 + (+ (- (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) (get-num-segments (-> self path)) 'interp) + y + ) + (-> (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp) y) + ) + (-> self params plane-expand-y) + ) + ) + ) + (blocking-plane-spawn (the-as curve-control #f) gp-0 f0-12) + ) + ) + ) + :trans (behavior () + (local-vars + (sv-176 lightning-spec) + (sv-192 int) + (sv-208 symbol) + (sv-224 symbol) + (sv-240 int) + (sv-256 symbol) + (sv-272 symbol) + ) + (let ((gp-0 *target*)) + (when gp-0 + (when (not (focus-test? gp-0 disable dead ignore grabbed pilot-riding pilot mech teleporting invulnerable)) + (let* ((v1-5 (get-trans gp-0 0)) + (a1-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (the-as vector (-> self dividing-wall)))) + (s5-0 (-> self plane (if (< 0.0 (vector-dot a1-2 (-> self dividing-wall dir))) + 0 + 1 + ) + ) + ) + (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> s5-0 pos))) + ) + (when (and (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 1.0) (-> s5-0 dir)) 0.0) + (let ((v1-10 s4-1)) + (< (sqrtf (+ (* (-> v1-10 x) (-> v1-10 x)) (* (-> v1-10 z) (-> v1-10 z)))) (-> self wall-xz)) + ) + (< (fabs (-> s4-1 y)) (-> self wall-y)) + ) + (send-event + gp-0 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (vector (-> s5-0 dir)) + (shove-back (meters 6)) + (shove-up (meters 3)) + (control (if (focus-test? gp-0 board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (let* ((s5-1 (-> self l-bolt)) + (s4-2 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) (-> s5-1 0 pos) 'interp)) + (s5-2 + (get-point-at-percent-along-path! (-> self path-r) (new 'stack-no-clear 'vector) (-> s5-1 0 pos) 'interp) + ) + ) + (let ((s3-0 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when s3-0 + (let ((t9-6 (method-of-type lightning-tracker activate))) + (t9-6 (the-as lightning-tracker s3-0) *entity-pool* "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((s2-0 run-function-in-process) + (s1-0 s3-0) + (s0-0 lightning-tracker-init) + ) + (set! sv-176 (-> self params bolt-spec)) + (set! sv-192 15) + (set! sv-208 (the-as symbol #f)) + (set! sv-224 (the-as symbol #f)) + (let ((t3-0 (get-trans gp-0 3))) + ((the-as (function object object object object object object object object none) s2-0) + s1-0 + s0-0 + sv-176 + sv-192 + sv-208 + sv-224 + s4-2 + t3-0 + ) + ) + ) + (-> s3-0 ppointer) + ) + ) + (let ((s4-3 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when s4-3 + (let ((t9-10 (method-of-type lightning-tracker activate))) + (t9-10 (the-as lightning-tracker s4-3) *entity-pool* "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((s3-1 run-function-in-process) + (s2-1 s4-3) + (s1-1 lightning-tracker-init) + (s0-1 (-> self params bolt-spec)) + ) + (set! sv-240 15) + (set! sv-256 (the-as symbol #f)) + (set! sv-272 (the-as symbol #f)) + (let ((t3-1 (get-trans gp-0 3))) + ((the-as (function object object object object object object object object none) s3-1) + s2-1 + s1-1 + s0-1 + sv-240 + sv-256 + sv-272 + s5-2 + t3-1 + ) + ) + ) + (-> s4-3 ppointer) + ) + ) + ) + ) + ) + ) + (set! (-> self lightning-quality) (lerp-scale + 0.0 + 1.0 + (vector-vector-distance (get-trans gp-0 0) (-> self root trans)) + (-> self params max-dist) + (-> self params min-dist) + ) + ) + ) + ) + (let ((gp-1 (+ (the int (* 5.0 (-> self lightning-quality))) 1))) + (dotimes (s5-4 5) + (let ((s3-3 (-> self l-bolt s5-4)) + (s2-3 (-> self params)) + (s4-5 (if (and (-> self quality-enabled?) (zero? (mod s5-4 gp-1))) + 0 + -1 + ) + ) + ) + (seek! (-> s3-3 pos) 1.5 (* (-> s2-3 speed-mult) (+ 0.2 (fabs (-> s3-3 pos))) (seconds-per-frame))) + (cond + ((>= (-> s3-3 pos) 1.5) + (set! (-> s3-3 ring-radius) (rand-vu-float-range (-> s2-3 ring-radius-min) (-> s2-3 ring-radius-max))) + (set! (-> s3-3 pos) 0.0) + ) + ((>= (-> s3-3 pos) 1.0) + (let ((v1-56 (-> self l-bolt s5-4 bolt)) + (a0-40 (logand 0 s4-5)) + ) + (let ((a1-21 (!= a0-40 (-> v1-56 state mode)))) + (case a0-40 + ((3) + (if a1-21 + (set! (-> v1-56 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-56 state start-color) (-> v1-56 spec start-color)) + (set! (-> v1-56 state end-color) (-> v1-56 spec end-color)) + ) + ) + ) + (set! (-> v1-56 state mode) (the-as uint a0-40)) + ) + (when (-> self params ring-spec) + (let ((v1-62 (-> self l-bolt s5-4 ring 0)) + (a0-41 (logand 0 s4-5)) + ) + (let ((a1-31 (!= a0-41 (-> v1-62 state mode)))) + (case a0-41 + ((3) + (if a1-31 + (set! (-> v1-62 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-62 state start-color) (-> v1-62 spec start-color)) + (set! (-> v1-62 state end-color) (-> v1-62 spec end-color)) + ) + ) + ) + (set! (-> v1-62 state mode) (the-as uint a0-41)) + ) + (let ((a0-42 (-> self l-bolt s5-4 ring 1)) + (v1-65 (logand 0 s4-5)) + ) + (let ((a1-41 (!= v1-65 (-> a0-42 state mode)))) + (case v1-65 + ((3) + (if a1-41 + (set! (-> a0-42 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-42 state start-color) (-> a0-42 spec start-color)) + (set! (-> a0-42 state end-color) (-> a0-42 spec end-color)) + ) + ) + ) + (set! (-> a0-42 state mode) (the-as uint v1-65)) + ) + ) + ) + ((< 0.0 (-> s3-3 pos)) + (when (zero? (-> self l-bolt s5-4 bolt state mode)) + (let ((v1-74 (-> self l-bolt s5-4 bolt)) + (a0-43 (logand s4-5 1)) + ) + (let ((a1-51 (!= a0-43 (-> v1-74 state mode)))) + (case a0-43 + ((3) + (if a1-51 + (set! (-> v1-74 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-74 state start-color) (-> v1-74 spec start-color)) + (set! (-> v1-74 state end-color) (-> v1-74 spec end-color)) + ) + ) + ) + (set! (-> v1-74 state mode) (the-as uint a0-43)) + ) + (when (-> self params ring-spec) + (let ((v1-80 (-> self l-bolt s5-4 ring 0)) + (a0-44 (logand s4-5 1)) + ) + (let ((a1-61 (!= a0-44 (-> v1-80 state mode)))) + (case a0-44 + ((3) + (if a1-61 + (set! (-> v1-80 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-80 state start-color) (-> v1-80 spec start-color)) + (set! (-> v1-80 state end-color) (-> v1-80 spec end-color)) + ) + ) + ) + (set! (-> v1-80 state mode) (the-as uint a0-44)) + ) + (let ((a0-45 (-> self l-bolt s5-4 ring 1)) + (v1-83 (logand s4-5 1)) + ) + (let ((a1-71 (!= v1-83 (-> a0-45 state mode)))) + (case v1-83 + ((3) + (if a1-71 + (set! (-> a0-45 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-45 state start-color) (-> a0-45 spec start-color)) + (set! (-> a0-45 state end-color) (-> a0-45 spec end-color)) + ) + ) + ) + (set! (-> a0-45 state mode) (the-as uint v1-83)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (set-elec-scale! self 1.0) + (if (nonzero? (-> self part)) + (spawn-particles self (-> self part)) + ) + (update! (-> self sound)) + (elec-gate-post) + ) + ) + +;; failed to figure out what this is: +(defstate shutdown-camera (elec-gate) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (format 0 "~s~%" (-> self name)) + (if (res-lump-struct (-> self entity) 'camera-name structure) + (process-spawn + external-camera-controller + (-> self entity) + 600 + #f + :name "external-camera-controller" + :to *entity-pool* + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (go-virtual shutdown) + ) + :post (behavior () + (elec-gate-post) + ) + ) + +;; failed to figure out what this is: +(defstate shutdown (elec-gate) + :virtual #t + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (stop! (-> self sound)) + (sound-play "elec-gate-off") + (blocking-plane-destroy) + (if (-> self on-stop) + (script-eval (-> self on-stop) :vector (-> self root trans)) + ) + ) + :trans (behavior () + (let ((gp-0 #t)) + (dotimes (s5-0 5) + (let ((s4-0 (-> self l-bolt s5-0))) + (seek! (-> s4-0 pos) 0.0 (seconds-per-frame)) + (set! gp-0 (cond + ((or (< 1.0 (-> s4-0 pos)) (>= 0.0 (-> s4-0 pos))) + (when (= (-> self l-bolt s5-0 bolt state mode) 2) + (let ((v1-9 (-> self l-bolt s5-0 bolt)) + (a0-6 3) + ) + (let ((a1-2 (!= a0-6 (-> v1-9 state mode)))) + (case a0-6 + ((3) + (if a1-2 + (set! (-> v1-9 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-9 state start-color) (-> v1-9 spec start-color)) + (set! (-> v1-9 state end-color) (-> v1-9 spec end-color)) + ) + ) + ) + (set! (-> v1-9 state mode) (the-as uint a0-6)) + ) + (when (-> self params ring-spec) + (let ((v1-14 (-> self l-bolt s5-0 ring 0)) + (a0-8 3) + ) + (let ((a1-12 (!= a0-8 (-> v1-14 state mode)))) + (case a0-8 + ((3) + (if a1-12 + (set! (-> v1-14 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-14 state start-color) (-> v1-14 spec start-color)) + (set! (-> v1-14 state end-color) (-> v1-14 spec end-color)) + ) + ) + ) + (set! (-> v1-14 state mode) (the-as uint a0-8)) + ) + (let ((v1-17 (-> self l-bolt s5-0 ring 1)) + (a0-9 3) + ) + (let ((a1-22 (!= a0-9 (-> v1-17 state mode)))) + (case a0-9 + ((3) + (if a1-22 + (set! (-> v1-17 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) + (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) + ) + ) + ) + (set! (-> v1-17 state mode) (the-as uint a0-9)) + ) + ) + ) + gp-0 + ) + (else + #f + ) + ) + ) + ) + ) + (when gp-0 + (let ((gp-1 (-> self on-shutdown))) + (if gp-1 + (script-eval gp-1 :vector (-> self root trans)) + ) + ) + (go-virtual idle) + ) + ) + ) + :code sleep-code + :post (behavior () + (set-elec-scale! self 0.0) + (if (nonzero? (-> self part-off)) + (spawn-particles self (-> self part-off)) + ) + (elec-gate-post) + ) + ) + +;; definition for method 29 of type elec-gate +;; WARN: Return type mismatch int vs none. +(defmethod set-elec-scale! ((this elec-gate) (arg0 float)) + (if (< (vector-vector-distance (-> this root trans) (target-pos 0)) 327680.0) + (elec-gate-method-30 this arg0) + ) + 0 + (none) + ) + +;; definition for method 30 of type elec-gate +;; WARN: Return type mismatch int vs none. +(defmethod elec-gate-method-30 ((this elec-gate) (arg0 float)) + 0 + (none) + ) + +;; definition for method 28 of type elec-gate +;; WARN: Return type mismatch int vs none. +(defmethod spawn-particles ((this elec-gate) (arg0 sparticle-launch-control)) + (if (-> this part-spawner-left) + (spawn arg0 (the-as vector (&-> (-> this part-spawner-left child) 8))) + ) + (if (-> this part-spawner-right) + (spawn arg0 (the-as vector (&-> (-> this part-spawner-right child) 8))) + ) + 0 + (none) + ) + +;; definition for method 7 of type elec-gate +;; WARN: Return type mismatch process-drawable vs elec-gate. +(defmethod relocate ((this elec-gate) (offset int)) + (dotimes (v1-0 5) + (let ((a2-2 (-> this l-bolt v1-0))) + (if (nonzero? (-> a2-2 bolt)) + (&+! (-> a2-2 bolt) offset) + ) + (if (nonzero? (-> a2-2 ring 0)) + (&+! (-> a2-2 ring 0) offset) + ) + (if (nonzero? (-> a2-2 ring 1)) + (&+! (-> a2-2 ring 1) offset) + ) + ) + ) + (if (nonzero? (-> this path-r)) + (&+! (-> this path-r) offset) + ) + (when (nonzero? (-> this part-off)) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) offset) + ) + ) + (the-as elec-gate ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for method 10 of type elec-gate +(defmethod deactivate ((this elec-gate)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this root)) + (set-elec-scale! this 0.0) + ) + (if (nonzero? (-> this part-off)) + (kill-particles (-> this part-off)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 24 of type elec-gate +(defmethod get-params ((this elec-gate)) + *default-elec-gate-params* + ) + +;; definition for method 25 of type elec-gate +;; WARN: Return type mismatch int vs none. +(defmethod elec-gate-method-25 ((this elec-gate)) + 0 + (none) + ) + +;; definition for method 26 of type elec-gate +;; WARN: Return type mismatch int vs none. +(defmethod elec-gate-method-26 ((this elec-gate)) + 0 + (none) + ) + +;; definition for method 27 of type elec-gate +;; WARN: Return type mismatch int vs object. +(defmethod go-initial-state ((this elec-gate)) + (if (or (logtest? (actor-option user17) (-> this fact options)) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + (go (method-of-object this idle)) + (go (method-of-object this active)) + ) + 0 + ) + +;; definition for method 11 of type elec-gate +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this entity) arg0) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> this params) (get-params this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'pathl 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-r) (new 'process 'path-control this 'pathr 0.0 (the-as entity #f) #f)) + (logior! (-> this path-r flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this part-spawner-left) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this part-spawner-right) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 1))) + (let ((s5-1 (-> this params))) + (dotimes (s4-0 5) + (let ((s3-0 (-> this l-bolt s4-0))) + (set! (-> s3-0 bolt) (new 'process 'lightning-control (-> s5-1 bolt-spec) this 0.0)) + (when (-> s5-1 ring-spec) + (set! (-> s3-0 ring 0) (new 'process 'lightning-control (-> s5-1 ring-spec) this 0.0)) + (set! (-> s3-0 ring 1) (new 'process 'lightning-control (-> s5-1 ring-spec) this 0.0)) + ) + (set! (-> s3-0 ring-radius) (rand-vu-float-range (-> s5-1 ring-radius-min) (-> s5-1 ring-radius-max))) + (set! (-> s3-0 pos) (* 0.2 (the float s4-0))) + ) + ) + ) + (let* ((s4-1 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-29 (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp)) + (a1-15 (vector-! (new 'stack-no-clear 'vector) v1-29 s4-1)) + (s5-3 (vector+float*! (new 'stack-no-clear 'vector) s4-1 a1-15 0.5)) + (v1-31 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-15 1.0)) + ) + (vector-cross! v1-31 v1-31 *up-vector*) + (set! (-> this dividing-wall pos quad) (-> s5-3 quad)) + (set! (-> this dividing-wall dir quad) (-> v1-31 quad)) + (vector+float*! (the-as vector (-> this plane)) s5-3 v1-31 12288.0) + (set! (-> this plane 0 dir quad) (-> v1-31 quad)) + (vector-float*! v1-31 v1-31 -1.0) + (vector+float*! (the-as vector (-> this plane 1)) s5-3 v1-31 12288.0) + (set! (-> this plane 1 dir quad) (-> v1-31 quad)) + ) + (set! (-> this wall-xz) + (vector-vector-distance + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) + (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) + ) + ) + (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (+! (-> this wall-xz) 4096.0) + (set! (-> this wall-y) + (fabs + (- (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (get-num-segments (-> this path)) 'interp) + y + ) + (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) y) + ) + ) + ) + (+! (-> this wall-y) 4096.0) + (set! (-> this quality-enabled?) #t) + (set! (-> this lightning-quality) 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "electric-gate" :group 1 :fo-max 70) (-> this root trans) 0.0) + ) + (set! (-> this on-start) (res-lump-struct (-> this entity) 'on-start pair)) + (set! (-> this on-stop) (res-lump-struct (-> this entity) 'on-stop pair)) + (set! (-> this on-shutdown) (res-lump-struct (-> this entity) 'on-shutdown pair)) + (set! (-> this on-trigger) (res-lump-struct (-> this entity) 'on-trigger pair)) + (elec-gate-method-25 this) + (elec-gate-method-26 this) + (go-initial-state this) + ) + +;; definition of type sewer-elec-gate +(deftype sewer-elec-gate (elec-gate) + ((gate-index int32) + ) + ) + +;; definition for method 3 of type sewer-elec-gate +(defmethod inspect ((this sewer-elec-gate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elec-gate inspect))) + (t9-0 this) + ) + (format #t "~2Tgate-index: ~D~%" (-> this gate-index)) + (label cfg-4) + this + ) + +;; definition for method 29 of type sewer-elec-gate +;; WARN: Return type mismatch int vs none. +(defmethod set-elec-scale! ((this sewer-elec-gate) (arg0 float)) + (set-sewh-electricity-scale! arg0 (-> this gate-index)) + (if (zero? (-> this gate-index)) + (set-sewg-electricity-scale! arg0 (-> this gate-index)) + ) + 0 + (none) + ) + +;; definition for method 11 of type sewer-elec-gate +(defmethod init-from-entity! ((this sewer-elec-gate) (arg0 entity-actor)) + (set! (-> this gate-index) (res-lump-value (-> this entity) 'index int :time -1000000000.0)) + (call-parent-method this arg0) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc new file mode 100644 index 0000000000..180b8cd0f4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc @@ -0,0 +1,2024 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-grunt grunt grunt-lod0-jg -1 + ((grunt-lod0-mg (meters 20)) (grunt-lod1-mg (meters 40)) (grunt-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow grunt-shadow-mg + :origin-joint-index 18 + ) + +;; definition of type grunt-anim-info +(deftype grunt-anim-info (structure) + ((anim-index int32) + (travel-speed meters) + ) + :pack-me + ) + +;; definition for method 3 of type grunt-anim-info +(defmethod inspect ((this grunt-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'grunt-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Ttravel-speed: (meters ~m)~%" (-> this travel-speed)) + (label cfg-4) + this + ) + +;; definition of type grunt-global-info +(deftype grunt-global-info (basic) + ((patrol-anim grunt-anim-info 4 :inline) + (charge-anim grunt-anim-info 3 :inline) + (attack-anim grunt-anim-info 2 :inline) + ) + ) + +;; definition for method 3 of type grunt-global-info +(defmethod inspect ((this grunt-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tpatrol-anim[4] @ #x~X~%" (-> this patrol-anim)) + (format #t "~1Tcharge-anim[3] @ #x~X~%" (-> this charge-anim)) + (format #t "~1Tattack-anim[2] @ #x~X~%" (-> this attack-anim)) + (label cfg-4) + this + ) + +;; definition of type grunt +(deftype grunt (nav-enemy) + ((patrol-anim grunt-anim-info) + (charge-anim grunt-anim-info) + (attack-anim grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8 :offset 640) + (jumping-ambush-path-pt int8) + (grunt-flags grunt-flags) + (state-timeout2 time-frame) + (next-warn-time time-frame) + (dest vector :inline) + (minimap connection-minimap :offset 704) + ) + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) + (:methods + (grunt-method-196 (_type_ float) process-focusable) + (get-enemy-info (_type_) nav-enemy-info) + ) + ) + +;; definition for method 3 of type grunt +(defmethod inspect ((this grunt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tpatrol-anim: #~%" (-> this patrol-anim)) + (format #t "~2Tcharge-anim: #~%" (-> this charge-anim)) + (format #t "~2Tattack-anim: #~%" (-> this attack-anim)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) + (format #t "~2Tuse-charge-anim-index: ~D~%" (-> this use-charge-anim-index)) + (format #t "~2Tjumping-ambush-path-pt: ~D~%" (-> this jumping-ambush-path-pt)) + (format #t "~2Tgrunt-flags: ~D~%" (-> this grunt-flags)) + (format #t "~2Tstate-timeout2: ~D~%" (-> this state-timeout2)) + (format #t "~2Tnext-warn-time: ~D~%" (-> this next-warn-time)) + (format #t "~2Tdest: #~%" (-> this dest)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; definition for symbol *grunt-global-info*, type grunt-global-info +(define *grunt-global-info* (new 'static 'grunt-global-info + :patrol-anim (new 'static 'inline-array grunt-anim-info 4 + (new 'static 'grunt-anim-info :anim-index 11 :travel-speed (meters 4)) + (new 'static 'grunt-anim-info :anim-index 12 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + ) + :charge-anim (new 'static 'inline-array grunt-anim-info 3 + (new 'static 'grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + (new 'static 'grunt-anim-info :anim-index 16 :travel-speed (meters 7)) + ) + :attack-anim (new 'static 'inline-array grunt-anim-info 2 + (new 'static 'grunt-anim-info :anim-index 17 :travel-speed (meters 12)) + (new 'static 'grunt-anim-info :anim-index 18 :travel-speed (meters 12)) + ) + ) + ) + +;; definition for symbol *grunt-nav-enemy-info*, type nav-enemy-info +(define *grunt-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 'inline-array idle-control-frame 36 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x14 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 13 + :hostile-anim -1 + :hit-anim -1 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim -1 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim 22 + :jump-in-air-anim 23 + :jump-land-anim 24 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 18 + :sound-hit (static-sound-name "grunt-hit") + :sound-die (static-sound-name "grunt-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.5) + :ragdoll-rotate-velocity-mult 0.5 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 73728.0 + :knocked-red-vy-hi 114688.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) + :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) + :bg-collide-with (collide-spec backgnd crate obstacle hit-by-others-list player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0 :w 1170.3455) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 2268.7744 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 4000.9365) + :geo-tform (new 'static 'vector :x 1.0 :w 12817.95) + :axial-slop 2169.078 + :max-angle 2296.8184 + :coll-rad 2867.2 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10540.374) + :geo-tform (new 'static 'vector :x -1.0 :w 12551.108) + :axial-slop 2169.078 + :max-angle 2226.3489 + :coll-rad 2209.3823 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 13046.233) + :geo-tform (new 'static 'vector :x 1.0 :w 18078.088) + :axial-slop 2169.078 + :max-angle 3210.7178 + :coll-rad 1644.544 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 16901.771) + :geo-tform (new 'static 'vector :x 1.0 :w 359.3193) + :axial-slop 2169.078 + :max-angle 2605.129 + :coll-rad 1722.368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4178 :z -0.9083 :w 11487.004) + :geo-tform (new 'static 'vector :x -0.5907 :y -0.4565 :z 0.665 :w 25388.248) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1641.6768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1565 :z -0.9875 :w 12747.589) + :geo-tform (new 'static 'vector :x -0.0123 :y 0.7268 :z 0.6864 :w 28823.824) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1295.1552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.3463 :w 15464.585) + :geo-tform (new 'static 'vector :x 0.0404 :y 0.9991 :z 0.0016 :w 26660.428) + :axial-slop 2169.078 + :max-angle 2671.921 + :coll-rad 1899.3152 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z 0.346 :w 14.381512) + :geo-tform (new 'static 'vector :x 0.5827 :y 0.8005 :z 0.1389 :w 27752.074) + :axial-slop 2169.078 + :max-angle 2077.3455 + :coll-rad 1787.904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.418 :z 0.9082 :w 11484.565) + :geo-tform (new 'static 'vector :x 0.5908 :y -0.4564 :z 0.665 :w 40148.812) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1563.8528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1563 :z 0.9875 :w 12751.085) + :geo-tform (new 'static 'vector :x 0.0122 :y 0.7266 :z 0.6866 :w 36713.688) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.938 :z -0.3461 :w 15469.664) + :geo-tform (new 'static 'vector :x -0.0404 :y 0.9991 :z 0.0015 :w 38877.887) + :axial-slop 2169.078 + :max-angle 2330.5876 + :coll-rad 1610.1376 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9377 :z -0.3468 :w 16.074524) + :geo-tform (new 'static 'vector :x -0.2371 :y 0.2169 :z -0.9468 :w 20556.623) + :axial-slop 2169.078 + :max-angle 1879.882 + :coll-rad 1629.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 1.0 :w 42847.234) + :geo-tform (new 'static 'vector :x -1.0 :w 16468.232) + :axial-slop 2169.078 + :max-angle 2508.973 + :coll-rad 1812.0704 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 3567.2522) + :geo-tform (new 'static 'vector :x 1.0 :w 42973.14) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1858.3552 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2349 :z -0.9718 :w 18020.252) + :geo-tform (new 'static 'vector :x 0.3808 :y 0.3151 :z 0.8691 :w 29486.395) + :axial-slop 2169.078 + :max-angle 3698.87 + :coll-rad 877.3632 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z 0.0086 :w 4412.9214) + :geo-tform (new 'static 'vector :x 0.3995 :y -0.4805 :z 0.7804 :w 25729.781) + :axial-slop 2169.078 + :max-angle 3691.5154 + :coll-rad 1524.9408 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7835 :z 0.621 :w 14960.958) + :geo-tform (new 'static 'vector :x 0.2887 :y 0.6587 :z 0.6945 :w 40555.97) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7644 :z -0.6445 :w 17272.176) + :geo-tform (new 'static 'vector :x 0.5513 :y 0.3614 :z 0.7516 :w 33063.24) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9734 :z 0.2283 :w 7149.304) + :geo-tform (new 'static 'vector :x -0.7224 :y -0.6901 :z -0.0373 :w 15253.522) + :axial-slop 2169.078 + :max-angle 1294.1176 + :coll-rad 659.456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 22 + :pre-tform (new 'static 'vector :x 0.4934 :z 0.8696 :w 6514.1875) + :geo-tform (new 'static 'vector :x -0.0332 :y 0.8825 :z 0.4687 :w 37613.457) + :axial-slop 2169.078 + :max-angle 1411.5544 + :coll-rad 605.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 18 + :pre-tform (new 'static 'vector :x -1.0 :w 9863.842) + :geo-tform (new 'static 'vector :x -1.0 :w 12698.965) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1488.0768 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -1.0 :w 1462.5452) + :geo-tform (new 'static 'vector :x 0.9995 :y -0.0161 :z -0.0185 :w 7921.737) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1285.7344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9958 :z -0.09 :w 1956.7229) + :geo-tform (new 'static 'vector :x 0.9998 :y 0.0041 :z 0.0071 :w 33050.805) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1801.8304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6114.891) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0127 :z 0.0043 :w 8018.73) + :axial-slop 2169.078 + :max-angle 2497.213 + :coll-rad 794.2144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6305.8555) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0172 :z 0.0018 :w 6908.7324) + :axial-slop 2169.078 + :max-angle 1846.1127 + :coll-rad 556.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0159 :w 6830.7266) + :geo-tform (new 'static 'vector :x 0.9993 :y -0.0365 :z -0.006 :w 3790.2383) + :axial-slop 2169.078 + :max-angle 1491.563 + :coll-rad 542.3104 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint 18 + :pre-tform (new 'static 'vector :x -0.2352 :z 0.9718 :w 18022.729) + :geo-tform (new 'static 'vector :x -0.3537 :y 0.3542 :z 0.8654 :w 34566.508) + :axial-slop 2169.078 + :max-angle 3739.2292 + :coll-rad 1540.096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8967 :z -0.4423 :w 5274.7744) + :geo-tform (new 'static 'vector :x -0.0105 :y 0.862 :z -0.5065 :w 24694.367) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8194 :z -0.573 :w 13110.112) + :geo-tform (new 'static 'vector :x -0.2576 :y 0.7211 :z 0.6428 :w 24504.475) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1751.4496 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8027 :z 0.596 :w 15135.011) + :geo-tform (new 'static 'vector :x -0.5895 :y 0.2007 :z 0.7821 :w 36329.734) + :axial-slop 2169.078 + :max-angle 3682.7046 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8262 :z 0.5632 :w 7707.525) + :geo-tform (new 'static 'vector :x -0.6943 :y 0.7184 :z -0.0381 :w 14762.858) + :axial-slop 2169.078 + :max-angle 2015.6871 + :coll-rad 573.0304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 34 + :pre-tform (new 'static 'vector :x 0.9975 :z -0.0684 :w 3277.692) + :geo-tform (new 'static 'vector :x -0.2795 :y 0.7979 :z 0.5336 :w 35258.77) + :axial-slop 2169.078 + :max-angle 1851.9927 + :coll-rad 468.992 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5769 :z -0.8166 :w 8297.695) + :geo-tform (new 'static 'vector :x -0.6954 :y -0.0651 :z 0.7153 :w 9511.8955) + :axial-slop 2169.078 + :max-angle 2863.5044 + :coll-rad 1868.5952 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5774 :z 0.8162 :w 8293.489) + :geo-tform (new 'static 'vector :x 0.948 :y -0.2986 :z 0.1083 :w 34953.68) + :axial-slop 2169.078 + :max-angle 2569.885 + :coll-rad 1893.9904 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 12 + :pre-tform (new 'static 'vector :x 0.3449 :z -0.9384 :w 16372.404) + :geo-tform (new 'static 'vector :x 0.088 :y -0.8342 :z 0.5442 :w 20057.604) + :axial-slop 2169.078 + :max-angle 3185.0312 + :coll-rad 1327.9232 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.6081 :z 0.7936 :w 10429.526) + :geo-tform (new 'static 'vector :x 0.213 :y -0.975 :z -0.061 :w 19499.654) + :axial-slop 2169.078 + :max-angle 2031.8344 + :coll-rad 423.1168 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint 12 + :pre-tform (new 'static 'vector :x 0.9512 :z -0.3084 :w 2006.2573) + :geo-tform (new 'static 'vector :x -0.0464 :y 0.9956 :z 0.0799 :w 26746.152) + :axial-slop 2169.078 + :max-angle 2505.2957 + :coll-rad 533.7088 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7105 :z 0.7034 :w 3017.6597) + :geo-tform (new 'static 'vector :x 0.0381 :y 0.9847 :z -0.1692 :w 26846.422) + :axial-slop 2169.078 + :max-angle 2064.8572 + :coll-rad 408.3712 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.9371 :z 0.3486 :w 15668.893) + :geo-tform (new 'static 'vector :x -0.2897 :y 0.1004 :z 0.9516 :w 31568.328) + :axial-slop 2169.078 + :max-angle 2784.2424 + :coll-rad 1593.7535 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 44 + :parent-joint 16 + :pre-tform (new 'static 'vector :x 0.3452 :z 0.9383 :w 16373.424) + :geo-tform (new 'static 'vector :x 0.1347 :y 0.823 :z -0.5515 :w 19233.342) + :axial-slop 2169.078 + :max-angle 2773.2288 + :coll-rad 1373.3888 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 45 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4593 :z -0.888 :w 10428.289) + :geo-tform (new 'static 'vector :x 0.1971 :y 0.977 :z 0.079 :w 17810.5) + :axial-slop 2169.078 + :max-angle 1984.8488 + :coll-rad 616.448 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 46 + :parent-joint 16 + :pre-tform (new 'static 'vector :x 0.9998 :z -0.0063 :w 3668.4868) + :geo-tform (new 'static 'vector :x 0.0529 :y 0.9969 :z 0.056 :w 38759.062) + :axial-slop 2169.078 + :max-angle 1981.1897 + :coll-rad 1127.6288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 47 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7207 :z -0.6929 :w 3011.8708) + :geo-tform (new 'static 'vector :x -0.0298 :y 0.9808 :z -0.1918 :w 38536.098) + :axial-slop 2169.078 + :max-angle 2276.2654 + :coll-rad 534.528 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 48 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.9375 :z -0.3477 :w 15673.973) + :geo-tform (new 'static 'vector :x 0.2894 :y 0.1005 :z 0.9517 :w 33957.168) + :axial-slop 2169.078 + :max-angle 2685.1372 + :coll-rad 1853.0304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 49 + :parent-joint 22 + :pre-tform (new 'static 'vector :x -0.9829 :z 0.1831 :w 2492.6619) + :geo-tform (new 'static 'vector :x 0.5546 :y 0.2592 :z 0.7904 :w 34067.453) + :axial-slop 2169.078 + :max-angle 1536.3458 + :coll-rad 525.9264 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 50 + :parent-joint 34 + :pre-tform (new 'static 'vector :x -0.275 :z 0.9613 :w 5964.5225) + :geo-tform (new 'static 'vector :x -0.5191 :y 0.2888 :z 0.8042 :w 30864.797) + :axial-slop 2169.078 + :max-angle 1445.3237 + :coll-rad 382.5664 + ) + ) + ) + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 6 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 614.4 :z -3276.8 :r 327680.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #t + :use-pacing #t + :walk-anim 11 + :turn-anim -1 + :run-anim 14 + :taunt-anim 19 + :run-travel-speed (meters 7) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 82 of type grunt +(defmethod event-handler ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((= (-> this hit-points) 0.0) + (let ((s5-1 (-> this incoming knocked-type))) + (cond + ((and (= s5-1 (knocked-type yellow-shot)) + (not (and (-> this next-state) (let ((v1-31 (-> this next-state name))) + (or (= v1-31 'knocked) (= v1-31 'jump) (= v1-31 'jump-land)) + ) + ) + ) + (zero? (rnd-int this 3)) + (let ((f0-2 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (f1-2 32768.0) + ) + (>= f0-2 (* f1-2 f1-2)) + ) + ) + (go-die this) + ) + ((or (= s5-1 (knocked-type yellow-shot)) (= s5-1 (knocked-type blue-shot))) + (set! (-> this incoming knocked-type) (knocked-type none)) + (go (method-of-object this knocked)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + ) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 74 of type grunt +(defmethod go-ambush-delay ((this grunt)) + (cond + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) + ) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) + ) + (else + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) + ) + ) + ) + +;; failed to figure out what this is: +(defstate falling-ambush (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let* ((gp-1 *target*) + (a0-4 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when a0-4 + (let* ((gp-2 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0)) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-2 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-2 quat) (-> gp-2 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let* ((v1-17 *game-info*) + (a0-15 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-15) + (set! (-> self attack-id) a0-15) + ) + (let ((v1-19 (-> self root root-prim))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((v1-6 (-> self root root-prim))) + (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) + ) + (sound-play "grunt-notice") + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max 1.8) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (until (logtest? (-> self root status) (collide-status on-ground touch-surface touch-wall)) + (suspend) + ) + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +;; definition for method 102 of type grunt +(defmethod go-directed2 ((this grunt)) + (case (-> this jump-why) + ((2) + (go (method-of-object this jumping-ambush-cont)) + ) + (else + ((method-of-type nav-enemy go-directed2) this) + ) + ) + ) + +;; failed to figure out what this is: +(defstate jumping-ambush (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy ambush) enter)) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping jumping-ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self jumping-ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate jumping-ambush-cont (grunt) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self jumping-ambush-path-pt) 1)) + ) + (if (< v1-1 (-> a0-0 curve num-cverts)) + (set! (-> self jumping-ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self jumping-ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate active (grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-8 (ja-group))) + (and v1-8 + (or (= v1-8 grunt-patrol0-ja) (= v1-8 grunt-patrol1-ja) (= v1-8 grunt-charge0-ja) (= v1-8 grunt-charge1-ja)) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-37 (ja-group))) + (if (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (nonzero? (-> self patrol-anim anim-index)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self patrol-anim) (the-as grunt-anim-info (-> *grunt-global-info* patrol-anim))) + (let ((v1-67 (-> self nav))) + (set! (-> v1-67 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (zero? (rnd-int self 3)) + (let ((v1-107 self)) + (set! (-> v1-107 enemy-flags) (the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-107 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-171 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-171 enemy-flags))) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-171 enemy-flags)))) + ) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-171 enemy-flags)))) + (set! (-> v1-171 nav callback-info) (-> v1-171 enemy-info callback-info)) + ) + 0 + ) + ) + ) + #f + ) + ) + +;; definition for method 196 of type grunt +(defmethod grunt-method-196 ((this grunt) (arg0 float)) + (local-vars (v1-5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (get-focus! this))) + (when gp-0 + (let ((v1-3 (get-trans gp-0 0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 v1-3 (-> this root trans)) + (.lvf vf1 (&-> s4-0 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-5 vf1) + (let* ((f30-0 v1-5) + (f0-0 arg0) + (f28-0 (* f0-0 f0-0)) + (f0-2 12288.0) + ) + (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) + (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f1-0 1228.8) + ) + (cond + ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) + (go (method-of-object this attack)) + ) + ((let ((f0-10 12288.0)) + (< f30-0 (* f0-10 f0-10)) + ) + (go (method-of-object this spin-attack)) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (grunt) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (grunt-method-196 self 13312.0)) + (gp-0 (current-time)) + ) + (when (and (>= gp-0 (-> self next-warn-time)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + (when (and a0-1 (let ((f0-0 65536.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans a0-1 0) (-> self root trans))) + ) + ) + (sound-play "grunt-warn") + (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (let ((v1-19 (-> self use-charge-anim-index))) + (cond + ((>= v1-19 0) + (set! (-> self charge-anim) (-> *grunt-global-info* charge-anim v1-19)) + (set! (-> self use-charge-anim-index) -1) + ) + (else + (set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (rnd-int self 3))) + ) + ) + ) + (until #f + (grunt-method-196 self 22528.0) + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-37 (ja-group))) + (when (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-41 (-> self nav))) + (set! (-> v1-41 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate attack (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state))) + (set! (-> v1-1 speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-10 *game-info*) + (v0-1 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) v0-1) + (set! (-> self attack-id) v0-1) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int self 2))) + (let ((v1-5 (-> self nav))) + (set! (-> v1-5 target-speed) (-> self attack-anim travel-speed)) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 turning-acceleration) 49152.0) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self charge-anim anim-index)))) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 3.0 0)) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (let ((v1-57 0)) + (let ((a0-22 (the-as object (-> *grunt-global-info* charge-anim))) + (a1-7 (-> self charge-anim)) + ) + (dotimes (a2-3 3) + (when (= a0-22 a1-7) + (set! v1-57 a2-3) + (goto cfg-21) + ) + (set! a0-22 (-> (the-as grunt-global-info a0-22) patrol-anim 1)) + ) + ) + (label cfg-21) + (set! (-> self use-charge-anim-index) v1-57) + ) + (go-virtual hostile) + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate spin-attack (grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-stare self) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-21 *game-info*) + (v0-3 (+ (-> v1-21 attack-id) 1)) + ) + (set! (-> v1-21 attack-id) v0-3) + (set! (-> self attack-id) v0-3) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int self 2))) + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-13 (ja-group))) + (if (not (and v1-13 (= v1-13 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-9 (handle->process (-> self focus handle)))) + (if a0-9 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + ) + ) + (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (go-virtual hostile) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate circling (grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (rnd-int self 3))) + (let ((v1-22 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-22 enemy-flags))) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-22 enemy-flags)))) + ) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-22 enemy-flags)))) + (set! (-> v1-22 nav callback-info) (-> v1-22 enemy-info callback-info)) + ) + 0 + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-25 enemy-flags)))) + ) + 0 + (let ((v1-27 (-> self nav))) + (set! (-> v1-27 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-29 (-> self nav))) + (set! (-> v1-29 acceleration) (-> self enemy-info run-acceleration)) + ) + 0 + (let ((v1-31 (-> self nav))) + (set! (-> v1-31 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-39 (ja-group))) + (if (not (and v1-39 (= v1-39 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((s5-0 (rnd-int self 8)) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (< 20480.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (let ((v1-66 self)) + (set! (-> v1-66 enemy-flags) (the-as enemy-flag (logclear (-> v1-66 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-66 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-71 self)) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logclear (-> v1-71 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((v1-77 (ja-group))) + (if (not (and v1-77 (= v1-77 grunt-celebrate-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((f30-2 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! grunt-celebrate-start-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + (ja-no-eval :group! grunt-celebrate-finish-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate pacing (grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-28 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-28 enemy-flags))) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-28 enemy-flags)))) + ) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-28 enemy-flags)))) + (set! (-> v1-28 nav callback-info) (-> v1-28 enemy-info callback-info)) + ) + 0 + (let ((v1-31 self)) + (set! (-> v1-31 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-31 enemy-flags)))) + ) + 0 + (let ((v1-33 (-> self nav))) + (set! (-> v1-33 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((v1-35 (-> self nav))) + (set! (-> v1-35 acceleration) (-> self enemy-info walk-acceleration)) + ) + 0 + (let ((v1-37 (-> self nav))) + (set! (-> v1-37 turning-acceleration) (-> self enemy-info walk-turning-acceleration)) + ) + 0 + (let ((v1-41 (ja-group))) + (if (not (and v1-41 (= v1-41 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate stop-chase (grunt) + :virtual #t + :code (behavior () + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-24 (ja-group))) + (if (not (and v1-24 (= v1-24 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-focus (grunt) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy idle) enter) + :trans (behavior () + (let ((s5-0 (handle->process (-> self focus handle)))) + (when s5-0 + (let ((gp-0 (get-trans (the-as process-focusable s5-0) 0))) + (when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))) + (>= 163840.0 (vector-vector-distance (-> self root trans) gp-0)) + ) + (or (not (logtest? (-> self fact enemy-options) (enemy-option user8))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) + (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root trans y)))) + ) + ) + ) + (cond + ((and (logtest? (-> self fact enemy-options) (enemy-option user9)) + (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-! s5-1 gp-0 (-> self root trans)) + (let ((f0-2 32768.0) + (v1-26 s5-1) + ) + (if (or (>= f0-2 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + (>= 20024.889 (fabs (deg- (y-angle (-> self root)) (atan (-> s5-1 x) (-> s5-1 z))))) + ) + (go-virtual notice) + ) + ) + ) + ) + (else + (go-virtual notice) + ) + ) + ) + ) + ) + ) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (grunt) + :virtual #t + :code (behavior () + (local-vars (v1-49 object)) + (ja-channel-push! 1 0) + (let ((gp-0 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll))) + (when gp-0 + (let ((a0-5 (-> gp-0 ragdoll-joints))) + (if (< 0.0 (vector-dot (-> self node-list data (-> a0-5 0 joint-index) bone transform fvec) *y-vector*)) + (ja-no-eval :group! grunt-getup-front-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! grunt-getup-back-ja :num! (seek!) :frame-num 0.0) + ) + ) + (enable-ragdoll! gp-0 self) + ) + ) + (until v1-49 + (suspend) + (ja :num! (seek!)) + (set! v1-49 (and (ja-done? 0) (let ((a0-15 (handle->process (-> self ragdoll-proc)))) + (or (not a0-15) (ragdoll-proc-method-19 (the-as ragdoll-proc a0-15))) + ) + ) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +;; definition for method 125 of type grunt +(defmethod ragdoll-settled? ((this grunt)) + (let ((t9-0 (method-of-type nav-enemy ragdoll-settled?))) + (and (t9-0 this) (or (= (-> this root gspot-pos y) -40959590.0) + (< (- (-> this root trans y) (-> this root gspot-pos y)) 4096.0) + ) + ) + ) + ) + +;; definition for method 143 of type grunt +(defmethod on-dying ((this grunt)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type grunt +;; WARN: Return type mismatch nav-enemy vs grunt. +(defmethod relocate ((this grunt) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (the-as grunt ((method-of-type nav-enemy relocate) this offset)) + ) + +;; definition for method 120 of type grunt +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this grunt)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (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 17408.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd crate obstacle hit-by-others-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 9830.4 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 4915.2) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-19 transform-index) 18) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 2252.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 16) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 12) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-25 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-25 transform-index) 6) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 197 of type grunt +(defmethod get-enemy-info ((this grunt)) + *grunt-nav-enemy-info* + ) + +;; definition for method 67 of type grunt +(defmethod coin-flip? ((this grunt)) + #f + ) + +;; definition for method 121 of type grunt +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this grunt)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this (get-enemy-info this)) + (let ((v1-6 (-> this neck))) + (set! (-> v1-6 up) (the-as uint 1)) + (set! (-> v1-6 nose) (the-as uint 2)) + (set! (-> v1-6 ear) (the-as uint 0)) + (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-6 ignore-angle) 30947.555) + ) + (let ((v1-8 (-> this nav))) + (set! (-> v1-8 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((s5-2 *grunt-global-info*)) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (rnd-int this 4))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (rnd-int this 3))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (rnd-int this 2))) + ) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (rnd-int this 2)) + (logior! (-> this grunt-flags) (grunt-flags gf0)) + ) + (if (zero? (rnd-int this 2)) + (logior! (-> this grunt-flags) (grunt-flags gf2)) + ) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + (add-connection + *part-engine* + this + 6 + this + 468 + (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) + ) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + 0 + (none) + ) + +;; definition for method 122 of type grunt +;; WARN: Return type mismatch int vs object. +(defmethod go-idle2 ((this grunt)) + (if (logtest? (-> this fact enemy-options) (enemy-option user9)) + (go (method-of-object this wait-for-focus)) + (go (method-of-object this idle)) + ) + 0 + ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc new file mode 100644 index 0000000000..a691f467df --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc @@ -0,0 +1,2034 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-kg-grunt kg-grunt kg-grunt-lod0-jg -1 + ((kg-grunt-lod1-mg (meters 20)) (kg-grunt-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow kg-grunt-shadow-mg + :origin-joint-index 18 + ) + +;; failed to figure out what this is: +(defskelgroup skel-kg-grunt-lowres kg-grunt kg-grunt-lod0-jg -1 + ((kg-grunt-lod1-mg (meters 20)) (kg-grunt-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow kg-grunt-shadow-mg + :origin-joint-index 18 + ) + +;; definition for symbol *kg-grunt-debris-params*, type debris-static-params +(define *kg-grunt-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 20 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 30 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 31 :group "skel-kg-debris-d") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +;; definition for symbol *kg-grunt-debris-elbow-shoulder-params*, type debris-static-params +(define *kg-grunt-debris-elbow-shoulder-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 18 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +;; definition for symbol *kg-grunt-debris-array-params*, type (array debris-static-params) +(define *kg-grunt-debris-array-params* + (new 'static 'boxed-array :type debris-static-params + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 21 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 40 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 19 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 22 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 32 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 44 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 30 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 33 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 27 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + ) + +;; definition for symbol *kg-grunt-debris-knee-hip-params*, type debris-static-params +(define *kg-grunt-debris-knee-hip-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 20 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 31 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 26 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +;; definition of type kg-grunt-anim-info +(deftype kg-grunt-anim-info (structure) + ((anim-index int32) + (travel-speed meters) + ) + :pack-me + ) + +;; definition for method 3 of type kg-grunt-anim-info +(defmethod inspect ((this kg-grunt-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'kg-grunt-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Ttravel-speed: (meters ~m)~%" (-> this travel-speed)) + (label cfg-4) + this + ) + +;; definition of type kg-grunt-global-info +(deftype kg-grunt-global-info (basic) + ((prev-knocked-anim-index int32) + (prev-yellow-hit-anim-index int32) + (prev-blue-hit-anim-index int32) + (patrol-anim kg-grunt-anim-info 4 :inline) + (charge-anim kg-grunt-anim-info 3 :inline) + (attack-anim kg-grunt-anim-info 2 :inline) + (knocked-anim kg-grunt-anim-info 4 :inline) + (knocked-land-anim kg-grunt-anim-info 4 :inline) + (yellow-hit-anim kg-grunt-anim-info 4 :inline) + (blue-hit-anim kg-grunt-anim-info 6 :inline) + ) + ) + +;; definition for method 3 of type kg-grunt-global-info +(defmethod inspect ((this kg-grunt-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-knocked-anim-index: ~D~%" (-> this prev-knocked-anim-index)) + (format #t "~1Tprev-yellow-hit-anim-index: ~D~%" (-> this prev-yellow-hit-anim-index)) + (format #t "~1Tprev-blue-hit-anim-index: ~D~%" (-> this prev-blue-hit-anim-index)) + (format #t "~1Tpatrol-anim[4] @ #x~X~%" (-> this patrol-anim)) + (format #t "~1Tcharge-anim[3] @ #x~X~%" (-> this charge-anim)) + (format #t "~1Tattack-anim[2] @ #x~X~%" (-> this attack-anim)) + (format #t "~1Tknocked-anim[4] @ #x~X~%" (-> this knocked-anim)) + (format #t "~1Tknocked-land-anim[4] @ #x~X~%" (-> this knocked-land-anim)) + (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> this blue-hit-anim)) + (label cfg-4) + this + ) + +;; definition of type kg-grunt +(deftype kg-grunt (nav-enemy) + ((patrol-anim kg-grunt-anim-info) + (charge-anim kg-grunt-anim-info) + (attack-anim kg-grunt-anim-info) + (knocked-anim kg-grunt-anim-info) + (yellow-hit-anim kg-grunt-anim-info) + (blue-hit-anim kg-grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8 :offset 652) + (knocked-anim-index int8) + (jumping-ambush-path-pt int8) + (kg-grunt-flags uint8) + (state-timeout2 time-frame) + (next-warn-time time-frame) + (dest vector :inline) + (minimap connection-minimap :offset 704) + (debris-count uint32) + (debris-mask uint32) + ) + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + explode + ) + (:methods + (go-attack (_type_ float) process-focusable) + (get-nav-enemy-info (_type_) nav-enemy-info) + ) + ) + +;; definition for method 3 of type kg-grunt +(defmethod inspect ((this kg-grunt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tpatrol-anim: #~%" (-> this patrol-anim)) + (format #t "~2Tcharge-anim: #~%" (-> this charge-anim)) + (format #t "~2Tattack-anim: #~%" (-> this attack-anim)) + (format #t "~2Tknocked-anim: #~%" (-> this knocked-anim)) + (format #t "~2Tyellow-hit-anim: #~%" (-> this yellow-hit-anim)) + (format #t "~2Tblue-hit-anim: #~%" (-> this blue-hit-anim)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) + (format #t "~2Tuse-charge-anim-index: ~D~%" (-> this use-charge-anim-index)) + (format #t "~2Tknocked-anim-index: ~D~%" (-> this knocked-anim-index)) + (format #t "~2Tjumping-ambush-path-pt: ~D~%" (-> this jumping-ambush-path-pt)) + (format #t "~2Tkg-grunt-flags: ~D~%" (-> this kg-grunt-flags)) + (format #t "~2Tstate-timeout2: ~D~%" (-> this state-timeout2)) + (format #t "~2Tnext-warn-time: ~D~%" (-> this next-warn-time)) + (format #t "~2Tdest: #~%" (-> this dest)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tdebris-count: ~D~%" (-> this debris-count)) + (format #t "~2Tdebris-mask: ~D~%" (-> this debris-mask)) + (label cfg-4) + this + ) + +;; definition for symbol *kg-grunt-global-info*, type kg-grunt-global-info +(define *kg-grunt-global-info* (new 'static 'kg-grunt-global-info + :patrol-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 11 :travel-speed (meters 4)) + (new 'static 'kg-grunt-anim-info :anim-index 12 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + ) + :charge-anim (new 'static 'inline-array kg-grunt-anim-info 3 + (new 'static 'kg-grunt-anim-info :anim-index 14 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 15 :travel-speed (meters 7)) + (new 'static 'kg-grunt-anim-info :anim-index 16 :travel-speed (meters 7)) + ) + :attack-anim (new 'static 'inline-array kg-grunt-anim-info 2 + (new 'static 'kg-grunt-anim-info :anim-index 17 :travel-speed (meters 12)) + (new 'static 'kg-grunt-anim-info :anim-index 18 :travel-speed (meters 12)) + ) + :knocked-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 22) + (new 'static 'kg-grunt-anim-info :anim-index 24) + (new 'static 'kg-grunt-anim-info :anim-index 26) + (new 'static 'kg-grunt-anim-info :anim-index 28) + ) + :knocked-land-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 23) + (new 'static 'kg-grunt-anim-info :anim-index 25) + (new 'static 'kg-grunt-anim-info :anim-index 27) + (new 'static 'kg-grunt-anim-info :anim-index 29) + ) + :yellow-hit-anim (new 'static 'inline-array kg-grunt-anim-info 4 + (new 'static 'kg-grunt-anim-info :anim-index 34) + (new 'static 'kg-grunt-anim-info :anim-index 35) + (new 'static 'kg-grunt-anim-info :anim-index 36) + (new 'static 'kg-grunt-anim-info :anim-index 37) + ) + :blue-hit-anim (new 'static 'inline-array kg-grunt-anim-info 6 + (new 'static 'kg-grunt-anim-info :anim-index 38) + (new 'static 'kg-grunt-anim-info :anim-index 39) + (new 'static 'kg-grunt-anim-info :anim-index 40) + (new 'static 'kg-grunt-anim-info :anim-index 41) + (new 'static 'kg-grunt-anim-info :anim-index 42) + (new 'static 'kg-grunt-anim-info :anim-index 43) + ) + ) + ) + +;; definition for symbol *fact-info-kg-grunt-defaults*, type fact-info-enemy-defaults +(define *fact-info-kg-grunt-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 48 :pickup-amount 10.0) + ) + +;; definition for symbol *kg-grunt-nav-enemy-info*, type nav-enemy-info +(define *kg-grunt-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 'inline-array idle-control-frame 36 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x9 + :param0 30 + :param1 #x69 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #xa + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x1e + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 60) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 13 + :hostile-anim -1 + :hit-anim 34 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 19 + :die-falling-anim 32 + :victory-anim -1 + :jump-wind-up-anim 45 + :jump-in-air-anim 46 + :jump-land-anim 47 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 18 + :sound-hit (static-sound-name "kg-impact") + :sound-die (static-sound-name "kg-explo") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #t + :use-circling #t + :use-pacing #t + :walk-anim 11 + :turn-anim -1 + :run-anim 14 + :taunt-anim 20 + :run-travel-speed (meters 7) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *kg-grunt-nav-enemy-info* fact-defaults) *fact-info-kg-grunt-defaults*) + +;; definition for method 27 of type kg-grunt +(defmethod get-inv-mass ((this kg-grunt)) + 2.0 + ) + +;; definition for method 82 of type kg-grunt +;; INFO: Used lq/sq +(defmethod event-handler ((this kg-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((= (-> this hit-points) 0.0) + (go (method-of-object this explode)) + ) + (else + (let ((s5-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> s5-1 hit-xz-reaction) 0.95) + (set! (-> s5-1 hit-y-reaction) 0.6) + (set! (-> s5-1 fountain-rand-transv-lo quad) (-> this incoming attack-position quad)) + (dotimes (s4-0 8) + (let ((v1-32 (rand-vu-int-count-excluding 18 (the-as int (-> this debris-mask))))) + (logior! (-> this debris-mask) (ash 1 v1-32)) + (debris-spawn this s5-1 (-> *kg-grunt-debris-array-params* v1-32) (the-as process-drawable #f)) + ) + ) + ) + (setup-masks (-> this draw) 0 (the-as int (* (-> this debris-mask) 2))) + (go (method-of-object this knocked)) + ) + ) + #t + ) + (('impact-impulse) + (let ((v1-44 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-44) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> this hit-points) 0.0) + (send-event arg0 'lawsuit (-> this root trans)) + (go (method-of-object this explode)) + #t + ) + ) + ) + (('death-start) + (set! (-> this draw death-timer) (the-as uint 0)) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 74 of type kg-grunt +(defmethod go-ambush-delay ((this kg-grunt)) + (cond + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) + ) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) + ) + (else + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) + ) + ) + ) + +;; failed to figure out what this is: +(defstate explode (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "kg-explo") + (send-event self 'death-start) + ) + :code (behavior () + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-1 hit-xz-reaction) 0.95) + (set! (-> a1-1 hit-y-reaction) 0.6) + (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (debris-spawn self a1-1 *kg-grunt-debris-params* (the-as process-drawable #f)) + ) + (let ((v1-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-grunt-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 220 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 220)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 220)) + ) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; failed to figure out what this is: +(defstate falling-ambush (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let* ((gp-1 *target*) + (a0-4 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when a0-4 + (let* ((gp-2 (-> self root)) + (s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0)) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-2 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-2 quat) (-> gp-2 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let* ((v1-17 *game-info*) + (a0-15 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-15) + (set! (-> self attack-id) a0-15) + ) + (let ((v1-19 (-> self root root-prim))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((v1-6 (-> self root root-prim))) + (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) + ) + (sound-play "kg-grunt-notice") + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max 1.8) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.8)) + ) + (until (logtest? (-> self root status) (collide-status on-ground touch-surface touch-wall)) + (suspend) + ) + (go-virtual hostile) + ) + :post nav-enemy-falling-post + ) + +;; definition for method 102 of type kg-grunt +(defmethod go-directed2 ((this kg-grunt)) + (case (-> this jump-why) + ((2) + (go (method-of-object this jumping-ambush-cont)) + ) + (else + ((method-of-type nav-enemy go-directed2) this) + ) + ) + ) + +;; failed to figure out what this is: +(defstate jumping-ambush (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy ambush) enter)) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping jumping-ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self jumping-ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate jumping-ambush-cont (kg-grunt) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self jumping-ambush-path-pt) 1)) + ) + (if (and (nonzero? a0-0) (< v1-1 (-> a0-0 curve num-cverts))) + (set! (-> self jumping-ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self jumping-ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate active (kg-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 kg-grunt-patrol0-ja) + (= v1-8 kg-grunt-patrol1-ja) + (= v1-8 kg-grunt-charge0-ja) + (= v1-8 kg-grunt-charge1-ja) + ) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (set! (-> self patrol-anim) (-> *kg-grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-37 (ja-group))) + (if (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (nonzero? (-> self patrol-anim anim-index)) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.2)) + (set! (-> self patrol-anim) (the-as kg-grunt-anim-info (-> *kg-grunt-global-info* patrol-anim))) + (let ((v1-67 (-> self nav))) + (set! (-> v1-67 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) + (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (dotimes (s4-1 s5-1) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (zero? (rnd-int self 3)) + (let ((v1-107 self)) + (set! (-> v1-107 enemy-flags) (the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-107 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-channel-push! 1 (seconds 0.3)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-171 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-171 enemy-flags))) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-171 enemy-flags)))) + ) + (set! (-> v1-171 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-171 enemy-flags)))) + (set! (-> v1-171 nav callback-info) (-> v1-171 enemy-info callback-info)) + ) + 0 + ) + ) + ) + #f + ) + ) + +;; definition for method 197 of type kg-grunt +(defmethod go-attack ((this kg-grunt) (arg0 float)) + (local-vars (v1-5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (get-focus! this))) + (when gp-0 + (let ((v1-3 (get-trans gp-0 0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s4-0 v1-3 (-> this root trans)) + (.lvf vf1 (&-> s4-0 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-5 vf1) + (let* ((f30-0 v1-5) + (f0-0 arg0) + (f28-0 (* f0-0 f0-0)) + (f0-2 12288.0) + ) + (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) + (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f1-0 1228.8) + ) + (cond + ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) + (go (method-of-object this attack)) + ) + ((let ((f0-10 12288.0)) + (< f30-0 (* f0-10 f0-10)) + ) + (go (method-of-object this spin-attack)) + ) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (kg-grunt) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (go-attack self 13312.0)) + (gp-0 (current-time)) + ) + (when (and (>= gp-0 (-> self next-warn-time)) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) + ) + (when (and a0-1 (let ((f0-0 65536.0)) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans a0-1 0) (-> self root trans))) + ) + ) + (sound-play "kg-grunt-warn") + (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (let ((v1-19 (-> self use-charge-anim-index))) + (cond + ((>= v1-19 0) + (set! (-> self charge-anim) (-> *kg-grunt-global-info* charge-anim v1-19)) + (set! (-> self use-charge-anim-index) -1) + ) + (else + (set! (-> self charge-anim) (-> *kg-grunt-global-info* charge-anim (rnd-int self 3))) + ) + ) + ) + (until #f + (go-attack self 22528.0) + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-37 (ja-group))) + (when (not (and v1-37 (= v1-37 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-41 (-> self nav))) + (set! (-> v1-41 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate attack (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state))) + (set! (-> v1-1 speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-10 *game-info*) + (v0-1 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) v0-1) + (set! (-> self attack-id) v0-1) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "kg-grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *kg-grunt-global-info* attack-anim (rnd-int self 2))) + (let ((v1-5 (-> self nav))) + (set! (-> v1-5 target-speed) (-> self attack-anim travel-speed)) + ) + 0 + (let ((v1-7 (-> self nav))) + (set! (-> v1-7 turning-acceleration) 49152.0) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-17 (ja-group))) + (if (not (and v1-17 (= v1-17 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-1 (-> self draw art-group data (-> self charge-anim anim-index)))) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe 3.0 0)) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (let ((v1-57 0)) + (let ((a0-22 (the-as object (-> *kg-grunt-global-info* charge-anim))) + (a1-7 (-> self charge-anim)) + ) + (dotimes (a2-3 3) + (when (= (the-as kg-grunt-anim-info a0-22) a1-7) + (set! v1-57 a2-3) + (goto cfg-21) + ) + (set! a0-22 (&+ (the-as kg-grunt-anim-info a0-22) 8)) + ) + ) + (label cfg-21) + (set! (-> self use-charge-anim-index) v1-57) + ) + (go-virtual hostile) + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate spin-attack (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((gp-0 (handle->process (-> self focus handle)))) + (if (not gp-0) + (go-stare self) + ) + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-21 *game-info*) + (v0-3 (+ (-> v1-21 attack-id) 1)) + ) + (set! (-> v1-21 attack-id) v0-3) + (set! (-> self attack-id) v0-3) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (sound-play "kg-grunt-hit") + ) + ) + :code (behavior () + (set! (-> self attack-anim) (-> *kg-grunt-global-info* attack-anim (rnd-int self 2))) + (let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (let ((v1-13 (ja-group))) + (if (not (and v1-13 (= v1-13 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-9 (handle->process (-> self focus handle)))) + (if a0-9 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + ) + ) + (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((gp-3 (-> self focus aware))) + (if (or (not (get-focus! self)) (!= gp-3 3)) + (go-stare self) + ) + ) + (go-virtual hostile) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate circling (kg-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (set! (-> self charge-anim) (-> *kg-grunt-global-info* charge-anim (rnd-int self 3))) + (let ((v1-22 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-22 enemy-flags))) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-22 enemy-flags)))) + ) + (set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-22 enemy-flags)))) + (set! (-> v1-22 nav callback-info) (-> v1-22 enemy-info callback-info)) + ) + 0 + (let ((v1-25 self)) + (set! (-> v1-25 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-25 enemy-flags)))) + ) + 0 + (let ((v1-27 (-> self nav))) + (set! (-> v1-27 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (let ((v1-29 (-> self nav))) + (set! (-> v1-29 acceleration) (-> self enemy-info run-acceleration)) + ) + 0 + (let ((v1-31 (-> self nav))) + (set! (-> v1-31 turning-acceleration) (-> self enemy-info run-turning-acceleration)) + ) + 0 + (let ((gp-0 (-> self draw art-group data (-> self charge-anim anim-index)))) + (let ((v1-39 (ja-group))) + (if (not (and v1-39 (= v1-39 gp-0))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((s5-0 (rnd-int self 8)) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (< 20480.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (let ((v1-66 self)) + (set! (-> v1-66 enemy-flags) (the-as enemy-flag (logclear (-> v1-66 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-66 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-71 self)) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logclear (-> v1-71 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (vector-reset! (-> self root transv)) + (let ((v1-77 (ja-group))) + (if (not (and v1-77 (= v1-77 kg-grunt-celebrate-start-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (let ((f30-2 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! kg-grunt-celebrate-start-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + (ja-no-eval :group! kg-grunt-celebrate-finish-ja :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate pacing (kg-grunt) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 kg-grunt-charge0-ja) (= v1-2 kg-grunt-charge1-ja) (= v1-2 kg-grunt-charge2-ja))) + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) + ) + 0 + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (set! (-> self patrol-anim) (-> *kg-grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-28 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-28 enemy-flags))) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-28 enemy-flags)))) + ) + (set! (-> v1-28 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-28 enemy-flags)))) + (set! (-> v1-28 nav callback-info) (-> v1-28 enemy-info callback-info)) + ) + 0 + (let ((v1-31 self)) + (set! (-> v1-31 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-31 enemy-flags)))) + ) + 0 + (let ((v1-33 (-> self nav))) + (set! (-> v1-33 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((v1-35 (-> self nav))) + (set! (-> v1-35 acceleration) (-> self enemy-info walk-acceleration)) + ) + 0 + (let ((v1-37 (-> self nav))) + (set! (-> v1-37 turning-acceleration) (-> self enemy-info walk-turning-acceleration)) + ) + 0 + (let ((v1-41 (ja-group))) + (if (not (and v1-41 (= v1-41 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate stop-chase (kg-grunt) + :virtual #t + :code (behavior () + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (set! (-> self patrol-anim) (-> *kg-grunt-global-info* patrol-anim (rnd-int self 4))) + (let ((v1-14 (-> self nav))) + (set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed)) + ) + 0 + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) + ) + (let ((v1-24 (ja-group))) + (if (not (and v1-24 (= v1-24 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; definition for method 85 of type kg-grunt +(defmethod knocked-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (let ((v1-2 (ash 1 (-> *kg-grunt-global-info* prev-yellow-hit-anim-index))) + (a0-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and a0-7 (or (= a0-7 (-> this draw art-group data 16)) + (= a0-7 (-> this draw art-group data 38)) + (= a0-7 (-> this draw art-group data 39)) + (= a0-7 (-> this draw art-group data 40)) + ) + ) + (set! a2-3 (logior v1-2 4)) + (set! a2-3 (logior v1-2 8)) + ) + ) + (let ((s4-0 (enemy-method-131 this 4 a2-3))) + (set! (-> *kg-grunt-global-info* prev-yellow-hit-anim-index) s4-0) + (set! (-> this yellow-hit-anim) (-> *kg-grunt-global-info* yellow-hit-anim s4-0)) + (let ((v1-11 (rnd-int this 3))) + (if (= s4-0 3) + (set! v1-11 2) + ) + (set! (-> this use-charge-anim-index) v1-11) + ) + ) + (let ((s4-1 (-> this draw art-group data (-> this yellow-hit-anim anim-index)))) + (ja-channel-push! 1 0) + (let ((a0-19 (-> this skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-19 param 1) (-> arg0 anim-speed)) + (set! (-> a0-19 frame-num) 0.0) + (joint-control-channel-group! a0-19 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + #t + ) + (((knocked-type blue-shot)) + (let* ((v1-24 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (s4-2 (and v1-24 (or (= v1-24 (-> this draw art-group data 16)) + (= v1-24 (-> this draw art-group data 38)) + (= v1-24 (-> this draw art-group data 39)) + (= v1-24 (-> this draw art-group data 40)) + ) + ) + ) + ) + (if (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (logior! (-> this kg-grunt-flags) 2) + ) + (cond + ((and (not s4-2) (logtest? (-> this kg-grunt-flags) 2)) + (set! s4-2 #t) + (ja-channel-push! 1 (seconds 0.17)) + ) + (else + (let ((v1-36 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-36 (= v1-36 (-> this draw art-group data 44))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + ) + ) + (let ((v1-42 (ash 1 (-> *kg-grunt-global-info* prev-blue-hit-anim-index)))) + (if s4-2 + (set! a2-5 (logior v1-42 56)) + (set! a2-5 (logior v1-42 7)) + ) + ) + (let ((v1-46 (enemy-method-131 this 6 a2-5))) + (set! (-> *kg-grunt-global-info* prev-blue-hit-anim-index) v1-46) + (set! (-> this blue-hit-anim) (-> *kg-grunt-global-info* blue-hit-anim v1-46)) + ) + (let ((a2-6 0)) + (when (not (logtest? (-> this kg-grunt-flags) 2)) + (if s4-2 + (set! a2-6 (logior a2-6 3)) + (set! a2-6 (logior a2-6 4)) + ) + ) + (set! (-> this use-charge-anim-index) (enemy-method-131 this 3 a2-6)) + ) + ) + (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) + (a0-51 (-> this skel root-channel 0)) + ) + (set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26)) + (set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1))) + (set! (-> a0-51 param 1) (-> arg0 anim-speed)) + (set! (-> a0-51 frame-num) 0.0) + (joint-control-channel-group! a0-51 (the-as art-joint-anim a1-26) num-func-seek!) + ) + #t + ) + (else + 0 + (cond + ((or (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) + (= (-> this incoming knocked-type) (knocked-type dark-shot)) + ) + (set! v1-72 3) + ) + (else + (let ((s4-3 (ash 1 (-> *kg-grunt-global-info* prev-knocked-anim-index)))) + (let ((s3-0 (-> this root))) + (if (>= 16384.0 (fabs (deg- (quaternion-y-angle (-> s3-0 quat)) (atan (-> s3-0 transv x) (-> s3-0 transv z))))) + (set! s4-3 (logior s4-3 4)) + ) + ) + (set! v1-72 (enemy-method-131 this 3 s4-3)) + ) + ) + ) + (set! (-> *kg-grunt-global-info* prev-knocked-anim-index) v1-72) + (set! (-> this knocked-anim-index) v1-72) + (set! (-> this knocked-anim) (-> *kg-grunt-global-info* knocked-anim v1-72)) + (let ((s4-4 (-> this draw art-group data (-> this knocked-anim anim-index)))) + (ja-channel-push! 1 0) + (let ((a0-68 (-> this skel root-channel 0))) + (set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4)) + (set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1))) + (set! (-> a0-68 param 1) (-> arg0 anim-speed)) + (set! (-> a0-68 frame-num) 0.0) + (joint-control-channel-group! a0-68 (the-as art-joint-anim s4-4) num-func-seek!) + ) + ) + #t + ) + ) + ) + +;; definition for method 86 of type kg-grunt +(defmethod knocked-land-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + #f + ) + ((!= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (let ((v1-8 (-> this + draw + art-group + data + (-> *kg-grunt-global-info* knocked-land-anim (-> this knocked-anim-index) anim-index) + ) + ) + (a0-3 (-> this skel root-channel 0)) + ) + (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-8)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-8) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim v1-8) num-func-seek!) + ) + #t + ) + ) + ) + +;; definition for method 81 of type kg-grunt +(defmethod go-die ((this kg-grunt)) + (go (method-of-object this explode)) + ) + +;; failed to figure out what this is: +(defstate wait-for-focus (kg-grunt) + :virtual #t + :event enemy-event-handler + :enter (-> (method-of-type nav-enemy idle) enter) + :trans (behavior () + (let ((s5-0 (handle->process (-> self focus handle)))) + (when s5-0 + (let ((gp-0 (get-trans (the-as process-focusable s5-0) 0))) + (when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))) + (>= 163840.0 (vector-vector-distance (-> self root trans) gp-0)) + ) + (or (not (logtest? (-> self fact enemy-options) (enemy-option user8))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) + (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root trans y)))) + ) + ) + ) + (cond + ((and (logtest? (-> self fact enemy-options) (enemy-option user9)) + (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)) + ) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (vector-! s5-1 gp-0 (-> self root trans)) + (let ((f0-2 32768.0) + (v1-26 s5-1) + ) + (if (or (>= f0-2 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + (>= 20024.889 (fabs (deg- (y-angle (-> self root)) (atan (-> s5-1 x) (-> s5-1 z))))) + ) + (go-virtual notice) + ) + ) + ) + ) + (else + (go-virtual notice) + ) + ) + ) + ) + ) + ) + ) + :code (-> (method-of-type nav-enemy idle) code) + :post (-> (method-of-type nav-enemy idle) post) + ) + +;; definition for method 143 of type kg-grunt +(defmethod on-dying ((this kg-grunt)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type kg-grunt +;; WARN: Return type mismatch nav-enemy vs kg-grunt. +(defmethod relocate ((this kg-grunt) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (the-as kg-grunt ((method-of-type nav-enemy relocate) this offset)) + ) + +;; definition for method 120 of type kg-grunt +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this kg-grunt)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (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 17408.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd crate obstacle hit-by-others-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 9830.4 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 4915.2) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-19 transform-index) 18) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 2252.8) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 16) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 12) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-25 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-25 transform-index) 6) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 198 of type kg-grunt +(defmethod get-nav-enemy-info ((this kg-grunt)) + *kg-grunt-nav-enemy-info* + ) + +;; definition for method 121 of type kg-grunt +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this kg-grunt)) + (if (and (-> this entity) (= (-> this entity extra level name) 'factoryd)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-kg-grunt-lowres" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-kg-grunt" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (logior! (-> this mask) (process-mask kg-robot)) + (init-enemy-defaults! this (get-nav-enemy-info this)) + (let ((v1-17 (-> this neck))) + (set! (-> v1-17 up) (the-as uint 1)) + (set! (-> v1-17 nose) (the-as uint 2)) + (set! (-> v1-17 ear) (the-as uint 0)) + (set-vector! (-> v1-17 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-17 ignore-angle) 30947.555) + ) + (let ((v1-19 (-> this nav))) + (set! (-> v1-19 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((s5-3 *kg-grunt-global-info*)) + (set! (-> this patrol-anim) (-> s5-3 patrol-anim (rnd-int this 4))) + (set! (-> this charge-anim) (-> s5-3 charge-anim (rnd-int this 3))) + (set! (-> this attack-anim) (-> s5-3 attack-anim (rnd-int this 2))) + ) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (rnd-int this 2)) + (logior! (-> this kg-grunt-flags) 1) + ) + (if (zero? (rnd-int this 2)) + (logior! (-> this kg-grunt-flags) 4) + ) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + (set-vector! (-> this root scale) 1.25 1.25 1.25 1.0) + (setup-masks (-> this draw) -1 0) + 0 + (none) + ) + +;; definition for method 122 of type kg-grunt +;; WARN: Return type mismatch int vs object. +(defmethod go-idle2 ((this kg-grunt)) + (if (logtest? (-> this fact enemy-options) (enemy-option user9)) + (go (method-of-object this wait-for-focus)) + (go (method-of-object this idle)) + ) + 0 + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc new file mode 100644 index 0000000000..6afc7c3bf0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc @@ -0,0 +1,3625 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-prebot-critter-trail + :id 440 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 1754 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 1755 :flags (sp6)) + (sp-item 1756 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +;; failed to figure out what this is: +(defpart 1756 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 4.0) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 48.0 16.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 6761.25)) + (:vel-y (meters 0) (meters 0.01)) + (:fade-a -0.10666667) + (:accel-y (meters -0.000033333334) (meters -0.000016666667)) + (:friction 0.96) + (:timer (seconds 0.5) (seconds 3.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.017) (seconds 0.497)) + (:next-launcher 1757) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 1757 + :init-specs ((:r 32.0) (:g 128.0 128.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 1758)) + ) + +;; failed to figure out what this is: +(defpart 1758 + :init-specs ((:r 0.0) (:g 48.0 16.0) (:b 64.0) (:next-time (seconds 0.017) (seconds 0.497)) (:next-launcher 1757)) + ) + +;; failed to figure out what this is: +(defpart 1755 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -0.8) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1754 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 3.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 64.0 8.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters 0.005) (meters 0.008333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.2) + (:fade-g 0.0) + (:fade-b -3.2) + (:fade-a -0.8) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.135)) + (:next-launcher 1759) + ) + ) + +;; failed to figure out what this is: +(defpart 1759 + :init-specs ((:r 128.0) + (:g 128.0) + (:b 128.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.10666667 -0.21333334) + (:func 'nothing) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-eco-lg cav-eco-lg cav-eco-lg-lod0-jg cav-eco-lg-idle-ja + ((cav-eco-lg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; definition of type prebot-large-eco-creature +(deftype prebot-large-eco-creature (nav-enemy) + ((old-y-deg float) + (diff-angle float) + (attack-anims (array int32)) + (victory-anims (array int32)) + (turn-left-anim int32) + (turn-right-anim int32) + (split-type type) + (attack-stop-frame float) + (traj trajectory :inline) + (which-trajectory int8) + (x-rotate float) + (y-rotate float) + (launch-pos vector :inline) + (launch vector :inline) + (spin-jm joint-mod) + (trail-part sparticle-launch-control) + (trail-sound sound-id) + (flags eco-creature-flag) + ) + (:state-methods + unfold + fly-to-dest + attack + wait-for-children + ) + (:methods + (prebot-large-eco-creature-method-194 (_type_) none) + (prebot-large-eco-creature-method-195 (_type_) none) + ) + ) + +;; definition for method 3 of type prebot-large-eco-creature +(defmethod inspect ((this prebot-large-eco-creature)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Told-y-deg: ~f~%" (-> this old-y-deg)) + (format #t "~2Tdiff-angle: ~f~%" (-> this diff-angle)) + (format #t "~2Tattack-anims: ~A~%" (-> this attack-anims)) + (format #t "~2Tvictory-anims: ~A~%" (-> this victory-anims)) + (format #t "~2Tturn-left-anim: ~D~%" (-> this turn-left-anim)) + (format #t "~2Tturn-right-anim: ~D~%" (-> this turn-right-anim)) + (format #t "~2Tsplit-type: ~A~%" (-> this split-type)) + (format #t "~2Tattack-stop-frame: ~f~%" (-> this attack-stop-frame)) + (format #t "~2Ttraj: #~%" (-> this traj)) + (format #t "~2Twhich-trajectory: ~D~%" (-> this which-trajectory)) + (format #t "~2Tx-rotate: ~f~%" (-> this x-rotate)) + (format #t "~2Ty-rotate: ~f~%" (-> this y-rotate)) + (format #t "~2Tlaunch-pos: #~%" (-> this launch-pos)) + (format #t "~2Tlaunch: #~%" (-> this launch)) + (format #t "~2Tspin-jm: ~A~%" (-> this spin-jm)) + (format #t "~2Ttrail-part: ~A~%" (-> this trail-part)) + (format #t "~2Ttrail-sound: ~D~%" (-> this trail-sound)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition for symbol *prebot-large-eco-creature-nav-enemy-info*, type nav-enemy-info +(define *prebot-large-eco-creature-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 3 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim 2 + :victory-anim 10 + :jump-wind-up-anim 2 + :jump-in-air-anim 2 + :jump-land-anim 2 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 16384.0 + :knocked-red-vxz-hi 40960.0 + :knocked-red-vy-lo 49152.0 + :knocked-red-vy-hi 61440.0 + :knocked-blue-vxz-lo 20480.0 + :knocked-blue-vxz-hi 28672.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 1.0 :w 35404.914) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8223.438) + :geo-tform (new 'static 'vector :x 1.0 :w 27181.492) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14248.819) + :geo-tform (new 'static 'vector :x -1.0 :w 10623.986) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 12262.859) + :geo-tform (new 'static 'vector :x 1.0 :w 33438.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.137 :z -0.9905 :w 11373.791) + :geo-tform (new 'static 'vector :x 0.2271 :y 0.9734 :z 0.0279 :w 36639.176) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5102 :z -0.86 :w 20530.754) + :geo-tform (new 'static 'vector :x 0.409 :y -0.0529 :z 0.9109 :w 32271.676) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6644 :z -0.7473 :w 1968.9199) + :geo-tform (new 'static 'vector :x 0.4093 :y 0.033 :z 0.9117 :w 33077.91) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9613 :z -0.2752 :w 2214.5525) + :geo-tform (new 'static 'vector :x 0.4059 :y -0.0481 :z 0.9126 :w 34502.54) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5153 :z 0.8569 :w 2080.0034) + :geo-tform (new 'static 'vector :x 0.4027 :y -0.0356 :z 0.9146 :w 32440.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.4859 :z 0.8739 :w 3273.5598) + :geo-tform (new 'static 'vector :x 0.414 :y 0.0464 :z 0.909 :w 29818.152) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8326 :z -0.5538 :w 3106.5886) + :geo-tform (new 'static 'vector :x 0.419 :y -0.032 :z 0.9073 :w 32459.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.9421 :z -0.3352 :w 6646.0605) + :geo-tform (new 'static 'vector :x 0.3914 :y -0.2 :z 0.8982 :w 37623.16) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3413 :z -0.9399 :w 1832.5868) + :geo-tform (new 'static 'vector :x 0.4204 :y -0.1424 :z 0.896 :w 38915.023) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1371 :z 0.9905 :w 11369.786) + :geo-tform (new 'static 'vector :x -0.2272 :y 0.9734 :z 0.0279 :w 28896.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5101 :z 0.86 :w 20534.176) + :geo-tform (new 'static 'vector :x -0.026 :y 0.9979 :z 0.0579 :w 23979.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6645 :z 0.7472 :w 1958.0337) + :geo-tform (new 'static 'vector :x 0.016 :y 0.9992 :z -0.0358 :w 23969.791) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9615 :z 0.2744 :w 2230.645) + :geo-tform (new 'static 'vector :x 0.0911 :y 0.9943 :z 0.0536 :w 24079.475) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5098 :z -0.8602 :w 2098.3352) + :geo-tform (new 'static 'vector :x -0.0178 :y 0.999 :z 0.0406 :w 24125.459) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 19 + :pre-tform (new 'static 'vector :x 0.4819 :z -0.8762 :w 3256.2107) + :geo-tform (new 'static 'vector :x -0.1538 :y 0.9868 :z -0.0491 :w 23956.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8364 :z 0.548 :w 3087.583) + :geo-tform (new 'static 'vector :x -0.017 :y 0.9991 :z 0.0369 :w 23745.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.9425 :z 0.3339 :w 6655.1807) + :geo-tform (new 'static 'vector :x 0.2492 :y 0.945 :z 0.2115 :w 24615.268) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3403 :z 0.9402 :w 1852.0657) + :geo-tform (new 'static 'vector :x 0.3178 :y 0.9363 :z 0.1493 :w 24121.836) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 20948.764) + :geo-tform (new 'static 'vector :x -1.0 :w 9182.285) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0068 :w 7387.509) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.003 :z -0.0014 :w 16198.405) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9697 :z -0.244 :w 191.6382) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4854 :z -0.8742 :w 21186.406) + :geo-tform (new 'static 'vector :x 0.6599 :y 0.6796 :z 0.3201 :w 35879.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0363 :w 2717.3774) + :geo-tform (new 'static 'vector :x 0.6708 :y 0.7057 :z 0.2277 :w 34044.242) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3584 :z -0.9335 :w 11286.792) + :geo-tform (new 'static 'vector :x -0.4444 :y 0.7119 :z -0.5437 :w 28463.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1147 :z -0.9933 :w 2024.0066) + :geo-tform (new 'static 'vector :x -0.5154 :y 0.6809 :z -0.5201 :w 27281.908) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4859 :z 0.8739 :w 21191.012) + :geo-tform (new 'static 'vector :x 0.1968 :y 0.4177 :z -0.8869 :w 17933.508) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z -0.0361 :w 2729.0828) + :geo-tform (new 'static 'vector :x 0.0825 :y 0.3055 :z -0.9485 :w 17459.846) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3588 :z 0.9333 :w 11281.3125) + :geo-tform (new 'static 'vector :x 0.2273 :y 0.5912 :z 0.7738 :w 23386.34) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1145 :z 0.9934 :w 2026.6462) + :geo-tform (new 'static 'vector :x 0.2996 :y 0.5792 :z 0.758 :w 21904.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + ) + ) + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 5) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 4) + :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! (-> *prebot-large-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 74 of type prebot-large-eco-creature +(defmethod go-ambush-delay ((this prebot-large-eco-creature)) + (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) + (go-idle2 this) + ((method-of-type nav-enemy go-ambush-delay) this) + ) + ) + +;; definition for method 71 of type prebot-large-eco-creature +(defmethod go-dormant ((this prebot-large-eco-creature)) + (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) + (go-idle2 this) + ((method-of-type nav-enemy go-dormant) this) + ) + ) + +;; definition for method 72 of type prebot-large-eco-creature +(defmethod go-dormant-aware ((this prebot-large-eco-creature)) + (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) + (go-idle2 this) + ((method-of-type nav-enemy go-dormant-aware) this) + ) + ) + +;; definition for method 82 of type prebot-large-eco-creature +(defmethod event-handler ((this prebot-large-eco-creature) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((s4-0 (the-as object (-> arg3 param 1)))) + (cond + ((or (not (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s4-0) mask))) + (logand (penetrate + vehicle + dark-skin + dark-punch + dark-bomb + dark-smack + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + ) + (-> (the-as attack-info s4-0) penetrate-using) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + (when (and (logtest? (-> (the-as attack-info s4-0) mask) (attack-mask id)) + (!= (-> (the-as attack-info s4-0) id) (-> this incoming attack-id)) + ) + (set! (-> this incoming attack-id) (-> (the-as attack-info s4-0) id)) + #t + ) + ) + ) + ) + ) + (('death-end) + (prebot-large-eco-creature-method-195 this) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('eco-creature-died) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer arg0)) + (set! (-> a1-4 num-params) arg1) + (set! (-> a1-4 message) arg2) + (set! (-> a1-4 param 0) (-> arg3 param 0)) + (set! (-> a1-4 param 1) (-> arg3 param 1)) + (set! (-> a1-4 param 2) (-> arg3 param 2)) + (set! (-> a1-4 param 3) (-> arg3 param 3)) + (set! (-> a1-4 param 4) (-> arg3 param 4)) + (set! (-> a1-4 param 5) (-> arg3 param 5)) + (send-event-function (ppointer->process (-> this parent)) a1-4) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 67 of type prebot-large-eco-creature +(defmethod coin-flip? ((this prebot-large-eco-creature)) + #f + ) + +;; definition for method 59 of type prebot-large-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod enemy-common-post ((this prebot-large-eco-creature)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (let ((f0-0 (quaternion-y-angle (-> this root quat)))) + (set! (-> this diff-angle) (- (-> this old-y-deg) f0-0)) + (cond + ((< 32768.0 (-> this diff-angle)) + (+! (-> this diff-angle) -65536.0) + ) + ((< (-> this diff-angle) -32768.0) + (+! (-> this diff-angle) 65536.0) + ) + ) + (set! (-> this old-y-deg) f0-0) + ) + (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (logior! (-> this flags) (eco-creature-flag ecf0)) + (logclear! (-> this flags) (eco-creature-flag ecf0)) + ) + 0 + (none) + ) + +;; definition for method 194 of type prebot-large-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod prebot-large-eco-creature-method-194 ((this prebot-large-eco-creature)) + (cond + ((< 0.0 (-> this diff-angle)) + (let ((v1-2 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((not (and v1-2 (= v1-2 (-> this draw art-group data (-> this turn-left-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-0 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-0 + (the-as art-joint-anim (-> this draw art-group data (-> this turn-left-anim))) + num-func-identity + ) + (set! (-> s5-0 frame-num) 0.0) + ) + ) + (else + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 param 0) (* 0.0019975142 (-> this diff-angle))) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + ) + ) + ) + (else + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((not (and v1-17 (= v1-17 (-> this draw art-group data (-> this turn-right-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data (-> this turn-right-anim))) + num-func-identity + ) + (set! (-> s5-1 frame-num) 0.0) + ) + ) + (else + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 param 0) (* -0.0019975142 (-> this diff-angle))) + (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-loop!) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 195 of type prebot-large-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod prebot-large-eco-creature-method-195 ((this prebot-large-eco-creature)) + (when (not (logtest? (-> this flags) (eco-creature-flag ecf2))) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (send-event (ppointer->process (-> this parent)) 'eco-creature-died (-> this root trans)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate knocked (prebot-large-eco-creature) + :virtual #t + :enter (behavior () + (cond + ((and (-> self split-type) (or (= (-> self hit-points) 0.0) (nonzero? (-> self fated-time)))) + (large-eco-creature-split) + (go-virtual wait-for-children) + ) + (else + (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait-for-children (prebot-large-eco-creature) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('eco-creature-died) + (let ((v1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-1 from) (process->ppointer proc)) + (set! (-> v1-1 num-params) argc) + (set! (-> v1-1 message) message) + (set! (-> v1-1 param 0) (-> block param 0)) + (set! (-> v1-1 param 1) (-> block param 1)) + (set! (-> v1-1 param 2) (-> block param 2)) + (set! (-> v1-1 param 3) (-> block param 3)) + (set! (-> v1-1 param 4) (-> block param 4)) + (set! (-> v1-1 param 5) (-> block param 5)) + (send-event-function (ppointer->process (-> self parent)) v1-1) + ) + ) + ) + ) + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-6 (-> self nav))) + (logclear! (-> v1-6 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + (logclear! (-> self root nav-flags) (nav-flags has-root-sphere)) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + ) + +;; failed to figure out what this is: +(defstate attack (prebot-large-eco-creature) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (eco-creature-flag ecf1)) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-9 *game-info*) + (a0-5 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-5) + (set! (-> self attack-id) a0-5) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self attack-anims (rand-vu-int-count (-> self attack-anims length)))) + ) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-179 self) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 max-rotation-rate) (-> self enemy-info maximum-rotation-rate)) + ) + 0 + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + nav-state + (if (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logior! (-> self flags) (eco-creature-flag ecf1)) + ) + (cond + ((ja-group-in-array? (-> self attack-anims)) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) (-> self attack-stop-frame)) + (let ((v1-17 (-> self nav))) + (set! (-> v1-17 target-speed) 0.0) + ) + 0 + (let ((v1-20 (-> self nav state))) + (set! (-> v1-20 speed) 0.0) + ) + 0 + (let ((v1-22 (-> self nav))) + (set! (-> v1-22 max-rotation-rate) 0.0) + ) + 0 + ) + (when (ja-done? 0) + (if (logtest? (-> self flags) (eco-creature-flag ecf1)) + (go-virtual victory) + (go-hostile self) + ) + ) + ) + ((logtest? (-> self flags) (eco-creature-flag ecf1)) + (go-virtual victory) + ) + (else + (go-hostile self) + ) + ) + ) + :code sleep-code + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate notice (prebot-large-eco-creature) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when (and a0-1 (time-elapsed? (-> self state-time) (seconds 0.1))) + (let ((gp-1 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-1) 0) (-> self root trans)) + ) + ) + (if (and (< (vector-normalize-ret-len! gp-1 1.0) 18432.0) + (< (cos 5461.3335) (vector-dot gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + ) + (go-virtual attack) + ) + ) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-29 (ja-group))) + (when (not (and v1-29 (= v1-29 (-> self draw art-group data (-> self enemy-info hostile-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate circling (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy circling) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (nav-enemy-method-176 self) + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate pacing (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy pacing) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate stare (prebot-large-eco-creature) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (eco-creature-flag ecf0))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! min) + ) + ) + (ja :num! (loop!)) + ) + (else + (prebot-large-eco-creature-method-194 self) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate victory (prebot-large-eco-creature) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (ja-no-eval :group! (-> self draw art-group data (-> self victory-anims (rand-vu-int-count (-> self victory-anims length)))) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate unfold (prebot-large-eco-creature) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (event-handler self proc argc message block) + ) + :enter (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data 13) :num! min) + ) + :trans (behavior () + (ja :num! (seek!)) + (if (ja-done? 0) + (go-best-state self) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate fly-to-dest (prebot-large-eco-creature) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((v1-1 (the-as object (-> block param 1)))) + (if (or (not (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-1) mask))) + (logand (penetrate + vehicle + dark-skin + dark-punch + dark-bomb + dark-smack + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + ) + (-> (the-as attack-info v1-1) penetrate-using) + ) + ) + (enemy-event-handler proc argc message block) + (send-event proc 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + ) + #f + ) + (('touch 'bonk) + (if (and (< (-> self which-trajectory) 2) (= proc *target*)) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + (event-handler self proc argc message block) + ) + #t + ) + (('set-dest) + (let ((s5-0 (the-as object (-> block param 0))) + (gp-0 (the-as object (-> block param 1))) + ) + (let ((f30-0 (the-as float (-> block param 2))) + (f28-0 (the-as float (-> block param 3))) + ) + (if (< (-> (the-as vector s5-0) y) (-> (the-as vector gp-0) y)) + (+! f30-0 (- (-> (the-as vector gp-0) y) (-> (the-as vector s5-0) y))) + ) + (let ((f0-15 (* 0.0000061035157 (vector-vector-xz-distance (the-as vector s5-0) (the-as vector gp-0)) f28-0))) + (setup-from-to-duration-and-height! (-> self traj) (the-as vector s5-0) (the-as vector gp-0) f0-15 f30-0) + ) + ) + (let ((v1-27 (new 'stack-no-clear 'vector))) + (vector-! v1-27 (the-as vector gp-0) (the-as vector s5-0)) + (set! (-> v1-27 y) 0.0) + (let ((f30-1 (atan (-> v1-27 x) (-> v1-27 z)))) + (quaternion-set! (-> self root quat) 0.0 (sin (* 0.5 f30-1)) 0.0 (cos (* 0.5 f30-1))) + ) + ) + (set! (-> self which-trajectory) 0) + (set! (-> self x-rotate) 0.0) + (set! (-> self y-rotate) 0.0) + (set! (-> self root trans quad) (-> (the-as vector s5-0) quad)) + (set! (-> self launch-pos quad) (-> (the-as vector s5-0) quad)) + (set! (-> self launch quad) (-> (the-as vector s5-0) quad)) + (let* ((v1-36 (-> self nav)) + (f0-25 (-> v1-36 extra-nav-sphere w)) + ) + (set! (-> v1-36 extra-nav-sphere quad) (-> (the-as vector gp-0) quad)) + (set! (-> v1-36 extra-nav-sphere w) f0-25) + ) + ) + 0 + (let ((v1-39 (-> self nav))) + (set! (-> v1-39 extra-nav-sphere w) 16384.0) + ) + 0 + (let ((v1-41 (-> self nav))) + (logior! (-> v1-41 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + (else + (if (> (-> self which-trajectory) 0) + (event-handler self proc argc message block) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (ja :group! (-> self draw art-group data 12) :num! min) + ) + :exit (behavior () + (quaternion-identity! (-> self spin-jm quat)) + (let ((v1-1 (-> self nav))) + (logclear! (-> v1-1 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + :trans (behavior () + (let ((v1-0 (-> self which-trajectory))) + (cond + ((zero? v1-0) + (sound-play "launch-trail" :id (-> self trail-sound) :position (-> self root trans)) + (logior! (-> self flags) (eco-creature-flag ecf4)) + (+! (-> self x-rotate) 4369.067) + (+! (-> self y-rotate) 3458.8445) + ) + ((= v1-0 1) + (when (logtest? (-> self flags) (eco-creature-flag ecf4)) + (sound-stop (-> self trail-sound)) + (logclear! (-> self flags) (eco-creature-flag ecf4)) + ) + (+! (-> self x-rotate) 7281.778) + (set! (-> self y-rotate) 0.0) + ) + (else + (seek! (-> self x-rotate) 65353.957 7281.778) + ) + ) + ) + (if (< 65536.0 (-> self x-rotate)) + (+! (-> self x-rotate) -65536.0) + ) + (if (< 65536.0 (-> self y-rotate)) + (+! (-> self y-rotate) -65536.0) + ) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-set! s5-0 (sin (* 0.5 (-> self x-rotate))) 0.0 0.0 (cos (* 0.5 (-> self x-rotate)))) + (quaternion-set! gp-0 0.0 (sin (* 0.5 (-> self y-rotate))) 0.0 (cos (* 0.5 (-> self y-rotate)))) + (quaternion-normalize! (quaternion*! (-> self spin-jm quat) gp-0 s5-0)) + ) + (cond + ((time-elapsed? (-> self state-time) (the int (-> self traj time))) + (let ((v1-34 (-> self which-trajectory))) + (cond + ((zero? v1-34) + (set! (-> self which-trajectory) 1) + (sound-play "caveco-land" :position (-> self root trans)) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (set-time! (-> self state-time)) + (let ((gp-3 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) + (set! (-> gp-3 y) 0.0) + (vector-normalize! gp-3 12288.0) + (vector+! gp-3 gp-3 (-> self root trans)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-3 75.0 4096.0) + ) + ) + ((= v1-34 1) + (set! (-> self which-trajectory) 2) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (set-time! (-> self state-time)) + (let ((gp-5 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) + (set! (-> gp-5 y) 0.0) + (vector-normalize! gp-5 4096.0) + (vector+! gp-5 gp-5 (-> self root trans)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-5 37.5 1024.0) + ) + ) + ((= v1-34 2) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (set! (-> self which-trajectory) 3) + (let* ((gp-6 (-> self state-time)) + (f30-0 300.0) + (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-77 (the-as number (logior #x3f800000 v1-76))) + ) + (set! (-> self state-time) (+ gp-6 (the int (* f30-0 (+ -1.0 (the-as float v1-77)))))) + ) + ) + (else + (go-virtual unfold) + ) + ) + ) + ) + ((< (-> self which-trajectory) 3) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (if (logtest? (-> self flags) (eco-creature-flag ecf3)) + (spawn-from-cspace (-> self trail-part) (-> self node-list data 3)) + ) + ) + ) + (ja :num! (loop! 0.2)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (logior! (-> self flags) (eco-creature-flag ecf3)) + (do-push-aways (-> self root)) + ) + ) + +;; definition for method 122 of type prebot-large-eco-creature +(defmethod go-idle2 ((this prebot-large-eco-creature)) + (set! (-> this event-hook) (-> (method-of-object this fly-to-dest) event)) + (go (method-of-object this fly-to-dest)) + ) + +;; definition for method 120 of type prebot-large-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this prebot-large-eco-creature)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 16) 0))) + (set! (-> s5-0 total-prims) (the-as uint 17)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 26) + (set-vector! (-> s4-0 local-sphere) 1076.4288 -3118.6943 2700.0833 18061.312) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set-vector! (-> v1-14 local-sphere) 0.0 5734.4 0.0 8192.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) -26.2144 -2495.2832 378.88 4096.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly)) + (set! (-> v1-20 transform-index) 6) + (set-vector! (-> v1-20 local-sphere) -32.3584 281.8048 1412.7104 2940.109) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly)) + (set! (-> v1-22 transform-index) 9) + (set-vector! (-> v1-22 local-sphere) -12.288 84.3776 -2.4576 2387.5583) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly)) + (set! (-> v1-24 transform-index) 10) + (set-vector! (-> v1-24 local-sphere) 178.5856 -1004.3392 81.5104 2358.4768) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly)) + (set! (-> v1-26 transform-index) 18) + (set-vector! (-> v1-26 local-sphere) 0.0 0.0 0.0 2896.6912) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly)) + (set! (-> v1-28 transform-index) 19) + (set-vector! (-> v1-28 local-sphere) -130.2528 1489.7152 -119.1936 2784.8704) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid deadly)) + (set! (-> v1-30 transform-index) 28) + (set-vector! (-> v1-30 local-sphere) 0.0 0.0 0.0 2600.5503) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid deadly)) + (set! (-> v1-32 transform-index) 29) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 2296.6272) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid deadly)) + (set! (-> v1-34 transform-index) 30) + (set-vector! (-> v1-34 local-sphere) 82.7392 -43.008 -394.0352 1869.824) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid deadly)) + (set! (-> v1-36 transform-index) 31) + (set-vector! (-> v1-36 local-sphere) 151.9616 0.0 -608.256 1713.3568) + ) + (let ((v1-38 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-38 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-38 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-38 prim-core action) (collide-action solid deadly)) + (set! (-> v1-38 transform-index) 33) + (set-vector! (-> v1-38 local-sphere) -1664.2048 -741.7856 -648.8064 3235.4304) + ) + (let ((v1-40 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-40 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-40 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-40 prim-core action) (collide-action solid deadly)) + (set! (-> v1-40 transform-index) 35) + (set-vector! (-> v1-40 local-sphere) 1078.4768 509.1328 511.1808 3509.8623) + ) + (let ((v1-42 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-42 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-42 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-42 prim-core action) (collide-action solid deadly)) + (set! (-> v1-42 transform-index) 37) + (set-vector! (-> v1-42 local-sphere) 791.7568 571.8016 355.9424 3460.3008) + ) + (let ((v1-44 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-44 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-44 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-44 prim-core action) (collide-action solid deadly)) + (set! (-> v1-44 transform-index) 39) + (set-vector! (-> v1-44 local-sphere) -593.1008 -499.712 -635.6992 3313.2544) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-46 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-46 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-46 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 7 of type prebot-large-eco-creature +(defmethod relocate ((this prebot-large-eco-creature) (offset int)) + (if (nonzero? (-> this spin-jm)) + (&+! (-> this spin-jm) offset) + ) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type prebot-large-eco-creature +(defmethod deactivate ((this prebot-large-eco-creature)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this trail-part)) + (kill-particles (-> this trail-part)) + ) + (when (logtest? (-> this flags) (eco-creature-flag ecf4)) + (sound-stop (-> this trail-sound)) + (logclear! (-> this flags) (eco-creature-flag ecf4)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 121 of type prebot-large-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this prebot-large-eco-creature)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *prebot-large-eco-creature-nav-enemy-info*) + (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) + (let ((v1-8 (-> this neck))) + (set! (-> v1-8 up) (the-as uint 1)) + (set! (-> v1-8 nose) (the-as uint 2)) + (set! (-> v1-8 ear) (the-as uint 0)) + (set-vector! (-> v1-8 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-8 ignore-angle) 15473.777) + ) + (let ((v1-10 (-> this nav))) + (set! (-> v1-10 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (set! (-> this attack-anims) (new 'static 'boxed-array :type int32 8 9)) + (set! (-> this victory-anims) (new 'static 'boxed-array :type int32 10 11)) + (set! (-> this turn-left-anim) 6) + (set! (-> this turn-right-anim) 7) + (set! (-> this split-type) prebot-medium-eco-creature) + (set! (-> this attack-stop-frame) 0.0) + (set! (-> this which-trajectory) 0) + (set! (-> this spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this trail-part) (create-launch-control (-> *part-group-id-table* 440) this)) + (set! (-> this flags) (eco-creature-flag)) + (set! (-> this trail-sound) (new-sound-id)) + (send-event (ppointer->process (-> this parent)) 'start-critter) + 0 + (none) + ) + +;; definition of type prebot-medium-eco-creature +(deftype prebot-medium-eco-creature (prebot-large-eco-creature) + ((is-top basic) + (is-bottom basic) + (initial-scale float) + (final-scale float) + ) + (:methods + (prebot-medium-eco-creature-method-196 (_type_) none) + (prebot-medium-eco-creature-method-197 (_type_) none) + ) + ) + +;; definition for method 3 of type prebot-medium-eco-creature +(defmethod inspect ((this prebot-medium-eco-creature)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type prebot-large-eco-creature inspect))) + (t9-0 this) + ) + (format #t "~2Tis-top: ~A~%" (-> this is-top)) + (format #t "~2Tis-bottom: ~A~%" (-> this is-bottom)) + (format #t "~2Tinitial-scale: ~f~%" (-> this initial-scale)) + (format #t "~2Tfinal-scale: ~f~%" (-> this final-scale)) + (label cfg-4) + this + ) + +;; definition for function large-eco-creature-split +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior large-eco-creature-split prebot-large-eco-creature () + (sound-play "caveco-spawn" :position (-> self root trans)) + (let ((gp-1 (new 'stack-no-clear 'enemy-init-by-other-params))) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (-> self root transv) + (set! (-> v1-2 quad) (-> self root trans quad)) + (set! (-> gp-1 trans quad) (-> v1-2 quad)) + ) + (quaternion-copy! (-> gp-1 quat) (-> self root quat)) + (set! (-> gp-1 entity) (-> self entity)) + (set! (-> gp-1 directed?) #f) + (set! (-> gp-1 no-initial-move-to-ground?) #f) + (set! (-> gp-1 art-level) (the-as level (-> self level name))) + (let* ((s5-1 (get-process *default-dead-pool* (-> self split-type) #x4000 1)) + (v1-9 (when s5-1 + (let ((t9-4 (method-of-type process activate))) + (t9-4 s5-1 self "eco-creature" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 enemy-init-by-other self gp-1) + (-> s5-1 ppointer) + ) + ) + ) + (when v1-9 + (set-vector! + (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0 incoming attack-direction) + (-> self incoming attack-direction z) + (-> self incoming attack-direction y) + (- (-> self incoming attack-direction x)) + 1.0 + ) + (set! (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0 incoming knocked-type) + (knocked-type blue-shot) + ) + (if (logtest? (-> self flags) (eco-creature-flag ecf2)) + (set! (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) flags) + (logior (-> (the-as prebot-large-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) flags) + (eco-creature-flag ecf2) + ) + ) + (logclear! + (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) flags) + (eco-creature-flag ecf2) + ) + ) + (prebot-medium-eco-creature-method-196 + (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-9) 0)) + ) + ) + ) + (let* ((s5-2 (get-process *default-dead-pool* (-> self split-type) #x4000 1)) + (v1-13 (when s5-2 + (let ((t9-8 (method-of-type process activate))) + (t9-8 s5-2 self "eco-creature" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 enemy-init-by-other self gp-1) + (-> s5-2 ppointer) + ) + ) + ) + (when v1-13 + (set-vector! + (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0 incoming attack-direction) + (- (-> self incoming attack-direction z)) + (-> self incoming attack-direction y) + (-> self incoming attack-direction x) + 1.0 + ) + (set! (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0 incoming knocked-type) + (knocked-type blue-shot) + ) + (if (logtest? (-> self flags) (eco-creature-flag ecf2)) + (logior! + (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0)) flags) + (eco-creature-flag ecf2) + ) + (logclear! + (-> (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0)) flags) + (eco-creature-flag ecf2) + ) + ) + (prebot-medium-eco-creature-method-197 + (the-as prebot-medium-eco-creature (-> (the-as (pointer prebot-medium-eco-creature) v1-13) 0)) + ) + ) + ) + ) + (prebot-large-eco-creature-method-195 self) + 0 + (none) + ) + +;; definition for symbol *prebot-medium-eco-creature-nav-enemy-info*, type nav-enemy-info +(define *prebot-medium-eco-creature-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 15 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim 2 + :victory-anim 2 + :jump-wind-up-anim 2 + :jump-in-air-anim 2 + :jump-land-anim 2 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 49152.0 + :knocked-red-vy-lo 57344.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 32768.0 + :knocked-blue-vxz-hi 40960.0 + :knocked-blue-vy-lo 20480.0 + :knocked-blue-vy-hi 53248.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 1.0 :w 35404.914) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8223.438) + :geo-tform (new 'static 'vector :x 1.0 :w 27181.492) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14248.819) + :geo-tform (new 'static 'vector :x -1.0 :w 10623.986) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 12262.859) + :geo-tform (new 'static 'vector :x 1.0 :w 33438.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.137 :z -0.9905 :w 11373.791) + :geo-tform (new 'static 'vector :x 0.2271 :y 0.9734 :z 0.0279 :w 36639.176) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5102 :z -0.86 :w 20530.754) + :geo-tform (new 'static 'vector :x 0.409 :y -0.0529 :z 0.9109 :w 32271.676) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6644 :z -0.7473 :w 1968.9199) + :geo-tform (new 'static 'vector :x 0.4093 :y 0.033 :z 0.9117 :w 33077.91) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9613 :z -0.2752 :w 2214.5525) + :geo-tform (new 'static 'vector :x 0.4059 :y -0.0481 :z 0.9126 :w 34502.54) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5153 :z 0.8569 :w 2080.0034) + :geo-tform (new 'static 'vector :x 0.4027 :y -0.0356 :z 0.9146 :w 32440.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.4859 :z 0.8739 :w 3273.5598) + :geo-tform (new 'static 'vector :x 0.414 :y 0.0464 :z 0.909 :w 29818.152) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8326 :z -0.5538 :w 3106.5886) + :geo-tform (new 'static 'vector :x 0.419 :y -0.032 :z 0.9073 :w 32459.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.9421 :z -0.3352 :w 6646.0605) + :geo-tform (new 'static 'vector :x 0.3914 :y -0.2 :z 0.8982 :w 37623.16) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3413 :z -0.9399 :w 1832.5868) + :geo-tform (new 'static 'vector :x 0.4204 :y -0.1424 :z 0.896 :w 38915.023) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1371 :z 0.9905 :w 11369.786) + :geo-tform (new 'static 'vector :x -0.2272 :y 0.9734 :z 0.0279 :w 28896.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5101 :z 0.86 :w 20534.176) + :geo-tform (new 'static 'vector :x -0.026 :y 0.9979 :z 0.0579 :w 23979.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6645 :z 0.7472 :w 1958.0337) + :geo-tform (new 'static 'vector :x 0.016 :y 0.9992 :z -0.0358 :w 23969.791) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9615 :z 0.2744 :w 2230.645) + :geo-tform (new 'static 'vector :x 0.0911 :y 0.9943 :z 0.0536 :w 24079.475) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5098 :z -0.8602 :w 2098.3352) + :geo-tform (new 'static 'vector :x -0.0178 :y 0.999 :z 0.0406 :w 24125.459) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 19 + :pre-tform (new 'static 'vector :x 0.4819 :z -0.8762 :w 3256.2107) + :geo-tform (new 'static 'vector :x -0.1538 :y 0.9868 :z -0.0491 :w 23956.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8364 :z 0.548 :w 3087.583) + :geo-tform (new 'static 'vector :x -0.017 :y 0.9991 :z 0.0369 :w 23745.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.9425 :z 0.3339 :w 6655.1807) + :geo-tform (new 'static 'vector :x 0.2492 :y 0.945 :z 0.2115 :w 24615.268) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3403 :z 0.9402 :w 1852.0657) + :geo-tform (new 'static 'vector :x 0.3178 :y 0.9363 :z 0.1493 :w 24121.836) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 20948.764) + :geo-tform (new 'static 'vector :x -1.0 :w 9182.285) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0068 :w 7387.509) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.003 :z -0.0014 :w 16198.405) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9697 :z -0.244 :w 191.6382) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4854 :z -0.8742 :w 21186.406) + :geo-tform (new 'static 'vector :x 0.6599 :y 0.6796 :z 0.3201 :w 35879.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0363 :w 2717.3774) + :geo-tform (new 'static 'vector :x 0.6708 :y 0.7057 :z 0.2277 :w 34044.242) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3584 :z -0.9335 :w 11286.792) + :geo-tform (new 'static 'vector :x -0.4444 :y 0.7119 :z -0.5437 :w 28463.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1147 :z -0.9933 :w 2024.0066) + :geo-tform (new 'static 'vector :x -0.5154 :y 0.6809 :z -0.5201 :w 27281.908) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4859 :z 0.8739 :w 21191.012) + :geo-tform (new 'static 'vector :x 0.1968 :y 0.4177 :z -0.8869 :w 17933.508) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z -0.0361 :w 2729.0828) + :geo-tform (new 'static 'vector :x 0.0825 :y 0.3055 :z -0.9485 :w 17459.846) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3588 :z 0.9333 :w 11281.3125) + :geo-tform (new 'static 'vector :x 0.2273 :y 0.5912 :z 0.7738 :w 23386.34) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1145 :z 0.9934 :w 2026.6462) + :geo-tform (new 'static 'vector :x 0.2996 :y 0.5792 :z 0.758 :w 21904.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + ) + ) + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 15 + :turn-anim -1 + :run-anim 15 + :taunt-anim -1 + :run-travel-speed (meters 5) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 3) + :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! (-> *prebot-medium-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for function prebot-eco-creature-joint-callback +(defun prebot-eco-creature-joint-callback ((arg0 cspace) (arg1 transformq)) + (when (and (= (the-as float (-> arg0 param1)) 1.0) (= (-> arg0 param0) prebot-eco-creature-joint-callback)) + (let ((a2-1 arg0)) + (set! (-> a2-1 param0) cspace<-parented-transformq-joint!) + ) + ) + (set-vector! + (-> arg1 scale) + (the-as float (-> arg0 param1)) + (the-as float (-> arg0 param1)) + (the-as float (-> arg0 param1)) + 1.0 + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; definition for method 196 of type prebot-medium-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod prebot-medium-eco-creature-method-196 ((this prebot-medium-eco-creature)) + (set! (-> this is-top) (the-as basic #t)) + (let ((v1-2 (-> this node-list data 32))) + (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-2 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-4 (-> this node-list data 33))) + (set! (-> v1-4 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-4 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-6 (-> this node-list data 36))) + (set! (-> v1-6 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-6 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-8 (-> this node-list data 37))) + (set! (-> v1-8 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-8 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-10 (-> this node-list data 34))) + (set! (-> v1-10 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-10 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-12 (-> this node-list data 35))) + (set! (-> v1-12 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-12 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-14 (-> this node-list data 38))) + (set! (-> v1-14 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-14 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-16 (-> this node-list data 39))) + (set! (-> v1-16 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-16 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-18 (-> this node-list data 27))) + (set! (-> v1-18 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-18 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-20 (-> this node-list data 28))) + (set! (-> v1-20 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-20 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-22 (-> this node-list data 29))) + (set! (-> v1-22 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-22 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-24 (-> this node-list data 30))) + (set! (-> v1-24 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-24 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-26 (-> this node-list data 31))) + (set! (-> v1-26 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-26 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-28 (-> this node-list data 26))) + (set! (-> v1-28 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-28 param1) (the-as basic #x3e99999a)) + ) + 0 + (none) + ) + +;; definition for method 197 of type prebot-medium-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod prebot-medium-eco-creature-method-197 ((this prebot-medium-eco-creature)) + (set! (-> this is-bottom) (the-as basic #t)) + (let ((v1-2 (-> this node-list data 4))) + (set! (-> v1-2 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-2 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-4 (-> this node-list data 5))) + (set! (-> v1-4 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-4 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-6 (-> this node-list data 6))) + (set! (-> v1-6 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-6 param1) (the-as basic #x3d23d70a)) + ) + (let ((v1-8 (-> this node-list data 7))) + (set! (-> v1-8 param0) prebot-eco-creature-joint-callback) + (set! (-> v1-8 param1) (the-as basic #x3d23d70a)) + ) + 0 + (none) + ) + +;; definition for method 122 of type prebot-medium-eco-creature +(defmethod go-idle2 ((this prebot-medium-eco-creature)) + (set-vector! (-> this root scale) (-> this initial-scale) (-> this initial-scale) (-> this initial-scale) 1.0) + (go (method-of-object this knocked)) + ) + +;; definition for method 120 of type prebot-medium-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this prebot-medium-eco-creature)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 12) 0))) + (set! (-> s5-0 total-prims) (the-as uint 13)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 26) + (set-vector! (-> s4-0 local-sphere) 532.48 -1556.48 1310.72 9011.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set-vector! (-> v1-14 local-sphere) 0.0 2867.2 0.0 4096.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) 0.0 -1228.8 204.8 2048.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly)) + (set! (-> v1-20 transform-index) 6) + (set-vector! (-> v1-20 local-sphere) 0.0 163.84 696.32 1474.56) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly)) + (set! (-> v1-22 transform-index) 28) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 1269.76) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly)) + (set! (-> v1-24 transform-index) 29) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 1146.88) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly)) + (set! (-> v1-26 transform-index) 30) + (set-vector! (-> v1-26 local-sphere) 40.96 0.0 -204.8 942.08) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly)) + (set! (-> v1-28 transform-index) 31) + (set-vector! (-> v1-28 local-sphere) 81.92 0.0 -286.72 860.16) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid deadly)) + (set! (-> v1-30 transform-index) 33) + (set-vector! (-> v1-30 local-sphere) -819.2 -368.64 -327.68 1597.44) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid deadly)) + (set! (-> v1-32 transform-index) 35) + (set-vector! (-> v1-32 local-sphere) 532.48 245.76 245.76 1761.28) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid deadly)) + (set! (-> v1-34 transform-index) 37) + (set-vector! (-> v1-34 local-sphere) 368.64 286.72 163.84 1720.32) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid deadly)) + (set! (-> v1-36 transform-index) 39) + (set-vector! (-> v1-36 local-sphere) -286.72 -245.76 -327.68 1638.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-38 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type prebot-medium-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this prebot-medium-eco-creature)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *prebot-medium-eco-creature-nav-enemy-info*) + (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) + (let ((v1-8 (-> this neck))) + (set! (-> v1-8 up) (the-as uint 1)) + (set! (-> v1-8 nose) (the-as uint 2)) + (set! (-> v1-8 ear) (the-as uint 0)) + (set-vector! (-> v1-8 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-8 ignore-angle) 15473.777) + ) + (let ((v1-10 (-> this nav))) + (set! (-> v1-10 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (set! (-> this attack-anims) (new 'static 'boxed-array :type int32 14)) + (set! (-> this victory-anims) (new 'static 'boxed-array :type int32 10 11)) + (set! (-> this turn-left-anim) 6) + (set! (-> this turn-right-anim) 7) + (setup-masks (-> this draw) 0 2) + (set! (-> this is-top) #f) + (set! (-> this is-bottom) #f) + (set! (-> this initial-scale) 1.0) + (set! (-> this final-scale) 0.6) + (set! (-> this split-type) prebot-small-eco-creature) + (set! (-> this attack-stop-frame) 7.0) + (when (type? this medium-eco-creature-launched) + (set! (-> this spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this trail-part) (create-launch-control (-> *part-group-id-table* 440) this)) + (logclear! (-> this flags) (eco-creature-flag ecf3)) + ) + (set! (-> this flags) (eco-creature-flag)) + (send-event (ppointer->process (-> this parent)) 'start-critter) + 0 + (none) + ) + +;; definition for function adjust-split-joints +;; WARN: Return type mismatch float vs none. +(defbehavior adjust-split-joints prebot-medium-eco-creature () + (cond + ((-> self is-top) + (let ((f0-2 (lerp-scale (-> self initial-scale) (-> self final-scale) (ja-aframe-num 0) 3.0 8.0))) + (set-vector! (-> self root scale) f0-2 f0-2 f0-2 1.0) + ) + (let ((f0-4 (lerp-scale 0.04 1.0 (ja-aframe-num 0) 2.0 7.0))) + (set! (-> self node-list data 32 param1) (the-as basic f0-4)) + (set! (-> self node-list data 33 param1) (the-as basic f0-4)) + (set! (-> self node-list data 36 param1) (the-as basic f0-4)) + (set! (-> self node-list data 37 param1) (the-as basic f0-4)) + (set! (-> self node-list data 34 param1) (the-as basic f0-4)) + (set! (-> self node-list data 35 param1) (the-as basic f0-4)) + (set! (-> self node-list data 38 param1) (the-as basic f0-4)) + (set! (-> self node-list data 39 param1) (the-as basic f0-4)) + (set! (-> self node-list data 27 param1) (the-as basic f0-4)) + (set! (-> self node-list data 28 param1) (the-as basic f0-4)) + (set! (-> self node-list data 29 param1) (the-as basic f0-4)) + (set! (-> self node-list data 30 param1) (the-as basic f0-4)) + (set! (-> self node-list data 31 param1) (the-as basic f0-4)) + (set! (-> self node-list data 26 param1) (the-as basic f0-4)) + ) + ) + (else + (let ((f0-7 (lerp-scale (-> self initial-scale) (-> self final-scale) (ja-aframe-num 0) 4.0 8.0))) + (set-vector! (-> self root scale) f0-7 f0-7 f0-7 1.0) + ) + (let ((f0-9 (lerp-scale 0.04 1.0 (ja-aframe-num 0) 3.0 7.0))) + (set! (-> self node-list data 4 param1) (the-as basic f0-9)) + (set! (-> self node-list data 5 param1) (the-as basic f0-9)) + (set! (-> self node-list data 6 param1) (the-as basic f0-9)) + (set! (-> self node-list data 7 param1) (the-as basic f0-9)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (prebot-medium-eco-creature) + :virtual #t + :code (behavior () + (cond + ((or (-> self is-top) (-> self is-bottom)) + (let ((gp-0 (if (-> self is-top) + (-> self draw art-group data 4) + (-> self draw art-group data 5) + ) + ) + ) + (cond + ((handle->process (-> self ragdoll-proc)) + (ja-channel-push! 1 0) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + (adjust-split-joints) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (adjust-split-joints) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (set! (-> self is-top) #f) + (set! (-> self is-bottom) #f) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + (else + (let ((t9-14 (-> (method-of-type prebot-large-eco-creature knocked-recover) code))) + (if t9-14 + ((the-as (function none) t9-14)) + ) + ) + ) + ) + ) + ) + +;; definition of type prebot-small-eco-creature +(deftype prebot-small-eco-creature (prebot-medium-eco-creature) + () + ) + +;; definition for method 3 of type prebot-small-eco-creature +(defmethod inspect ((this prebot-small-eco-creature)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type prebot-medium-eco-creature inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *prebot-small-eco-creature-nav-enemy-info*, type nav-enemy-info +(define *prebot-small-eco-creature-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 2 + :hostile-anim 19 + :hit-anim 2 + :knocked-anim 2 + :knocked-land-anim 2 + :die-anim 2 + :die-falling-anim 2 + :victory-anim 2 + :jump-wind-up-anim 2 + :jump-in-air-anim 2 + :jump-land-anim 2 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-die (static-sound-name "caveco-death") + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 32768.0 + :knocked-red-vxz-hi 57344.0 + :knocked-red-vy-lo 65536.0 + :knocked-red-vy-hi 77824.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 61440.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 1.0 :w 35404.914) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8223.438) + :geo-tform (new 'static 'vector :x 1.0 :w 27181.492) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 14248.819) + :geo-tform (new 'static 'vector :x -1.0 :w 10623.986) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 12262.859) + :geo-tform (new 'static 'vector :x 1.0 :w 33438.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.137 :z -0.9905 :w 11373.791) + :geo-tform (new 'static 'vector :x 0.2271 :y 0.9734 :z 0.0279 :w 36639.176) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5102 :z -0.86 :w 20530.754) + :geo-tform (new 'static 'vector :x 0.409 :y -0.0529 :z 0.9109 :w 32271.676) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6644 :z -0.7473 :w 1968.9199) + :geo-tform (new 'static 'vector :x 0.4093 :y 0.033 :z 0.9117 :w 33077.91) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9613 :z -0.2752 :w 2214.5525) + :geo-tform (new 'static 'vector :x 0.4059 :y -0.0481 :z 0.9126 :w 34502.54) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5153 :z 0.8569 :w 2080.0034) + :geo-tform (new 'static 'vector :x 0.4027 :y -0.0356 :z 0.9146 :w 32440.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.4859 :z 0.8739 :w 3273.5598) + :geo-tform (new 'static 'vector :x 0.414 :y 0.0464 :z 0.909 :w 29818.152) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8326 :z -0.5538 :w 3106.5886) + :geo-tform (new 'static 'vector :x 0.419 :y -0.032 :z 0.9073 :w 32459.652) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.9421 :z -0.3352 :w 6646.0605) + :geo-tform (new 'static 'vector :x 0.3914 :y -0.2 :z 0.8982 :w 37623.16) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3413 :z -0.9399 :w 1832.5868) + :geo-tform (new 'static 'vector :x 0.4204 :y -0.1424 :z 0.896 :w 38915.023) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.1371 :z 0.9905 :w 11369.786) + :geo-tform (new 'static 'vector :x -0.2272 :y 0.9734 :z 0.0279 :w 28896.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5101 :z 0.86 :w 20534.176) + :geo-tform (new 'static 'vector :x -0.026 :y 0.9979 :z 0.0579 :w 23979.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6645 :z 0.7472 :w 1958.0337) + :geo-tform (new 'static 'vector :x 0.016 :y 0.9992 :z -0.0358 :w 23969.791) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9615 :z 0.2744 :w 2230.645) + :geo-tform (new 'static 'vector :x 0.0911 :y 0.9943 :z 0.0536 :w 24079.475) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5098 :z -0.8602 :w 2098.3352) + :geo-tform (new 'static 'vector :x -0.0178 :y 0.999 :z 0.0406 :w 24125.459) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 19 + :pre-tform (new 'static 'vector :x 0.4819 :z -0.8762 :w 3256.2107) + :geo-tform (new 'static 'vector :x -0.1538 :y 0.9868 :z -0.0491 :w 23956.574) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8364 :z 0.548 :w 3087.583) + :geo-tform (new 'static 'vector :x -0.017 :y 0.9991 :z 0.0369 :w 23745.531) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.9425 :z 0.3339 :w 6655.1807) + :geo-tform (new 'static 'vector :x 0.2492 :y 0.945 :z 0.2115 :w 24615.268) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3403 :z 0.9402 :w 1852.0657) + :geo-tform (new 'static 'vector :x 0.3178 :y 0.9363 :z 0.1493 :w 24121.836) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 20948.764) + :geo-tform (new 'static 'vector :x -1.0 :w 9182.285) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0068 :w 7387.509) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.003 :z -0.0014 :w 16198.405) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9697 :z -0.244 :w 191.6382) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :y -1.0 :w 10.176285) + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9999 :y -0.0008 :z 0.0008 :w 16384.0) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4854 :z -0.8742 :w 21186.406) + :geo-tform (new 'static 'vector :x 0.6599 :y 0.6796 :z 0.3201 :w 35879.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0363 :w 2717.3774) + :geo-tform (new 'static 'vector :x 0.6708 :y 0.7057 :z 0.2277 :w 34044.242) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3584 :z -0.9335 :w 11286.792) + :geo-tform (new 'static 'vector :x -0.4444 :y 0.7119 :z -0.5437 :w 28463.65) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1147 :z -0.9933 :w 2024.0066) + :geo-tform (new 'static 'vector :x -0.5154 :y 0.6809 :z -0.5201 :w 27281.908) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 26 + :pre-tform (new 'static 'vector :x -0.4859 :z 0.8739 :w 21191.012) + :geo-tform (new 'static 'vector :x 0.1968 :y 0.4177 :z -0.8869 :w 17933.508) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z -0.0361 :w 2729.0828) + :geo-tform (new 'static 'vector :x 0.0825 :y 0.3055 :z -0.9485 :w 17459.846) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 26 + :pre-tform (new 'static 'vector :x 0.3588 :z 0.9333 :w 11281.3125) + :geo-tform (new 'static 'vector :x 0.2273 :y 0.5912 :z 0.7738 :w 23386.34) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1145 :z 0.9934 :w 2026.6462) + :geo-tform (new 'static 'vector :x 0.2996 :y 0.5792 :z 0.758 :w 21904.426) + :axial-slop 1780.067 + :max-angle 4683.2207 + :coll-rad 1734.656 + ) + ) + ) + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 19 + :turn-anim -1 + :run-anim 19 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 6) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *prebot-small-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 120 of type prebot-small-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this prebot-small-eco-creature)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 12) 0))) + (set! (-> s5-0 total-prims) (the-as uint 13)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 26) + (set-vector! (-> s4-0 local-sphere) 532.48 -1556.48 1310.72 9011.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set-vector! (-> v1-14 local-sphere) 0.0 2867.2 0.0 4096.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly)) + (set! (-> v1-18 transform-index) 4) + (set-vector! (-> v1-18 local-sphere) 0.0 -1228.8 204.8 2048.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly)) + (set! (-> v1-20 transform-index) 6) + (set-vector! (-> v1-20 local-sphere) 0.0 163.84 696.32 1474.56) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly)) + (set! (-> v1-22 transform-index) 28) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 1269.76) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly)) + (set! (-> v1-24 transform-index) 29) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 1146.88) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly)) + (set! (-> v1-26 transform-index) 30) + (set-vector! (-> v1-26 local-sphere) 40.96 0.0 -204.8 942.08) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly)) + (set! (-> v1-28 transform-index) 31) + (set-vector! (-> v1-28 local-sphere) 81.92 0.0 -286.72 860.16) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-30 prim-core action) (collide-action solid deadly)) + (set! (-> v1-30 transform-index) 33) + (set-vector! (-> v1-30 local-sphere) -819.2 -368.64 -327.68 1597.44) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-32 prim-core action) (collide-action solid deadly)) + (set! (-> v1-32 transform-index) 35) + (set-vector! (-> v1-32 local-sphere) 532.48 245.76 245.76 1761.28) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-34 prim-core action) (collide-action solid deadly)) + (set! (-> v1-34 transform-index) 37) + (set-vector! (-> v1-34 local-sphere) 368.64 286.72 163.84 1720.32) + ) + (let ((v1-36 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-36 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-36 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-36 prim-core action) (collide-action solid deadly)) + (set! (-> v1-36 transform-index) 39) + (set-vector! (-> v1-36 local-sphere) -286.72 -245.76 -327.68 1638.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-38 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type prebot-small-eco-creature +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this prebot-small-eco-creature)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *prebot-small-eco-creature-nav-enemy-info*) + (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) + (let ((v1-8 (-> this neck))) + (set! (-> v1-8 up) (the-as uint 1)) + (set! (-> v1-8 nose) (the-as uint 2)) + (set! (-> v1-8 ear) (the-as uint 0)) + (set-vector! (-> v1-8 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-8 ignore-angle) 15473.777) + ) + (let ((v1-10 (-> this nav))) + (set! (-> v1-10 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (set! (-> this attack-anims) (new 'static 'boxed-array :type int32 18)) + (set! (-> this victory-anims) (new 'static 'boxed-array :type int32 10 11)) + (set! (-> this turn-left-anim) 16) + (set! (-> this turn-right-anim) 17) + (setup-masks (-> this draw) 0 2) + (set! (-> this is-top) #f) + (set! (-> this is-bottom) #f) + (set! (-> this initial-scale) 0.6) + (set! (-> this final-scale) 0.4) + (set! (-> this split-type) #f) + (set! (-> this attack-stop-frame) 10.0) + (when (type? this small-eco-creature-launched) + (set! (-> this spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this trail-part) (create-launch-control (-> *part-group-id-table* 440) this)) + (logclear! (-> this flags) (eco-creature-flag ecf3)) + ) + (set! (-> this flags) (eco-creature-flag)) + (send-event (ppointer->process (-> this parent)) 'start-critter) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + ) + (transform-post) + 0 + (none) + ) + +;; definition of type medium-eco-creature-launched +(deftype medium-eco-creature-launched (prebot-medium-eco-creature) + () + ) + +;; definition for method 3 of type medium-eco-creature-launched +(defmethod inspect ((this medium-eco-creature-launched)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type prebot-medium-eco-creature inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 121 of type medium-eco-creature-launched +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! ((this medium-eco-creature-launched)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (none) + ) + +;; definition for method 122 of type medium-eco-creature-launched +(defmethod go-idle2 ((this medium-eco-creature-launched)) + ((method-of-type prebot-large-eco-creature go-idle2) this) + ) + +;; definition of type small-eco-creature-launched +(deftype small-eco-creature-launched (prebot-small-eco-creature) + () + ) + +;; definition for method 3 of type small-eco-creature-launched +(defmethod inspect ((this small-eco-creature-launched)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type prebot-small-eco-creature inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 121 of type small-eco-creature-launched +;; WARN: Return type mismatch vector vs none. +(defmethod init-enemy! ((this small-eco-creature-launched)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (none) + ) + +;; definition for method 122 of type small-eco-creature-launched +(defmethod go-idle2 ((this small-eco-creature-launched)) + ((method-of-type prebot-large-eco-creature go-idle2) this) + ) + +;; definition of type large-eco-creature +(deftype large-eco-creature (prebot-large-eco-creature) + () + ) + +;; definition for method 3 of type large-eco-creature +(defmethod inspect ((this large-eco-creature)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type prebot-large-eco-creature inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 122 of type large-eco-creature +(defmethod go-idle2 ((this large-eco-creature)) + ((method-of-type nav-enemy go-idle2) this) + ) + +;; definition for method 121 of type large-eco-creature +;; WARN: Return type mismatch eco-creature-flag vs none. +(defmethod init-enemy! ((this large-eco-creature)) + (call-parent-method this) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (none) + ) + +;; definition of type medium-eco-creature +(deftype medium-eco-creature (prebot-medium-eco-creature) + () + ) + +;; definition for method 3 of type medium-eco-creature +(defmethod inspect ((this medium-eco-creature)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type prebot-medium-eco-creature inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 122 of type medium-eco-creature +(defmethod go-idle2 ((this medium-eco-creature)) + ((method-of-type nav-enemy go-idle2) this) + ) + +;; definition for method 121 of type medium-eco-creature +;; WARN: Return type mismatch eco-creature-flag vs none. +(defmethod init-enemy! ((this medium-eco-creature)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (none) + ) + +;; definition of type small-eco-creature +(deftype small-eco-creature (prebot-small-eco-creature) + () + ) + +;; definition for method 3 of type small-eco-creature +(defmethod inspect ((this small-eco-creature)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type prebot-small-eco-creature inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 122 of type small-eco-creature +(defmethod go-idle2 ((this small-eco-creature)) + ((method-of-type nav-enemy go-idle2) this) + ) + +;; definition for method 121 of type small-eco-creature +;; WARN: Return type mismatch eco-creature-flag vs none. +(defmethod init-enemy! ((this small-eco-creature)) + (call-parent-method this) + (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) + (logior! (-> this flags) (eco-creature-flag ecf2)) + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc new file mode 100644 index 0000000000..bea164c071 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc @@ -0,0 +1,1837 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-roboguard-armor-explode + :id 223 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 810) (sp-item 812) (sp-item 814)) + ) + +;; definition of type roboguard +(deftype roboguard (nav-enemy) + ((los los-control :inline) + (rotation-matrix matrix :inline) + (upper-rotation-matrix matrix :inline) + (fire-at-pos vector :inline) + (formation-position vector :inline) + (focus-formation-source vector :inline) + (me-to-focus-dir vector :inline) + (me-to-focus-angle float) + (flags roboguard-flag) + (torso-aim-blend float) + (torso-angle float) + (torso-seek-speed float) + (torso-to-focus-angle float) + (last-torso-frame-num float) + (stand-angle-threshold float) + (arm-rot-mult float 2) + (arm-rot degrees 2) + (fire-time time-frame) + (fire-count uint32) + (last-attack-time time-frame) + (update-focus-pos symbol) + (formation-angle-sign float) + (last-hit-points int32) + ) + (:state-methods + hostile-stand + close-attack + shoot-attack + explode + ) + (:methods + (roboguard-method-194 (_type_ vector float) symbol) + (roboguard-method-195 (_type_) none) + (roboguard-method-196 (_type_ int) none) + ) + ) + +;; definition for method 3 of type roboguard +(defmethod inspect ((this roboguard)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Trotation-matrix: #~%" (-> this rotation-matrix)) + (format #t "~2Tupper-rotation-matrix: #~%" (-> this upper-rotation-matrix)) + (format #t "~2Tfire-at-pos: #~%" (-> this fire-at-pos)) + (format #t "~2Tformation-position: #~%" (-> this formation-position)) + (format #t "~2Tfocus-formation-source: #~%" (-> this focus-formation-source)) + (format #t "~2Tme-to-focus-dir: #~%" (-> this me-to-focus-dir)) + (format #t "~2Tme-to-focus-angle: ~f~%" (-> this me-to-focus-angle)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Ttorso-aim-blend: ~f~%" (-> this torso-aim-blend)) + (format #t "~2Ttorso-angle: ~f~%" (-> this torso-angle)) + (format #t "~2Ttorso-seek-speed: ~f~%" (-> this torso-seek-speed)) + (format #t "~2Ttorso-to-focus-angle: ~f~%" (-> this torso-to-focus-angle)) + (format #t "~2Tlast-torso-frame-num: ~f~%" (-> this last-torso-frame-num)) + (format #t "~2Tstand-angle-threshold: ~f~%" (-> this stand-angle-threshold)) + (format #t "~2Tarm-rot-mult[2] @ #x~X~%" (-> this arm-rot-mult)) + (format #t "~2Tarm-rot[2] @ #x~X~%" (-> this arm-rot)) + (format #t "~2Tfire-time: ~D~%" (-> this fire-time)) + (format #t "~2Tfire-count: ~D~%" (-> this fire-count)) + (format #t "~2Tlast-attack-time: ~D~%" (-> this last-attack-time)) + (format #t "~2Tupdate-focus-pos: ~A~%" (-> this update-focus-pos)) + (format #t "~2Tformation-angle-sign: ~f~%" (-> this formation-angle-sign)) + (format #t "~2Tlast-hit-points: ~D~%" (-> this last-hit-points)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-roboguard roboguard roboguard-lod0-jg roboguard-idle0-ja + ((roboguard-lod0-mg (meters 20)) (roboguard-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow roboguard-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-roboguard-explode roboguard roboguard-explode-lod0-jg roboguard-explode-idle-ja + ((roboguard-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *roboguard-exploder-params*, type joint-exploder-static-params +(define *roboguard-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 15) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 11) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 9) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 13) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 24) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 27) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 18) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 21) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 12) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 8) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 6) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 17) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 4) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition for symbol *roboguard-explode-joints*, type (array int32) +(define *roboguard-explode-joints* (new 'static 'boxed-array :type int32 0 10 19 9 14 22 13 6)) + +;; definition for symbol *roboguard-debris-array-params*, type (array debris-static-params) +(define *roboguard-debris-array-params* + (new 'static 'boxed-array :type debris-static-params + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index -1 :group "skel-kg-debris-b") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + :art-level 'sewg + ) + ) + ) + +;; failed to figure out what this is: +(dotimes (v1-27 (-> *roboguard-debris-array-params* length)) + (set! (-> *roboguard-debris-array-params* v1-27 joints 0 parent-joint-index) + (-> *roboguard-explode-joints* (+ v1-27 1)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 17) (new 'static 'lightning-spec + :name "lightning-shock-roboguard" + :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 + :fade-time 15.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 819.2 + :duration 90.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 18) (new 'static 'lightning-spec + :name "lightning-awe-roboguard" + :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 + :fade-time 15.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 90.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +;; definition for symbol *fact-info-roboguard-defaults*, type fact-info-enemy-defaults +(define *fact-info-roboguard-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 48 :pickup-amount 10.0) + ) + +;; definition for symbol *roboguard-nav-enemy-info*, type nav-enemy-info +(define *roboguard-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script #f + :idle-anim 5 + :notice-anim -1 + :hostile-anim 14 + :hit-anim 5 + :knocked-anim 27 + :knocked-land-anim 28 + :die-anim 18 + :die-falling-anim 29 + :victory-anim 5 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint -1 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 50) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 32768.0 + :knocked-soft-vxz-hi 61440.0 + :knocked-soft-vy-lo 49152.0 + :knocked-soft-vy-hi 65536.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 73728.0 + :knocked-hard-vxz-hi 114688.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 73728.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 20480.0 + :knocked-yellow-vxz-hi 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 4096.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 114688.0 + :knocked-red-vy-lo 53248.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 13 + :turn-anim 4 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 16) + :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! (-> *roboguard-nav-enemy-info* fact-defaults) *fact-info-roboguard-defaults*) + +;; failed to figure out what this is: +(defpart 913 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 40)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 914 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 915 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; definition for method 120 of type roboguard +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this roboguard)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy camera-blocker los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 12288.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 enemy)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 12697.6 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core action) (collide-action)) + (set! (-> v1-16 transform-index) 11) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set-vector! (-> v1-18 local-sphere) 0.0 8192.0 0.0 11468.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function roboguard-turn-torso-post +;; INFO: Used lq/sq +(defbehavior roboguard-turn-torso-post roboguard () + (seek! (-> self torso-aim-blend) 1.0 (* 5.0 (seconds-per-frame))) + (let ((v1-3 (joint-node roboguard-lod0-jg chest)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) + (set! (-> gp-0 y) 0.0) + (set! (-> s5-1 y) 0.0) + (vector-xz-normalize! gp-0 1.0) + (vector-xz-normalize! s5-1 1.0) + (set! (-> self torso-to-focus-angle) (acos (vector-dot gp-0 s5-1))) + ) + ) + (if (>= 2730.6667 (-> self torso-to-focus-angle)) + (seek! (-> self torso-seek-speed) 0.0 (* 54613.332 (seconds-per-frame))) + (seek! (-> self torso-seek-speed) 43690.668 (* 72817.78 (seconds-per-frame))) + ) + (nav-enemy-simple-post) + (none) + ) + +;; definition for function roboguard-turret-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior roboguard-turret-code roboguard () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! roboguard-idle-shoot0-loop-ja :num! zero) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.2)) + (suspend) + ) + ) + (let ((gp-1 + (lambda ((arg0 roboguard) (arg1 symbol)) + (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 + 1.0 + -1.0 + ) + ) + ) + ) + ) + (f30-0 (-> self stand-angle-threshold)) + ) + (until #f + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-20 (if (< 0.0 (-> self me-to-focus-angle)) + 7 + 9 + ) + ) + (s5-1 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-20) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-1) + (suspend) + (ja :num! (seek!)) + ) + ) + (when (< (fabs (-> self me-to-focus-angle)) f30-0) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 0.5)) + (suspend) + ) + ) + (while (< (fabs (-> self me-to-focus-angle)) f30-0) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-40 (if (< 0.0 (-> self me-to-focus-angle)) + 8 + 10 + ) + ) + (s5-3 (< 0.0 (-> self me-to-focus-angle))) + ) + (ja-no-eval :group! (-> self draw art-group data v1-40) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (gp-1 self s5-3) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + (none) + ) + +;; failed to figure out what this is: +(defstate idle (roboguard) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)) :frame-num 2.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)) :frame-num 3.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)) :frame-num 4.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)) :frame-num 5.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15))) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 7.0 0.07) :frame-num 6.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 7.0 0.07)) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 8.0 0.07) :frame-num 7.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 8.0 0.07)) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 9.0 0.07) :frame-num 8.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 9.0 0.07)) + ) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)) :frame-num 9.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05))) + ) + ) + #f + ) + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set-time! (-> self last-draw-time)) + ) + (update-focus self) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate notice (roboguard) + :virtual #t + :exit (behavior () + (set! (-> self formation-position quad) (-> self root trans quad)) + (let ((t9-0 (-> (method-of-type nav-enemy notice) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (ja-no-eval :group! roboguard-notice-jump-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (vector-! gp-0 (target-pos 0) (-> self root trans)) + (seek-toward-heading-vec! (-> self root) gp-0 131072.0 (seconds 0.05)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (ja-no-eval :group! roboguard-notice-land-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate stare (roboguard) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self stand-angle-threshold) 9102.223) + ) + :code roboguard-turret-code + :post roboguard-turn-torso-post + ) + +;; failed to figure out what this is: +(defstate hostile (roboguard) + :virtual #t + :exit (behavior () + (let ((v1-0 (-> self nav))) + (logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere)) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (cond + ((< (vector-vector-xz-distance (-> self root trans) (-> self formation-position)) 8192.0) + (go-virtual hostile-stand) + ) + ((and (< (fabs (-> self torso-to-focus-angle)) 3640.889) + (and (get-focus! self) (>= 24576.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)))) + ) + (go-virtual close-attack) + ) + ) + ) + ) + :post (behavior () + (seek! (-> self torso-aim-blend) 0.0 (seconds-per-frame)) + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (roboguard-method-195 self) + (let ((a0-4 (-> self nav state)) + (v1-8 (-> self formation-position)) + ) + (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-4 target-pos quad) (-> v1-8 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate hostile-stand (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self stand-angle-threshold) 9102.223) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + ) + :exit (behavior () + (nav-enemy-method-179 self) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (ja-done? 0)) + (if (or (and (< 65536.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (< 2048.0 (vector-vector-xz-distance (-> self root trans) (-> self formation-position))) + ) + (< 14336.0 (vector-vector-xz-distance (-> self root trans) (-> self formation-position))) + ) + (go-virtual hostile) + ) + (when (and (time-elapsed? (-> self state-time) (seconds 0.3)) + (and (< (fabs (-> self torso-to-focus-angle)) 3640.889) (get-focus! self)) + ) + (cond + ((>= 24576.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos))) + (go-virtual close-attack) + ) + ((should-check-los? (-> self los) (seconds 0.4)) + (go-virtual shoot-attack) + ) + ) + ) + ) + ) + :code roboguard-turret-code + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (roboguard-method-195 self) + (roboguard-turn-torso-post) + ) + ) + +;; failed to figure out what this is: +(defstate close-attack (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-time! (-> self fire-time)) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + ) + :exit (behavior () + (nav-enemy-method-179 self) + ) + :code (behavior () + (let ((f30-0 + (lerp-scale 0.0 1.0 (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 12288.0 20480.0) + ) + ) + (ja-channel-push! 2 (seconds 0.3)) + (ja-no-eval :group! roboguard-punch-close-rotate-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-punch-far-rotate-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (seek-to-point-toward-point! + (-> self root) + (-> self focus-pos) + (* 1.2 (-> self nav max-rotation-rate)) + (seconds 0.02) + ) + (seek! (-> self torso-aim-blend) 0.0 (* 3.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + (let ((f28-0 8192.0)) + (let* ((a0-10 (-> self root root-prim)) + (v1-53 (-> (the-as collide-shape-prim-group a0-10) child 2)) + ) + (+! (-> a0-10 local-sphere w) f28-0) + (set! (-> v1-53 prim-core action) (collide-action solid deadly)) + (set! (-> v1-53 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-53 prim-core collide-with) (collide-spec jak bot obstacle player-list)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! roboguard-punch-close-go-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-punch-far-go-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek! max 1.2)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! roboguard-punch-close-hold-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :chan 1 :group! roboguard-punch-far-hold-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + (suspend) + (ja :num! (seek! max 4.0)) + ) + (let* ((v1-147 (-> self root root-prim)) + (a0-26 (-> (the-as collide-shape-prim-group v1-147) child 2)) + ) + (set! (-> v1-147 local-sphere w) (- (-> v1-147 local-sphere w) f28-0)) + (set! (-> a0-26 prim-core action) (collide-action)) + (set! (-> a0-26 prim-core collide-as) (collide-spec)) + (set! (-> a0-26 prim-core collide-with) (collide-spec)) + ) + ) + ) + 0 + (go-virtual hostile-stand) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate shoot-attack (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self fire-time) (+ (current-time) (seconds -0.4))) + (set! (-> self fire-count) (the-as uint 0)) + (set! (-> self last-torso-frame-num) 0.0) + (set! (-> self stand-angle-threshold) 16384.0) + (set! (-> self update-focus-pos) #f) + (nav-enemy-method-180 self 8192.0 (the-as float #f)) + ) + :exit (behavior () + (when (> (-> self skel float-channels) 0) + (let ((a0-1 (joint-control-method-12 (-> self skel) 0))) + (joint-channel-float-delete! a0-1) + ) + ) + (set! (-> self update-focus-pos) #t) + (nav-enemy-method-179 self) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) (zero? (-> self skel float-channels))) + (if (or (= (-> self fire-count) 8) (los-control-method-11 (-> self los) (seconds 0.1))) + (go-virtual hostile-stand) + ) + (let ((f0-0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)))) + (if (>= 24576.0 f0-0) + (go-virtual close-attack) + ) + ) + (let ((v1-22 (ja-channel-float! (the-as art-joint-anim roboguard-idle-shoot0-loop-ja) 0.0 1.0 0.0))) + (when v1-22 + (set! (-> self skel interp-select 0) #x1bbf8) + (set! (-> self skel interp-select 1) 0) + (set! (-> v1-22 param 0) 1.0) + (set! (-> v1-22 param 1) 1.0) + (set! (-> v1-22 param 2) 2.0) + (set! (-> v1-22 num-func) num-func-interp1-play!) + ) + ) + (set-time! (-> self fire-time)) + ) + (let ((gp-0 (joint-control-method-12 (-> self skel) 0))) + (when gp-0 + (let ((f1-1 (-> gp-0 frame-num)) + (f0-4 (-> self last-torso-frame-num)) + ) + (cond + ((and (< 0.5 f1-1) (>= 0.5 f0-4)) + (roboguard-method-196 self 11) + ) + ((and (< 3.0 f1-1) (>= 3.0 f0-4)) + (roboguard-method-196 self 15) + ) + ) + ) + (set! (-> self last-torso-frame-num) (-> gp-0 frame-num)) + ) + ) + ) + :code roboguard-turret-code + :post (behavior () + (seek! (-> self arm-rot-mult 0) 1.0 (* 30.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 1.0 (* 30.0 (seconds-per-frame))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self focus-pos)))) + (let ((s5-0 vector-normalize!) + (s4-0 gp-1) + (f0-8 -8192.0) + (v1-7 gp-1) + ) + (s5-0 s4-0 (fmin + (+ f0-8 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z))))) + (lerp-scale 0.0 32768.0 (the float (- (current-time) (-> self state-time))) 600.0 60.0) + ) + ) + ) + (vector+! (-> self fire-at-pos) (-> self focus-pos) gp-1) + ) + 0 + (let ((gp-2 + (lambda :behavior roboguard + ((arg0 int) (arg1 int) (arg2 float)) + (let* ((s5-0 (-> self node-list data arg0)) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) + ) + (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 bone transform uvec) -1.0) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (vector-! (-> s5-1 rvec) (-> self fire-at-pos) v1-2) + (set! (-> s5-1 uvec quad) (-> s5-1 rvec quad)) + (set! (-> s5-1 uvec y) 0.0) + (vector-normalize! (-> s5-1 uvec) 1.0) + (vector-normalize-copy! (-> s5-1 fvec) (-> s5-1 rvec) 1.0) + (vector-flatten! (-> s5-1 fvec) (-> s5-1 fvec) (the-as vector (-> self upper-rotation-matrix))) + (set! (-> self arm-rot-mult arg1) + (* (-> self arm-rot-mult arg1) (vector-dot (-> s5-1 uvec) (-> self upper-rotation-matrix fvec))) + ) + (let ((f0-6 (* arg2 (acos (vector-dot (-> s5-1 fvec) (-> self upper-rotation-matrix fvec)))))) + (set! (-> self arm-rot arg1) + (seek + (-> self arm-rot arg1) + (fmax -8192.0 (fmin 13653.333 (if (< 0.0 (vector-dot (-> s5-1 fvec) *y-vector*)) + (- f0-6) + f0-6 + ) + ) + ) + (* 65536.0 (seconds-per-frame)) + ) + ) + ) + ) + ) + ) + ) + ) + (gp-2 11 0 1.0) + (gp-2 15 1 1.0) + ) + (roboguard-turn-torso-post) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (roboguard) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 (- (-> self last-hit-points) (the int (-> self hit-points)))) + (let ((s5-0 (enemy-method-131 self 8 (the-as int (logior (-> self draw seg-mask) 1))))) + (when (> s5-0 0) + (let ((a1-2 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-2 hit-xz-reaction) 0.5) + (set! (-> a1-2 hit-y-reaction) 0.3) + (set! (-> a1-2 fountain-rand-transv-lo quad) (-> self root root-prim prim-core world-sphere quad)) + (let ((s3-0 (-> *roboguard-debris-array-params* (+ s5-0 -1)))) + (debris-spawn self a1-2 s3-0 (the-as process-drawable #f)) + (cond + ((logtest? (-> *part-group-id-table* 223 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + quad + ) + ) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 223)) + ) + (else + (set! (-> *launch-matrix* trans quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + quad + ) + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 223)) + ) + ) + ) + ) + (setup-masks (-> self draw) 0 (ash 1 s5-0)) + ) + ) + ) + (set! (-> self last-hit-points) (the int (-> self hit-points))) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (let ((t9-2 (-> (method-of-type nav-enemy knocked) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (roboguard) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (let ((t9-2 (-> (method-of-type nav-enemy knocked-recover) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (roboguard) + :virtual #t + :enter (behavior () + (on-dying self) + (set-time! (-> self state-time)) + (set! (-> self hit-points) 0.0) + ) + :code (behavior () + (when (!= (-> self incoming knocked-type) (knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! roboguard-death-standing-ja + :num! (seek! (ja-aframe 20.0 0) 1.5) + :frame-num (ja-aframe 13.0 0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 20.0 0) 1.5)) + ) + ) + (go-virtual explode) + ) + :post (behavior () + (seek! (-> self arm-rot-mult 0) 0.0 (* 10.0 (seconds-per-frame))) + (seek! (-> self arm-rot-mult 1) 0.0 (* 10.0 (seconds-per-frame))) + (let ((t9-2 (-> (method-of-type nav-enemy die) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate explode (roboguard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (sound-play "robo-explode") + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (send-event self 'death-start) + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (let ((v1-14 (-> gp-1 fountain-rand-transv-lo))) + (let ((a0-8 (-> self root trans))) + (let ((a1-3 *up-vector*)) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-8 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-14 quad) vf6) + ) + (set! (-> s5-1 quad) (-> self incoming attack-direction quad)) + (vector-normalize-copy! (-> gp-1 fountain-rand-transv-lo) s5-1 -20480.0) + (vector-normalize-copy! (-> gp-1 fountain-rand-transv-hi) s5-1 122880.0) + ) + (set! (-> gp-1 fountain-rand-transv-lo y) 40960.0) + (set! (-> gp-1 fountain-rand-transv-hi y) 81920.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-roboguard-explode" (the-as (pointer level) #f)) + 35 + gp-1 + *roboguard-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((v1-25 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + ) + ) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 194 of type roboguard +;; INFO: Used lq/sq +(defmethod roboguard-method-194 ((this roboguard) (arg0 vector) (arg1 float)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> arg0 quad)) + (set! (-> a1-1 w) arg1) + (and (not (add-root-sphere-to-hash! (-> this nav) a1-1 #x100068)) + (let ((a0-5 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) arg0))) + (< (vector-x-angle a0-5) 5461.3335) + ) + (let ((s3-0 (-> this nav)) + (s2-0 (-> this focus-pos)) + (s4-0 (new 'stack 'nav-find-poly-parms)) + ) + (vector-! (-> s4-0 point) s2-0 (the-as vector (-> s3-0 state mesh bounds))) + (set! (-> s4-0 y-threshold) (-> s3-0 nearest-y-threshold)) + (set! (-> s4-0 ignore) (the-as uint 2)) + (nav-mesh-method-46 (-> s3-0 state mesh) (the-as nav-poly s4-0)) + (let ((s4-1 (-> s4-0 poly)) + (s3-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this focus-pos))) + (s5-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (or (not s4-1) (begin + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this focus-pos) s4-1 s3-2 s5-1) + (not (-> s5-1 found-boundary)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *roboguard-formation-table*, type (array float) +(define *roboguard-formation-table* (new 'static 'boxed-array :type float + 0.0 + 1820.4445 + 3640.889 + 5461.3335 + -1820.4445 + -3640.889 + -5461.3335 + 7281.778 + 9102.223 + 10922.667 + -7281.778 + -9102.223 + -10922.667 + 12743.111 + 14563.556 + 16384.0 + -12743.111 + -14563.556 + -16384.0 + 18204.445 + 20024.889 + 21845.334 + -18204.445 + -20024.889 + -21845.334 + 23665.777 + 25486.223 + 27306.666 + -23665.777 + -25486.223 + -27306.666 + 29127.111 + 30947.555 + 32768.0 + -29127.111 + -30947.555 + ) + ) + +;; definition for method 195 of type roboguard +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod roboguard-method-195 ((this roboguard)) + (when (or (< 8192.0 (vector-vector-xz-distance (-> this focus-pos) (-> this focus-formation-source))) + (let ((f0-1 (vector-vector-distance (-> this formation-position) (-> this focus-formation-source))) + (f1-0 40960.0) + (f2-0 65536.0) + ) + (or (>= f1-0 f0-1) (>= f0-1 f2-0)) + ) + (not (roboguard-method-194 this (-> this formation-position) 9011.2)) + ) + (set! (-> this focus-formation-source quad) (-> this focus-pos quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this formation-position) (-> this focus-formation-source))) + ) + (when (< 0.0 (vector-length s4-1)) + (set! (-> s4-1 y) 0.0) + (dotimes (s3-0 (-> *roboguard-formation-table* length)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector-normalize-copy! s1-0 s4-1 1.0) + (vector-rotate-y! s1-0 s1-0 (* (-> this formation-angle-sign) (-> *roboguard-formation-table* s3-0))) + (vector-normalize! s1-0 53248.0) + (vector+! s2-0 (-> this focus-formation-source) s1-0) + (when (and (closest-point-on-mesh (-> this nav) s2-0 s2-0 (the-as nav-poly #f)) + (roboguard-method-194 this s2-0 9011.2) + ) + (set! (-> s5-0 quad) (-> s2-0 quad)) + #t + (goto cfg-26) + ) + ) + ) + ) + ) + (label cfg-26) + (set! (-> this formation-angle-sign) (* -1.0 (-> this formation-angle-sign))) + (set! (-> this formation-position quad) (-> s5-0 quad)) + ) + ) + 0 + (none) + ) + +;; definition for method 196 of type roboguard +;; WARN: Return type mismatch int vs none. +(defmethod roboguard-method-196 ((this roboguard) (arg0 int)) + (let* ((s5-0 (-> this node-list data arg0)) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) s5-0)) + (a3-1 (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 bone transform uvec) -1.0)) + ) + (spawn-guard-projectile + this + v1-2 + (vector+! (new 'stack-no-clear 'vector) v1-2 a3-1) + 819200.0 + (the-as vector #f) + ) + ) + (sound-play "robo-fire" :position (-> this root trans)) + (+! (-> this fire-count) 1) + 0 + (none) + ) + +;; definition for method 85 of type roboguard +(defmethod knocked-anim ((this roboguard) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 0) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) + ) + ) + (else + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 29))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 29)) 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 (-> this draw art-group data 29)) num-func-seek!) + ) + ) + ) + #t + ) + +;; definition for method 86 of type roboguard +(defmethod knocked-land-anim ((this roboguard) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 28))) + (set! (-> v1-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 28)) frames num-frames) -1)) + ) + (set! (-> v1-4 param 1) (-> arg0 anim-speed)) + (set! (-> v1-4 frame-num) 0.0) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 28)) num-func-seek!) + ) + ) + (else + (let ((v1-8 (-> this skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + (set! (-> v1-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) + ) + (set! (-> v1-8 param 1) (-> arg0 anim-speed)) + (set! (-> v1-8 frame-num) 0.0) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) + ) + ) + ) + #t + ) + +;; definition for method 66 of type roboguard +;; WARN: Return type mismatch int vs penetrate. +(defmethod get-penetrated-by ((this roboguard)) + (the-as penetrate 0) + ) + +;; definition for method 27 of type roboguard +(defmethod get-inv-mass ((this roboguard)) + 2.0 + ) + +;; definition for method 109 of type roboguard +;; INFO: Used lq/sq +(defmethod enemy-method-109 ((this roboguard)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) + ) + (do-navigation-to-destination s3-0 (-> gp-0 trans)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ) + (else + (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) + (let ((f0-0 8192.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (-> gp-0 trans))) + ) + (< (- (-> gp-0 trans y) (-> s5-0 y)) -4096.0) + ) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 82 of type roboguard +(defmethod event-handler ((this roboguard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((or (= (-> this hit-points) 0.0) + (and (>= 1.0 (-> this hit-points)) (= (-> this incoming knocked-type) (knocked-type blue-shot))) + ) + (on-dying this) + (go (method-of-object this explode)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (('impact-impulse) + (let ((v1-38 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-38) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> this hit-points) 0.0) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 17) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 10 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 14 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 8 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 12 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 19 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 22 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 18 + 210 + 16384.0 + ) + (process-drawable-shock-effect + this + (-> *lightning-spec-id-table* 18) + lightning-probe-callback + (-> *part-id-table* 160) + 21 + 210 + 16384.0 + ) + (send-event arg0 'lawsuit (-> this root trans)) + (go (method-of-object this explode)) + #t + ) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 59 of type roboguard +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this roboguard)) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + (vector-rotate-around-y! + (the-as vector (-> this upper-rotation-matrix)) + (the-as vector (-> this rotation-matrix)) + (-> this torso-angle) + ) + (set! (-> this upper-rotation-matrix uvec quad) (-> this rotation-matrix uvec quad)) + (vector-rotate-around-y! + (-> this upper-rotation-matrix fvec) + (-> this rotation-matrix fvec) + (-> this torso-angle) + ) + (when (< 1 (the-as int (-> this focus aware))) + (when (-> this update-focus-pos) + (let ((s5-0 (handle->process (-> this focus handle)))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-0) 5) quad)) + (los-control-method-9 (-> this los) (the-as process-focusable s5-0) (-> this focus-pos) 819.2 4096.0) + ) + ) + ) + (vector-! (-> this me-to-focus-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this me-to-focus-dir y) 0.0) + (vector-xz-normalize! (-> this me-to-focus-dir) 1.0) + (let* ((a1-9 (-> this rotation-matrix fvec)) + (s5-1 (-> this rotation-matrix)) + (f0-3 (vector-vector-angle-safe (-> this me-to-focus-dir) a1-9)) + ) + (if (< (vector-dot (-> this me-to-focus-dir) (the-as vector s5-1)) 0.0) + (set! f0-3 (* -1.0 f0-3)) + ) + (set! (-> this me-to-focus-angle) f0-3) + ) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 67 of type roboguard +(defmethod coin-flip? ((this roboguard)) + #f + ) + +;; definition for method 121 of type roboguard +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this roboguard)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask kg-robot)) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + ) + (init-enemy-defaults! this *roboguard-nav-enemy-info*) + (init-los! + (-> this los) + this + (seconds 0.1) + 327680.0 + (collide-spec backgnd obstacle hit-by-others-list los-blocker) + ) + (set! (-> this torso-aim-blend) 0.0) + (set! (-> this torso-angle) 0.0) + (set! (-> this torso-seek-speed) 0.0) + (set! (-> this torso-to-focus-angle) 0.0) + (let ((v1-13 (-> this node-list data 4))) + (set! (-> v1-13 param0) + (lambda ((arg0 cspace) (arg1 transformq)) + (local-vars (sv-96 vector)) + (let ((s3-0 (the-as roboguard (-> arg0 param1))) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> s3-0 rotation-matrix rvec quad)) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (set! (-> s0-0 quad) (-> s3-0 rotation-matrix fvec quad)) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (set! sv-96 (-> s3-0 focus-pos)) + (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) arg0)) + (s1-1 (vector-! s1-0 sv-96 v0-1)) + ) + (set! (-> s1-1 y) 0.0) + (set! (-> s2-0 y) 0.0) + (set! (-> s0-0 y) 0.0) + (vector-xz-normalize! s1-1 1.0) + (vector-xz-normalize! s2-0 1.0) + (vector-xz-normalize! s0-0 1.0) + (let ((f0-5 (fmin 18204.445 (acos (vector-dot s0-0 s1-1))))) + (if (< (vector-dot s2-0 s1-1) 0.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (seek! (-> s3-0 torso-angle) f0-5 (* (-> s3-0 torso-seek-speed) (seconds-per-frame))) + ) + ) + ) + ) + ) + (quaternion-vector-angle! gp-0 *y-vector* (* (-> s3-0 torso-angle) (-> s3-0 torso-aim-blend))) + (quaternion*! (-> arg1 quat) (-> arg1 quat) gp-0) + ) + (quaternion-normalize! (-> arg1 quat)) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + ) + (set! (-> v1-13 param1) this) + ) + (let ((v1-14 (lambda ((arg0 cspace) (arg1 transformq)) + (let ((s3-0 (-> arg0 param1)) + (s2-0 (the-as object (-> arg0 param2))) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (quaternion-vector-angle! + (the-as quaternion s4-0) + (the-as vector (-> (the-as roboguard s3-0) upper-rotation-matrix)) + (* (-> (the-as roboguard s3-0) arm-rot (the-as int s2-0)) + (-> (the-as roboguard s3-0) arm-rot-mult (the-as int s2-0)) + ) + ) + (matrix->trans (-> arg0 bone transform) gp-0) + (matrix*! + (-> arg0 bone transform) + (-> arg0 bone transform) + (quaternion->matrix (new 'stack-no-clear 'matrix) (the-as quaternion s4-0)) + ) + (matrix<-trans (-> arg0 bone transform) gp-0) + ) + (none) + ) + ) + ) + (let ((a0-9 (-> this node-list data 10))) + (set! (-> a0-9 param0) v1-14) + (set! (-> a0-9 param1) this) + (set! (-> a0-9 param2) (the-as basic 0)) + ) + (let ((a0-11 (-> this node-list data 14))) + (set! (-> a0-11 param0) v1-14) + (set! (-> a0-11 param1) this) + (set! (-> a0-11 param2) (the-as basic 1)) + ) + ) + (set! (-> this arm-rot-mult 0) 0.0) + (set! (-> this arm-rot-mult 1) 0.0) + (set! (-> this flags) (roboguard-flag)) + (set! (-> this last-attack-time) 0) + (set! (-> this update-focus-pos) #t) + (set! (-> this formation-angle-sign) (if (not (logtest? (-> this pid) 1)) + 1.0 + -1.0 + ) + ) + (set! (-> this last-hit-points) (the int (-> this enemy-info default-hit-points))) + (setup-masks (-> this draw) -1 0) + 0 + (none) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc new file mode 100644 index 0000000000..e7d37a742d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc @@ -0,0 +1,1772 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-spydroid-orig-trail + :id 1521 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4976 :fade-after (meters 120) :falloff-to (meters 160)) + (sp-item 4977 :flags (sp6)) + (sp-item 4978 :fade-after (meters 120) :falloff-to (meters 160)) + ) + ) + +;; failed to figure out what this is: +(defpart 4977 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 1.7) (meters 1)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees -17) (degrees 17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 192.0 64.0) + (:b 255.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -1.0666667) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4978 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 2.0 2.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.033)) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.03375)) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:fade-r -8.0) + (:fade-g -0.85 -0.85) + (:fade-a -0.10666667 -0.42666668) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 135) (degrees 90)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters -0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 4976 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.5 1.0) + (:scale-x (meters 1.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 64.0 8.0) + (:vel-x (meters -0.0033333334) (meters 0.006666667)) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:vel-z (meters -0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667) (meters 0.008333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.2) + (:fade-g 0.0) + (:fade-b -3.2) + (:fade-a -0.8) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.135)) + (:next-launcher 4979) + ) + ) + +;; failed to figure out what this is: +(defpart 4979 + :init-specs ((:r 128.0) + (:g 128.0) + (:b 128.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.10666667 -0.21333334) + (:func 'nothing) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-spydroid-orig-explode + :id 1522 + :duration (seconds 3) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4980 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 4981 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 4982 :period (seconds 3) :length (seconds 0.05)) + (sp-item 4983 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 4984 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 4985 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 4986 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 4981 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -8.5) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 4987) + ) + ) + +;; failed to figure out what this is: +(defpart 4987 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 4986 + :init-specs ((:texture (explosion-wave factoryc-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 4988) + (:conerot-x '*sp-temp*) + ) + ) + +;; failed to figure out what this is: +(defpart 4985 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 4988) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4988 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 4989)) + ) + +;; failed to figure out what this is: +(defpart 4989 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4990) + ) + ) + +;; failed to figure out what this is: +(defpart 4990 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 4991) + ) + ) + +;; failed to figure out what this is: +(defpart 4991 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 4980 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 4992) + ) + ) + +;; failed to figure out what this is: +(defpart 4992 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +;; failed to figure out what this is: +(defpart 4984 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4993) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4993 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4994) + ) + ) + +;; failed to figure out what this is: +(defpart 4994 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +;; failed to figure out what this is: +(defpart 4982 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4995) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +;; failed to figure out what this is: +(defpart 4995 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4996) + ) + ) + +;; failed to figure out what this is: +(defpart 4996 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 4983 + :init-specs ((:texture (flamingstick factoryc-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpart 4997 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4998 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 16.0 4.0) + (:omega (degrees 1361.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4999 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 6.0 2.0) + (:omega (degrees 1811.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 5000 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees -2) (degrees 4)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 1811.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-spydroid-orig spydroid-orig spydroid-orig-lod0-jg spydroid-orig-idle-ja + ((spydroid-orig-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow spydroid-orig-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-spydroid-orig-exploding spydroid-orig spydroid-orig-exploding-lod0-jg spydroid-orig-exploding-idle-ja + ((spydroid-orig-exploding-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 12) + ) + +;; definition for symbol *spydroid-orig-exploder-params*, type joint-exploder-static-params +(define *spydroid-orig-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd obstacle hit-by-others-list) + ) + ) + +;; definition of type spydroid-orig +(deftype spydroid-orig (nav-enemy) + ((old-y-deg float) + (diff-angle float) + (flags spydroid-orig-flag) + (lightning lightning-control 4) + (floor float) + (explode-part sparticle-launch-control) + ) + (:state-methods + attack + explode + ) + ) + +;; definition for method 3 of type spydroid-orig +(defmethod inspect ((this spydroid-orig)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Told-y-deg: ~f~%" (-> this old-y-deg)) + (format #t "~2Tdiff-angle: ~f~%" (-> this diff-angle)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tlightning[4] @ #x~X~%" (-> this lightning)) + (format #t "~2Tfloor: ~f~%" (-> this floor)) + (format #t "~2Texplode-part: ~A~%" (-> this explode-part)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-spydroid-orig-defaults*, type fact-info-enemy-defaults +(define *fact-info-spydroid-orig-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +;; definition for symbol *spydroid-orig-nav-enemy-info*, type nav-enemy-info +(define *spydroid-orig-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 5 + :hit-anim 15 + :knocked-anim 11 + :knocked-land-anim 12 + :die-anim 15 + :die-falling-anim 15 + :victory-anim -1 + :jump-wind-up-anim 8 + :jump-in-air-anim 9 + :jump-land-anim 10 + :neck-joint 4 + :look-at-joint 4 + :bullseye-joint 4 + :sound-hit (static-sound-name "spydroid-orig-h") + :sound-die (static-sound-name "droid-explode") + :notice-distance (meters 200) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3.5) + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 4 + :turn-anim -1 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 32) + :run-turning-acceleration (meters 40) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 16) + :walk-turning-acceleration (meters 40) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *spydroid-orig-nav-enemy-info* fact-defaults) *fact-info-spydroid-orig-defaults*) + +;; definition for method 59 of type spydroid-orig +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod enemy-common-post ((this spydroid-orig)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (when (< (-> this root scale x) 1.0) + (let ((f0-2 (fmin 1.0 (+ 0.025 (-> this root scale x))))) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) + ) + ) + (when (logtest? (-> this flags) (spydroid-orig-flag sof0)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! s5-0 (-> this node-list data 12)) + (dotimes (s3-0 4) + (let ((a0-4 (-> this lightning s3-0)) + (v1-15 s5-0) + ) + (set! (-> a0-4 state meet data 0 quad) (-> v1-15 quad)) + ) + (let ((v1-17 s3-0)) + (cond + ((zero? v1-17) + (vector<-cspace! s4-0 (-> this node-list data 16)) + ) + ((= v1-17 1) + (vector<-cspace! s4-0 (-> this node-list data 20)) + ) + ((= v1-17 2) + (vector<-cspace! s4-0 (-> this node-list data 28)) + ) + (else + (vector<-cspace! s4-0 (-> this node-list data 24)) + ) + ) + ) + (let ((a0-13 (-> this lightning s3-0)) + (v1-28 s4-0) + ) + (set! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1) quad) (-> v1-28 quad)) + ) + (when (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'die-falling) (= v1-33 'explode)) + ) + ) + ) + (let ((v1-38 (-> this lightning s3-0 state mode))) + (when (or (zero? v1-38) (= v1-38 3)) + (let ((v1-42 (-> this lightning s3-0)) + (a0-20 1) + ) + (let ((a1-11 (!= a0-20 (-> v1-42 state mode)))) + (case a0-20 + ((3) + (if a1-11 + (set! (-> v1-42 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-42 state start-color) (-> v1-42 spec start-color)) + (set! (-> v1-42 state end-color) (-> v1-42 spec end-color)) + ) + ) + ) + (set! (-> v1-42 state mode) (the-as uint a0-20)) + ) + ) + ) + ) + ) + ) + ) + (let ((f0-5 (quaternion-y-angle (-> this root quat)))) + (set! (-> this diff-angle) (- (-> this old-y-deg) f0-5)) + (cond + ((< 32768.0 (-> this diff-angle)) + (+! (-> this diff-angle) -65536.0) + ) + ((< (-> this diff-angle) -32768.0) + (+! (-> this diff-angle) 65536.0) + ) + ) + (set! (-> this old-y-deg) f0-5) + ) + (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (logior! (-> this flags) (spydroid-orig-flag sof1)) + (logclear! (-> this flags) (spydroid-orig-flag sof1)) + ) + (if (and (< (-> this root trans y) (+ -122880.0 (-> this floor))) + (-> this next-state) + (= (-> this next-state name) 'jump) + ) + (deactivate this) + ) + (if (and (-> this next-state) (= (-> this next-state name) 'jump)) + (spawn (-> this part) (-> this root trans)) + ) + 0 + (none) + ) + +;; definition for method 82 of type spydroid-orig +;; INFO: Used lq/sq +(defmethod event-handler ((this spydroid-orig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v1-8 structure) (sv-144 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (case arg2 + (('touch 'bonk 'attack) + (cond + ((logtest? (-> this flags) (spydroid-orig-flag sof0)) + (set! sv-144 (the-as vector (send-event (ppointer->process (-> this parent)) 'widow-get-center))) + (let* ((s1-0 arg0) + (s0-0 (if (type? s1-0 process-drawable) + s1-0 + ) + ) + ) + (let ((v1-7 sv-144)) + (b! (not v1-7) cfg-16 :likely-delay (set! v1-8 sv-144)) + ) + (set! v1-8 s0-0) + (label cfg-16) + (cond + (v1-8 + (let ((v1-12 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) sv-144)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-1 x) (- (-> v1-12 z))) + (set! (-> s1-1 y) 0.0) + (set! (-> s1-1 z) (-> v1-12 x)) + (set! (-> s1-1 w) 1.0) + (let ((v1-15 + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> this root trans)) + ) + ) + (set! (-> s1-1 y) 0.0) + (set! (-> v1-15 y) 0.0) + (if (< (vector-dot v1-15 s1-1) 0.0) + (vector-negate! s1-1 s1-1) + ) + ) + (vector-normalize! s1-1 16384.0) + (vector+! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans)) + (vector-! s1-1 s1-1 sv-144) + (set! (-> s1-1 y) 0.0) + (vector-normalize! s1-1 204800.0) + (let ((v1-20 s1-1)) + (let ((a0-19 s1-1)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> a0-19 quad)) + ) + (.lvf vf5 (&-> sv-144 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-20 quad) vf6) + ) + (vector-! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans)) + (set! (-> s1-1 y) 8192.0) + (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'shock) + (vector s1-1) + ) + ) + ) + ) + ) + ((and s0-0 (= (-> s0-0 type) target)) + (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'shock) + (shove-up (meters 2)) + (shove-back (meters 4)) + ) + ) + ) + ) + ) + ) + (let ((v1-36 (the-as object (-> arg3 param 1)))) + (if (or (!= arg0 *target*) + (and (= arg2 'attack) + (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-36) mask)) + (logtest? (penetrate vehicle dark-bomb) (-> (the-as attack-info v1-36) penetrate-using)) + ) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('jump) + (set! (-> this floor) (-> (the-as vector (-> arg3 param 1)) y)) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('use-lightning) + (cond + ((-> arg3 param 0) + (let ((v0-7 (the-as object (logior (-> this flags) (spydroid-orig-flag sof0))))) + (set! (-> this flags) (the-as spydroid-orig-flag v0-7)) + v0-7 + ) + ) + (else + (logclear! (-> this flags) (spydroid-orig-flag sof0)) + (dotimes (v1-47 4) + (let ((a0-56 (-> this lightning v1-47 state mode))) + (cond + ((or (zero? a0-56) (= a0-56 3)) + ) + (else + (let ((a0-60 (-> this lightning v1-47)) + (a1-28 3) + ) + (let ((a2-9 (!= a1-28 (-> a0-60 state mode)))) + (case a1-28 + ((3) + (if a2-9 + (set! (-> a0-60 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-60 state start-color) (-> a0-60 spec start-color)) + (set! (-> a0-60 state end-color) (-> a0-60 spec end-color)) + ) + ) + ) + (set! (-> a0-60 state mode) (the-as uint a1-28)) + ) + ) + ) + ) + ) + #f + ) + ) + ) + (('impact-impulse) + (let ((v1-49 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-49) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) + (set! (-> this hit-points) 0.0) + (send-event arg0 'lawsuit (-> this root trans)) + (go (method-of-object this explode)) + #t + ) + ) + ) + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (cond + ((or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) + (on-dying this) + (go (method-of-object this explode)) + ) + (else + (go (method-of-object this knocked)) + ) + ) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate explode (spydroid-orig) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (send-event self 'death-start) + (sound-play "droid-explode") + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (when (logtest? (-> self flags) (spydroid-orig-flag sof0)) + (dotimes (v1-16 4) + (let ((a0-7 (-> self lightning v1-16)) + (a1-2 3) + ) + (let ((a2-2 (!= a1-2 (-> a0-7 state mode)))) + (case a1-2 + ((3) + (if a2-2 + (set! (-> a0-7 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-7 state start-color) (-> a0-7 spec start-color)) + (set! (-> a0-7 state end-color) (-> a0-7 spec end-color)) + ) + ) + ) + (set! (-> a0-7 state mode) (the-as uint a1-2)) + ) + ) + ) + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-spydroid-orig-exploding" (the-as (pointer level) #f)) + 20 + gp-1 + *spydroid-orig-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((v1-25 (new 'stack-no-clear 'vector))) + (set! (-> v1-25 quad) (-> self root trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + ) + (let ((gp-4 (-> self child))) + (while gp-4 + (send-event (ppointer->process gp-4) 'notice 'die) + (set! gp-4 (-> gp-4 0 brother)) + ) + ) + ) + :trans (behavior () + (when (not (-> self child)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die-falling (spydroid-orig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-time! (-> self state-time)) + (send-event self 'death-start) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (not (time-elapsed? (-> self state-time) (seconds 2))) + (spawn (-> self explode-part) (-> self root trans)) + ) + ) + :code (behavior () + (when (logtest? (-> self flags) (spydroid-orig-flag sof0)) + (dotimes (v1-3 4) + (let ((a0-2 (-> self lightning v1-3)) + (a1-0 3) + ) + (let ((a2-1 (!= a1-0 (-> a0-2 state mode)))) + (case a1-0 + ((3) + (if a2-1 + (set! (-> a0-2 state counter) 0.0) + ) + ) + ((1) + (set! (-> a0-2 state start-color) (-> a0-2 spec start-color)) + (set! (-> a0-2 state end-color) (-> a0-2 spec end-color)) + ) + ) + ) + (set! (-> a0-2 state mode) (the-as uint a1-0)) + ) + ) + ) + (suspend) + (ja-channel-set! 0) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (let ((gp-1 (-> self child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'notice 'die) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; failed to figure out what this is: +(defstate attack (spydroid-orig) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (spydroid-orig-flag sof2)) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (+ 8192.0 (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-7 (-> self nav state))) + (set! (-> v1-7 speed) (+ 8192.0 (-> self enemy-info run-travel-speed))) + ) + 0 + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 turning-acceleration) (* 4.0 (-> self enemy-info run-turning-acceleration))) + ) + 0 + (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) + (reset-penetrate! self) + (let* ((v1-14 *game-info*) + (a0-11 (+ (-> v1-14 attack-id) 1)) + ) + (set! (-> v1-14 attack-id) a0-11) + (set! (-> self attack-id) a0-11) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-attack-jump-ja :num! min) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (nav-enemy-method-179 self) + (let ((v1-4 (-> self nav))) + (set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed)) + ) + 0 + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (reset-penetrate! self) + nav-state + (if (logtest? (-> self enemy-flags) (enemy-flag victory)) + (logior! (-> self flags) (spydroid-orig-flag sof2)) + ) + (let ((v1-10 (ja-group))) + (cond + ((and v1-10 (= v1-10 spydroid-orig-attack-jump-ja)) + (ja :num! (seek!)) + (if (and (< 4.0 (ja-aframe-num 0)) (not (logtest? (-> self flags) (spydroid-orig-flag sof0)))) + (logior! (-> self focus-status) (focus-status dangerous)) + ) + (when (ja-done? 0) + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 target-speed) 0.0) + ) + 0 + (let ((v1-30 (-> self nav))) + (set! (-> v1-30 acceleration) 262144.0) + ) + 0 + (let ((v1-32 (-> self nav))) + (set! (-> v1-32 turning-acceleration) 0.0) + ) + 0 + (ja :group! spydroid-orig-attack-land-ja :num! min) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + ) + (else + (let ((v1-45 (ja-group))) + (cond + ((and v1-45 (= v1-45 spydroid-orig-attack-land-ja)) + (ja :num! (seek!)) + (cond + ((ja-done? 0) + (go-hostile self) + ) + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + ) + ((< 0.0 (-> self diff-angle)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + ) + ) + ((let ((v1-69 (ja-group))) + (and (and v1-69 (= v1-69 spydroid-orig-turn-left-ja)) + (and (logtest? (-> self flags) (spydroid-orig-flag sof1)) (< 0.0 (-> self diff-angle))) + ) + ) + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + (else + (let ((v1-80 (ja-group))) + (if (and (and v1-80 (= v1-80 spydroid-orig-turn-right-ja)) + (and (logtest? (-> self flags) (spydroid-orig-flag sof1)) (< (-> self diff-angle) 0.0)) + ) + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + (go-hostile self) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate notice (spydroid-orig) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (and a0-1 + (let ((f0-0 (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (-> self root trans))) + (f1-0 16384.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + ) + (go-virtual attack) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-24 (ja-group))) + (when (not (and v1-24 (= v1-24 (-> self draw art-group data (-> self enemy-info hostile-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-44 (ja-group))) + (cond + ((not (and v1-44 (= v1-44 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-56 (ja-group))) + (cond + ((not (and v1-56 (= v1-56 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate circling (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy circling) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-28 (ja-group))) + (cond + ((not (and v1-28 (= v1-28 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-40 (ja-group))) + (cond + ((not (and v1-40 (= v1-40 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (nav-enemy-method-176 self) + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate pacing (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy pacing) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info walk-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) + ) + ) + (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-28 (ja-group))) + (cond + ((not (and v1-28 (= v1-28 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-40 (ja-group))) + (cond + ((not (and v1-40 (= v1-40 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate stare (spydroid-orig) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (cond + ((not (logtest? (-> self flags) (spydroid-orig-flag sof1))) + (let ((v1-8 (ja-group))) + (when (not (and v1-8 (= v1-8 (-> self draw art-group data (-> self enemy-info idle-anim))))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! min) + ) + ) + (ja :num! (loop!)) + ) + ((< 0.0 (-> self diff-angle)) + (let ((v1-24 (ja-group))) + (cond + ((not (and v1-24 (= v1-24 spydroid-orig-turn-left-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-left-ja :num! min) + ) + (else + (ja :num! (loop! (* 0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + (else + (let ((v1-36 (ja-group))) + (cond + ((not (and v1-36 (= v1-36 spydroid-orig-turn-right-ja))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! spydroid-orig-turn-right-ja :num! min) + ) + (else + (ja :num! (loop! (* -0.0019975142 (-> self diff-angle)))) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + ) + #f + ) + ) + +;; definition for method 120 of type spydroid-orig +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this spydroid-orig)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid deadly)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4300.8) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action deadly)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list) + ) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 3686.4) + ) + (set! (-> s5-0 nav-radius) 8192.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 67 of type spydroid-orig +(defmethod coin-flip? ((this spydroid-orig)) + #f + ) + +;; definition for method 27 of type spydroid-orig +(defmethod get-inv-mass ((this spydroid-orig)) + 3.3333333 + ) + +;; definition for method 10 of type spydroid-orig +(defmethod deactivate ((this spydroid-orig)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this explode-part)) + (kill-particles (-> this explode-part)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type spydroid-orig +;; WARN: Return type mismatch nav-enemy vs spydroid-orig. +(defmethod relocate ((this spydroid-orig) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) offset) + ) + ) + (when (nonzero? (-> this explode-part)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) offset) + ) + ) + (the-as spydroid-orig ((method-of-type nav-enemy relocate) this offset)) + ) + +;; definition for method 121 of type spydroid-orig +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this spydroid-orig)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid-orig" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *spydroid-orig-nav-enemy-info*) + (dotimes (s5-1 4) + (set! (-> this lightning s5-1) + (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 512.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + (let ((v1-10 (-> this lightning s5-1)) + (a0-5 0) + ) + (let ((a1-5 (!= a0-5 (-> v1-10 state mode)))) + (case a0-5 + ((3) + (if a1-5 + (set! (-> v1-10 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-10 state start-color) (-> v1-10 spec start-color)) + (set! (-> v1-10 state end-color) (-> v1-10 spec end-color)) + ) + ) + ) + (set! (-> v1-10 state mode) (the-as uint a0-5)) + ) + ) + (let ((v1-13 (-> this neck))) + (set! (-> v1-13 up) (the-as uint 1)) + (set! (-> v1-13 nose) (the-as uint 2)) + (set! (-> v1-13 ear) (the-as uint 0)) + (set-vector! (-> v1-13 twist-max) 3640.889 11832.889 0.0 1.0) + (set! (-> v1-13 ignore-angle) 15473.777) + ) + (set-vector! (-> this root scale) 0.5 0.5 0.5 1.0) + (let ((v1-17 (-> this nav))) + (set! (-> v1-17 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1521) this)) + (set! (-> this explode-part) (create-launch-control (-> *part-group-id-table* 1522) this)) + (add-connection + *part-engine* + this + 8 + this + 4997 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 163840.0) + ) + (add-connection + *part-engine* + this + 10 + this + 4997 + (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 163840.0) + ) + (add-connection + *part-engine* + this + 4 + this + 4998 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 163840.0) + ) + (add-connection *part-engine* this 6 this 4999 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 6 this 5000 (new 'static 'vector :w 163840.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this flags) (spydroid-orig-flag)) + (if (-> this entity) + (set! (-> this flags) + (res-lump-value (-> this entity) 'spydroid-flags spydroid-orig-flag :time -1000000000.0) + ) + ) + (logclear! (-> this flags) (spydroid-orig-flag sof1 sof2)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control-h_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control-h_REF.gc new file mode 100644 index 0000000000..1f94e1e64d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control-h_REF.gc @@ -0,0 +1,238 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type squad-unit-settings +(deftype squad-unit-settings (structure) + ((target-count int8) + (shot-count int8) + (rand-shot-count int8) + (inaccuracy float) + (acquire-delay uint16) + (shot-delay uint16) + (burst-delay uint16) + (rand-burst-delay uint16) + (rand-shot-delay uint16) + ) + ) + +;; definition for method 3 of type squad-unit-settings +(defmethod inspect ((this squad-unit-settings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'squad-unit-settings) + (format #t "~1Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~1Tshot-count: ~D~%" (-> this shot-count)) + (format #t "~1Trand-shot-count: ~D~%" (-> this rand-shot-count)) + (format #t "~1Tinaccuracy: ~f~%" (-> this inaccuracy)) + (format #t "~1Tacquire-delay: ~D~%" (-> this acquire-delay)) + (format #t "~1Tshot-delay: ~D~%" (-> this shot-delay)) + (format #t "~1Tburst-delay: ~D~%" (-> this burst-delay)) + (format #t "~1Trand-burst-delay: ~D~%" (-> this rand-burst-delay)) + (format #t "~1Trand-shot-delay: ~D~%" (-> this rand-shot-delay)) + (label cfg-4) + this + ) + +;; definition of type squad-target-status +(deftype squad-target-status (structure) + ((flags squad-target-flag) + (handle handle) + (last-seen-time time-frame) + (position vector :inline) + (velocity vector :inline) + (threat-level float) + ) + ) + +;; definition for method 3 of type squad-target-status +(defmethod inspect ((this squad-target-status)) + (when (not this) + (set! this this) + (goto cfg-14) + ) + (format #t "[~8x] ~A~%" this 'squad-target-status) + (format #t "~1Tflags: #x~X : (squad-target-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (squad-target-flag visible-now)) (squad-target-flag visible-now)) + (format #t "visible-now ") + ) + (if (= (logand s5-0 (squad-target-flag visible-ever)) (squad-target-flag visible-ever)) + (format #t "visible-ever ") + ) + (if (= (logand s5-0 (squad-target-flag force-visible)) (squad-target-flag force-visible)) + (format #t "force-visible ") + ) + (if (= (logand s5-0 (squad-target-flag visible-recently)) (squad-target-flag visible-recently)) + (format #t "visible-recently ") + ) + (if (= (logand s5-0 (squad-target-flag updated)) (squad-target-flag updated)) + (format #t "updated ") + ) + ) + (format #t ")~%") + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tlast-seen-time: ~D~%" (-> this last-seen-time)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tthreat-level: ~f~%" (-> this threat-level)) + (label cfg-14) + this + ) + +;; definition of type squad-alert-state +(deftype squad-alert-state (structure) + ((flags squad-alert-flag) + (level uint8) + (max-level uint8) + (guards-in-sight-of-target int8) + (guard-aim-count int8) + (guard-inaccuracy-factor float) + (guard-target-level float) + (duration uint32) + (start-time time-frame) + (notify-time time-frame) + (alarm-sound-id sound-id) + (target-status-array squad-target-status 3 :inline) + (target-status squad-target-status :inline :overlay-at (-> target-status-array 0)) + ) + (:methods + (init! (_type_) none) + ) + ) + +;; definition for method 3 of type squad-alert-state +(defmethod inspect ((this squad-alert-state)) + (when (not this) + (set! this this) + (goto cfg-18) + ) + (format #t "[~8x] ~A~%" this 'squad-alert-state) + (format #t "~1Tflags: #x~X : (squad-alert-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (squad-alert-flag update-target-search)) (squad-alert-flag update-target-search)) + (format #t "update-target-search ") + ) + (if (= (logand s5-0 (squad-alert-flag disable-pursuit-control)) (squad-alert-flag disable-pursuit-control)) + (format #t "disable-pursuit-control ") + ) + (if (= (logand s5-0 (squad-alert-flag sticky-guard-settings)) (squad-alert-flag sticky-guard-settings)) + (format #t "sticky-guard-settings ") + ) + (if (= (logand s5-0 (squad-alert-flag alarm-on)) (squad-alert-flag alarm-on)) + (format #t "alarm-on ") + ) + (if (= (logand s5-0 (squad-alert-flag war)) (squad-alert-flag war)) + (format #t "war ") + ) + (if (= (logand s5-0 (squad-alert-flag alert-ending)) (squad-alert-flag alert-ending)) + (format #t "alert-ending ") + ) + (if (= (logand s5-0 (squad-alert-flag guard-multi-focus)) (squad-alert-flag guard-multi-focus)) + (format #t "guard-multi-focus ") + ) + ) + (format #t ")~%") + (format #t "~1Tlevel: ~D~%" (-> this level)) + (format #t "~1Tmax-level: ~D~%" (-> this max-level)) + (format #t "~1Tguards-in-sight-of-target: ~D~%" (-> this guards-in-sight-of-target)) + (format #t "~1Tguard-aim-count: ~D~%" (-> this guard-aim-count)) + (format #t "~1Tguard-inaccuracy-factor: ~f~%" (-> this guard-inaccuracy-factor)) + (format #t "~1Tguard-target-level: ~f~%" (-> this guard-target-level)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tnotify-time: ~D~%" (-> this notify-time)) + (format #t "~1Talarm-sound-id: ~D~%" (-> this alarm-sound-id)) + (format #t "~1Ttarget-status-array[3] @ #x~X~%" (-> this target-status-array)) + (format #t "~1Ttarget-status: #~%" (-> this target-status-array)) + (label cfg-18) + this + ) + +;; definition of type primary-target-pos-vel +(deftype primary-target-pos-vel (structure) + ((position vector :inline) + (velocity vector :inline) + (time uint32 :overlay-at (-> velocity data 3)) + ) + ) + +;; definition for method 3 of type primary-target-pos-vel +(defmethod inspect ((this primary-target-pos-vel)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'primary-target-pos-vel) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Ttime: ~D~%" (-> this time)) + (label cfg-4) + this + ) + +;; definition of type squad-control +(deftype squad-control (basic) + ((sync-clock uint8) + (sync-mask-8 uint8) + (sync-mask-16 uint16) + (sync-mask-32 uint32) + (alert-state squad-alert-state :inline) + (primary-target-history primary-target-pos-vel 16 :inline) + ) + (:methods + (initialize (_type_ process) none) + (squad-control-method-10 (_type_) none) + (stop-alarm-sound (_type_) none) + (init-alert (_type_) none) + (update (_type_) none) + (set-sync-mask (_type_) none) + (probe-backgnd-collision (_type_ vector vector) symbol) + (squad-control-method-16 (_type_ vector process-focusable squad-target-status) none) + (squad-control-method-17 (_type_ vector int squad-target-status) none) + (squad-control-method-18 (_type_ int process) int) + (set-alert-level0 (_type_ int) int) + (start-alert (_type_ int) none) + (set-alert-level (_type_ int) none) + (get-alert-level (_type_) int) + (set-alert-duration (_type_ time-frame) none) + (squad-control-method-24 (_type_) int) + (squad-control-method-25 (_type_ primary-target-pos-vel time-frame) none) + (set-pos-vel (_type_ primary-target-pos-vel) primary-target-pos-vel) + (squad-control-method-27 (_type_ process float) none) + (get-idx-in-status-arr (_type_ handle) int) + (valid-target-handle? (_type_ handle) symbol) + (get-target-focus (_type_) process-focusable) + (squad-control-method-31 (_type_ vector process-focusable handle float float) none) + (get-handle-pos (_type_ handle vector) vector) + (get-focus-in-range (_type_ process-focusable) process-focusable) + ) + ) + +;; definition for method 3 of type squad-control +(defmethod inspect ((this squad-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsync-clock: ~D~%" (-> this sync-clock)) + (format #t "~1Tsync-mask-8: ~D~%" (-> this sync-mask-8)) + (format #t "~1Tsync-mask-16: ~D~%" (-> this sync-mask-16)) + (format #t "~1Tsync-mask-32: ~D~%" (-> this sync-mask-32)) + (format #t "~1Talert-state: #~%" (-> this alert-state)) + (format #t "~1Tprimary-target-history[16] @ #x~X~%" (-> this primary-target-history)) + (label cfg-4) + this + ) + +;; definition for symbol *waswide-squad-control*, type squad-control +(define *waswide-squad-control* (the-as squad-control #f)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc new file mode 100644 index 0000000000..6a5f15ac0b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc @@ -0,0 +1,556 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type squad-alert-state +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this squad-alert-state)) + (set! (-> this flags) (squad-alert-flag)) + (set! (-> this level) (the-as uint 0)) + (set! (-> this duration) (the-as uint 9000)) + (set! (-> this alarm-sound-id) (new-sound-id)) + (set! (-> this guard-inaccuracy-factor) 1.0) + (dotimes (v1-2 3) + (let ((a0-4 (-> this target-status-array v1-2))) + (set! (-> a0-4 flags) (squad-target-flag)) + (set! (-> a0-4 handle) (the-as handle #f)) + (vector-reset! (-> a0-4 position)) + (vector-reset! (-> a0-4 velocity)) + (set! (-> a0-4 threat-level) 0.0) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod initialize ((this squad-control) (arg0 process)) + 0 + (none) + ) + +;; definition for method 10 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod squad-control-method-10 ((this squad-control)) + (init! (-> this alert-state)) + (init-alert this) + 0 + (none) + ) + +;; definition for method 11 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod stop-alarm-sound ((this squad-control)) + (sound-stop (-> this alert-state alarm-sound-id)) + 0 + (none) + ) + +;; definition for method 12 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod init-alert ((this squad-control)) + (logclear! + (-> this alert-state flags) + (squad-alert-flag guard-multi-focus sticky-guard-settings disable-pursuit-control war) + ) + (let ((v1-2 (-> this alert-state target-status-array))) + (logclear! (-> v1-2 0 flags) (squad-target-flag force-visible)) + ) + (set-alert-duration this (seconds 30)) + (set-alert-level this 4) + 0 + (none) + ) + +;; definition for method 14 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod set-sync-mask ((this squad-control)) + (+! (-> this sync-clock) 1) + (let ((v1-2 (-> this sync-clock))) + (set! (-> this sync-mask-8) (the-as uint (ash 1 (the-as int (logand v1-2 7))))) + (set! (-> this sync-mask-16) (the-as uint (ash 1 (the-as int (logand v1-2 15))))) + (set! (-> this sync-mask-32) (the-as uint (ash 1 (the-as int (logand v1-2 31))))) + ) + 0 + (none) + ) + +;; definition for method 13 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod update ((this squad-control)) + (set-sync-mask this) + 0 + (none) + ) + +;; definition for method 17 of type squad-control +;; INFO: this function exists in multiple non-identical object files +;; WARN: Return type mismatch squad-target-status vs none. +(defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) + (empty) + (none) + ) + +;; definition for method 18 of type squad-control +(defmethod squad-control-method-18 ((this squad-control) (arg0 int) (arg1 process)) + (if (logtest? (-> this alert-state flags) (squad-alert-flag war)) + (return 0) + ) + (when (valid-target-handle? this (process->handle arg1)) + (let ((v1-10 (min arg0 (the-as int (-> this alert-state max-level))))) + (if (< (-> this alert-state level) (the-as uint v1-10)) + (logior! (-> this alert-state flags) (squad-alert-flag update-target-search)) + ) + (set-time! (-> this alert-state start-time)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + (set! (-> this alert-state level) (the-as uint (max (the-as int (-> this alert-state level)) v1-10))) + ) + ) + 0 + ) + +;; definition for method 19 of type squad-control +(defmethod set-alert-level0 ((this squad-control) (arg0 int)) + (if (logtest? (-> this alert-state flags) (squad-alert-flag war)) + (return 0) + ) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) + 0 + ) + +;; definition for method 20 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod start-alert ((this squad-control) (arg0 int)) + (set! (-> this alert-state level) (the-as uint arg0)) + (set-time! (-> this alert-state start-time)) + (logclear! (-> this alert-state flags) (squad-alert-flag alert-ending)) + 0 + (none) + ) + +;; definition for method 21 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod set-alert-level ((this squad-control) (arg0 int)) + (set! (-> this alert-state max-level) (the-as uint arg0)) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) + 0 + (none) + ) + +;; definition for method 22 of type squad-control +(defmethod get-alert-level ((this squad-control)) + (if (logtest? (-> this alert-state flags) (squad-alert-flag war)) + (return 0) + ) + (the-as int (-> this alert-state level)) + ) + +;; definition for method 23 of type squad-control +;; WARN: Return type mismatch int vs none. +(defmethod set-alert-duration ((this squad-control) (arg0 time-frame)) + (set! (-> this alert-state duration) (the-as uint arg0)) + 0 + (none) + ) + +;; definition for method 15 of type squad-control +;; INFO: Used lq/sq +(defmethod probe-backgnd-collision ((this squad-control) (arg0 vector) (arg1 vector)) + (let ((v1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-! (-> v1-0 move-dist) arg1 arg0) + (let ((a0-4 v1-0)) + (set! (-> a0-4 radius) 2048.0) + (set! (-> a0-4 collide-with) (collide-spec backgnd)) + (set! (-> a0-4 ignore-process0) #f) + (set! (-> a0-4 ignore-process1) #f) + (set! (-> a0-4 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a0-4 action-mask) (collide-action solid)) + ) + (< (fill-and-probe-using-line-sphere *collide-cache* v1-0) 0.0) + ) + ) + +;; definition for method 16 of type squad-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod squad-control-method-16 ((this squad-control) (arg0 vector) (arg1 process-focusable) (arg2 squad-target-status)) + (cond + ((zero? (get-idx-in-status-arr this (process->handle arg1))) + (let ((s5-1 (-> this alert-state target-status-array))) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'primary-target-pos-vel 2))) + (set-pos-vel this (-> s4-0 0)) + (set! (-> s4-0 1 position quad) (-> s4-0 0 position quad)) + (logior! (-> s5-1 0 flags) (squad-target-flag updated)) + (cond + ((or (logtest? (-> s5-1 0 flags) (squad-target-flag force-visible)) + (probe-backgnd-collision this arg0 (the-as vector (-> s4-0 1))) + ) + (logior! (-> s5-1 0 flags) (squad-target-flag visible-now visible-recently visible-ever)) + (set-time! (-> s5-1 0 last-seen-time)) + (set! (-> s5-1 0 position quad) (-> s4-0 1 position quad)) + (set! (-> s5-1 0 velocity quad) (-> s4-0 0 velocity quad)) + ) + (else + (logclear! (-> s5-1 0 flags) (squad-target-flag visible-now)) + (if (time-elapsed? (-> s5-1 0 last-seen-time) (seconds 2)) + (logclear! (-> s5-1 0 flags) (squad-target-flag visible-recently)) + ) + ) + ) + ) + (mem-copy! (the-as pointer arg2) (the-as pointer s5-1) 68) + ) + 0 + ) + (else + (logior! (-> arg2 flags) (squad-target-flag visible-now visible-recently visible-ever)) + (set-time! (-> arg2 last-seen-time)) + (set! (-> arg2 position quad) (-> (get-trans arg1 3) quad)) + (set! (-> arg2 velocity quad) (-> (get-transv arg1) quad)) + ) + ) + 0 + (none) + ) + +;; definition for method 29 of type squad-control +;; WARN: Return type mismatch object vs symbol. +(defmethod valid-target-handle? ((this squad-control) (arg0 handle)) + (the-as symbol (and (handle->process arg0) (= (get-idx-in-status-arr this arg0) 0))) + ) + +;; definition for method 17 of type squad-control +;; INFO: this function exists in multiple non-identical object files +;; INFO: Used lq/sq +;; WARN: Return type mismatch squad-target-status vs none. +(defmethod squad-control-method-17 ((this squad-control) (arg0 vector) (arg1 int) (arg2 squad-target-status)) + (logclear! (-> arg2 flags) (squad-target-flag visible-now updated)) + (cond + ((or (= (-> this sync-mask-16) (ash 1 (logand arg1 15))) + (or (logtest? (-> this alert-state flags) (squad-alert-flag update-target-search)) + (< (get-idx-in-status-arr this (-> arg2 handle)) 0) + ) + ) + (logclear! (-> this alert-state flags) (squad-alert-flag update-target-search)) + (logior! (-> arg2 flags) (squad-target-flag updated)) + (let ((a2-1 (handle->process (-> arg2 handle)))) + (if a2-1 + (squad-control-method-16 this arg0 (the-as process-focusable a2-1) arg2) + ) + ) + ) + (else + (when (and (handle->process (-> arg2 handle)) (valid-target-handle? this (-> arg2 handle))) + (let ((s4-1 (-> this alert-state target-status-array))) + (when (logtest? (-> s4-1 0 flags) (squad-target-flag visible-recently)) + (let ((s3-0 (new 'stack-no-clear 'primary-target-pos-vel))) + (set-pos-vel this (the-as primary-target-pos-vel (-> s3-0 position))) + (set! (-> s4-1 0 position quad) (-> s3-0 position quad)) + (set! (-> s4-1 0 velocity quad) (-> s3-0 velocity quad)) + ) + ) + (mem-copy! (the-as pointer arg2) (the-as pointer s4-1) 68) + ) + ) + (logclear! (-> arg2 flags) (squad-target-flag updated)) + ) + ) + (none) + ) + +;; definition for method 24 of type squad-control +;; INFO: Used lq/sq +(defmethod squad-control-method-24 ((this squad-control)) + (if (not (handle->process (-> this alert-state target-status handle))) + (return 0) + ) + (let* ((s5-0 (handle->process (-> this alert-state target-status handle))) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (new 'stack-no-clear 'primary-target-pos-vel))) + (set! (-> s5-1 position quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (set! (-> s5-1 velocity quad) (-> (get-transv (the-as process-focusable s4-0)) quad)) + (set! (-> s5-1 time) (the-as uint (current-time))) + (if (>= (- (-> s5-1 time) (-> this primary-target-history 1 time)) (the-as uint 30)) + (qmem-copy->! + (the-as pointer (-> this primary-target-history 1)) + (the-as pointer (-> this primary-target-history)) + 480 + ) + ) + (mem-copy! (the-as pointer (-> this primary-target-history)) (the-as pointer (-> s5-1 position)) 32) + ) + 0 + ) + ) + 0 + ) + +;; definition for method 25 of type squad-control +;; WARN: Return type mismatch primary-target-pos-vel vs none. +(defmethod squad-control-method-25 ((this squad-control) (arg0 primary-target-pos-vel) (arg1 time-frame)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'primary-target-pos-vel 2))) + (set! (-> s5-0 0 time) (the-as uint (- (current-time) arg1))) + (let ((v1-3 0)) + (let ((a1-1 0)) + (b! #t cfg-7 :delay (nop!)) + (label cfg-1) + (b! + (not (and (>= (-> this primary-target-history a1-1 time) (-> s5-0 0 time)) + (>= (-> s5-0 0 time) (-> this primary-target-history (+ a1-1 1) time)) + ) + ) + cfg-6 + :delay (empty-form) + ) + (set! v1-3 a1-1) + (b! #t cfg-9 :delay (nop!)) + (label cfg-6) + (+! a1-1 1) + (label cfg-7) + (b! (< a1-1 14) cfg-1) + ) + (set! (-> s5-0 0 time) (-> this primary-target-history 0 time)) + (label cfg-9) + (let ((s4-0 (-> this primary-target-history v1-3)) + (s3-0 (-> this primary-target-history (+ v1-3 1))) + ) + (set! (-> s5-0 1 position x) + (/ (the float (- (-> s5-0 0 time) (-> s4-0 time))) (the float (- (-> s3-0 time) (-> s4-0 time)))) + ) + (vector-lerp! (-> arg0 position) (-> s4-0 position) (-> s3-0 position) (-> s5-0 1 position x)) + (vector-lerp! (-> arg0 velocity) (-> s4-0 velocity) (-> s3-0 velocity) (-> s5-0 1 position x)) + ) + ) + (set! (-> arg0 time) (-> s5-0 0 time)) + ) + (none) + ) + +;; definition for method 26 of type squad-control +;; INFO: Used lq/sq +(defmethod set-pos-vel ((this squad-control) (arg0 primary-target-pos-vel)) + (let* ((s4-0 (handle->process (-> this alert-state target-status handle))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-0 + (set! (-> arg0 position quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (set! (-> arg0 velocity quad) (-> (get-transv (the-as process-focusable s5-0)) quad)) + ) + ) + arg0 + ) + +;; definition for method 27 of type squad-control +;; WARN: Return type mismatch float vs none. +(defmethod squad-control-method-27 ((this squad-control) (arg0 process) (arg1 float)) + (let ((a1-4 (process->handle arg0)) + (v1-2 (-> this alert-state target-status-array)) + ) + (when (!= (-> v1-2 0 handle) a1-4) + (set! (-> v1-2 0 handle) (the-as handle a1-4)) + (set! (-> v1-2 0 flags) (squad-target-flag)) + (vector-reset! (-> v1-2 0 position)) + (vector-reset! (-> v1-2 0 velocity)) + (set! (-> v1-2 0 threat-level) arg1) + ) + ) + (none) + ) + +;; definition for method 28 of type squad-control +(defmethod get-idx-in-status-arr ((this squad-control) (arg0 handle)) + (if (not (handle->process arg0)) + (return -1) + ) + (dotimes (v1-5 3) + (if (= (-> this alert-state target-status-array v1-5 handle) arg0) + (return v1-5) + ) + ) + -1 + ) + +;; definition for method 30 of type squad-control +;; WARN: Return type mismatch process vs process-focusable. +(defmethod get-target-focus ((this squad-control)) + (let ((gp-0 (handle->process (-> this alert-state target-status handle)))) + (the-as process-focusable (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + ) + +;; definition for method 33 of type squad-control +;; WARN: Return type mismatch process vs process-focusable. +(defmethod get-focus-in-range ((this squad-control) (arg0 process-focusable)) + (let* ((f0-0 4915200.0) + (f30-0 (* f0-0 f0-0)) + (s4-0 (the-as process #f)) + ) + (dotimes (s3-0 3) + (let* ((s1-0 (handle->process (-> this alert-state target-status-array s3-0 handle))) + (s2-0 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-0 + (let ((f0-2 (vector-vector-xz-distance-squared (-> arg0 root trans) (get-trans (the-as process-focusable s2-0) 0))) + ) + (when (< f0-2 f30-0) + (set! f30-0 f0-2) + (set! s4-0 s2-0) + ) + ) + ) + ) + ) + (the-as process-focusable s4-0) + ) + ) + +;; definition for method 31 of type squad-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod squad-control-method-31 ((this squad-control) (arg0 vector) (arg1 process-focusable) (arg2 handle) (arg3 float) (arg4 float)) + (local-vars (v1-40 float) (sv-672 float) (sv-688 vector) (sv-704 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (set! sv-672 arg4) + (let ((s5-0 (get-handle-pos this arg2 (new 'stack-no-clear 'vector)))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> arg1 root trans)))) + (set! sv-688 s5-0) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 1.0) + (let ((s2-0 (new 'stack-no-clear 'squad-control-stack-type0)) + (s1-0 (the-as nav-mesh #f)) + (f30-0 sv-672) + ) + (if (and (nonzero? (-> arg1 nav)) (-> arg1 nav)) + (set! s1-0 (-> arg1 nav state mesh)) + ) + (if (not s1-0) + (set! s1-0 (find-nearest-nav-mesh sv-688 (the-as float #x7f800000))) + ) + (when s1-0 + (nav-mesh-method-10 s1-0 sv-688 sv-688 (the-as nav-poly #f)) + (set! (-> s2-0 float0) 40960.0) + (set! (-> s2-0 byte0) 2) + (vector-! (-> s2-0 vec1) sv-688 (the-as vector (-> s1-0 bounds))) + (nav-mesh-method-46 s1-0 (the-as nav-poly (-> s2-0 vec1))) + (let ((s0-1 (-> s2-0 mesh))) + (when s0-1 + (project-point-into-poly-2d s1-0 (the-as nav-poly s0-1) (-> s2-0 vec1) (-> s2-0 vec1)) + (let ((v1-18 (-> s2-0 vec1)) + (a0-9 (-> s1-0 bounds)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> v1-18 quad)) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-688 quad) vf6) + (set! sv-704 0) + (while (< sv-704 16) + (when #t + (set! (-> s2-0 float1) + (the float (sar (shl (the int (+ f30-0 (* 182.04445 (* 22.5 (the float sv-704))))) 48) 48)) + ) + (set! (-> s2-0 float2) arg3) + (vector-rotate-around-y! (-> s2-0 vec0) s3-1 (-> s2-0 float1)) + (vector-float*! (-> s2-0 vec0) (-> s2-0 vec0) (-> s2-0 float2)) + (clamp-vector-to-mesh-cross-gaps + s1-0 + (-> s2-0 vec1) + (the-as nav-poly s0-1) + (-> s2-0 vec0) + (-> s2-0 float2) + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (set! (-> s2-0 cquery start-pos quad) (-> s5-0 quad)) + (set! (-> s2-0 cquery move-dist quad) (-> s2-0 vec0 quad)) + (let ((v1-34 (-> s2-0 cquery))) + (set! (-> v1-34 radius) 2048.0) + (set! (-> v1-34 collide-with) (collide-spec backgnd)) + (set! (-> v1-34 ignore-process0) #f) + (set! (-> v1-34 ignore-process1) #f) + (set! (-> v1-34 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-34 action-mask) (collide-action solid)) + ) + (set! (-> s2-0 float3) (fill-and-probe-using-line-sphere *collide-cache* (-> s2-0 cquery))) + (if (< 0.0 (-> s2-0 float3)) + (vector-float*! (-> s2-0 vec0) (-> s2-0 vec0) (-> s2-0 float3)) + ) + (.lvf vf1 (&-> (-> s2-0 vec0) 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-40 vf1) + (let ((f0-17 v1-40) + (f1-4 (* 0.5 arg3)) + ) + (when (< (* f1-4 f1-4) f0-17) + (vector+! s5-0 s5-0 (-> s2-0 vec0)) + 0 + (goto cfg-19) + ) + ) + ) + (set! sv-704 (+ sv-704 1)) + ) + ) + ) + ) + ) + ) + (label cfg-19) + (set! (-> arg0 quad) (-> s5-0 quad)) + ) + (none) + ) + ) + +;; definition for method 32 of type squad-control +;; INFO: Used lq/sq +(defmethod get-handle-pos ((this squad-control) (arg0 handle) (arg1 vector)) + (let* ((s5-0 (handle->process arg0)) + (a0-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (new 'stack-no-clear 'vector) + (if a0-5 + (set! (-> arg1 quad) (-> (get-trans (the-as process-focusable a0-5) 0) quad)) + ) + ) + arg1 + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-hud_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-hud_REF.gc new file mode 100644 index 0000000000..ab7c5d94bb --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-hud_REF.gc @@ -0,0 +1,95 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type hud-vehicle-health +(deftype hud-vehicle-health (hud) + () + ) + +;; definition for method 3 of type hud-vehicle-health +(defmethod inspect ((this hud-vehicle-health)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-vehicle-health +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-vehicle-health)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (+ (the int (* -100.0 (-> this offset))) 5) + 366 + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 4 6) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-4 (fmax 0.0 (fmin 1.0 (-> *game-info* health-bar-vehicle))))) + (set! (-> this sprites 1 color x) (the int (* 255.0 (- 1.0 f0-4)))) + (set! (-> this sprites 1 color y) (the int (* 255.0 f0-4))) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* 20.5 f0-4)) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-vehicle-health +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-vehicle-health)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-vehicle-health +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-vehicle-health)) + (vehicle-entity-hack 27) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-2) (gui-action play) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (lookup-texture-by-name + "hud-small-vehicle-health-bar-01" + (the-as string #f) + (the-as (pointer texture-page) #f) + ) + ) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags)) + (set! (-> this sprites 0 scale-x) 1.43) + (set! (-> this sprites 0 scale-y) 1.3) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 2.5) + (set! (-> this sprites 1 color w) 48) + 0 + (none) + ) + +;; definition for function hud-vehicle-health-spawn +;; WARN: Return type mismatch process vs hud-vehicle-health. +(defun hud-vehicle-health-spawn ((arg0 vehicle)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn hud-vehicle-health :init hud-init-by-other :name "hud-vehicle-health" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as hud-vehicle-health gp-0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-manager_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-manager_REF.gc new file mode 100644 index 0000000000..dcac147763 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-manager_REF.gc @@ -0,0 +1,457 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *vehicle-rigid-body-queue*, type rigid-body-queue +(define *vehicle-rigid-body-queue* (new 'static 'rigid-body-queue)) + +;; definition for symbol *vehicle-info*, type vehicle-info +(define *vehicle-info* (new 'static 'vehicle-info)) + +;; failed to figure out what this is: +(dotimes (v1-2 44) + (set! (-> *vehicle-info* handle-by-vehicle-type v1-2) (the-as handle #f)) + ) + +;; definition for function vehicle-entity-hack +;; WARN: Return type mismatch int vs none. +(defun vehicle-entity-hack ((arg0 int)) + (with-pp + (case arg0 + ((27) + (set! (-> pp level) (the-as level (-> *traffic-info* vehicle-level))) + ) + (else + (set! (-> pp level) (level-get *level* (-> *traffic-info* vehicle-levels arg0))) + ) + ) + 0 + (none) + ) + ) + +;; definition of type vehicle-manager +(deftype vehicle-manager (process) + () + (:state-methods + idle + active + ) + (:methods + (vehicle-manager-method-16 (_type_) none) + (vehicle-manager-method-17 (_type_) none) + ) + ) + +;; definition for method 3 of type vehicle-manager +(defmethod inspect ((this vehicle-manager)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; definition for method 7 of type vehicle-manager +;; WARN: Return type mismatch process vs vehicle-manager. +(defmethod relocate ((this vehicle-manager) (offset int)) + (set! *vehicle-manager* this) + (if *vehicle-manager* + (set! *vehicle-manager* (&+ *vehicle-manager* offset)) + ) + (the-as vehicle-manager ((method-of-type process relocate) this offset)) + ) + +;; definition for method 10 of type vehicle-manager +(defmethod deactivate ((this vehicle-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set! *vehicle-manager* #f) + (remove-setting *setting-control* this 'task-mask) + (apply-settings *setting-control*) + ((method-of-type process deactivate) this) + (none) + ) + +;; definition for method 17 of type vehicle-manager +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-manager-method-17 ((this vehicle-manager)) + 0 + (none) + ) + +;; definition for function vehicle-manager-event-handler +;; WARN: Return type mismatch none vs object. +(defbehavior vehicle-manager-event-handler vehicle-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('no-extra-bank) + (remove-setting! 'extra-bank) + ) + (('extra-bank) + (let ((a3-1 (-> arg3 param 0))) + (set-setting! 'extra-bank a3-1 0.0 0) + ) + ) + ) + ) + +;; definition for function vehicle-manager-init-by-other +(defbehavior vehicle-manager-init-by-other vehicle-manager () + (stack-size-set! (-> self main-thread) 128) + (vehicle-entity-hack 27) + (set! *vehicle-manager* self) + (vehicle-manager-method-17 self) + (add-setting! 'task-mask 'clear 0.0 (task-mask vehicle)) + (set! (-> self event-hook) vehicle-manager-event-handler) + (set! *rigid-body-queue-manager* + (the-as rigid-body-queue-manager (rigid-body-queue-manager-spawn *vehicle-rigid-body-queue* self)) + ) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate idle (vehicle-manager) + :virtual #t + :event vehicle-manager-event-handler + :code (behavior () + (suspend) + (suspend) + (go-virtual active) + ) + ) + +;; failed to figure out what this is: +(defstate active (vehicle-manager) + :virtual #t + :event vehicle-manager-event-handler + :code sleep-code + ) + +;; definition for function vehicle-manager-start +;; WARN: Return type mismatch int vs none. +(defun vehicle-manager-start ((arg0 process)) + (if *vehicle-manager* + (change-parent *vehicle-manager* arg0) + (process-spawn vehicle-manager :name "vehicle-manager" :to arg0) + ) + 0 + (none) + ) + +;; definition for function vehicle-manager-kill +;; WARN: Return type mismatch symbol vs none. +(defun vehicle-manager-kill () + (kill-by-type vehicle-manager *active-pool*) + (none) + ) + +;; definition for function vehicle-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior vehicle-init-by-other vehicle ((arg0 int) (arg1 traffic-object-spawn-params)) + (stack-size-set! (-> self main-thread) 16) + (logior! (-> self mask) (process-mask vehicle)) + (init-collision! self) + (set! (-> self root trans quad) (-> arg1 position quad)) + (quaternion-copy! (-> self root quat) (-> arg1 rotation)) + (set! (-> self root transv quad) (-> arg1 velocity quad)) + (if (logtest? (-> arg1 flags) (traffic-spawn-flags tsf6)) + (vehicle-method-149 self) + ) + (if (not (logtest? (-> arg1 flags) (traffic-spawn-flags tsf0))) + (vehicle-entity-hack arg0) + ) + (init-rbody-control! self) + (rigid-body-queue-method-11 *vehicle-rigid-body-queue* self) + (if (logtest? (-> arg1 flags) (traffic-spawn-flags tsf5)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag unique) (-> self v-flags)))) + ) + (set! (-> self traffic-priority-id) (the-as int (-> arg1 id))) + (vehicle-method-132 self arg1) + ) + +;; definition for function vehicle-spawn-hack +;; WARN: Return type mismatch process vs vehicle. +(defun vehicle-spawn-hack ((arg0 type) (arg1 traffic-object-spawn-params) (arg2 process)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* arg0 #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg2 "vehicle" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-init-by-other 27 arg1) + (-> s3-0 ppointer) + ) + ) + ) + (when v1-1 + (set! gp-0 (-> v1-1 0)) + (change-parent gp-0 *vehicle-manager*) + ) + ) + (if (and gp-0 (logtest? (-> arg1 flags) (traffic-spawn-flags tsf1))) + (vehicle-method-133 (the-as vehicle gp-0)) + ) + (the-as vehicle gp-0) + ) + ) + +;; definition for function vehicle-spawn +;; WARN: Return type mismatch process vs process-drawable. +(defun vehicle-spawn ((arg0 vehicle-type) (arg1 traffic-object-spawn-params)) + (let ((gp-0 (the-as process #f))) + (cond + ((level-get *level* (-> *traffic-info* vehicle-levels arg0)) + (let* ((a1-3 (type-from-vehicle-type arg0)) + (s3-0 (get-process *default-dead-pool* a1-3 #x4000 1)) + (a0-4 (when s3-0 + (let ((t9-3 (method-of-type process activate))) + (t9-3 s3-0 *vehicle-manager* "vehicle" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-init-by-other arg0 arg1) + (-> s3-0 ppointer) + ) + ) + ) + (when a0-4 + (set! gp-0 (-> a0-4 0)) + (when (logtest? (-> arg1 flags) (traffic-spawn-flags tsf5)) + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type arg0)) 'go-die) + (set! (-> *vehicle-info* handle-by-vehicle-type arg0) (process->handle gp-0)) + ) + ) + ) + ) + (else + 0 + ) + ) + (if (and gp-0 (logtest? (-> arg1 flags) (traffic-spawn-flags tsf1))) + (vehicle-method-133 (the-as vehicle gp-0)) + ) + (the-as process-drawable gp-0) + ) + ) + +;; definition for function type-from-vehicle-type +(defun type-from-vehicle-type ((arg0 vehicle-type)) + (case arg0 + (((vehicle-type h-bike-a)) + h-bike-a + ) + (((vehicle-type h-bike-b)) + h-bike-b + ) + (((vehicle-type h-bike-c)) + h-bike-c + ) + (((vehicle-type h-bike-d)) + h-bike-d + ) + (((vehicle-type h-car-a)) + h-car-a + ) + (((vehicle-type h-car-b)) + h-car-b + ) + (((vehicle-type h-car-c)) + h-car-c + ) + (((vehicle-type h-hellcat)) + h-hellcat + ) + (((vehicle-type h-warf)) + h-warf + ) + (((vehicle-type h-glider)) + h-glider + ) + (((vehicle-type h-sled)) + h-sled + ) + (((vehicle-type h-kg-pickup)) + h-kg-pickup + ) + (((vehicle-type v-turtle)) + v-turtle + ) + (((vehicle-type v-snake)) + v-snake + ) + (((vehicle-type v-scorpion)) + v-scorpion + ) + (((vehicle-type v-toad)) + v-toad + ) + (((vehicle-type v-fox)) + v-fox + ) + (((vehicle-type v-rhino)) + v-rhino + ) + (((vehicle-type v-mirage)) + v-mirage + ) + (((vehicle-type v-x-ride)) + v-x-ride + ) + (((vehicle-type v-marauder)) + v-marauder + ) + (((vehicle-type v-faccar)) + v-faccar + ) + (((vehicle-type v-catapult)) + v-catapult + ) + (((vehicle-type v-marauder-b)) + v-marauder-b + ) + (((vehicle-type evan-test-bike)) + evan-test-bike + ) + (((vehicle-type wbike-test)) + wbike-test + ) + (((vehicle-type test-car)) + test-car + ) + (else + (the-as type #f) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/race/race-control_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-control_REF.gc new file mode 100644 index 0000000000..e562e28403 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/race/race-control_REF.gc @@ -0,0 +1,142 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type race-control +(deftype race-control (structure) + ((state race-state) + (mesh race-mesh) + (path-select int8) + (path-group race-path-group) + (path race-path) + (path-t float) + (racer-state racer-state) + (path-sample race-path-sample :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) + ) + (:methods + (race-control-method-9 (_type_ int vector) none) + (race-control-method-10 (_type_ race-state racer-state) none) + (race-control-method-11 (_type_ float) none) + (race-control-method-12 (_type_ vector) none) + ) + ) + +;; definition for method 3 of type race-control +(defmethod inspect ((this race-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-control) + (format #t "~1Tstate: #~%" (-> this state)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tpath-select: ~D~%" (-> this path-select)) + (format #t "~1Tpath-group: #~%" (-> this path-group)) + (format #t "~1Tpath: #~%" (-> this path)) + (format #t "~1Tpath-t: ~f~%" (-> this path-t)) + (format #t "~1Tracer-state: #~%" (-> this racer-state)) + (format #t "~1Tpath-sample: #~%" (-> this path-sample)) + (format #t "~1Tlin-velocity: #~%" (-> this lin-velocity)) + (format #t "~1Tang-velocity: #~%" (-> this ang-velocity)) + (label cfg-4) + this + ) + +;; definition for method 12 of type race-control +;; WARN: Return type mismatch int vs none. +(defmethod race-control-method-12 ((this race-control) (arg0 vector)) + (let* ((f0-0 (-> this path-t)) + (f0-2 (race-path-method-12 (-> this path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) + ) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) + ) + 0 + (none) + ) + +;; definition for method 11 of type race-control +;; WARN: Return type mismatch int vs none. +(defmethod race-control-method-11 ((this race-control) (arg0 float)) + (let ((f0-1 (+ (-> this path-t) (* 15.0 arg0)))) + (set! f0-1 (cond + ((logtest? (-> this mesh flags) (race-mesh-flag rmf0)) + (let ((f1-3 (the float (-> this path sample-count)))) + (if (>= f0-1 f1-3) + (set! f0-1 (- f0-1 f1-3)) + ) + ) + f0-1 + ) + (else + (fmin f0-1 (the float (+ (-> this path sample-count) -1))) + ) + ) + ) + (set! (-> this path-t) f0-1) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-1) + ) + (vector-reset! (-> this ang-velocity)) + 0 + (none) + ) + +;; definition for method 9 of type race-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod race-control-method-9 ((this race-control) (arg0 int) (arg1 vector)) + (let ((v1-1 (-> this path-group path-count))) + (if (>= arg0 v1-1) + (set! arg0 0) + ) + (set! (-> this path-select) arg0) + (cond + ((> v1-1 0) + (let ((s4-0 (-> this path-group paths arg0))) + (set! (-> this path) s4-0) + (let ((s3-0 (new 'stack-no-clear 'race-mesh-slice-query))) + (set! (-> s3-0 search-sphere quad) (-> arg1 quad)) + (set! (-> s3-0 search-sphere r) 61440.0) + (race-mesh-method-13 (-> this mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) + (when (!= (-> s3-0 slice-id) -1) + (let* ((v1-12 (-> this mesh slices (-> s3-0 slice-id))) + (f0-1 (-> (the-as (pointer float) (+ (* (-> v1-12 start-edge) 4) (the-as int (-> s4-0 edge-infos)))))) + (f1-0 (-> (the-as (pointer float) (+ (* (-> v1-12 end-edge) 4) (the-as int (-> s4-0 edge-infos)))))) + ) + (when (and (>= f0-1 0.0) (>= f1-0 0.0)) + (let ((f0-2 (race-path-method-12 s4-0 arg1 f0-1 f1-0))) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this path) #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type race-control +;; WARN: Return type mismatch int vs none. +(defmethod race-control-method-10 ((this race-control) (arg0 race-state) (arg1 racer-state)) + (set! (-> this state) arg0) + (set! (-> this mesh) (-> arg0 info mesh)) + (if (-> this mesh) + (set! (-> this path-group) (-> this mesh path-groups 0)) + ) + (set! (-> this racer-state) arg1) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/race/race-h_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-h_REF.gc new file mode 100644 index 0000000000..0cb96bd27a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/race/race-h_REF.gc @@ -0,0 +1,422 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type race-turbo-pad +(deftype race-turbo-pad (structure) + ((position vector :inline) + (handle handle) + ) + ) + +;; definition for method 3 of type race-turbo-pad +(defmethod inspect ((this race-turbo-pad)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-turbo-pad) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (label cfg-4) + this + ) + +;; definition of type race-decision-point +(deftype race-decision-point (structure) + ((pos float) + (decision-type uint8) + (shortcuts uint8) + (safe-paths uint8) + ) + ) + +;; definition for method 3 of type race-decision-point +(defmethod inspect ((this race-decision-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-decision-point) + (format #t "~1Tpos: ~f~%" (-> this pos)) + (format #t "~1Tdecision-type: ~D~%" (-> this decision-type)) + (format #t "~1Tshortcuts: ~D~%" (-> this shortcuts)) + (format #t "~1Tsafe-paths: ~D~%" (-> this safe-paths)) + (label cfg-4) + this + ) + +;; definition of type race-racer-info +(deftype race-racer-info (structure) + ((rider uint8) + (vehicle uint8) + (flags racer-info-flag) + (seek-offset int8) + ) + ) + +;; definition for method 3 of type race-racer-info +(defmethod inspect ((this race-racer-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-racer-info) + (format #t "~1Trider: ~D~%" (-> this rider)) + (format #t "~1Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tseek-offset: ~D~%" (-> this seek-offset)) + (label cfg-4) + this + ) + +;; definition of type race-info +(deftype race-info (basic) + ((race-mesh-name string) + (path-group-name string) + (task-node uint16) + (mesh race-mesh) + (ai-min-speed-factor float) + (ai-max-speed-factor float) + (ai-spread-factor float) + (start-sphere sphere :inline) + (start-dir vector :inline) + (finish-sphere sphere :inline) + (finish-dir vector :inline) + (player-intro-pos vector :inline) + (flags racer-info-flag) + (score uint8) + (lap-count int8) + (racer-count int8) + (turbo-pad-count int8) + (map-index int8) + (decision-point-count int8) + (safe-paths uint8) + (turbo-pad-array (inline-array race-turbo-pad)) + (racer-array (inline-array race-racer-info)) + (decision-point-array (inline-array race-decision-point)) + (level symbol) + (borrow-level symbol) + (borrow pair) + (manager handle) + (manager-handle-init-hack symbol :overlay-at manager) + (hatch-actor-name string) + (countdown-scene string) + (complete-continue string) + (start-camera string) + (go-speech uint16) + ) + (:methods + (race-info-method-9 () none) + ) + ) + +;; definition for method 3 of type race-info +(defmethod inspect ((this race-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Trace-mesh-name: ~A~%" (-> this race-mesh-name)) + (format #t "~1Tpath-group-name: ~A~%" (-> this path-group-name)) + (format #t "~1Ttask-node: ~D~%" (-> this task-node)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tai-min-speed-factor: ~f~%" (-> this ai-min-speed-factor)) + (format #t "~1Tai-max-speed-factor: ~f~%" (-> this ai-max-speed-factor)) + (format #t "~1Tai-spread-factor: ~f~%" (-> this ai-spread-factor)) + (format #t "~1Tstart-sphere: #~%" (-> this start-sphere)) + (format #t "~1Tstart-dir: #~%" (-> this start-dir)) + (format #t "~1Tfinish-sphere: #~%" (-> this finish-sphere)) + (format #t "~1Tfinish-dir: #~%" (-> this finish-dir)) + (format #t "~1Tplayer-intro-pos: #~%" (-> this player-intro-pos)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tscore: ~D~%" (-> this score)) + (format #t "~1Tlap-count: ~D~%" (-> this lap-count)) + (format #t "~1Tracer-count: ~D~%" (-> this racer-count)) + (format #t "~1Tturbo-pad-count: ~D~%" (-> this turbo-pad-count)) + (format #t "~1Tmap-index: ~D~%" (-> this map-index)) + (format #t "~1Tdecision-point-count: ~D~%" (-> this decision-point-count)) + (format #t "~1Tsafe-paths: ~D~%" (-> this safe-paths)) + (format #t "~1Tturbo-pad-array: #x~X~%" (-> this turbo-pad-array)) + (format #t "~1Tracer-array: #x~X~%" (-> this racer-array)) + (format #t "~1Tdecision-point-array: #x~X~%" (-> this decision-point-array)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tborrow-level: ~A~%" (-> this borrow-level)) + (format #t "~1Tborrow: ~A~%" (-> this borrow)) + (format #t "~1Tmanager: ~D~%" (-> this manager)) + (format #t "~1Tmanager-handle-init-hack: ~A~%" (-> this manager-handle-init-hack)) + (format #t "~1Thatch-actor-name: ~A~%" (-> this hatch-actor-name)) + (format #t "~1Tcountdown-scene: ~A~%" (-> this countdown-scene)) + (format #t "~1Tcomplete-continue: ~A~%" (-> this complete-continue)) + (format #t "~1Tstart-camera: ~A~%" (-> this start-camera)) + (format #t "~1Tgo-speech: ~D~%" (-> this go-speech)) + (label cfg-4) + this + ) + +;; definition of type racer-state +(deftype racer-state (structure) + ((position vector :inline) + (racer handle) + (flags racer-state-flags) + (rank int8) + (finish-count int8) + (lap-count int8) + (lap-quadrant int8) + (rider uint8) + (lap-distance float) + (lap-distance-prev float) + (pos float) + (target-pos-offset float) + (speed-factor float) + (finish-time uint32) + (lap-start uint32) + (best-lap-time uint32) + (lap-time-array float 5) + (start-position vector :inline) + ) + (:methods + (racer-state-method-9 () none) + (racer-state-method-10 () none) + (racer-state-method-11 () none) + (racer-state-method-12 () none) + (racer-state-method-13 () none) + ) + ) + +;; definition for method 3 of type racer-state +(defmethod inspect ((this racer-state)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'racer-state) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tracer: ~D~%" (-> this racer)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Trank: ~D~%" (-> this rank)) + (format #t "~1Tfinish-count: ~D~%" (-> this finish-count)) + (format #t "~1Tlap-count: ~D~%" (-> this lap-count)) + (format #t "~1Tlap-quadrant: ~D~%" (-> this lap-quadrant)) + (format #t "~1Trider: ~D~%" (-> this rider)) + (format #t "~1Tlap-distance: ~f~%" (-> this lap-distance)) + (format #t "~1Tlap-distance-prev: ~f~%" (-> this lap-distance-prev)) + (format #t "~1Tpos: ~f~%" (-> this pos)) + (format #t "~1Ttarget-pos-offset: ~f~%" (-> this target-pos-offset)) + (format #t "~1Tspeed-factor: ~f~%" (-> this speed-factor)) + (format #t "~1Tfinish-time: ~D~%" (-> this finish-time)) + (format #t "~1Tlap-start: ~D~%" (-> this lap-start)) + (format #t "~1Tbest-lap-time: ~D~%" (-> this best-lap-time)) + (format #t "~1Tlap-time-array[5] @ #x~X~%" (-> this lap-time-array)) + (format #t "~1Tstart-position: #~%" (-> this start-position)) + (label cfg-4) + this + ) + +;; definition of type race-state +(deftype race-state (structure) + ((info race-info) + (flags race-flag) + (state race-state-enum) + (racer-count int8) + (finished-count int8) + (i-player int8) + (i-countdown int8) + (manager handle) + (scene-player handle) + (race-signal handle) + (arrow handle) + (hud-timer handle) + (hud-lap-counter handle) + (hud-turbo-counter handle) + (hud-position handle) + (current-time uint32) + (countdown-start-time uint32) + (race-start-time uint32) + (rankings int8 10) + (target-pos float) + (suck-factor float) + (player-win? symbol) + (new-score? symbol) + (racer-array racer-state 10 :inline) + (player-intro-curve cubic-curve :inline) + ) + (:methods + (race-state-method-9 () none) + (race-state-method-10 () none) + (race-state-method-11 () none) + (race-state-method-12 () none) + (race-state-method-13 () none) + (race-state-method-14 () none) + (race-state-method-15 () none) + (race-state-method-16 () none) + (race-state-method-17 () none) + (race-state-method-18 () none) + (race-state-method-19 () none) + (race-state-method-20 () none) + ) + ) + +;; definition for method 3 of type race-state +(defmethod inspect ((this race-state)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-state) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tstate: ~D~%" (-> this state)) + (format #t "~1Tracer-count: ~D~%" (-> this racer-count)) + (format #t "~1Tfinished-count: ~D~%" (-> this finished-count)) + (format #t "~1Ti-player: ~D~%" (-> this i-player)) + (format #t "~1Ti-countdown: ~D~%" (-> this i-countdown)) + (format #t "~1Tmanager: #x~X~%" (-> this manager)) + (format #t "~1Tscene-player: #x~X~%" (-> this scene-player)) + (format #t "~1Trace-signal: #x~X~%" (-> this race-signal)) + (format #t "~1Tarrow: #x~X~%" (-> this arrow)) + (format #t "~1Thud-timer: #x~X~%" (-> this hud-timer)) + (format #t "~1Thud-lap-counter: #x~X~%" (-> this hud-lap-counter)) + (format #t "~1Thud-turbo-counter: #x~X~%" (-> this hud-turbo-counter)) + (format #t "~1Thud-position: #x~X~%" (-> this hud-position)) + (format #t "~1Tcurrent-time: ~D~%" (-> this current-time)) + (format #t "~1Tcountdown-start-time: ~D~%" (-> this countdown-start-time)) + (format #t "~1Trace-start-time: ~D~%" (-> this race-start-time)) + (format #t "~1Trankings[10] @ #x~X~%" (-> this rankings)) + (format #t "~1Ttarget-pos: ~f~%" (-> this target-pos)) + (format #t "~1Tsuck-factor: ~f~%" (-> this suck-factor)) + (format #t "~1Tplayer-win?: ~A~%" (-> this player-win?)) + (format #t "~1Tnew-score?: ~A~%" (-> this new-score?)) + (format #t "~1Tracer-array[10] @ #x~X~%" (-> this racer-array)) + (format #t "~1Tplayer-intro-curve: #~%" (-> this player-intro-curve)) + (label cfg-4) + this + ) + +;; definition of type race-manager +(deftype race-manager (process) + ((race-state race-state) + (state-time time-frame) + (player-on-track-time time-frame) + (message-id sound-id) + (finish-sound-id sound-id) + (show-stats? symbol) + ) + (:methods + (race-manager-method-14 () none) + (race-manager-method-15 () none) + (race-manager-method-16 () none) + (race-manager-method-17 () none) + (race-manager-method-18 () none) + (race-manager-method-19 () none) + (race-manager-method-20 () none) + (race-manager-method-21 () none) + (race-manager-method-22 () none) + (race-manager-method-23 () none) + (race-manager-method-24 () none) + (race-manager-method-25 () none) + (race-manager-method-26 () none) + (race-manager-method-27 () none) + ) + ) + +;; definition for method 3 of type race-manager +(defmethod inspect ((this race-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Trace-state: #~%" (-> this race-state)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tplayer-on-track-time: ~D~%" (-> this player-on-track-time)) + (format #t "~2Tmessage-id: ~D~%" (-> this message-id)) + (format #t "~2Tfinish-sound-id: ~D~%" (-> this finish-sound-id)) + (format #t "~2Tshow-stats?: ~A~%" (-> this show-stats?)) + (label cfg-4) + this + ) + +;; definition of type hud-race-timer +(deftype hud-race-timer (hud) + () + ) + +;; definition for method 3 of type hud-race-timer +(defmethod inspect ((this hud-race-timer)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type hud-race-lap-counter +(deftype hud-race-lap-counter (hud) + () + ) + +;; definition for method 3 of type hud-race-lap-counter +(defmethod inspect ((this hud-race-lap-counter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type hud-race-turbo-counter +(deftype hud-race-turbo-counter (hud) + () + ) + +;; definition for method 3 of type hud-race-turbo-counter +(defmethod inspect ((this hud-race-turbo-counter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type hud-race-position +(deftype hud-race-position (hud) + () + ) + +;; definition for method 3 of type hud-race-position +(defmethod inspect ((this hud-race-position)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *race-manager*, type (pointer race-manager) +(define *race-manager* (the-as (pointer race-manager) #f)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc new file mode 100644 index 0000000000..b7fd293bab --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc @@ -0,0 +1,987 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type race-mesh-hash-search +(deftype race-mesh-hash-search (structure) + ((best-dist float) + (debug-cells-searched int32) + (debug-slices-searched int32) + (bounds bounding-box4w :inline) + (cell-quads vector 2 :inline) + (slice-quads vector 4 :inline) + (cell-bits vector16ub 2 :inline :overlay-at cell-quads) + (slice-bits vector16ub 2 :inline :overlay-at slice-quads) + ) + ) + +;; definition for method 3 of type race-mesh-hash-search +(defmethod inspect ((this race-mesh-hash-search)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-mesh-hash-search) + (format #t "~1Tbest-dist: ~f~%" (-> this best-dist)) + (format #t "~1Tdebug-cells-searched: ~D~%" (-> this debug-cells-searched)) + (format #t "~1Tdebug-slices-searched: ~D~%" (-> this debug-slices-searched)) + (format #t "~1Tbounds: #~%" (-> this bounds)) + (format #t "~1Tcell-quads[2] @ #x~X~%" (-> this cell-quads)) + (format #t "~1Tslice-quads[4] @ #x~X~%" (-> this slice-quads)) + (format #t "~1Tcell-bits[2] @ #x~X~%" (-> this cell-quads)) + (format #t "~1Tslice-bits[2] @ #x~X~%" (-> this slice-quads)) + (label cfg-4) + this + ) + +;; definition of type race-mesh-slice-query +(deftype race-mesh-slice-query (structure) + ((slice-id int16) + (lap-dist float) + (pt-on-slice vector :inline) + (slice-corners vector 4 :inline) + (search-sphere sphere :inline) + ) + ) + +;; definition for method 3 of type race-mesh-slice-query +(defmethod inspect ((this race-mesh-slice-query)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-mesh-slice-query) + (format #t "~1Tslice-id: ~D~%" (-> this slice-id)) + (format #t "~1Tlap-dist: ~f~%" (-> this lap-dist)) + (format #t "~1Tpt-on-slice: #~%" (-> this pt-on-slice)) + (format #t "~1Tslice-corners[4] @ #x~X~%" (-> this slice-corners)) + (format #t "~1Tsearch-sphere: #~%" (-> this search-sphere)) + (label cfg-4) + this + ) + +;; definition of type race-path-edge-info +(deftype race-path-edge-info (structure) + ((sample-t float) + ) + ) + +;; definition for method 3 of type race-path-edge-info +(defmethod inspect ((this race-path-edge-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-path-edge-info) + (format #t "~1Tsample-t: ~f~%" (-> this sample-t)) + (label cfg-4) + this + ) + +;; definition of type race-path-sample +(deftype race-path-sample (structure) + ((bytes uint8 32) + (pos vector :inline :overlay-at (-> bytes 0)) + (quat quaternion :inline :overlay-at (-> bytes 16)) + (stick-x int8 :overlay-at (-> bytes 12)) + (stick-y int8 :overlay-at (-> bytes 13)) + (throttle uint8 :overlay-at (-> bytes 14)) + (flags uint8 :overlay-at (-> bytes 15)) + ) + ) + +;; definition for method 3 of type race-path-sample +(defmethod inspect ((this race-path-sample)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-path-sample) + (format #t "~1Tbytes[32] @ #x~X~%" (-> this pos)) + (format #t "~1Tpos: ~`vector`P~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tstick-x: ~D~%" (-> this stick-x)) + (format #t "~1Tstick-y: ~D~%" (-> this stick-y)) + (format #t "~1Tthrottle: ~D~%" (-> this throttle)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition of type race-path +(deftype race-path (structure) + ((sample-count uint16) + (record-id int8) + (pad uint8) + (samples (inline-array race-path-sample)) + (edge-infos (inline-array race-path-edge-info)) + ) + (:methods + (draw-path-debug (_type_ rgba rgba) none) + (race-path-method-10 (_type_ vector float float) none) + (race-path-method-11 (_type_ race-path-sample vector float) none) + (race-path-method-12 (_type_ vector float float) float) + ) + ) + +;; definition for method 3 of type race-path +(defmethod inspect ((this race-path)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-path) + (format #t "~1Tsample-count: ~D~%" (-> this sample-count)) + (format #t "~1Trecord-id: ~D~%" (-> this record-id)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (format #t "~1Tsamples: #x~X~%" (-> this samples)) + (format #t "~1Tedge-infos: #x~X~%" (-> this edge-infos)) + (label cfg-4) + this + ) + +;; definition of type race-path-group +(deftype race-path-group (structure) + ((name string) + (path-count int8) + (pad uint8 3) + (paths (inline-array race-path)) + ) + ) + +;; definition for method 3 of type race-path-group +(defmethod inspect ((this race-path-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-path-group) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tpath-count: ~D~%" (-> this path-count)) + (format #t "~1Tpad[3] @ #x~X~%" (-> this pad)) + (format #t "~1Tpaths: #x~X~%" (-> this paths)) + (label cfg-4) + this + ) + +;; definition of type race-mesh-edge +(deftype race-mesh-edge (structure) + ((left vector :inline) + (right vector :inline) + (lap-dist float :overlay-at (-> left data 3)) + ) + ) + +;; definition for method 3 of type race-mesh-edge +(defmethod inspect ((this race-mesh-edge)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-mesh-edge) + (format #t "~1Tleft: ~`vector`P~%" (-> this left)) + (format #t "~1Tright: ~`vector`P~%" (-> this right)) + (format #t "~1Tlap-dist: ~f~%" (-> this left w)) + (label cfg-4) + this + ) + +;; definition of type race-mesh-slice +(deftype race-mesh-slice (structure) + ((edge-index-array uint16 2) + (start-edge int16 :overlay-at (-> edge-index-array 0)) + (end-edge int16 :overlay-at (-> edge-index-array 1)) + ) + :pack-me + ) + +;; definition for method 3 of type race-mesh-slice +(defmethod inspect ((this race-mesh-slice)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-mesh-slice) + (format #t "~1Tedge-index-array[2] @ #x~X~%" (-> this edge-index-array)) + (format #t "~1Tstart-edge: ~D~%" (-> this start-edge)) + (format #t "~1Tend-edge: ~D~%" (-> this end-edge)) + (label cfg-4) + this + ) + +;; definition of type race-mesh-hash-cell +(deftype race-mesh-hash-cell (structure) + ((first-slice int16) + (slice-count uint8) + (pad uint8) + ) + ) + +;; definition for method 3 of type race-mesh-hash-cell +(defmethod inspect ((this race-mesh-hash-cell)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-mesh-hash-cell) + (format #t "~1Tfirst-slice: ~D~%" (-> this first-slice)) + (format #t "~1Tslice-count: ~D~%" (-> this slice-count)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (label cfg-4) + this + ) + +;; definition of type race-mesh-hash +(deftype race-mesh-hash (structure) + ((cells-wide int8) + (cells-tall int8) + (cell-length float) + (cells (inline-array race-mesh-hash-cell)) + (slice-table (inline-array race-mesh-slice)) + (origin vector :inline) + ) + ) + +;; definition for method 3 of type race-mesh-hash +(defmethod inspect ((this race-mesh-hash)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'race-mesh-hash) + (format #t "~1Tcells-wide: ~D~%" (-> this cells-wide)) + (format #t "~1Tcells-tall: ~D~%" (-> this cells-tall)) + (format #t "~1Tcell-length: ~f~%" (-> this cell-length)) + (format #t "~1Tcells: #x~X~%" (-> this cells)) + (format #t "~1Tslice-table: #x~X~%" (-> this slice-table)) + (format #t "~1Torigin: ~`vector`P~%" (-> this origin)) + (label cfg-4) + this + ) + +;; definition of type race-mesh +(deftype race-mesh (basic) + ((version uint8) + (path-group-count uint8) + (flags race-mesh-flag) + (pad uint8 1) + (slice-count int16) + (edge-count int16) + (slices (inline-array race-mesh-slice)) + (edges (inline-array race-mesh-edge)) + (hash race-mesh-hash) + (path-groups (inline-array race-path-group)) + ) + (:methods + (debug-draw-path (_type_ int int rgba rgba) none) + (debug-draw-path-from-history (_type_ int int) symbol) + (debug-draw-slice (_type_ int) none) + (debug-draw-edges (_type_) none) + (race-mesh-method-13 (_type_ race-mesh-slice-query) none) + (race-mesh-method-14 (_type_ race-mesh-slice-query) none) + (race-mesh-method-15 (_type_ int race-mesh-slice-query) none) + (race-mesh-method-16 (_type_ race-mesh-slice-query) none) + (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol) + (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none) + (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol) + ) + ) + +;; definition for method 3 of type race-mesh +(defmethod inspect ((this race-mesh)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tversion: ~D~%" (-> this version)) + (format #t "~1Tpath-group-count: ~D~%" (-> this path-group-count)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tpad[1] @ #x~X~%" (-> this pad)) + (format #t "~1Tslice-count: ~D~%" (-> this slice-count)) + (format #t "~1Tedge-count: ~D~%" (-> this edge-count)) + (format #t "~1Tslices: #x~X~%" (-> this slices)) + (format #t "~1Tedges: #x~X~%" (-> this edges)) + (format #t "~1Thash: #~%" (-> this hash)) + (format #t "~1Tpath-groups: #x~X~%" (-> this path-groups)) + (label cfg-4) + this + ) + +;; definition for method 10 of type race-path +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod race-path-method-10 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) + (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) + (a3-1 (the int arg1)) + ) + (set! (-> v1-0 0 quad) (-> this samples a3-1 pos quad)) + (set! (-> v1-0 1 quad) (-> this samples (+ a3-1 1) pos quad)) + (let ((f0-3 (- arg1 (the float a3-1)))) + (vector-lerp! arg0 (-> v1-0 0) (-> v1-0 1) f0-3) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type race-path +;; WARN: Return type mismatch int vs none. +(defmethod race-path-method-11 ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'race-path-sample 6))) + (let ((f0-1 (the float (-> this sample-count)))) + (if (< f0-1 arg2) + (set! arg2 (- arg2 f0-1)) + ) + (if (< arg2 0.0) + (set! arg2 (+ arg2 f0-1)) + ) + ) + (let ((s1-0 (the int arg2))) + (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> this samples s1-0)) 32) + (mem-copy! (the-as pointer (-> gp-0 1)) (the-as pointer (-> this samples (+ s1-0 1))) 32) + (let ((v1-7 (+ s1-0 2))) + (if (< (the-as int (-> this sample-count)) v1-7) + (set! v1-7 (- v1-7 (the-as int (-> this sample-count)))) + ) + (mem-copy! (the-as pointer (-> gp-0 2)) (the-as pointer (-> this samples v1-7)) 32) + ) + (let ((f30-0 (- arg2 (the float s1-0)))) + (vector-lerp! (-> arg0 pos) (the-as vector (-> gp-0 0)) (the-as vector (-> gp-0 1)) f30-0) + (quaternion-slerp! (-> arg0 quat) (-> gp-0 0 quat) (-> gp-0 1 quat) f30-0) + (set! (-> arg0 stick-x) + (the int (+ 0.5 (* (the float (-> gp-0 1 stick-x)) f30-0) (* (the float (-> gp-0 0 stick-x)) (- 1.0 f30-0)))) + ) + (set! (-> arg0 stick-y) (-> gp-0 0 stick-y)) + (set! (-> arg0 throttle) + (the-as + uint + (the int + (+ 0.5 (* (the float (-> gp-0 1 throttle)) f30-0) (* (the float (-> gp-0 0 throttle)) (- 1.0 f30-0))) + ) + ) + ) + (set! (-> arg0 flags) (-> gp-0 0 flags)) + (vector-! (the-as vector (-> gp-0 4)) (the-as vector (-> gp-0 1)) (the-as vector (-> gp-0 0))) + (vector-float*! (the-as vector (-> gp-0 3)) (the-as vector (-> gp-0 4)) 15.0) + (vector-! (the-as vector (-> gp-0 4)) (the-as vector (-> gp-0 2)) (the-as vector (-> gp-0 1))) + (vector-float*! (the-as vector (-> gp-0 3 quat)) (the-as vector (-> gp-0 4)) 15.0) + (vector-lerp! arg1 (the-as vector (-> gp-0 3)) (the-as vector (-> gp-0 3 quat)) f30-0) + ) + ) + ) + 0 + 0 + (none) + ) + +;; definition for method 12 of type race-path +(defmethod race-path-method-12 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) + (local-vars (v1-15 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 arg2) + (s4-0 (new 'stack-no-clear 'matrix)) + (f30-0 (the float (-> this sample-count))) + ) + (if (< f30-0 gp-0) + (set! gp-0 (- gp-0 f30-0)) + ) + (if (< arg1 0.0) + (set! arg1 (+ arg1 f30-0)) + ) + (race-path-method-10 this (-> s4-0 rvec) arg1 arg2) + (race-path-method-10 this (-> s4-0 uvec) gp-0 arg2) + (vector-! (-> s4-0 fvec) (-> s4-0 uvec) (-> s4-0 rvec)) + (vector-! (-> s4-0 trans) arg0 (-> s4-0 rvec)) + (let ((f0-7 0.0) + (f1-1 1.0) + (f2-1 (vector-dot (-> s4-0 fvec) (-> s4-0 trans))) + ) + (.lvf vf1 (&-> (-> s4-0 fvec) 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-15 vf1) + (let ((f0-8 (fmax f0-7 (fmin f1-1 (/ f2-1 v1-15))))) + (if (< gp-0 arg1) + (set! gp-0 (+ gp-0 f30-0)) + ) + (let ((f0-10 (+ (* arg1 (- 1.0 f0-8)) (* gp-0 f0-8)))) + (if (< f30-0 f0-10) + (set! f0-10 (- f0-10 f30-0)) + ) + (if (< f0-10 0.0) + (+! f0-10 f30-0) + ) + f0-10 + ) + ) + ) + ) + ) + ) + +;; definition for method 9 of type race-path +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-path-debug ((this race-path) (arg0 rgba) (arg1 rgba)) + (local-vars (sv-32 vector) (sv-48 race-path-sample)) + (let ((s0-0 0) + (s3-0 1) + (s2-0 (+ (-> this sample-count) -1)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (set! sv-32 s1-0) + (let ((v1-1 (-> (math-camera-pos) quad))) + (set! (-> sv-32 quad) v1-1) + ) + (while (< s0-0 (the-as int s2-0)) + (let ((s0-1 (-> this samples s0-0))) + (set! sv-48 (-> this samples s3-0)) + (let ((f0-0 (vector-vector-distance-squared (-> s0-1 pos) s1-0)) + (f1-0 819200.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (add-debug-line #t (bucket-id debug) (-> s0-1 pos) (-> sv-48 pos) arg0 #f arg1) + ) + ) + ) + (set! s0-0 s3-0) + (set! s3-0 (min (+ s3-0 1) (the-as int s2-0))) + ) + ) + (format + *stdcon* + "path ~d time ~5,,3f~%" + (-> this record-id) + (* 0.06666667 (the float (-> this sample-count))) + ) + 0 + (none) + ) + +;; definition for method 9 of type race-mesh +(defmethod debug-draw-path ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) + (if (< arg0 (-> v1-2 path-count)) + (draw-path-debug (-> v1-2 paths arg0) arg2 arg3) + ) + ) + ) + (none) + ) + +;; definition for method 10 of type race-mesh +(defmethod debug-draw-path-from-history ((this race-mesh) (arg0 int) (arg1 int)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) + (countdown (a2-1 (-> v1-2 path-count)) + (let ((a0-3 (-> v1-2 paths a2-1))) + (when (= (-> a0-3 record-id) arg0) + (let ((v1-3 (new 'static 'array rgba 16 + (new 'static 'rgba :r #x40 :a #x80) + (new 'static 'rgba :r #xff :g #x30 :b #x30 :a #x80) + (new 'static 'rgba :g #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #xff :g #xff :a #x80) + (new 'static 'rgba :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + (new 'static 'rgba :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + ) + (a2-2 (* arg0 2)) + ) + (draw-path-debug a0-3 (-> v1-3 a2-2) (-> v1-3 (+ a2-2 1))) + ) + (return #f) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 11 of type race-mesh +;; WARN: Return type mismatch symbol vs none. +(defmethod debug-draw-slice ((this race-mesh) (arg0 int)) + (let* ((v1-1 (-> this slices arg0)) + (s3-0 (-> this edges (-> v1-1 start-edge))) + (s4-0 (-> this edges (-> v1-1 end-edge))) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s3-0 left) + (-> s3-0 right) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s3-0 right) + (-> s4-0 right) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 right) + (-> s4-0 left) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 left) + (-> s3-0 left) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + #f + (the-as rgba -1) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector+! s5-0 (-> s3-0 left) (-> s3-0 right)) + (vector+! s5-0 s5-0 (-> s4-0 left)) + (vector+! s5-0 s5-0 (-> s4-0 right)) + (vector-float*! s5-0 s5-0 0.25) + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-0 577) + ) + (format (clear *temp-string*) "~D" arg0) + (s4-1 s3-1 (the-as bucket-id s2-0) *temp-string* s5-0 (font-color white) (the-as vector2h #f)) + ) + ) + ) + (none) + ) + +;; definition for method 12 of type race-mesh +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-edges ((this race-mesh)) + (let ((s5-0 0) + (s4-0 (+ (-> this slice-count) -1)) + ) + (while (>= s4-0 s5-0) + (let* ((v1-2 (-> this slices s5-0)) + (s3-0 (-> this edges (-> v1-2 start-edge))) + (s2-0 (-> this edges (-> v1-2 end-edge))) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 left) (-> s2-0 left) *color-white* #f (the-as rgba -1)) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> s3-0 right) + (-> s2-0 right) + *color-white* + #f + (the-as rgba -1) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s2-0 left) (-> s2-0 right) *color-gray* #f (the-as rgba -1)) + ) + (+! s5-0 1) + ) + ) + (let ((v1-8 (-> this edges 0))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> v1-8 left) + (-> v1-8 right) + *color-green* + #f + (the-as rgba -1) + ) + ) + (let ((s5-1 (+ (-> this edge-count) -1))) + (let ((v1-12 (-> this edges s5-1))) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> v1-12 left) + (-> v1-12 right) + *color-red* + #f + (the-as rgba -1) + ) + ) + (format *stdcon* "edge-count ~d last-edge ~d~%" (-> this edge-count) s5-1) + ) + 0 + (none) + ) + +;; definition for method 19 of type race-mesh +;; INFO: Used lq/sq +(defmethod race-mesh-method-19 ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) + (set! (-> arg1 slice-id) -1) + (let* ((v1-2 (-> this slices arg0)) + (a1-3 (-> this edges (-> v1-2 start-edge))) + (v1-5 (-> this edges (-> v1-2 end-edge))) + ) + (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) + (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) + (set! (-> arg1 slice-corners 2 quad) (-> v1-5 right quad)) + (set! (-> arg1 slice-corners 3 quad) (-> v1-5 left quad)) + ) + (let ((v1-8 (new 'stack-no-clear 'vector)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (countdown (a1-8 4) + (vector-! a0-6 (-> arg1 slice-corners (logand (+ a1-8 1) 3)) (-> arg1 slice-corners a1-8)) + (vector-! v1-8 (the-as vector (-> arg1 search-sphere)) (-> arg1 slice-corners a1-8)) + (if (< (- (* (-> a0-6 z) (-> v1-8 x)) (* (-> a0-6 x) (-> v1-8 z))) 0.0) + (return #f) + ) + ) + ) + (let ((v1-11 (new 'stack-no-clear 'vector)) + (a0-7 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-11 (-> arg1 slice-corners 2) (the-as vector (-> arg1 slice-corners))) + (vector-! a0-7 (the-as vector (-> arg1 search-sphere)) (the-as vector (-> arg1 slice-corners))) + (let ((f0-5 (- (* (-> v1-11 z) (-> a0-7 x)) (* (-> v1-11 x) (-> a0-7 z)))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((< f0-5 0.0) + (vector-! s4-0 (-> arg1 slice-corners 1) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s3-0 s4-0 v1-11) + ) + (else + (vector-! s4-0 (-> arg1 slice-corners 3) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s3-0 v1-11 s4-0) + ) + ) + (vector-normalize! s3-0 1.0) + (set-vector! s4-0 0.0 -1.0 0.0 1.0) + (let ((f0-10 (intersect-ray-plane (-> arg1 search-sphere) s4-0 (the-as vector (-> arg1 slice-corners)) s3-0))) + (vector+float*! (-> arg1 pt-on-slice) (the-as vector (-> arg1 search-sphere)) s4-0 f0-10) + ) + ) + ) + (if (< (- (-> arg1 search-sphere y) (-> arg1 pt-on-slice y)) -8192.0) + (return #f) + ) + (set! (-> arg1 slice-id) arg0) + #t + ) + +;; definition for method 17 of type race-mesh +(defmethod race-mesh-method-17 ((this race-mesh) (arg0 race-mesh-slice-query)) + (set! (-> arg0 slice-id) -1) + (let* ((s4-0 (-> this hash)) + (v1-2 (max 0 (min + (the int (/ (- (-> arg0 search-sphere x) (-> s4-0 origin x)) (-> s4-0 cell-length))) + (+ (-> s4-0 cells-wide) -1) + ) + ) + ) + (a0-4 (max 0 (min + (the int (/ (- (-> arg0 search-sphere z) (-> s4-0 origin z)) (-> s4-0 cell-length))) + (+ (-> s4-0 cells-tall) -1) + ) + ) + ) + (s3-0 (the-as object (+ (the-as uint (-> s4-0 cells)) (* (+ (* a0-4 (-> s4-0 cells-wide)) v1-2) 4)))) + (s1-0 (-> (the-as race-mesh-hash-cell s3-0) slice-count)) + ) + (when (nonzero? s1-0) + (let ((s2-0 (new 'stack-no-clear 'race-mesh-slice-query))) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg0) 112) + (while (nonzero? s1-0) + (+! s1-0 -1) + (let ((a1-7 (-> (&-> (-> s4-0 slice-table) 0 edge-index-array (+ (-> (the-as (pointer int16) s3-0)) s1-0)) 0))) + (when (race-mesh-method-19 this (the-as int a1-7) s2-0) + (if (or (= (-> arg0 slice-id) -1) + (< (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> arg0 search-sphere)) + (vector-vector-distance-squared (-> arg0 pt-on-slice) (-> arg0 search-sphere)) + ) + ) + (mem-copy! (the-as pointer arg0) (the-as pointer s2-0) 112) + ) + ) + ) + ) + ) + #f + ) + ) + ) + +;; definition for method 15 of type race-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod race-mesh-method-15 ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) + (local-vars (v1-8 symbol)) + (set! (-> arg1 slice-id) arg0) + (let* ((v1-1 (-> this slices arg0)) + (a1-3 (-> this edges (-> v1-1 start-edge))) + (v1-4 (-> this edges (-> v1-1 end-edge))) + ) + (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) + (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) + (set! (-> arg1 slice-corners 2 quad) (-> v1-4 right quad)) + (set! (-> arg1 slice-corners 3 quad) (-> v1-4 left quad)) + ) + (let ((v1-7 (new 'stack-no-clear 'vector)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (countdown (a1-8 4) + (vector-! a0-6 (-> arg1 slice-corners (logand (+ a1-8 1) 3)) (-> arg1 slice-corners a1-8)) + (vector-! v1-7 (the-as vector (-> arg1 search-sphere)) (-> arg1 slice-corners a1-8)) + (when (< (- (* (-> a0-6 z) (-> v1-7 x)) (* (-> a0-6 x) (-> v1-7 z))) 0.0) + (set! v1-8 #f) + (goto cfg-6) + ) + ) + ) + (set! v1-8 #t) + (label cfg-6) + (cond + (v1-8 + (let ((v1-11 (new 'stack-no-clear 'vector)) + (a0-7 (new 'stack-no-clear 'vector)) + ) + (vector-! v1-11 (-> arg1 slice-corners 2) (the-as vector (-> arg1 slice-corners))) + (vector-! a0-7 (the-as vector (-> arg1 search-sphere)) (the-as vector (-> arg1 slice-corners))) + (let ((f0-5 (- (* (-> v1-11 z) (-> a0-7 x)) (* (-> v1-11 x) (-> a0-7 z)))) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((< f0-5 0.0) + (vector-! s5-0 (-> arg1 slice-corners 1) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s4-0 s5-0 v1-11) + ) + (else + (vector-! s5-0 (-> arg1 slice-corners 3) (the-as vector (-> arg1 slice-corners))) + (vector-cross! s4-0 v1-11 s5-0) + ) + ) + (vector-normalize! s4-0 1.0) + (set-vector! s5-0 0.0 -1.0 0.0 1.0) + (let ((f0-10 (intersect-ray-plane (-> arg1 search-sphere) s5-0 (the-as vector (-> arg1 slice-corners)) s4-0))) + (vector+float*! (-> arg1 pt-on-slice) (the-as vector (-> arg1 search-sphere)) s5-0 f0-10) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f30-0 -1.0) + ) + (countdown (s4-1 4) + (let ((f0-11 (vector-segment-distance-point! + (-> arg1 search-sphere) + (-> arg1 slice-corners s4-1) + (-> arg1 slice-corners (logand (+ s4-1 1) 3)) + s5-1 + ) + ) + ) + (when (or (< f30-0 0.0) (< f0-11 f30-0)) + (set! f30-0 f0-11) + (set! (-> arg1 pt-on-slice quad) (-> s5-1 quad)) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 18 of type race-mesh +;; WARN: Return type mismatch symbol vs none. +(defmethod race-mesh-method-18 ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) + (let* ((v1-3 (+ (* arg2 (-> this hash cells-wide)) arg1)) + (a0-1 (/ v1-3 8)) + (a1-2 (ash 1 (logand v1-3 7))) + (a2-4 (-> (the-as race-mesh-hash-search (+ a0-1 (the-as int arg0))) cell-bits 0 data 0)) + ) + (when (not (logtest? a2-4 a1-2)) + (set! (-> arg0 cell-bits 0 data a0-1) (logior a2-4 a1-2)) + (let* ((v1-5 (the-as object (+ (the-as uint (-> this hash cells)) (* v1-3 4)))) + (s3-0 (&-> (-> this hash slice-table) 0 edge-index-array (-> (the-as (pointer int16) v1-5)))) + (s1-0 (-> (the-as race-mesh-hash-cell v1-5) slice-count)) + ) + (when (nonzero? s1-0) + (let ((s2-0 (new 'stack-no-clear 'race-mesh-slice-query))) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg3) 112) + (while (nonzero? s1-0) + (+! s1-0 -1) + (let* ((a1-7 (-> s3-0 0)) + (v1-6 (shr a1-7 3)) + (a0-10 (ash 1 (the-as int (logand a1-7 7)))) + (a2-9 (-> arg0 slice-bits 0 data v1-6)) + ) + (when (not (logtest? a2-9 a0-10)) + (set! (-> arg0 slice-bits 0 data v1-6) (logior a2-9 a0-10)) + (race-mesh-method-15 this (the-as int a1-7) s2-0) + (let ((f0-0 (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> arg3 search-sphere)))) + (when (or (= (-> arg3 slice-id) -1) (< f0-0 (-> arg0 best-dist))) + (set! (-> arg0 best-dist) f0-0) + (mem-copy! (the-as pointer arg3) (the-as pointer s2-0) 112) + ) + ) + ) + ) + (set! s3-0 (&-> s3-0 1)) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 16 of type race-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod race-mesh-method-16 ((this race-mesh) (arg0 race-mesh-slice-query)) + (set! (-> arg0 slice-id) -1) + (let ((s4-0 (-> this hash)) + (s3-0 (new 'stack-no-clear 'race-mesh-hash-search)) + ) + (let ((v1-3 (/ (+ (-> this slice-count) 127) 128))) + (when (< 4 v1-3) + (break!) + 0 + ) + (while (nonzero? v1-3) + (+! v1-3 -1) + (set! (-> s3-0 slice-bits v1-3 quad) (the-as uint128 0)) + ) + ) + (set! (-> s3-0 cell-bits 0 quad) (the-as uint128 0)) + (set! (-> s3-0 cell-bits 1 quad) (the-as uint128 0)) + (let ((f0-1 (/ 1.0 (-> s4-0 cell-length))) + (f1-2 (fmin (-> arg0 search-sphere r) (* 0.5 (-> s4-0 cell-length)))) + ) + (let ((f3-1 (- (-> arg0 search-sphere x) f1-2)) + (f2-4 (- (-> arg0 search-sphere z) f1-2)) + ) + (set! (-> s3-0 bounds min x) + (max 0 (min (the int (* (- f3-1 (-> s4-0 origin x)) f0-1)) (+ (-> s4-0 cells-wide) -1))) + ) + (set! (-> s3-0 bounds min z) + (max 0 (min (the int (* (- f2-4 (-> s4-0 origin z)) f0-1)) (+ (-> s4-0 cells-tall) -1))) + ) + ) + (let ((f2-9 (+ (-> arg0 search-sphere x) f1-2)) + (f1-3 (+ (-> arg0 search-sphere z) f1-2)) + ) + (set! (-> s3-0 bounds max x) + (max 0 (min (the int (* (- f2-9 (-> s4-0 origin x)) f0-1)) (+ (-> s4-0 cells-wide) -1))) + ) + (set! (-> s3-0 bounds max z) + (max 0 (min (the int (* (- f1-3 (-> s4-0 origin z)) f0-1)) (+ (-> s4-0 cells-tall) -1))) + ) + ) + ) + (let ((s2-0 (-> s3-0 bounds min z))) + (until (< (-> s3-0 bounds max z) s2-0) + (let ((s1-0 (-> s3-0 bounds min x))) + (until (< (-> s3-0 bounds max x) s1-0) + (race-mesh-method-18 this s3-0 s1-0 s2-0 arg0) + (+! s1-0 1) + ) + ) + (+! s2-0 1) + ) + ) + (when (and (= (-> arg0 slice-id) -1) (< (* 0.5 (-> s4-0 cell-length)) (-> arg0 search-sphere r))) + (while (= (-> arg0 slice-id) -1) + (set! (-> s3-0 bounds min x) (max 0 (+ (-> s3-0 bounds min x) -1))) + (set! (-> s3-0 bounds min z) (max 0 (+ (-> s3-0 bounds min z) -1))) + (set! (-> s3-0 bounds max x) (min (+ (-> s3-0 bounds max x) 1) (+ (-> s4-0 cells-wide) -1))) + (set! (-> s3-0 bounds max z) (min (+ (-> s3-0 bounds max z) 1) (+ (-> s4-0 cells-tall) -1))) + (let ((s2-1 (-> s3-0 bounds min x))) + (until (< (-> s3-0 bounds max x) s2-1) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds min z) arg0) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds max z) arg0) + (+! s2-1 1) + ) + ) + (let ((s2-2 (-> s3-0 bounds min z))) + (until (< (-> s3-0 bounds max z) s2-2) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds min x) s2-2 arg0) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds max x) s2-2 arg0) + (+! s2-2 1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type race-mesh +;; WARN: Return type mismatch float vs none. +(defmethod race-mesh-method-14 ((this race-mesh) (arg0 race-mesh-slice-query)) + (let* ((f30-0 (vector-line-distance-point! + (-> arg0 pt-on-slice) + (the-as vector (-> arg0 slice-corners)) + (-> arg0 slice-corners 1) + (the-as vector #f) + ) + ) + (f1-0 (vector-line-distance-point! + (-> arg0 pt-on-slice) + (-> arg0 slice-corners 2) + (-> arg0 slice-corners 3) + (the-as vector #f) + ) + ) + (f0-0 (+ f30-0 f1-0)) + (v1-1 (-> this slices (-> arg0 slice-id))) + (f2-0 (-> this edges (-> v1-1 start-edge) left w)) + (f3-0 (-> this edges (-> v1-1 end-edge) left w)) + ) + (set! (-> arg0 lap-dist) (+ (* (/ f1-0 f0-0) f2-0) (* (/ f30-0 f0-0) f3-0))) + ) + (none) + ) + +;; definition for method 13 of type race-mesh +;; WARN: Return type mismatch int vs none. +(defmethod race-mesh-method-13 ((this race-mesh) (arg0 race-mesh-slice-query)) + (race-mesh-method-17 this arg0) + (if (and (= (-> arg0 slice-id) -1) (< 0.0 (-> arg0 search-sphere r))) + (race-mesh-method-16 this arg0) + ) + (when (!= (-> arg0 slice-id) -1) + (race-mesh-method-14 this arg0) + 0 + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc new file mode 100644 index 0000000000..8b4cec1548 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc @@ -0,0 +1,305 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type w-parking-spot +(deftype w-parking-spot (process-drawable) + ((vehicle handle) + (should-spawn? symbol) + (should-cleanup? symbol) + (v-type game-vehicle-u8) + (minimap connection-minimap) + (test-sphere sphere :inline) + (arrow handle) + ) + (:state-methods + idle + ) + (:methods + (w-parking-spot-method-21 (_type_) none) + (w-parking-spot-method-22 (_type_) none) + (w-parking-spot-method-23 (_type_) none) + (w-parking-spot-method-24 (_type_) none) + (w-parking-spot-method-25 (_type_) symbol) + (w-parking-spot-method-26 (_type_) int) + ) + ) + +;; definition for method 3 of type w-parking-spot +(defmethod inspect ((this w-parking-spot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~2Tshould-spawn?: ~A~%" (-> this should-spawn?)) + (format #t "~2Tshould-cleanup?: ~A~%" (-> this should-cleanup?)) + (format #t "~2Tv-type: ~D~%" (-> this v-type)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Ttest-sphere: #~%" (-> this test-sphere)) + (format #t "~2Tarrow: ~D~%" (-> this arrow)) + (label cfg-4) + this + ) + +;; definition for method 24 of type w-parking-spot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod w-parking-spot-method-24 ((this w-parking-spot)) + (let ((gp-0 (new 'stack-no-clear 'cquery-with-5vec))) + (set! (-> gp-0 vec 0 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec 0 quad)) + (vector-reset! (-> gp-0 vec 1)) + (set! (-> gp-0 vec 1 y) 1.0) + (vector-z-quaternion! (-> gp-0 vec 2) (-> this root quat)) + (set! (-> gp-0 vec 2 y) 0.0) + (vector-normalize! (-> gp-0 vec 2) 1.0) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-6 (-> gp-0 cquery))) + (set! (-> v1-6 radius) 1024.0) + (set! (-> v1-6 collide-with) (collide-spec backgnd)) + (set! (-> v1-6 ignore-process0) #f) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f30-0 0.0) + (vector+float*! (the-as vector (-> gp-0 vec)) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) + (set! (-> gp-0 vec 1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (when (< (-> gp-0 vec 1 y) (cos 3640.889)) + (vector-reset! (-> gp-0 vec 1)) + (set! (-> gp-0 vec 1 y) 1.0) + ) + (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (format #t "w-parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec 0 y)) + ) + (if (< f30-0 0.0) + (format #t "w-parking-spot::find-ground: could not find ground~%") + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec 2) (-> gp-0 vec 1)) + ) + 0 + (none) + ) + +;; definition for method 25 of type w-parking-spot +(defmethod w-parking-spot-method-25 ((this w-parking-spot)) + (let ((v1-1 (handle->process (-> this vehicle)))) + (if v1-1 + (or (focus-test? (the-as vehicle v1-1) dead inactive) + (not (logtest? (vehicle-flag waiting-for-player) (-> (the-as vehicle v1-1) v-flags))) + (let ((f0-0 (-> this test-sphere r))) + (< (* f0-0 f0-0) (vector-vector-distance-squared (-> (the-as vehicle v1-1) root trans) (-> this test-sphere))) + ) + (let ((v1-5 *target*)) + (when v1-5 + (if (focus-test? v1-5 pilot-riding) + (= (-> v1-5 pilot vehicle) (-> this vehicle)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 21 of type w-parking-spot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod w-parking-spot-method-21 ((this w-parking-spot)) + (let ((s5-0 (handle->process (-> this vehicle)))) + (cond + (s5-0 + (cond + ((w-parking-spot-method-25 this) + (logclear! (-> (the-as vehicle s5-0) v-flags) (vehicle-flag persistent)) + (set! (-> this vehicle) (the-as handle #f)) + ) + ((and (nonzero? (-> *setting-control* user-current vehicles)) + (have-vehicle-v-type? (the-as int (-> this v-type))) + ) + (when (not (handle->process (-> this arrow))) + (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> s5-1 pos quad) (-> this root trans quad)) + (quaternion-identity! (-> s5-1 quat)) + (set! (-> s5-1 flags) (task-arrow-flags taf8)) + (set! (-> s5-1 map-icon) (the-as uint 12)) + (set! (-> this arrow) (process->handle (task-arrow-spawn s5-1 this))) + ) + ) + ) + (else + (let ((a0-21 (handle->process (-> this arrow)))) + (if a0-21 + (send-event a0-21 'leave) + ) + ) + ) + ) + ) + (else + (let ((a0-25 (handle->process (-> this arrow)))) + (if a0-25 + (send-event a0-25 'leave) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 23 of type w-parking-spot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod w-parking-spot-method-23 ((this w-parking-spot)) + (let ((v1-0 #t) + (s5-0 (-> this v-type)) + ) + (if (= s5-0 (game-vehicle-u8 v-scorpion v-toad v-fox)) + (set! s5-0 (-> *game-info* current-vehicle)) + ) + (when *target* + (let ((v1-3 (-> *vehicle-info* handle-by-vehicle-type s5-0))) + (-> *target* pilot) + (set! v1-0 (not (handle->process v1-3))) + ) + ) + (when (and v1-0 (!= s5-0 27) *vehicle-manager*) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 behavior) (the-as uint 0)) + (set! (-> s4-0 id) (the-as uint 0)) + (set! (-> s4-0 nav-mesh) #f) + (set! (-> s4-0 nav-branch) #f) + (set! (-> s4-0 proc) #f) + (set! (-> s4-0 handle) (the-as handle #f)) + (set! (-> s4-0 user-data) (the-as uint 0)) + (set! (-> s4-0 flags) (traffic-spawn-flags tsf5)) + (set! (-> s4-0 guard-type) (the-as uint 11)) + (set! (-> s4-0 entity) #f) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) + (let ((a0-22 (vehicle-spawn (the-as vehicle-type s5-0) s4-0))) + (when a0-22 + (set! (-> this vehicle) (process->handle a0-22)) + (set! (-> this should-spawn?) #f) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type w-parking-spot +(defmethod w-parking-spot-method-26 ((this w-parking-spot)) + (let ((gp-0 0)) + (let ((v1-1 + (res-lump-value (-> this entity) 'vehicle-type-mask int :default (the-as uint128 4096) :time -1000000000.0) + ) + ) + (while (not (logtest? v1-1 1)) + (+! gp-0 1) + (set! v1-1 (the-as int (/ v1-1 2))) + ) + ) + gp-0 + ) + ) + +;; definition for method 11 of type w-parking-spot +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this w-parking-spot) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (set! (-> this minimap) #f) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this should-spawn?) #t) + (set! (-> this should-cleanup?) (= (-> this level name) 'wasdoors)) + (set! (-> this v-type) (the-as game-vehicle-u8 (w-parking-spot-method-26 this))) + (let ((v1-9 (res-lump-struct arg0 'spawn-trans vector))) + (cond + (v1-9 + (set! (-> this root trans quad) (-> v1-9 quad)) + (let ((a1-5 (res-lump-struct arg0 'spawn-quat structure))) + (when a1-5 + (quaternion-copy! (-> this root quat) (the-as quaternion a1-5)) + 0 + ) + ) + ) + (else + (w-parking-spot-method-24 this) + ) + ) + ) + (let ((s5-1 (res-lump-struct (-> this entity) 'on-activate structure))) + (if s5-1 + (set! (-> this should-spawn?) (the-as symbol (script-eval (the-as pair s5-1)))) + ) + ) + (set! (-> this test-sphere quad) (-> this root trans quad)) + (set! (-> this test-sphere r) 24576.0) + (set-time! (-> this state-time)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate idle (w-parking-spot) + :virtual #t + :exit (behavior () + (w-parking-spot-method-21 self) + (if (and (-> self should-cleanup?) (not (w-parking-spot-method-25 self))) + (send-event (handle->process (-> self vehicle)) 'go-die) + ) + ) + :code (behavior () + (suspend) + (if (-> self should-spawn?) + (w-parking-spot-method-23 self) + ) + (until #f + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.25)) + (suspend) + ) + ) + (w-parking-spot-method-21 self) + (when (-> self should-spawn?) + (let ((f0-0 (vector-vector-distance-squared (camera-pos) (-> self test-sphere))) + (f1-0 327680.0) + ) + (when (< (* f1-0 f1-0) f0-0) + (let ((f1-3 614400.0)) + (if (or (< (* f1-3 f1-3) f0-0) (not (sphere-in-view-frustum? (-> self test-sphere)))) + (w-parking-spot-method-23 self) + ) + ) + ) + ) + ) + ) + #f + (sleep-code) + ) + :post (behavior () + 0 + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-fox_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-fox_REF.gc new file mode 100644 index 0000000000..5e9873fa1a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-fox_REF.gc @@ -0,0 +1,137 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-fox +(deftype v-fox (wcar-snake-base) + () + ) + +;; definition for method 3 of type v-fox +(defmethod inspect ((this v-fox)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-snake-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 62 of type v-fox +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-fox)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3317.76 :z 9011.2 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -14336.0 :w 6144.0)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 35 of type v-fox +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-fox)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-fox-constants*) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 2 0) + (set! (-> this shoot-delay) (the-as uint 18)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 8) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 17) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel-blur" (the-as (pointer level) #f))) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc new file mode 100644 index 0000000000..115573fffd --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc @@ -0,0 +1,243 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-mirage +(deftype v-mirage (wcar-snake-base) + () + ) + +;; definition for method 3 of type v-mirage +(defmethod inspect ((this v-mirage)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-snake-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 169 of type v-mirage +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod wvehicle-method-169 ((this v-mirage)) + (sound-play "toad-shot-fire") + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((gp-1 (new 'stack-no-clear 'wcar-toad-stack-var0))) + (set! (-> gp-1 barrel-idx) (-> this i-barrel)) + (set! (-> gp-1 vec10 x) 61440.0) + (set! (-> gp-1 vec10 y) 204800.0) + (set! (-> gp-1 vec10 z) 409600.0) + (set! (-> gp-1 vec10 w) 163840.0) + (let* ((v1-9 (-> gp-1 mat0)) + (a3-1 (-> this rbody matrix)) + (a0-4 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-9 rvec quad) a0-4) + (set! (-> v1-9 uvec quad) a1-1) + (set! (-> v1-9 fvec quad) a2-1) + (set! (-> v1-9 trans quad) a3-2) + ) + (let ((v1-10 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0))) + (vector-matrix*! + (-> gp-1 vec0) + (the-as vector (+ (the-as uint v1-10) (* (-> gp-1 barrel-idx) 16))) + (-> gp-1 mat0) + ) + ) + 0 + (vector-reset! (-> gp-1 vec4)) + (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) + (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) + (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) + (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) + (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> s4-1 length) (fill-actor-list-for-sphere + *actor-hash* + (-> gp-1 vec3) + (-> gp-1 vec9) + (-> gp-1 vec10 x) + (the-as (pointer collide-shape) (-> s4-1 data)) + (-> s4-1 allocated-length) + -1 + ) + ) + (let ((s4-2 (find-nearest-focusable + (the-as (array collide-shape) s4-1) + (-> gp-1 vec3) + (-> gp-1 vec10 z) + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> gp-1 vec1) + (the-as vector #f) + 8192.0 + ) + ) + ) + (when s4-2 + (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) + (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) + (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) + (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (vector-! (-> gp-1 vec5) (-> gp-1 vec7) (-> gp-1 vec2)) + (set! (-> gp-1 vec11 y) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) + (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) + (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) + (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + ) + ) + (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) + (set! (-> gp-1 vec4 y) (fmax (fmin (-> gp-1 vec4 y) (* 0.3638 (-> gp-1 vec10 y))) (* 0.0 (-> gp-1 vec10 y)))) + 0 + ) + ) + ) + (vector-rotate*! (-> gp-1 vec2) (-> gp-1 vec4) (-> gp-1 mat0)) + (vector+! (-> gp-1 vec2) (-> gp-1 vec2) (-> this rbody lin-velocity)) + (set! (-> gp-1 params ent) (-> this entity)) + (set! (-> gp-1 params charge) 1.0) + (set! (-> gp-1 params options) (projectile-options)) + (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) + (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (set! (-> gp-1 params notify-handle) (the-as handle #f)) + (set! (-> gp-1 params owner-handle) (process->handle this)) + (set! (-> gp-1 params target-handle) (the-as handle #f)) + (set! (-> gp-1 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-1 params ignore-handle) (process->handle this)) + (let* ((v1-60 *game-info*) + (a0-37 (+ (-> v1-60 attack-id) 1)) + ) + (set! (-> v1-60 attack-id) a0-37) + (set! (-> gp-1 params attack-id) a0-37) + ) + (set! (-> gp-1 params timeout) (seconds 4)) + (spawn-projectile v-toad-shot (-> gp-1 params) *rigid-body-queue-manager* *default-dead-pool*) + ) + (none) + ) + +;; definition for method 62 of type v-mirage +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-mirage)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z 9011.2 :w 4505.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -11878.4 :w 5734.4)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 35 of type v-mirage +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-mirage)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-mirage" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 2 0) + (alloc-rbody-control! this *v-mirage-constants*) + (set! (-> this shoot-delay) (the-as uint 240)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 17) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 19) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc new file mode 100644 index 0000000000..a3e0127462 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc @@ -0,0 +1,749 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-scorp-shot +(deftype v-scorp-shot (projectile) + ((init-pos vector :inline) + (init-dir vector :inline) + (collide-normal vector :inline) + ) + ) + +;; definition for method 3 of type v-scorp-shot +(defmethod inspect ((this v-scorp-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Tinit-pos: #~%" (-> this init-pos)) + (format #t "~2Tinit-dir: #~%" (-> this init-dir)) + (format #t "~2Tcollide-normal: #~%" (-> this collide-normal)) + (label cfg-4) + this + ) + +;; definition for method 24 of type v-scorp-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this v-scorp-shot)) + 0 + (none) + ) + +;; definition for method 26 of type v-scorp-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this v-scorp-shot)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this init-pos)))) + (draw-beam (-> *part-id-table* 975) (-> this init-pos) s3-1 #t) + (draw-beam (-> *part-id-table* 978) (-> this init-pos) (-> this starting-dir) #f) + (when (not (logtest? (projectile-options po20) (-> this options))) + (let ((s5-0 (-> *part-id-table* 986)) + (s4-0 (-> *part-id-table* 985)) + ) + (new 'stack-no-clear 'vector) + (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> this collide-normal)))) + (vector-normalize! s2-0 1.0) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-x)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-y)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-z)) + (let ((a1-7 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) + (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) + (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (matrix->eul (the-as euler-angles s1-0) a1-7 21) + (vector-negate! s3-2 s1-0) + (let ((a0-15 s3-2)) + (let ((v1-19 s3-2)) + (let ((a1-10 -3640.889)) + (.mov vf6 a1-10) + ) + (.lvf vf4 (&-> v1-19 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-15 quad) vf5) + ) + (sparticle-set-conerot s5-0 s3-2) + (sparticle-set-conerot s4-0 s3-2) + ) + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 228 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 228)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 228)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 27 of type v-scorp-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-27 ((this v-scorp-shot)) + (draw-beam (-> *part-id-table* 975) (-> this init-pos) (-> this init-dir) #f) + (draw-beam (-> *part-id-table* 978) (-> this init-pos) (-> this starting-dir) #f) + 0 + (none) + ) + +;; definition for method 28 of type v-scorp-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-scorp-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "scorp-gun-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +;; definition for function v-scorp-shot-move +;; WARN: Return type mismatch int vs none. +(defun v-scorp-shot-move ((arg0 v-scorp-shot)) + (projectile-move-fill-line-sphere arg0) + (cond + ((logtest? (-> arg0 root status) (collide-status touch-actor)) + (projectile-method-26 arg0) + ) + ((logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for function cshape-reaction-scorp-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs collide-status. +(defun cshape-reaction-scorp-shot ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (vector-reset! arg2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (set! (-> (the-as v-scorp-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (let* ((s5-1 (-> arg1 best-other-tri collide-ptr)) + (v1-7 (if (type? s5-1 collide-shape-prim) + s5-1 + ) + ) + (v0-2 4) + ) + (cond + (v1-7 + (set! v0-2 32) + ) + (else + ) + ) + (logior! (-> arg0 status) v0-2) + (the-as collide-status v0-2) + ) + ) + +;; definition for method 30 of type v-scorp-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this v-scorp-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-scorp-shot) + (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 bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 1228.8) + (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 obstacle pusher shield)) + (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 bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (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! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type v-scorp-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this v-scorp-shot)) + (with-pp + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 491520.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 491520.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) v-scorp-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) 4.0) + (set! (-> this vehicle-impulse-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + ) + +;; definition of type v-snake-shot +(deftype v-snake-shot (v-scorp-shot) + () + ) + +;; definition for method 3 of type v-snake-shot +(defmethod inspect ((this v-snake-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type v-scorp-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 28 of type v-snake-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-snake-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "snake-gun-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +;; definition for method 37 of type v-snake-shot +(defmethod deal-damage! ((this v-snake-shot) (arg0 process) (arg1 event-message-block)) + (let ((gp-0 ((method-of-type v-scorp-shot deal-damage!) this arg0 arg1))) + (when gp-0 + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (sound-play "snake-riccos") + ) + ) + gp-0 + ) + ) + +;; definition of type v-rhino-shot +(deftype v-rhino-shot (guard-shot) + () + ) + +;; definition for method 3 of type v-rhino-shot +(defmethod inspect ((this v-rhino-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 24 of type v-rhino-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this v-rhino-shot)) + (draw-beam (-> *part-id-table* 854) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 855)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type v-rhino-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this v-rhino-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 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 (&-> s4-0 quad) vf6) + (set! (-> *part-id-table* 980 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 980) a1-0 s5-1 #f) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 981) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000008138021 f30-0)) + (f30-1 (-> *part-id-table* 982 init-specs 3 initial-valuef)) + (f28-0 (-> *part-id-table* 982 init-specs 5 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 982 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 982 init-specs 5 initial-valuef) (* f26-0 f28-0)) + (launch-particles (-> *part-id-table* 982) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 982 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 982 init-specs 5 initial-valuef) f28-0) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type v-rhino-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this v-rhino-shot)) + (let* ((s5-0 (-> this root)) + (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-1 quad) (-> s5-0 trans quad)) + (vector+! v1-1 v1-1 a0-3) + (cond + ((-> this hit-actor?) + (cond + ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type v-rhino-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-rhino-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "rhino-gun-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +;; definition for method 37 of type v-rhino-shot +(defmethod deal-damage! ((this v-rhino-shot) (arg0 process) (arg1 event-message-block)) + (let ((gp-0 ((method-of-type v-scorp-shot deal-damage!) (the-as v-scorp-shot this) arg0 arg1))) + (when gp-0 + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (sound-play "rhino-riccos") + ) + ) + gp-0 + ) + ) + +;; definition for method 31 of type v-rhino-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this v-rhino-shot)) + (let ((t9-0 (method-of-type guard-shot init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this damage) 6.0) + (set! (-> this vehicle-damage-factor) 1.0) + (set! (-> this vehicle-impulse-factor) 0.5) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + +;; definition of type v-toad-shot +(deftype v-toad-shot (projectile) + ((trail-tracker handle) + (blast-radius float) + ) + (:methods + (set-y-vel (_type_) none) + ) + ) + +;; definition for method 3 of type v-toad-shot +(defmethod inspect ((this v-toad-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Ttrail-tracker: ~D~%" (-> this trail-tracker)) + (format #t "~2Tblast-radius: ~f~%" (-> this blast-radius)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-toad-shot gun gun-grenade-lod0-jg gun-grenade-idle-ja + ((gun-grenade-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :texture-level 10 + ) + +;; definition for method 28 of type v-toad-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this v-toad-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "toad-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; definition for method 41 of type v-toad-shot +;; WARN: Return type mismatch int vs none. +(defmethod set-y-vel ((this v-toad-shot)) + (+! (-> this root transv y) (* -163840.0 (seconds-per-frame))) + 0 + (none) + ) + +;; definition for method 30 of type v-toad-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this v-toad-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (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 penetrate-using) (penetrate explode)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 819.2) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set-collide-with! + (-> this root) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set-collide-as! (-> this root) (collide-spec projectile)) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; definition for method 40 of type v-toad-shot +(defmethod projectile-method-40 ((this v-toad-shot)) + 256 + ) + +;; definition for method 31 of type v-toad-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this v-toad-shot)) + (set! (-> this attack-mode) 'explode) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-shot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile init-proj-settings!))) + (t9-2 this) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 213) this)) + (set! (-> this blast-radius) 102400.0) + (set! (-> this max-speed) 90112.0) + (set! (-> this timeout) (seconds 4)) + (set! (-> this update-velocity) (method-of-object this set-y-vel)) + (set! (-> this damage) 0.0) + (let ((v1-13 (new 'stack-no-clear 'vector))) + (set! (-> v1-13 x) 2.0) + (set! (-> v1-13 y) 2.0) + (set! (-> v1-13 z) 2.0) + (set! (-> v1-13 w) 1.0) + (set! (-> this root scale quad) (-> v1-13 quad)) + ) + (let ((s5-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> s5-1 tracked-obj) (process->handle this)) + (set! (-> s5-1 appearance) *toad-grenade-trail*) + (set! (-> s5-1 max-num-crumbs) (the int (* 0.5 (the float (-> s5-1 appearance max-age))))) + (set! (-> s5-1 track-immediately?) #t) + (let* ((v1-26 + (estimate-light-trail-mem-usage + (the-as uint (-> s5-1 max-num-crumbs)) + (the-as uint (= (-> s5-1 appearance lie-mode) 3)) + ) + ) + (s4-1 (get-process *default-dead-pool* light-trail-tracker-projectile (+ v1-26 8192) 1)) + ) + (set! (-> this trail-tracker) + (ppointer->handle (when s4-1 + (let ((t9-6 (method-of-type process activate))) + (t9-6 s4-1 this "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-1 light-trail-tracker-init-by-other s5-1) + (-> s4-1 ppointer) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 24 of type v-toad-shot +(defmethod projectile-method-24 ((this v-toad-shot)) + (draw-beam (-> *part-id-table* 979) (-> this root trans) (-> this starting-dir) #f) + (none) + ) + +;; definition for method 25 of type v-toad-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this v-toad-shot)) + (spawn (-> this part) (-> this root trans)) + (ja-post) + 0 + (none) + ) + +;; definition for method 39 of type v-toad-shot +;; WARN: Return type mismatch object vs none. +(defmethod projectile-method-39 ((this v-toad-shot)) + (if (logtest? (-> this root status) (collide-status impact-surface)) + (go (method-of-object this impact)) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate impact (v-toad-shot) + :virtual #t + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) (-> self blast-radius)) + (set! (-> gp-0 scale) 2.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 230)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 20.0) + (set! (-> gp-0 damage-scale) 3.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle (handle->process (-> self ignore-handle)))) + (explosion-spawn gp-0 self) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-20 (-> self root root-prim))) + (set! (-> v1-20 prim-core collide-as) (collide-spec)) + (set! (-> v1-20 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event (handle->process (-> self trail-tracker)) 'notice 'die) + (while (-> self child) + (suspend) + ) + (deactivate self) + ) + ) + +;; definition of type v-marauder-shot +(deftype v-marauder-shot (guard-shot) + () + ) + +;; definition for method 3 of type v-marauder-shot +(defmethod inspect ((this v-marauder-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 28 of type v-marauder-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this v-marauder-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "inter-gun-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "inter-doppler" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "guard-shot-hit") + ) + ) + ) + (none) + ) + +;; definition for method 31 of type v-marauder-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this v-marauder-shot)) + (let ((t9-0 (method-of-type guard-shot init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this vehicle-damage-factor) 0.333) + (set! (-> this vehicle-impulse-factor) 0.25) + (set! (-> this timeout) (seconds 1.25)) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + +;; definition for method 37 of type v-marauder-shot +(defmethod deal-damage! ((this v-marauder-shot) (arg0 process) (arg1 event-message-block)) + (when ((method-of-type guard-shot deal-damage!) this arg0 arg1) + (if (logtest? (process-mask vehicle) (-> arg0 mask)) + (sound-play "inter-riccos") + ) + #t + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc new file mode 100644 index 0000000000..fc21c4a3dc --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc @@ -0,0 +1,274 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-rhino +(deftype v-rhino (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-gun-kick joint-mod-add-local :inline) + (jmod-gun-turn joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type v-rhino +(defmethod inspect ((this v-rhino)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-base inspect))) + (t9-0 this) + ) + (format #t "~2Tjmod-axles[4] @ #x~X~%" (-> this jmod-axles)) + (format #t "~2Tjmod-gun-kick: #~%" (-> this jmod-gun-kick)) + (format #t "~2Tjmod-gun-turn: #~%" (-> this jmod-gun-turn)) + (label cfg-4) + this + ) + +;; definition for method 169 of type v-rhino +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-169 ((this v-rhino)) + (set! (-> this shoot-time) (the-as uint (current-time))) + (set! (-> this gun-kick) 1638.4) + (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) + (let* ((v1-3 (-> gp-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-3) + (set! (-> v1-3 uvec quad) a1-0) + (set! (-> v1-3 fvec quad) a2-0) + (set! (-> v1-3 trans quad) a3-1) + ) + (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) + (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) + (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) + (set! (-> gp-0 params ent) (-> this entity)) + (set! (-> gp-0 params charge) 1.0) + (set! (-> gp-0 params options) (projectile-options)) + (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) + (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (set! (-> gp-0 params notify-handle) (the-as handle #f)) + (set! (-> gp-0 params owner-handle) (process->handle this)) + (set! (-> gp-0 params target-handle) (the-as handle #f)) + (set! (-> gp-0 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 params ignore-handle) (process->handle this)) + (let* ((v1-19 *game-info*) + (a0-20 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-20) + (set! (-> gp-0 params attack-id) a0-20) + ) + (set! (-> gp-0 params timeout) (seconds 4)) + (spawn-projectile v-rhino-shot (-> gp-0 params) *rigid-body-queue-manager* *default-dead-pool*) + ) + 0 + (none) + ) + +;; definition for method 34 of type v-rhino +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this v-rhino)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2305)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2308)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2309)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1040)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((a0-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> a0-18 prim-core action) (collide-action solid)) + (set! (-> a0-18 transform-index) 0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 28262.4) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 62 of type v-rhino +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-rhino)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 14336.0 :y -2867.2 :z 15769.6 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -14336.0 :y -2867.2 :z 15769.6 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 15155.2 :y -2867.2 :z -12902.4 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -15155.2 :y -2867.2 :z -12902.4 :w 7372.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 1638.4 :z 15769.6 :w 9830.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 4505.6 :w 11878.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 2457.6 :z -13516.8 :w 9830.4)) + 16 + ) + ) + (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 6553.6 :z 14745.6 :w 1.0) quad)) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 88 of type v-rhino +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-88 ((this v-rhino) (arg0 vehicle-controls)) + (let ((t9-0 (method-of-type wcar-base vehicle-method-88))) + (t9-0 this arg0) + ) + (wvehicle-method-199 this) + 0 + (none) + ) + +;; definition for method 94 of type v-rhino +(defmethod vehicle-method-94 ((this v-rhino)) + (let ((f0-0 (vector-length (-> this lin-acceleration)))) + (if (and (< 327680.0 f0-0) (and (not (logtest? (-> this controls flags) (vehicle-controls-flag vcf0))) + (not (-> *setting-control* cam-current entity-name)) + ) + ) + (activate! *camera-smush-control* (fmin 1331.2 (* 0.5 f0-0)) 120 360 1.0 0.9 (-> *display* camera-clock)) + ) + ) + ((method-of-type wcar-base vehicle-method-94) this) + (none) + ) + +;; definition for method 79 of type v-rhino +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this v-rhino)) + (set! (-> this turbo-supply) 3.0) + (seek! (-> this gun-kick) 0.0 (* 32768.0 (seconds-per-frame))) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set! (-> this jmod-gun-kick transform trans z) (-> this gun-kick)) + (quaternion-axis-angle! (-> s5-0 1) 1.0 0.0 0.0 (- (-> this gun-pitch))) + (quaternion-axis-angle! (-> s5-0 2) 0.0 1.0 0.0 (-> this gun-yaw)) + (quaternion*! (-> this jmod-gun-turn rotation) (-> s5-0 2) (-> s5-0 1)) + ) + 0 + (let ((s5-1 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-1 2) 0.0 0.0 0.0 0.0) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((v1-8 (-> this wheel s4-0))) + (-> v1-8 info) + (quaternion-set! (-> s5-1 0) 0.0 0.0 (-> v1-8 sin-susp-ang) (+ 1.0 (-> v1-8 cos-susp-ang))) + ) + (quaternion-normalize! (-> s5-1 0)) + (quaternion-axis-angle! (-> s5-1 1) 0.0 1.0 0.0 (-> (&-> s5-1 0 data s4-0) 8)) + (let ((v1-13 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-13 rotation) (-> s5-1 0) (-> s5-1 1)) + ) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 35 of type v-rhino +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-rhino)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-rhino" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-rhino-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + (init (-> this jmod-gun-turn) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-kick) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z 12288.0 :w 1.0) quad)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 4) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 5) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-rhino-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-rhino-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc new file mode 100644 index 0000000000..978ea5d8d1 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc @@ -0,0 +1,413 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-scorpion +(deftype v-scorpion (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 4 :inline) + (jmod-shock-mids joint-mod-set-local 4 :inline) + (jmod-shock-bots joint-mod-set-local 4 :inline) + (jmod-gun-kick joint-mod-add-local :inline) + (jmod-gun-tilt joint-mod-add-local :inline) + (jmod-gun-turn joint-mod-rotate-local :inline) + ) + ) + +;; definition for method 3 of type v-scorpion +(defmethod inspect ((this v-scorpion)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-base inspect))) + (t9-0 this) + ) + (format #t "~2Tjmod-axles[4] @ #x~X~%" (-> this jmod-axles)) + (format #t "~2Tjmod-shock-tops[4] @ #x~X~%" (-> this jmod-shock-tops)) + (format #t "~2Tjmod-shock-mids[4] @ #x~X~%" (-> this jmod-shock-mids)) + (format #t "~2Tjmod-shock-bots[4] @ #x~X~%" (-> this jmod-shock-bots)) + (format #t "~2Tjmod-gun-kick: #~%" (-> this jmod-gun-kick)) + (format #t "~2Tjmod-gun-tilt: #~%" (-> this jmod-gun-tilt)) + (format #t "~2Tjmod-gun-turn: #~%" (-> this jmod-gun-turn)) + (label cfg-4) + this + ) + +;; definition for method 34 of type v-scorpion +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this v-scorpion)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 16)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((a0-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> a0-18 prim-core action) (collide-action solid)) + (set! (-> a0-18 transform-index) 0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 27033.6) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 62 of type v-scorpion +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-scorpion)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 12697.6 :y -819.2 :z 14336.0 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -12697.6 :y -819.2 :z 14336.0 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 12697.6 :y -819.2 :z -12492.8 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -12697.6 :y -819.2 :z -12492.8 :w 7782.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 1638.4 :z 14336.0 :w 9830.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 2457.6 :w 9830.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 2457.6 :z -12492.8 :w 9830.4)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 169 of type v-scorpion +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod wvehicle-method-169 ((this v-scorpion)) + (set! (-> this shoot-time) (the-as uint (current-time))) + (set! (-> this gun-kick) 1638.4) + (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) + (let* ((v1-3 (-> gp-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-3) + (set! (-> v1-3 uvec quad) a1-0) + (set! (-> v1-3 fvec quad) a2-0) + (set! (-> v1-3 trans quad) a3-1) + ) + (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) + (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) + (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) + (set! (-> gp-0 params ent) (-> this entity)) + (set! (-> gp-0 params charge) 1.0) + (set! (-> gp-0 params options) (projectile-options)) + (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) + (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (set! (-> gp-0 params notify-handle) (the-as handle #f)) + (set! (-> gp-0 params owner-handle) (process->handle this)) + (set! (-> gp-0 params target-handle) (the-as handle #f)) + (set! (-> gp-0 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 params ignore-handle) (process->handle this)) + (let* ((v1-19 *game-info*) + (a0-20 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-20) + (set! (-> gp-0 params attack-id) a0-20) + ) + (set! (-> gp-0 params timeout) (seconds 4)) + (spawn-projectile v-scorp-shot (-> gp-0 params) *rigid-body-queue-manager* *default-dead-pool*) + (let ((v1-23 (get-field-spec-by-id (-> *part-id-table* 967) (sp-field-id spt-omega)))) + (if v1-23 + (set! (-> v1-23 initial-valuef) (+ -20480.0 (-> gp-0 gun-local-pos y))) + ) + ) + (set! (-> gp-0 mat fvec quad) (-> gp-0 gun-local-dir quad)) + (vector-cross! (the-as vector (-> gp-0 mat)) (-> gp-0 mat uvec) (-> gp-0 mat fvec)) + (vector+float*! (-> gp-0 mat trans) (-> gp-0 gun-local-pos) (-> gp-0 gun-local-dir) -12288.0) + (if (logtest? (-> *part-group-id-table* 227 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 227) + :duration 1 + :mat-joint (-> gp-0 mat) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 227) + :duration 1 + :mat-joint (-> gp-0 mat) + ) + ) + ) + (none) + ) + +;; definition for method 88 of type v-scorpion +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-88 ((this v-scorpion) (arg0 vehicle-controls)) + (let ((t9-0 (method-of-type wcar-base vehicle-method-88))) + (t9-0 this arg0) + ) + (wvehicle-method-199 this) + 0 + (none) + ) + +;; definition for method 94 of type v-scorpion +(defmethod vehicle-method-94 ((this v-scorpion)) + (let ((f0-0 (vector-length (-> this lin-acceleration)))) + (if (and (< 327680.0 f0-0) (not (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)))) + (activate! *camera-smush-control* (fmin 2048.0 (* 0.5 f0-0)) 60 210 1.0 0.9 (-> *display* camera-clock)) + ) + ) + ((method-of-type wcar-base vehicle-method-94) this) + (none) + ) + +;; definition for method 79 of type v-scorpion +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this v-scorpion)) + (seek! (-> this gun-kick) 0.0 (* 32768.0 (seconds-per-frame))) + (new 'stack-no-clear 'vector) + (set! (-> this jmod-gun-kick transform trans z) (-> this gun-kick)) + (set! (-> this jmod-gun-tilt transform trans z) (-> this gun-kick)) + (quaternion-axis-angle! (-> this jmod-gun-tilt transform quat) 1.0 0.0 0.0 (-> this gun-pitch)) + (quaternion-axis-angle! (-> this jmod-gun-turn rotation) 0.0 1.0 0.0 (+ 32768.0 (-> this gun-yaw))) + 0 + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-0 2) -1638.4 -1638.4 1638.4 1638.4) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((v1-9 (-> this wheel s4-0))) + (-> v1-9 info) + (quaternion-set! (-> s5-0 0) 0.0 0.0 (-> v1-9 sin-susp-ang) (+ 1.0 (-> v1-9 cos-susp-ang))) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 1.0 0.0 (-> (&-> s5-0 0 data s4-0) 8)) + (let ((v1-14 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-14 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'wvehicle-physics-work))) + (let* ((v1-20 (-> s5-1 mat)) + (a3-4 (-> this node-list data 0 bone transform)) + (a0-15 (-> a3-4 rvec quad)) + (a1-6 (-> a3-4 uvec quad)) + (a2-6 (-> a3-4 fvec quad)) + (a3-5 (-> a3-4 trans quad)) + ) + (set! (-> v1-20 rvec quad) a0-15) + (set! (-> v1-20 uvec quad) a1-6) + (set! (-> v1-20 fvec quad) a2-6) + (set! (-> v1-20 trans quad) a3-5) + ) + (set! (-> s5-1 force quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) + (set! (-> s5-1 velocity quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) + (set! (-> s5-1 world-pos quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) + (set! (-> s5-1 world-normal quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) + (set-vector! (-> s5-1 local-pos) 27670.756 27670.756 28398.934 28398.934) + (dotimes (s4-1 4) + (let ((s3-0 (-> this wheel s4-1))) + (let ((v1-29 (-> s3-0 info))) + (set! (-> s5-1 ground-pos x) (+ -3276.8 (-> v1-29 susp-arm-length))) + (set! (-> s5-1 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) + (set! (-> s5-1 steering-axis quad) (-> v1-29 local-pos quad)) + ) + (+! (-> s5-1 steering-axis x) (* (-> s5-1 ground-pos x) (-> s3-0 cos-susp-ang))) + (+! (-> s5-1 steering-axis y) (* (-> s5-1 ground-pos x) (-> s3-0 sin-susp-ang))) + (set! (-> s5-1 p-body quad) (-> s5-1 steering-axis quad)) + (set! (-> s5-1 p-body x) (* (-> s5-1 p-body x) (-> s3-0 x-scale))) + (set! (-> s5-1 tmp x) (* (-> s5-1 tmp x) (-> s3-0 x-scale))) + (vector-! (-> s5-1 axis) (-> s5-1 p-body) (-> s5-1 tmp)) + (set! (-> s5-1 ground-pos z) (vector-length (-> s5-1 axis))) + (set! (-> s5-1 ground-pos y) + (- (-> s5-1 local-pos data s4-1) (* (atan (-> s5-1 axis x) (-> s5-1 axis y)) (-> s3-0 x-scale))) + ) + (let ((v1-40 (-> this jmod-shock-tops s4-1))) + (quaternion-axis-angle! (-> v1-40 rotation) 0.0 0.0 1.0 (-> s5-1 ground-pos y)) + ) + 0 + (let ((v1-44 (-> this jmod-shock-mids s4-1))) + (set! (-> v1-44 transform trans y) (* -0.5 (-> s5-1 ground-pos z) (-> s3-0 x-scale))) + ) + 0 + (let ((v1-48 (-> this jmod-shock-bots s4-1))) + (set! (-> v1-48 transform trans y) (* -1.0 (+ -2048.0 (* 0.5 (-> s5-1 ground-pos z))) (-> s3-0 x-scale))) + ) + ) + 0 + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 35 of type v-scorpion +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-scorpion)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-scorpion" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-scorpion-constants*) + (set! (-> this rider-hand-joint-array 0) 3) + (init (-> this jmod-gun-turn) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-gun-tilt) this (the-as uint 5) (joint-mod-base-flags attached trans quat)) + (init (-> this jmod-gun-kick) this (the-as uint 6) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 7) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 8) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 16) (joint-mod-base-flags attached)) + (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z -10240.0 :w 1.0) quad)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 9) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 17) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 12) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 20) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 10) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 18) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 13) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 21) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-bots)) + this + (the-as uint 11) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-bots 1) this (the-as uint 19) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-bots 2) this (the-as uint 14) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-bots 3) this (the-as uint 22) (joint-mod-base-flags attached trans)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-scorpion-wheel" (the-as (pointer level) #f))) + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-v-scorpion-wheel-blur" (the-as (pointer level) #f)) + ) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + (set! (-> this gun-aim-yaw) 0.0) + (set! (-> this gun-aim-yaw-vel) 0.0) + (set! (-> this gun-yaw) 0.0) + (set! (-> this gun-pitch) 0.0) + (set! (-> this shoot-delay) (the-as uint 30)) + (set! (-> this lock-turret) #f) + 0 + (none) + ) + +;; definition for method 49 of type v-scorpion +(defmethod rbody-event-handler ((this v-scorpion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('set-string-height) + (set-setting! 'string-min-height 'abs (-> arg3 param 0) 0) + (set-setting! 'string-max-height 'abs (-> arg3 param 0) 0) + #t + ) + (('draw-turret) + (if (-> arg3 param 0) + (setup-masks (-> this draw) 2 0) + (setup-masks (-> this draw) 0 2) + ) + ) + (('use-camera) + (if (-> arg3 param 0) + (vehicle-method-80 this) + (vehicle-method-81 this) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-snake_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-snake_REF.gc new file mode 100644 index 0000000000..741152ee2f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-snake_REF.gc @@ -0,0 +1,137 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-snake +(deftype v-snake (wcar-snake-base) + () + ) + +;; definition for method 3 of type v-snake +(defmethod inspect ((this v-snake)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-snake-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 62 of type v-snake +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-snake)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z 9011.2 :w 4505.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -11878.4 :w 5734.4)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 35 of type v-snake +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-snake)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 4 0) + (alloc-rbody-control! this *v-snake-constants*) + (set! (-> this shoot-delay) (the-as uint 18)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 17) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 19) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc new file mode 100644 index 0000000000..d798df4027 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc @@ -0,0 +1,546 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-toad +(deftype v-toad (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 2 :inline) + (jmod-shock-bots joint-mod-set-local 2 :inline) + ) + (:methods + (v-toad-method-203 (_type_ vehicle-wheel-state vehicle-wheel-info) none) + ) + ) + +;; definition for method 3 of type v-toad +(defmethod inspect ((this v-toad)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-base inspect))) + (t9-0 this) + ) + (format #t "~2Tjmod-axles[4] @ #x~X~%" (-> this jmod-axles)) + (format #t "~2Tjmod-shock-tops[2] @ #x~X~%" (-> this jmod-shock-tops)) + (format #t "~2Tjmod-shock-bots[2] @ #x~X~%" (-> this jmod-shock-bots)) + (label cfg-4) + this + ) + +;; definition for method 169 of type v-toad +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs none. +(defmethod wvehicle-method-169 ((this v-toad)) + (sound-play "toad-shot-fire") + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((gp-1 (new 'stack-no-clear 'wcar-toad-stack-var0))) + (set! (-> gp-1 barrel-idx) (-> this i-barrel)) + (set! (-> gp-1 vec10 x) 61440.0) + (set! (-> gp-1 vec10 y) 204800.0) + (set! (-> gp-1 vec10 z) 409600.0) + (set! (-> gp-1 vec10 w) 163840.0) + (let* ((v1-9 (-> gp-1 mat0)) + (a3-1 (-> this rbody matrix)) + (a0-4 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-9 rvec quad) a0-4) + (set! (-> v1-9 uvec quad) a1-1) + (set! (-> v1-9 fvec quad) a2-1) + (set! (-> v1-9 trans quad) a3-2) + ) + (let ((v1-10 (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 7372.8 :z 6144.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 7372.8 :z 6144.0 :w 1.0) + ) + ) + ) + (vector-matrix*! (-> gp-1 vec0) (-> v1-10 (-> gp-1 barrel-idx)) (-> gp-1 mat0)) + ) + 0 + (vector-reset! (-> gp-1 vec4)) + (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) + (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) + (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) + (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) + (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> s4-1 length) (fill-actor-list-for-sphere + *actor-hash* + (-> gp-1 vec3) + (-> gp-1 vec9) + (-> gp-1 vec10 x) + (the-as (pointer collide-shape) (-> s4-1 data)) + (-> s4-1 allocated-length) + -1 + ) + ) + (let ((s4-2 (find-nearest-focusable + (the-as (array collide-shape) s4-1) + (-> gp-1 vec3) + (-> gp-1 vec10 z) + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> gp-1 vec1) + (the-as vector #f) + 8192.0 + ) + ) + ) + (when s4-2 + (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) + (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) + (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) + (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (vector-! (-> gp-1 vec5) (-> gp-1 vec7) (-> gp-1 vec2)) + (set! (-> gp-1 vec11 y) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) + (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) + (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) + (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) + (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + ) + ) + (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) + (set! (-> gp-1 vec4 y) (fmax (fmin (-> gp-1 vec4 y) (* 0.3638 (-> gp-1 vec10 y))) (* 0.0 (-> gp-1 vec10 y)))) + 0 + ) + ) + ) + (vector-rotate*! (-> gp-1 vec2) (-> gp-1 vec4) (-> gp-1 mat0)) + (vector+! (-> gp-1 vec2) (-> gp-1 vec2) (-> this rbody lin-velocity)) + (set! (-> gp-1 params ent) (-> this entity)) + (set! (-> gp-1 params charge) 1.0) + (set! (-> gp-1 params options) (projectile-options)) + (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) + (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) + (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (set! (-> gp-1 params notify-handle) (the-as handle #f)) + (set! (-> gp-1 params owner-handle) (process->handle this)) + (set! (-> gp-1 params target-handle) (the-as handle #f)) + (set! (-> gp-1 params target-pos quad) (the-as uint128 0)) + (set! (-> gp-1 params ignore-handle) (process->handle this)) + (let* ((v1-60 *game-info*) + (a0-37 (+ (-> v1-60 attack-id) 1)) + ) + (set! (-> v1-60 attack-id) a0-37) + (set! (-> gp-1 params attack-id) a0-37) + ) + (set! (-> gp-1 params timeout) (seconds 4)) + (spawn-projectile v-toad-shot (-> gp-1 params) *rigid-body-queue-manager* *default-dead-pool*) + ) + (none) + ) + +;; definition for method 88 of type v-toad +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-88 ((this v-toad) (arg0 vehicle-controls)) + ((method-of-type wcar-base vehicle-method-88) this arg0) + 0 + (none) + ) + +;; definition for method 48 of type v-toad +(defmethod on-impact ((this v-toad) (arg0 rigid-body-impact)) + (when (and (logtest? (vehicle-flag vf56) (-> this v-flags)) (-> arg0 process)) + (let ((a0-2 (-> arg0 process))) + (if a0-2 + (send-event + a0-2 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker (process->handle this)) + ) + ) + ) + ) + ) + ) + ((method-of-type wcar-base on-impact) this arg0) + (none) + ) + +;; definition for method 93 of type v-toad +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-93 ((this v-toad)) + (let ((t9-0 (method-of-type wcar-base vehicle-method-93))) + (t9-0 this) + ) + (if (logtest? (vehicle-flag vf56) (-> this v-flags)) + (set! (-> this rbody lin-momentum y) (* -409600.0 (-> this info info mass))) + ) + 0 + (none) + ) + +;; definition for method 34 of type v-toad +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this v-toad)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-6 prim-core action) (collide-action solid)) + (set! (-> a0-6 transform-index) 0) + ) + (let ((a0-8 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-8 prim-core action) (collide-action solid)) + (set! (-> a0-8 transform-index) 0) + ) + (let ((a0-10 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-10 prim-core action) (collide-action solid)) + (set! (-> a0-10 transform-index) 0) + ) + (let ((a0-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-12 prim-core action) (collide-action solid)) + (set! (-> a0-12 transform-index) 0) + ) + (let ((a0-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-14 prim-core action) (collide-action solid)) + (set! (-> a0-14 transform-index) 0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1168)))) + (set! (-> v1-21 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-21 transform-index) 0) + (set! (-> v1-21 nav-radius) 20480.0) + ) + (let ((a0-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 16)))) + (set! (-> a0-19 prim-core action) (collide-action solid)) + (set! (-> a0-19 transform-index) 0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-25 prim-core action) (collide-action solid rideable)) + (set! (-> v1-25 transform-index) 3) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 28672.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (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 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 62 of type v-toad +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-toad)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 11264.0 :y 2252.8 :z 20275.2 :w 5120.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -11264.0 :y 2252.8 :z 20275.2 :w 5120.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 12697.6 :y 3481.6 :z -12083.2 :w 6553.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -12697.6 :y 3481.6 :z -12083.2 :w 6553.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 4096.0 :z 14336.0 :w 6963.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 5324.8 :z 1228.8 :w 8192.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 5324.8 :z -10649.6 :w 6963.2)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 203 of type v-toad +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod v-toad-method-203 ((this v-toad) (arg0 vehicle-wheel-state) (arg1 vehicle-wheel-info)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-physics-work))) + (set-vector! (-> gp-0 p-body) 1.0 0.0 0.0 1.0) + (set-vector! (-> gp-0 axis) 0.0 1.0 0.0 1.0) + (quaternion-copy! (the-as quaternion (-> gp-0 world-normal)) (-> this root quat)) + (let* ((v1-3 (-> gp-0 mat)) + (a3-0 (-> this rbody matrix)) + (a0-7 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-7) + (set! (-> v1-3 uvec quad) a1-2) + (set! (-> v1-3 fvec quad) a2-1) + (set! (-> v1-3 trans quad) a3-1) + ) + (set! (-> gp-0 wsphere y) (* (-> arg1 radius) (-> arg1 scale))) + (set! (-> gp-0 wsphere z) 13590.528) + (set! (-> gp-0 wsphere r) 0.0) + (set! (-> gp-0 friction-coef) + (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (* 0.5 (-> arg1 travel)) (-> gp-0 wsphere z))))) + ) + (set! (-> gp-0 steering-axis quad) (-> (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0) quad)) + (set-vector! + (-> gp-0 ground-pos) + 0.0 + (* -1.0 (- (sin (-> gp-0 friction-coef)) (sin (-> gp-0 wsphere r))) (-> gp-0 wsphere z)) + (* (- (cos (-> gp-0 friction-coef)) (cos (-> gp-0 wsphere r))) (-> gp-0 wsphere z)) + 1.0 + ) + (vector-normalize! (-> gp-0 ground-pos) 1.0) + (set! (-> gp-0 tmp quad) (-> gp-0 steering-axis quad)) + (+! (-> gp-0 tmp z) (* (-> gp-0 wsphere z) (cos (-> gp-0 wsphere r)))) + (+! (-> gp-0 tmp y) (* -1.0 (sin (-> gp-0 wsphere r)) (-> gp-0 wsphere z))) + (set! (-> gp-0 tmp y) (- (-> gp-0 tmp y) (-> gp-0 wsphere y))) + (set! (-> gp-0 tmp x) (* (-> gp-0 tmp x) (-> arg0 x-scale))) + (vector+float*! + (-> gp-0 tmp) + (-> gp-0 tmp) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (set! (-> arg0 probe-local-pos quad) (-> gp-0 tmp quad)) + (set! (-> arg0 probe-local-dir quad) (-> gp-0 ground-pos quad)) + (vector-matrix*! (-> gp-0 side-dir) (-> gp-0 tmp) (-> gp-0 mat)) + (vector-rotate*! (-> gp-0 forward-dir) (-> gp-0 ground-pos) (-> gp-0 mat)) + (set! (-> gp-0 wsphere x) + (- (+ (-> arg0 probe-local-pos y) + (-> gp-0 wsphere y) + (* (-> arg0 probe-local-dir y) (-> arg0 pos2) (-> arg1 travel)) + ) + (-> gp-0 steering-axis y) + ) + ) + (set! (-> arg0 sin-susp-ang) (fmax -1.0 (fmin 1.0 (/ (- (-> gp-0 wsphere x)) (-> gp-0 wsphere z))))) + (let ((f0-52 1.0) + (f1-16 (-> arg0 sin-susp-ang)) + ) + (set! (-> arg0 cos-susp-ang) (sqrtf (- f0-52 (* f1-16 f1-16)))) + ) + (quaternion-identity! (the-as quaternion (-> gp-0 local-pos))) + (set! (-> gp-0 local-pos z) (* (sin (-> arg1 camber)) (-> arg0 x-scale))) + (set! (-> gp-0 local-pos w) (cos (-> arg1 camber))) + (when (logtest? (-> arg1 flags) (vehicle-wheel-flag vwf5)) + (quaternion-set! + (the-as quaternion (-> gp-0 force)) + 0.0 + 0.0 + (* (-> arg0 sin-susp-ang) (-> arg0 x-scale)) + (+ 1.0 (-> arg0 cos-susp-ang)) + ) + (quaternion-normalize! (the-as quaternion (-> gp-0 force))) + (quaternion*! + (the-as quaternion (-> gp-0 local-pos)) + (the-as quaternion (-> gp-0 local-pos)) + (the-as quaternion (-> gp-0 force)) + ) + ) + (set! (-> gp-0 dir quad) (-> gp-0 steering-axis quad)) + (+! (-> gp-0 dir z) (* (-> gp-0 wsphere z) (-> arg0 cos-susp-ang))) + (+! (-> gp-0 dir y) (* -1.0 (-> arg0 sin-susp-ang) (-> gp-0 wsphere z))) + (set! (-> gp-0 dir x) (* (-> gp-0 dir x) (-> arg0 x-scale))) + (vector+float*! + (-> gp-0 dir) + (-> gp-0 dir) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (vector-matrix*! (-> gp-0 ground-normal-sum) (-> gp-0 dir) (-> gp-0 mat)) + (quaternion-vector-angle! (the-as quaternion (-> gp-0 world-pos)) (-> gp-0 axis) (-> arg0 steer-angle)) + (quaternion-vector-angle! (the-as quaternion (-> gp-0 velocity)) (-> gp-0 p-body) (-> arg0 angle)) + (quaternion*! + (the-as quaternion (-> gp-0 force)) + (the-as quaternion (-> gp-0 world-pos)) + (the-as quaternion (-> gp-0 local-pos)) + ) + (quaternion*! + (the-as quaternion (-> gp-0 force)) + (the-as quaternion (-> gp-0 force)) + (the-as quaternion (-> gp-0 velocity)) + ) + (quaternion*! (-> arg0 quat) (the-as quaternion (-> gp-0 world-normal)) (the-as quaternion (-> gp-0 force))) + (set! (-> arg0 trans quad) (-> gp-0 ground-normal-sum quad)) + ) + 0 + (none) + ) + +;; definition for method 79 of type v-toad +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this v-toad)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-axis-angle! (-> s5-0 1) 1.0 0.0 0.0 -5355.7476) + (dotimes (s4-0 2) + (let ((v1-3 (-> this wheel s4-0))) + (-> v1-3 info) + (quaternion-set! (-> s5-0 0) (-> v1-3 sin-susp-ang) 0.0 0.0 (+ 1.0 (-> v1-3 cos-susp-ang))) + ) + (quaternion-normalize! (-> s5-0 0)) + (let ((v1-6 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-6 rotation) (-> s5-0 1) (-> s5-0 0)) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'quaternion 1)) + (s4-1 2) + ) + (while (< s4-1 4) + (let ((v1-13 (-> this wheel s4-1))) + (-> v1-13 info) + (quaternion-set! + (-> s5-1 0) + 0.0 + 0.0 + (* (-> v1-13 sin-susp-ang) (-> v1-13 x-scale)) + (+ 1.0 (-> v1-13 cos-susp-ang)) + ) + ) + (quaternion-normalize! (-> s5-1 0)) + (let ((v1-16 (-> this jmod-axles s4-1))) + (quaternion-copy! (-> v1-16 rotation) (-> s5-1 0)) + ) + 0 + (+! s4-1 1) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'wvehicle-physics-work))) + (let* ((v1-19 (-> s5-2 mat)) + (a3-3 (-> this node-list data 0 bone transform)) + (a0-12 (-> a3-3 rvec quad)) + (a1-5 (-> a3-3 uvec quad)) + (a2-4 (-> a3-3 fvec quad)) + (a3-4 (-> a3-3 trans quad)) + ) + (set! (-> v1-19 rvec quad) a0-12) + (set! (-> v1-19 uvec quad) a1-5) + (set! (-> v1-19 fvec quad) a2-4) + (set! (-> v1-19 trans quad) a3-4) + ) + (set! (-> s5-2 force quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) + (set! (-> s5-2 velocity quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) + (set-vector! (-> s5-2 local-pos) 32768.0 32768.0 0.0 0.0) + (dotimes (s4-2 2) + (let ((v1-26 (-> this wheel (+ s4-2 2)))) + (let ((a0-20 (-> v1-26 info))) + (set! (-> s5-2 ground-pos y) (+ -2048.0 (-> a0-20 susp-arm-length))) + (set! (-> s5-2 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-2 16) 64) (the-as int s5-2))))) + (set! (-> s5-2 steering-axis quad) (-> a0-20 local-pos quad)) + ) + (+! (-> s5-2 steering-axis x) (* (-> s5-2 ground-pos y) (-> v1-26 cos-susp-ang))) + (+! (-> s5-2 steering-axis y) (* (-> s5-2 ground-pos y) (-> v1-26 sin-susp-ang))) + (set! (-> s5-2 p-body quad) (-> s5-2 steering-axis quad)) + (set! (-> s5-2 p-body x) (* (-> s5-2 p-body x) (-> v1-26 x-scale))) + (set! (-> s5-2 tmp x) (* (-> s5-2 tmp x) (-> v1-26 x-scale))) + ) + (vector-! (-> s5-2 axis) (-> s5-2 p-body) (-> s5-2 tmp)) + (set! (-> s5-2 ground-pos x) (vector-length (-> s5-2 axis))) + (set! (-> s5-2 ground-pos z) (- (-> s5-2 local-pos data s4-2) (atan (-> s5-2 axis x) (-> s5-2 axis y)))) + (let ((v1-34 (-> this jmod-shock-tops s4-2))) + (quaternion-axis-angle! (-> v1-34 rotation) 0.0 0.0 1.0 (-> s5-2 ground-pos z)) + ) + 0 + (let ((v1-38 (-> this jmod-shock-bots s4-2))) + (set! (-> v1-38 transform trans y) (* -1.0 (+ -3686.4 (-> s5-2 ground-pos x)))) + ) + 0 + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 37 of type v-toad +;; WARN: Return type mismatch (function v-toad vehicle-wheel-state vehicle-wheel-info none) vs none. +(defmethod rigid-body-object-method-37 ((this v-toad)) + (let ((t9-0 (method-of-type wcar-base rigid-body-object-method-37))) + (t9-0 this) + ) + (set! (-> this info physics-model front-wheel callback) (method-of-object this v-toad-method-203)) + (none) + ) + +;; definition for method 35 of type v-toad +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-toad)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-toad-constants*) + (set! (-> this rider-hand-joint-array 0) 14) + (set! (-> this shoot-delay) (the-as uint 300)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 10) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 12) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-bots)) + this + (the-as uint 11) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-bots 1) this (the-as uint 13) (joint-mod-base-flags attached trans)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-toad-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc new file mode 100644 index 0000000000..4fc6c471fd --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc @@ -0,0 +1,292 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-turtle +(deftype v-turtle (wcar-base) + ((jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 4 :inline) + (jmod-shock-mids joint-mod-set-local 4 :inline) + (jmod-antenna joint-mod-rotate-local 4 :inline) + (ant-tip-vel vector :inline) + (spring-pos vector :inline) + (spring-vel vector :inline) + ) + ) + +;; definition for method 3 of type v-turtle +(defmethod inspect ((this v-turtle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-base inspect))) + (t9-0 this) + ) + (format #t "~2Tjmod-axles[4] @ #x~X~%" (-> this jmod-axles)) + (format #t "~2Tjmod-shock-tops[4] @ #x~X~%" (-> this jmod-shock-tops)) + (format #t "~2Tjmod-shock-mids[4] @ #x~X~%" (-> this jmod-shock-mids)) + (format #t "~2Tjmod-antenna[4] @ #x~X~%" (-> this jmod-antenna)) + (format #t "~2Tant-tip-vel: #~%" (-> this ant-tip-vel)) + (format #t "~2Tspring-pos: #~%" (-> this spring-pos)) + (format #t "~2Tspring-vel: #~%" (-> this spring-vel)) + (label cfg-4) + this + ) + +;; definition for method 34 of type v-turtle +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this v-turtle)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (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 action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 16)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-22 prim-core action) (collide-action solid rideable)) + (set! (-> v1-22 transform-index) 3) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-24 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 62 of type v-turtle +(defmethod vehicle-method-62 ((this v-turtle)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 7782.4 :y 1638.4 :z 7987.2 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -7782.4 :y 1638.4 :z 7987.2 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 7372.8 :y 4096.0 :z -8601.6 :w 3686.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -7372.8 :y 4096.0 :z -8601.6 :w 3686.4)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 4505.6 :z 4096.0 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 5324.8 :z -6553.6 :w 6144.0)) + 16 + ) + ) + ((method-of-type wcar-base vehicle-method-62) this) + (none) + ) + +;; definition for method 79 of type v-turtle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this v-turtle)) + (local-vars (v1-33 float) (v1-47 float) (v1-52 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set-vector! (-> this root scale) 1.0 1.0 1.07 1.0) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-0 2) -3640.889 3640.889 3640.889 -3640.889) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((v1-6 (-> this wheel s4-0))) + (-> v1-6 info) + (let ((s3-0 (-> this jmod-axles s4-0))) + (quaternion-set! + (-> s5-0 0) + 0.0 + 0.0 + (* (-> v1-6 sin-susp-ang) (-> v1-6 x-scale)) + (+ 1.0 (-> v1-6 cos-susp-ang)) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 1.0 0.0 (-> (&-> s5-0 0 data s4-0) 8)) + (quaternion*! (-> s3-0 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'wvehicle-physics-work))) + (set! (-> s5-1 mat trans x) (seconds-per-frame)) + (vector-matrix*! (-> s5-1 mat uvec) (new 'static 'vector :y 20480.0 :z -8192.0 :w 1.0) (-> this rbody matrix)) + (rigid-body-control-method-23 (-> this rbody) (-> s5-1 mat uvec) (the-as vector (-> s5-1 mat))) + (vector-! (-> s5-1 mat fvec) (the-as vector (-> s5-1 mat)) (-> this ant-tip-vel)) + (set! (-> this ant-tip-vel quad) (-> s5-1 mat rvec quad)) + (vector-float*! (-> s5-1 mat fvec) (-> s5-1 mat fvec) (/ 1.0 (-> s5-1 mat trans x))) + (vector+float*! + (-> this spring-vel) + (-> this spring-vel) + (-> s5-1 mat fvec) + (* -0.00024414062 (-> s5-1 mat trans x)) + ) + (set! (-> s5-1 mat trans y) 500.0) + (set! (-> s5-1 mat trans z) 5.0) + (vector+float*! + (-> this spring-vel) + (-> this spring-vel) + (-> this spring-pos) + (* -1.0 (-> s5-1 mat trans x) (-> s5-1 mat trans y)) + ) + (vector-float*! + (-> this spring-vel) + (-> this spring-vel) + (fmax 0.0 (+ 1.0 (* -1.0 (-> s5-1 mat trans z) (-> s5-1 mat trans x)))) + ) + (vector+float*! (-> this spring-pos) (-> this spring-pos) (-> this spring-vel) (-> s5-1 mat trans x)) + ) + (set! (-> this spring-pos y) 0.0) + (.lvf vf1 (&-> (-> this spring-pos) 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-33 vf1) + (let ((f0-27 v1-33)) + (when (< 1.0 f0-27) + (vector-float*! (-> this spring-pos) (-> this spring-pos) (/ 1.0 (sqrtf f0-27))) + (vector-reset! (-> this spring-vel)) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'wvehicle-jmod-work))) + (quaternion-conjugate! (-> s5-2 quat1) (-> this root quat)) + (quaternion->matrix (-> s5-2 mat0) (-> s5-2 quat1)) + (set! (-> s5-2 float0) 8192.0) + (set! (-> s5-2 float2) (sin (* 0.5 (-> s5-2 float0)))) + (set! (-> s5-2 float1) (cos (* 0.5 (-> s5-2 float0)))) + (vector-rotate90-around-y! (-> s5-2 vec0) (-> this spring-pos)) + (vector-float*! (-> s5-2 vec0) (-> s5-2 vec0) (* -1.0 (-> s5-2 float2))) + (vector-rotate*! (-> s5-2 vec0) (-> s5-2 vec0) (-> s5-2 mat0)) + (set! (-> s5-2 quat0 x) (-> s5-2 vec0 x)) + (set! (-> s5-2 quat0 y) (-> s5-2 vec0 y)) + (set! (-> s5-2 quat0 z) (-> s5-2 vec0 z)) + (let ((f0-42 1.0)) + (.lvf vf1 (&-> (-> s5-2 vec0) 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-47 vf1) + (set! (-> s5-2 quat0 w) (sqrtf (- f0-42 v1-47))) + ) + (quaternion-copy! (-> this jmod-antenna 0 rotation) (-> s5-2 quat0)) + (vector-float*! (-> s5-2 vec0) (-> s5-2 vec0) 1.0) + (set! (-> s5-2 quat0 x) (-> s5-2 vec0 x)) + (set! (-> s5-2 quat0 y) (-> s5-2 vec0 y)) + (set! (-> s5-2 quat0 z) (-> s5-2 vec0 z)) + (let ((f0-49 1.0)) + (.lvf vf1 (&-> (-> s5-2 vec0) 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-52 vf1) + (set! (-> s5-2 quat0 w) (sqrtf (- f0-49 v1-52))) + ) + (quaternion-copy! (-> this jmod-antenna 1 rotation) (-> s5-2 quat0)) + (quaternion-copy! (-> this jmod-antenna 2 rotation) (-> s5-2 quat0)) + (quaternion-copy! (-> this jmod-antenna 3 rotation) (-> s5-2 quat0)) + ) + 0 + (none) + ) + ) + +;; definition for method 35 of type v-turtle +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-turtle)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-turtle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *v-turtle-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-antenna)) + this + (the-as uint 9) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-antenna 1) this (the-as uint 10) (joint-mod-base-flags attached)) + (init (-> this jmod-antenna 2) this (the-as uint 11) (joint-mod-base-flags attached)) + (init (-> this jmod-antenna 3) this (the-as uint 12) (joint-mod-base-flags attached)) + (vector-reset! (-> this ant-tip-vel)) + (vector-reset! (-> this spring-pos)) + (vector-reset! (-> this spring-vel)) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-turtle-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-turtle-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group #f) + (the-as skeleton-group #f) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-x-ride_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-x-ride_REF.gc new file mode 100644 index 0000000000..7abf851bae --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-x-ride_REF.gc @@ -0,0 +1,137 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type v-x-ride +(deftype v-x-ride (wcar-snake-base) + () + ) + +;; definition for method 3 of type v-x-ride +(defmethod inspect ((this v-x-ride)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-snake-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 62 of type v-x-ride +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this v-x-ride)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3317.76 :z 9011.2 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -14336.0 :w 6144.0)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 35 of type v-x-ride +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this v-x-ride)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-x-ride" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 4 0) + (alloc-rbody-control! this *v-x-ride-constants*) + (set! (-> this shoot-delay) (the-as uint 18)) + (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (set! (-> this rider-hand-joint-array 0) 8) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-axles)) + this + (the-as uint 5) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-axles 1) this (the-as uint 6) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 2) this (the-as uint 4) (joint-mod-base-flags attached)) + (init (-> this jmod-axles 3) this (the-as uint 7) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-rotate-local init) + (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) + this + (the-as uint 11) + (joint-mod-base-flags attached) + ) + (init (-> this jmod-shock-tops 1) this (the-as uint 15) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 2) this (the-as uint 9) (joint-mod-base-flags attached)) + (init (-> this jmod-shock-tops 3) this (the-as uint 13) (joint-mod-base-flags attached)) + ((method-of-type joint-mod-set-local init) + (the-as joint-mod-set-local (-> this jmod-shock-mids)) + this + (the-as uint 12) + (joint-mod-base-flags attached trans) + ) + (init (-> this jmod-shock-mids 1) this (the-as uint 16) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 2) this (the-as uint 10) (joint-mod-base-flags attached trans)) + (init (-> this jmod-shock-mids 3) this (the-as uint 14) (joint-mod-base-flags attached trans)) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns)) + this + (the-as uint 17) + (joint-mod-base-flags attached trans) + ) + ((method-of-type joint-mod-add-local init) + (the-as joint-mod-add-local (-> this jmod-guns 1)) + this + (the-as uint 18) + (joint-mod-base-flags attached trans) + ) + (spawn-wheels! + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-fox-wheel-blur" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel" (the-as (pointer level) #f))) + (the-as skeleton-group (art-group-get-by-name *level* "skel-v-snake-wheel-blur" (the-as (pointer level) #f))) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc new file mode 100644 index 0000000000..2c8312217a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc @@ -0,0 +1,4324 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *v-turtle-constants*, type rigid-body-vehicle-constants +(define *v-turtle-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 3.0 + :inv-mass 0.33333334 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 819.2 :z -409.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 3.5) (meters 2.5) (meters 5.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-turtle-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-turtle) + :engine (new 'static 'vehicle-engine-info + :max-torque 83886080.0 + :inertia 8192.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 4000.0 + :min-rpm 700.0 + :max-rpm 6000.0 + :peak-torque-rpm 3200.0 + :powerband-width-rpm 4000.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 4096.0 + :upshift-rpm 4500.0 + :downshift-rpm 2500.0 + :final-drive-ratio 9.0 + :gear-ratio-array (new 'static 'array float 8 -3.375 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 0.7 + :turbo-boost-duration (seconds 3.5) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4551.1113 + :tire-steering-speed-factor 34816.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.3 + :tire-friction-factor 1.0 + :tire-static-friction 1.516 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.98539996 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 40960.0 + :air-pitch-torque 81920.0 + :air-angular-damping 0.97 + :hop-turn-torque 225280.0 + :ground-torque-scale 0.45 + :ai-steering-factor 4.0 + :ai-throttle-factor 0.5 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 9011.2 :z -4915.2 :w 1.0) + (new 'static 'vector :x -20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :x 20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :y 12288.0 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "turt-scrape") + :glance-sound (static-sound-name "turt-glance") + :impact-sound (static-sound-name "turt-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "turt-flutter") + :water-sound (static-sound-name "turt-water") + :jump-sound (static-sound-name "turt-hop") + :turbo-sound (static-sound-name "turt-boost") + :bank-replace '((wasall1 wasturt)) + :idle-rpm 900.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 3000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "turt-start") + :stop-sound (static-sound-name "turt-stop") + :idle-sound (static-sound-name "turt-idle") + :engine-sound (static-sound-name "turt-steady") + :susp-creak-sound (static-sound-name "turt-bounce") + :susp-bottom-out-sound (static-sound-name "turt-bottom") + :susp-speed-threshold 81920.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "turt-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 5120.0 :y 3276.8 :z -12697.6 :w 1.0) + (new 'static 'vector :x -5120.0 :y 3276.8 :z -12697.6 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 5242.88 :y 3399.68 :z -12288.0 :w 1.0) + (new 'static 'vector :x -5242.88 :y 3399.68 :z -12288.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 + (new 'static 'vector :x 0.4 :y 0.1 :z -1.0 :w 1.0) + (new 'static 'vector :x -0.4 :y 0.1 :z -1.0 :w 1.0) + ) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 5120.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -1024.0 :y 5120.0 :z -10240.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 1843.2 :y 2867.2 :z 8601.6 :w 1.0) + (new 'static 'vector :x -1843.2 :y 2867.2 :z 8601.6 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 6758.4 :z -11264.0 :w 1.0) + (new 'static 'vector :x -2457.6 :y 6758.4 :z -11264.0 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.8333333 + :hit-points 29.997 + :inv-hit-points 0.033336665 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 4300.8 :y -491.52 :z 9420.8 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf4) + :inertia 4300800.0 + :radius 2334.72 + :susp-arm-length 2867.2 + :steer-arm-length 1638.4 + :scale 1.4 + :travel 2867.2 + :probe-y-offset -2048.0 + :width 2867.2 + :suspension-spring 0.6 + :suspension-damping 0.4 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 2048.0 + :tread-texture "tread-turtle" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 3891.2 :y 409.6 :z -10035.199 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2) + :inertia 4915200.0 + :radius 2334.72 + :susp-arm-length 3481.6 + :steer-arm-length 2048.0 + :scale 1.6 + :travel 3440.6401 + :probe-y-offset -1474.56 + :width 2867.2 + :suspension-spring 0.7 + :suspension-damping 0.4 + :forward-grip 1.15 + :side-grip 1.15 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 2457.6 + :tread-texture "tread-turtle" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 4341.76 + :settle-rot-x -546.13336 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info :position (new 'static 'vector :y 2007.04 :z 819.2 :w (the-as float #x10000))) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1228.8 :y 614.4 :z -368.64 :w 1.0) + (new 'static 'vector :x -1228.8 :y 614.4 :z -368.64 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-turtle) + ) + ) + +;; definition for symbol *v-snake-constants*, type rigid-body-vehicle-constants +(define *v-snake-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 2.5) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-snake-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-snake) + :engine (new 'static 'vehicle-engine-info + :max-torque 167772160.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 14.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.75 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38912.0 + :tire-steering-speed-bias 36864.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 2.178 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 1.4157 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 737280.0 + :ground-torque-scale 0.55 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2048.0 :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "snake-scrape") + :glance-sound (static-sound-name "snake-glance") + :impact-sound (static-sound-name "snake-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "snake-flutter") + :water-sound (static-sound-name "snake-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "snake-idle") + :engine-sound (static-sound-name "snake-steady") + :susp-creak-sound (static-sound-name "snake-bounce") + :susp-bottom-out-sound (static-sound-name "snake-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 39.996 + :inv-hit-points 0.025002502 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.2 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-snake" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-snake" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-snake) + ) + ) + +;; definition for symbol *v-scorpion-constants*, type rigid-body-vehicle-constants +(define *v-scorpion-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 24.0 + :inv-mass 0.041666668 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y -4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 8) (meters 4) (meters 8)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-scorpion-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-scorpion) + :engine (new 'static 'vehicle-engine-info + :max-torque 335544320.0 + :inertia 65536.0 + :drag 0.4 + :idle-rpm 500.0 + :clutch-min-rpm 800.0 + :clutch-max-rpm 5100.0 + :min-rpm 300.0 + :max-rpm 6500.0 + :peak-torque-rpm 3400.0 + :powerband-width-rpm 4180.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 16384.0 + :upshift-rpm 5000.0 + :downshift-rpm 1000.0 + :final-drive-ratio 30.0 + :gear-ratio-array (new 'static 'array float 8 -1.35 1.8225001 1.35 1.0 0.0 0.0 0.0 0.0) + :gear-count 4 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 0.5 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.2 + :player-turn-anim-min -0.2 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 2002.4889 + :tire-steering-speed-factor 40960.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.8 + :tire-friction-factor 1.0 + :tire-static-friction 1.0 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.65 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.4 + :rolling-resistance 0.16 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 3.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 512000.0 + :air-pitch-torque 1024000.0 + :air-angular-damping 0.98 + :hop-turn-torque 2580480.0 + :ground-torque-scale 0.75 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 6.5) + :string-max-height (meters 6.5) + :string-min-length (meters 10.049999) + :string-max-length (meters 13.125) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2867.2 :y 6144.0 :z 8601.6 :w 1.0) + (new 'static 'vector :x -40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :x 40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :y 30720.0 :z 40960.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "scorp-scrape") + :glance-sound (static-sound-name "scorp-glance") + :impact-sound (static-sound-name "scorp-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "scorp-flutter") + :water-sound (static-sound-name "scorp-water") + :jump-sound (static-sound-name "scorp-hop") + :turbo-sound (static-sound-name "scorp-boost") + :bank-replace '((wasall1 wasscorp)) + :idle-rpm 700.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 800.0 + :engine-rpm 2500.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "scorp-start") + :stop-sound (static-sound-name "scorp-stop") + :idle-sound (static-sound-name "scorp-idle") + :engine-sound (static-sound-name "scorp-steady") + :susp-creak-sound (static-sound-name "scorp-bounce") + :susp-bottom-out-sound (static-sound-name "scorp-bottom") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "scorp-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 4096.0 :z -7372.8 :w 1.0) + (new 'static 'vector :x -3686.4 :y 4096.0 :z -7372.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 4915.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 4915.2 :z -4096.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :y 1.0 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :z -1638.4 :w 1.0) + (new 'static 'vector :x -6144.0 :z -1638.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector :x -5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7577.6 :y -2048.0 :z -18022.4 :w 1.0) + (new 'static 'vector :x -7577.6 :y -2048.0 :z -18022.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 79.992 + :inv-hit-points 0.012501251 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 3686.4 :y -4096.0 :z 14336.0 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 12288.0 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7864.3203 + :probe-y-offset -4423.68 + :width 2048.0 + :suspension-spring 0.36 + :suspension-damping 0.2 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.81 + :probe-radius 4096.0 + :tread-texture "tread-scorpion" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 3686.4 :y -4096.0 :z -12492.8 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 12288.0 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7864.3203 + :probe-y-offset -4423.68 + :width 2048.0 + :suspension-spring 0.36 + :suspension-damping 0.2 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 4096.0 + :tread-texture "tread-scorpion" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 13598.72 + :settle-rot-x -163.84 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -2730.6667 + :gun-pitch-max 5461.3335 + :gun-z-offset 11059.2 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :attach-point-count 14 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -3072.0 :y 204.8 :z 12697.6 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 3072.0 :y 204.8 :z 12697.6 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x -1638.4 :y 6963.2 :z 13107.2 :w 1.0) + (new 'static 'vector :x -4300.8 :y 6963.2 :z 13107.2 :w 1.0) + ) + :attach-point-array (new 'static 'inline-array vehicle-attach-point 14 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z 7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y -1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y 1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 2048.0 :z -16384.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z -15155.2 :w 1.0) + :rot (new 'static 'vector :x -9102.223 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z 7281.778 :w 1.0) + ) + ) + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-scorpion) + ) + ) + +;; definition for symbol *v-toad-constants*, type rigid-body-vehicle-constants +(define *v-toad-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 16.0 + :inv-mass 0.0625 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 819.2 :z 2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 4) (meters 10)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-toad-constants* + :flags #x386318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-toad) + :engine (new 'static 'vehicle-engine-info + :max-torque 117440510.0 + :inertia 8192.0 + :drag 0.4 + :idle-rpm 500.0 + :clutch-min-rpm 800.0 + :clutch-max-rpm 5100.0 + :min-rpm 300.0 + :max-rpm 6500.0 + :peak-torque-rpm 3400.0 + :powerband-width-rpm 4180.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 4096.0 + :upshift-rpm 5000.0 + :downshift-rpm 2000.0 + :final-drive-ratio 20.0 + :gear-ratio-array (new 'static 'array float 8 -1.8225001 2.4603753 1.8225001 1.35 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 60.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.8 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4551.1113 + :tire-steering-speed-factor 45056.0 + :tire-steering-speed-bias 36864.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.694 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 1.1011 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.3 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 2.0 + :jump-thrust-factor 2.4 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 151552.0 + :air-pitch-torque 307200.0 + :air-angular-damping 0.98 + :hop-turn-torque 614400.0 + :ground-torque-scale 0.4 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 3) + :string-max-height (meters 4.5) + :string-min-length (meters 6) + :string-max-length (meters 9) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :normal-max-angle-offset 21845.334 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2048.0 :y 10649.6 :z -4915.2 :w 1.0) + (new 'static 'vector :x -40960.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 40960.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 40960.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "toad-scrape") + :glance-sound (static-sound-name "toad-glance") + :impact-sound (static-sound-name "toad-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "toad-flutter") + :water-sound (static-sound-name "toad-water") + :jump-sound (static-sound-name "toad-hop") + :turbo-sound (static-sound-name "toad-boost") + :bank-replace '((wasall1 wastoad)) + :idle-rpm 900.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 700.0 + :engine-rpm 5300.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "toad-start") + :stop-sound (static-sound-name "toad-stop") + :idle-sound (static-sound-name "toad-idle") + :engine-sound (static-sound-name "toad-steady") + :susp-creak-sound (static-sound-name "toad-bounce") + :susp-bottom-out-sound (static-sound-name "toad-bottom") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "toad-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :taillight-count 2 + :thruster-flame-width (meters 1) + :thruster-flame-length (meters 6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y 5447.68 :z -14336.0 :w 1.0) + (new 'static 'vector :y 5447.68 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y -1228.8 :z -5324.8 :w 1.0) + (new 'static 'vector :x -2457.6 :y -1228.8 :z -5324.8 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -1638.4 :w 1.0) + (new 'static 'vector :x -3072.0 :z -1638.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2457.6 :y 9830.4 :z -8192.0 :w 1.0) + (new 'static 'vector :x -2457.6 :y 9830.4 :z -8192.0 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.6666667 + :hit-points 49.995 + :inv-hit-points 0.020002 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :y -3686.4 :z 19456.0 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf4) + :inertia 2048000.0 + :radius 4915.2 + :susp-arm-length 12288.0 + :steer-arm-length 2048.0 + :scale 1.0 + :travel 12288.0 + :width 4096.0 + :suspension-spring 0.3 + :suspension-damping 0.051 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.606 + :probe-radius 4096.0 + :tread-texture "tread-toad" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 2048.0 :y 819.2 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 4915.2 + :susp-arm-length 13516.8 + :scale 1.5 + :travel 8601.6 + :probe-y-offset -3686.4001 + :width 2867.2 + :suspension-spring 0.65 + :suspension-damping 0.1 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 4096.0 + :tread-texture "tread-toad" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 9338.88 + :settle-rot-x 91.022224 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2457.6 :y 3276.8 :z -1228.8 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1228.8 :y 942.08 :z -860.16 :w 1.0) + (new 'static 'vector :x -1433.6 :y 942.08 :z -860.16 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-toad) + ) + ) + +;; definition for symbol *v-fox-constants*, type rigid-body-vehicle-constants +(define *v-fox-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-fox-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-fox) + :engine (new 'static 'vehicle-engine-info + :max-torque 218103800.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 11.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.32 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 491520.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "snake-scrape") + :glance-sound (static-sound-name "snake-glance") + :impact-sound (static-sound-name "snake-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "snake-flutter") + :water-sound (static-sound-name "snake-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "snake-idle") + :engine-sound (static-sound-name "snake-steady") + :susp-creak-sound (static-sound-name "snake-bounce") + :susp-bottom-out-sound (static-sound-name "snake-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 1) + :thruster-flame-length (meters 6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 33.329998 + :inv-hit-points 0.030003002 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 4915.2 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 0.83199996 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 4096.0 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-toad" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 4915.2 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.04 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-toad" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 1638.4 :z -5324.8 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-fox) + ) + ) + +;; definition for symbol *v-rhino-constants*, type rigid-body-vehicle-constants +(define *v-rhino-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 30.0 + :inv-mass 0.033333335 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y -4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 7) (meters 4) (meters 8)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-rhino-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-rhino) + :engine (new 'static 'vehicle-engine-info + :max-torque 335544320.0 + :inertia 65536.0 + :drag 0.4 + :idle-rpm 500.0 + :clutch-min-rpm 800.0 + :clutch-max-rpm 5100.0 + :min-rpm 300.0 + :max-rpm 6500.0 + :peak-torque-rpm 3400.0 + :powerband-width-rpm 4180.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 16384.0 + :upshift-rpm 5000.0 + :downshift-rpm 1000.0 + :final-drive-ratio 28.0 + :gear-ratio-array (new 'static 'array float 8 -1.35 2.4603753 1.8225001 1.35 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 4.0 + :turbo-boost-duration (seconds 0.25) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 2002.4889 + :tire-steering-speed-factor 51200.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.8 + :tire-friction-factor 1.0 + :tire-static-friction 0.9 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.585 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.4 + :rolling-resistance 0.16 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 3.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.125 + :player-weight 122880.0 + :air-roll-torque 512000.0 + :air-pitch-torque 1024000.0 + :air-angular-damping 0.98 + :hop-turn-torque 4300800.0 + :ground-torque-scale 0.37 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 5.655) + :string-max-height (meters 5.655) + :string-min-length (meters 10.049999) + :string-max-length (meters 13.125) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -4915.2 :y 14336.0 :z -8192.0 :w 1.0) + (new 'static 'vector :x -40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :x 40960.0 :y 30720.0 :w 1.0) + (new 'static 'vector :y 30720.0 :z 40960.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "rhino-scrape") + :glance-sound (static-sound-name "rhino-glance") + :impact-sound (static-sound-name "rhino-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :water-sound (static-sound-name "rhino-water") + :jump-sound (static-sound-name "rhino-hop") + :turbo-sound (static-sound-name "rhino-boost") + :bank-replace '((wasall1 wasrhino)) + :idle-rpm 500.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 800.0 + :engine-rpm 3785.0 + :engine-crossover-rpm 1400.0 + :start-sound (static-sound-name "rhino-start") + :stop-sound (static-sound-name "rhino-stop") + :idle-sound (static-sound-name "rhino-idle") + :engine-sound (static-sound-name "rhino-steady") + :susp-creak-sound (static-sound-name "rhino-bounce") + :susp-bottom-out-sound (static-sound-name "rhino-bottom") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "rhino-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 1.5) + :thruster-flame-length (meters 5) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 4915.2 :y 2744.32 :z -19660.8 :w 1.0) + (new 'static 'vector :x -4915.2 :y 2744.32 :z -19660.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 4915.2 :z -4096.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 4915.2 :z -4096.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :y 1.0 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :z -1638.4 :w 1.0) + (new 'static 'vector :x -6144.0 :z -1638.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector :x -5939.2 :y -1228.8 :z 18841.6 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 7577.6 :y -2048.0 :z -18022.4 :w 1.0) + (new 'static 'vector :x -7577.6 :y -2048.0 :z -18022.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 79.992 + :inv-hit-points 0.012501251 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 7372.8 :y -4096.0 :z 15769.6 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 7372.8 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7208.9604 + :probe-y-offset -5079.0396 + :width 1638.4 + :suspension-spring 0.55 + :suspension-damping 0.3 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.81 + :probe-radius 4505.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 7372.8 :y -4096.0 :z -12902.4 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf4) + :inertia 32768000.0 + :radius 2048.0 + :susp-arm-length 8192.0 + :steer-arm-length 2048.0 + :scale 4.0 + :travel 7208.9604 + :probe-y-offset -5079.0396 + :width 1638.4 + :suspension-spring 0.55 + :suspension-damping 0.3 + :forward-grip 1.3 + :side-grip 1.4 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 4505.6 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 14663.68 + :settle-rot-x -163.84 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -21845.334 + :gun-yaw-max 21845.334 + :gun-pitch-min -5461.3335 + :gun-pitch-max 8192.0 + :gun-z-offset 6963.2 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :attach-point-count 14 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -4915.2 :y 4915.2 :z -4096.0 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 4915.2 :y 4915.2 :z -4096.0 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 614.4 :z -1024.0 :w 1.0) + (new 'static 'vector :x -1638.4 :y 614.4 :z -1024.0 :w 1.0) + ) + :attach-point-array (new 'static 'inline-array vehicle-attach-point 14 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z 16384.0 :w 1.0) + :rot (new 'static 'vector :x -3640.889 :y 32768.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z 7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z 14336.0 :w 1.0) + :rot (new 'static 'vector :x -7281.778 :y 32768.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :z 4096.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y -16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -7372.8 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :y 16384.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y -1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :y 4096.0 :z 2048.0 :w 1.0) + :rot (new 'static 'vector :x -1820.4445 :y 1820.4445 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 2867.2 :y 2048.0 :z -16384.0 :w 1.0) + :rot (new 'static 'vector :x -12743.111 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -2867.2 :z -15155.2 :w 1.0) + :rot (new 'static 'vector :x -9102.223 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z -7281.778 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6144.0 :y 2048.0 :z -14336.0 :w 1.0) + :rot (new 'static 'vector :x -8192.0 :z 7281.778 :w 1.0) + ) + ) + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-rhino) + ) + ) + +;; definition for symbol *v-mirage-constants*, type rigid-body-vehicle-constants +(define *v-mirage-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 10.0 + :inv-mass 0.1 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5.5) (meters 3) (meters 7)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-mirage-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-mirage) + :engine (new 'static 'vehicle-engine-info + :max-torque 218103800.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 12.5 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 2.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 1392640.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2048.0 :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "mir-scrape") + :glance-sound (static-sound-name "mir-glance") + :impact-sound (static-sound-name "mir-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "mir-flutter") + :water-sound (static-sound-name "mir-water") + :jump-sound (static-sound-name "mir-hop") + :turbo-sound (static-sound-name "mir-boost") + :bank-replace '((wasall1 wasmir)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "mir-start") + :stop-sound (static-sound-name "mir-stop") + :idle-sound (static-sound-name "mir-idle") + :engine-sound (static-sound-name "mir-steady") + :susp-creak-sound (static-sound-name "mir-bounce") + :susp-bottom-out-sound (static-sound-name "mir-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "mir-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.8 + :hit-points 46.662 + :inv-hit-points 0.021430716 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.1 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 0.75 :y 0.9 :z 1.05 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-mirage) + ) + ) + +;; definition for symbol *v-x-ride-constants*, type rigid-body-vehicle-constants +(define *v-x-ride-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 3) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-x-ride-constants* + :flags #x387318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-x-ride) + :engine (new 'static 'vehicle-engine-info + :max-torque 234881020.0 + :inertia 16384.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 600.0 + :max-rpm 7500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 3200.0 + :final-drive-ratio 10.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 3355443200.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.694 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 1.1011 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.3 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.6 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 491520.0 + :ground-torque-scale 0.75 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "snake-scrape") + :glance-sound (static-sound-name "snake-glance") + :impact-sound (static-sound-name "snake-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "snake-flutter") + :water-sound (static-sound-name "snake-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "snake-idle") + :engine-sound (static-sound-name "snake-steady") + :susp-creak-sound (static-sound-name "snake-bounce") + :susp-bottom-out-sound (static-sound-name "snake-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "snake-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 1) + :thruster-flame-length (meters 6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + (new 'static 'vector :y 3686.4 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 39.996 + :inv-hit-points 0.025002502 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.2 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-snake" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.76 + :probe-radius 2867.2 + :tread-texture "tread-snake" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5324.8 + :settle-rot-x 764.5866 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 0.9 :y 1.1 :z 0.9 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 1638.4 :z -5324.8 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + :name-text (text-id progress-inventory-v-x-ride) + ) + ) + +;; definition for symbol *v-marauder-constants*, type rigid-body-vehicle-constants +(define *v-marauder-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 2.5) (meters 6.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-marauder-constants* + :flags #x81310 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-marauder) + :engine (new 'static 'vehicle-engine-info + :max-torque 117440510.0 + :inertia 16384.0 + :drag 0.4 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 700.0 + :max-rpm 6500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 2000.0 + :final-drive-ratio 12.5 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1677721600.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 1392640.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6963.2 :z -6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "inter-scrape") + :glance-sound (static-sound-name "inter-glance") + :impact-sound (static-sound-name "inter-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "inter-flutter") + :water-sound (static-sound-name "inter-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "inter-idle") + :engine-sound (static-sound-name "inter-steady") + :susp-creak-sound (static-sound-name "inter-bounce") + :susp-bottom-out-sound (static-sound-name "inter-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 2.0 + :hit-points 30.0 + :inv-hit-points 0.033333335 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1843.2 :y 901.12 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 5939.2 + :steer-arm-length 1638.4 + :scale 1.2 + :travel 4055.04 + :probe-y-offset -2580.48 + :width 3276.8 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 546.13336 + :settle-pos 0.78 + :probe-radius 2457.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 1351.68 :y 1638.4 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 8069.12 + :steer-arm-length 1638.4 + :scale 1.5 + :travel 4300.8 + :probe-y-offset -4710.4 + :width 3276.8 + :suspension-spring 0.5 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :camber 1820.4445 + :settle-pos 0.8 + :probe-radius 2867.2 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5488.64 + :settle-rot-x 728.1778 + :shadow-bot-clip -32768.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; definition for symbol *v-faccar-constants*, type rigid-body-vehicle-constants +(define *v-faccar-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 819.2 :z -409.6 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6.5) (meters 3) (meters 8)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-faccar-constants* + :flags #x287318 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-faccar) + :engine (new 'static 'vehicle-engine-info + :max-torque 83886080.0 + :inertia 8192.0 + :drag 0.2 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 4000.0 + :min-rpm 700.0 + :max-rpm 6000.0 + :peak-torque-rpm 3200.0 + :powerband-width-rpm 4000.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 4096.0 + :upshift-rpm 4500.0 + :downshift-rpm 2900.0 + :final-drive-ratio 9.0 + :gear-ratio-array (new 'static 'array float 8 -3.375 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 5033165000.0 + :turbo-boost-factor 2.0 + :turbo-boost-duration (seconds 0.25) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4551.1113 + :tire-steering-speed-factor 34816.0 + :tire-steering-speed-bias 40960.0 + :ackermann-factor 0.3 + :tire-friction-factor 1.0 + :tire-static-friction 1.516 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.98539996 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 2.0 + :jump-thrust-factor 1.5 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 40960.0 + :air-pitch-torque 81920.0 + :air-angular-damping 0.97 + :hop-turn-torque 1228800.0 + :ground-torque-scale 0.45 + :ai-steering-factor 4.0 + :ai-throttle-factor 0.5 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :x -2457.6 :y 9011.2 :z -4915.2 :w 1.0) + (new 'static 'vector :x -20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :x 20480.0 :y 12288.0 :w 1.0) + (new 'static 'vector :y 12288.0 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "fac-scrape-mtl") + :glance-sound (static-sound-name "fac-glance") + :impact-sound (static-sound-name "fac-impact-hard") + :explode-sound (static-sound-name "fac-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "fac-flutter") + :water-sound (static-sound-name "fac-water") + :jump-sound (static-sound-name "fac-hop") + :turbo-sound (static-sound-name "fac-boost") + :bank-replace '((factory6 facveh)) + :idle-rpm 1400.0 + :idle-pitch-scale 0.25 + :idle-crossover-rpm 1500.0 + :engine-rpm 2500.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "fac-start") + :stop-sound (static-sound-name "fac-stop") + :idle-sound (static-sound-name "fac-idle") + :engine-sound (static-sound-name "fac-steady") + :susp-creak-sound (static-sound-name "fac-bounce") + :susp-bottom-out-sound (static-sound-name "fac-bottom") + :susp-speed-threshold 81920.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-hum") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "fac-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 1 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 1843.2 :z -14336.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 1843.2 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 1843.2 :z -14336.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 1843.2 :z -14336.0 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1024.0 :y 5120.0 :z -10240.0 :w 1.0) + (new 'static 'vector :x -1024.0 :y 5120.0 :z -10240.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x -2867.2 :y 6963.2 :z 11059.2 :w 1.0) + (new 'static 'vector) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 7987.2 :z -12083.2 :w 1.0) + (new 'static 'vector :x -1638.4 :y 7987.2 :z -12083.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.8333333 + :hit-points 29.997 + :inv-hit-points 0.033336665 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 0.3333 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 4464.64 :y -655.36 :z 7864.32 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf4) + :inertia 4300800.0 + :radius 3481.6 + :susp-arm-length 4096.0 + :steer-arm-length 1638.4 + :scale 1.0 + :travel 2457.6 + :probe-y-offset -3276.8 + :width 4096.0 + :suspension-spring 0.4 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 1720.32 + :tread-texture "tread-scorpion" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 4444.16 :y -532.48 :z -12083.2 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2) + :inertia 4915200.0 + :radius 3481.6 + :susp-arm-length 4096.0 + :steer-arm-length 2048.0 + :scale 1.2 + :travel 2867.2 + :probe-y-offset -3276.8 + :width 4096.0 + :suspension-spring 0.7 + :suspension-damping 0.4 + :forward-grip 1.15 + :side-grip 1.15 + :max-brake-torque 1.0 + :settle-pos 0.79 + :probe-radius 2048.0 + :tread-texture "tread-scorpion" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5693.44 + :settle-rot-x -691.76886 + :shadow-bot-clip -61440.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 1 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2457.6 :y 1187.84 :z -819.2 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1228.8 :y 614.4 :z -368.64 :w 1.0) + (new 'static 'vector :x -1228.8 :y 614.4 :z -368.64 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; definition for symbol *v-catapult-constants*, type rigid-body-vehicle-constants +(define *v-catapult-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 32.0 + :inv-mass 0.03125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.5 + :cm-offset-joint (new 'static 'vector :y 409.6 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 12) (meters 8) (meters 25)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 40) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*v-catapult-constants* + :flags #x80010 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 v-catapult) + :engine (new 'static 'vehicle-engine-info + :max-torque 117440510.0 + :inertia 16384.0 + :drag 0.4 + :idle-rpm 900.0 + :clutch-min-rpm 2000.0 + :clutch-max-rpm 5500.0 + :min-rpm 700.0 + :max-rpm 6500.0 + :peak-torque-rpm 3800.0 + :powerband-width-rpm 4100.0 + ) + :transmission (new 'static 'vehicle-transmission-info + :inertia 8192.0 + :upshift-rpm 5500.0 + :downshift-rpm 2000.0 + :final-drive-ratio 25.0 + :gear-ratio-array (new 'static 'array float 8 -2.25 3.375 2.25 1.5 1.0 0.0 0.0 0.0) + :gear-count 5 + ) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 10.0 + :engine-intake-factor 1.0 + :brake-factor 1677721600.0 + :turbo-boost-factor 0.9 + :turbo-boost-duration (seconds 2) + :max-xz-speed (meters 30) + :player-turn-anim-bias 0.5 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 1.0 + :air-drag-factor 1.0 + :steering-fin-angle 1820.4445 + :steering-thruster-factor 1.0 + :steering-thruster-max-gain 1.0 + :steering-thruster-half-gain-speed (meters 30) + :tire-steering-angle 4369.067 + :tire-steering-speed-factor 38379.52 + :tire-steering-speed-bias 20480.0 + :ackermann-factor 0.45 + :tire-friction-factor 1.0 + :tire-static-friction 1.3310001 + :tire-static-friction-speed (meters 2) + :tire-dynamic-friction 0.86515 + :tire-dynamic-friction-speed (meters 4) + :tire-inv-max-friction-speed 0.000024414063 + :airfoil-factor 1.0 + :drag-force-factor 0.35 + :rolling-resistance 0.08 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 1.0 + :pitch-control-factor 1.0 + :roll-control-factor 1.0 + :jump-thrust-factor 1.0 + :buoyancy-factor 0.03 + :water-drag-factor 0.25 + :player-weight 122880.0 + :air-roll-torque 81920.0 + :air-pitch-torque 163840.0 + :air-angular-damping 0.98 + :hop-turn-torque 1392640.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 15) + :string-min-length (meters 5) + :string-max-length (meters 15.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 6963.2 :z -6144.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :x 20480.0 :y 19251.2 :w 1.0) + (new 'static 'vector :y 19251.2 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.5 + :engine-pitch-mod-amp 0.05 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "inter-scrape") + :glance-sound (static-sound-name "inter-glance") + :impact-sound (static-sound-name "inter-crash") + :explode-sound (static-sound-name "car-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "inter-load") + :water-sound (static-sound-name "inter-water") + :jump-sound (static-sound-name "snake-hop") + :turbo-sound (static-sound-name "snake-boost") + :bank-replace '((wasall1 wassnake)) + :idle-rpm 1300.0 + :idle-pitch-scale 0.5 + :idle-crossover-rpm 1000.0 + :engine-rpm 4700.0 + :engine-crossover-rpm 2500.0 + :start-sound (static-sound-name "snake-start") + :stop-sound (static-sound-name "snake-stop") + :idle-sound (static-sound-name "inter-idle") + :engine-sound (static-sound-name "inter-steady") + :susp-creak-sound (static-sound-name "inter-bounce") + :susp-bottom-out-sound (static-sound-name "inter-bottom") + :susp-speed-threshold 61440.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-road") + :speed 40960.0 + :min-speed 20480.0 + :max-speed 61440.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-dirt") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-sand") + :speed 40960.0 + :max-speed 40960.0 + :pitch-offset -0.5 + :pitch-scale 0.25 + :min-pitch -2.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-knobby") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 40960.0 + :pitch-scale 0.125 + :min-pitch -0.2 + :max-pitch 0.2 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-road") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :sound (static-sound-name "inter-skid-dirt") + :speed 40960.0 + :min-speed 8192.0 + :max-speed 16384.0 + :pitch-offset -0.0625 + :pitch-scale 0.0625 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 2) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4505.6 :z -15564.8 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4505.6 :z -15564.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -15974.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -15974.4 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.6666667 + :hit-points 80.0 + :inv-hit-points 0.0125 + :hit-threshold 8192.0 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :inv-lift-thruster-count 1.0 + :engine-thrust-local-pos (new 'static 'vector :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 20480.0 :y -2048.0 :z 15687.68 :w 1.0) + :flags (vehicle-wheel-flag vwf1 vwf3 vwf4) + :inertia 6144000.0 + :radius 3399.68 + :susp-arm-length 9420.8 + :steer-arm-length 2457.6 + :scale 2.4 + :travel 9011.2 + :probe-y-offset -4096.0 + :width 4096.0 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 0.9 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.78 + :probe-radius 409.6 + :tread-texture "tread-interceptor-rhino" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :x 14336.0 :y -4096.0 :z -24166.4 :w 1.0) + :flags (vehicle-wheel-flag vwf0 vwf1 vwf2 vwf3 vwf5) + :inertia 10240000.0 + :radius 3399.68 + :susp-arm-length 10240.0 + :steer-arm-length 3276.8 + :scale 2.4 + :travel 8192.0 + :probe-y-offset -2867.2 + :width 4096.0 + :suspension-spring 0.6 + :suspension-damping 0.3 + :forward-grip 1.5 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "tread-interceptor-rhino" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 5488.64 + :settle-rot-x 728.1778 + :shadow-bot-clip -32768.0 + :shadow-locus-dist 204800.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x2 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 819.2 :z -720.896 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 819.2 :z -720.896 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1310.72 :y 409.6 :z -614.4 :w 1.0) + (new 'static 'vector :x -1310.72 :y 409.6 :z -409.6 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; definition for symbol *wcar-explosion-info*, type vehicle-explosion-info +(define *wcar-explosion-info* + (new 'static 'vehicle-explosion-info + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'wasall + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +;; failed to figure out what this is: +(set! (-> *v-turtle-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-snake-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-scorpion-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-toad-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-fox-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-rhino-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-mirage-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-x-ride-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-marauder-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-faccar-constants* explosion) *wcar-explosion-info*) + +;; failed to figure out what this is: +(set! (-> *v-catapult-constants* explosion) *wcar-explosion-info*) + +;; definition of type wcar-base +(deftype wcar-base (wvehicle) + ((rider-hand-joint-array int8 2) + ) + ) + +;; definition for method 3 of type wcar-base +(defmethod inspect ((this wcar-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wvehicle inspect))) + (t9-0 this) + ) + (format #t "~2Trider-hand-joint-array[2] @ #x~X~%" (-> this rider-hand-joint-array)) + (label cfg-4) + this + ) + +;; definition for method 113 of type wcar-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-113 ((this wcar-base) (arg0 vector) (arg1 int) (arg2 int)) + (vector-matrix*! + arg0 + (-> this info rider rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) + ) + 0 + (none) + ) + +;; definition of type wcar-snake-base +(deftype wcar-snake-base (wcar-base) + ((local-gun-pos vector 2 :inline) + (jmod-axles joint-mod-rotate-local 4 :inline) + (jmod-shock-tops joint-mod-rotate-local 4 :inline) + (jmod-shock-mids joint-mod-set-local 4 :inline) + (jmod-guns joint-mod-set-local 2 :inline) + ) + ) + +;; definition for method 3 of type wcar-snake-base +(defmethod inspect ((this wcar-snake-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wcar-base inspect))) + (t9-0 this) + ) + (format #t "~2Tlocal-gun-pos[2] @ #x~X~%" (-> this local-gun-pos)) + (format #t "~2Tjmod-axles[4] @ #x~X~%" (-> this jmod-axles)) + (format #t "~2Tjmod-shock-tops[4] @ #x~X~%" (-> this jmod-shock-tops)) + (format #t "~2Tjmod-shock-mids[4] @ #x~X~%" (-> this jmod-shock-mids)) + (format #t "~2Tjmod-guns[2] @ #x~X~%" (-> this jmod-guns)) + (label cfg-4) + this + ) + +;; definition for method 169 of type wcar-snake-base +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod wvehicle-method-169 ((this wcar-snake-base)) + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((s5-0 (new 'stack-no-clear 'wcar-proj-init-by-other-params))) + (set! (-> s5-0 barrel-idx) (-> this i-barrel)) + (set! (-> s5-0 vec0 7 x) 16384.0) + (set! (-> s5-0 vec0 7 y) 409600.0) + (set! (-> s5-0 vec0 7 w) 0.1736) + (set! (-> s5-0 vec0 7 z) 0.0) + (when (and (task-node-closed? (game-task-node desert-final-boss-introduction)) + (not (task-node-closed? (game-task-node desert-final-boss-resolution))) + ) + (set! (-> s5-0 vec0 7 x) 32768.0) + (set! (-> s5-0 vec0 7 w) 0.3419) + (set! (-> s5-0 vec0 7 z) -0.1736) + ) + (let* ((v1-13 (-> s5-0 mat0)) + (a3-0 (-> this rbody matrix)) + (a0-4 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-13 rvec quad) a0-4) + (set! (-> v1-13 uvec quad) a1-0) + (set! (-> v1-13 fvec quad) a2-0) + (set! (-> v1-13 trans quad) a3-1) + ) + (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) + ) + (vector-matrix*! (the-as vector (-> s5-0 vec0)) (-> this local-gun-pos (-> s5-0 barrel-idx)) (-> s5-0 mat0)) + 0 + (set! (-> s5-0 vec0 2 quad) (-> (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) quad)) + (vector-rotate*! (-> s5-0 vec0 3) (-> s5-0 vec0 2) (-> s5-0 mat0)) + (vector-float*! (-> s5-0 vec0 4) (-> s5-0 vec0 3) (- (-> s5-0 vec0 7 y) (-> s5-0 vec0 7 x))) + (vector+float*! + (-> s5-0 vec0 1) + (the-as vector (-> s5-0 vec0)) + (-> s5-0 vec0 3) + (+ 16384.0 (-> s5-0 vec0 7 x)) + ) + (let ((s4-0 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> s4-0 length) (fill-actor-list-for-sphere + *actor-hash* + (-> s5-0 vec0 1) + (-> s5-0 vec0 4) + (-> s5-0 vec0 7 x) + (the-as (pointer collide-shape) (-> s4-0 data)) + (-> s4-0 allocated-length) + -1 + ) + ) + (let ((a0-14 (find-nearest-focusable + (the-as (array collide-shape) s4-0) + (-> s5-0 vec0 1) + (-> s5-0 vec0 7 y) + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> s5-0 vec0 3) + (the-as vector #f) + 2730.6667 + ) + ) + ) + (when a0-14 + (set! (-> s5-0 vec0 6 quad) (-> (get-trans a0-14 3) quad)) + (vector-! (-> s5-0 vec0 5) (-> s5-0 vec0 6) (the-as vector (-> s5-0 vec0))) + (matrix-transpose! (-> s5-0 mat1) (-> s5-0 mat0)) + (vector-matrix*! (-> s5-0 vec0 2) (-> s5-0 vec0 5) (-> s5-0 mat1)) + (set! (-> s5-0 vec0 2 x) 0.0) + (vector-normalize! (-> s5-0 vec0 2) 1.0) + (cond + ((< (-> s5-0 vec0 7 w) (-> s5-0 vec0 2 y)) + (set! (-> s5-0 vec0 2 y) (-> s5-0 vec0 7 w)) + (let ((f0-16 1.0) + (f1-3 (-> s5-0 vec0 7 w)) + ) + (set! (-> s5-0 vec0 2 z) (sqrtf (- f0-16 (* f1-3 f1-3)))) + ) + ) + ((< (-> s5-0 vec0 2 y) (-> s5-0 vec0 7 z)) + (set! (-> s5-0 vec0 2 y) (-> s5-0 vec0 7 z)) + (let ((f0-21 1.0) + (f1-7 (-> s5-0 vec0 7 z)) + ) + (set! (-> s5-0 vec0 2 z) (sqrtf (- f0-21 (* f1-7 f1-7)))) + ) + ) + ) + (if (< 0.0 (-> s5-0 vec0 2 z)) + (vector-rotate*! (-> s5-0 vec0 3) (-> s5-0 vec0 2) (-> s5-0 mat0)) + ) + ) + ) + ) + (vector-float*! (-> s5-0 vec0 4) (-> s5-0 vec0 3) (-> s5-0 vec0 7 y)) + (set! (-> s5-0 params ent) (-> this entity)) + (set! (-> s5-0 params charge) 1.0) + (set! (-> s5-0 params options) (projectile-options)) + (logclear! (-> s5-0 params options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 params pos quad) (-> s5-0 vec0 0 quad)) + (set! (-> s5-0 params vel quad) (-> s5-0 vec0 4 quad)) + (set! (-> s5-0 params notify-handle) (the-as handle #f)) + (set! (-> s5-0 params owner-handle) (process->handle this)) + (set! (-> s5-0 params target-handle) (the-as handle #f)) + (set! (-> s5-0 params target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 params ignore-handle) (process->handle this)) + (let* ((v1-58 *game-info*) + (a0-35 (+ (-> v1-58 attack-id) 1)) + ) + (set! (-> v1-58 attack-id) a0-35) + (set! (-> s5-0 params attack-id) a0-35) + ) + (set! (-> s5-0 params timeout) (seconds 4)) + (spawn-projectile v-snake-shot (-> s5-0 params) *rigid-body-queue-manager* *default-dead-pool*) + (let ((v1-63 (-> this jmod-guns (-> s5-0 barrel-idx)))) + (set! (-> v1-63 transform trans z) -3276.8) + ) + ) + (none) + ) + +;; definition for method 34 of type wcar-snake-base +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this wcar-snake-base)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 80)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-22 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-22 transform-index) 0) + (set! (-> v1-22 nav-radius) 20480.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 62 of type wcar-snake-base +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this wcar-snake-base)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -8192.0 :y 1638.4 :z 7864.32 :w 3276.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -9011.2 :y 2048.0 :z -11878.4 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 3317.76 :z 9011.2 :w 4915.2)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 3686.4 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 3276.8 :z -14336.0 :w 6144.0)) + 16 + ) + (set! (-> (the-as collide-shape-prim-group s5-0) child 7 local-sphere w) 20889.6) + ) + ((method-of-type wcar-base vehicle-method-62) this) + 0 + (none) + ) + +;; definition for method 79 of type wcar-snake-base +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this wcar-snake-base)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (set-vector! (-> s5-0 2) 1092.2667 1092.2667 0.0 0.0) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let ((s3-0 (-> this wheel s4-0))) + (-> s3-0 info) + (quaternion-set! + (-> s5-0 0) + 0.0 + 0.0 + (* (-> s3-0 sin-susp-ang) (-> s3-0 x-scale)) + (+ 1.0 (-> s3-0 cos-susp-ang)) + ) + (quaternion-normalize! (-> s5-0 0)) + (quaternion-axis-angle! (-> s5-0 1) 0.0 0.0 (-> s3-0 x-scale) (-> (&-> s5-0 0 data s4-0) 8)) + ) + (let ((v1-10 (-> this jmod-axles s4-0))) + (quaternion*! (-> v1-10 rotation) (-> s5-0 0) (-> s5-0 1)) + ) + 0 + ) + ) + (let ((s5-1 (new 'stack-no-clear 'wcar-stack-type1))) + (let* ((v1-16 (-> s5-1 vec0)) + (a3-2 (-> this node-list data 0 bone transform)) + (a0-9 (-> a3-2 rvec quad)) + (a1-3 (-> a3-2 uvec quad)) + (a2-3 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> v1-16 0 quad) a0-9) + (set! (-> v1-16 1 quad) a1-3) + (set! (-> v1-16 2 quad) a2-3) + (set! (-> v1-16 3 quad) a3-3) + ) + (set! (-> s5-1 vec0 4 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) + (set! (-> s5-1 vec0 5 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) + (set! (-> s5-1 vec0 6 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) + (set! (-> s5-1 vec0 7 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) + (set-vector! (-> s5-1 vec0 8) 25486.223 25486.223 29127.111 29127.111) + (dotimes (s4-1 4) + (let ((s3-1 (-> this wheel s4-1))) + (let ((v1-25 (-> s3-1 info))) + (set! (-> s5-1 float0) (+ -2048.0 (-> v1-25 susp-arm-length))) + (set! (-> s5-1 vec1 0 quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) + (set! (-> s5-1 vec0 9 quad) (-> v1-25 local-pos quad)) + ) + (+! (-> s5-1 vec0 9 x) (* (-> s5-1 float0) (-> s3-1 cos-susp-ang))) + (+! (-> s5-1 vec0 9 y) (* (-> s5-1 float0) (-> s3-1 sin-susp-ang))) + (set! (-> s5-1 vec1 1 quad) (-> s5-1 vec0 9 quad)) + (set! (-> s5-1 vec1 1 x) (* (-> s5-1 vec1 1 x) (-> s3-1 x-scale))) + (set! (-> s5-1 vec1 0 x) (* (-> s5-1 vec1 0 x) (-> s3-1 x-scale))) + (vector-! (-> s5-1 vec1 2) (-> s5-1 vec1 1) (the-as vector (-> s5-1 vec1))) + (set! (-> s5-1 float2) + (- (-> s5-1 vec0 8 data s4-1) (* (atan (-> s5-1 vec1 2 x) (-> s5-1 vec1 2 y)) (-> s3-1 x-scale))) + ) + (let ((v1-34 (-> this jmod-shock-tops s4-1))) + (quaternion-axis-angle! (-> v1-34 rotation) 0.0 0.0 1.0 (-> s5-1 float2)) + ) + 0 + (let ((v1-38 (-> this jmod-shock-mids s4-1))) + (set! (-> v1-38 transform trans y) (* -1.0 (+ -3276.8 (vector-length (-> s5-1 vec1 2))) (-> s3-1 x-scale))) + ) + ) + 0 + 0 + ) + ) + (let ((f30-1 (seconds-per-frame))) + (dotimes (s5-2 2) + (let ((s4-2 (-> this jmod-guns s5-2))) + (seek! (-> s4-2 transform trans z) 0.0 (* 32768.0 f30-1)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-turtle turtle turtle-lod0-jg turtle-idle-ja + ((turtle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3.5) + :shadow turtle-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-turtle-wheel turtle turtle-wheel-lod0-jg turtle-wheel-idle-ja + ((turtle-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.75) + :shadow turtle-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-turtle-wheel-blur turtle turtle-wheel-blur-lod0-jg turtle-wheel-blur-idle-ja + ((turtle-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.75) + :shadow turtle-wheel-blur-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-snake snake snake-lod0-jg snake-idle-ja + ((snake-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow snake-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-snake-wheel snake snake-wheel-lod0-jg snake-wheel-idle-ja + ((snake-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-snake-wheel-blur snake snake-wheel-blur-lod0-jg snake-wheel-blur-idle-ja + ((snake-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-blur-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-scorpion scorpion scorpion-lod0-jg scorpion-idle-ja + ((scorpion-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7) + :shadow scorpion-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-scorpion-wheel scorpion scorpion-wheel-lod0-jg scorpion-wheel-idle-ja + ((scorpion-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.55) + :shadow scorpion-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-scorpion-wheel-blur scorpion scorpion-wheel-blur-lod0-jg scorpion-wheel-blur-idle-ja + ((scorpion-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.55) + :shadow scorpion-wheel-blur-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-toad toad toad-lod0-jg toad-idle-ja + ((toad-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + :shadow toad-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-toad-wheel toad toad-wheel-lod0-jg toad-wheel-idle-ja + ((toad-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.44) + :shadow toad-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-toad-wheel-blur toad toad-wheel-blur-lod0-jg toad-wheel-blur-idle-ja + ((toad-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.44) + :shadow toad-wheel-blur-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-fox fox fox-lod0-jg fox-idle-ja + ((fox-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow fox-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-fox-wheel fox fox-wheel-lod0-jg fox-wheel-idle-ja + ((fox-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-fox-wheel-blur fox fox-wheel-blur-lod0-jg fox-wheel-blur-idle-ja + ((fox-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-blur-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-rhino rhino rhino-lod0-jg rhino-idle-ja + ((rhino-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + :shadow rhino-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-rhino-wheel rhino rhino-wheel-lod0-jg rhino-wheel-idle-ja + ((rhino-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.59) + :shadow rhino-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-mirage snake snake-lod0-jg snake-idle-ja + ((snake-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow snake-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-mirage-wheel snake snake-wheel-lod0-jg snake-wheel-idle-ja + ((snake-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-mirage-wheel-blur snake snake-wheel-blur-lod0-jg snake-wheel-blur-idle-ja + ((snake-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow snake-wheel-blur-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-x-ride fox fox-lod0-jg fox-idle-ja + ((fox-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow fox-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-x-ride-wheel fox fox-wheel-lod0-jg fox-wheel-idle-ja + ((fox-wheel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-shadow-mg + ) + +;; failed to figure out what this is: +(defskelgroup skel-v-x-ride-wheel-blur fox fox-wheel-blur-lod0-jg fox-wheel-blur-idle-ja + ((fox-wheel-blur-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1.15) + :shadow fox-wheel-blur-shadow-mg + ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-h_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-h_REF.gc new file mode 100644 index 0000000000..6d4741cf31 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-h_REF.gc @@ -0,0 +1,641 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type wvehicle-sound-loop-state +(deftype wvehicle-sound-loop-state (structure) + ((id sound-id) + (vol float) + (pitch float) + ) + :allow-misaligned + ) + +;; definition for method 3 of type wvehicle-sound-loop-state +(defmethod inspect ((this wvehicle-sound-loop-state)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'wvehicle-sound-loop-state) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tvol: ~f~%" (-> this vol)) + (format #t "~1Tpitch: ~f~%" (-> this pitch)) + (label cfg-4) + this + ) + +;; definition of type vehicle-wheel-surface +(deftype vehicle-wheel-surface (structure) + ((flags vehicle-wheel-surface-flag) + (surface-type uint8) + (friction float) + (drag float) + (depth float) + (damage float) + (tire-roll-mix float 4) + (tire-roll-hum float :overlay-at (-> tire-roll-mix 0)) + (tire-roll-dirt float :overlay-at (-> tire-roll-mix 1)) + (tire-roll-sand float :overlay-at (-> tire-roll-mix 2)) + (tire-roll-knobby float :overlay-at (-> tire-roll-mix 3)) + (tire-slide-mix float 2) + (tire-slide-road float :overlay-at (-> tire-slide-mix 0)) + (tire-slide-dirt float :overlay-at (-> tire-slide-mix 1)) + ) + ) + +;; definition for method 3 of type vehicle-wheel-surface +(defmethod inspect ((this vehicle-wheel-surface)) + (when (not this) + (set! this this) + (goto cfg-23) + ) + (format #t "[~8x] ~A~%" this 'vehicle-wheel-surface) + (format #t "~1Tflags: #x~X : (vehicle-wheel-surface-flag " (-> this flags)) + (let ((a0-3 (-> this flags))) + (if (= (logand a0-3 (vehicle-wheel-surface-flag moving)) (vehicle-wheel-surface-flag moving)) + (format #t "moving ") + ) + ) + (format #t ")~%") + (let ((t9-4 format) + (a0-7 #t) + (a1-4 "~1Tsurface-type: #x~X : ~S~%") + (a2-2 (-> this surface-type)) + (v1-5 (-> this surface-type)) + ) + (t9-4 a0-7 a1-4 a2-2 (cond + ((= v1-5 5) + "wall" + ) + ((= v1-5 6) + "conveyor" + ) + ((zero? v1-5) + "stone" + ) + ((= v1-5 1) + "dirt" + ) + ((= v1-5 4) + "water" + ) + ((= v1-5 3) + "quicksand" + ) + ((= v1-5 7) + "none" + ) + ((= v1-5 2) + "sand" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tfriction: ~f~%" (-> this friction)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tdepth: ~f~%" (-> this depth)) + (format #t "~1Tdamage: ~f~%" (-> this damage)) + (format #t "~1Ttire-roll-mix[4] @ #x~X~%" (-> this tire-roll-mix)) + (format #t "~1Ttire-roll-hum: ~f~%" (-> this tire-roll-hum)) + (format #t "~1Ttire-roll-dirt: ~f~%" (-> this tire-roll-dirt)) + (format #t "~1Ttire-roll-sand: ~f~%" (-> this tire-roll-sand)) + (format #t "~1Ttire-roll-knobby: ~f~%" (-> this tire-roll-knobby)) + (format #t "~1Ttire-slide-mix[2] @ #x~X~%" (-> this tire-slide-mix)) + (format #t "~1Ttire-slide-road: ~f~%" (-> this tire-slide-road)) + (format #t "~1Ttire-slide-dirt: ~f~%" (-> this tire-slide-dirt)) + (label cfg-23) + this + ) + +;; definition of type vehicle-wheel-state +(deftype vehicle-wheel-state (structure) + ((info vehicle-wheel-info) + (flags uint8) + (prev-flags uint8) + (handle handle) + (probe-local-pos vector :inline) + (probe-local-dir vector :inline) + (local-axis vector :inline) + (surface-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (trans vector :inline) + (quat quaternion :inline) + (trail-pos vector 2 :inline) + (surface vehicle-wheel-surface) + (pos float) + (pos2 float) + (inertia float) + (steer-angle float) + (angle float) + (rev float) + (x-scale float) + (torque float) + (braking-torque float) + (up-force float) + (drive-diff float) + (side-vel float) + (up-vel float) + (forward-vel float) + (forward-slip-vel float) + (friction-coef float) + (sink-depth float) + (sin-susp-ang float) + (cos-susp-ang float) + (part-birth-accum sparticle-launch-control 4) + (tread-time uint32) + (tread-tracker handle) + ) + ) + +;; definition for method 3 of type vehicle-wheel-state +(defmethod inspect ((this vehicle-wheel-state)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-wheel-state) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tprev-flags: ~D~%" (-> this prev-flags)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tprobe-local-pos: #~%" (-> this probe-local-pos)) + (format #t "~1Tprobe-local-dir: #~%" (-> this probe-local-dir)) + (format #t "~1Tlocal-axis: #~%" (-> this local-axis)) + (format #t "~1Tsurface-pos: #~%" (-> this surface-pos)) + (format #t "~1Tground-pos: #~%" (-> this ground-pos)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Ttrail-pos[2] @ #x~X~%" (-> this trail-pos)) + (format #t "~1Tsurface: #~%" (-> this surface)) + (format #t "~1Tpos: ~f~%" (-> this pos)) + (format #t "~1Tpos2: ~f~%" (-> this pos2)) + (format #t "~1Tinertia: ~f~%" (-> this inertia)) + (format #t "~1Tsteer-angle: ~f~%" (-> this steer-angle)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Trev: ~f~%" (-> this rev)) + (format #t "~1Tx-scale: ~f~%" (-> this x-scale)) + (format #t "~1Ttorque: ~f~%" (-> this torque)) + (format #t "~1Tbraking-torque: ~f~%" (-> this braking-torque)) + (format #t "~1Tup-force: ~f~%" (-> this up-force)) + (format #t "~1Tdrive-diff: ~f~%" (-> this drive-diff)) + (format #t "~1Tside-vel: ~f~%" (-> this side-vel)) + (format #t "~1Tup-vel: ~f~%" (-> this up-vel)) + (format #t "~1Tforward-vel: ~f~%" (-> this forward-vel)) + (format #t "~1Tforward-slip-vel: ~f~%" (-> this forward-slip-vel)) + (format #t "~1Tfriction-coef: ~f~%" (-> this friction-coef)) + (format #t "~1Tsink-depth: ~f~%" (-> this sink-depth)) + (format #t "~1Tsin-susp-ang: ~f~%" (-> this sin-susp-ang)) + (format #t "~1Tcos-susp-ang: ~f~%" (-> this cos-susp-ang)) + (format #t "~1Tpart-birth-accum[4] @ #x~X~%" (-> this part-birth-accum)) + (format #t "~1Ttread-time: ~D~%" (-> this tread-time)) + (format #t "~1Ttread-tracker: ~D~%" (-> this tread-tracker)) + (label cfg-4) + this + ) + +;; definition of type wvehicle-probe-work +(deftype wvehicle-probe-work (structure) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (wheel-axis vector :inline) + (side-dir vector :inline) + (forward-dir vector :inline) + (velocity vector :inline) + (probe-uu float) + ) + ) + +;; definition for method 3 of type wvehicle-probe-work +(defmethod inspect ((this wvehicle-probe-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'wvehicle-probe-work) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-normal: #~%" (-> this local-normal)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Twheel-axis: #~%" (-> this wheel-axis)) + (format #t "~1Tside-dir: #~%" (-> this side-dir)) + (format #t "~1Tforward-dir: #~%" (-> this forward-dir)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tprobe-uu: ~f~%" (-> this probe-uu)) + (label cfg-4) + this + ) + +;; definition of type wvehicle-physics-work +(deftype wvehicle-physics-work (structure) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (probe-dir vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal-sum vector :inline) + (ground-pos vector :inline) + (forward-dir vector :inline) + (side-dir vector :inline) + (wheel-axis vector :inline) + (wsphere sphere :inline) + (friction-coef float) + (wheel-radius float) + (side-force float) + (forward-force float) + (max-forward-tire-grip float) + (max-side-tire-grip float) + (inertia-eff float) + (ground-torque float) + (braking-torque float) + (total-torque float) + (limit-braking-torque float) + (max-braking-torque float) + (surface-drag float) + (water-y float) + (cur-time uint32) + (surface-type uint8) + (surface-depth float) + (material uint64) + (probe-work-array wvehicle-probe-work 4 :inline) + (cquery collide-query :inline) + ) + ) + +;; definition for method 3 of type wvehicle-physics-work +(defmethod inspect ((this wvehicle-physics-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'wvehicle-physics-work) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tforce: #~%" (-> this force)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tsteering-axis: #~%" (-> this steering-axis)) + (format #t "~1Tprobe-dir: #~%" (-> this probe-dir)) + (format #t "~1Ttmp: #~%" (-> this tmp)) + (format #t "~1Tp-body: #~%" (-> this p-body)) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tground-normal-sum: #~%" (-> this ground-normal-sum)) + (format #t "~1Tground-pos: #~%" (-> this ground-pos)) + (format #t "~1Tforward-dir: #~%" (-> this forward-dir)) + (format #t "~1Tside-dir: #~%" (-> this side-dir)) + (format #t "~1Twheel-axis: #~%" (-> this wheel-axis)) + (format #t "~1Twsphere: #~%" (-> this wsphere)) + (format #t "~1Tfriction-coef: ~f~%" (-> this friction-coef)) + (format #t "~1Twheel-radius: ~f~%" (-> this wheel-radius)) + (format #t "~1Tside-force: ~f~%" (-> this side-force)) + (format #t "~1Tforward-force: ~f~%" (-> this forward-force)) + (format #t "~1Tmax-forward-tire-grip: ~f~%" (-> this max-forward-tire-grip)) + (format #t "~1Tmax-side-tire-grip: ~f~%" (-> this max-side-tire-grip)) + (format #t "~1Tinertia-eff: ~f~%" (-> this inertia-eff)) + (format #t "~1Tground-torque: ~f~%" (-> this ground-torque)) + (format #t "~1Tbraking-torque: ~f~%" (-> this braking-torque)) + (format #t "~1Ttotal-torque: ~f~%" (-> this total-torque)) + (format #t "~1Tlimit-braking-torque: ~f~%" (-> this limit-braking-torque)) + (format #t "~1Tmax-braking-torque: ~f~%" (-> this max-braking-torque)) + (format #t "~1Tsurface-drag: ~f~%" (-> this surface-drag)) + (format #t "~1Twater-y: ~f~%" (-> this water-y)) + (format #t "~1Tcur-time: ~D~%" (-> this cur-time)) + (format #t "~1Tsurface-type: ~D~%" (-> this surface-type)) + (format #t "~1Tsurface-depth: ~f~%" (-> this surface-depth)) + (format #t "~1Tmaterial: ~D~%" (-> this material)) + (format #t "~1Tprobe-work-array[4] @ #x~X~%" (-> this probe-work-array)) + (format #t "~1Tcquery: #~%" (-> this cquery)) + (label cfg-4) + this + ) + +;; definition of type wvehicle +(deftype wvehicle (vehicle) + ((race race-control :inline) + (target-status squad-target-status :inline) + (ai-controls vehicle-controls :inline) + (minimap connection-minimap) + (net basic) + (engine-rev float) + (engine-inertia float) + (engine-torque float) + (engine-max-torque float) + (engine-rpm float) + (sound-engine-rpm float) + (wheel-rev float) + (wheel-inertia float) + (wheel-torque float) + (wheel-braking-torque float) + (wheel-ground-torque float) + (clutch-grab float) + (gear-ratio float) + (final-drive-ratio float) + (total-gear-ratio float) + (inv-total-gear-ratio float) + (avg-drive-wheel-radius float) + (drive-wheel-inertia float) + (clutch-inertia float) + (idle-throttle float) + (susp-spring-control float) + (jump-control float) + (ai-min-speed float) + (ai-max-speed float) + (shortcut-speed-factor float) + (path-deviation float) + (turbo-supply float) + (turbo-ready float) + (ai-state uint8) + (return-ai-state uint8) + (i-barrel int8) + (shift-state uint8) + (gear-select int8) + (next-gear-select int8) + (shift-time uint32) + (impact rigid-body-impact :inline) + (wheel vehicle-wheel-state 4 :inline) + (gravity-dir vector :inline) + (ai-target-point vector :inline) + (surface-velocity vector :inline) + (turret-local-pos vector :inline) + (gun-local-pos vector :inline) + (gun-local-dir vector :inline) + (gun-aim-yaw float) + (gun-aim-yaw-vel float) + (gun-targ-yaw float) + (gun-targ-pitch float) + (gun-yaw float) + (gun-pitch float) + (gun-yaw-vel float) + (gun-pitch-vel float) + (gun-kick float) + (lock-turret basic) + (tire-roll-loop-state wvehicle-sound-loop-state 4 :inline) + (tire-slide-loop-state wvehicle-sound-loop-state 2 :inline) + (engine1-sound-id sound-id :offset 2472) + (engine2-sound-id sound-id) + (engine3-sound-id sound-id) + (damage-sound-id sound-id) + (water-sound-id sound-id) + (turbo-sound-id sound-id) + (shortcut-time uint32) + (overturned-time uint32) + (splash-time uint32) + (knobby-time uint32) + (susp-creak-time uint32) + (shoot-time uint32) + (shoot-delay uint32) + (jump-time uint32) + (ground-time uint32) + (ram-time uint32) + (attached-array handle 16) + (eng1-vol float) + (eng2-vol float) + (eng3-vol float) + (eng-pitch-variance float) + (eng-pitch-variance-seek float) + (eng-vol-variance float) + (eng-vol-variance-seek float) + (eng-pitch-offset float) + (eng-flutter-envelope float) + (water-sound-envelope float) + (other-proc handle) + (other-pos vector :inline) + ) + :allow-misaligned + (:state-methods + hostile + undefined0 + race-waiting + race-racing + race-finished + undefined1 + explode-into-nothing + sink + ) + (:methods + (wvehicle-method-160 (_type_ wvehicle-physics-work) none) + (spawn-wheels! (_type_ skeleton-group skeleton-group skeleton-group skeleton-group) none) + (wvehicle-method-162 (_type_ float) none) + (wvehicle-method-163 (_type_) none) + (wvehicle-method-164 (_type_ vehicle-wheel-state vehicle-wheel-info) none) + (wvehicle-method-165 (_type_) none) + (wvehicle-method-166 (_type_ float float) float) + (wvehicle-method-167 (_type_) none) + (wvehicle-method-168 (_type_) none) + (wvehicle-method-169 (_type_) none) + (wvehicle-method-170 (_type_) none) + (wvehicle-method-171 (_type_ vector int) none) + (wvehicle-method-172 (_type_ quaternion int) none) + (wvehicle-method-173 (_type_ vector) int) + (get-attached-by-idx (_type_ int) process-focusable) + (add-attached-at-idx (_type_ int process-focusable) none) + (remove-attached-from-arr (_type_ process-focusable) symbol) + (wvehicle-method-177 (_type_ vehicle-controls) none) + (wvehicle-method-178 (_type_) none) + (wvehicle-method-179 (_type_) none) + (wvehicle-method-180 (_type_ uint) none) + (wvehicle-method-181 (_type_) none) + (wvehicle-method-182 (_type_) none) + (wvehicle-method-183 (_type_) none) + (wvehicle-method-184 (_type_) none) + (wvehicle-method-185 (_type_) none) + (wvehicle-method-186 (_type_) none) + (wvehicle-method-187 (_type_) none) + (wvehicle-method-188 (_type_) none) + (wvehicle-method-189 (_type_ vehicle-wheel-state wvehicle-part-work wvehicle-wheel-launcher-spec) none) + (wvehicle-method-190 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-191 (_type_ vehicle-wheel-state wvehicle-part-work) symbol) + (wvehicle-method-192 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-193 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-194 (_type_ vehicle-wheel-state wvehicle-part-work) none) + (wvehicle-method-195 (_type_) none) + (wvehicle-method-196 (_type_) none) + (wvehicle-method-197 (_type_) symbol) + (wvehicle-method-198 (_type_) none) + (wvehicle-method-199 (_type_) none) + (wvehicle-method-200 (_type_ vector wvehicle-part-work) none) + (wvehicle-method-201 (_type_) none) + (wvehicle-method-202 (_type_) none) + ) + ) + +;; definition for method 3 of type wvehicle +(defmethod inspect ((this wvehicle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle inspect))) + (t9-0 this) + ) + (format #t "~2Trace: #~%" (-> this race)) + (format #t "~2Ttarget-status: #~%" (-> this target-status)) + (format #t "~2Tai-controls: #~%" (-> this ai-controls)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tnet: ~A~%" (-> this net)) + (format #t "~2Tengine-rev: ~f~%" (-> this engine-rev)) + (format #t "~2Tengine-inertia: ~f~%" (-> this engine-inertia)) + (format #t "~2Tengine-torque: ~f~%" (-> this engine-torque)) + (format #t "~2Tengine-max-torque: ~f~%" (-> this engine-max-torque)) + (format #t "~2Tengine-rpm: ~f~%" (-> this engine-rpm)) + (format #t "~2Tsound-engine-rpm: ~f~%" (-> this sound-engine-rpm)) + (format #t "~2Twheel-rev: ~f~%" (-> this wheel-rev)) + (format #t "~2Twheel-inertia: ~f~%" (-> this wheel-inertia)) + (format #t "~2Twheel-torque: ~f~%" (-> this wheel-torque)) + (format #t "~2Twheel-braking-torque: ~f~%" (-> this wheel-braking-torque)) + (format #t "~2Twheel-ground-torque: ~f~%" (-> this wheel-ground-torque)) + (format #t "~2Tclutch-grab: ~f~%" (-> this clutch-grab)) + (format #t "~2Tgear-ratio: ~f~%" (-> this gear-ratio)) + (format #t "~2Tfinal-drive-ratio: ~f~%" (-> this final-drive-ratio)) + (format #t "~2Ttotal-gear-ratio: ~f~%" (-> this total-gear-ratio)) + (format #t "~2Tinv-total-gear-ratio: ~f~%" (-> this inv-total-gear-ratio)) + (format #t "~2Tavg-drive-wheel-radius: ~f~%" (-> this avg-drive-wheel-radius)) + (format #t "~2Tdrive-wheel-inertia: ~f~%" (-> this drive-wheel-inertia)) + (format #t "~2Tclutch-inertia: ~f~%" (-> this clutch-inertia)) + (format #t "~2Tidle-throttle: ~f~%" (-> this idle-throttle)) + (format #t "~2Tsusp-spring-control: ~f~%" (-> this susp-spring-control)) + (format #t "~2Tjump-control: ~f~%" (-> this jump-control)) + (format #t "~2Tai-min-speed: ~f~%" (-> this ai-min-speed)) + (format #t "~2Tai-max-speed: ~f~%" (-> this ai-max-speed)) + (format #t "~2Tshortcut-speed-factor: ~f~%" (-> this shortcut-speed-factor)) + (format #t "~2Tpath-deviation: ~f~%" (-> this path-deviation)) + (format #t "~2Tturbo-supply: ~f~%" (-> this turbo-supply)) + (format #t "~2Tturbo-ready: ~f~%" (-> this turbo-ready)) + (format #t "~2Tai-state: ~D~%" (-> this ai-state)) + (format #t "~2Treturn-ai-state: ~D~%" (-> this return-ai-state)) + (format #t "~2Ti-barrel: ~D~%" (-> this i-barrel)) + (format #t "~2Tshift-state: ~D~%" (-> this shift-state)) + (format #t "~2Tgear-select: ~D~%" (-> this gear-select)) + (format #t "~2Tnext-gear-select: ~D~%" (-> this next-gear-select)) + (format #t "~2Tshift-time: ~D~%" (-> this shift-time)) + (format #t "~2Timpact: #~%" (-> this impact)) + (format #t "~2Twheel[4] @ #x~X~%" (-> this wheel)) + (format #t "~2Tgravity-dir: #~%" (-> this gravity-dir)) + (format #t "~2Tai-target-point: #~%" (-> this ai-target-point)) + (format #t "~2Tsurface-velocity: #~%" (-> this surface-velocity)) + (format #t "~2Tturret-local-pos: #~%" (-> this turret-local-pos)) + (format #t "~2Tgun-local-pos: #~%" (-> this gun-local-pos)) + (format #t "~2Tgun-local-dir: #~%" (-> this gun-local-dir)) + (format #t "~2Tgun-aim-yaw: ~f~%" (-> this gun-aim-yaw)) + (format #t "~2Tgun-aim-yaw-vel: ~f~%" (-> this gun-aim-yaw-vel)) + (format #t "~2Tgun-targ-yaw: ~f~%" (-> this gun-targ-yaw)) + (format #t "~2Tgun-targ-pitch: ~f~%" (-> this gun-targ-pitch)) + (format #t "~2Tgun-yaw: ~f~%" (-> this gun-yaw)) + (format #t "~2Tgun-pitch: ~f~%" (-> this gun-pitch)) + (format #t "~2Tgun-yaw-vel: ~f~%" (-> this gun-yaw-vel)) + (format #t "~2Tgun-pitch-vel: ~f~%" (-> this gun-pitch-vel)) + (format #t "~2Tgun-kick: ~f~%" (-> this gun-kick)) + (format #t "~2Tlock-turret: ~A~%" (-> this lock-turret)) + (format #t "~2Ttire-roll-loop-state[4] @ #x~X~%" (-> this tire-roll-loop-state)) + (format #t "~2Ttire-slide-loop-state[2] @ #x~X~%" (-> this tire-slide-loop-state)) + (format #t "~2Tengine1-sound-id: ~D~%" (-> this engine1-sound-id)) + (format #t "~2Tengine2-sound-id: ~D~%" (-> this engine2-sound-id)) + (format #t "~2Tengine3-sound-id: ~D~%" (-> this engine3-sound-id)) + (format #t "~2Tdamage-sound-id: ~D~%" (-> this damage-sound-id)) + (format #t "~2Twater-sound-id: ~D~%" (-> this water-sound-id)) + (format #t "~2Tturbo-sound-id: ~D~%" (-> this turbo-sound-id)) + (format #t "~2Tshortcut-time: ~D~%" (-> this shortcut-time)) + (format #t "~2Toverturned-time: ~D~%" (-> this overturned-time)) + (format #t "~2Tsplash-time: ~D~%" (-> this splash-time)) + (format #t "~2Tknobby-time: ~D~%" (-> this knobby-time)) + (format #t "~2Tsusp-creak-time: ~D~%" (-> this susp-creak-time)) + (format #t "~2Tshoot-time: ~D~%" (-> this shoot-time)) + (format #t "~2Tshoot-delay: ~D~%" (-> this shoot-delay)) + (format #t "~2Tjump-time: ~D~%" (-> this jump-time)) + (format #t "~2Tground-time: ~D~%" (-> this ground-time)) + (format #t "~2Tram-time: ~D~%" (-> this ram-time)) + (format #t "~2Tattached-array[16] @ #x~X~%" (-> this attached-array)) + (format #t "~2Teng1-vol: ~f~%" (-> this eng1-vol)) + (format #t "~2Teng2-vol: ~f~%" (-> this eng2-vol)) + (format #t "~2Teng3-vol: ~f~%" (-> this eng3-vol)) + (format #t "~2Teng-pitch-variance: ~f~%" (-> this eng-pitch-variance)) + (format #t "~2Teng-pitch-variance-seek: ~f~%" (-> this eng-pitch-variance-seek)) + (format #t "~2Teng-vol-variance: ~f~%" (-> this eng-vol-variance)) + (format #t "~2Teng-vol-variance-seek: ~f~%" (-> this eng-vol-variance-seek)) + (format #t "~2Teng-pitch-offset: ~f~%" (-> this eng-pitch-offset)) + (format #t "~2Teng-flutter-envelope: ~f~%" (-> this eng-flutter-envelope)) + (format #t "~2Twater-sound-envelope: ~f~%" (-> this water-sound-envelope)) + (format #t "~2Tother-proc: ~D~%" (-> this other-proc)) + (format #t "~2Tother-pos: #~%" (-> this other-pos)) + (label cfg-4) + this + ) + +;; definition for function rpm->radians-per-sec +;; WARN: Return type mismatch float vs degrees. +(defun rpm->radians-per-sec ((arg0 float)) + (the-as degrees (* 0.10471976 arg0)) + ) + +;; definition for function radians-per-sec->rpm +(defun radians-per-sec->rpm ((arg0 degrees)) + (* 9.549297 arg0) + ) + +;; definition of type wvehicle-ai-drop-off-params +(deftype wvehicle-ai-drop-off-params (structure) + ((dest vector :inline) + (proc process) + ) + ) + +;; definition for method 3 of type wvehicle-ai-drop-off-params +(defmethod inspect ((this wvehicle-ai-drop-off-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'wvehicle-ai-drop-off-params) + (format #t "~1Tdest: #~%" (-> this dest)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (label cfg-4) + this + ) + +;; definition for function wvehicle-surface-type-from-material +(defun wvehicle-surface-type-from-material ((arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (= v1-0 23) (= v1-0 6)) + 0 + ) + ((or (= v1-0 15) (zero? v1-0)) + 1 + ) + ((= v1-0 5) + 2 + ) + ((= v1-0 2) + 3 + ) + ((= v1-0 16) + 6 + ) + (else + 1 + ) + ) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-hud_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-hud_REF.gc new file mode 100644 index 0000000000..89339c23d1 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-hud_REF.gc @@ -0,0 +1,117 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type hud-vehicle-turbo +(deftype hud-vehicle-turbo (hud) + ((tex-rim texture) + (tex-on texture) + (tex-off texture) + ) + ) + +;; definition for method 3 of type hud-vehicle-turbo +(defmethod inspect ((this hud-vehicle-turbo)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (format #t "~2Ttex-rim: ~A~%" (-> this tex-rim)) + (format #t "~2Ttex-on: ~A~%" (-> this tex-on)) + (format #t "~2Ttex-off: ~A~%" (-> this tex-off)) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-vehicle-turbo +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-vehicle-turbo)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (* -100.0 (-> this offset))) 336) + (let* ((f0-5 (the float (the int (-> *game-info* vehicle-turbo-ready)))) + (f0-7 (* 120.0 (fmax 0.33 f0-5))) + (v1-5 (-> *game-info* race-number-turbos)) + ) + (dotimes (a0-2 3) + (let ((a1-3 (-> this sprites a0-2))) + (cond + ((< a0-2 v1-5) + (set! (-> a1-3 tid) (the-as texture-id (-> this tex-on))) + (set! (-> a1-3 color w) (the int f0-7)) + ) + (else + (set! (-> a1-3 tid) (the-as texture-id (-> this tex-off))) + (set! (-> a1-3 color w) (the int (* 0.5 f0-7))) + ) + ) + ) + ) + ) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 32 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 32 0) + (dotimes (s5-0 3) + (set-as-offset-from! (-> this sprites (+ s5-0 3)) (the-as vector4w (-> this sprites s5-0)) 0 0) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-vehicle-turbo +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-vehicle-turbo)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-vehicle-turbo +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-vehicle-turbo)) + (vehicle-entity-hack 27) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action play) (-> this name) 81920.0 0) + ) + (set! (-> this tex-on) + (lookup-level-texture-by-name "hud-turbo-boost-on-01" (-> this level) (the-as (pointer texture-page) #f)) + ) + (set! (-> this tex-off) + (lookup-level-texture-by-name "hud-turbo-boost-off-01" (-> this level) (the-as (pointer texture-page) #f)) + ) + (set! (-> this tex-rim) + (lookup-level-texture-by-name "hud-turbo-boost-rim-01" (-> this level) (the-as (pointer texture-page) #f)) + ) + (logior! (-> this flags) (hud-flags show)) + (dotimes (v1-4 6) + (let ((a0-8 (-> this sprites v1-4))) + (set! (-> a0-8 scale-x) 1.0) + (set! (-> a0-8 scale-y) 1.0) + ) + ) + (dotimes (v1-7 3) + (let ((a0-13 (-> this sprites (+ v1-7 3)))) + (set! (-> a0-13 tid) (the-as texture-id (-> this tex-rim))) + ) + ) + 0 + (none) + ) + +;; definition for function hud-vehicle-turbo-spawn +;; WARN: Return type mismatch process vs hud-vehicle-turbo. +(defun hud-vehicle-turbo-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn hud-vehicle-turbo :init hud-init-by-other :name "hud-vehicle-turbo" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as hud-vehicle-turbo gp-0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-obs_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-obs_REF.gc new file mode 100644 index 0000000000..bde4968006 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-obs_REF.gc @@ -0,0 +1,506 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-turbo-pickup + :id 231 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 998 :flags (sp6 sp7)) + (sp-item 999 :flags (sp6 sp7)) + (sp-item 1000 :flags (sp6 sp7)) + (sp-item 1001 :flags (sp7)) + (sp-item 1002 :flags (sp3) :binding 994) + (sp-item 994 :flags (sp2 sp3) :binding 995) + (sp-item 1002 :flags (sp3) :binding 996) + (sp-item 996 :flags (sp2 sp3) :binding 995) + (sp-item 1002 :flags (sp3) :binding 997) + (sp-item 997 :flags (sp2 sp3) :binding 995) + (sp-item 995 :flags (sp2)) + (sp-item 995 :flags (sp2)) + (sp-item 995 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 998 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 200.0 2.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 999 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 30.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 1000 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 20.0 1.0) + (:omega (degrees 18011.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 1002 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 80.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 994 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:z (meters 2)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.10666667)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 996 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -2)) + (:z (meters 2)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.10666667)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 997 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.10666667)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 995 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:fade-r 6.4) + (:fade-g -6.4) + (:fade-b -6.4) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 1001 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.06 0.06) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.3)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:scalevel-y (meters -0.001) (meters 0.002)) + (:fade-a 0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 1003) + ) + ) + +;; failed to figure out what this is: +(defpart 1003 + :init-specs ((:scalevel-y (meters -0.0013333333) (meters 0.002)) (:fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpartgroup group-turbo-pickup-explode + :id 232 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 1006 :period (seconds 20) :length (seconds 0.3)) + (sp-item 1007 :flags (sp3) :binding 1004) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1004 :flags (sp2) :period (seconds 20) :length (seconds 0.335) :binding 1005) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + (sp-item 1005 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 1006 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.5) + (:scale-x (meters 20)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 32.0) + (:b :copy g) + (:a 128.0) + (:scalevel-x (meters -0.16666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 1007 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.001)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds -0.005)) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 1004 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 4.0) + (:y (meters -4) (meters 16)) + (:scale-x (meters 1.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 1 (meters 0.035555556)) + (:vel-z (meters 0.16666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:accel-z (meters -0.011333333)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpart 1005 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.002)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334 -0.13333334) + (:accel-y (meters -0.00066666666)) + (:friction 0.6 0.3) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +;; definition of type turbo-pickup +(deftype turbo-pickup (process-drawable) + ((root collide-shape :override) + (available symbol) + (persistent symbol) + (birth-time time-frame) + (collector handle) + ) + (:state-methods + idle + die + ) + (:methods + (find-ground (_type_) symbol) + ) + ) + +;; definition for method 3 of type turbo-pickup +(defmethod inspect ((this turbo-pickup)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tavailable: ~A~%" (-> this available)) + (format #t "~2Tpersistent: ~A~%" (-> this persistent)) + (format #t "~2Tbirth-time: ~D~%" (-> this birth-time)) + (format #t "~2Tcollector: ~D~%" (-> this collector)) + (label cfg-4) + this + ) + +;; definition for method 22 of type turbo-pickup +;; INFO: Used lq/sq +(defmethod find-ground ((this turbo-pickup)) + (let ((s4-0 #f)) + (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) + (set! (-> gp-0 vec0 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-reset! (-> gp-0 vec1)) + (set! (-> gp-0 vec1 y) 1.0) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-5 (-> gp-0 cquery))) + (set! (-> v1-5 radius) 1024.0) + (set! (-> v1-5 collide-with) (collide-spec backgnd)) + (set! (-> v1-5 ignore-process0) #f) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (let ((f0-6 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f0-6 0.0) + (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f0-6) + (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (+! (-> gp-0 vec0 y) 4915.2) + (set! s4-0 #t) + (format #t "turbo-pickup::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) + ) + s4-0 + ) + ) + +;; failed to figure out what this is: +(defstate idle (turbo-pickup) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (when (-> self available) + (set! (-> self collector) (process->handle proc)) + (when (send-event proc 'turbo-pickup) + (set! (-> self available) #f) + (go-virtual die) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (spawn (-> self part) (-> self root trans)) + (if (and (not (-> self persistent)) (time-elapsed? (-> self birth-time) (seconds 10))) + (go-virtual die) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate die (turbo-pickup) + :virtual #t + :code (behavior () + (set-time! (-> self state-time)) + (let* ((s5-0 (handle->process (-> self collector))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when gp-0 + (if (logtest? (-> *part-group-id-table* 232 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 232) + :target (the-as process-drawable gp-0) + :mat-joint (the-as object 0) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 232) + :target (the-as process-drawable gp-0) + :mat-joint (the-as object 0) + ) + ) + ) + ) + (let ((v1-35 (-> self root root-prim))) + (set! (-> v1-35 prim-core collide-as) (collide-spec)) + (set! (-> v1-35 prim-core collide-with) (collide-spec)) + ) + 0 + (when (nonzero? (-> self part)) + (kill-particles (-> self part)) + (set! (-> self part) (the-as sparticle-launch-control 0)) + 0 + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + ) + ) + +;; definition for function turbo-pickup-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior turbo-pickup-init-by-other turbo-pickup ((arg0 vector) (arg1 symbol)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrate-using) (the-as penetrate -1)) + (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-4 prim-core collide-with) (collide-spec vehicle-sphere hit-by-others-list)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 14336.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-7 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (update-transforms (-> self root)) + (set! (-> self available) #t) + (set! (-> self persistent) arg1) + (set-time! (-> self birth-time)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 231) self)) + (set! (-> self collector) (the-as handle #f)) + (go-virtual idle) + (none) + ) + +;; definition for function race-turbo-pickup-spawn +;; WARN: Return type mismatch process vs turbo-pickup. +(defun race-turbo-pickup-spawn ((arg0 process) (arg1 vector)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn turbo-pickup arg1 #t :name "turbo-pickup" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as turbo-pickup gp-0) + ) + ) + +;; definition for function turbo-pickup-spawn +;; WARN: Return type mismatch process vs turbo-pickup. +(defbehavior turbo-pickup-spawn turbo-pickup ((arg0 process) (arg1 vector)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn turbo-pickup arg0 #f :name "turbo-pickup" :to *entity-pool*))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as turbo-pickup gp-0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-part_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-part_REF.gc new file mode 100644 index 0000000000..98e6bd3279 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-part_REF.gc @@ -0,0 +1,1342 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function sparticle-motion-blur-dirt +;; INFO: function output is handled by mips2c +(def-mips2c sparticle-motion-blur-dirt (function sparticle-system sparticle-cpuinfo vector none)) + +;; definition for function spt-birth-func-brightness-buggy-rocks +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-buggy-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 200)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 953 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-buggy-rocks) + (:num 1.0) + (:x (meters 0) (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.01)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.001)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-buggy-rocks +(defun spt-birth-func-part-buggy-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-buggy-rocks arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 954 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-dbuggy-debris) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1)) + (:r 200.0) + (:g 200.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.033333335)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function spt-birth-func-part-dbuggy-debris +(defun spt-birth-func-part-dbuggy-debris ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (birth-func-set-vel-2d arg0 arg1 arg2) + (spt-birth-func-brightness-buggy-rocks arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 955 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.96) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 956 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.05) + (:scale-x (meters 0.5)) + (:scale-y (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.008333334) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wv-water-splash + :id 226 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 957 :fade-after (meters 60) :flags (sp7) :period (seconds 10) :length (seconds 0.2)) + (sp-item 958 :fade-after (meters 60) :flags (sp7) :period (seconds 10) :length (seconds 0.067) :offset 125) + (sp-item 959 :fade-after (meters 60) :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 960 :fade-after (meters 60) :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.167) :offset 125) + ) + ) + +;; failed to figure out what this is: +(defpart 957 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.016666668)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-wsplash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 158.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 0.5 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wv-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wv-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wv-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 2.0 :z 0.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y -5.0000005 :z -1.6666666 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-wv-water-splash-curve-settings*, type particle-curve-settings +(define *part-wv-water-splash-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.95) :lifetime-offset (seconds 0.1)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 957 init-specs 13 initial-valuef) + (the-as float *part-wv-water-splash-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* color-start) *range-wv-wsplash-color*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* alpha-start) *range-wv-wsplash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* scale-x-start) *range-wv-wsplash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* scale-y-start) *range-wv-wsplash-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* a-scalar) *curve-wv-wsplash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* scale-x-scalar) *curve-wv-wsplash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-curve-settings* scale-y-scalar) *curve-wv-wsplash-scale-y*) + +;; failed to figure out what this is: +(defpart 958 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 2.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 set-conerot)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-splash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 110.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wv-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wv-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -3.3333333 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wv-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 0.15 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -2.8333333 :y -0.21428573 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wv-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 3.0 :z 2.0) + :one-over-x-deltas (new 'static 'vector :x 6.0 :y -5.0000005 :z -6.6666665 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-wv-water-splash-center-curve-settings*, type particle-curve-settings +(define *part-wv-water-splash-center-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.8) :lifetime-offset (seconds 0.4)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 958 init-specs 11 initial-valuef) + (the-as float *part-wv-water-splash-center-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* color-start) *range-wv-splash-color*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* alpha-start) *range-wv-splash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* scale-x-start) *range-wv-splash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* scale-y-start) *range-wv-splash-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* a-scalar) *curve-wv-splash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* scale-x-scalar) *curve-wv-splash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-wv-water-splash-center-curve-settings* scale-y-scalar) *curve-wv-splash-scale-y*) + +;; failed to figure out what this is: +(defpart 959 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.4) + (:scale-x (meters 2) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.01) (meters 0.0033333334)) + (:scalevel-y (meters 0.01) (meters 0.0033333334)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 960 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0) (meters 0.1)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.00033333333) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 961 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 5.0) + (:x (meters 0) (meters 1)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 set-conerot)) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 962 + :init-specs ((:texture (ripples level-default-sprite)) + (:num 0.5 1.0) + (:x (meters 1) (meters 5)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat set-conerot)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 963 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 2.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.026666667) (meters 0.026666667)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 set-conerot)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 964 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-set-vel) + (:num 0.4) + (:scale-x (meters 2)) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 2)) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 20.0) + (:vel-y (meters 0) (meters 0.013333334)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 1)) + (:next-launcher 965) + (:launchrot-x (degrees -90)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-x (degrees 30)) + (:rotate-z (degrees -20) (degrees 40)) + ) + ) + +;; failed to figure out what this is: +(defpart 965 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-scorp-shells + :id 227 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 966 :flags (sp7)) (sp-item 967 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 966 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 32.0 16.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:friction 0.85 0.04) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -45) (degrees 10)) + (:conerot-y (degrees 85) (degrees 10)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.4)) + ) + ) + +;; failed to figure out what this is: +(defpart 967 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 260) (degrees 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 20.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.06666667) (meters 0.026666667)) + (:rotvel-z (degrees -4.8) (degrees 2.4)) + (:accel-y (meters -0.008333334) (meters -0.0016666667)) + (:timer (seconds 1.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408700 #x408700 #x408800)) + (:func 'check-scorp-shell-level1) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 968) + (:conerot-x (degrees -40) (degrees 20)) + (:conerot-y (degrees 80) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 968 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 969) + ) + ) + +;; failed to figure out what this is: +(defpart 969 + :init-specs ((:r 128.0) (:g 128.0) (:b 20.0) (:a 128.0)) + ) + +;; failed to figure out what this is: +(defpart 970 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 20.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.026666667) (meters 0.016666668)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0026666666) (meters -0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408800 #x408900)) + (:func 'check-scorp-shell-level2) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 968) + (:conerot-x (degrees 0) (degrees 45)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 971 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.35)) + (:rot-z (degrees 30) (degrees 120)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 20.0) + (:a 128.0) + (:vel-x (meters 0) (meters 0.0033333334)) + (:vel-y (meters 0.016666668)) + (:vel-z (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408800 #x408800 #x408900)) + (:next-time (seconds 0.25)) + (:next-launcher 972) + (:conerot-x (degrees 30) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 972 + :init-specs ((:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:next-time (seconds 2) (seconds 0.997)) + (:next-launcher 973) + ) + ) + +;; failed to figure out what this is: +(defpart 973 + :init-specs ((:fade-a -0.512)) + ) + +;; failed to figure out what this is: +(defpart 974 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.0 1 2.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.03) (meters 0.005)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.01125) (degrees 0.0045)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -2.55 -2.55) + (:fade-b -8.0) + (:fade-a -0.64 -0.64) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.8 0.02) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 60) (degrees 20)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function check-scorp-shell-level1 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun check-scorp-shell-level1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (set! (-> *part-id-table* 970 init-specs 10 initial-valuef) (-> gp-0 y)) + (launch-particles (-> *part-id-table* 970) gp-0) + (launch-particles (-> *part-id-table* 974) gp-0) + ) + ) + 0 + (none) + ) + +;; definition for function check-scorp-shell-level2 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun check-scorp-shell-level2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 971) gp-0) + (launch-particles (-> *part-id-table* 974) gp-0) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 975 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-setup-beam) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y (meters 100) (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0) + (:fade-a 0.8) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x401000 #x401200)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.05)) + (:next-launcher 976) + ) + ) + +;; failed to figure out what this is: +(defpart 976 + :init-specs ((:scalevel-x (meters 0.033333335)) + (:scalevel-y (meters -0.13333334)) + (:fade-r 0.85333335) + (:fade-g 0.85333335) + (:fade-b 0.85333335) + (:fade-a -0.21333334 -0.42666668) + (:accel-y (meters 0.000033333334)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 977) + ) + ) + +;; failed to figure out what this is: +(defpart 977 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 978 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2) (meters 5)) + (:scale-y (meters 10) (meters 0.6)) + (:r 128.0) + (:g 110.0) + (:b 64.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r -3.2) + (:fade-g -3.2) + (:fade-b -6.4) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 979 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2) (meters 5)) + (:scale-y (meters 10) (meters 0.6)) + (:r 128.0) + (:g 110.0) + (:b 64.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r -3.2) + (:fade-g -3.2) + (:fade-b -6.4) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 980 + :init-specs ((:texture (gun-enemy-beam level-default-sprite)) + (:birth-func 'birth-func-setup-beam) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 981 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.075)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 982 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 16.0) + (:z (meters 0) (meters -2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:fade-g -3.2 -6.4) + (:fade-a -1.6 -6.4) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(when (or (zero? *curve-toad-linear-up-red*) (!= loading-level global)) + (set! *curve-toad-linear-up-red* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-toad-linear-up-red* 2 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *curve-toad-linear-up-red* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-toad-linear-up-red* pts data 0 second) 0.3) + +;; failed to figure out what this is: +(set! (-> *curve-toad-linear-up-red* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-toad-linear-up-red* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(if #t + (set! *trail-color-curve-toad-grenade* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 0.3 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.25 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-grenade-linear-toad-trail* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.3 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 0.7 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if (or (zero? *toad-grenade-trail*) (!= loading-level global)) + (set! *toad-grenade-trail* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* color-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* alpha-2-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* base-alpha) 0.5) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* alpha-repeat-dist) 6144.0) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* base-width) 2048.0) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* width-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* uv-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* uv-repeat-dist) 16384000.0) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* max-age) (seconds 0.5)) + +;; failed to figure out what this is: +(if #f + (set! (-> *toad-grenade-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *toad-grenade-trail* tex-id) (the-as uint #x100300)) + ) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* width-curve) (the-as curve2d-piecewise *curve-grenade-linear-toad-trail*)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-toad-grenade*)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* alpha-curve-2) *curve-toad-linear-up-red*) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* use-tape-mode?) #f) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *toad-grenade-trail* frame-stagger) (the-as uint 1)) + +;; failed to figure out what this is: +(defpart 983 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0.25)) + (:scale-x (meters 18) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2 -0.2) + (:friction 0.85 0.04) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -45) (degrees 10)) + (:conerot-y (degrees 85) (degrees 10)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.4)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-scorp-shot-hit + :id 228 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 984 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 985 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.017)) + (sp-item 986 :fade-after (meters 120) :falloff-to (meters 140) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 986 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 1.5)) + (:rot-x 4) + (:scale-y (meters 0.05) (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.0675)) + (:vel-z (meters 0.06666667) (meters 0.33333334)) + (:fade-r -0.053333335) + (:fade-g -2.55) + (:fade-b -5.1) + (:fade-a -0.42666668 -0.42666668) + (:accel-y (meters -0.0013333333) (meters -0.001)) + (:friction 0.875) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 40)) + (:conerot-y (degrees 80) (degrees 40)) + (:conerot-z (degrees 80) (degrees 40)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +;; failed to figure out what this is: +(defpart 985 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 32.0 32.0) + (:vel-z (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0013333333) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90) (degrees 20)) + (:conerot-y (degrees 90) (degrees 20)) + (:conerot-z (degrees 90) (degrees 20)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +;; failed to figure out what this is: +(defpart 984 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-rico" :group 1)) + (:scale-x (meters 0.4) (meters 2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 230.0 25.0) + (:g 230.0 25.0) + (:b 230.0 25.0) + (:a 128.0) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.035)) + (:next-launcher 987) + ) + ) + +;; failed to figure out what this is: +(defpart 987 + :init-specs ((:scalevel-x (meters 0.12) (meters 0.12)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-scorp-shot-die + :id 229 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-toad-grenade-shot-explode + :id 230 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 988 :flags (sp3)) + (sp-item 989 :flags (sp3)) + (sp-item 990 :flags (sp3)) + (sp-item 991 :period (seconds 30) :length (seconds 0.167)) + (sp-item 992 :flags (sp3)) + ) + ) + +;; failed to figure out what this is: +(defpart 988 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.28) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 989 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 990 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 255.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.6666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 991 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 10.0) + (:scale-x (meters -4) 2.0 (meters 8)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 20.0) + (:b 130.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.6666667)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 992 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 100.0) + (:x (meters 0) (meters 0.1)) + (:scale-x (meters -4) 2.0 (meters 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 255.0) + (:vel-y (meters 0.6666667) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:fade-g -1.7) + (:fade-b -1.7) + (:fade-a -0.85) + (:friction 0.83) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.25)) + (:next-launcher 993) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 993 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.33333334) + (:fade-b -0.6666667) + (:friction 0.99) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc new file mode 100644 index 0000000000..8e9cb2e489 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc @@ -0,0 +1,640 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *wvehicle-surfaces*, type (inline-array vehicle-wheel-surface) +(define *wvehicle-surfaces* + (new 'static 'inline-array vehicle-wheel-surface 7 + (new 'static 'vehicle-wheel-surface + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type #x1 + :friction 0.9 + :drag 1.0 + :depth 409.6 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.5 0.5 0.0 0.5) + :tire-slide-mix (new 'static 'array float 2 0.5 1.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type #x2 + :friction 0.85 + :drag 2.0 + :depth 1024.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.0 0.0 1.0 0.25) + :tire-slide-mix (new 'static 'array float 2 0.0 0.5) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type #x3 + :friction 0.5 + :drag 5.0 + :damage 1.0 + ) + (new 'static 'vehicle-wheel-surface :surface-type #x4 :friction 0.25 :drag 4.0 :depth 2048.0 :damage 1.0) + (new 'static 'vehicle-wheel-surface + :surface-type #x5 + :friction 0.1 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type #x6 + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + ) + ) + +;; definition for method 160 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-160 ((this wvehicle) (arg0 wvehicle-physics-work)) + (let ((v1-0 (-> this rbody))) + (mem-copy! (the-as pointer (-> arg0 mat)) (the-as pointer (-> v1-0 matrix)) 64) + ) + (logior! (-> this v-flags) (vehicle-flag in-air)) + (logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (vector-reset! (-> arg0 ground-normal-sum)) + (let ((v1-6 (-> arg0 cquery))) + (set! (-> v1-6 radius) 1.0) + (set! (-> v1-6 collide-with) (collide-spec + backgnd + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + ) + ) + (set! (-> v1-6 ignore-process0) #f) + (set! (-> v1-6 ignore-process1) #f) + (set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-6 action-mask) (collide-action solid)) + ) + (countdown (s4-0 (-> this info physics-model wheel-count)) + (let* ((s3-0 (-> this wheel s4-0)) + (s1-0 (-> s3-0 info)) + (s2-0 (-> arg0 probe-work-array s4-0)) + ) + (vector-matrix*! (-> arg0 world-pos) (-> s3-0 probe-local-pos) (-> arg0 mat)) + (vector-rotate*! (-> arg0 probe-dir) (-> s3-0 probe-local-dir) (-> arg0 mat)) + (vector-rotate*! (-> s2-0 wheel-axis) (-> s3-0 local-axis) (-> arg0 mat)) + (vector-float*! (-> arg0 cquery move-dist) (-> arg0 probe-dir) (-> s1-0 travel)) + (set! (-> arg0 cquery radius) (-> s1-0 probe-radius)) + (vector-reset! (-> s3-0 ground-normal)) + (vector+float*! + (-> arg0 cquery start-pos) + (-> arg0 world-pos) + (-> arg0 probe-dir) + (- (-> arg0 cquery radius)) + ) + (logand! (-> s3-0 flags) -7) + (set! (-> s3-0 sink-depth) 0.0) + (set! (-> arg0 surface-depth) 0.0) + (set! (-> s2-0 probe-uu) (probe-using-line-sphere *collide-cache* (-> arg0 cquery))) + (cond + ((>= (-> s2-0 probe-uu) 0.0) + (set! (-> arg0 material) (the-as uint (-> arg0 cquery best-other-tri pat material))) + (let ((v1-26 (-> arg0 material))) + (set! (-> arg0 surface-type) (the-as uint (cond + ((or (= v1-26 23) (= v1-26 6)) + 0 + ) + ((or (= v1-26 15) (zero? v1-26)) + 1 + ) + ((= v1-26 5) + 2 + ) + ((= v1-26 2) + 3 + ) + ((= v1-26 16) + 6 + ) + (else + 1 + ) + ) + ) + ) + ) + (if (or (= (-> arg0 cquery best-other-tri pat mode) (pat-mode wall)) + (= (-> arg0 cquery best-other-tri pat event) (pat-event slippery)) + ) + (set! (-> arg0 surface-type) (the-as uint 5)) + ) + (set! (-> s3-0 surface) (-> *wvehicle-surfaces* (-> arg0 surface-type))) + (logclear! (-> this v-flags) (vehicle-flag in-air)) + (logior! (-> this v-flags) (vehicle-flag on-ground)) + (logior! (-> s3-0 flags) 2) + (set! (-> arg0 surface-depth) (-> s3-0 surface depth)) + (vector+float*! (-> arg0 tmp) (-> arg0 cquery start-pos) (-> arg0 cquery move-dist) (-> s2-0 probe-uu)) + (vector-! (-> s3-0 ground-normal) (-> arg0 tmp) (-> arg0 cquery best-other-tri intersect)) + (vector-normalize! (-> s3-0 ground-normal) 1.0) + (vector+! (-> arg0 ground-normal-sum) (-> arg0 ground-normal-sum) (-> s3-0 ground-normal)) + 0 + ) + (else + (set! (-> s2-0 probe-uu) 1.0) + (set! (-> s3-0 surface) #f) + ) + ) + (vector+float*! + (-> s3-0 surface-pos) + (-> arg0 world-pos) + (-> arg0 probe-dir) + (* (-> s1-0 travel) (-> s2-0 probe-uu)) + ) + (+! (-> s2-0 probe-uu) (/ (-> arg0 surface-depth) (-> s1-0 travel))) + (set! (-> s2-0 probe-uu) (fmax 0.0 (fmin 1.0 (-> s2-0 probe-uu)))) + (vector+float*! (-> s3-0 ground-pos) (-> s3-0 surface-pos) (-> arg0 probe-dir) (-> arg0 surface-depth)) + (set! (-> s3-0 sink-depth) (fmax 0.0 (- (-> this water-height) (-> s3-0 ground-pos y)))) + (set! (-> s3-0 pos) (-> s2-0 probe-uu)) + ) + 0 + ) + 0 + (none) + ) + +;; definition for method 97 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-97 ((this wvehicle) (arg0 float) (arg1 vehicle-physics-work)) + (local-vars (sv-16 rigid-body-control)) + (set! sv-16 (-> this rbody)) + (dotimes (s3-0 (-> this info physics-model wheel-count)) + (let* ((s2-0 (-> this wheel s3-0)) + (s1-0 (-> s2-0 info)) + (f30-0 + (fmax + 0.0 + (- 1.0 (-> (the-as wvehicle-physics-work (+ (the-as uint arg1) (* 144 s3-0))) probe-work-array 0 probe-uu)) + ) + ) + ) + (if (>= (-> this info handling cos-ground-effect-angle) (vector-dot (-> s2-0 ground-normal) (-> arg1 mat uvec))) + (set! f30-0 0.0) + ) + (set! (-> s2-0 up-force) 0.0) + (when (< 0.0 f30-0) + (rigid-body-control-method-23 sv-16 (-> s2-0 ground-pos) (-> arg1 velocity)) + (let* ((f0-4 0.0) + (f1-9 (* 2.0 + (-> this info info mass) + (-> this info extra gravity) + f30-0 + (-> this susp-spring-control) + (-> s1-0 suspension-spring) + ) + ) + (f2-5 0.25) + (f3-0 arg0) + (f0-5 (fmax f0-4 (+ f1-9 (* f2-5 + (/ 1.0 f3-0) + (-> this info info mass) + (-> s1-0 suspension-damping) + (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> s2-0 ground-normal)))) + ) + ) + ) + ) + ) + (set! (-> s2-0 up-force) f0-5) + (vector-float*! (-> arg1 force) (-> s2-0 ground-normal) f0-5) + ) + (apply-impact! sv-16 (-> s2-0 ground-pos) (-> arg1 force)) + ) + ) + ) + (dotimes (s3-1 (-> this info physics-model wheel-count)) + (let* ((s2-1 (-> this wheel s3-1)) + (s1-1 (-> s2-1 info)) + ) + (set! (-> arg1 probe-work-array 0 world-normal y) (* (-> s1-1 scale) (-> s1-1 radius))) + (set! (-> arg1 probe-work-array 0 ground-normal x) 1.0) + (when (< 0.0 (-> s2-1 up-force)) + (rigid-body-control-method-23 sv-16 (-> s2-1 ground-pos) (-> arg1 velocity)) + (if (logtest? (-> s2-1 surface flags) (vehicle-wheel-surface-flag moving)) + (vector-! (-> arg1 velocity) (-> arg1 velocity) (-> this surface-velocity)) + ) + (let ((s0-0 (the-as object (+ (+ (* 144 s3-1) 416) (the-as int arg1))))) + (set! (-> arg1 probe-work-array 0 local-normal quad) (-> (the-as wvehicle-physics-work s0-0) force quad)) + (vector+float*! + (-> (the-as wvehicle-physics-work s0-0) velocity) + (-> arg1 probe-work-array 0 local-normal) + (-> s2-1 ground-normal) + (- (vector-dot (-> arg1 probe-work-array 0 local-normal) (-> s2-1 ground-normal))) + ) + (vector-normalize! (the-as vector (+ (the-as int s0-0) 80)) 1.0) + (vector-cross! + (the-as vector (+ (the-as int s0-0) 96)) + (-> arg1 probe-work-array 0 local-normal) + (-> s2-1 ground-normal) + ) + (vector-normalize! (-> (the-as wvehicle-physics-work s0-0) world-pos) 1.0) + (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) + (-> (the-as wvehicle-physics-work s0-0) world-pos quad) + ) + (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) + (-> (the-as wvehicle-physics-work s0-0) velocity quad) + ) + (set! (-> (the-as wvehicle-physics-work s0-0) world-normal quad) + (-> (the-as wvehicle-physics-work arg1) velocity quad) + ) + ) + (set! (-> s2-1 side-vel) + (vector-dot + (-> (the-as wvehicle-physics-work arg1) velocity) + (-> (the-as wvehicle-physics-work arg1) side-dir) + ) + ) + (set! (-> s2-1 forward-vel) (vector-dot (-> arg1 velocity) (the-as vector (&-> arg1 impulse)))) + (set! (-> s2-1 up-vel) (vector-dot (-> arg1 velocity) (-> s2-1 ground-normal))) + (set! (-> s2-1 forward-slip-vel) + (+ (-> s2-1 forward-vel) (* -1.0 (-> arg1 probe-work-array 0 world-normal y) (-> s2-1 rev))) + ) + (let* ((f0-21 (-> s2-1 side-vel)) + (f0-23 (* f0-21 f0-21)) + (f1-16 (-> s2-1 forward-slip-vel)) + (f0-25 (sqrtf (+ f0-23 (* f1-16 f1-16)))) + ) + (set! (-> s2-1 friction-coef) + (* (smooth-interp + (-> this info handling tire-static-friction) + (-> this info handling tire-dynamic-friction) + f0-25 + (-> this info handling tire-static-friction-speed) + (-> this info handling tire-dynamic-friction-speed) + ) + (-> s2-1 surface friction) + ) + ) + ) + (set! (-> arg1 probe-work-array 0 ground-normal x) (-> s2-1 surface drag)) + ) + (set! (-> arg1 probe-work-array 0 ground-pos y) (-> s2-1 torque)) + (when (< 0.0 (-> s2-1 up-force)) + (let ((f0-36 + (* (-> s2-1 up-force) + (-> s2-1 friction-coef) + (-> s1-1 forward-grip) + (-> arg1 probe-work-array 0 world-normal y) + ) + ) + (f1-29 + (/ (* 0.5 (-> s2-1 inertia) (-> s2-1 forward-slip-vel)) (* arg0 (-> arg1 probe-work-array 0 world-normal y))) + ) + ) + (if (logtest? (-> s1-1 flags) (vehicle-wheel-flag vwf0)) + (set! f1-29 (* f1-29 (/ 1.0 (the float (-> this info physics-model drive-wheel-count))))) + ) + (set! (-> arg1 probe-work-array 0 probe-pos w) (fmax (fmin f1-29 f0-36) (- f0-36))) + ) + (+! (-> arg1 probe-work-array 0 ground-pos y) (-> arg1 probe-work-array 0 probe-pos w)) + ) + (set! (-> arg1 probe-work-array 0 ground-pos z) + (- (* -0.25 (/ 1.0 arg0) (-> s2-1 rev) (-> s2-1 inertia)) (-> arg1 probe-work-array 0 ground-pos y)) + ) + (set! (-> arg1 probe-work-array 0 ground-pos w) (fabs (-> s2-1 braking-torque))) + (set! (-> arg1 probe-work-array 0 ground-pos x) + (fmax + (fmin (-> arg1 probe-work-array 0 ground-pos z) (-> arg1 probe-work-array 0 ground-pos w)) + (- (-> arg1 probe-work-array 0 ground-pos w)) + ) + ) + (+! (-> arg1 probe-work-array 0 ground-pos y) (-> arg1 probe-work-array 0 ground-pos x)) + (let ((f0-57 (* -1.0 + (-> s2-1 rev) + (-> s2-1 inertia) + (-> arg1 probe-work-array 0 ground-normal x) + (-> this info handling rolling-resistance) + ) + ) + ) + (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (set! f0-57 (* 0.05 f0-57)) + ) + (+! (-> arg1 probe-work-array 0 ground-pos y) f0-57) + ) + (cond + ((logtest? (-> s1-1 flags) (vehicle-wheel-flag vwf0)) + (+! (-> this wheel-torque) (-> arg1 probe-work-array 0 ground-pos y)) + ) + (else + (let ((f0-61 (-> s2-1 rev)) + (f1-49 (* (-> arg1 probe-work-array 0 ground-pos y) arg0)) + (f2-20 (-> s2-1 inertia)) + ) + (set! (-> s2-1 rev) (+ f0-61 (* f1-49 (/ 1.0 f2-20)))) + ) + (set! (-> s2-1 rev) (fmax -125.6637 (fmin 125.6637 (-> s2-1 rev)))) + ) + ) + ) + 0 + ) + (let ((f0-65 (-> this wheel-rev)) + (f1-54 (* arg0 (-> this wheel-torque))) + (f2-25 (-> this wheel-inertia)) + ) + (set! (-> this wheel-rev) (+ f0-65 (* f1-54 (/ 1.0 f2-25)))) + ) + (set! (-> this wheel-rev) (fmax -125.6637 (fmin 125.6637 (-> this wheel-rev)))) + (dotimes (v1-110 (-> this info physics-model wheel-count)) + (let ((a0-28 (-> this wheel v1-110))) + (if (logtest? (-> a0-28 info flags) (vehicle-wheel-flag vwf0)) + (set! (-> a0-28 rev) (* (-> this wheel-rev) (-> a0-28 drive-diff))) + ) + ) + ) + (let* ((f0-71 (-> this info engine inertia)) + (f1-59 (-> this clutch-grab)) + (f2-29 (-> this clutch-inertia)) + (f3-12 (-> this gear-ratio)) + (f3-14 (/ 1.0 f3-12)) + (f3-16 (* f3-14 f3-14)) + (f4-5 (-> this info transmission inertia)) + (f5-0 (-> this final-drive-ratio)) + (f5-2 (/ 1.0 f5-0)) + ) + (set! (-> arg1 probe-work-array 0 probe-pos z) + (+ f0-71 (* f1-59 (+ f2-29 (* f3-16 (+ f4-5 (* f5-2 f5-2 (-> this drive-wheel-inertia))))))) + ) + ) + (let* ((f3-18 (- (* (- (fmax 0.0 (* (-> this total-gear-ratio) (-> this wheel-rev))) (-> this engine-rev)) + (-> arg1 probe-work-array 0 probe-pos z) + (/ 1.0 arg0) + ) + (-> this engine-torque) + ) + ) + (f0-78 (-> this engine-rev)) + (f1-69 (* arg0 (+ (-> this engine-torque) (* f3-18 (-> this clutch-grab))))) + (f2-35 (-> arg1 probe-work-array 0 probe-pos z)) + ) + (set! (-> this engine-rev) (+ f0-78 (* f1-69 (/ 1.0 f2-35)))) + ) + (let* ((f0-80 (-> this engine-rev)) + (f1-71 (-> this info engine max-rpm)) + (f0-81 (fmin f0-80 (* 0.10471976 f1-71))) + (f1-74 (-> this info engine min-rpm)) + ) + (set! (-> this engine-rev) (fmax f0-81 (* 0.10471976 f1-74))) + ) + (dotimes (s3-2 (-> this info physics-model wheel-count)) + (let* ((s1-2 (-> this wheel s3-2)) + (s2-2 (-> s1-2 info)) + ) + (when (< 0.0 (-> s1-2 up-force)) + (set! (-> arg1 probe-work-array 0 world-normal y) (* (-> s2-2 scale) (-> s2-2 radius))) + (let ((v1-138 (-> (the-as wvehicle-physics-work arg1) probe-work-array s3-2))) + (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) (-> v1-138 forward-dir quad)) + (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) (-> v1-138 side-dir quad)) + (set! (-> (the-as wvehicle-physics-work arg1) velocity quad) (-> v1-138 velocity quad)) + ) + (set! (-> (the-as wvehicle-physics-work arg1) ground-pos quad) (-> s1-2 ground-pos quad)) + (vector-! + (-> (the-as wvehicle-physics-work arg1) p-body) + (-> (the-as wvehicle-physics-work arg1) ground-pos) + (-> sv-16 position) + ) + (vector-cross! (-> arg1 normal) (-> arg1 tmp) (the-as vector (-> arg1 probe-work-array))) + (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) + (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) + (set! (-> arg1 probe-work-array 0 world-normal z) + (/ (* -0.5 (-> s1-2 side-vel)) + (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (-> arg1 probe-work-array)) (-> arg1 normal)))) + ) + ) + (set! (-> arg1 probe-work-array 0 world-normal w) 0.0) + (set! (-> s1-2 forward-slip-vel) + (+ (-> s1-2 forward-vel) (* -1.0 (-> arg1 probe-work-array 0 world-normal y) (-> s1-2 rev))) + ) + (vector-cross! (-> arg1 normal) (-> arg1 tmp) (the-as vector (&-> arg1 impulse))) + (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) + (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) + (let ((f0-94 + (/ (* -0.25 (-> s1-2 forward-slip-vel)) + (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (&-> arg1 impulse)) (-> arg1 normal)))) + ) + ) + ) + (+! (-> arg1 probe-work-array 0 world-normal w) f0-94) + ) + (set! (-> arg1 probe-work-array 0 probe-pos y) + (* (-> s1-2 friction-coef) (-> s1-2 up-force) (-> s2-2 side-grip)) + ) + (set! (-> arg1 probe-work-array 0 probe-pos x) + (* (-> s1-2 friction-coef) (-> s1-2 up-force) (-> s2-2 forward-grip)) + ) + (let* ((f0-103 (/ (-> arg1 probe-work-array 0 world-normal z) (-> arg1 probe-work-array 0 probe-pos y))) + (f0-105 (* f0-103 f0-103)) + (f1-95 (/ (-> arg1 probe-work-array 0 world-normal w) (-> arg1 probe-work-array 0 probe-pos x))) + (f0-106 (+ f0-105 (* f1-95 f1-95))) + ) + (when (< 1.0 f0-106) + (let ((f0-108 (/ 1.0 (sqrtf f0-106)))) + (set! (-> arg1 probe-work-array 0 world-normal z) (* (-> arg1 probe-work-array 0 world-normal z) f0-108)) + (set! (-> arg1 probe-work-array 0 world-normal w) (* (-> arg1 probe-work-array 0 world-normal w) f0-108)) + ) + ) + ) + (vector-float*! + (-> arg1 force) + (the-as vector (-> arg1 probe-work-array)) + (-> arg1 probe-work-array 0 world-normal z) + ) + (vector+float*! + (-> arg1 force) + (-> arg1 force) + (the-as vector (&-> arg1 impulse)) + (-> arg1 probe-work-array 0 world-normal w) + ) + (let ((f0-114 + (* (vector-dot (-> arg1 tmp) (-> arg1 mat uvec)) (+ -1.0 (-> this info handling ground-torque-scale))) + ) + ) + (vector+float*! (-> arg1 ground-normal) (-> arg1 ground-normal) (-> arg1 mat uvec) f0-114) + ) + (apply-impact! sv-16 (-> arg1 ground-normal) (-> arg1 force)) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-gravity! ((this wvehicle) (arg0 float)) + (local-vars (v1-51 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (wvehicle-method-162 this arg0) + (wvehicle-method-163 this) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-physics-work)) + (s5-0 (-> this rbody)) + (s4-0 (-> this info)) + ) + (set! (-> gp-0 cur-time) (the-as uint (current-time))) + (cond + ((logtest? (-> this v-flags) (vehicle-flag dead)) + (vector-reset! (-> gp-0 ground-normal-sum)) + ) + (else + (wvehicle-method-160 this gp-0) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force y) (* 2.0 (-> s4-0 info mass) (-> s4-0 extra gravity) (-> this jump-control))) + (add-force! s5-0 (-> gp-0 force)) + (vehicle-method-97 this arg0 (the-as vehicle-physics-work gp-0)) + ) + ) + (when (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (let ((f0-6 (* (-> this turbo-boost-factor) (-> s4-0 info mass) (-> s4-0 extra gravity)))) + (vector-float*! (-> gp-0 force) (-> gp-0 mat fvec) f0-6) + ) + (add-force! s5-0 (-> gp-0 force)) + ) + (when (logtest? (-> this v-flags) (vehicle-flag in-air)) + (let* ((v1-29 (-> this rbody ang-momentum)) + (a0-10 (-> this rbody ang-momentum)) + (f3-0 (-> s4-0 handling air-angular-damping)) + (f2-0 arg0) + (f0-7 0.0) + (f1-5 1.0) + (f2-1 (* -1.0 (- 1.0 f3-0) f2-0)) + (f3-3 0.016666668) + ) + (vector-float*! v1-29 a0-10 (fmax f0-7 (+ f1-5 (* f2-1 (/ 1.0 f3-3))))) + ) + (let* ((v1-31 (-> s5-0 lin-velocity)) + (f0-13 (+ (* (-> v1-31 x) (-> v1-31 x)) (* (-> v1-31 z) (-> v1-31 z)))) + (f1-10 40960.0) + ) + (cond + ((< f0-13 (* f1-10 f1-10)) + (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (+! (-> gp-0 local-pos z) 4096.0) + (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force x) (* (-> s4-0 handling hop-turn-torque) (-> this controls steering))) + (set! (-> gp-0 force y) (* -1.0 (-> this controls lean-z) (-> s4-0 handling air-pitch-torque))) + (vector-rotate*! (-> gp-0 force) (-> gp-0 force) (-> gp-0 mat)) + (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) + ) + (else + (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (+! (-> gp-0 local-pos y) 4096.0) + (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force x) (* (-> s4-0 handling air-roll-torque) (-> this controls steering))) + (set! (-> gp-0 force z) (* (-> s4-0 handling air-pitch-torque) (-> this controls lean-z))) + (vector-rotate*! (-> gp-0 force) (-> gp-0 force) (-> gp-0 mat)) + (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) + ) + ) + ) + ) + (when (not (logtest? (vehicle-flag gun-dark-2-zero-g) (-> this v-flags))) + (let ((f0-27 0.0)) + (.lvf vf1 (&-> (-> gp-0 ground-normal-sum) 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-51 vf1) + (if (= f0-27 v1-51) + (set! (-> gp-0 ground-normal-sum y) 1.0) + ) + ) + (+! (-> gp-0 ground-normal-sum y) 6.0) + (vector-normalize! (-> gp-0 ground-normal-sum) 1.0) + (vector-float*! (-> this gravity-dir) (-> gp-0 ground-normal-sum) -1.0) + (vector-float*! (-> gp-0 force) (-> this gravity-dir) (* (-> s4-0 extra gravity) (-> s4-0 info mass))) + (add-force! s5-0 (-> gp-0 force)) + ) + (rigid-body-object-method-53 this arg0) + (vehicle-method-96 this arg0) + (countdown (s1-0 (-> s4-0 physics-model wheel-count)) + (let* ((a1-25 (-> this wheel s1-0)) + (v1-69 (-> a1-25 info)) + ) + (set! (-> gp-0 wsphere quad) (-> a1-25 trans quad)) + (set! (-> gp-0 wsphere r) (* (-> v1-69 scale) (-> v1-69 radius))) + ) + (vehicle-method-95 this (-> gp-0 wsphere) arg0) + 0 + ) + (let ((f0-38 (* -0.000012207031 (vector-length (-> s5-0 lin-velocity)) (-> s4-0 handling drag-force-factor)))) + (vector-float*! (-> gp-0 force) (-> s5-0 lin-velocity) f0-38) + ) + (add-force! s5-0 (-> gp-0 force)) + (when (or (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (and (< (-> s5-0 matrix uvec y) 0.0) (< (- (-> gp-0 cur-time) (-> this impact-time)) (the-as uint 10))) + ) + ) + (logtest? (vehicle-flag overturned) (-> this v-flags)) + ) + (vector-reset! (-> gp-0 local-pos)) + (set! (-> gp-0 local-pos y) -6144.0) + (when (logtest? (vehicle-flag overturned) (-> this v-flags)) + (let ((f0-42 (* 0.0033333334 (the float (- (current-time) (the-as int (-> this overturned-time))))))) + (set! (-> gp-0 local-pos y) (* (+ -32768.0 (* -16384.0 f0-42)) + (-> s4-0 handling roll-control-factor) + (fmax 0.1 (- (-> s5-0 matrix uvec y))) + ) + ) + ) + ) + (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) + (vector-reset! (-> gp-0 force)) + (set! (-> gp-0 force y) (* -0.5 (-> s4-0 extra gravity) (-> s4-0 info mass))) + (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 120 of type wvehicle +(defmethod apply-gravity ((this wvehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) + +;; definition for method 121 of type wvehicle +(defmethod apply-gravity1 ((this wvehicle) (arg0 float)) + (apply-gravity! this arg0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc new file mode 100644 index 0000000000..c66c64151b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc @@ -0,0 +1,425 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate idle (wvehicle) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (go-virtual waiting) + ) + ) + +;; failed to figure out what this is: +(defstate player-control (wvehicle) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type vehicle player-control) enter))) + (if t9-0 + (t9-0) + ) + ) + (send-event *vehicle-manager* 'extra-bank (-> self info sound bank-replace)) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (logclear! (-> arg0 prim-core collide-as) (collide-spec camera-blocker)) + (none) + ) + ) + (wvehicle-method-195 self) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type vehicle player-control) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self sound-engine-rpm) 0.0) + (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) + (logior! (-> arg0 prim-core collide-as) (collide-spec camera-blocker)) + (none) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate crash (wvehicle) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type vehicle crash) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-virtual explode) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate explode (wvehicle) + :virtual #t + :enter (behavior () + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((t9-0 (-> (method-of-type vehicle explode) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (dotimes (s5-0 (-> self info physics-model wheel-count)) + (let ((s4-0 (-> self wheel s5-0))) + (cond + ((or (not (logtest? (-> self info flags) #x4000)) (< (rand-vu) 0.6)) + (rigid-body-control-method-23 (-> self rbody) (-> s4-0 trans) (-> gp-0 rvec)) + (vector-! (-> gp-0 uvec) (-> s4-0 trans) (-> self rbody position)) + (vector+float*! (-> gp-0 rvec) (-> gp-0 rvec) (-> gp-0 uvec) 6.0) + (+! (-> gp-0 rvec y) 81920.0) + (send-event (handle->process (-> s4-0 handle)) 'explode (-> gp-0 rvec)) + (set! (-> s4-0 handle) (the-as handle #f)) + ) + (else + (send-event (handle->process (-> s4-0 handle)) 'explode #f) + ) + ) + ) + ) + ) + (if (not (logtest? (-> self info flags) #x4000)) + (go-virtual explode-into-nothing) + ) + (let ((a0-14 (-> self draw color-mult))) + (vector-float*! (the-as vector a0-14) (the-as vector a0-14) 0.25) + ) + (impulse-handler self) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + (gp-1 (-> self rbody)) + ) + (set! (-> gp-1 linear-damping) 0.99) + (set! (-> gp-1 angular-damping) 0.97) + (vector-reset! s4-1) + (set! (-> s4-1 y) (* 122880.0 (-> self info info mass))) + (dotimes (s3-0 3) + (set! (-> s5-1 data s3-0) (* 12288.0 (+ -1.0 (* 2.0 (rand-vu))))) + ) + (vector+! s5-1 s5-1 (-> gp-1 position)) + (apply-impact! gp-1 s5-1 s4-1) + (rigid-body-control-method-12 gp-1 1.0) + (init-velocities! gp-1) + ) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-2 spawn-quat)) + (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) + (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) + (set! (-> gp-2 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-2 damage) 2.0) + (set! (-> gp-2 damage-scale) 1.0) + (set! (-> gp-2 vehicle-damage-factor) 1.0) + (set! (-> gp-2 vehicle-impulse-factor) 1.0) + (set! (-> gp-2 ignore-proc) (process->handle #f)) + (explosion-spawn gp-2 (the-as process-drawable *default-pool*)) + ) + (let ((gp-3 (-> self info explosion))) + (when gp-3 + (set! (-> gp-3 skel) + (the-as skeleton-group (art-group-get-by-name *level* (-> gp-3 skel-name) (the-as (pointer level) #f))) + ) + (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> s5-2 duration) (seconds 4)) + (set! (-> s5-2 gravity) -327680.0) + (set! (-> s5-2 rot-speed) 10.2) + (set-vector! (-> s5-2 fountain-rand-transv-lo) -81920.0 61440.0 -81920.0 1.0) + (set-vector! (-> s5-2 fountain-rand-transv-hi) 81920.0 131072.0 81920.0 1.0) + (let ((v1-100 + (process-spawn joint-exploder (-> gp-3 skel) (-> gp-3 anim) s5-2 gp-3 :name "joint-exploder" :to self :unk 0) + ) + ) + (when v1-100 + (let ((v1-103 (-> (the-as process-drawable (-> v1-100 0)) draw))) + (if v1-103 + (.svf (&-> (-> v1-103 color-mult) quad) vf0) + ) + ) + ) + ) + ) + ) + ) + (if (and (logtest? (vehicle-flag unique) (-> self v-flags)) + (not (logtest? (vehicle-flag player-killed) (-> self v-flags))) + (-> *setting-control* user-current unique-vehicle-mission-critical) + ) + (fail-mission) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate explode-into-nothing (wvehicle) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self v-flags) (the-as vehicle-flag (logclear (-> self v-flags) (vehicle-flag rammed-target)))) + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) 4096.0) + (set! (-> gp-0 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-0 group) (-> *part-group-id-table* (-> self info explosion-part))) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-0 damage) 2.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 (the-as process-drawable *default-pool*)) + ) + (logior! (-> self focus-status) (focus-status disable inactive)) + (disable-physics! self) + (rigid-body-object-method-43 self) + ) + :code sleep-code + :post (behavior () + (when (and (not (logtest? (vehicle-flag rammed-target) (-> self v-flags))) + (time-elapsed? (-> self state-time) (seconds 0.035)) + ) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag rammed-target) (-> self v-flags)))) + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 0))) + (a2-1 (-> self info debris)) + ) + (when a2-1 + (set! (-> a1-1 duration) (seconds 5)) + (set! (-> a1-1 hit-xz-reaction) 0.95) + (set! (-> a1-1 hit-y-reaction) 0.6) + (set! (-> a1-1 gravity) -163840.0) + (set! (-> a1-1 scale-rand-lo) 2.0) + (set! (-> a1-1 scale-rand-hi) (* 2.0 (-> a1-1 scale-rand-lo))) + (set! (-> a1-1 rot-speed) 1000.0) + (vector+! + (-> a1-1 fountain-rand-transv-lo) + (-> self root transv) + (new 'static 'vector :x -81920.0 :y 61440.0 :z -81920.0 :w 1.0) + ) + (vector+! + (-> a1-1 fountain-rand-transv-hi) + (-> self root transv) + (new 'static 'vector :x 81920.0 :y 131072.0 :z 81920.0 :w 1.0) + ) + (debris-spawn self a1-1 a2-1 (the-as process-drawable #f)) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (if (not (-> self child)) + (go-virtual die) + ) + ) + ) + +;; failed to figure out what this is: +(defstate waiting (wvehicle) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :exit (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (wvehicle-method-195 self) + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 10) (the-as int #f) (the-as vector #t) 0)) + ) + (set! (-> self control-hook) + (the-as (function vehicle vehicle-controls) (method-of-object self control-hook-ai)) + ) + (set! (-> self ai-state) (the-as uint 1)) + (logior! (-> self v-flags) (vehicle-flag ai-driving ignition)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self v-flags) (vehicle-flag ai-driving ignition)) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (wvehicle-method-168 self) + ) + ) + +;; failed to figure out what this is: +(defstate sink (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (vehicle-method-116 self 'drown-death) + (set! (-> self crash-level) 3) + (set! (-> self force-level) 3) + (logior! (-> self focus-status) (focus-status dead)) + (logclear! (-> self v-flags) (vehicle-flag persistent player-driving net-player-driving)) + (set! (-> self v-flags) (the-as vehicle-flag (logior (vehicle-flag dead lights-dead) (-> self v-flags)))) + (vehicle-method-126 self) + (sound-play "car-bubbles") + (vehicle-method-106 self) + (vehicle-method-136 self) + (vehicle-method-100 self) + (let ((v1-21 (-> self rbody))) + (set! (-> v1-21 linear-damping) 0.95) + (set! (-> v1-21 angular-damping) 0.25) + ) + (if (and (logtest? (vehicle-flag unique) (-> self v-flags)) + (not (logtest? (vehicle-flag player-killed) (-> self v-flags))) + (-> *setting-control* user-current unique-vehicle-mission-critical) + ) + (fail-mission) + ) + ) + :code sleep-code + :post (behavior () + (let ((v1-1 (-> self draw color-mult))) + (let ((f0-1 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) + (set-vector! v1-1 f0-1 f0-1 f0-1 1.0) + ) + (dotimes (a0-6 (-> self info physics-model wheel-count)) + (let ((a1-6 (handle->process (-> self wheel a0-6 handle)))) + (if a1-6 + (set! (-> (the-as process-drawable a1-6) draw color-mult quad) (-> v1-1 quad)) + ) + ) + ) + ) + (vehicle-explode-post) + ) + ) + +;; failed to figure out what this is: +(defstate race-waiting (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (wvehicle-method-195 self) + (vehicle-method-140 self) + (logior! (-> self v-flags) (vehicle-flag ignition)) + ) + :code sleep-code + :post (behavior () + (vector-reset! (-> self target-acceleration)) + (logclear! (-> self v-flags) (vehicle-flag player-impulse-force player-contact-force)) + (let ((v1-3 (-> self rbody))) + (set! (-> v1-3 force quad) (the-as uint128 0)) + (set! (-> v1-3 torque quad) (the-as uint128 0)) + ) + 0 + (reset-momentum! (-> self rbody)) + (rigid-body-object-method-30 self) + (vehicle-method-115 self) + ) + ) + +;; failed to figure out what this is: +(defstate race-racing (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self v-flags) (vehicle-flag riding ai-driving ignition)) + (set! (-> self controls throttle) 0.0) + (set! (-> self controls brake) 0.0) + (set! (-> self controls steering) 0.0) + (set! (-> self control-hook) + (the-as (function vehicle vehicle-controls) (method-of-object self wvehicle-method-177)) + ) + ) + :exit (behavior () + (logclear! (-> self v-flags) (vehicle-flag waiting-for-player)) + (let ((v1-3 (find-prim-by-id-logtest (-> self root) (the-as uint 32)))) + (when v1-3 + (set! (-> v1-3 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-3 prim-core collide-as) (collide-spec vehicle-sphere)) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (wvehicle-method-182 self) + ) + ) + +;; failed to figure out what this is: +(defstate race-finished (wvehicle) + :virtual #t + :event vehicle-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self v-flags) (vehicle-flag persistent riding nav-spheres)) + (set! (-> self controls throttle) 0.0) + (set! (-> self controls brake) 0.0) + (set! (-> self controls steering) 0.0) + ) + :trans #f + :code sleep-code + :post (behavior () + (wvehicle-method-185 self) + ) + ) + +;; failed to figure out what this is: +(defstate die (wvehicle) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-util_REF.gc new file mode 100644 index 0000000000..0731e39d51 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-util_REF.gc @@ -0,0 +1,1048 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 167 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-167 ((this wvehicle)) + (let* ((v1-0 (-> this info)) + (f0-1 (* (-> v1-0 engine drag) (-> v1-0 engine idle-rpm))) + (f1-2 (* (-> v1-0 engine peak-torque-rpm) (+ 1.0 (-> v1-0 engine drag)))) + (f2-2 1.0) + (f3-3 (/ (- (-> v1-0 engine idle-rpm) (-> v1-0 engine peak-torque-rpm)) (-> v1-0 engine powerband-width-rpm))) + ) + (set! (-> this idle-throttle) (/ f0-1 (* f1-2 (- f2-2 (* f3-3 f3-3))))) + ) + (set! (-> this idle-throttle) (fmax 0.0 (fmin 1.0 (-> this idle-throttle)))) + 0 + (none) + ) + +;; definition for method 37 of type wvehicle +(defmethod rigid-body-object-method-37 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle rigid-body-object-method-37))) + (t9-0 this) + ) + (set! (-> this wheel 0 info) (-> this info physics-model front-wheel)) + (set! (-> this wheel 1 info) (-> this info physics-model front-wheel)) + (set! (-> this wheel 2 info) (-> this info physics-model rear-wheel)) + (set! (-> this wheel 3 info) (-> this info physics-model rear-wheel)) + (dotimes (s5-0 (-> this info physics-model wheel-count)) + (let ((s4-0 (-> this wheel s5-0 info))) + (set! (-> s4-0 tread-tid) (lookup-texture-id-by-name (-> s4-0 tread-texture) (the-as string #f))) + ) + ) + (set! (-> this info physics-model front-wheel callback) (method-of-object this wvehicle-method-164)) + (set! (-> this info physics-model rear-wheel callback) (method-of-object this wvehicle-method-164)) + (let ((v1-22 (-> this draw shadow-ctrl))) + (set! (-> v1-22 settings shadow-dir w) (-> this info setup shadow-locus-dist)) + (set! (-> v1-22 settings top-plane w) 0.0) + (set! (-> v1-22 settings bot-plane w) (- (-> this info setup shadow-bot-clip))) + ) + (wvehicle-method-167 this) + (none) + ) + +;; definition for function have-earned-vehicle-v-type? +(defun have-earned-vehicle-v-type? ((arg0 int)) + (case arg0 + ((12) + (let ((v1-2 (-> *game-info* vehicles))) + (logtest? v1-2 (game-vehicles v-turtle)) + ) + ) + ((13) + (let ((v1-5 (-> *game-info* vehicles))) + (logtest? v1-5 (game-vehicles v-snake)) + ) + ) + ((14) + (let ((v1-8 (-> *game-info* vehicles))) + (logtest? v1-8 (game-vehicles v-scorpion)) + ) + ) + ((15) + (let ((v1-11 (-> *game-info* vehicles))) + (logtest? v1-11 (game-vehicles v-toad)) + ) + ) + ((16) + (let ((v1-14 (-> *game-info* vehicles))) + (logtest? v1-14 (game-vehicles v-fox)) + ) + ) + ((17) + (let ((v1-17 (-> *game-info* vehicles))) + (logtest? v1-17 (game-vehicles v-rhino)) + ) + ) + ((18) + (let ((v1-20 (-> *game-info* vehicles))) + (logtest? v1-20 (game-vehicles v-mirage)) + ) + ) + ((19) + (let ((v1-23 (-> *game-info* vehicles))) + (logtest? v1-23 (game-vehicles v-x-ride)) + ) + ) + ((21) + #t + ) + (else + #f + ) + ) + ) + +;; definition for function have-vehicle-v-type? +(defun have-vehicle-v-type? ((arg0 int)) + (case arg0 + ((12) + (let ((v1-2 (-> *game-info* vehicles))) + (let ((a0-3 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-3) + (set! v1-2 (logand v1-2 a0-3)) + ) + ) + (logtest? v1-2 (game-vehicles v-turtle)) + ) + ) + ((13) + (let ((v1-5 (-> *game-info* vehicles))) + (let ((a0-6 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-6) + (set! v1-5 (logand v1-5 a0-6)) + ) + ) + (logtest? v1-5 (game-vehicles v-snake)) + ) + ) + ((14) + (let ((v1-8 (-> *game-info* vehicles))) + (let ((a0-9 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-9) + (set! v1-8 (logand v1-8 a0-9)) + ) + ) + (logtest? v1-8 (game-vehicles v-scorpion)) + ) + ) + ((15) + (let ((v1-11 (-> *game-info* vehicles))) + (let ((a0-12 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-12) + (set! v1-11 (logand v1-11 a0-12)) + ) + ) + (logtest? v1-11 (game-vehicles v-toad)) + ) + ) + ((16) + (let ((v1-14 (-> *game-info* vehicles))) + (let ((a0-15 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-15) + (set! v1-14 (logand v1-14 a0-15)) + ) + ) + (logtest? v1-14 (game-vehicles v-fox)) + ) + ) + ((17) + (let ((v1-17 (-> *game-info* vehicles))) + (let ((a0-18 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-18) + (set! v1-17 (logand v1-17 a0-18)) + ) + ) + (logtest? v1-17 (game-vehicles v-rhino)) + ) + ) + ((18) + (let ((v1-20 (-> *game-info* vehicles))) + (let ((a0-21 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-21) + (set! v1-20 (logand v1-20 a0-21)) + ) + ) + (logtest? v1-20 (game-vehicles v-mirage)) + ) + ) + ((19) + (let ((v1-23 (-> *game-info* vehicles))) + (let ((a0-24 (-> *setting-control* user-current vehicles))) + (if (nonzero? a0-24) + (set! v1-23 (logand v1-23 a0-24)) + ) + ) + (logtest? v1-23 (game-vehicles v-x-ride)) + ) + ) + ((21) + #t + ) + (else + #f + ) + ) + ) + +;; definition for method 146 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-146 ((this wvehicle) (arg0 vector)) + (with-pp + (vector-float*! (-> this surface-velocity) arg0 (-> pp clock frames-per-second)) + 0 + (none) + ) + ) + +;; definition for method 54 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-54 ((this wvehicle)) + ((method-of-type vehicle rigid-body-object-method-54) this) + 0 + (none) + ) + +;; definition for method 128 of type wvehicle +(defmethod vehicle-method-128 ((this wvehicle)) + (have-vehicle-v-type? (the-as int (-> this info vehicle-type))) + ) + +;; definition for method 144 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-144 ((this wvehicle)) + (send-event *vehicle-manager* 'extra-bank (-> this info sound bank-replace)) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 22 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + 1.0 + (let* ((v1-9 (-> *setting-control* user-default language)) + (f30-0 (cond + ((= v1-9 (language-enum korean)) + 1.3 + ) + ((= v1-9 (language-enum russian)) + 1.3 + ) + (else + 1.0 + ) + ) + ) + ) + (let ((v1-11 gp-0)) + (set! (-> v1-11 width) (the float 350)) + ) + (let ((v1-12 gp-0)) + (set! (-> v1-12 height) (the float 80)) + ) + (let ((v1-13 gp-0)) + (set! (-> v1-13 scale) (* 0.7 f30-0)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (print-game-text + (lookup-text! *common-text* (text-id text-0779) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + (let ((a1-4 (-> this info name-text))) + (when (nonzero? a1-4) + (let ((a0-11 gp-0)) + (set! (-> a0-11 color) (font-color cyan)) + ) + (+! (-> gp-0 origin y) (the float (the int (* 30.0 f30-0)))) + (let ((v1-20 gp-0)) + (set! (-> v1-20 scale) (* 0.6 f30-0)) + ) + (print-game-text (lookup-text! *common-text* a1-4 #f) gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 145 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-145 ((this wvehicle)) + (when (not (have-earned-vehicle-v-type? (the-as int (-> this info vehicle-type)))) + (let ((gp-0 + (new 'stack 'font-context *font-default-matrix* 22 320 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + 1.0 + (let* ((v1-5 (-> *setting-control* user-default language)) + (f30-0 (cond + ((= v1-5 (language-enum korean)) + 1.3 + ) + ((= v1-5 (language-enum russian)) + 1.3 + ) + (else + 1.0 + ) + ) + ) + ) + (let ((v1-7 gp-0)) + (set! (-> v1-7 width) (the float 350)) + ) + (let ((v1-8 gp-0)) + (set! (-> v1-8 height) (the float 80)) + ) + (let ((v1-9 gp-0)) + (set! (-> v1-9 scale) (* 0.7 f30-0)) + ) + (set! (-> gp-0 flags) (font-flags shadow kerning large)) + (let ((a1-1 (-> this info name-text))) + (when (nonzero? a1-1) + (let ((a0-8 gp-0)) + (set! (-> a0-8 color) (font-color cyan)) + ) + (let ((v1-14 gp-0)) + (set! (-> v1-14 scale) (* 0.6 f30-0)) + ) + (print-game-text (lookup-text! *common-text* a1-1 #f) gp-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + (+! (-> gp-0 origin y) (the float (the int (* 30.0 f30-0)))) + ) + (let ((a0-12 gp-0)) + (set! (-> a0-12 color) (font-color default)) + ) + (print-game-text + (lookup-text! *common-text* (text-id text-0887) #f) + gp-0 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 170 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-170 ((this wvehicle)) + (-> this info rider attach-point-count) + (none) + ) + +;; definition for method 171 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-171 ((this wvehicle) (arg0 vector) (arg1 int)) + (vector-matrix*! arg0 (the-as vector (-> this info rider attach-point-array arg1)) (-> this rbody matrix)) + 0 + (none) + ) + +;; definition for method 172 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-172 ((this wvehicle) (arg0 quaternion) (arg1 int)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-zxy! (-> gp-0 0) (-> this info rider attach-point-array arg1 rot)) + (quaternion*! arg0 (the-as quaternion (-> this rbody rot)) (-> gp-0 0)) + ) + 0 + (none) + ) + +;; definition for method 173 of type wvehicle +(defmethod wvehicle-method-173 ((this wvehicle) (arg0 vector)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type1))) + (set! (-> gp-0 float00) (the-as float #x7f800000)) + (set! (-> gp-0 byte00) -1) + (dotimes (s3-0 (-> this info rider attach-point-count)) + (let ((s2-0 (handle->process (-> this attached-array s3-0)))) + (when (not (if (type? s2-0 process-focusable) + s2-0 + ) + ) + (wvehicle-method-171 this (-> gp-0 vec00) s3-0) + (set! (-> gp-0 float01) (vector-vector-distance-squared arg0 (-> gp-0 vec00))) + (when (< (-> gp-0 float01) (-> gp-0 float00)) + (set! (-> gp-0 float00) (-> gp-0 float01)) + (set! (-> gp-0 byte00) s3-0) + ) + ) + ) + ) + (-> gp-0 byte00) + ) + ) + +;; definition for method 174 of type wvehicle +;; WARN: Return type mismatch process vs process-focusable. +(defmethod get-attached-by-idx ((this wvehicle) (arg0 int)) + (let ((gp-0 (handle->process (-> this attached-array arg0)))) + (the-as process-focusable (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + ) + +;; definition for method 175 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod add-attached-at-idx ((this wvehicle) (arg0 int) (arg1 process-focusable)) + (if arg1 + (set! (-> this attached-array arg0) (process->handle arg1)) + ) + 0 + (none) + ) + +;; definition for method 176 of type wvehicle +(defmethod remove-attached-from-arr ((this wvehicle) (arg0 process-focusable)) + (let ((v1-2 (process->handle arg0))) + (dotimes (a1-4 (-> this info rider attach-point-count)) + (if (= v1-2 (-> this attached-array a1-4)) + (set! (-> this attached-array a1-4) (the-as handle #f)) + ) + ) + ) + #f + ) + +;; definition for method 142 of type wvehicle +;; WARN: Return type mismatch symbol vs none. +(defmethod vehicle-method-142 ((this wvehicle)) + (reset-momentum! (-> this rbody)) + (set! (-> this wheel-rev) 0.0) + (dotimes (v1-2 (-> this info physics-model wheel-count)) + (let ((a0-5 (-> this wheel v1-2))) + (set! (-> a0-5 rev) 0.0) + (set! (-> a0-5 up-vel) 0.0) + (set! (-> a0-5 side-vel) 0.0) + (set! (-> a0-5 forward-vel) 0.0) + (set! (-> a0-5 forward-slip-vel) 0.0) + ) + ) + (none) + ) + +;; definition for method 40 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod apply-momentum! ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle apply-momentum!))) + (t9-0 this) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag particles joints) (-> this v-flags)))) + (none) + ) + +;; definition for method 41 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod disable-physics! ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle disable-physics!))) + (t9-0 this) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag particles joints) (-> this v-flags)))) + (none) + ) + +;; definition for method 124 of type wvehicle +(defmethod vehicle-method-124 ((this wvehicle)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + ((method-of-type vehicle vehicle-method-124) this) + (none) + ) + +;; definition for method 169 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-169 ((this wvehicle)) + 0 + (none) + ) + +;; definition for method 64 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-64 ((this wvehicle)) + (when (and (not (logtest? (vehicle-flag turbo-boost) (-> this v-flags))) (>= (-> this turbo-supply) 1.0)) + (cond + ((< (-> this turbo-supply) 1.0) + (if (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf2))) + (sound-play "turbo-dud") + ) + ) + ((< (-> this turbo-ready) 1.0) + (if (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf2))) + (sound-play "turbo-out") + ) + ) + (else + (set! (-> this turbo-ready) 0.0) + (+! (-> this turbo-supply) -1.0) + (set! (-> this turbo-boost-time) (the-as uint (current-time))) + (set! (-> this turbo-boost-factor) (-> this info handling turbo-boost-factor)) + (set! (-> this turbo-boost-duration) (-> this info handling turbo-boost-duration)) + (logior! (-> this v-flags) (vehicle-flag turbo-boost)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 143 of type wvehicle +(defmethod vehicle-method-143 ((this wvehicle) (arg0 process)) + (set! (-> this target-status handle) (process->handle arg0)) + (set! (-> this ai-state) (the-as uint 1)) + (go (method-of-object this hostile)) + ) + +;; definition for method 132 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-132 ((this wvehicle) (arg0 traffic-object-spawn-params)) + (case (-> arg0 behavior) + ((3) + (set! (-> this target-status handle) (-> arg0 handle)) + (go (method-of-object this hostile)) + ) + ((10) + (let* ((a0-3 this) + (t9-1 (method-of-object a0-3 wvehicle-method-197)) + ) + (-> arg0 id) + (cond + ((t9-1 a0-3) + (cond + ((logtest? (-> arg0 flags) (traffic-spawn-flags tsf1)) + (logior! (-> this v-flags) (vehicle-flag riding ai-driving)) + (go (method-of-object this race-waiting)) + ) + (else + (logior! (-> this v-flags) (vehicle-flag waiting-for-player)) + (logior! (-> this focus-status) (focus-status grabbed)) + (go (method-of-object this waiting)) + ) + ) + ) + (else + (go (method-of-object this die)) + ) + ) + ) + ) + ((13) + (go (method-of-object this undefined1)) + ) + (else + ((method-of-type vehicle vehicle-method-132) this arg0) + ) + ) + 0 + (none) + ) + +;; definition for method 102 of type wvehicle +(defmethod vehicle-method-102 ((this wvehicle)) + (logtest? (vehicle-flag disturbed player-driving in-pursuit) (-> this v-flags)) + ) + +;; definition for method 103 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-103 ((this wvehicle)) + (local-vars (v1-8 float) (v1-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) + (let* ((f0-0 (-> this camera-dist2)) + (f1-0 0.000024414063) + (f0-1 (* f0-0 (* f1-0 f1-0))) + ) + (.lvf vf1 (&-> (-> this rbody ang-velocity) 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-8 vf1) + (when (and (< v1-8 f0-1) (begin + (.lvf vf1 (&-> (-> this rbody lin-velocity) 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-13 vf1) + (let ((f1-4 v1-13) + (f2-0 614.4) + ) + (< f1-4 (* f0-1 (* f2-0 f2-0))) + ) + ) + ) + (logclear! (-> this v-flags) (vehicle-flag disturbed)) + (vehicle-method-142 this) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 161 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-wheels! ((this wvehicle) (arg0 skeleton-group) (arg1 skeleton-group) (arg2 skeleton-group) (arg3 skeleton-group)) + (local-vars (sv-96 vehicle-wheel-state)) + (let ((s1-0 (new 'stack-no-clear 'vehicle-wheel-init-params))) + (set! (-> s1-0 position quad) (-> this root trans quad)) + (quaternion-identity! (-> s1-0 rotation)) + (vector-identity! (-> s1-0 scale)) + (set! (-> s1-0 skel) arg0) + (set! (-> s1-0 skel-blur) arg1) + (set! (-> s1-0 level) (the-as symbol (-> this level))) + (set! (-> s1-0 radius) 4096.0) + (set! (-> s1-0 collision-mesh-index) -1) + (&-> s1-0 skel) + (dotimes (s0-0 (-> this info physics-model wheel-count)) + (cond + ((and arg2 (>= s0-0 2)) + (set! (-> s1-0 skel) arg2) + (set! (-> s1-0 skel-blur) arg3) + ) + (else + (set! (-> s1-0 skel) arg0) + (set! (-> s1-0 skel-blur) arg1) + ) + ) + (set! sv-96 (-> this wheel s0-0)) + (set! (-> s1-0 radius) (* 1.3 (-> sv-96 info scale) (-> sv-96 info radius))) + (vector-identity! (-> s1-0 scale)) + (set! (-> s1-0 scale x) (-> sv-96 x-scale)) + (vector-float*! (-> s1-0 scale) (-> s1-0 scale) (-> sv-96 info scale)) + (if (logtest? (-> this info flags) #x4000) + (set! (-> s1-0 collision-mesh-index) (if (>= (-> sv-96 x-scale) 0.0) + 0 + 1 + ) + ) + ) + (set! (-> sv-96 handle) + (process->handle (vehicle-wheel-spawn this (the-as vehicle-wheel-init-params (&-> s1-0 skel)))) + ) + (set! (-> sv-96 pos) (-> sv-96 info settle-pos)) + (set! (-> sv-96 pos2) (-> sv-96 pos)) + ) + ) + (wvehicle-method-165 this) + (vehicle-method-79 this) + 0 + (none) + ) + +;; definition for method 82 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-82 ((this wvehicle)) + (call-parent-method this) + (set-setting! 'rapid-tracking #f 0.0 0) + (let ((v1-2 (process->ppointer this))) + (persist-with-delay + *setting-control* + 'butt-handle + (seconds 1.5) + 'butt-handle + (the-as symbol v1-2) + 32768.0 + (-> v1-2 0 pid) + ) + ) + 0 + (none) + ) + +;; definition for method 83 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-83 ((this wvehicle)) + (call-parent-method this) + (logclear! (-> this draw status) (draw-control-status force-vu1)) + 0 + (none) + ) + +;; definition for method 148 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-148 ((this wvehicle)) + (send-event *target* 'draw #t) + 0 + (none) + ) + +;; definition for method 147 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-147 ((this wvehicle)) + (send-event *target* 'draw #f) + 0 + (none) + ) + +;; definition for method 20 of type wvehicle +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this wvehicle)) + (let ((v0-0 0)) + (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) + (set! v0-0 (logior v0-0 40)) + ) + (if (logtest? (vehicle-flag dead ignore-damage ignore-impulse) (-> this v-flags)) + (set! v0-0 0) + ) + (the-as search-info-flag v0-0) + ) + ) + +;; definition for method 149 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-149 ((this wvehicle)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type2))) + (set! (-> gp-0 float0) 4096.0) + (quaternion->matrix (-> gp-0 mat0) (-> this root quat)) + (set! (-> gp-0 mat0 trans quad) (-> this root trans quad)) + (set! (-> gp-0 vec3 quad) (-> gp-0 mat0 fvec quad)) + (set! (-> gp-0 vec1 quad) (-> this root trans quad)) + (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec1 quad)) + (+! (-> gp-0 cquery start-pos y) 4096.0) + (vector-reset! (-> gp-0 vec2)) + (set! (-> gp-0 vec2 y) 1.0) + (vector-z-quaternion! (-> gp-0 vec3) (-> this root quat)) + (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-11 (-> gp-0 cquery))) + (set! (-> v1-11 radius) (-> gp-0 float0)) + (set! (-> v1-11 collide-with) (collide-spec backgnd)) + (set! (-> v1-11 ignore-process0) #f) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) + (when (>= f30-0 0.0) + (vector+float*! (-> gp-0 vec1) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) + (set! (-> gp-0 vec1 y) (- (-> gp-0 vec1 y) (-> gp-0 float0))) + (let* ((v1-19 (-> gp-0 cquery best-other-tri pat material)) + (a0-22 (cond + ((or (= v1-19 (pat-material stone)) (= v1-19 (pat-material wood))) + 0 + ) + ((or (= v1-19 (pat-material dirt)) (= v1-19 (pat-material unknown))) + 1 + ) + ((= v1-19 (pat-material sand)) + 2 + ) + ((= v1-19 (pat-material quicksand)) + 3 + ) + ((= v1-19 (pat-material metal)) + 6 + ) + (else + 1 + ) + ) + ) + (v1-21 (-> *wvehicle-surfaces* (the-as uint a0-22))) + ) + (set! (-> gp-0 vec1 y) (- (-> gp-0 vec1 y) (-> v1-21 depth))) + ) + (set! (-> gp-0 vec2 quad) (-> gp-0 cquery best-other-tri normal quad)) + (when (< (-> gp-0 vec2 y) (cos 3640.889)) + (vector-reset! (-> gp-0 vec2)) + (set! (-> gp-0 vec2 y) 1.0) + ) + (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + 0 + ) + (if (< f30-0 0.0) + 0 + ) + ) + (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec3) (-> gp-0 vec2)) + ) + 0 + (none) + ) + +;; definition for method 198 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-198 ((this wvehicle)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-physics-work))) + (set! (-> gp-0 ground-pos z) (seconds-per-frame)) + (let ((v1-2 (-> this info setup))) + (set! (-> gp-0 ground-pos y) (fmax (fmin (-> this gun-aim-yaw) (-> v1-2 gun-yaw-max)) (-> v1-2 gun-yaw-min))) + ) + (let* ((v1-4 (-> gp-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-4 rvec quad) a0-3) + (set! (-> v1-4 uvec quad) a1-0) + (set! (-> v1-4 fvec quad) a2-0) + (set! (-> v1-4 trans quad) a3-1) + ) + (set! (-> gp-0 tmp quad) (-> this turret-local-pos quad)) + (set-vector! (-> gp-0 probe-dir) (sin (-> gp-0 ground-pos y)) 0.0 (cos (-> gp-0 ground-pos y)) 1.0) + (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) 204800.0) + (vector-matrix*! (-> gp-0 local-pos) (-> gp-0 tmp) (-> gp-0 mat)) + (set! (-> this gun-targ-pitch) 0.0) + (set! (-> this gun-targ-yaw) (-> gp-0 ground-pos y)) + (vector-matrix*! (-> gp-0 p-body) (-> gp-0 steering-axis) (-> gp-0 mat)) + (set! (-> gp-0 p-body w) 163840.0) + (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) + (set! (-> gp-0 ground-normal-sum x) (the-as float (fill-actor-list-for-box + *actor-hash* + (the-as bounding-box (-> gp-0 p-body)) + (the-as (pointer collide-shape) (-> s4-1 data)) + (-> s4-1 allocated-length) + ) + ) + ) + (set! (-> s4-1 length) (the-as int (-> gp-0 ground-normal-sum x))) + (let ((a0-14 (find-nearest-focusable + (the-as (array collide-shape) s4-1) + (-> gp-0 p-body) + 655360.0 + (search-info-flag attackable enemy attackable-priority high-priority) + (search-info-flag) + (-> gp-0 mat fvec) + (-> gp-0 local-pos) + 27306.666 + ) + ) + ) + (when a0-14 + (vector-! (-> gp-0 axis) (get-trans a0-14 3) (-> gp-0 local-pos)) + (matrix-transpose! (the-as matrix (-> gp-0 force)) (-> gp-0 mat)) + (vector-matrix*! (-> gp-0 dir) (-> gp-0 axis) (the-as matrix (-> gp-0 force))) + (vector-normalize! (-> gp-0 dir) 1.0) + (set! (-> this gun-targ-yaw) (atan (-> gp-0 dir x) (-> gp-0 dir z))) + (set! (-> this gun-targ-pitch) (asin (-> gp-0 dir y))) + 0 + ) + ) + ) + (let ((s4-4 (-> this info setup))) + (set! (-> this gun-targ-yaw) (fmax (fmin (-> this gun-targ-yaw) (-> s4-4 gun-yaw-max)) (-> s4-4 gun-yaw-min))) + (set! (-> this gun-targ-pitch) + (fmax (fmin (-> this gun-targ-pitch) (-> s4-4 gun-pitch-max)) (-> s4-4 gun-pitch-min)) + ) + (if (>= (-> s4-4 gun-yaw-max) 65536.0) + (set! (-> this gun-yaw) + (deg-seek + (-> this gun-yaw) + (-> this gun-targ-yaw) + (* 10.0 (fabs (deg- (-> this gun-yaw) (-> this gun-targ-yaw))) (-> gp-0 ground-pos z)) + ) + ) + (+! (-> this gun-yaw) + (* (- (-> this gun-targ-yaw) (-> this gun-yaw)) (fmin 1.0 (* 10.0 (-> gp-0 ground-pos z)))) + ) + ) + (+! (-> this gun-pitch) + (* (- (-> this gun-targ-pitch) (-> this gun-pitch)) (fmin 1.0 (* 10.0 (-> gp-0 ground-pos z)))) + ) + (set! (-> gp-0 ground-normal-sum y) (sin (-> this gun-yaw))) + (set! (-> gp-0 ground-normal-sum z) (cos (-> this gun-yaw))) + (set! (-> gp-0 ground-normal-sum w) (sin (-> this gun-pitch))) + (set! (-> gp-0 ground-pos x) (cos (-> this gun-pitch))) + (set-vector! + (-> gp-0 probe-dir) + (* (-> gp-0 ground-pos x) (-> gp-0 ground-normal-sum y)) + (-> gp-0 ground-normal-sum w) + (* (-> gp-0 ground-pos x) (-> gp-0 ground-normal-sum z)) + 1.0 + ) + (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) (-> s4-4 gun-z-offset)) + ) + (set! (-> this gun-local-dir quad) (-> gp-0 probe-dir quad)) + (set! (-> this gun-local-pos quad) (-> gp-0 steering-axis quad)) + ) + 0 + (none) + ) + +;; definition for method 199 of type wvehicle +;; INFO: Used lq/sq +(defmethod wvehicle-method-199 ((this wvehicle)) + (let ((s5-0 (new 'stack-no-clear 'wvehicle-stack-type3))) + (set! (-> s5-0 float0) (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec))) + (if (and (cpad-hold? 0 square) (< (-> s5-0 float0) -20480.0)) + (set! (-> this lock-turret) (the-as basic #t)) + ) + (if (or (< 0.0 (-> s5-0 float0)) + (or (< 0.25 (fabs (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 1.0))) + (logtest? (vehicle-flag camera-look-mode) (-> this v-flags)) + ) + ) + (set! (-> this lock-turret) #f) + ) + (cond + ((-> this lock-turret) + (set! (-> this gun-aim-yaw) 0.0) + ) + (else + (matrix-transpose! (-> s5-0 mat0) (-> this rbody matrix)) + (matrix*! (-> s5-0 mat0) (camera-matrix) (-> s5-0 mat0)) + (set! (-> s5-0 vec0 quad) (-> s5-0 mat0 fvec quad)) + (set! (-> this gun-aim-yaw) (atan (-> s5-0 vec0 x) (-> s5-0 vec0 z))) + ) + ) + ) + 0 + (wvehicle-method-198 this) + (none) + ) + +;; definition for method 201 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-201 ((this wvehicle)) + 0 + (none) + ) + +;; definition for method 202 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-202 ((this wvehicle)) + 0 + (none) + ) + +;; definition of type kill-player-process +(deftype kill-player-process (process) + ((player handle) + (mode symbol) + ) + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type kill-player-process +(defmethod inspect ((this kill-player-process)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tplayer: ~D~%" (-> this player)) + (format #t "~2Tmode: ~A~%" (-> this mode)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (kill-player-process) + :virtual #t + :trans (behavior () + (let* ((s5-0 (handle->process (-> self player))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (not gp-0) + (go-virtual die) + ) + (if (focus-test? (the-as process-focusable gp-0) dead) + (go-virtual die) + ) + (when (not (focus-test? (the-as process-focusable gp-0) grabbed)) + (if (send-event + gp-0 + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode (-> self mode)) + ) + ) + ) + (go-virtual die) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (kill-player-process) + :virtual #t + :code (behavior () + '() + ) + ) + +;; definition for function kill-player-process-init-by-other +(defbehavior kill-player-process-init-by-other kill-player-process ((arg0 process) (arg1 symbol)) + (set! (-> self player) (process->handle arg0)) + (set! (-> self mode) arg1) + (go-virtual idle) + ) + +;; definition for function kill-player-process-spawn +;; WARN: Return type mismatch process vs kill-player-process. +(defun kill-player-process-spawn ((arg0 process) (arg1 process) (arg2 symbol)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn kill-player-process arg0 arg2 :name "kill-player-process" :to arg1))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as kill-player-process gp-0) + ) + ) + +;; definition for method 116 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-116 ((this wvehicle) (arg0 symbol)) + (dotimes (s4-0 (-> this info rider seat-count)) + (let* ((s3-0 (handle->process (-> this rider-array s4-0))) + (a1-3 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (and a1-3 (logtest? (-> a1-3 mask) (process-mask target))) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag player-killed) (-> this v-flags)))) + (kill-player-process-spawn a1-3 a1-3 arg0) + ) + ) + (put-rider-in-seat this s4-0 (the-as process #f)) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc new file mode 100644 index 0000000000..63820e7754 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc @@ -0,0 +1,488 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vehicle-wheel-init-params +(deftype vehicle-wheel-init-params (structure) + ((skel skeleton-group) + (skel-blur skeleton-group) + (level symbol) + (radius float) + (collision-mesh-index int8) + (position vector :inline) + (rotation quaternion :inline) + (scale vector :inline) + ) + ) + +;; definition for method 3 of type vehicle-wheel-init-params +(defmethod inspect ((this vehicle-wheel-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'vehicle-wheel-init-params) + (format #t "~1Tskel: ~A~%" (-> this skel)) + (format #t "~1Tskel-blur: ~A~%" (-> this skel-blur)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tcollision-mesh-index: ~D~%" (-> this collision-mesh-index)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Trotation: #~%" (-> this rotation)) + (format #t "~1Tscale: #~%" (-> this scale)) + (label cfg-4) + this + ) + +;; definition for symbol *vehicle-wheel-constants*, type rigid-body-object-constants +(define *vehicle-wheel-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.0 + :inv-mass 1.0 + :linear-damping 0.995 + :angular-damping 0.995 + :bounce-factor 0.5 + :friction-factor 0.5 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2) (meters 3) (meters 3)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 50) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*vehicle-wheel-constants* + ) + ) + +;; definition of type vehicle-wheel +(deftype vehicle-wheel (rigid-body-object) + ((collision-enable? symbol) + (normal-look lod-set :inline) + (blur-look lod-set :inline) + ) + (:state-methods + explode + fade-out + die + ) + (:methods + (init-collision! (_type_ vehicle-wheel-init-params) none :replace) + ) + ) + +;; definition for method 3 of type vehicle-wheel +(defmethod inspect ((this vehicle-wheel)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type rigid-body-object inspect))) + (t9-0 this) + ) + (format #t "~2Tcollision-enable?: ~A~%" (-> this collision-enable?)) + (format #t "~2Tnormal-look: #~%" (-> this normal-look)) + (format #t "~2Tblur-look: #~%" (-> this blur-look)) + (label cfg-4) + this + ) + +;; definition for method 34 of type vehicle-wheel +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this vehicle-wheel) (arg0 vehicle-wheel-init-params)) + (cond + ((< (-> arg0 collision-mesh-index) 0) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-0 penetrate-using) (penetrate vehicle)) + (let ((v1-8 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 0) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-8) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-11 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + ) + (else + (let ((s4-1 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-1 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-1 reaction) cshape-reaction-default) + (set! (-> s4-1 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-1 penetrate-using) (penetrate vehicle)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 2) 0))) + (set! (-> s4-1 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + (set! (-> s4-1 root-prim) s3-0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s4-1 (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid)) + (set! (-> v1-24 transform-index) 0) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + ) + (let ((v1-26 + (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint (-> arg0 collision-mesh-index)) (the-as uint 0)) + ) + ) + (set! (-> v1-26 prim-core action) (collide-action solid rideable)) + (set! (-> v1-26 transform-index) 3) + (set-vector! (-> v1-26 local-sphere) 0.0 0.0 0.0 (-> arg0 radius)) + ) + (set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w))) + (let ((v1-29 (-> s4-1 root-prim))) + (set! (-> s4-1 backup-collide-as) (-> v1-29 prim-core collide-as)) + (set! (-> s4-1 backup-collide-with) (-> v1-29 prim-core collide-with)) + ) + (set! (-> this root) s4-1) + ) + ) + ) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere-no-probe)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh-no-block-use)) + ) + ((zero? v1-0) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh-no-block-use vehicle-sphere-no-probe)) + ) + ) + ) + (none) + ) + ) + 0 + (none) + ) + +;; definition for method 35 of type vehicle-wheel +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this vehicle-wheel)) + (alloc-rbody-control! this *vehicle-wheel-constants*) + (logior! (-> this rbody flags) (rigid-body-flag enable-collision)) + (set! (-> this root max-iteration-count) (the-as uint 3)) + (set! (-> this max-time-step) 0.033333335) + (set! (-> this draw shadow-ctrl) + (new 'process 'shadow-control -43008.0 -2048.0 69632.0 (the-as vector #f) (shadow-flags) 245760.0) + ) + (set! (-> this focus-status) + (the-as focus-status (logior (focus-status gun-no-target) (-> this focus-status))) + ) + 0 + (none) + ) + +;; definition for method 30 of type vehicle-wheel +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-30 ((this vehicle-wheel)) + (ja-post) + (if (logtest? (-> this rbody flags) (rigid-body-flag enable-collision)) + (update-transforms (-> this root)) + ) + 0 + (none) + ) + +;; definition for method 39 of type vehicle-wheel +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod rbody-post ((this vehicle-wheel)) + (let ((v1-0 (new 'stack-no-clear 'rigid-body-move-work))) + (set! (-> v1-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-float*! (-> v1-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) + (let ((a0-4 (-> v1-0 cquery))) + (set! (-> a0-4 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> a0-4 collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> a0-4 ignore-process0) this) + (set! (-> a0-4 ignore-process1) #f) + (set! (-> a0-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + (set! (-> a0-4 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* (-> v1-0 cquery)) + ) + (if *display-collide-cache* + (debug-draw *collide-cache*) + ) + (rigid-body-object-method-32 this) + (rigid-body-object-method-38 this) + (update-rbody-transform! (-> this rbody) (the-as collide-shape-moving (-> this root))) + (rigid-body-object-method-30 this) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (vehicle-wheel) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-2 object)) + (case message + (('explode) + (lods-assign! (-> self draw) (-> self normal-look)) + (let ((a0-4 (-> self draw color-mult))) + (vector-float*! (the-as vector a0-4) (the-as vector a0-4) 0.25) + ) + (set! (-> self rbody position quad) (-> self root trans quad)) + (quaternion-copy! (the-as quaternion (-> self rbody rot)) (-> self root quat)) + (let ((v1-10 (-> block param 0))) + (when v1-10 + (vector-float*! (-> self rbody lin-momentum) (the-as vector v1-10) (-> self info info mass)) + (go-virtual explode) + ) + ) + ) + (('enable-collision) + (set! v0-2 (logior (-> self rbody flags) (rigid-body-flag enable-collision))) + (set! (-> self rbody flags) (the-as rigid-body-flag v0-2)) + v0-2 + ) + (('disable-collision) + (set! v0-2 (logclear (-> self rbody flags) (rigid-body-flag enable-collision))) + (set! (-> self rbody flags) (the-as rigid-body-flag v0-2)) + v0-2 + ) + (('hide) + (set! v0-2 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-2)) + v0-2 + ) + (('unhide) + (set! v0-2 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-2)) + v0-2 + ) + ) + ) + :enter (behavior () + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((= v1-0 -1) + (set! (-> arg0 prim-core collide-with) (collide-spec)) + (set! (-> arg0 prim-core collide-as) (collide-spec)) + 0 + ) + ((or (= v1-0 1) (zero? v1-0)) + (set! (-> arg0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-mesh-no-block-use)) + ) + ) + ) + (none) + ) + ) + ) + :trans #f + :post (behavior () + (rigid-body-object-method-30 self) + ) + ) + +;; failed to figure out what this is: +(defstate explode (vehicle-wheel) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + #t + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self rbody flags) (rigid-body-flag enable-physics)) + (iterate-prims + (-> self root) + (lambda ((arg0 collide-shape-prim)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((or (= v1-0 -1) (zero? v1-0)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec vehicle-sphere-no-probe)) + ) + ((= v1-0 1) + (set! (-> arg0 prim-core collide-with) (collide-spec)) + (set! (-> arg0 prim-core collide-as) (collide-spec)) + 0 + ) + ) + ) + (none) + ) + ) + ) + :trans #f + :code sleep-code + :post (behavior () + (rbody-post self) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-virtual fade-out) + ) + ) + ) + +;; failed to figure out what this is: +(defstate fade-out (vehicle-wheel) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self draw status) (draw-control-status force-fade)) + ) + :code sleep-code + :post (behavior () + (set! (-> self draw force-fade) + (the-as + uint + (the int (fmax 0.0 (- 128.0 (* 0.42666668 (the float (- (current-time) (-> self state-time))))))) + ) + ) + (if (< (-> self draw force-fade) (the-as uint 2)) + (go-virtual die) + ) + (rbody-post self) + ) + ) + +;; failed to figure out what this is: +(defstate die (vehicle-wheel) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +;; definition for function vehicle-wheel-init-by-other +;; INFO: Used lq/sq +(defbehavior vehicle-wheel-init-by-other vehicle-wheel ((arg0 vehicle-wheel-init-params)) + (logior! (-> self mask) (process-mask vehicle)) + (init-collision! self arg0) + (set! (-> self root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> self root quat) (-> arg0 rotation)) + (set! (-> self root scale quad) (-> arg0 scale quad)) + (set! (-> self level) (the-as level (-> arg0 level))) + (initialize-skeleton self (-> arg0 skel) (the-as pair 0)) + (setup-lods! (-> self normal-look) (-> arg0 skel) (-> self draw art-group) (-> self entity)) + (setup-lods! (-> self blur-look) (-> arg0 skel-blur) (-> self draw art-group) (-> self entity)) + (set! (-> self normal-look lod 0 dist) 819200.0) + (set! (-> self blur-look lod 0 dist) 819200.0) + (set! (-> self draw lod-set lod 0 dist) 819200.0) + (let ((f0-6 (fmax (fmax (fabs (-> arg0 scale x)) (fabs (-> arg0 scale y))) (fabs (-> arg0 scale z))))) + (set! (-> self draw bounds w) (* (-> arg0 skel bounds w) f0-6)) + (set! (-> self draw longest-edge) (* (-> arg0 skel longest-edge) f0-6)) + ) + (init-rbody-control! self) + (go-virtual idle) + ) + +;; definition for function vehicle-wheel-spawn +;; WARN: Return type mismatch process vs vehicle-wheel. +(defun vehicle-wheel-spawn ((arg0 process) (arg1 vehicle-wheel-init-params)) + (let ((gp-0 (the-as process #f))) + (let* ((s3-0 (get-process *default-dead-pool* vehicle-wheel #x4000 1)) + (v1-1 (when s3-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s3-0 arg0 "vehicle-wheel" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 vehicle-wheel-init-by-other arg1) + (-> s3-0 ppointer) + ) + ) + ) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as vehicle-wheel gp-0) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc new file mode 100644 index 0000000000..45ee36bafd --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc @@ -0,0 +1,1332 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 166 of type wvehicle +(defmethod wvehicle-method-166 ((this wvehicle) (arg0 float) (arg1 float)) + (let* ((v1-0 (-> this info)) + (f0-0 (-> this engine-max-torque)) + (f1-3 (* (+ 1.0 (-> v1-0 engine drag)) + (if (< arg0 (-> v1-0 engine max-rpm)) + 1.0 + 0.0 + ) + (fmax (-> this idle-throttle) arg1) + ) + ) + (f2-5 0.2) + (f3-2 1.0) + (f4-2 (/ (- arg0 (-> v1-0 engine peak-torque-rpm)) (-> v1-0 engine powerband-width-rpm))) + ) + (* f0-0 (+ (* f1-3 (fmax f2-5 (- f3-2 (* f4-2 f4-2)))) + (* -1.0 (/ arg0 (-> v1-0 engine peak-torque-rpm)) (-> v1-0 engine drag)) + ) + ) + ) + ) + +;; definition for method 164 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-164 ((this wvehicle) (arg0 vehicle-wheel-state) (arg1 vehicle-wheel-info)) + (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type6))) + (set-vector! (-> gp-0 vec0) 1.0 0.0 0.0 1.0) + (set-vector! (-> gp-0 vec1) 0.0 1.0 0.0 1.0) + (quaternion-copy! (-> gp-0 quat3) (-> this root quat)) + (let* ((v1-3 (-> gp-0 mat0)) + (a3-0 (-> this rbody matrix)) + (a0-7 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-3 rvec quad) a0-7) + (set! (-> v1-3 uvec quad) a1-2) + (set! (-> v1-3 fvec quad) a2-1) + (set! (-> v1-3 trans quad) a3-1) + ) + (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (+! (-> gp-0 vec2 x) (-> arg1 susp-arm-length)) + (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) + (+! (-> gp-0 vec2 y) (-> arg1 probe-y-offset)) + (vector+float*! + (-> arg0 probe-local-pos) + (-> gp-0 vec2) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (set! (-> gp-0 float0) + (+ (-> arg1 probe-y-offset) (* (-> arg1 radius) (-> arg1 scale)) (* -1.0 (-> arg0 pos2) (-> arg1 travel))) + ) + (set! (-> arg0 sin-susp-ang) (fmax -1.0 (fmin 1.0 (/ (-> gp-0 float0) (-> arg1 susp-arm-length))))) + (let ((f0-21 1.0) + (f1-11 (-> arg0 sin-susp-ang)) + ) + (set! (-> arg0 cos-susp-ang) (sqrtf (- f0-21 (* f1-11 f1-11)))) + ) + (quaternion-identity! (-> gp-0 quat4)) + (set! (-> gp-0 quat4 z) (* (sin (-> arg1 camber)) (-> arg0 x-scale))) + (set! (-> gp-0 quat4 w) (cos (-> arg1 camber))) + (when (logtest? (-> arg1 flags) (vehicle-wheel-flag vwf5)) + (quaternion-set! + (-> gp-0 quat0) + 0.0 + 0.0 + (* (-> arg0 sin-susp-ang) (-> arg0 x-scale)) + (+ 1.0 (-> arg0 cos-susp-ang)) + ) + (quaternion-normalize! (-> gp-0 quat0)) + (quaternion*! (-> gp-0 quat4) (-> gp-0 quat4) (-> gp-0 quat0)) + ) + (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (+! (-> gp-0 vec2 x) (* (-> arg1 susp-arm-length) (-> arg0 cos-susp-ang))) + (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) + (+! (-> gp-0 vec2 y) (-> gp-0 float0)) + (vector+float*! + (-> gp-0 vec2) + (-> gp-0 vec2) + (-> arg0 local-axis) + (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) + ) + (vector-matrix*! (-> gp-0 vec3) (-> gp-0 vec2) (-> gp-0 mat0)) + (quaternion-vector-angle! (-> gp-0 quat2) (-> gp-0 vec1) (-> arg0 steer-angle)) + (quaternion-vector-angle! (-> gp-0 quat1) (-> gp-0 vec0) (-> arg0 angle)) + (quaternion*! (-> gp-0 quat0) (-> gp-0 quat2) (-> gp-0 quat4)) + (quaternion*! (-> gp-0 quat0) (-> gp-0 quat0) (-> gp-0 quat1)) + (quaternion*! (-> arg0 quat) (-> gp-0 quat3) (-> gp-0 quat0)) + (set! (-> arg0 trans quad) (-> gp-0 vec3 quad)) + ) + 0 + (none) + ) + +;; definition for method 165 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-165 ((this wvehicle)) + (let ((s5-0 (new 'stack-no-clear 'vehicle-controls))) + (set! (-> s5-0 steering) (seconds-per-frame)) + (dotimes (s4-0 (-> this info physics-model wheel-count)) + (let* ((a1-0 (-> this wheel s4-0)) + (a2-0 (-> a1-0 info)) + ) + (let* ((f0-1 (-> a1-0 pos2)) + (f1-1 (- (-> a1-0 pos) (-> a1-0 pos2))) + (f2-1 1.0) + (f3-0 (-> s5-0 steering)) + (f4-0 (-> a1-0 forward-vel)) + (f4-2 (* f4-0 f4-0)) + (f5-0 (-> a1-0 up-vel)) + (f4-3 (+ f4-2 (* f5-0 f5-0))) + (f5-3 8192.0) + (f3-1 (* f3-0 (fmin f4-3 (* f5-3 f5-3)))) + (f4-5 15.0) + (f5-6 8192.0) + ) + (set! (-> a1-0 pos2) (+ f0-1 (* f1-1 (fmin f2-1 (* f3-1 (/ f4-5 (* f5-6 f5-6))))))) + ) + (set! (-> a1-0 angle) + (the float (sar (shl (the int (+ (-> a1-0 angle) (* 10430.379 (-> a1-0 rev) (-> s5-0 steering)))) 48) 48)) + ) + ((-> a2-0 callback) this a1-0 a2-0) + ) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (let ((a2-1 (-> this draw shadow-ctrl settings))) + (vector+float*! (-> s5-1 rvec) (-> a2-1 center) (-> a2-1 shadow-dir) (-> a2-1 shadow-dir w)) + ) + 0 + (dotimes (s4-1 (-> this info physics-model wheel-count)) + (let ((s3-0 (-> this wheel s4-1))) + (-> s3-0 info) + (let ((s2-0 (handle->process (-> s3-0 handle)))) + (cond + (s2-0 + (let ((s1-0 (-> (the-as process-focusable s2-0) draw shadow-ctrl settings))) + (vector-! (-> s5-1 uvec) (-> s5-1 rvec) (-> s1-0 center)) + (vector-normalize! (-> s5-1 uvec) 1.0) + (mem-copy! (the-as pointer s1-0) (the-as pointer (-> this draw shadow-ctrl settings)) 80) + (set! (-> s5-1 uvec w) (-> s1-0 shadow-dir w)) + (set! (-> s1-0 shadow-dir quad) (-> s5-1 uvec quad)) + ) + (let ((v1-39 (-> (the-as process-focusable s2-0) root))) + (set! (-> v1-39 trans quad) (-> s3-0 trans quad)) + (quaternion-copy! (-> v1-39 quat) (-> s3-0 quat)) + ) + (logand! (-> s3-0 flags) -9) + (cond + ((< 11.780972 (fabs (-> s3-0 rev))) + (when (not (logtest? (-> s3-0 flags) 1)) + (logior! (-> s3-0 flags) 1) + (lods-assign! (-> (the-as process-focusable s2-0) draw) (the-as lod-set (&-> s2-0 stack 216))) + ) + ) + (else + (when (logtest? (-> s3-0 flags) 1) + (logand! (-> s3-0 flags) -2) + (lods-assign! (-> (the-as process-focusable s2-0) draw) (the-as lod-set (&-> s2-0 stack 164))) + ) + ) + ) + ) + (else + (logior! (-> s3-0 flags) 8) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 55 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod clear-impulse-force-flag! ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle clear-impulse-force-flag!))) + (t9-0 this) + ) + (when (logtest? (vehicle-flag waiting-for-player) (-> this v-flags)) + (let ((s5-0 (-> this root))) + (when (and (logtest? (-> this v-flags) (vehicle-flag player-touching)) + (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + ) + (pull-riders! s5-0) + (cond + ((logtest? (do-push-aways s5-0) (collide-spec jak)) + (+! (-> this overlap-player-counter) 1) + (when (< (the-as uint 60) (-> this overlap-player-counter)) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 1000.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'smush)) + ) + ) + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + (else + (set! (-> this overlap-player-counter) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 77 of type wvehicle +(defmethod vehicle-method-77 ((this wvehicle)) + (local-vars (a0-19 float) (a0-23 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (if (-> this nav) + (logior! (-> this nav flags) (nav-control-flag output-sphere-hash)) + ) + (if (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) + (vehicle-method-142 this) + ) + (if (logtest? (-> this v-flags) (vehicle-flag in-air)) + (set! (-> this ground-time) (the-as uint (current-time))) + ) + (let ((v1-16 (-> this rbody))) + (cond + ((logtest? (vehicle-flag overturned) (-> this v-flags)) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag in-air))) (< 0.0 (-> v1-16 matrix uvec y))) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag overturned)))) + ) + ) + (else + (when (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (-> v1-16 matrix uvec y) 0.0) + (let ((a0-18 (-> v1-16 lin-velocity)) + (f1-2 16384.0) + ) + (.lvf vf1 (&-> a0-18 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 a0-19 vf1) + (< a0-19 (* f1-2 f1-2)) + ) + (let ((a0-22 (-> v1-16 ang-velocity)) + (f1-5 4.0) + ) + (.lvf vf1 (&-> a0-22 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 a0-23 vf1) + (< a0-23 (* f1-5 f1-5)) + ) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag overturned) (-> this v-flags)))) + (set! (-> this overturned-time) (the-as uint (current-time))) + ) + ) + ) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (+ 8192.0 (-> v1-16 position y)) (-> this water-height)) + ) + (go (method-of-object this sink)) + ) + ) + (when (logtest? (vehicle-flag player-driving net-player-driving) (-> this v-flags)) + (when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf1)) + (>= (the-as uint (- (current-time) (the-as int (-> this shoot-time)))) (-> this shoot-delay)) + ) + (set! (-> this shoot-time) (the-as uint (current-time))) + (wvehicle-method-169 this) + ) + ) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (let ((v1-39 *game-info*)) + (set! (-> v1-39 health-bar-vehicle) (-> this hit-points)) + (set! (-> v1-39 race-number-turbos) (the int (-> this turbo-supply))) + (set! (-> v1-39 vehicle-turbo-ready) (-> this turbo-ready)) + ) + (new 'stack-no-clear 'vector) + (dotimes (s5-0 (-> this info rider attach-point-count)) + (let* ((s3-0 (handle->process (-> this attached-array s5-0))) + (s4-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when (and s4-0 (focus-test? (the-as process-focusable s4-0) pilot-riding)) + (wvehicle-method-171 this (-> (the-as process-focusable s4-0) root trans) s5-0) + (wvehicle-method-172 this (-> (the-as process-focusable s4-0) root quat) s5-0) + ) + ) + ) + 0 + ) + ((method-of-type vehicle vehicle-method-77) this) + (none) + ) + ) + +;; definition for method 30 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod rigid-body-object-method-30 ((this wvehicle)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag sounds)))) + (let ((f0-0 (-> this player-dist2)) + (f1-0 245760.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds) (-> this v-flags)))) + ) + ) + (let ((v1-8 (new 'stack-no-clear 'matrix))) + (set! (-> v1-8 fvec x) (seconds-per-frame)) + (set! (-> v1-8 uvec quad) (-> this draw color-emissive quad)) + (set! (-> v1-8 uvec x) (fmax 0.0 (+ (-> v1-8 uvec x) (* -2.0 (-> v1-8 fvec x))))) + (set! (-> this draw color-emissive quad) (-> v1-8 uvec quad)) + ) + (let ((t9-0 (method-of-type vehicle rigid-body-object-method-30))) + (t9-0 this) + ) + (wvehicle-method-165 this) + (vector-reset! (-> this surface-velocity)) + (dotimes (v1-15 (-> this info physics-model wheel-count)) + (let ((a0-13 (-> this wheel v1-15))) + (set! (-> a0-13 prev-flags) (-> a0-13 flags)) + ) + ) + (none) + ) + +;; definition for method 162 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-162 ((this wvehicle) (arg0 float)) + (let ((s5-0 (-> this info))) + (let ((s4-0 (new 'stack-no-clear 'wvehicle-physics-work))) + (let ((f0-0 (-> this engine-rev))) + (set! (-> s4-0 mat uvec x) (* 9.549297 f0-0)) + ) + (set! (-> s4-0 mat uvec z) 1.0) + (if (or (= 0.0 (-> this controls throttle)) + (and (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (= (-> this gear-select) (+ (-> s5-0 transmission gear-count) -1)) + (< (-> s5-0 transmission upshift-rpm) (-> s4-0 mat uvec x)) + ) + ) + (set! (-> s4-0 mat uvec z) 0.0) + ) + (set! (-> this engine-rpm) (-> s4-0 mat uvec x)) + (set! (-> s4-0 mat uvec w) (the-as float (current-time))) + (vector-! (the-as vector (-> s4-0 mat)) (-> this rbody lin-velocity) (-> this surface-velocity)) + (when (not (logtest? (-> this v-flags) (vehicle-flag in-air))) + (let ((f0-12 (* (/ (fmax 0.0 (vector-dot (the-as vector (-> s4-0 mat)) (-> this rbody matrix fvec))) + (-> this avg-drive-wheel-radius) + ) + (-> this gear-ratio) + (-> this final-drive-ratio) + ) + ) + ) + (set! (-> s4-0 mat uvec y) (* 9.549297 f0-12)) + ) + (cond + ((logtest? (vehicle-flag reverse-gear) (-> this v-flags)) + (set! (-> this next-gear-select) 0) + 0 + ) + ((and (zero? (-> this gear-select)) (not (logtest? (vehicle-flag reverse-gear) (-> this v-flags)))) + (set! (-> this next-gear-select) 1) + ) + ((and (< (-> s5-0 transmission upshift-rpm) (-> s4-0 mat uvec y)) + (and (< (-> this gear-select) (+ (-> s5-0 transmission gear-count) -1)) + (> (-> this gear-select) 0) + (= (-> this clutch-grab) 1.0) + (< 0.5 (-> this controls throttle)) + ) + ) + (set! (-> this next-gear-select) (+ (-> this gear-select) 1)) + ) + ((and (< (-> s4-0 mat uvec y) (-> s5-0 transmission downshift-rpm)) (< 1 (-> this gear-select))) + (set! (-> this next-gear-select) (+ (-> this gear-select) -1)) + ) + ) + ) + (let ((v1-47 (-> this shift-state))) + (cond + ((zero? v1-47) + (cond + ((>= 1 (-> this gear-select)) + (cond + ((or (< (-> s4-0 mat uvec x) (-> s5-0 engine clutch-min-rpm)) (= (-> this controls throttle) 0.0)) + (seek! (-> this clutch-grab) 0.0 (* 16.0 arg0)) + ) + ((or (< (-> s5-0 engine clutch-max-rpm) (-> s4-0 mat uvec x)) + (and (< 0.0 (-> this clutch-grab)) (< (-> s5-0 engine peak-torque-rpm) (-> s4-0 mat uvec x))) + ) + (seek! (-> this clutch-grab) (-> s4-0 mat uvec z) (* 3.0 arg0)) + ) + (else + (seek! (-> this clutch-grab) 0.0 (* 3.0 arg0)) + ) + ) + ) + (else + (seek! (-> this clutch-grab) (-> s4-0 mat uvec z) (* 8.0 arg0)) + ) + ) + (when (!= (-> this next-gear-select) (-> this gear-select)) + (set! (-> this shift-state) (the-as uint 1)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ((= v1-47 1) + (seek! (-> this clutch-grab) 0.0 (* 16.0 arg0)) + (when (= (-> this clutch-grab) 0.0) + (set! (-> this shift-state) (the-as uint 2)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ((= v1-47 2) + (set! (-> this gear-select) (-> this next-gear-select)) + (when (< (the-as uint 15) (- (the-as uint (-> s4-0 mat uvec w)) (the-as uint (-> this shift-time)))) + (set! (-> this shift-state) (the-as uint 3)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ((= v1-47 3) + (seek! (-> this clutch-grab) (-> s4-0 mat uvec z) (* 8.0 arg0)) + (when (!= (-> this next-gear-select) (-> this gear-select)) + (set! (-> this shift-state) (the-as uint 1)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + (when (= (-> this clutch-grab) (-> s4-0 mat uvec z)) + (set! (-> this shift-state) (the-as uint 0)) + (set! (-> this shift-time) (the-as uint (-> s4-0 mat uvec w))) + ) + ) + ) + ) + ) + (set! (-> this gear-ratio) (-> s5-0 transmission gear-ratio-array (-> this gear-select))) + (set! (-> this final-drive-ratio) (-> s5-0 transmission final-drive-ratio)) + (set! (-> this total-gear-ratio) (* (-> this final-drive-ratio) (-> this gear-ratio))) + (set! (-> this inv-total-gear-ratio) (/ 1.0 (-> this total-gear-ratio))) + (set! (-> this engine-max-torque) (-> s5-0 engine max-torque)) + (set! (-> this clutch-inertia) (* 0.0 (-> s5-0 transmission inertia))) + ) + 0 + (none) + ) + +;; definition for method 163 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod wvehicle-method-163 ((this wvehicle)) + (let ((s5-0 (-> this info)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-0 rvec z) (-> this controls throttle)) + (set! (-> s4-0 uvec x) (vector-dot (the-as vector (-> this rbody matrix)) (-> this rbody ang-velocity))) + (set! (-> s4-0 rvec w) (-> this rbody matrix fvec y)) + (set! (-> s4-0 uvec y) (+ (-> s4-0 rvec w) (* -1.0 (-> s4-0 uvec x)))) + (if (and (< (cos 12743.111) (-> s4-0 rvec w)) + (< (-> s4-0 uvec x) -0.1) + (and (< 1.0 (-> s4-0 uvec y)) + (not (logtest? (-> this wheel 0 flags) 2)) + (not (logtest? (-> this wheel 1 flags) 2)) + (logtest? (-> this wheel 2 flags) 2) + (logtest? (-> this wheel 3 flags) 2) + ) + ) + (set! (-> s4-0 rvec z) 0.0) + ) + (set! (-> this engine-torque) (wvehicle-method-166 this (-> this engine-rpm) (-> s4-0 rvec z))) + (let ((f0-13 0.0)) + (dotimes (v1-23 (-> s5-0 physics-model wheel-count)) + (let ((a0-9 (-> this wheel v1-23 info))) + (if (logtest? (-> a0-9 flags) (vehicle-wheel-flag vwf0)) + (+! f0-13 (-> a0-9 inertia)) + ) + ) + ) + (set! (-> this drive-wheel-inertia) f0-13) + (let* ((f1-6 (-> this final-drive-ratio)) + (f1-8 (* f1-6 f1-6)) + (f2-1 (-> s5-0 transmission inertia)) + (f3-0 (-> this gear-ratio)) + ) + (set! (-> this wheel-inertia) + (+ f0-13 + (* f1-8 + (+ f2-1 (* f3-0 f3-0 (+ (-> this clutch-inertia) (* (-> s5-0 engine inertia) (-> this clutch-grab))))) + ) + ) + ) + ) + ) + (set! (-> s4-0 rvec x) (* (/ 1.0 (the float (-> s5-0 physics-model drive-wheel-count))) + (-> this engine-torque) + (-> this clutch-grab) + (-> this total-gear-ratio) + ) + ) + (set! (-> this wheel-torque) 0.0) + (set! (-> this wheel-braking-torque) 0.0) + (set! (-> this wheel-ground-torque) 0.0) + (dotimes (v1-31 (-> s5-0 physics-model wheel-count)) + (let* ((a0-14 (-> this wheel v1-31)) + (a1-5 (-> a0-14 info)) + ) + (set! (-> a0-14 torque) 0.0) + (set! (-> a0-14 braking-torque) 0.0) + (set! (-> a0-14 inertia) (-> a1-5 inertia)) + (let ((f0-26 0.0)) + (if (logtest? (-> a1-5 flags) (vehicle-wheel-flag vwf1)) + (+! f0-26 (-> this controls brake)) + ) + (if (logtest? (-> a1-5 flags) (vehicle-wheel-flag vwf2)) + (+! f0-26 (-> this controls handbrake)) + ) + (+! (-> a0-14 braking-torque) (* (fmin 1.0 f0-26) (-> a1-5 max-brake-torque) (-> s5-0 handling brake-factor))) + ) + (+! (-> this wheel-braking-torque) (-> a0-14 braking-torque)) + (when (logtest? (-> a1-5 flags) (vehicle-wheel-flag vwf0)) + (set! (-> a0-14 inertia) (-> this wheel-inertia)) + (set! (-> a0-14 torque) (-> s4-0 rvec x)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 92 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-92 ((this wvehicle) (arg0 vehicle-controls)) + (seek! (-> this controls steering) (-> arg0 steering) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 lean-z) (* 8.0 (seconds-per-frame))) + (set! (-> this controls handbrake) (-> arg0 handbrake)) + (let ((f0-11 (-> arg0 throttle)) + (f30-0 (-> arg0 brake)) + ) + (set! f30-0 + (cond + ((< 0.0 f0-11) + (logclear! (-> this v-flags) (vehicle-flag reverse-gear)) + (if (< (-> this wheel-rev) -1.5) + (set! f30-0 1.0) + ) + f30-0 + ) + ((< 0.0 f30-0) + (cond + ((logtest? (vehicle-flag reverse-gear) (-> this v-flags)) + (set! f0-11 f30-0) + 0.0 + ) + (else + (let ((v1-13 (new 'stack-no-clear 'vector))) + (vector-! (the-as vector (&-> v1-13 x)) (-> this rbody lin-velocity) (-> this surface-velocity)) + (if (< (vector-dot (the-as vector (&-> v1-13 x)) (-> this rbody matrix fvec)) 40960.0) + (logior! (-> this v-flags) (vehicle-flag reverse-gear)) + ) + ) + f30-0 + ) + ) + ) + (else + (logclear! (-> this v-flags) (vehicle-flag reverse-gear)) + f30-0 + ) + ) + ) + (case (-> this shift-state) + ((1 2) + (set! f0-11 0.0) + ) + ) + (seek! (-> this controls throttle) f0-11 (* 8.0 (seconds-per-frame))) + (+! (-> this controls brake) (* (- f30-0 (-> this controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) + ) + (set! (-> this controls prev-flags) (-> this controls flags)) + (set! (-> this controls flags) (-> arg0 flags)) + 0 + (none) + ) + +;; definition for method 88 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-88 ((this wvehicle) (arg0 vehicle-controls)) + (set! (-> arg0 steering) (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 lean-z) (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 throttle) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6))))) + (set! (-> arg0 brake) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 7))))) + (set! (-> arg0 handbrake) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 5))))) + (cond + ((-> *setting-control* user-current jump) + (if (cpad-hold? 0 l1) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf0)) + ) + ) + (else + (logclear! (-> this controls flags) (vehicle-controls-flag vcf0)) + (logclear! (-> this controls prev-flags) (vehicle-controls-flag vcf0)) + ) + ) + (if (and (cpad-hold? 0 r1) (-> *setting-control* user-current gun)) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf1)) + ) + (if (and (cpad-hold? 0 r2) (-> *setting-control* user-current turbo)) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf2)) + ) + (if (cpad-pressed? 0 r3) + (set! (-> this v-flags) (the-as vehicle-flag (logxor (shl #x8000 16) (the-as int (-> this v-flags))))) + ) + (if (not (-> *setting-control* user-current allow-look-around)) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag camera-inside-view)))) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag camera-look-mode)))) + (if (logtest? (vehicle-flag camera-inside-view) (-> this v-flags)) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag camera-look-mode) (-> this v-flags)))) + ) + (if (cpad-pressed? 0 l2) + (set! (-> this cam-view) 1) + ) + (cond + ((cpad-hold? 0 l2) + (let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 -1.0)) + (f0-8 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 -1.0)) + ) + (cond + ((< (fabs f0-8) (fabs f30-0)) + (cond + ((< f30-0 -0.5) + (set! (-> this cam-view) 3) + ) + ((< 0.5 f30-0) + (set! (-> this cam-view) 2) + ) + ) + ) + (else + (cond + ((< 0.5 f0-8) + (set! (-> this cam-view) 0) + 0 + ) + ((< f0-8 -0.5) + (set! (-> this cam-view) 1) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this cam-view) 0) + 0 + ) + ) + (if (nonzero? (-> this cam-view)) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag camera-look-mode) (-> this v-flags)))) + ) + 0 + (none) + ) + +;; definition for method 94 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-94 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle vehicle-method-94))) + (t9-0 this) + ) + (set-setting! 'string-camera-floor 'abs (+ 12288.0 (-> this water-height)) 0) + (cond + ((logtest? (vehicle-flag reverse-gear) (-> this v-flags)) + (let ((v1-6 (process->ppointer this))) + (set-setting! 'butt-handle v1-6 32768.0 (-> v1-6 0 pid)) + ) + ) + (else + (remove-setting! 'butt-handle) + ) + ) + (let ((f0-2 (vector-vector-distance-squared (-> this draw origin) (math-camera-pos))) + (f1-1 (-> this draw origin w)) + ) + (if (< f0-2 (* f1-1 f1-1)) + (logclear! (-> this draw status) (draw-control-status force-vu1)) + (logior! (-> this draw status) (draw-control-status force-vu1)) + ) + ) + 0 + (none) + ) + +;; definition for method 93 of type wvehicle +;; INFO: Used lq/sq +(defmethod vehicle-method-93 ((this wvehicle)) + (let ((t9-0 (method-of-type vehicle vehicle-method-93))) + (t9-0 this) + ) + (let ((s4-0 (-> this info)) + (s5-0 (new 'stack-no-clear 'inline-array 'matrix 2)) + ) + (set! (-> s5-0 0 trans z) (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec))) + (set! (-> s5-0 0 trans w) (vector-dot (-> this rbody lin-velocity) (the-as vector (-> this rbody matrix)))) + (set! (-> s5-0 0 trans y) (/ (* 2.0 (fabs (-> s5-0 0 trans w))) (fmax 409.6 (-> s5-0 0 trans z)))) + (set! (-> s5-0 0 trans x) + (/ (-> s4-0 handling tire-steering-speed-factor) + (fmax 409.6 (- (-> s5-0 0 trans z) (-> s4-0 handling tire-steering-speed-bias))) + ) + ) + (set! (-> s5-0 0 fvec y) (fmin 1.0 (fmax (-> s5-0 0 trans y) (-> s5-0 0 trans x)))) + (set! (-> s5-0 0 fvec x) (* (-> this controls steering) (-> s5-0 0 fvec y))) + (set! (-> s5-0 0 fvec z) (* (-> this info handling tire-steering-angle) (-> s5-0 0 fvec x))) + (set! (-> s5-0 0 fvec w) + (* (-> s5-0 0 fvec z) (+ 1.0 (* (-> this info handling ackermann-factor) (fabs (-> s5-0 0 fvec x))))) + ) + (set! (-> s5-0 1 uvec y) + (* 2.0 + (+ (-> s4-0 physics-model rear-wheel local-pos x) + (-> s4-0 physics-model rear-wheel susp-arm-length) + (-> s4-0 physics-model rear-wheel steer-arm-length) + ) + ) + ) + (set! (-> s5-0 1 uvec z) + (- (-> s4-0 physics-model front-wheel local-pos z) (-> s4-0 physics-model rear-wheel local-pos z)) + ) + (set! (-> s5-0 1 uvec w) 0.0) + (when (< 18.204445 (fabs (-> s5-0 0 fvec z))) + (cond + ((logtest? (-> s4-0 physics-model rear-wheel flags) (vehicle-wheel-flag vwf4)) + (set! (-> s5-0 1 rvec w) (/ (* 0.5 (-> s5-0 1 uvec z)) (sin (fabs (-> s5-0 0 fvec z))))) + (let ((f0-32 + (- (* (-> s5-0 1 rvec w) (cos (fabs (-> s5-0 0 fvec z)))) + (* 2.0 (+ (-> s4-0 physics-model rear-wheel local-pos x) (-> s4-0 physics-model rear-wheel susp-arm-length))) + ) + ) + (f1-22 (* 0.5 (-> s5-0 1 uvec z))) + ) + (set! (-> s5-0 1 rvec z) (sqrtf (+ (* f1-22 f1-22) (* f0-32 f0-32)))) + ) + (+! (-> s5-0 1 rvec w) (-> s4-0 physics-model rear-wheel steer-arm-length)) + (set! (-> s5-0 1 rvec z) (- (-> s5-0 1 rvec z) (-> s4-0 physics-model rear-wheel steer-arm-length))) + ) + (else + (set! (-> s5-0 1 rvec w) (/ (-> s5-0 1 uvec z) (tan (fabs (-> s5-0 0 fvec z))))) + (set! (-> s5-0 1 rvec w) + (- (-> s5-0 1 rvec w) + (+ (-> s4-0 physics-model front-wheel local-pos x) + (-> s4-0 physics-model front-wheel susp-arm-length) + (* -0.5 (-> s5-0 1 uvec y)) + ) + ) + ) + (set! (-> s5-0 1 rvec z) (- (-> s5-0 1 rvec w) (-> s5-0 1 uvec y))) + ) + ) + (set! (-> s5-0 1 uvec w) + (/ (- (-> s5-0 1 rvec w) (-> s5-0 1 rvec z)) (+ (-> s5-0 1 rvec w) (-> s5-0 1 rvec z))) + ) + ) + (set! (-> s5-0 1 rvec x) (- 1.0 (-> s5-0 1 uvec w))) + (set! (-> s5-0 1 rvec y) (+ 1.0 (-> s5-0 1 uvec w))) + (cond + ((< (-> s5-0 0 fvec z) 0.0) + (set! (-> s5-0 0 rvec x) (-> s5-0 0 fvec z)) + (set! (-> s5-0 0 rvec y) (-> s5-0 0 fvec w)) + (set! (-> s5-0 0 uvec x) (-> s5-0 1 rvec y)) + (set! (-> s5-0 0 uvec y) (-> s5-0 1 rvec x)) + ) + (else + (set! (-> s5-0 0 rvec x) (-> s5-0 0 fvec w)) + (set! (-> s5-0 0 rvec y) (-> s5-0 0 fvec z)) + (set! (-> s5-0 0 uvec x) (-> s5-0 1 rvec x)) + (set! (-> s5-0 0 uvec y) (-> s5-0 1 rvec y)) + ) + ) + (dotimes (s4-1 (-> this info physics-model wheel-count)) + (let* ((s3-0 (-> this wheel s4-1)) + (s2-0 (-> s3-0 info)) + ) + (if (logtest? (-> s2-0 flags) (vehicle-wheel-flag vwf4)) + (set! (-> s3-0 steer-angle) (* (-> (&-> s5-0 0 rvec data (logand s4-1 1)) 0) (sign (-> s2-0 local-pos z)))) + ) + (if (logtest? (-> s2-0 flags) (vehicle-wheel-flag vwf0)) + (set! (-> s3-0 drive-diff) (-> (&-> s5-0 0 rvec data (logand s4-1 1)) 4)) + ) + ) + ) + ) + (dotimes (s5-1 (-> this info physics-model wheel-count)) + (let ((s3-1 (-> this wheel s5-1))) + (set-vector! (-> s3-1 local-axis) (cos (-> s3-1 steer-angle)) 0.0 (- (sin (-> s3-1 steer-angle))) 1.0) + ) + ) + (let ((s5-2 (new 'stack-no-clear 'wvehicle-physics-work))) + (set! (-> s5-2 mat rvec x) (the-as float (current-time))) + (cond + ((logtest? (-> this info flags) 4096) + (when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)) + (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0))) + (< (the-as uint 45) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this jump-time)))) + (< (the-as uint 45) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this ground-time)))) + ) + (let ((v1-77 0)) + (dotimes (a0-15 4) + (let ((a1-5 (-> this wheel a0-15))) + (if (and (logtest? (-> a1-5 flags) 2) (< 0.0 (-> a1-5 up-force))) + (+! v1-77 1) + ) + ) + ) + (when (>= v1-77 2) + (let ((v1-79 (new 'stack-no-clear 'matrix))) + (vector-float*! (-> v1-79 rvec) (-> this rbody matrix uvec) (* 0.3 + (-> this rbody matrix uvec y) + (-> this info info mass) + (-> this info extra gravity) + (-> this info handling jump-thrust-factor) + ) + ) + (add-force! (-> this rbody) (-> v1-79 rvec)) + ) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + (set! (-> this jump-time) (the-as uint (-> s5-2 mat rvec x))) + (sound-play-by-name (-> this info sound jump-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + ) + ) + ) + ) + ((logtest? (-> this controls flags) (vehicle-controls-flag vcf0)) + (set! (-> this susp-spring-control) 0.5) + (set! (-> this jump-control) 0.0) + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.05)) + ) + (if (and (not (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0))) + (logtest? (-> this v-flags) (vehicle-flag on-ground)) + ) + (sound-play "toad-prehop") + ) + ) + (else + (set! (-> this susp-spring-control) 1.0) + (when (and (logtest? (-> this controls prev-flags) (vehicle-controls-flag vcf0)) + (< (the-as uint 300) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this jump-time)))) + (< (the-as uint 45) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this ground-time)))) + ) + 0 + (when (>= (-> this rbody matrix uvec y) 0.707) + (set! (-> this jump-time) (the-as uint (-> s5-2 mat rvec x))) + (set! (-> this jump-control) (-> this info handling jump-thrust-factor)) + (sound-play-by-name (-> this info sound jump-sound) (new-sound-id) 1024 0 0 (sound-group) #t) + ) + ) + (if (< (the-as uint 60) (- (the-as uint (-> s5-2 mat rvec x)) (the-as uint (-> this jump-time)))) + (set! (-> this jump-control) 0.0) + ) + ) + ) + ) + (if (not (logtest? (vehicle-flag turbo-boost) (-> this v-flags))) + (set! (-> this turbo-ready) (fmin 1.0 (+ (-> this turbo-ready) (* 0.5 (seconds-per-frame))))) + ) + (if (logtest? (-> this controls flags) (vehicle-controls-flag vcf2)) + (vehicle-method-64 this) + ) + (none) + ) + +;; definition for method 33 of type wvehicle +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod alloc-rbody-control! ((this wvehicle) (arg0 rigid-body-object-constants)) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (vector-y-quaternion! (the-as vector (-> s4-0 0)) (-> this root quat)) + (vector+float*! + (-> this root trans) + (-> this root trans) + (the-as vector (-> s4-0 0)) + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-height) + ) + (quaternion-axis-angle! + (-> s4-0 1) + 1.0 + 0.0 + 0.0 + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-rot-x) + ) + (quaternion*! (-> this root quat) (-> this root quat) (-> s4-0 1)) + ) + (let ((t9-3 (method-of-type vehicle alloc-rbody-control!))) + (t9-3 this (the-as rigid-body-vehicle-constants arg0)) + ) + (iterate-prims (-> this root) (lambda ((arg0 collide-shape-prim)) + (logior! (-> arg0 prim-core collide-as) (collide-spec camera-blocker)) + (none) + ) + ) + (set! (-> this control-hook) #f) + (set! (-> this ai-min-speed) 61440.0) + (set! (-> this ai-max-speed) 102400.0) + (set! (-> this minimap) #f) + (set! (-> this clutch-grab) 0.0) + (set! (-> this gear-select) 1) + (set! (-> this shoot-delay) (the-as uint 60)) + (wvehicle-method-167 this) + (set! (-> this info physics-model wheel-count) 4) + (set! (-> this susp-spring-control) 1.0) + (set! (-> this jump-control) 0.0) + (set! (-> this turbo-ready) 1.0) + (set! (-> this net) #f) + (let ((v1-19 (new 'stack-no-clear 'wvehicle-stack-type4))) + (set! (-> v1-19 float2) (vector-dot (-> this root transv) (-> this rbody matrix fvec))) + (set! (-> v1-19 byte0) 0) + (set! (-> v1-19 float0) 0.0) + (dotimes (a0-14 (-> this info physics-model wheel-count)) + (let ((a1-11 (-> this wheel a0-14))) + (let ((a2-2 (-> a1-11 info))) + (set! (-> a1-11 x-scale) (if (= (logand a0-14 1) 1) + -1.0 + 1.0 + ) + ) + (set! (-> a1-11 surface) #f) + (set! (-> v1-19 float1) (* (-> a2-2 radius) (-> a2-2 scale))) + (set! (-> a1-11 rev) (/ (-> v1-19 float2) (-> v1-19 float1))) + (when (logtest? (-> a2-2 flags) (vehicle-wheel-flag vwf0)) + (+! (-> v1-19 byte0) 1) + (+! (-> v1-19 float0) (-> v1-19 float1)) + (set! (-> a1-11 drive-diff) 1.0) + ) + (set! (-> a1-11 handle) (the-as handle #f)) + (set! (-> a1-11 tread-tracker) (the-as handle #f)) + (set! (-> a1-11 inertia) (-> a2-2 inertia)) + ) + (set! (-> a1-11 probe-local-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) + (set! (-> a1-11 local-axis quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + ) + ) + (set! (-> (the-as rigid-body-vehicle-constants arg0) physics-model drive-wheel-count) (-> v1-19 byte0)) + (set! (-> this avg-drive-wheel-radius) (/ (-> v1-19 float0) (the float (-> v1-19 byte0)))) + (set! (-> this wheel-rev) (/ (-> v1-19 float2) (-> this avg-drive-wheel-radius))) + (when (< 0.0 (-> v1-19 float2)) + (set! (-> this gear-select) (+ (-> (the-as rigid-body-vehicle-constants arg0) transmission gear-count) -1)) + (let ((f0-25 (-> (the-as rigid-body-vehicle-constants arg0) engine idle-rpm))) + (set! (-> this engine-rev) (* 0.10471976 f0-25)) + ) + ) + ) + (dotimes (v1-26 (-> this info rider attach-point-count)) + (set! (-> this attached-array v1-26) (the-as handle #f)) + ) + (vector-reset! (-> this surface-velocity)) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set! (-> this draw lod-set lod 2 dist) 1236992.0) + (set! (-> this gun-aim-yaw) 0.0) + (set! (-> this gun-aim-yaw-vel) 0.0) + (set! (-> this gun-yaw) 0.0) + (set! (-> this gun-pitch) 0.0) + (set! (-> this shoot-delay) (the-as uint 30)) + (set! (-> this lock-turret) #f) + (none) + ) + +;; definition for method 134 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-134 ((this wvehicle)) + (if (focus-test? this grabbed) + (go (method-of-object this race-waiting)) + (go (method-of-object this player-control)) + ) + 0 + (none) + ) + +;; definition for method 48 of type wvehicle +(defmethod on-impact ((this wvehicle) (arg0 rigid-body-impact)) + (mem-copy! (the-as pointer (-> this impact)) (the-as pointer arg0) 64) + ((method-of-type vehicle on-impact) this arg0) + (none) + ) + +;; definition for method 49 of type wvehicle +;; INFO: Used lq/sq +;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 59. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod rbody-event-handler ((this wvehicle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('test-ready) + (and (and (-> this next-state) (= (-> this next-state name) 'race-waiting)) + (logtest? (-> this v-flags) (vehicle-flag riding)) + ) + ) + (('repair) + (let ((f0-0 (the-as float (-> arg3 param 0))) + (f1-0 (-> this hit-points)) + ) + (if (< 0.0 f1-0) + (set! (-> this hit-points) (fmin 1.0 (+ f1-0 f0-0))) + ) + ) + ) + (('touched) + (when (zero? (-> (the-as process-drawable arg0) rbody)) + (let* ((s5-0 arg0) + (v1-10 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when (and v1-10 + (logtest? (-> v1-10 mask) (process-mask target)) + (logtest? (vehicle-flag waiting-for-player) (-> this v-flags)) + (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + ) + (logior! (-> this v-flags) (vehicle-flag player-touching)) + (set! v0-0 (current-time)) + (set! (-> this player-touch-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + (('begin-race) + (-> arg3 param 0) + (wvehicle-method-197 this) + (logclear! (-> this focus-status) (focus-status grabbed)) + (when (and (-> this next-state) (= (-> this next-state name) 'race-waiting)) + (cond + ((logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag player-grabbed)) + (go (method-of-object this player-control)) + ) + (else + (go (method-of-object this race-racing)) + ) + ) + ) + ) + (('turbo-pickup) + (when (< (-> this turbo-supply) 3.0) + (sound-play "turbo-pickup") + (if (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (sound-play "turbo-pickup") + ) + (+! (-> this turbo-supply) 1.0) + (set! (-> this turbo-supply) (fmin 3.0 (-> this turbo-supply))) + (let ((v1-47 (-> this draw color-emissive))) + (set! (-> v1-47 x) 2.0) + ) + ) + #t + ) + (('race-decision-point) + (when (logtest? (vehicle-flag ai-driving) (-> this v-flags)) + (let* ((v1-51 (the-as race-decision-point (-> arg3 param 0))) + (a0-25 (-> v1-51 decision-type)) + ) + (cond + ((zero? a0-25) + (cond + ((and (nonzero? (-> v1-51 shortcuts)) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) + (< 0.1 (- (+ (-> this race state target-pos) (-> this race racer-state target-pos-offset)) + (-> this race racer-state pos) + ) + ) + ) + (wvehicle-method-180 this (-> v1-51 shortcuts)) + (set! (-> this shortcut-time) (the-as uint (current-time))) + (set! (-> this shortcut-speed-factor) 1.0) + ) + (else + (wvehicle-method-180 this (-> v1-51 safe-paths)) + (set! (-> this shortcut-speed-factor) 0.0) + ) + ) + ) + ((= a0-25 1) + (when (and (>= (-> this turbo-supply) 1.0) + (< (-> this path-deviation) 1.0) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) + ) + (apply-momentum! this) + (vehicle-method-64 this) + ) + ) + ) + ) + ) + ) + (('hide) + (logior! (-> this draw status) (draw-control-status no-draw)) + (dotimes (s5-3 (-> this info physics-model wheel-count)) + (send-event (handle->process (-> this wheel s5-3 handle)) 'hide) + ) + (let ((gp-1 (-> this child))) + (while gp-1 + (send-event (ppointer->process gp-1) 'hide) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + #f + ) + (('unhide) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (dotimes (s5-4 (-> this info physics-model wheel-count)) + (send-event (handle->process (-> this wheel s5-4 handle)) 'unhide) + ) + (let ((gp-2 (-> this child))) + (while gp-2 + (send-event (ppointer->process gp-2) 'unhide) + (set! gp-2 (-> gp-2 0 brother)) + ) + ) + #f + ) + (('race-pass) + (send-event (the-as process-tree (vehicle-method-68 this)) 'race-pass) + ) + (('race-got-passed) + (send-event (the-as process-tree (vehicle-method-68 this)) 'race-got-passed) + ) + (('race-finished) + (-> arg3 param 0) + (cond + ((logtest? (vehicle-flag player-driving) (-> this v-flags)) + (set! (-> this damage-factor) 0.0) + (set! v0-0 (method-of-object this wvehicle-method-177)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-0)) + v0-0 + ) + (else + (go (method-of-object this race-finished)) + ) + ) + ) + (('race-deactivate) + (set! (-> this damage-factor) (-> this info damage inv-hit-points)) + (set! (-> this race path) #f) + (cond + ((logtest? (vehicle-flag player-driving) (-> this v-flags)) + (logclear! (-> this v-flags) (vehicle-flag player-grabbed)) + (set! v0-0 (method-of-object this control-hook-player)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-0)) + v0-0 + ) + (else + (go (method-of-object this die)) + ) + ) + ) + (('set-control-hook-race-ai) + (set! v0-0 (method-of-object this wvehicle-method-177)) + (set! (-> this control-hook) (the-as (function vehicle vehicle-controls) v0-0)) + v0-0 + ) + (('ai-set-target-speed) + (let ((f0-18 (the-as float (-> arg3 param 0)))) + (set! (-> this ai-min-speed) f0-18) + (set! (-> this ai-max-speed) f0-18) + f0-18 + ) + ) + (('ai-set-target-process) + (let* ((s5-7 (-> arg3 param 0)) + (a0-77 (if (type? s5-7 process-drawable) + s5-7 + ) + ) + ) + (cond + ((the-as uint a0-77) + (set! v0-0 (process->handle (the-as uint a0-77))) + (set! (-> this target-status handle) (the-as handle v0-0)) + v0-0 + ) + (else + (set! (-> this target-status handle) (the-as handle #f)) + #f + ) + ) + ) + ) + (('ai-set-target-position) + (let ((v1-138 (the-as object (-> arg3 param 0)))) + (set! (-> this ai-state) (the-as uint 2)) + (set! v0-0 (-> this ai-target-point)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-138) quad)) + ) + v0-0 + ) + (('ai-set-mode) + (set! v0-0 (-> arg3 param 0)) + (set! (-> this ai-state) (the-as uint v0-0)) + v0-0 + ) + (('ai-drop-off) + (let ((v1-140 (the-as object (-> arg3 param 0)))) + (set! (-> this other-pos quad) (-> (the-as wvehicle-ai-drop-off-params v1-140) dest quad)) + (set! (-> this other-proc) (process->handle (-> (the-as wvehicle-ai-drop-off-params v1-140) proc))) + ) + (set! v0-0 (logior (vehicle-flag vf53) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + v0-0 + ) + (('ai-ignore-nav-mesh) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (vehicle-flag vf52) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> this v-flags) (vehicle-flag vf52))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + ) + ) + v0-0 + ) + (('ai-set-inaccuracy-factor) + (let* ((a0-95 this) + (t9-23 (method-of-object a0-95 wvehicle-method-202)) + ) + (-> arg3 param 0) + (t9-23 a0-95) + ) + ) + (('ai-set-attack-delay-factor) + (let* ((a0-97 this) + (t9-24 (method-of-object a0-97 wvehicle-method-201)) + ) + (-> arg3 param 0) + (t9-24 a0-97) + ) + ) + (('go-player-control) + (go (method-of-object this player-control)) + ) + (('set-rigid-body-info) + (set! (-> this info) (the-as rigid-body-vehicle-constants (-> arg3 param 0))) + (rigid-body-object-method-37 this) + ) + (('no-pickup) + (set! v0-0 (logior (vehicle-flag vf55) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + v0-0 + ) + (else + ((method-of-type vehicle rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 119 of type wvehicle +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-119 ((this wvehicle)) + (cond + ((and (logtest? (-> this v-flags) (vehicle-flag player-grabbed)) (-> this race path)) + (wvehicle-method-185 this) + ) + (else + (let ((t9-1 (method-of-type vehicle vehicle-method-119))) + (t9-1 this) + ) + ) + ) + (if (logtest? (game-secrets unlimited-turbos) (-> *game-info* secrets)) + (set! (-> this turbo-supply) 3.0) + ) + 0 + (none) + ) + +;; definition for method 118 of type wvehicle +(defmethod vehicle-method-118 ((this wvehicle)) + (when (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) + (if (handle->process (-> this wheel 0 tread-tracker)) + (wvehicle-method-196 this) + ) + ) + (cond + ((have-vehicle-v-type? (the-as int (-> this info vehicle-type))) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 133) (the-as int #f) (the-as vector #t) 0)) + ) + ) + (else + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + ) + ) + ((method-of-type vehicle vehicle-method-118) this) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/forest/forest-obs-h_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-obs-h_REF.gc new file mode 100644 index 0000000000..d4a963ff0b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/forest/forest-obs-h_REF.gc @@ -0,0 +1,68 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type shaker +(deftype shaker (structure) + ((axis vector :inline) + (start-time time-frame) + (decay-time float) + (amplitude float) + (freq float) + (y-decay-time float) + (y-amplitude float) + (y-freq float) + (shake float) + (y-shake float) + ) + (:methods + (shaker-method-9 (_type_) none) + ) + ) + +;; definition for method 3 of type shaker +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this shaker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'shaker) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tdecay-time: ~f~%" (-> this decay-time)) + (format #t "~1Tamplitude: ~f~%" (-> this amplitude)) + (format #t "~1Tfreq: ~f~%" (-> this freq)) + (format #t "~1Ty-decay-time: ~f~%" (-> this y-decay-time)) + (format #t "~1Ty-amplitude: ~f~%" (-> this y-amplitude)) + (format #t "~1Ty-freq: ~f~%" (-> this y-freq)) + (format #t "~1Tshake: ~f~%" (-> this shake)) + (format #t "~1Ty-shake: ~f~%" (-> this y-shake)) + (label cfg-4) + this + ) + +;; definition for method 9 of type shaker +;; INFO: this function exists in multiple non-identical object files +;; WARN: Return type mismatch float vs none. +(defmethod shaker-method-9 ((this shaker)) + (let ((s5-0 (- (current-time) (-> this start-time)))) + (set! (-> this shake) (* (-> this amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this freq)))) + ) + ) + (set! (-> this y-shake) (* (-> this y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this y-freq)))) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc new file mode 100644 index 0000000000..bf82e546bf --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc @@ -0,0 +1,3125 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-gekko gekko gekko-lod0-jg -1 + ((gekko-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow gekko-shadow-mg + :origin-joint-index 16 + ) + +;; definition of type gekko-foot-info +(deftype gekko-foot-info (structure) + ((ground-pos vector :inline) + (ground-normal vector :inline) + (foot-transform transformq :inline) + (leg-ik joint-mod-ik) + ) + ) + +;; definition for method 3 of type gekko-foot-info +(defmethod inspect ((this gekko-foot-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gekko-foot-info) + (format #t "~1Tground-pos: #~%" (-> this ground-pos)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Tfoot-transform: #~%" (-> this foot-transform)) + (format #t "~1Tleg-ik: ~A~%" (-> this leg-ik)) + (label cfg-4) + this + ) + +;; definition of type gekko-ik-setup +(deftype gekko-ik-setup (structure) + ((elbow-index int32) + (hand-index int32) + (effector-index int32) + (hand-dist float) + ) + ) + +;; definition for method 3 of type gekko-ik-setup +(defmethod inspect ((this gekko-ik-setup)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gekko-ik-setup) + (format #t "~1Telbow-index: ~D~%" (-> this elbow-index)) + (format #t "~1Thand-index: ~D~%" (-> this hand-index)) + (format #t "~1Teffector-index: ~D~%" (-> this effector-index)) + (format #t "~1Thand-dist: ~f~%" (-> this hand-dist)) + (label cfg-4) + this + ) + +;; definition for symbol *gekko-ik-setup*, type (inline-array gekko-ik-setup) +(define *gekko-ik-setup* + (new 'static 'inline-array gekko-ik-setup 4 + (new 'static 'gekko-ik-setup :elbow-index 9 :hand-index 10 :effector-index 10 :hand-dist 1224.704) + (new 'static 'gekko-ik-setup :elbow-index 13 :hand-index 14 :effector-index 14 :hand-dist 1224.704) + (new 'static 'gekko-ik-setup :elbow-index 19 :hand-index 20 :effector-index 20 :hand-dist 1638.4) + (new 'static 'gekko-ik-setup :elbow-index 29 :hand-index 30 :effector-index 30 :hand-dist 1638.4) + ) + ) + +;; definition for symbol *gekko-foot-offset*, type (array gekko-foot-info) +(define *gekko-foot-offset* + (the-as (array gekko-foot-info) (new 'static 'boxed-array :type vector + (new 'static 'vector :x 2281.472 :z 2424.832 :w 1.0) + (new 'static 'vector :x -2281.472 :z 2424.832 :w 1.0) + (new 'static 'vector :x 2301.952 :z -2424.832 :w 1.0) + (new 'static 'vector :x -2301.952 :z -2424.832 :w 1.0) + ) + ) + ) + +;; definition of type gekko-shadow-spot +(deftype gekko-shadow-spot (structure) + ((position vector :inline) + (normal vector :inline) + (valid? symbol) + (pat uint32) + ) + ) + +;; definition for method 3 of type gekko-shadow-spot +(defmethod inspect ((this gekko-shadow-spot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gekko-shadow-spot) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Tvalid?: ~A~%" (-> this valid?)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (label cfg-4) + this + ) + +;; definition of type gekko +(deftype gekko (nav-enemy) + ((shadow-spot gekko-shadow-spot :inline) + (foot gekko-foot-info 4 :inline) + (rot-matrix matrix :inline) + (gspot-normal vector :inline) + (tilt-quat quaternion :inline) + (dest-to-me-dir vector :inline) + (turn-face-point vector :inline) + (flags gekko-flag) + (attack-time time-frame) + (last-turn-time time-frame) + (fade float) + (rot-mult float) + (move-speed float) + (move-decel float) + (turn-next-state (state gekko)) + (path-wall path-control) + (scared-timer time-frame) + (scale float) + (probe-len float) + ) + (:state-methods + active-wall + hostile-wall + turn-wall + attack-wall + knocked-wall + jump-off-wall + jump-off-wall-falling + jump-off-wall-recover + pre-attack + attack + turn + turn-quick + ) + (:methods + (gekko-method-202 (_type_) none) + (gekko-method-203 (_type_) none) + (gekko-method-204 (_type_) none) + (gekko-method-205 (_type_) none) + (gekko-method-206 (_type_) none) + (gekko-method-207 (_type_) none) + (gekko-method-208 (_type_) none) + ) + ) + +;; definition for method 3 of type gekko +(defmethod inspect ((this gekko)) + (when (not this) + (set! this this) + (goto cfg-14) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tshadow-spot: #~%" (-> this shadow-spot)) + (format #t "~2Tfoot[4] @ #x~X~%" (-> this foot)) + (format #t "~2Trot-matrix: #~%" (-> this rot-matrix)) + (format #t "~2Tgspot-normal: #~%" (-> this gspot-normal)) + (format #t "~2Ttilt-quat: #~%" (-> this tilt-quat)) + (format #t "~2Tdest-to-me-dir: #~%" (-> this dest-to-me-dir)) + (format #t "~2Tturn-face-point: #~%" (-> this turn-face-point)) + (format #t "~2Tflags: #x~X : (gekko-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (gekko-flag update-tilt)) (gekko-flag update-tilt)) + (format #t "update-tilt ") + ) + (if (= (logand s5-0 (gekko-flag follow-terrain)) (gekko-flag follow-terrain)) + (format #t "follow-terrain ") + ) + (if (= (logand s5-0 (gekko-flag on-wall?)) (gekko-flag on-wall?)) + (format #t "on-wall? ") + ) + (if (= (logand s5-0 (gekko-flag update-foot-position?)) (gekko-flag update-foot-position?)) + (format #t "update-foot-position? ") + ) + (if (= (logand s5-0 (gekko-flag falling-off-wall?)) (gekko-flag falling-off-wall?)) + (format #t "falling-off-wall? ") + ) + ) + (format #t ")~%") + (format #t "~2Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~2Tlast-turn-time: ~D~%" (-> this last-turn-time)) + (format #t "~2Tfade: ~f~%" (-> this fade)) + (format #t "~2Trot-mult: ~f~%" (-> this rot-mult)) + (format #t "~2Tmove-speed: ~f~%" (-> this move-speed)) + (format #t "~2Tmove-decel: ~f~%" (-> this move-decel)) + (format #t "~2Tturn-next-state: ~A~%" (-> this turn-next-state)) + (format #t "~2Tpath-wall: ~A~%" (-> this path-wall)) + (format #t "~2Tscared-timer: ~D~%" (-> this scared-timer)) + (format #t "~2Tscale: ~f~%" (-> this scale)) + (format #t "~2Tprobe-len: ~f~%" (-> this probe-len)) + (label cfg-14) + this + ) + +;; definition for symbol *fact-info-gekko-defaults*, type fact-info-enemy-defaults +(define *fact-info-gekko-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 140) :pickup-type 9) + ) + +;; definition for symbol *gekko-nav-enemy-info*, type nav-enemy-info +(define *gekko-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 5 + :param1 5 + :param2 '((new 'static 'bfloat :data 0.5) (new 'static 'bfloat :data 0.5)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 4 + :hostile-anim 14 + :hit-anim 3 + :knocked-anim 23 + :knocked-land-anim 18 + :die-anim 32 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim 33 + :jump-in-air-anim 34 + :jump-land-anim 35 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 16 + :sound-hit (static-sound-name "gekko-get-hit") + :sound-die (static-sound-name "gekko-die") + :notice-distance (meters 80) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 7) + :attack-shove-up (meters 4) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 0.5 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp -1.0 + :knocked-soft-vxz-lo 113049.6 + :knocked-soft-vxz-hi 149094.4 + :knocked-soft-vy-lo 122880.0 + :knocked-soft-vy-hi 163840.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x -0.9169 :y -0.314 :z 0.2441 :w 2358.841) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd jak obstacle player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z -0.0145 :w 18690.63) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0109 :z 0.0086 :w 14092.443) + :axial-slop 426.98523 + :max-angle 1820.4445 + :coll-rad 2079.5393 + :hit-sound (static-sound-name "gekko-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0177 :w 29970.05) + :geo-tform (new 'static 'vector :x 0.9998 :z 0.0088 :w 32808.543) + :axial-slop 426.98523 + :max-angle 1456.3556 + :coll-rad 1224.2944 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0185 :w 31347.709) + :geo-tform (new 'static 'vector :x 0.9998 :y -0.0016 :z 0.0092 :w 28653.906) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1338.9824 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0186 :w 6233.548) + :geo-tform (new 'static 'vector :x -0.9994 :y -0.0202 :z -0.0091 :w 8968.311) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1183.3344 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2363 :y -0.0265 :z -0.971 :w 16298.385) + :geo-tform (new 'static 'vector :x 0.7523 :y 0.6222 :z -0.2161 :w 22609.957) + :axial-slop 426.98523 + :max-angle 3640.889 + :coll-rad 1150.5664 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9842 :y 0.081 :z 0.1544 :w 6309.4785) + :geo-tform (new 'static 'vector :x -0.6984 :y 0.5454 :z 0.4627 :w 18388.328) + :axial-slop 426.98523 + :max-angle 4619.2505 + :coll-rad 1282.4576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3794 :y -0.0126 :z 0.925 :w 14670.799) + :geo-tform (new 'static 'vector :x -0.2831 :y 0.9394 :z 0.1922 :w 13051.641) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1127.2192 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3743 :y -0.0189 :z 0.9269 :w 4210.943) + :geo-tform (new 'static 'vector :x 0.8507 :y -0.4889 :z -0.1902 :w 19701.232) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 1333.248 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.3447 :y 0.1703 :z 0.9229 :w 16305.849) + :geo-tform (new 'static 'vector :x 0.7264 :y -0.5892 :z 0.3528 :w 20835.006) + :axial-slop 426.98523 + :max-angle 3640.889 + :coll-rad 1124.352 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9835 :y -0.1776 :z 0.0185 :w 3334.3625) + :geo-tform (new 'static 'vector :x -0.6955 :y -0.5474 :z -0.4643 :w 18426.193) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1088.3073 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3701 :y 0.0165 :z -0.9283 :w 14670.671) + :geo-tform (new 'static 'vector :x -0.2795 :y -0.9402 :z -0.1922 :w 13170.697) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1053.4912 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3607 :y 0.023 :z -0.932 :w 4213.7646) + :geo-tform (new 'static 'vector :x -0.8814 :y -0.119 :z 0.456 :w 16534.57) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 1327.104 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.9993 :y -0.005 :z -0.0354 :w 5877.141) + :geo-tform (new 'static 'vector :x -0.9998 :y -0.0126 :z -0.0087 :w 12748.154) + :axial-slop 426.98523 + :max-angle 1367.4814 + :coll-rad 1144.832 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9994 :z -0.0227 :w 17.585493) + :geo-tform (new 'static 'vector :x -0.9998 :y -0.0126 :z -0.0087 :w 12762.499) + :axial-slop 426.98523 + :max-angle 1537.784 + :coll-rad 1164.0833 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.514 :y 0.0096 :z -0.8572 :w 14720.624) + :geo-tform (new 'static 'vector :x -0.9145 :y -0.3788 :z 0.1386 :w 11441.111) + :axial-slop 426.98523 + :max-angle 2730.6667 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9968 :y 0.0073 :z 0.075 :w 8037.281) + :geo-tform (new 'static 'vector :x 0.7911 :y -0.1717 :z 0.5867 :w 14446.993) + :axial-slop 426.98523 + :max-angle 3665.7927 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7222 :y 0.0125 :z 0.6908 :w 14193.806) + :geo-tform (new 'static 'vector :x -0.9861 :y -0.1063 :z -0.1272 :w 19499.127) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9636 :y 0.0018 :z -0.2657 :w 19342.15) + :geo-tform (new 'static 'vector :x 0.3582 :y -0.8755 :z -0.3234 :w 7445.891) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9163 :y -0.0016 :z -0.3995 :w 3475.2285) + :geo-tform (new 'static 'vector :x -0.8003 :y -0.5296 :z -0.2795 :w 11328.59) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1264.8448 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.9998 :y 0.0016 :z 0.0099 :w 1182.9977) + :geo-tform (new 'static 'vector :x 0.9958 :y -0.0876 :z 0.0087 :w 2150.4365) + :axial-slop 426.98523 + :max-angle 1456.3556 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :y -0.0055 :z 0.0172 :w 2143.81) + :geo-tform (new 'static 'vector :x -0.0003 :y -1.0 :w 177.23846) + :axial-slop 426.98523 + :max-angle 2002.4889 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4534 :y -0.8907 :z -0.0071 :w 14.345102) + :geo-tform (new 'static 'vector :y -1.0 :w 167.15321) + :axial-slop 426.98523 + :max-angle 2730.6667 + :coll-rad 638.5664 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0309) + :geo-tform (new 'static 'vector :x -0.0002 :y -1.0 :w 167.15321) + :axial-slop 426.98523 + :max-angle 3458.8445 + :coll-rad 526.7456 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9993 :z 0.0309) + :geo-tform (new 'static 'vector :x -0.0003 :y -0.9998 :w 167.15321) + :axial-slop 426.98523 + :max-angle 4187.0225 + :coll-rad 355.5328 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.5197 :y 0.0089 :z 0.8538 :w 14715.818) + :geo-tform (new 'static 'vector :x -0.921 :y 0.3571 :z -0.1527 :w 11310.513) + :axial-slop 426.98523 + :max-angle 3640.889 + :coll-rad 935.936 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9975 :y 0.0082 :z -0.0651 :w 8052.2993) + :geo-tform (new 'static 'vector :x 0.8026 :y 0.1536 :z -0.5763 :w 14394.364) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7269 :y 0.0057 :z -0.6861 :w 14192.44) + :geo-tform (new 'static 'vector :x -0.9887 :y 0.0952 :z 0.1121 :w 19467.068) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9719 :y -0.0073 :z 0.2335 :w 19440.309) + :geo-tform (new 'static 'vector :x 0.3657 :y 0.866 :z 0.3398 :w 7188.9897) + :axial-slop 426.98523 + :max-angle 4029.8452 + :coll-rad 924.0576 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9024 :y 0.0007 :z 0.4302 :w 3461.2112) + :geo-tform (new 'static 'vector :x -0.8144 :y 0.5124 :z 0.2716 :w 11174.926) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 1215.2832 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint 10 + :pre-tform (new 'static 'vector :x -0.6151 :y -0.6097 :z -0.4993 :w 12937.025) + :geo-tform (new 'static 'vector :x -0.0868 :y -0.921 :z -0.3792 :w 8346.01) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 650.4448 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.921 :y 0.1397 :z -0.3634 :w 2869.6938) + :geo-tform (new 'static 'vector :x -0.319 :y -0.9406 :z -0.1124 :w 8966.345) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 489.8816 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.7723 :y 0.6006 :z -0.2057 :w 11225.279) + :geo-tform (new 'static 'vector :x 0.0707 :y 0.9922 :z -0.0988 :w 20417.65) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 575.0784 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3531 :y -0.0993 :z -0.9298 :w 2126.9346) + :geo-tform (new 'static 'vector :y 0.9937 :z 0.1082 :w 35917.625) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 545.9968 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 10 + :pre-tform (new 'static 'vector :x 0.9417 :y 0.2245 :z 0.2487 :w 15554.733) + :geo-tform (new 'static 'vector :x 0.07 :y 0.9965 :z 0.0389 :w 36169.848) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 541.4912 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3319 :y -0.0751 :z -0.9401 :w 1665.7977) + :geo-tform (new 'static 'vector :x 0.3686 :y 0.9253 :z -0.0855 :w 33224.6) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 489.0624 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.9477 :y -0.2105 :z -0.239 :w 14735.951) + :geo-tform (new 'static 'vector :x 0.477 :y 0.0276 :z 0.8779 :w 34298.176) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 596.7872 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1272 :y 0.0794 :z 0.9883 :w 1645.9913) + :geo-tform (new 'static 'vector :x 0.5577 :y 0.3476 :z 0.7531 :w 36094.316) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 496.4352 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.7784 :y -0.6029 :z 0.1728 :w 8814.884) + :geo-tform (new 'static 'vector :x -0.3 :y 0.025 :z 0.9532 :w 34750.32) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 620.9536 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5386 :y 0.0881 :z 0.8378 :w 2062.2178) + :geo-tform (new 'static 'vector :x -0.2608 :y -0.1063 :z 0.9592 :w 33021.97) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 600.064 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint 14 + :pre-tform (new 'static 'vector :x -0.6597 :y 0.605 :z 0.4453 :w 10974.531) + :geo-tform (new 'static 'vector :x 0.8782 :y 0.1516 :z -0.4526 :w 32356.781) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 614.4 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 43 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9724 :y -0.131 :z 0.1908 :w 2849.3416) + :geo-tform (new 'static 'vector :x 0.8708 :y 0.0597 :z -0.4875 :w 30132.617) + :axial-slop 426.98523 + :max-angle 4576.015 + :coll-rad 458.752 + :hit-sound (static-sound-name "gekko-ragdoll") + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 14 + :taunt-anim -1 + :run-travel-speed (meters 14) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 60) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 30) + :maximum-rotation-rate (degrees 450) + :notice-nav-radius (meters 40) + :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! (-> *gekko-nav-enemy-info* fact-defaults) *fact-info-gekko-defaults*) + +;; definition for method 120 of type gekko +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this gekko)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle 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 4915.2 0.0 12288.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-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.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 enemy)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3276.8) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core action) (collide-action solid deadly)) + (set! (-> v1-19 transform-index) 6) + (set-vector! (-> v1-19 local-sphere) 0.0 -819.2 1638.4 1638.4) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 16) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 1638.4) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 24) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 1228.8) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core action) (collide-action solid deadly)) + (set! (-> v1-25 transform-index) 10) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 1228.8) + ) + (set-vector! + (-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere) + 0.0 + 4096.0 + 0.0 + 8192.0 + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-29 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-29 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-29 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (gekko) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy idle) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (logclear! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active-wall (gekko) + :virtual #t + :enter (behavior () + ((-> (method-of-type nav-enemy active) enter)) + (let ((v1-3 (-> self draw shadow-ctrl))) + (logclear! (-> v1-3 settings flags) (shadow-flags disable-draw)) + ) + 0 + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + ) + :trans (-> (method-of-type nav-enemy active) trans) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! gekko-wall-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate notice (gekko) + :virtual #t + :enter (behavior () + (set! (-> self attack-time) (+ (current-time) (seconds -3.5))) + (set! (-> self last-turn-time) (+ (current-time) (seconds -100))) + (if (logtest? (-> self flags) (gekko-flag on-wall?)) + (gekko-method-206 self) + (go-virtual hostile) + ) + ) + ) + +;; definition for function hostile-wall-trans +;; WARN: Return type mismatch object vs none. +(defbehavior hostile-wall-trans gekko () + (local-vars (gp-2 vector) (f0-0 float)) + (if (rnd-chance? self 0.75) + (sound-play "gekko-slither") + ) + (cond + ((and (time-elapsed? (-> self attack-time) (seconds 3)) + (and (get-focus! self) + (begin + (set! gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + (set! f0-0 (vector-length gp-2)) + (< f0-0 163840.0) + ) + (or (< 20480.0 f0-0) (not (logtest? (-> self flags) (gekko-flag on-wall?)))) + (< (vector-dot + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) gp-2 1.0) + ) + (cos 30.0) + ) + ) + ) + (gekko-method-207 self) + ) + ((or (< (vector-vector-planar-distance (-> self root trans) (-> self move-dest) (-> self rot-matrix uvec)) 8192.0) + (or (< (vector-dot + (-> self dest-to-me-dir) + (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self move-dest)) + ) + 0.0 + ) + (time-elapsed? (-> self state-time) (seconds 5)) + ) + ) + (gekko-method-206 self) + ) + ((and (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 61440.0) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (and (closest-point-on-mesh (-> self nav) gp-3 (-> self focus-pos) (the-as nav-poly #f)) + (< (vector-vector-xz-distance gp-3 (-> self focus-pos)) 409.6) + ) + ) + ) + (go-virtual jump-off-wall) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate hostile-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (set-time! (-> self state-time)) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + (set-look-at-mode! self 2) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.017)) + (let ((f30-0 (/ 1.0 (-> self scale)))) + (until #f + (hostile-wall-trans) + (ja-no-eval :group! gekko-wall-run0-a-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (hostile-wall-trans) + (ja-no-eval :group! gekko-wall-run0-b-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((gp-0 (-> self root))) + (vector-normalize-copy! + (-> gp-0 transv) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat)) + 40960.0 + ) + (vector-v++! (-> gp-0 trans) (-> gp-0 transv)) + ) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate turn-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + ) + :exit (behavior () + (set-time! (-> self last-turn-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (when (!= (-> self turn-next-state) (method-of-type gekko attack-wall)) + (set-look-at-mode! self 1) + (let* ((v1-7 (ja-group)) + (gp-0 (if (and v1-7 (= v1-7 gekko-wall-run0-a-ja)) + 25 + 24 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (dotimes (s5-0 (if (time-elapsed? (-> self last-turn-time) (seconds 1)) + 1 + 6 + ) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + ) + ) + (set-look-at-mode! self 2) + (let* ((f0-8 (vector-dot + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (vector-negate! (new 'stack-no-clear 'vector) (-> self dest-to-me-dir)) + ) + (-> self rot-matrix uvec) + ) + ) + (gp-3 (if (< f0-8 0.0) + 8 + 9 + ) + ) + ) + (set! (-> self rot-mult) (if (< f0-8 0.0) + 1.0 + -1.0 + ) + ) + (let ((v1-47 self)) + (set! (-> v1-47 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-47 enemy-flags)))) + ) + 0 + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (if (rnd-chance? self 0.75) + (sound-play "gekko-slither") + ) + (ja-channel-push! 1 (seconds 0.017)) + (ja-no-eval :group! (-> self draw art-group data gp-3) :num! (loop!) :frame-num 0.0) + ) + (until (enemy-method-104 self (-> self turn-face-point) 910.2222) + (suspend) + (ja :num! (loop!)) + ) + (go (-> self turn-next-state)) + ) + :post (behavior () + (let ((a0-0 self)) + (if (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (quaternion-rotate-local-y! + (-> self root quat) + (-> self root quat) + (* -81920.0 (seconds-per-frame) (-> self rot-mult)) + ) + ) + ) + (vector-float*! (-> self root transv) (-> self root transv) 0.6) + (vector-v++! (-> self root trans) (-> self root transv)) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate attack-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + (set-look-at-mode! self 1) + ) + :exit (behavior () + (set-time! (-> self attack-time)) + ) + :code (behavior () + (let* ((v1-2 (ja-group)) + (gp-0 (if (and v1-2 (= v1-2 gekko-wall-run0-a-ja)) + 25 + 24 + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((s5-0 (current-time)) + (s4-0 150) + (f30-0 0.5) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? s5-0 s4-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gekko-lod0-jg head))) + (s4-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 quad) (-> self focus-pos quad)) + (set! (-> s4-1 y) (- (-> s4-1 y) (* 4096.0 (rnd-float-range self 0.0 10.0)))) + (sound-play "gekko-shot") + (spawn-metalhead-projectile (the-as metalhead-shot self) s5-1 s4-1 532480.0) + ) + (logclear! (-> self flags) (gekko-flag update-foot-position?)) + (ja-channel-push! 1 1) + (ja-no-eval :group! gekko-wall-shoot0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.06)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (dotimes (s5-2 2) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (seek! max 0.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + ) + ) + (gekko-method-206 self) + ) + :post (behavior () + (seek! (-> self fade) 1.0 (seconds-per-frame)) + (set! (-> self draw force-fade) (the-as uint (the int (-> self fade)))) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy knocked) enter)) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position? falling-off-wall?)) + (set! (-> self probe-len) 18432.0) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self flags) (gekko-flag falling-off-wall?)) + ) + :trans (behavior () + ((-> (method-of-type nav-enemy knocked) trans)) + (let ((a1-1 (quaternion-from-two-vectors-max-angle! + (new 'stack-no-clear 'quaternion) + (-> self rot-matrix uvec) + *y-vector* + (* 49152.0 (seconds-per-frame)) + ) + ) + (v1-4 (-> self root)) + ) + (quaternion*! (-> v1-4 quat) a1-1 (-> v1-4 quat)) + ) + ) + :code (-> (method-of-type nav-enemy knocked) code) + :post (behavior () + ((the-as (function none) (-> (method-of-type nav-enemy knocked) post))) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate jump-off-wall (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (stop-look-at! self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self mask) (process-mask actor-pause)) + (let* ((v1-8 *game-info*) + (a0-4 (+ (-> v1-8 attack-id) 1)) + ) + (set! (-> v1-8 attack-id) a0-4) + (set! (-> self attack-id) a0-4) + ) + (set! (-> self root penetrate-using) (penetrate lunge vehicle knocked)) + (logclear! (-> self root status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> self root root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-20 (-> self root dynam gravity-normal))) + (set! (-> self root local-normal quad) (-> v1-20 quad)) + (set! (-> self root surface-normal quad) (-> v1-20 quad)) + (set! (-> self root poly-normal quad) (-> v1-20 quad)) + ) + (set! (-> self root coverage) 0.0) + (set! (-> self root touch-angle) 0.0) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (enemy-method-50 self 3) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (set! (-> self probe-len) 18432.0) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gekko-jump-to-ground-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual jump-off-wall-falling) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate jump-off-wall-falling (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans)))) + (set! (-> v1-1 y) 0.0) + (vector-float*! (-> self root transv) v1-1 1.5) + ) + (set-time! (-> self state-time)) + ) + :trans #f + :code (behavior () + (local-vars (s4-0 collide-shape-moving)) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gekko-jump-to-ground-in-air-ja :num! (seek!)) + (let ((gp-0 0) + (s5-0 0) + ) + (until (or (>= gp-0 3) + (and (logtest? (-> s4-0 status) (collide-status on-ground)) (>= 16384.0 (-> s4-0 transv y))) + (and (>= s5-0 3) + (let ((f0-7 40.96)) + (>= (* f0-7 f0-7) (vector-vector-distance-squared (-> s4-0 trans-old) (-> s4-0 trans-old-old))) + ) + (let ((f0-10 40.96)) + (>= (* f0-10 f0-10) (vector-vector-distance-squared (-> s4-0 trans-old-old) (-> s4-0 trans-old-old-old))) + ) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 2)) + (go-die self) + ) + (if (logtest? (-> self root status) (collide-status on-surface)) + (+! gp-0 1) + ) + (suspend) + (ja :num! (seek!)) + (+! s5-0 1) + (set! s4-0 (-> self root)) + ) + ) + (go-virtual jump-off-wall-recover) + ) + :post (behavior () + (let ((a1-1 (quaternion-from-two-vectors-max-angle! + (new 'stack-no-clear 'quaternion) + (-> self rot-matrix uvec) + *y-vector* + (* 49152.0 (seconds-per-frame)) + ) + ) + (v1-2 (-> self root)) + ) + (quaternion*! (-> v1-2 quat) a1-1 (-> v1-2 quat)) + ) + (nav-enemy-falling-post) + ) + ) + +;; failed to figure out what this is: +(defstate jump-off-wall-recover (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (gekko-method-208 self) + (set! (-> self root penetrate-using) (penetrate)) + 0 + ) + :exit (behavior () + (local-vars (v1-9 enemy-flag) (v1-11 enemy-flag) (v1-13 enemy-flag)) + (enemy-method-50 self 0) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-8 (-> self enemy-flags))) + (if (logtest? v1-8 (enemy-flag vulnerable-backup)) + (set! v1-9 (logior v1-8 (enemy-flag vulnerable))) + (set! v1-9 (logclear v1-8 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-9) + (let ((v1-10 (-> self enemy-flags))) + (if (logtest? v1-10 (enemy-flag attackable-backup)) + (set! v1-11 (logior v1-10 (enemy-flag attackable))) + (set! v1-11 (logclear v1-10 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-11) + (let ((v1-12 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-12) + (set! v1-13 (logior (enemy-flag trackable) v1-12)) + (set! v1-13 (logclear v1-12 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-13) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) (within-gspot-range? self)) + (go-die self) + ) + ) + :code (behavior () + (ja-channel-set! 1) + (ja-no-eval :group! gekko-jump-to-ground-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (gp-0 2) + (ja-no-eval :group! gekko-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-best-state self) + ) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate active (gekko) + :virtual #t + :enter (behavior () + (if (logtest? (-> self flags) (gekko-flag on-wall?)) + (go-virtual active-wall) + ) + (let ((t9-1 (-> (method-of-type nav-enemy active) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (until #f + (let* ((f30-1 (* 0.5 (rnd-float-range self 0.9 1.1))) + (v1-5 (ja-group)) + (s5-0 (if (and v1-5 (= v1-5 gekko-run0-a-ja)) + 25 + 24 + ) + ) + (s4-0 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (nav-enemy-method-164 self) + (let ((a1-2 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-2 target-pos quad)) + ) + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-13 nav callback-info) *null-nav-callback-info*) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (s3-0 s4-0) + (ja-no-eval :group! (-> self draw art-group data s5-0) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (logclear! (-> self flags) (gekko-flag update-foot-position?)) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + (when (not (enemy-method-104 self gp-0 8192.0)) + (let ((v1-48 self)) + (set! (-> v1-48 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-48 enemy-flags)))) + ) + 0 + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (ja-channel-push! 1 (seconds 0.06)) + (let ((a0-26 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (v1-54 (vector-! (new 'stack-no-clear 'vector) gp-0 (-> self root trans))) + (f30-2 0.5) + (f28-0 1.0) + ) + (cond + ((< 0.0 (vector-dot a0-26 v1-54)) + (ja-no-eval :group! gekko-turn-left0-ja :num! (loop! f30-2) :frame-num 0.0) + ) + (else + (ja-no-eval :group! gekko-turn-right0-ja :num! (loop! f30-2) :frame-num 0.0) + (set! f28-0 (* -1.0 f28-0)) + ) + ) + (until (enemy-method-104 self gp-0 6371.5557) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* -81920.0 (seconds-per-frame) f28-0)) + (suspend) + (ja :num! (loop! f30-2)) + ) + ) + ) + ) + (let* ((v1-86 (ja-group)) + (gp-1 (if (and v1-86 (= v1-86 gekko-idle0-ja)) + 14 + 15 + ) + ) + (v1-91 (ja-group)) + (s5-1 (if (and v1-91 (= v1-91 gekko-idle0-ja)) + 15 + 14 + ) + ) + (s4-1 (set-reaction-time! self (seconds 0.017) (seconds 0.027))) + ) + (let ((v1-95 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-95 enemy-flags))) + (set! (-> v1-95 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-95 enemy-flags)))) + ) + (set! (-> v1-95 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-95 enemy-flags)))) + (set! (-> v1-95 nav callback-info) (-> v1-95 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-3 (/ 0.5 (-> self scale)))) + (dotimes (s3-1 s4-1) + (ja-no-eval :group! (-> self draw art-group data gp-1) :num! (seek! max f30-3) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-3)) + ) + (ja-no-eval :group! (-> self draw art-group data s5-1) :num! (seek! max f30-3) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-3)) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for function gekko-stare-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior gekko-stare-code gekko () + (let* ((f30-1 (* 0.5 (rnd-float-range self 0.9 1.1))) + (v1-5 (ja-group)) + (gp-0 (if (and v1-5 (= v1-5 gekko-run0-a-ja)) + 25 + 24 + ) + ) + ) + (until #f + (cond + ((enemy-method-104 self (-> self focus-pos) 8192.0) + (let ((v1-10 self)) + (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (let ((v1-14 (ja-group))) + (if (not (and v1-14 (= v1-14 (-> self draw art-group data gp-0)))) + (ja-channel-push! 1 (seconds 0.12)) + ) + ) + (ja-no-eval :group! (-> self draw art-group data gp-0) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (if (= (-> self skel root-channel 0) (-> self skel channel)) + (logclear! (-> self flags) (gekko-flag update-foot-position?)) + ) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ((or (enemy-method-104 self (-> self focus-pos) 30947.555) (rnd-chance? self 0.3)) + (let ((v1-50 self)) + (set! (-> v1-50 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-50 enemy-flags)))) + ) + 0 + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (ja-channel-push! 1 (seconds 0.06)) + (let ((a0-28 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (v1-56 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + (f28-0 0.5) + ) + (if (< 0.0 (vector-dot a0-28 v1-56)) + (ja-no-eval :group! gekko-turn-left0-ja :num! (loop! f28-0) :frame-num 0.0) + (ja-no-eval :group! gekko-turn-right0-ja :num! (loop! f28-0) :frame-num 0.0) + ) + (until (enemy-method-104 self (-> self focus-pos) 6371.5557) + (suspend) + (ja :num! (loop! f28-0)) + ) + ) + ) + (else + (go-virtual turn-quick) + ) + ) + ) + ) + #f + (none) + ) + +;; failed to figure out what this is: +(defstate stare (gekko) + :virtual #t + :code gekko-stare-code + ) + +;; failed to figure out what this is: +(defstate flee (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy flee) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.015)) + (until #f + (let ((f30-0 (/ (rnd-float-range self 0.9 1.1) (-> self scale)))) + (ja-no-eval :group! gekko-run0-a-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! gekko-run0-b-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate hostile (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + (let ((v1-13 self)) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (until #f + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! gekko-run0-a-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (gekko-method-203 self) + (ja-no-eval :group! gekko-run0-b-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (gekko-method-203 self) + ) + #f + ) + :post (behavior () + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self focus-pos))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 y) 0.0) + (vector-xz-normalize! s4-1 24576.0) + (vector+! gp-0 (-> self focus-pos) s4-1) + (set! (-> s5-0 quad) (-> gp-0 quad)) + (closest-point-on-mesh (-> self nav) s5-0 gp-0 (the-as nav-poly #f)) + (set! (-> self move-dest quad) (-> s5-0 quad)) + ) + (let ((v1-8 (-> self nav state))) + (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + ) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate pre-attack (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self move-speed) (vector-length (-> self root transv))) + (set! (-> self move-decel) (fmax 163840.0 (* 0.00012207031 (-> self move-speed) (-> self move-speed)))) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.3)) + (cond + ((and (get-focus! self) + (enemy-method-104 self (-> self focus-pos) 8192.0) + (let ((f0-0 (vector-vector-distance (-> self root trans) (-> self focus-pos)))) + (< f0-0 40960.0) + (and (< 4096.0 f0-0) (gekko-method-204 self)) + ) + ) + (go-virtual attack) + ) + (else + (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 0.8 2.1))))) + (go-best-state self) + ) + ) + ) + ) + :code gekko-stare-code + :post (behavior () + (seek! (-> self move-speed) 0.0 (* (-> self move-decel) (seconds-per-frame))) + (vector-normalize-copy! + (-> self root transv) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (-> self move-speed) + ) + (vector+! (-> self move-dest) (-> self root trans) (-> self root transv)) + (vector-v++! (-> self root trans) (-> self root transv)) + (nav-enemy-face-focus-post) + ) + ) + +;; failed to figure out what this is: +(defstate attack (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (logclear! (-> self flags) (gekko-flag update-foot-position? update-tilt)) + (set-look-at-mode! self 1) + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((v1-14 (-> self root root-prim))) + (let ((a0-4 (-> (the-as collide-shape-prim-group v1-14) child 6))) + (set! (-> a0-4 prim-core collide-as) (collide-spec enemy)) + (+! (-> a0-4 local-sphere w) 3276.8) + ) + (+! (-> v1-14 local-sphere w) 6144.0) + ) + (let ((v1-16 self)) + (set! (-> v1-16 enemy-flags) (the-as enemy-flag (logclear (-> v1-16 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-16 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :exit (behavior () + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag update-foot-position? follow-terrain update-tilt)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-16 (-> self root root-prim))) + (let ((a0-3 (-> (the-as collide-shape-prim-group v1-16) child 6))) + (set! (-> a0-3 prim-core collide-as) (collide-spec)) + (+! (-> a0-3 local-sphere w) -3276.8) + ) + (+! (-> v1-16 local-sphere w) -6144.0) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! gekko-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-24 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-24 enemy-flags))) + (set! (-> v1-24 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-24 enemy-flags)))) + ) + (set! (-> v1-24 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-24 enemy-flags)))) + (set! (-> v1-24 nav callback-info) (-> v1-24 enemy-info callback-info)) + ) + 0 + (let ((gp-0 (-> self nav))) + (set! (-> gp-0 target-speed) (lerp-scale + 24576.0 + 110592.0 + (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) + 4096.0 + 24576.0 + ) + ) + ) + 0 + (ja-no-eval :group! gekko-attack0-mid-ja :num! (seek! max (/ 1.0 (-> self scale))) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (/ 1.0 (-> self scale)))) + ) + (nav-enemy-method-177 self) + (let ((v1-55 self)) + (set! (-> v1-55 enemy-flags) (the-as enemy-flag (logclear (-> v1-55 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-55 nav callback-info) *null-nav-callback-info*) + ) + 0 + (set-time! (-> self attack-time)) + (ja-no-eval :group! gekko-attack0-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate turn (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (logclear! (-> self flags) (gekko-flag follow-terrain)) + ) + :trans (behavior () + (if (enemy-method-104 self (-> self focus-pos) 2730.6667) + (go-best-state self) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (let ((a0-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (v1-2 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans))) + (f30-0 (/ 1.0 (-> self scale))) + ) + (cond + ((< 0.0 (vector-dot a0-2 v1-2)) + (ja-no-eval :group! gekko-turn-left0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! gekko-turn-right0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + #f + ) + :post nav-enemy-face-focus-post + ) + +;; failed to figure out what this is: +(defstate turn-quick (gekko) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gekko-turn-hop0-ja :num! (seek! max (/ 1.0 (-> self scale))) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* 98304.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max (/ 1.0 (-> self scale)))) + ) + (ja-no-eval :group! gekko-turn-hop0-land-ja :num! (seek! max (/ 1.0 (-> self scale))) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (/ 1.0 (-> self scale)))) + ) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate jump (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position? falling-off-wall?)) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (gekko) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #f) + ) + (set! (-> self probe-len) 18432.0) + (logclear! (-> self flags) (gekko-flag follow-terrain update-tilt on-wall?)) + (logior! (-> self flags) (gekko-flag update-foot-position?)) + (set-vector! + (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll gravity-target) + 0.0 + -1.5 + 0.0 + 1.0 + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (gekko) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) exit))) + (if t9-0 + (t9-0) + ) + ) + (dotimes (gp-0 4) + (enable-set! (-> self foot gp-0 leg-ik) #t) + ) + (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) + ) + :code (behavior () + (gekko-method-208 self) + (ja-channel-push! 1 (seconds 0.4)) + (ja-no-eval :group! gekko-run0-a-ja :num! (seek!) :frame-num 0.0) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.4)) + (suspend) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + +;; definition for function gekko-foot-rot-handler +;; WARN: Return type mismatch matrix vs none. +(defun gekko-foot-rot-handler ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (-> arg0 param2))) + (cspace<-transformq! arg0 (the-as transformq (&-> (the-as gekko v1-0) pool))) + ) + (none) + ) + +;; definition for function gekko-postbind +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun gekko-postbind ((arg0 draw-control) (arg1 cspace-array)) + (local-vars + (sv-560 float) + (sv-640 vector) + (sv-688 float) + (sv-692 vector) + (sv-696 vector) + (sv-976 cspace) + (sv-980 gekko-foot-info) + (sv-984 vector) + (sv-988 vector) + (sv-992 (function vector vector vector vector float)) + (sv-1008 vector) + (sv-1024 vector) + (sv-1040 vector) + (sv-1056 joint-mod-ik) + (sv-1072 vector) + (sv-1088 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as gekko (-> arg0 process)))) + (let ((s3-0 (-> gp-0 root))) + (let ((s2-0 (new 'stack-no-clear 'collide-query)) + (f30-0 (-> gp-0 probe-len)) + ) + (set! sv-560 (the-as float 2048.0)) + (quaternion->matrix (-> gp-0 rot-matrix) (-> gp-0 root quat)) + (let ((v1-2 1) + (a0-2 (new 'stack-no-clear 'inline-array 'vector 1)) + ) + (set! (-> a0-2 0 quad) (-> s3-0 trans quad)) + (set! (-> a0-2 0 w) + (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* 0.25 f30-0 f30-0)))) + ) + (let ((a1-6 s2-0)) + (set! (-> a1-6 best-dist) (the-as float a0-2)) + (set! (-> a1-6 best-other-prim) (the-as collide-shape-prim v1-2)) + (set! (-> a1-6 collide-with) (collide-spec backgnd)) + (set! (-> a1-6 ignore-process0) gp-0) + (set! (-> a1-6 ignore-process1) #f) + (set! (-> a1-6 ignore-pat) (-> gp-0 root pat-ignore-mask)) + (set! (-> a1-6 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> a1-6 action-mask) (collide-action solid)) + ) + ) + (fill-using-spheres *collide-cache* s2-0) + (dotimes (s1-0 4) + (let ((s0-0 (-> gp-0 foot s1-0))) + (set! sv-1056 (-> s0-0 leg-ik)) + (set! sv-1008 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg1 data (-> *gekko-ik-setup* s1-0 hand-index))) + ) + (let ((v0-3 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg1 data (-> *gekko-ik-setup* s1-0 effector-index))) + ) + ) + (set! sv-640 (vector-! (new 'stack-no-clear 'vector) v0-3 sv-1008)) + ) + (let ((v1-28 (if (logtest? (-> gp-0 flags) (gekko-flag on-wall?)) + (-> gp-0 rot-matrix uvec) + *y-vector* + ) + ) + ) + (vector+float*! (-> s2-0 start-pos) sv-1008 v1-28 (* 0.5 f30-0)) + (vector-float*! (-> s2-0 move-dist) v1-28 (- f30-0)) + ) + (let ((v1-29 s2-0)) + (set! (-> v1-29 radius) sv-560) + (set! (-> v1-29 collide-with) (collide-spec backgnd)) + (set! (-> v1-29 ignore-process0) #f) + (set! (-> v1-29 ignore-process1) #f) + (set! (-> v1-29 ignore-pat) (-> gp-0 root pat-ignore-mask)) + (set! (-> v1-29 action-mask) (collide-action solid)) + ) + (set! sv-688 (probe-using-line-sphere *collide-cache* s2-0)) + (set! sv-692 (new 'stack-no-clear 'vector)) + (set! sv-696 (new 'stack-no-clear 'vector)) + (cond + ((>= sv-688 0.0) + (let ((v0-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s2-0 move-dist) 1.0))) + (vector+float*! sv-692 (-> s2-0 start-pos) (-> s2-0 move-dist) sv-688) + (vector-! sv-696 sv-692 (-> s2-0 best-other-tri intersect)) + (vector+float*! sv-692 sv-692 v0-5 (-> s2-0 radius)) + ) + (vector-normalize! sv-696 1.0) + ) + (else + (set! (-> sv-692 quad) (-> sv-1008 quad)) + (set! (-> sv-692 y) (-> gp-0 root gspot-pos y)) + (set! (-> sv-696 quad) (-> gp-0 rot-matrix uvec quad)) + ) + ) + (if (logtest? (-> gp-0 flags) (gekko-flag on-wall?)) + (set! (-> s0-0 ground-normal quad) (-> sv-696 quad)) + (set! (-> s0-0 ground-normal quad) (-> *y-vector* quad)) + ) + (when (logtest? (-> gp-0 flags) (gekko-flag update-foot-position?)) + (set! sv-992 intersect-ray-plane) + (let* ((a1-22 (vector-negate! (new 'stack-no-clear 'vector) (-> gp-0 rot-matrix uvec))) + (a2-4 (-> gp-0 root trans)) + (a3-1 (-> gp-0 rot-matrix uvec)) + (f0-13 (sv-992 sv-1008 a1-22 a2-4 a3-1)) + ) + (vector+float*! sv-692 sv-692 (-> s0-0 ground-normal) f0-13) + ) + (vector+! sv-692 sv-692 sv-640) + ) + 0.0 + (let ((f28-0 (* 2457.6 (-> gp-0 scale))) + (v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> gp-0 node-list data 3))) + ) + (set! sv-1024 (new 'stack-no-clear 'vector)) + (set! sv-1040 (new 'stack-no-clear 'vector)) + (vector+float*! v0-9 v0-9 (-> gp-0 rot-matrix uvec) 3072.0) + (let ((f28-1 (+ 3072.0 f28-0))) + (when (< (vector-line-distance-point! + sv-692 + v0-9 + (vector+! (new 'stack-no-clear 'vector) v0-9 (-> gp-0 rot-matrix fvec)) + sv-1024 + ) + f28-1 + ) + (vector-! sv-1040 sv-692 sv-1024) + (vector-normalize! sv-1040 f28-1) + (let ((v1-64 sv-692)) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-1024 quad)) + (.lvf vf5 (&-> sv-1040 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-64 quad) vf6) + ) + 0 + ) + ) + ) + (vector-seek! + (-> s0-0 ground-pos) + sv-692 + (* (fmax 61440.0 (* 1.2 (vector-length (-> s3-0 transv)))) (seconds-per-frame)) + ) + (let ((t9-13 (method-of-object sv-1056 set-ik-target!)) + (a1-33 (-> s0-0 ground-pos)) + ) + (t9-13 sv-1056 a1-33) + ) + ) + ) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (vector-reset! s2-1) + (vector-reset! s1-1) + (dotimes (s0-1 4) + (vector+! s2-1 s2-1 (the-as vector (-> gp-0 foot s0-1))) + (when (> s0-1 0) + (set! sv-1072 + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> gp-0 foot s0-1)) (the-as vector (-> gp-0 foot))) + 1.0 + ) + ) + (set! sv-1088 (new 'stack-no-clear 'vector)) + (let ((v1-83 (-> gp-0 rot-matrix uvec)) + (a0-46 sv-1072) + ) + (.lvf vf1 (&-> v1-83 quad)) + (.lvf vf2 (&-> a0-46 quad)) + ) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> sv-1088 quad) vf3) + (vector-normalize! sv-1088 1.0) + (let ((a1-41 s1-1) + (v1-85 s1-1) + (a0-48 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> sv-1072 quad)) + (.lvf vf2 (&-> sv-1088 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> a0-48 quad) vf3) + (vector+! a1-41 v1-85 a0-48) + ) + ) + ) + (vector-float*! s2-1 s2-1 0.25) + (vector-normalize-copy! (-> gp-0 gspot-normal) s1-1 1.0) + ) + (when (logtest? (-> gp-0 flags) (gekko-flag follow-terrain)) + (set! (-> gp-0 root gspot-pos quad) (-> s2-1 quad)) + (let ((a2-15 (vector-! (new 'stack-no-clear 'vector) s2-1 (-> s3-0 trans)))) + (vector+float*! + (-> s3-0 trans) + (-> s3-0 trans) + (-> gp-0 rot-matrix uvec) + (* 0.9 (vector-dot a2-15 (-> gp-0 rot-matrix uvec))) + ) + ) + ) + ) + (when (logtest? (-> gp-0 flags) (gekko-flag update-tilt)) + (let ((s2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (a2-18 (quaternion-from-two-vectors-max-angle-partial! + (new 'stack-no-clear 'quaternion) + (-> gp-0 rot-matrix uvec) + (-> gp-0 gspot-normal) + 21845.334 + (* 8.0 (seconds-per-frame)) + ) + ) + (s1-2 (new 'stack-no-clear 'vector)) + ) + (quaternion-slerp! (-> gp-0 tilt-quat) (-> gp-0 tilt-quat) a2-18 1.0) + (vector-orient-by-quat! s1-2 (-> gp-0 rot-matrix uvec) (-> gp-0 tilt-quat)) + (forward-up-nopitch->quaternion (-> s3-0 quat) s2-2 s1-2) + ) + ) + ) + (dotimes (s3-1 4) + (set! sv-976 (-> arg1 data (-> *gekko-ik-setup* s3-1 effector-index))) + (set! sv-980 (the-as gekko-foot-info (+ (the-as uint (-> gp-0 foot 0 foot-transform)) (* 96 s3-1)))) + (set! sv-984 (new 'stack-no-clear 'vector)) + (set! sv-988 (new 'stack-no-clear 'vector)) + (quaternion-from-two-vectors! + (the-as quaternion sv-988) + (-> gp-0 rot-matrix uvec) + (the-as vector (+ (the-as uint (-> gp-0 foot 0 ground-normal)) (* 96 s3-1))) + ) + (vector<-cspace! (-> sv-980 ground-pos) sv-976) + (matrix->quaternion (the-as quaternion sv-984) (-> sv-976 bone transform)) + (quaternion*! + (the-as quaternion (-> sv-980 ground-normal)) + (the-as quaternion sv-988) + (the-as quaternion sv-984) + ) + ) + (logclear! (-> gp-0 skel status) (joint-control-status no-joint-callbacks)) + (draw-control-method-14 arg0 arg1 (-> gp-0 skel)) + (logior! (-> gp-0 skel status) (joint-control-status no-joint-callbacks)) + ) + 0 + 0 + (none) + ) + ) + +;; definition for function gekko-postbind-callback +(defun gekko-postbind-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control)) + (gekko-postbind arg0 arg1) + (none) + ) + +;; definition for method 203 of type gekko +;; WARN: Return type mismatch int vs none. +(defmethod gekko-method-203 ((this gekko)) + ((-> (method-of-type nav-enemy hostile) trans)) + (when (< (vector-vector-xz-distance (-> this root trans) (-> this move-dest)) 8192.0) + (let* ((s5-0 (-> this focus-pos)) + (v1-6 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> this root trans))) + (f30-0 (sqrtf (+ (* (-> v1-6 x) (-> v1-6 x)) (* (-> v1-6 z) (-> v1-6 z))))) + ) + (cond + ((and (get-focus! this) (and (and (< f30-0 32768.0) (< 16384.0 f30-0)) (enemy-method-104 this s5-0 6371.5557))) + (go (method-of-object this pre-attack)) + ) + ((< 32768.0 f30-0) + (cond + ((not (enemy-method-104 this s5-0 29127.111)) + (go (method-of-object this turn-quick)) + ) + ((not (enemy-method-104 this s5-0 6371.5557)) + (go (method-of-object this turn)) + ) + ) + ) + ) + ) + (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 1.3 2.25))))) + (go-best-state this) + ) + 0 + (none) + ) + +;; definition for method 204 of type gekko +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod gekko-method-204 ((this gekko)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this root trans quad)) + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) + ) + (when (and s4-0 (< (vector-vector-xz-distance s5-0 s3-0) 4096.0)) + (let* ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) s5-0)) + (f30-0 (vector-length s3-2)) + (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) + ) + (vector-float*! s3-2 s3-2 (/ (* 8192.0 (-> this scale)) f30-0)) + (clamp-vector-to-mesh-no-gaps (-> this nav) s5-0 s4-0 s3-2 s2-0) + (not (-> s2-0 found-boundary)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 107 of type gekko +(defmethod is-pfoc-in-mesh? ((this gekko) (arg0 process-focusable) (arg1 vector)) + (if (and arg0 (not arg1)) + (set! arg1 (get-trans arg0 1)) + ) + (when arg1 + (let* ((f0-0 (-> arg1 y)) + (v1-4 (-> this root)) + (f1-0 (-> v1-4 trans y)) + (a0-2 (-> this fact)) + ) + (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) + (let* ((f30-0 (if (logtest? (-> this flags) (gekko-flag on-wall?)) + (-> this enemy-info notice-nav-radius) + 8192.0 + ) + ) + (f0-2 f30-0) + ) + (or (>= (* f0-2 f0-2) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) + (is-in-mesh? (-> this nav) arg1 f30-0) + ) + ) + ) + ) + ) + ) + +;; definition for method 109 of type gekko +;; INFO: Used lq/sq +(defmethod enemy-method-109 ((this gekko)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) + ) + (do-navigation-to-destination s3-0 (-> gp-0 trans)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) + (set! (-> s5-0 quad) (-> gp-0 trans quad)) + ) + (else + (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) + (let ((f0-0 16384.0)) + (< (* f0-0 f0-0) (vector-vector-xz-distance-squared s5-0 (-> gp-0 trans))) + ) + (and (and (-> this next-state) (= (-> this next-state name) 'knocked-recover)) + (< (-> gp-0 trans y) (+ -8192.0 (-> s5-0 y))) + (< (+ 12288.0 (-> s5-0 y)) (-> gp-0 trans y)) + ) + ) + (return #t) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 206 of type gekko +;; WARN: Return type mismatch object vs none. +(defmethod gekko-method-206 ((this gekko)) + (set-look-at-mode! this 2) + (gekko-method-205 this) + (set! (-> this turn-next-state) (method-of-type gekko hostile-wall)) + (go (method-of-object this turn-wall)) + (none) + ) + +;; definition for method 207 of type gekko +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod gekko-method-207 ((this gekko)) + (set-look-at-mode! this 1) + (set! (-> this turn-face-point quad) (-> this focus-pos quad)) + (set! (-> this turn-next-state) (method-of-type gekko attack-wall)) + (go (method-of-object this turn-wall)) + (none) + ) + +;; definition for method 113 of type gekko +(defmethod get-focus! ((this gekko)) + (let* ((t9-0 (method-of-type nav-enemy get-focus!)) + (v0-0 (t9-0 this)) + ) + (cond + ((and v0-0 + (or (logtest? (-> this flags) (gekko-flag on-wall?)) (time-elapsed? (-> this attack-time) (seconds 3))) + ) + (empty) + v0-0 + ) + (else + (the-as process-focusable #f) + ) + ) + ) + ) + +;; definition for method 205 of type gekko +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod gekko-method-205 ((this gekko)) + (cond + ((zero? (-> this path-wall)) + (go process-drawable-art-error "no path-wall") + ) + (else + (let ((s5-0 (-> this path-wall curve num-cverts))) + (if (<= s5-0 0) + (go process-drawable-art-error "no path-wall") + ) + (let ((s2-0 (rnd-int this s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s3-0 s5-0) + (get-point-in-path! (-> this path-wall) s4-0 (the float s2-0) 'interp) + (if (< 8192.0 (vector-vector-xz-distance s4-0 (-> this root trans))) + (goto cfg-11) + ) + (set! s2-0 (mod (+ s2-0 1) s5-0)) + ) + (label cfg-11) + (set! (-> this move-dest quad) (-> s4-0 quad)) + (set! (-> this turn-face-point quad) (-> s4-0 quad)) + ) + ) + (vector-! (-> this dest-to-me-dir) (-> this root trans) (-> this move-dest)) + ) + ) + 0 + (none) + ) + +;; definition for method 108 of type gekko +;; WARN: disable def twice: 33. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod enemy-method-108 ((this gekko) (arg0 process-focusable)) + (or (< (current-time) (-> this scared-timer)) + (let ((v1-4 (handle->process (-> this focus handle)))) + (if v1-4 + (and (or (focus-test? (the-as process-focusable v1-4) disable dead ignore grabbed) + (and (not (logtest? (-> this flags) (gekko-flag on-wall?))) + (not (time-elapsed? (-> this attack-time) (seconds 3))) + ) + ) + (< (vector-vector-distance (-> this focus-pos) (-> this root trans)) 49152.0) + ) + #f + ) + ) + ) + ) + +;; definition for method 85 of type gekko +(defmethod knocked-anim ((this gekko) (arg0 enemy-knocked-info)) + (ja-channel-push! 1 0) + (cond + ((logtest? (-> this flags) (gekko-flag falling-off-wall?)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) + ) + ) + (else + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 29))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 29)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 29)) num-func-seek!) + ) + ) + ) + #t + ) + +;; definition for method 86 of type gekko +(defmethod knocked-land-anim ((this gekko) (arg0 enemy-knocked-info)) + (let ((v1-2 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-2 (= v1-2 (-> this draw art-group data 23))) + (let ((v1-7 (-> this skel root-channel 0))) + (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> v1-7 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> v1-7 param 1) (-> arg0 anim-speed)) + (set! (-> v1-7 frame-num) 0.0) + (joint-control-channel-group! v1-7 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + ) + ((= (-> this hit-points) 0.0) + (let ((v1-11 (-> this skel root-channel 0))) + (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) + (set! (-> v1-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 31)) frames num-frames) -1)) + ) + (set! (-> v1-11 param 1) (-> arg0 anim-speed)) + (set! (-> v1-11 frame-num) 0.0) + (joint-control-channel-group! v1-11 (the-as art-joint-anim (-> this draw art-group data 31)) num-func-seek!) + ) + ) + (else + (let ((v1-15 (-> this skel root-channel 0))) + (set! (-> v1-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + (set! (-> v1-15 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) + ) + (set! (-> v1-15 param 1) (-> arg0 anim-speed)) + (set! (-> v1-15 frame-num) 0.0) + (joint-control-channel-group! v1-15 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 78 of type gekko +(defmethod go-hostile ((this gekko)) + (if (logtest? (-> this flags) (gekko-flag on-wall?)) + (gekko-method-206 this) + (go (method-of-object this hostile)) + ) + ) + +;; definition for method 54 of type gekko +;; INFO: Used lq/sq +(defmethod get-knockback-dir! ((this gekko) (arg0 vector)) + (local-vars (v1-2 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (.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-2 vf1) + (when (= v1-2 0.0) + (vector-z-quaternion! arg0 (-> this root quat)) + (vector-negate-in-place! arg0) + ) + (vector-flatten! arg0 arg0 (-> this rot-matrix uvec)) + (vector-normalize! arg0 1.0) + ) + ) + +;; definition for method 56 of type gekko +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs object. +(defmethod knocked-handler ((this gekko) (arg0 vector)) + (get-knockback-dir! this arg0) + (let ((s4-0 (-> this enemy-info)) + (f28-0 0.0) + (f30-0 0.0) + ) + (let ((v1-2 (-> this incoming knocked-type))) + (set! f30-0 (cond + ((= v1-2 (knocked-type explode-or-darkjak)) + (let ((f30-1 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-hard-vxz-lo) (-> s4-0 knocked-hard-vxz-hi) f30-1)) + (lerp (-> s4-0 knocked-hard-vy-lo) (-> s4-0 knocked-hard-vy-hi) f30-1) + ) + ) + ((= v1-2 (knocked-type mech-punch)) + (let ((f30-2 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-medium-vxz-lo) (-> s4-0 knocked-medium-vxz-hi) f30-2)) + (lerp (-> s4-0 knocked-medium-vy-lo) (-> s4-0 knocked-medium-vy-hi) f30-2) + ) + ) + ((= v1-2 (knocked-type dark-shot)) + (let ((f30-3 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-huge-vxz-lo) (-> s4-0 knocked-huge-vxz-hi) f30-3)) + (lerp (-> s4-0 knocked-huge-vy-lo) (-> s4-0 knocked-huge-vy-hi) f30-3) + ) + ) + ((= v1-2 (knocked-type yellow-shot)) + (vector-rotate90-around-y! arg0 arg0) + (let ((v1-12 (new 'stack-no-clear 'vector))) + (vector-! v1-12 (-> this incoming attacker-pos) (-> this root trans)) + (set! (-> v1-12 y) 0.0) + (if (< 0.0 (vector-dot v1-12 arg0)) + (vector-negate! arg0 arg0) + ) + ) + (let ((f30-4 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-yellow-vxz-lo) (-> s4-0 knocked-yellow-vxz-hi) f30-4)) + (lerp (-> s4-0 knocked-yellow-vy-lo) (-> s4-0 knocked-yellow-vy-hi) f30-4) + ) + ) + ((= v1-2 (knocked-type red-shot)) + (let* ((f1-2 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) + (f0-18 1.0) + (f2-0 61440.0) + (f1-3 (fmin f1-2 (* f2-0 f2-0))) + (f2-3 61440.0) + (f30-6 (* (- f0-18 (/ f1-3 (* f2-3 f2-3))) (rnd-float-range this 0.8 1.0))) + ) + (set! f28-0 (lerp (-> s4-0 knocked-red-vxz-lo) (-> s4-0 knocked-red-vxz-hi) f30-6)) + (lerp (-> s4-0 knocked-red-vy-lo) (-> s4-0 knocked-red-vy-hi) f30-6) + ) + ) + ((= v1-2 (knocked-type blue-shot)) + (let* ((f1-5 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) + (f0-24 1.0) + (f2-6 122880.0) + (f1-6 (fmin f1-5 (* f2-6 f2-6))) + (f2-9 122880.0) + (f26-0 (* (- f0-24 (/ f1-6 (* f2-9 f2-9))) (rnd-float-range this 0.8 1.0))) + ) + (set! f28-0 (lerp (-> s4-0 knocked-blue-vxz-lo) (-> s4-0 knocked-blue-vxz-hi) f26-0)) + (cond + ((>= (the-as uint 4) (-> this incoming blue-juggle-count)) + (lerp (-> s4-0 knocked-blue-vy-lo) (-> s4-0 knocked-blue-vy-hi) f26-0) + ) + (else + (if (zero? (rnd-int this 3)) + (set! f30-0 40960.0) + ) + f30-0 + ) + ) + ) + ) + ((= v1-2 (knocked-type vehicle)) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + f30-0 + ) + (else + (let ((f30-7 (rnd-float-range this 0.0 1.0))) + (set! f28-0 (lerp (-> s4-0 knocked-soft-vxz-lo) (-> s4-0 knocked-soft-vxz-hi) f30-7)) + (lerp (-> s4-0 knocked-soft-vy-lo) (-> s4-0 knocked-soft-vy-hi) f30-7) + ) + ) + ) + ) + ) + (vector-float*! arg0 arg0 f28-0) + (vector-flatten! arg0 arg0 (-> this rot-matrix uvec)) + (vector+float*! arg0 arg0 (-> this rot-matrix uvec) f30-0) + ) + ) + +;; definition for method 103 of type gekko +;; INFO: Used lq/sq +(defmethod enemy-method-103 ((this gekko) (arg0 vector) (arg1 float)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-flatten! s4-0 s4-0 (-> this rot-matrix uvec)) + (vector-normalize! s4-0 1.0) + (vector-flatten! s5-0 s5-0 (-> this rot-matrix uvec)) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s4-0 s5-0) (cos arg1)) + ) + ) + +;; definition for method 125 of type gekko +(defmethod ragdoll-settled? ((this gekko)) + (local-vars (v1-18 gekko-shadow-spot)) + (let ((s5-0 (handle->process (-> this ragdoll-proc)))) + (or (not s5-0) + (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) + (and (time-elapsed? (-> this state-time) (seconds 2)) + (< (vector-length (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-joints 0 velocity)) + (* 49152.0 (seconds-per-frame)) + ) + (< (cos (* 16384.0 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) + (begin (set! v1-18 (-> this shadow-spot)) (< (- (-> this root trans y) (-> v1-18 position y)) 6144.0)) + (>= (fabs (vector-dot (-> v1-18 normal) *y-vector*)) + (-> *pat-mode-info* (shr (shl (-> v1-18 pat) 54) 61) wall-angle) + ) + ) + ) + ) + ) + ) + +;; definition for method 208 of type gekko +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod gekko-method-208 ((this gekko)) + (dotimes (s5-0 4) + (let ((s4-0 (-> this foot s5-0)) + (s3-0 (-> *gekko-ik-setup* s5-0)) + ) + (set! (-> s4-0 ground-normal quad) (-> this rot-matrix uvec quad)) + (vector<-cspace! (-> s4-0 ground-pos) (-> this node-list data (-> s3-0 hand-index))) + (vector+float*! (-> s4-0 ground-pos) (-> s4-0 ground-pos) (-> s4-0 ground-normal) (-> s3-0 hand-dist)) + ) + ) + 0 + (none) + ) + +;; definition for method 110 of type gekko +(defmethod send-attack ((this gekko) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (sound-play "gekko-impact") + ((method-of-type nav-enemy send-attack) this arg0 arg1 arg2) + ) + +;; definition for method 59 of type gekko +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this gekko)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (if a0-2 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + ) + ) + (if (and (nonzero? (-> this path-wall)) (not (logtest? (-> this path-wall flags) (path-control-flag not-found)))) + (debug-draw (-> this path-wall)) + ) + (gekko-method-202 this) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 202 of type gekko +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod gekko-method-202 ((this gekko)) + (cond + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + ) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this rot-matrix uvec))) + (f30-0 81920.0) + ) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) + (let ((v1-10 s4-0)) + (set! (-> v1-10 radius) 3276.8) + (set! (-> v1-10 collide-with) (collide-spec backgnd)) + (set! (-> v1-10 ignore-process0) this) + (set! (-> v1-10 ignore-process1) #f) + (set! (-> v1-10 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-10 action-mask) (collide-action solid)) + ) + (let ((f28-0 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f28-0 0.0) + (let ((v1-14 (-> this draw shadow-ctrl))) + (logclear! (-> v1-14 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> this shadow-spot valid?) #t) + (let ((s3-0 (-> s4-0 best-other-tri))) + (let ((v1-18 (vector+float*! (new 'stack-no-clear 'vector) (-> s4-0 start-pos) (-> s4-0 move-dist) f28-0))) + (set! (-> this shadow-spot position quad) (-> s3-0 intersect quad)) + (vector-! (-> this shadow-spot normal) v1-18 (-> s3-0 intersect)) + ) + (vector-normalize! (-> this shadow-spot normal) 1.0) + (set! (-> this shadow-spot pat) (the-as uint (-> s3-0 pat))) + ) + (let ((a1-10 (-> this root trans)) + (f0-3 (* f28-0 f30-0)) + ) + (shadow-control-method-14 + (-> this draw shadow-ctrl) + a1-10 + s5-0 + (fmax 32768.0 (* 409600.0 f28-0)) + (+ -12288.0 f0-3) + (+ 12288.0 f0-3) + ) + ) + ) + (else + (let ((v1-29 (-> this draw shadow-ctrl))) + (logior! (-> v1-29 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> this shadow-spot valid?) #f) + ) + ) + ) + ) + ) + (else + (let ((v1-33 (-> this draw shadow-ctrl))) + (logior! (-> v1-33 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! (-> this shadow-spot valid?) #f) + ) + ) + 0 + (none) + ) + +;; definition for method 50 of type gekko +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this gekko) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (zero? v1-0) (= v1-0 2)) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) + (a0-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 7)) + ) + (set! (-> v1-4 prim-core action) (collide-action)) + (set! (-> a0-4 prim-core action) (collide-action)) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> a0-4 prim-core collide-as) (collide-spec)) + ) + 0 + ) + ((= v1-0 1) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0))) + (set! (-> v1-8 prim-core action) (collide-action solid deadly)) + (set! (-> v1-8 prim-core collide-as) (collide-spec enemy)) + ) + ) + ((= v1-0 3) + (let ((v1-12 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) + (a0-9 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 7)) + ) + (set! (-> v1-12 prim-core action) (collide-action solid deadly)) + (set! (-> a0-9 prim-core action) (collide-action solid deadly)) + (set! (-> v1-12 prim-core collide-as) (collide-spec enemy)) + (set! (-> a0-9 prim-core collide-as) (collide-spec enemy)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 82 of type gekko +(defmethod event-handler ((this gekko) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (logtest? (-> this flags) (gekko-flag on-wall?)) + (go (method-of-object this knocked-wall)) + (go (method-of-object this knocked)) + ) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 67 of type gekko +(defmethod coin-flip? ((this gekko)) + #f + ) + +;; definition for method 7 of type gekko +(defmethod relocate ((this gekko) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this foot v1-0 leg-ik)) + (&+! (-> this foot v1-0 leg-ik) offset) + ) + ) + (if (nonzero? (-> this path-wall)) + (&+! (-> this path-wall) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 121 of type gekko +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this gekko)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-gekko" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *gekko-nav-enemy-info*) + (set! (-> this scale) (rnd-float-range this 1.15 1.35)) + (let ((f0-1 (-> this scale))) + (set-vector! (-> this root scale) f0-1 f0-1 f0-1 1.0) + ) + (let ((v1-9 (-> this neck))) + (set! (-> v1-9 up) (the-as uint 1)) + (set! (-> v1-9 nose) (the-as uint 2)) + (set! (-> v1-9 ear) (the-as uint 0)) + (set! (-> v1-9 max-dist) 167936.0) + (set-vector! (-> v1-9 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-9 ignore-angle) 16384.0) + ) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this path-wall) (new 'process 'path-control this 'wall 0.0 (the-as entity #f) #t)) + (if (nonzero? (-> this path-wall)) + (logior! (-> this path-wall flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (dotimes (s5-1 4) + (let ((s4-1 (-> this foot s5-1))) + (set! (-> s4-1 leg-ik) + (new 'process 'joint-mod-ik this (-> *gekko-ik-setup* s5-1 elbow-index) (-> *gekko-ik-setup* s5-1 hand-dist)) + ) + (set! (-> s4-1 leg-ik user-float) (the float s5-1)) + (set! (-> s4-1 leg-ik elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> s4-1 leg-ik elbow-rotation-axis) (the-as uint 0)) + (let ((a0-18 (-> this node-list data (-> *gekko-ik-setup* s5-1 effector-index)))) + (set! (-> a0-18 param0) gekko-foot-rot-handler) + (set! (-> a0-18 param1) this) + (set! (-> a0-18 param2) (the-as basic s4-1)) + ) + (set! (-> s4-1 foot-transform scale quad) (-> *identity-vector* quad)) + ) + ) + (logior! (-> this foot 2 leg-ik flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this foot 3 leg-ik flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this foot 0 leg-ik flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this foot 1 leg-ik flags) (joint-mod-ik-flags elbow-rot-neg)) + (set! (-> this skel postbind-function) gekko-postbind-callback) + (logior! (-> this skel status) (joint-control-status no-joint-callbacks)) + (quaternion-rotate-local-y! + (-> this root quat) + (-> this root quat) + (* 182.04445 (rnd-float-range this 170.0 190.0)) + ) + (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) + (set! (-> this scared-timer) 0) + (set! (-> this root pause-adjust-distance) 368640.0) + (let ((s5-3 (new 'stack-no-clear 'vector)) + (s4-3 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (dotimes (s3-1 4) + (vector-orient-by-quat! s5-3 (the-as vector (-> *gekko-foot-offset* s3-1)) (-> this root quat)) + (vector+float*! (the-as vector (-> this foot s3-1)) (-> this root trans) s5-3 (-> this scale)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this foot 0 ground-normal)) (* 96 s3-1)))) + (-> s4-3 quad) + ) + ) + ) + (logior! (-> this flags) (gekko-flag update-foot-position? follow-terrain update-tilt on-wall?)) + (set! (-> this probe-len) 24576.0) + 0 + (none) + ) + +;; definition for method 89 of type gekko +(defmethod within-gspot-range? ((this gekko)) + (let ((s5-0 (-> this root)) + (a1-0 (new 'stack-no-clear 'collide-query)) + (gp-0 #t) + ) + (when (find-ground + s5-0 + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + (let ((f0-1 (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)))) + (if (and (>= f0-1 -4096.0) (>= 8192.0 f0-1)) + (set! gp-0 #f) + ) + ) + ) + gp-0 + ) + ) + +;; definition of type gecko +(deftype gecko (gekko) + () + ) + +;; definition for method 3 of type gecko +(defmethod inspect ((this gecko)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type gekko inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/mine/manta_REF.gc b/test/decompiler/reference/jak3/levels/mine/manta_REF.gc new file mode 100644 index 0000000000..b9b33940c6 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/manta_REF.gc @@ -0,0 +1,2077 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type manta +(deftype manta (nav-enemy) + ((info rigid-body-object-constants) + (move-matrix matrix :inline) + (curve-matrix matrix :inline) + (move-vel vector :inline) + (move-u float) + (move-du float) + (move-force float) + (flags manta-flags) + (go-enable symbol) + (orbit-speed float) + (max-time-step float) + (gravity float) + (landed-pos vector :inline) + (dest-pos vector :inline) + (attack-pos vector :inline) + (up-dir vector :inline) + (forward-dir vector :inline) + (knocked-force vector :inline) + (knocked-force-mult float) + (default-y-offset float) + (y-offset float) + (last-attack-time time-frame) + (attack-y-offset float) + (attack-path-blocked-time time-frame) + (track-timer time-frame) + (angle-to-player float) + (offset-difference float) + (sound-volume float) + (restart-fly-anims symbol) + (fly-anim-speed float) + (hit-ground-count uint32) + (fade-level float) + (pad uint8 8) + ) + (:state-methods + land-approach + land + notice-to-fly + attack + attack-end + ) + (:methods + (manta-method-195 (_type_) none) + (manta-method-196 (_type_) symbol) + (manta-method-197 (_type_) none) + (manta-method-198 (_type_) none) + (manta-method-199 (_type_) none) + (manta-method-200 (_type_) none) + (manta-method-201 (_type_ float) none) + (do-impact (_type_) none) + (manta-method-203 (_type_ float) none) + (manta-method-204 (_type_) none) + (update-target-pos! (_type_) none) + (manta-method-206 (_type_) none) + (alloc-rbody! (_type_ rigid-body-object-constants) none) + (manta-method-208 (_type_) none) + ) + ) + +;; definition for method 3 of type manta +(defmethod inspect ((this manta)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Tmove-matrix: #~%" (-> this move-matrix)) + (format #t "~2Tcurve-matrix: #~%" (-> this curve-matrix)) + (format #t "~2Tmove-vel: #~%" (-> this move-vel)) + (format #t "~2Tmove-u: ~f~%" (-> this move-u)) + (format #t "~2Tmove-du: ~f~%" (-> this move-du)) + (format #t "~2Tmove-force: ~f~%" (-> this move-force)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tgo-enable: ~A~%" (-> this go-enable)) + (format #t "~2Torbit-speed: ~f~%" (-> this orbit-speed)) + (format #t "~2Tmax-time-step: ~f~%" (-> this max-time-step)) + (format #t "~2Tgravity: ~f~%" (-> this gravity)) + (format #t "~2Tlanded-pos: #~%" (-> this landed-pos)) + (format #t "~2Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~2Tattack-pos: #~%" (-> this attack-pos)) + (format #t "~2Tup-dir: #~%" (-> this up-dir)) + (format #t "~2Tforward-dir: #~%" (-> this forward-dir)) + (format #t "~2Tknocked-force: #~%" (-> this knocked-force)) + (format #t "~2Tknocked-force-mult: ~f~%" (-> this knocked-force-mult)) + (format #t "~2Tdefault-y-offset: ~f~%" (-> this default-y-offset)) + (format #t "~2Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~2Tlast-attack-time: ~D~%" (-> this last-attack-time)) + (format #t "~2Tattack-y-offset: ~f~%" (-> this attack-y-offset)) + (format #t "~2Tattack-path-blocked-time: ~D~%" (-> this attack-path-blocked-time)) + (format #t "~2Ttrack-timer: ~D~%" (-> this track-timer)) + (format #t "~2Tangle-to-player: ~f~%" (-> this angle-to-player)) + (format #t "~2Toffset-difference: ~f~%" (-> this offset-difference)) + (format #t "~2Tsound-volume: ~f~%" (-> this sound-volume)) + (format #t "~2Trestart-fly-anims: ~A~%" (-> this restart-fly-anims)) + (format #t "~2Tfly-anim-speed: ~f~%" (-> this fly-anim-speed)) + (format #t "~2Thit-ground-count: ~D~%" (-> this hit-ground-count)) + (format #t "~2Tfade-level: ~f~%" (-> this fade-level)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (label cfg-7) + this + ) + +;; definition for symbol *manta-rigid-body-constants*, type rigid-body-object-constants +(define *manta-rigid-body-constants* (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.5 + :inv-mass 0.6666667 + :linear-damping 0.97 + :angular-damping 0.94 + :bounce-factor 0.75 + :friction-factor 0.99 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2.5) (meters 5) (meters 2.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 20) + :idle-distance (meters 200) + :attack-force-scale 2.0 + ) + :name '*manta-rigid-body-constants* + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-manta manta manta-lod0-jg manta-idle0-ja + ((manta-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow manta-shadow-mg + :shadow-joint-index 3 + ) + +;; definition for symbol *fact-info-manta-defaults*, type fact-info-enemy-defaults +(define *fact-info-manta-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +;; definition for symbol *manta-nav-enemy-info*, type nav-enemy-info +(define *manta-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #t + :idle-anim-script #f + :idle-anim 3 + :notice-anim 5 + :hostile-anim 8 + :hit-anim 13 + :knocked-anim 13 + :knocked-land-anim 13 + :die-anim 19 + :die-falling-anim 17 + :victory-anim 3 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 3 + :sound-hit (static-sound-name "manta-impact") + :notice-distance (meters 60) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 15) + :default-hit-points 3.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.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 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 10) + :shadow-min-y (meters -40) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 8 + :turn-anim -1 + :run-anim -1 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 0.2) + :run-turning-acceleration (meters 8) + :walk-travel-speed (meters 4) + :walk-acceleration (meters 0.1) + :walk-turning-acceleration (meters 4) + :maximum-rotation-rate (degrees 1440) + :notice-nav-radius (meters 3) + :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! (-> *manta-nav-enemy-info* fact-defaults) *fact-info-manta-defaults*) + +;; definition for method 120 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this manta)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action semi-solid deadly)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13107.2) + (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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-13 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 0.0 2048.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set-vector! (-> v1-15 local-sphere) 0.0 -4096.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 enemy)) + (set! (-> v1-17 prim-core action) (collide-action semi-solid)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3481.6) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid)) + (set! (-> v1-19 transform-index) 6) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 10) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core action) (collide-action deadly)) + (set! (-> v1-23 transform-index) 12) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (set! (-> s5-0 nav-radius) 6144.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function manta-hostile-post +;; INFO: Used lq/sq +(defbehavior manta-hostile-post manta () + (update-target-pos! self) + (let* ((s4-0 (-> self root)) + (s3-0 (-> self focus-pos)) + (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 trans) s3-0)) + ) + (set! (-> gp-1 y) 0.0) + (vector-xz-normalize! gp-1 1.0) + (vector-rotate-y! gp-1 gp-1 (* (-> self orbit-speed) (seconds-per-frame))) + (vector-xz-normalize! gp-1 81920.0) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> s4-0 trans quad)) + (let ((s5-0 (-> self dest-pos))) + (closest-point-on-mesh (-> self nav) s2-0 (-> s4-0 trans) (the-as nav-poly #f)) + (cond + ((< (vector-vector-xz-distance (-> s4-0 trans) s2-0) 4096.0) + (vector+! s5-0 s3-0 gp-1) + (closest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f)) + ) + (else + (vector+! + s5-0 + (-> s4-0 trans) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-0 trans)) 32768.0) + ) + ) + ) + (let ((v1-15 (-> self nav state))) + (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-15 target-pos quad) (-> s5-0 quad)) + ) + ) + ) + 0 + (let ((s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-normalize! gp-1 -1.0) + (set! (-> self angle-to-player) (acos (vector-dot s5-1 gp-1))) + ) + ) + 0 + (set! (-> self dest-pos y) (+ (-> self root gspot-pos y) (-> self y-offset))) + (set! (-> self offset-difference) (- (-> self dest-pos y) (-> self root trans y))) + (vector-! (-> self forward-dir) (-> self focus-pos) (-> self root trans)) + (vector-normalize! (-> self forward-dir) 1.0) + (set! (-> self up-dir quad) (-> *y-vector* quad)) + (manta-method-200 self) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-travel-post) + (none) + ) + +;; definition for function manta-attack-post +(defbehavior manta-attack-post manta () + (update-target-pos! self) + (set! (-> self offset-difference) (- (-> self root trans y) (-> self attack-pos y))) + (if (time-elapsed? (-> self attack-path-blocked-time) (seconds 1)) + (manta-method-195 self) + ) + (when (logtest? (enemy-flag ef37) (-> self enemy-flags)) + (let ((s2-0 (-> self curve-matrix)) + (f0-2 (-> self move-u)) + (a1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (a0-4 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) 0.0) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) 4096.0) + (set! (-> s5-0 w) 1.0) + (set-vector! a1-0 (* f0-2 f0-2 f0-2) (* f0-2 f0-2) f0-2 1.0) + (set-vector! s3-0 (* 3.0 f0-2 f0-2) (* 2.0 f0-2) 1.0 0.0) + (vector-matrix*! a0-4 a1-0 s2-0) + (vector-matrix*! s4-0 s3-0 s2-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (let ((f0-6 4.0)) + (vector-float*! gp-0 s4-0 f0-6) + ) + (vector-orient-by-quat! s3-1 s5-0 (-> self root quat)) + (vector+! s3-1 s3-1 (-> self root trans)) + (apply-impact! (-> self rbody) s3-1 gp-0) + ) + ) + (seek! (-> self move-u) 1.0 (* (-> self move-du) (seconds-per-frame))) + ) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-simple-post) + (none) + ) + +;; definition for function manta-fly-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior manta-fly-code manta () + (cond + ((-> self restart-fly-anims) + (ja-channel-push! 3 (seconds 0.2)) + (ja :group! manta-flap-ja) + (let ((v1-6 (-> self skel root-channel 1))) + (let ((f0-0 0.0)) + (set! (-> v1-6 frame-interp 1) f0-0) + (set! (-> v1-6 frame-interp 0) f0-0) + ) + (set! (-> v1-6 frame-group) (the-as art-joint-anim manta-flap-fast-ja)) + ) + (let ((v1-9 (-> self skel root-channel 2))) + (let ((f0-1 0.0)) + (set! (-> v1-9 frame-interp 1) f0-1) + (set! (-> v1-9 frame-interp 0) f0-1) + ) + (set! (-> v1-9 frame-group) (the-as art-joint-anim manta-flap-back-ja)) + ) + (set! (-> self restart-fly-anims) #f) + ) + (else + (ja :group! manta-flap-ja) + (let ((v1-16 (-> self skel root-channel 1))) + (let ((f0-2 0.0)) + (set! (-> v1-16 frame-interp 1) f0-2) + (set! (-> v1-16 frame-interp 0) f0-2) + ) + (set! (-> v1-16 frame-group) (the-as art-joint-anim manta-flap-fast-ja)) + ) + (let ((v1-19 (-> self skel root-channel 2))) + (let ((f0-3 0.0)) + (set! (-> v1-19 frame-interp 1) f0-3) + (set! (-> v1-19 frame-interp 0) f0-3) + ) + (set! (-> v1-19 frame-group) (the-as art-joint-anim manta-flap-back-ja)) + ) + ) + ) + (until #f + (until (ja-done? 0) + (set! (-> self go-enable) #t) + (suspend) + (set! (-> self go-enable) #f) + (let ((a0-19 (-> self skel root-channel 0))) + (let ((f0-4 1.0)) + (set! (-> a0-19 frame-interp 1) f0-4) + (set! (-> a0-19 frame-interp 0) f0-4) + ) + (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group frames num-frames) -1))) + (set! (-> a0-19 param 1) (-> self fly-anim-speed)) + (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) + ) + (let* ((f30-0 (lerp-scale 0.0 1.0 (-> self fly-anim-speed) 1.0 1.5)) + (gp-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0)) + (f28-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) gp-0)) + ) + (let ((a0-23 (-> self skel root-channel 1))) + (let ((f0-11 (fmax 0.0 (* f28-0 f30-0)))) + (set! (-> a0-23 frame-interp 1) f0-11) + (set! (-> a0-23 frame-interp 0) f0-11) + ) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) + ) + (let ((a0-24 (-> self skel root-channel 2))) + (let ((f0-14 (fmax 0.0 (* (- 1.0 f28-0) f30-0)))) + (set! (-> a0-24 frame-interp 1) f0-14) + (set! (-> a0-24 frame-interp 0) f0-14) + ) + (set! (-> a0-24 param 0) 0.0) + (joint-control-channel-group-eval! a0-24 (the-as art-joint-anim #f) num-func-chan) + ) + ) + ) + (if (rnd-chance? self 0.5) + (ja-no-eval :group! manta-flap-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (ja-no-eval :group! manta-flap1-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + ) + ) + #f + (none) + ) + +;; failed to figure out what this is: +(defstate idle (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy idle) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self draw shadow-ctrl))) + (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) + ) + 0 + (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (set! (-> self landed-pos quad) (-> self root trans quad)) + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :exit (behavior () + (let ((v1-1 (-> self draw shadow-ctrl))) + (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 1 (the-as int (-> self focus aware)))) + (go-virtual ambush) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (let ((s5-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (f28-0 (rnd-float-range self 0.5 0.3)) + (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (f30-0 (rnd-float-range self 0.5 0.3)) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! manta-idle0-ja :num! (seek! max f28-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f28-0)) + ) + ) + (dotimes (s5-1 gp-0) + (ja-no-eval :group! manta-idle1-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) + (set-time! (-> self last-draw-time)) + ) + (update-focus self) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate land-approach (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (set! (-> self dest-pos y) (+ 8192.0 (-> self default-y-offset) (-> self landed-pos y))) + (let ((a0-7 (-> self nav state)) + (v1-9 (-> self dest-pos)) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-9 quad)) + ) + 0 + (set! (-> self go-enable) #t) + (let ((v1-13 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-13 enemy-flags))) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-13 enemy-flags)))) + ) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-13 enemy-flags)))) + (set! (-> v1-13 nav callback-info) (-> v1-13 enemy-info callback-info)) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) 24576.0) + ) + 0 + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (and (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 8192.0) (-> self go-enable)) + (go-virtual land) + ) + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 1 (the-as int (-> self focus aware)))) + (go-virtual notice) + ) + (seek! (-> self fly-anim-speed) 1.0 (seconds-per-frame)) + (vector-! (-> self forward-dir) (-> self dest-pos) (-> self root trans)) + (vector-normalize! (-> self forward-dir) 1.0) + 0 + ) + :code manta-fly-code + :post (behavior () + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate land (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self flags) (manta-flags mf0)) + (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (set! (-> self dest-pos y) (+ (-> self landed-pos y) (-> self default-y-offset))) + (set! (-> self restart-fly-anims) #t) + ) + :exit (behavior () + (manta-method-206 self) + ) + :trans (behavior () + (seek! (-> self fly-anim-speed) 1.0 (seconds-per-frame)) + (vector-! (-> self forward-dir) (-> self dest-pos) (-> self root trans)) + (vector-normalize! (-> self forward-dir) 1.0) + 0 + ) + :code (behavior () + (ja-no-eval :num! (seek! max (-> self fly-anim-speed))) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 0) + (while (< 2048.0 (vector-vector-distance (-> self root trans) (-> self landed-pos))) + (ja-no-eval :group! manta-flap-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self fly-anim-speed))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! manta-land-ja :num! (seek! max 0.8) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.8)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! manta-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual dormant-aware) + ) + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-0 x) 0.0) + (set! (-> a1-0 y) -819.2) + (set! (-> a1-0 z) 0.0) + (set! (-> a1-0 w) 1.0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! gp-0 (-> self landed-pos) (-> self root trans)) + (vector-float*! gp-0 gp-0 2.0) + (vector-orient-by-quat! s5-0 a1-0 (-> self root quat)) + (vector+! s5-0 s5-0 (-> self root trans)) + (apply-impact! (-> self rbody) s5-0 gp-0) + ) + ) + (vector-seek! (-> self dest-pos) (-> self landed-pos) (* 8192.0 (seconds-per-frame))) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate active (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self orbit-speed) (* 182.04445 (rnd-float-range self 0.5 2.0))) + (let ((v1-13 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-13 enemy-flags))) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-13 enemy-flags)))) + ) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-13 enemy-flags)))) + (set! (-> v1-13 nav callback-info) (-> v1-13 enemy-info callback-info)) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) 49152.0) + ) + 0 + ) + :code manta-fly-code + :post manta-hostile-post + ) + +;; failed to figure out what this is: +(defstate ambush (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy ambush) enter))) + (if t9-0 + (t9-0) + ) + ) + (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (set! (-> self landed-pos quad) (-> self root trans quad)) + (manta-method-206 self) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self draw force-fade) (the-as uint 0)) + (set! (-> self fade-level) 0.0) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status force-fade)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 1.0 1.5))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! manta-alert-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual notice-to-fly) + ) + :post (behavior () + (seek! (-> self fade-level) 128.0 (* 196.0 (seconds-per-frame))) + (set! (-> self draw force-fade) (the-as uint (the int (-> self fade-level)))) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate notice-to-fly (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (set! (-> self fly-anim-speed) 1.5) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self dest-pos quad) (-> self root trans quad)) + (set! (-> self dest-pos y) (+ (-> self root gspot-pos y) (-> self y-offset))) + ) + :exit (behavior () + (set-time! (-> self last-attack-time)) + (set! (-> self restart-fly-anims) #t) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (ja-no-eval :group! manta-alert-to-fly-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (cond + ((< 15.0 (ja-frame-num 0)) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-simple-post) + ) + (else + (nav-enemy-simple-post) + ) + ) + (suspend) + (ja :num! (seek! max (-> self fly-anim-speed))) + ) + (ja-channel-push! 1 (seconds 0.075)) + (dotimes (gp-0 5) + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max (-> self fly-anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (seek! (-> self fly-anim-speed) 1.2 (* 0.5 (seconds-per-frame))) + (do-impact self) + (manta-method-203 self -4096.0) + (nav-enemy-simple-post) + (suspend) + (ja :num! (seek! max (-> self fly-anim-speed))) + ) + ) + (go-virtual hostile) + ) + ) + +;; failed to figure out what this is: +(defstate stare (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self orbit-speed) (* 182.04445 (rnd-float-range self 0.5 2.0))) + (let ((v1-13 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-13 enemy-flags))) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-13 enemy-flags)))) + ) + (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-13 enemy-flags)))) + (set! (-> v1-13 nav callback-info) (-> v1-13 enemy-info callback-info)) + ) + 0 + (let ((v1-16 (-> self nav))) + (set! (-> v1-16 target-speed) 49152.0) + ) + 0 + ) + :code manta-fly-code + :post manta-hostile-post + ) + +;; failed to figure out what this is: +(defstate hostile (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self flags) (manta-flags mf0)) + (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self y-offset) (-> self default-y-offset)) + (set! (-> self orbit-speed) (* 182.04445 (rnd-float-range self 0.8 2.4))) + (set! (-> self go-enable) #t) + (let ((v1-14 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-14 enemy-flags))) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-14 enemy-flags)))) + ) + (set! (-> v1-14 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-14 enemy-flags)))) + (set! (-> v1-14 nav callback-info) (-> v1-14 enemy-info callback-info)) + ) + 0 + (let ((v1-17 (-> self nav))) + (set! (-> v1-17 target-speed) 49152.0) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (-> self go-enable) (< (fabs (- (-> self focus-pos y) (-> self root gspot-pos y))) 16384.0)) + (if (and (time-elapsed? (-> self last-attack-time) (seconds 3)) + (< (fabs (-> self angle-to-player)) 6371.5557) + (< (-> self offset-difference) 12288.0) + (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 28672.0) + (< (vector-vector-distance (-> self root trans) (-> self focus-pos)) 110592.0) + (< (vector-length (-> self root transv)) 16384.0) + (let ((f0-10 (- (-> self root trans y) (-> self focus-pos y)))) + (and (and (< f0-10 24576.0) (< 0.0 f0-10)) (get-focus! self)) + ) + ) + (go-virtual attack) + ) + (if (and (time-elapsed? (-> self last-attack-time) (seconds 1)) + (< (fabs (-> self angle-to-player)) 8192.0) + (< (current-time) (+ (-> self track-timer) (seconds 0.5))) + (< (-> self offset-difference) 12288.0) + (< -4096.0 (-> self root transv y)) + ) + (go-virtual attack) + ) + ) + ) + :code manta-fly-code + :post manta-hostile-post + ) + +;; failed to figure out what this is: +(defstate attack (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-177 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self state-time)) + (set-look-at-mode! self 1) + (let ((f30-0 1.13)) + (cond + ((and (get-focus! self) (manta-method-197 self)) + (set! (-> self attack-y-offset) (+ (- 4096.0 (-> self root trans y)) (-> self focus-pos y))) + (logior! (-> self flags) (manta-flags mf1)) + ) + (else + (set! (-> self attack-y-offset) 14336.0) + ) + ) + (let* ((f0-4 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (f0-7 (/ (fmin 69632.0 (/ f0-4 f30-0)) f30-0)) + ) + (set! (-> self move-force) (* (-> self info info mass) f0-7)) + ) + (set! (-> self move-u) 0.0) + (set! (-> self move-du) (* 0.94 f30-0)) + ) + (set! (-> self attack-pos quad) (-> self focus-pos quad)) + (set! (-> self y-offset) (+ 24576.0 (-> self default-y-offset))) + (set! (-> self move-matrix rvec quad) (-> self root trans quad)) + (manta-method-195 self) + (dotimes (gp-0 (-> self actor-group-count)) + (let ((s5-0 (-> self actor-group gp-0))) + (dotimes (s4-0 (-> s5-0 length)) + (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) 'attacking) + (let ((t9-6 send-event-function) + (v1-38 (-> s5-0 data s4-0 actor)) + ) + (t9-6 + (if v1-38 + (-> v1-38 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (logclear! (-> self flags) (manta-flags mf1)) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (>= 2 (the-as int (-> self focus aware)))) + (go-stare self) + ) + (if (and (logtest? (-> self flags) (manta-flags mf1)) + (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 36864.0) + (< (fabs (- (-> self root trans y) (-> self focus-pos y))) 7782.4) + ) + (go-virtual attack-end) + ) + ) + :code (behavior () + (let ((f28-0 (-> self fly-anim-speed)) + (f30-0 1.5) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max f28-0) :frame-num 0.0) + (until (ja-done? 0) + (set! f28-0 (seek f28-0 f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max f28-0)) + ) + (if (logtest? (-> self flags) (manta-flags mf1)) + (sound-play "manta-attack") + ) + (let ((v1-29 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-29 enemy-flags))) + (set! (-> v1-29 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-29 enemy-flags)))) + ) + (set! (-> v1-29 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-29 enemy-flags)))) + (set! (-> v1-29 nav callback-info) (-> v1-29 enemy-info callback-info)) + ) + 0 + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max f28-0) :frame-num 0.0) + (until (ja-done? 0) + (set! f28-0 (seek f28-0 f30-0 (seconds-per-frame))) + (suspend) + (ja :num! (seek! max f28-0)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! manta-attack-start-ja :num! (seek! max 1.2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.2)) + ) + (ja-no-eval :group! manta-glide-end-ja :num! (seek! max 1.1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.1)) + ) + (set! (-> self restart-fly-anims) #t) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (set-time! (-> self last-attack-time)) + (go-virtual hostile) + ) + :post manta-attack-post + ) + +;; failed to figure out what this is: +(defstate attack-end (manta) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((a0-0 (-> self root root-prim))) + (set! (-> (the-as collide-shape-prim-group a0-0) child 1 prim-core action) (collide-action deadly)) + ) + (sound-play "manta-hit-jak") + ) + :exit (behavior () + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action) + (collide-action) + ) + 0 + (set! (-> self restart-fly-anims) #t) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (set-time! (-> self last-attack-time)) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (>= 2 (the-as int (-> self focus aware)))) + (go-stare self) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 1.0)) + (ja-no-eval :group! manta-attack-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual hostile) + ) + :post manta-attack-post + ) + +;; failed to figure out what this is: +(defstate knocked (manta) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self rbody flags) (rigid-body-flag enable-collision)) + (manta-method-206 self) + (set! (-> self restart-fly-anims) #t) + (set! (-> self gravity) 327680.0) + (set! (-> self hit-ground-count) (the-as uint 0)) + (set! (-> self knocked-force-mult) 1.0) + (knocked-handler self (-> self knocked-force)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self gravity) 81920.0) + ) + :trans (behavior () + (set-time! (-> self attack-path-blocked-time)) + (cond + ((!= (-> self hit-points) 0.0) + (if (and (zero? (-> self fated-time)) + (>= (-> self knocked-force-mult) 0.0) + (or (time-elapsed? (-> self state-time) (seconds 0.8)) + (and (< (-> self root trans y) (+ 8192.0 (-> self default-y-offset) (-> self root gspot-pos y))) + (< (-> self root transv y) 0.0) + ) + ) + ) + (go-virtual knocked-recover) + ) + ) + (else + (if (and (< (-> self root trans y) (+ -40960.0 (-> self default-y-offset) (-> self root gspot-pos y))) + (< (-> self root transv y) 0.0) + ) + (go-die self) + ) + ) + ) + ) + :post (behavior () + (seek! (-> self sound-volume) 0.0 (* 0.5 (seconds-per-frame))) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) (* 4096.0 (rnd-float-range self -0.3 0.3))) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* 4096.0 (rnd-float-range self -0.2 0.2))) + (set! (-> s5-0 w) 1.0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (f30-2 4.0) + ) + (vector-float*! gp-0 (-> self knocked-force) (* 2.0 (-> self knocked-force-mult) f30-2 f30-2)) + (vector-orient-by-quat! s4-0 s5-0 (-> self root quat)) + (vector+! s4-0 s4-0 (-> self root trans)) + (apply-impact! (-> self rbody) s4-0 gp-0) + (seek! (-> self knocked-force-mult) 0.0 (* f30-2 (seconds-per-frame))) + ) + ) + (let ((a1-9 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-9 start-pos quad) (-> self rbody position quad)) + (vector-float*! (-> a1-9 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) + (let ((v1-21 a1-9)) + (set! (-> v1-21 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) + (set! (-> v1-21 collide-with) (collide-spec backgnd jak bot obstacle player-list)) + (set! (-> v1-21 ignore-process0) self) + (set! (-> v1-21 ignore-process1) #f) + (set! (-> v1-21 ignore-pat) (-> self root pat-ignore-mask)) + (set! (-> v1-21 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* a1-9) + ) + (manta-method-203 self 0.0) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (manta) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self rbody flags) (rigid-body-flag enable-collision)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (gp-0 2) + (ja-no-eval :group! manta-flap-fast-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-0 start-pos quad) (-> self rbody position quad)) + (vector-float*! (-> a1-0 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) + (let ((v1-3 a1-0)) + (set! (-> v1-3 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) + (set! (-> v1-3 collide-with) (collide-spec backgnd jak bot obstacle player-list)) + (set! (-> v1-3 ignore-process0) self) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) (-> self root pat-ignore-mask)) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* a1-0) + ) + (manta-method-203 self 0.0) + (nav-enemy-simple-post) + ) + ) + +;; definition for method 80 of type manta +(defmethod go-best-state ((this manta)) + (let ((s5-0 (-> this focus aware))) + (cond + ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + (go-hostile this) + ) + ((<= (the-as int s5-0) 0) + (go (method-of-object this land-approach)) + ) + ((>= 1 (the-as int s5-0)) + (go (method-of-object this land-approach)) + ) + ((= s5-0 (enemy-aware ea4)) + (go-flee this) + ) + (else + (go-stare this) + ) + ) + ) + ) + +;; definition for method 195 of type manta +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-195 ((this manta)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (the-as vector (-> this move-matrix))))) + (set! (-> s5-1 y) (-> this attack-y-offset)) + (vector-normalize! s5-1 (-> this move-force)) + (set! (-> this move-matrix fvec quad) (-> s5-1 quad)) + (vector+! (-> this move-matrix uvec) (the-as vector (-> this move-matrix)) s5-1) + ) + (vector-! (-> this move-matrix trans) (-> this focus-pos) (-> this move-matrix uvec)) + (vector-normalize! (-> this move-matrix trans) 24576.0) + (set! (-> this move-matrix trans y) (* -0.5 (-> this move-matrix trans y))) + (matrix*! (-> this curve-matrix) *hermite-matrix* (-> this move-matrix)) + 0 + (none) + ) + +;; definition for method 196 of type manta +;; INFO: Used lq/sq +(defmethod manta-method-196 ((this manta)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> this root trans quad)) + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) + ) + (when (and s4-0 (< (vector-vector-xz-distance s5-0 s3-0) 4096.0)) + (let ((s3-2 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) s5-0))) + (vector-length s3-2) + (let ((s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info))) + (vector-float*! s3-2 s3-2 1.3) + (clamp-vector-to-mesh-no-gaps (-> this nav) s5-0 s4-0 s3-2 s2-0) + (if (-> s2-0 found-boundary) + #f + #t + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 113 of type manta +(defmethod get-focus! ((this manta)) + (let* ((t9-0 (method-of-type nav-enemy get-focus!)) + (v0-0 (t9-0 this)) + ) + (cond + ((and v0-0 (time-elapsed? (-> this attack-path-blocked-time) (seconds 1))) + (empty) + v0-0 + ) + (else + (the-as process-focusable #f) + ) + ) + ) + ) + +;; definition for method 197 of type manta +;; WARN: Return type mismatch symbol vs none. +(defmethod manta-method-197 ((this manta)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) + (let ((gp-0 (camera-matrix))) + (camera-pos) + (let* ((s4-0 (-> this focus-pos)) + (gp-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> gp-0 fvec) 1.0)) + (v1-6 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s4-0) 1.0)) + ) + (< 0.0 (vector-dot gp-1 v1-6)) + ) + ) + ) + (none) + ) + +;; definition for method 89 of type manta +(defmethod within-gspot-range? ((this manta)) + #f + ) + +;; definition for method 88 of type manta +(defmethod enemy-method-88 ((this manta) (arg0 enemy-knocked-info)) + (let ((v1-0 (-> this root))) + (or (>= (-> arg0 on-surface-count) 3) + (>= (-> this hit-ground-count) (the-as uint 1)) + (and (logtest? (-> v1-0 status) (collide-status on-ground)) (>= 16384.0 (-> v1-0 transv y))) + ) + ) + ) + +;; definition for method 198 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-198 ((this manta)) + (let ((a1-0 (-> this info name))) + (when (nonzero? a1-0) + (set! (-> this info) (the-as rigid-body-object-constants (-> a1-0 value))) + (set! (-> this rbody info) (-> this info info)) + ) + ) + (rigid-body-info-method-9 (-> this info info)) + 0 + (none) + ) + +;; definition for method 199 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-199 ((this manta)) + 0 + (none) + ) + +;; definition for method 200 of type manta +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-200 ((this manta)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (-> this root root-prim prim-core)) + ) + (set! (-> s3-0 quad) (-> s5-0 world-sphere quad)) + (set! (-> s3-0 w) (-> s5-0 world-sphere w)) + (let ((s4-0 544)) + (set! *actor-list-length* 0) + (if (logtest? s4-0 512) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (the-as bounding-box s3-0) *actor-list* 256)) + ) + (when (logtest? s4-0 1024) + (let ((a0-4 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-14 (-> a0-4 next0))) + (while (!= a0-4 (-> *collide-player-list* alive-list-end)) + (let* ((a0-5 (-> (the-as connection a0-4) param1)) + (a1-1 (-> (the-as collide-shape a0-5) 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 s3-0) + ) + (.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-1 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-1 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-5)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-4 v1-14) + *collide-player-list* + (set! v1-14 (-> v1-14 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 256) + (let ((a0-7 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-22 (-> a0-7 next0))) + (while (!= a0-7 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-8 (-> (the-as connection a0-7) param1)) + (a1-13 (-> (the-as collide-shape a0-8) 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 s3-0) + ) + (.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-2 a2-12) + (f1-5 (+ (-> a1-14 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-2 (* f1-5 f1-5)) + (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-22) + *collide-hit-by-player-list* + (set! v1-22 (-> v1-22 next0)) + ) + ) + ) + ) + (dotimes (s3-1 *actor-list-length*) + (let ((v1-27 (-> *actor-list* s3-1))) + (when (logtest? (the-as collide-spec s4-0) (-> v1-27 root-prim prim-core collide-as)) + (when (!= v1-27 (-> this root)) + (let* ((s2-1 + (vector-! (new 'stack-no-clear 'vector) (the-as vector s5-0) (the-as vector (-> v1-27 root-prim prim-core))) + ) + (f0-3 (vector-length s2-1)) + ) + (when (< 40.96 f0-3) + (let ((f0-6 (lerp-scale 131072.0 0.0 f0-3 2048.0 (* 1.5 (-> s5-0 world-sphere w))))) + (vector-normalize! s2-1 f0-6) + ) + (add-force! (-> this rbody) s2-1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 201 of type manta +;; INFO: Used lq/sq +(defmethod manta-method-201 ((this manta) (arg0 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'matrix 2))) + (set! (-> gp-0 0 rvec quad) (-> this move-vel quad)) + (vector-normalize! + (the-as vector (-> gp-0 0)) + (vector-vector-distance (-> this dest-pos) (-> this root trans)) + ) + (let ((v1-2 (-> gp-0 1))) + (set! (-> v1-2 rvec x) 0.0) + (set! (-> v1-2 rvec y) 0.0) + (set! (-> v1-2 rvec z) 4096.0) + (set! (-> v1-2 rvec w) 1.0) + ) + (set-vector! (-> gp-0 1 uvec) 0.0 16384.0 0.0 1.0) + (set! (-> gp-0 0 uvec quad) (-> gp-0 0 rvec quad)) + (set! (-> gp-0 0 uvec y) 0.0) + (let* ((v1-5 (-> gp-0 0)) + (f30-0 (sqrtf (+ (* (-> v1-5 rvec x) (-> v1-5 rvec x)) (* (-> v1-5 rvec z) (-> v1-5 rvec z))))) + (f0-13 (lerp-scale 0.0 49152.0 f30-0 4096.0 61440.0)) + (f0-15 (/ (* (-> this info info mass) f0-13 f0-13) (* 2.0 f30-0))) + ) + (vector-normalize! (-> gp-0 0 uvec) (fmin arg0 f0-15)) + ) + (set! (-> this fly-anim-speed) (lerp-scale 1.0 1.5 (vector-length (-> gp-0 0 uvec)) 0.0 32768.0)) + (if (and (< (vector-dot (-> gp-0 0 uvec) (-> this forward-dir)) 0.0) + (let ((v1-15 (-> gp-0 0))) + (< (sqrtf (+ (* (-> v1-15 rvec x) (-> v1-15 rvec x)) (* (-> v1-15 rvec z) (-> v1-15 rvec z)))) 131072.0) + ) + ) + (set! (-> gp-0 1 rvec z) (* -1.0 (-> gp-0 1 rvec z))) + ) + (vector-float*! (-> gp-0 0 fvec) (-> gp-0 0 uvec) 4.0) + (vector-float*! (-> gp-0 0 trans) (-> gp-0 0 uvec) 0.5) + (vector-orient-by-quat! (-> gp-0 1 fvec) (the-as vector (-> gp-0 1)) (-> this root quat)) + (vector+! (-> gp-0 1 fvec) (-> gp-0 1 fvec) (-> this root trans)) + (apply-impact! (-> this rbody) (-> gp-0 1 fvec) (-> gp-0 0 fvec)) + (vector-orient-by-quat! (-> gp-0 1 fvec) (-> gp-0 1 uvec) (-> this root quat)) + (vector+! (-> gp-0 1 fvec) (-> gp-0 1 fvec) (-> this root trans)) + (apply-impact! (-> this rbody) (-> gp-0 1 fvec) (-> gp-0 0 trans)) + (when (logtest? (-> this flags) (manta-flags mf0)) + (let* ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans))) + (t9-9 lerp-scale) + (a0-27 32768.0) + (a1-16 0.0) + (v1-36 (-> gp-0 0)) + (f30-1 (t9-9 + a0-27 + a1-16 + (sqrtf (+ (* (-> v1-36 rvec x) (-> v1-36 rvec x)) (* (-> v1-36 rvec z) (-> v1-36 rvec z)))) + 4096.0 + 61440.0 + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-1 x) 0.0) + (set! (-> s3-1 y) 0.0) + (set! (-> s3-1 z) 10240.0) + (set! (-> s3-1 w) 1.0) + (let ((f30-2 + (* f30-1 + (lerp-scale + 0.5 + 1.0 + (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) (-> this forward-dir)) + 1.0 + -1.0 + ) + ) + ) + ) + (vector-orient-by-quat! (-> gp-0 1 fvec) s3-1 (-> this root quat)) + (vector+! (-> gp-0 1 fvec) (-> gp-0 1 fvec) (-> this root trans)) + (apply-impact! + (-> this rbody) + (-> gp-0 1 fvec) + (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 f30-2) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 202 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod do-impact ((this manta)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f0-1 (* (-> this rbody info mass) (-> this gravity))) + (f1-2 (fmax 0.0 (fmin 1.0 (/ (- (-> this dest-pos y) (-> this root trans y)) (-> this y-offset))))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 x) 0.0) + (set! (-> s4-0 y) 12288.0) + (set! (-> s4-0 z) 0.0) + (set! (-> s4-0 w) 1.0) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-reset! gp-0) + (set! (-> gp-0 y) (fmax 0.0 (fmin 450560.0 (* 4.0 f0-1 f1-2)))) + (set! (-> this fly-anim-speed) (fmax (lerp-scale 1.0 1.5 f1-2 0.35 0.6) (-> this fly-anim-speed))) + (vector-orient-by-quat! s3-0 s4-0 (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) + (apply-impact! (-> this rbody) s3-0 gp-0) + ) + ) + 0 + (none) + ) + +;; definition for method 203 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-203 ((this manta) (arg0 float)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 x) 0.0) + (set! (-> v1-0 y) arg0) + (set! (-> v1-0 z) 0.0) + (set! (-> v1-0 w) 1.0) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-reset! gp-0) + (set! (-> gp-0 y) (* -1.0 (-> this gravity) (-> this rbody info mass))) + (vector-orient-by-quat! s4-0 v1-0 (-> this root quat)) + (vector+! s4-0 s4-0 (-> this root trans)) + (apply-impact! (-> this rbody) s4-0 gp-0) + ) + ) + 0 + (none) + ) + +;; definition for method 204 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-204 ((this manta)) + (rigid-body-control-method-10 + (-> this rbody) + (the-as rigid-body-object this) + (seconds-per-frame) + (-> this max-time-step) + ) + 0 + (none) + ) + +;; definition for method 161 of type manta +;; INFO: Used lq/sq +(defmethod nav-enemy-method-161 ((this manta) (arg0 nav-control)) + (let ((a2-0 (-> arg0 state))) + (set! (-> this move-vel quad) (-> a2-0 velocity quad)) + ) + (manta-method-201 this 201326600.0) + (none) + ) + +;; definition for method 160 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this manta) (arg0 nav-control)) + 0 + (none) + ) + +;; definition for method 208 of type manta +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-208 ((this manta)) + (cond + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + ) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) + (f30-0 81920.0) + ) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) + (let ((v1-12 s4-0)) + (set! (-> v1-12 radius) 3276.8) + (set! (-> v1-12 collide-with) (collide-spec backgnd)) + (set! (-> v1-12 ignore-process0) this) + (set! (-> v1-12 ignore-process1) #f) + (set! (-> v1-12 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-12 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f0-1 0.0) + (let ((v1-16 (-> this draw shadow-ctrl))) + (logclear! (-> v1-16 settings flags) (shadow-flags disable-draw)) + ) + 0 + (-> s4-0 best-other-tri intersect) + (let ((a1-3 (-> this root trans))) + (-> a1-3 y) + (let ((f1-2 (* f0-1 f30-0))) + (shadow-control-method-14 + (-> this draw shadow-ctrl) + a1-3 + gp-0 + (fmax 32768.0 (* 409600.0 f0-1)) + (+ -12288.0 f1-2) + (+ 12288.0 f1-2) + ) + ) + ) + ) + (else + (let ((v1-28 (-> this draw shadow-ctrl))) + (logior! (-> v1-28 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + ) + ) + (else + (let ((v1-31 (-> this draw shadow-ctrl))) + (logior! (-> v1-31 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 59 of type manta +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this manta)) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (set-ground-pat! + this + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + ) + ) + (else + (let ((s5-0 (-> this nav)) + (s3-0 (-> this root trans)) + (s4-0 (new 'stack 'nav-find-poly-parms)) + ) + (vector-! (-> s4-0 point) s3-0 (the-as vector (-> s5-0 state mesh bounds))) + (set! (-> s4-0 y-threshold) (-> s5-0 nearest-y-threshold)) + (set! (-> s4-0 ignore) (the-as uint 2)) + (nav-mesh-method-46 (-> s5-0 state mesh) (the-as nav-poly s4-0)) + (let ((v1-16 (-> s4-0 poly))) + (if v1-16 + (set! (-> this root gspot-pos y) (+ (-> v1-16 vertex0 y) (-> this nav state mesh bounds y))) + ) + ) + ) + ) + ) + (manta-method-204 this) + (update-rbody-transform! (-> this rbody) (-> this root)) + (manta-method-208 this) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 82 of type manta +;; WARN: disable def twice: 150. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +;; WARN: disable def twice: 100. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this manta) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 object)) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + ) + (('impact-impulse) + (let ((v1-27 (-> arg3 param 0))) + (when (and (< 0.8 (vector-dot (the-as vector (+ v1-27 16)) *y-vector*)) + (< (vector-dot (the-as vector (+ v1-27 16)) (the-as vector (+ v1-27 32))) -0.8) + ) + (set! v0-4 (+ (-> this hit-ground-count) 1)) + (set! (-> this hit-ground-count) (the-as uint v0-4)) + v0-4 + ) + ) + ) + (('tracked) + (set! v0-4 (current-time)) + (set! (-> this track-timer) (the-as time-frame v0-4)) + v0-4 + ) + (('cue-chase 'trigger) + (if (and (-> this next-state) (let ((v1-37 (-> this next-state name))) + (or (= v1-37 'idle) (= v1-37 'dormant-aware) (= v1-37 'dormant)) + ) + ) + (go (method-of-object this ambush)) + ) + ) + (('attacking) + (when (and (!= arg0 this) (time-elapsed? (-> this last-attack-time) (seconds 1))) + (set! v0-4 (+ (current-time) (seconds -1))) + (set! (-> this last-attack-time) (the-as time-frame v0-4)) + v0-4 + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 205 of type manta +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod update-target-pos! ((this manta)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (cond + (a0-2 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (if (not (manta-method-196 this)) + (set-time! (-> this attack-path-blocked-time)) + ) + ) + (else + (set! (-> this focus-pos quad) (-> (target-pos 0) quad)) + (set! (-> this dest-pos quad) (-> this root trans quad)) + ) + ) + ) + (none) + ) + +;; definition for method 50 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this manta) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-2 (-> this root root-prim))) + (let ((a0-1 v1-2)) + (set! (-> a0-1 prim-core action) (collide-action solid deadly)) + (set! (-> a0-1 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) + ) + (let ((v1-4 (-> (the-as collide-shape-prim-group v1-2) child 0))) + (set! (-> v1-4 prim-core action) (collide-action solid deadly)) + (set! (-> v1-4 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) + (set! (-> v1-4 local-sphere w) 6144.0) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (let ((v1-8 (-> this root root-prim))) + (let ((a0-5 v1-8)) + (set! (-> a0-5 prim-core action) (collide-action semi-solid deadly)) + (set! (-> a0-5 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + ) + (let ((v1-10 (-> (the-as collide-shape-prim-group v1-8) child 0))) + (set! (-> v1-10 prim-core action) (collide-action semi-solid deadly)) + (set! (-> v1-10 prim-core collide-with) (collide-spec backgnd jak bot player-list)) + (set! (-> v1-10 local-sphere w) 2048.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 87 of type manta +(defmethod knocked-anim-handler ((this manta) (arg0 int) (arg1 enemy-knocked-info)) + (case arg0 + ((1) + (let ((s5-0 (ja-done? 0))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) + ) + (when (and s5-0 (= (-> this hit-points) 0.0)) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-4 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (set! (-> a0-4 frame-num) 8.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type nav-enemy knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +;; definition for method 85 of type manta +(defmethod knocked-anim ((this manta) (arg0 enemy-knocked-info)) + (cond + ((= (-> this hit-points) 0.0) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> arg0 anim-speed) 0.5) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) + ) + #t + ) + ((let ((v1-15 (-> this incoming knocked-type))) + (= v1-15 (knocked-type blue-shot)) + ) + (ja-channel-push! 1 0) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) + (set! (-> a0-5 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) + ) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) + (set! (-> a0-7 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) + ) + (set! (-> a0-7 param 1) (-> arg0 anim-speed)) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) + ) + #t + ) + ) + ) + +;; definition for method 86 of type manta +(defmethod knocked-land-anim ((this manta) (arg0 enemy-knocked-info)) + (set! (-> arg0 anim-speed) 0.5) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) + (set! (-> a0-2 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) + ) + (set! (-> a0-2 param 1) (-> arg0 anim-speed)) + (set! (-> a0-2 frame-num) 0.0) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) + ) + #t + ) + +;; definition for method 206 of type manta +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manta-method-206 ((this manta)) + (rigid-body-control-method-28 (-> this rbody) (-> this root trans) (-> this root quat)) + (let ((v1-4 (-> this rbody))) + (set! (-> v1-4 force quad) (the-as uint128 0)) + (set! (-> v1-4 torque quad) (the-as uint128 0)) + ) + 0 + (reset-momentum! (-> this rbody)) + 0 + (none) + ) + +;; definition for method 207 of type manta +;; WARN: Return type mismatch int vs none. +(defmethod alloc-rbody! ((this manta) (arg0 rigid-body-object-constants)) + (set! (-> this info) arg0) + (set! (-> this rbody) (new 'process 'rigid-body-control this)) + (update-transforms (-> this root)) + (init! + (-> this rbody) + (-> this info info) + (-> this root trans) + (-> this root quat) + (the-as (function rigid-body-object float) (method-of-object this manta-method-199)) + ) + (manta-method-198 this) + (set! (-> this max-time-step) (-> arg0 extra max-time-step)) + (set! (-> this root max-iteration-count) (the-as uint 4)) + 0 + (none) + ) + +;; definition for method 121 of type manta +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this manta)) + (local-vars (sv-16 res-tag)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-manta" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *manta-nav-enemy-info*) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) + ) + (alloc-rbody! this *manta-rigid-body-constants*) + (set! (-> this flags) (manta-flags)) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing use-momentum)) + (let ((v1-13 (-> this neck))) + (set! (-> v1-13 up) (the-as uint 1)) + (set! (-> v1-13 nose) (the-as uint 2)) + (set! (-> v1-13 ear) (the-as uint 0)) + (set-vector! (-> v1-13 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-13 ignore-angle) 30947.555) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-16)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this default-y-offset) (res-lump-float (-> this entity) 'y-offset :default 32768.0)) + (set! (-> this root dynam gravity y) 81920.0) + (set! (-> this root dynam gravity-length) 81920.0) + (set! (-> this root dynam gravity-max) 81920.0) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) + (set! (-> this go-enable) #t) + (set! (-> this up-dir quad) (-> *y-vector* quad)) + (set! (-> this forward-dir quad) (-> *z-vector* quad)) + (set! (-> this last-attack-time) 0) + (set! (-> this attack-path-blocked-time) 0) + (set! (-> this track-timer) 0) + (set! (-> this gravity) 81920.0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mine-mood_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-mood_REF.gc new file mode 100644 index 0000000000..7bedc5b228 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mine-mood_REF.gc @@ -0,0 +1,219 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function init-mood-minea +(defun init-mood-minea ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 1))) + (let ((a1-0 (-> v1-0 dir0))) + (set! (-> a1-0 direction x) 0.0) + (set! (-> a1-0 direction y) 1.0) + (set! (-> a1-0 direction z) 0.0) + (set! (-> a1-0 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 dir0 extra x) 0.25) + (set! (-> v1-0 dir1 extra x) 0.0) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 0.25) + ) + (let ((v1-2 (-> arg0 light-group 2))) + (let ((a1-5 (-> v1-2 dir0))) + (set! (-> a1-5 direction x) 0.0) + (set! (-> a1-5 direction y) 1.0) + (set! (-> a1-5 direction z) 0.0) + (set! (-> a1-5 direction w) 0.0) + ) + (set-vector! (-> v1-2 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-2 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-2 dir0 extra x) 0.75) + (set! (-> v1-2 dir1 extra x) 0.0) + (set! (-> v1-2 dir2 extra x) 0.0) + (set! (-> v1-2 ambi extra x) 0.25) + ) + (let ((v1-4 (-> arg0 light-group 3))) + (let ((a0-1 (-> v1-4 dir0))) + (set! (-> a0-1 direction x) -0.2357) + (set! (-> a0-1 direction y) 0.9428) + (set! (-> a0-1 direction z) -0.2357) + (set! (-> a0-1 direction w) 0.0) + ) + (set-vector! (-> v1-4 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-4 ambi color) 0.3 0.25 0.4 1.0) + (set! (-> v1-4 dir0 extra x) 0.75) + (set! (-> v1-4 dir1 extra x) 0.0) + (set! (-> v1-4 dir2 extra x) 0.0) + (set! (-> v1-4 ambi extra x) 0.5) + ) + ) + +;; definition for function update-mood-minea +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-minea time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (set! (-> arg0 times 0 w) 1.0) + ) + 0 + (none) + ) + +;; definition of type mineb-light-state +(deftype mineb-light-state (structure) + ((current float) + (target float) + ) + ) + +;; definition for method 3 of type mineb-light-state +(defmethod inspect ((this mineb-light-state)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mineb-light-state) + (format #t "~1Tcurrent: ~f~%" (-> this current)) + (format #t "~1Ttarget: ~f~%" (-> this target)) + (label cfg-4) + this + ) + +;; definition of type mineb-states +(deftype mineb-states (structure) + ((lights mineb-light-state 3 :inline) + ) + ) + +;; definition for method 3 of type mineb-states +(defmethod inspect ((this mineb-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mineb-states) + (format #t "~1Tlights[3] @ #x~X~%" (-> this lights)) + (label cfg-4) + this + ) + +;; definition for function init-mood-mineb +;; WARN: Return type mismatch symbol vs float. +(defun init-mood-mineb ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (dotimes (a0-1 3) + (set! (-> (&+ v1-0 (* a0-1 16)) 0) (the-as uint 0.0)) + (set! (-> (&+ v1-0 (* a0-1 16)) 1) (the-as uint 0.0)) + ) + ) + (the-as float #f) + ) + +;; definition for function update-mood-mineb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mineb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (let ((v1-0 (-> arg0 light-group))) + (set! (-> v1-0 0 dir0 extra x) 0.8) + (set! (-> v1-0 0 ambi extra x) 0.8) + ) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (-> arg0 state))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) (the-as float (-> gp-0 0))) + (set! (-> arg0 times 2 w) (the-as float (-> gp-0 4))) + (set! (-> arg0 times 3 w) (the-as float (-> gp-0 8))) + (when (not (paused?)) + (dotimes (s5-1 3) + (set! (-> (&+ gp-0 (* s5-1 16)) 0) + (the-as + uint + (seek (the-as float (-> (&+ gp-0 (* s5-1 16)) 0)) (the-as float (-> (&+ gp-0 (* s5-1 16)) 1)) 0.05) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-mineb-lights! +;; WARN: Return type mismatch float vs none. +(defun set-mineb-lights! ((arg0 int) (arg1 float)) + (let ((v1-1 (level-get *level* 'mineb))) + (when (and v1-1 (= (-> v1-1 status) 'active)) + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> (&+ v1-2 (* arg0 16)) 1) (the-as uint arg1)) + (if (= arg1 0.0) + (set! (-> (&+ v1-2 (* arg0 16)) 0) (the-as uint arg1)) + ) + ) + ) + ) + (none) + ) + +;; definition of type minec-states +(deftype minec-states (structure) + ((light light-state :inline) + (electricity electricity-state :inline) + ) + ) + +;; definition for method 3 of type minec-states +(defmethod inspect ((this minec-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'minec-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Telectricity: #~%" (-> this electricity)) + (label cfg-4) + this + ) + +;; definition for function init-mood-minec +(defun init-mood-minec ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state)) + (f0-0 0.0) + ) + (set! (-> v1-0 3) (the-as uint f0-0)) + f0-0 + ) + ) + +;; definition for function update-mood-minec +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-minec time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (-> arg0 state))) + (set! (-> arg0 times 6 w) 1.0) + (update-mood-light arg0 5 0 -1.0 0.0 arg1 0.0 2.0) + (cond + ((!= (the-as float (-> s4-1 3)) 0.0) + (update-mood-electricity arg0 7 8 1.2 1.7) + ) + ((or (>= arg1 18.0) (>= 6.0 arg1)) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mine-obs-h_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-obs-h_REF.gc new file mode 100644 index 0000000000..8e4b1f21d4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mine-obs-h_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc new file mode 100644 index 0000000000..450c41918b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc @@ -0,0 +1,2415 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function mineb-activate +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun mineb-activate () + (local-vars (sv-16 res-tag)) + (let ((a0-1 (entity-by-name "minb-part-1"))) + (when a0-1 + (let ((gp-0 (the-as (pointer actor-group) #f)) + (s5-0 0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data a0-1 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! gp-0 v1-2) + (set! s5-0 (the-as int (-> sv-16 elt-count))) + ) + ) + (when (> s5-0 0) + (dotimes (s5-1 (-> gp-0 0 length)) + (let ((a0-7 (-> gp-0 0 data s5-1 actor))) + (if a0-7 + (toggle-status (the-as entity-actor a0-7) (entity-perm-status subtask-complete) #t) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type rat-light-manager +(deftype rat-light-manager (process) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + ) + (:methods + (rat-light-manager-method-15 (_type_ int int symbol) none) + (rat-light-manager-method-16 (_type_ int symbol) none) + ) + ) + +;; definition for method 3 of type rat-light-manager +(defmethod inspect ((this rat-light-manager)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate idle (rat-light-manager) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('enter) + (rat-light-manager-method-16 self (command-get-int (-> block param 0) 0) #t) + ) + (('exit) + (rat-light-manager-method-16 self (command-get-int (-> block param 0) 0) #f) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 12 of type rat-light-manager +(defmethod run-logic? ((this rat-light-manager)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 15 of type rat-light-manager +;; WARN: Return type mismatch int vs none. +(defmethod rat-light-manager-method-15 ((this rat-light-manager) (arg0 int) (arg1 int) (arg2 symbol)) + (let ((v1-5 (-> this actor-group 0 data arg0 actor extra perm))) + (logior! (-> v1-5 status) (entity-perm-status bit-5)) + (set! (-> v1-5 user-object 0) (if arg2 + 1 + 0 + ) + ) + (if arg2 + (set-mineb-lights! arg1 (if (logtest? (-> v1-5 status) (entity-perm-status subtask-complete)) + 1.0 + 0.0 + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type rat-light-manager +;; WARN: Return type mismatch int vs none. +(defmethod rat-light-manager-method-16 ((this rat-light-manager) (arg0 int) (arg1 symbol)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (if arg1 + (rat-light-manager-method-15 this 0 0 #t) + ) + ) + ((= v1-0 1) + (if arg1 + (rat-light-manager-method-15 this 1 1 #t) + ) + ) + ((= v1-0 2) + (if arg1 + (rat-light-manager-method-15 this 2 2 #t) + ) + ) + ((= v1-0 3) + (cond + (arg1 + (rat-light-manager-method-15 this 0 0 #f) + (rat-light-manager-method-15 this 3 0 #t) + ) + (else + (rat-light-manager-method-15 this 0 0 #t) + (rat-light-manager-method-15 this 3 0 #f) + ) + ) + ) + ((= v1-0 4) + (cond + (arg1 + (rat-light-manager-method-15 this 1 1 #f) + (rat-light-manager-method-15 this 4 1 #t) + ) + (else + (rat-light-manager-method-15 this 1 1 #t) + (rat-light-manager-method-15 this 4 1 #f) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type rat-light-manager +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this rat-light-manager) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (dotimes (s5-0 5) + (rat-light-manager-method-16 this s5-0 #f) + ) + (go (method-of-object this idle)) + ) + +;; definition of type min-rat-engine +(deftype min-rat-engine (process-drawable) + ((root collide-shape-moving :override) + (init-quat quaternion :inline) + (force-pos vector :inline) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (rot-speed float) + (ang-momentum float) + (rat-timer time-frame) + (notify-actor entity-actor) + (sound-id sound-id) + (rat-sound-id sound-id) + (rat-wheel-sound-id sound-id) + (light-index uint32) + (light-target float) + (wheel-angle float) + (wheel-sound-volume float) + (last-turn-time time-frame) + (rat-count uint32) + ) + (:state-methods + inactive + active + running + shutdown + ) + (:methods + (min-rat-engine-method-24 (_type_) none) + (min-rat-engine-method-25 (_type_) none) + (min-rat-engine-method-26 (_type_ float float float float) symbol) + (min-rat-engine-method-27 (_type_ process focus) none) + (min-rat-engine-method-28 (_type_) none) + ) + ) + +;; definition for method 3 of type min-rat-engine +(defmethod inspect ((this min-rat-engine)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tforce-pos: #~%" (-> this force-pos)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Trot-speed: ~f~%" (-> this rot-speed)) + (format #t "~2Tang-momentum: ~f~%" (-> this ang-momentum)) + (format #t "~2Trat-timer: ~D~%" (-> this rat-timer)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Trat-sound-id: ~D~%" (-> this rat-sound-id)) + (format #t "~2Trat-wheel-sound-id: ~D~%" (-> this rat-wheel-sound-id)) + (format #t "~2Tlight-index: ~D~%" (-> this light-index)) + (format #t "~2Tlight-target: ~f~%" (-> this light-target)) + (format #t "~2Twheel-angle: ~f~%" (-> this wheel-angle)) + (format #t "~2Twheel-sound-volume: ~f~%" (-> this wheel-sound-volume)) + (format #t "~2Tlast-turn-time: ~D~%" (-> this last-turn-time)) + (format #t "~2Trat-count: ~D~%" (-> this rat-count)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-rat-engine min-rat-engine min-rat-engine-lod0-jg min-rat-engine-idle-ja + ((min-rat-engine-lod0-mg (meters 20)) (min-rat-engine-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 3 11) + :origin-joint-index 5 + ) + +;; definition for method 24 of type min-rat-engine +;; WARN: Return type mismatch collide-shape vs none. +(defmethod min-rat-engine-method-24 ((this min-rat-engine)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 9011.2 30720.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) -13516.8 6553.6 -16384.0 9830.4) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) -1638.4 13926.4 -13926.4 22118.4) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 13516.8 40960.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> this root) (the-as collide-shape-moving s5-0)) + ) + (none) + ) + +;; definition for function min-rat-engine-handler +(defbehavior min-rat-engine-handler min-rat-engine ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('ridden) + (min-rat-engine-method-27 self arg0 (the-as focus (-> arg3 param 0))) + ) + (('inside?) + (if (min-rat-engine-method-26 self (the-as float arg0) 25395.2 21299.2 8192.0) + #t + ) + ) + (('near?) + (if (min-rat-engine-method-26 self (the-as float arg0) 30720.0 24780.8 32768.0) + #t + ) + ) + (('wait-pos) + (let ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node min-rat-engine-lod0-jg ratrotation))) + (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self init-quat))) + ) + (vector+float*! (the-as vector (-> arg3 param 0)) s5-0 v1-7 32768.0) + ) + ) + (('run-dir) + (vector-normalize! + (vector-cross! + (the-as vector (-> arg3 param 0)) + *y-vector* + (vector-z-quaternion! (the-as vector (-> arg3 param 0)) (-> self root quat)) + ) + 1.0 + ) + ) + (('run-pos) + (let* ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node min-rat-engine-lod0-jg ratrotation))) + (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self init-quat))) + (s5-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self init-quat))) + (s3-2 (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> arg3 param 0)) s2-0) + s1-0 + ) + ) + (gp-0 (the-as object (-> arg3 param 1))) + ) + (let ((f30-0 2.0)) + (vector+float*! (the-as vector gp-0) s2-0 s1-0 12288.0) + (+! (-> s3-2 y) -8192.0) + (vector-normalize! s3-2 20480.0) + (vector+! (the-as vector gp-0) (the-as vector gp-0) s3-2) + (vector+float*! + (the-as vector gp-0) + (the-as vector gp-0) + s5-2 + (* 4096.0 + (+ 0.3 + (* 1.5 (sin (* 65536.0 (/ (the float (mod (current-time) (the int (* 300.0 f30-0)))) (* 300.0 f30-0))))) + ) + ) + ) + ) + gp-0 + ) + ) + (('run-up) + (let* ((a0-28 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node min-rat-engine-lod0-jg ratrotation))) + (a1-26 (vector-flatten! + (new 'stack-no-clear 'vector) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> arg3 param 0)) a0-28) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + ) + ) + ) + (vector-normalize-copy! (the-as vector (-> arg3 param 1)) a1-26 -1.0) + ) + ) + ) + ) + +;; definition for function min-rat-engine-post +(defbehavior min-rat-engine-post min-rat-engine () + (let ((v1-2 (-> self entity extra perm))) + (when (logtest? (-> v1-2 status) (entity-perm-status bit-5)) + (if (= (-> v1-2 user-object 0) 1) + (set-mineb-lights! (the-as int (-> self light-index)) (-> self light-target)) + ) + ) + ) + (min-rat-engine-method-28 self) + (min-rat-engine-method-25 self) + (rider-post) + (none) + ) + +;; failed to figure out what this is: +(defstate inactive (min-rat-engine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual running) + ) + (('turn) + (go-virtual running) + ) + (('claim-wheel?) + (let ((v1-6 (+ (-> self rat-count) 1))) + (set! (-> self rat-count) v1-6) + (= v1-6 1) + ) + ) + (else + (min-rat-engine-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self force-pos quad) (-> self root trans quad)) + ) + :trans (behavior () + (if (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 204800.0) + (go-virtual active) + ) + ) + :code sleep-code + :post (behavior () + (min-rat-engine-method-28 self) + (if (< 0.0 (-> self ang-momentum)) + (ja-post) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (min-rat-engine) + :virtual #t + :event (-> (method-of-type min-rat-engine inactive) event) + :trans (behavior () + (set! (-> self force-pos quad) (-> self root trans quad)) + (rider-trans) + (if (< 245760.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) + (go-virtual inactive) + ) + ) + :code (behavior () + (sleep-code) + ) + :post (behavior () + (min-rat-engine-post) + ) + ) + +;; failed to figure out what this is: +(defstate running (min-rat-engine) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('turn) + (let ((f0-0 2.0)) + (seek! + (-> self ang-momentum) + (* 8192.0 + (+ -91.68 + (* 16.68 (sin (* 65536.0 (/ (the float (mod (current-time) (the int (* 300.0 f0-0)))) (* 300.0 f0-0))))) + ) + ) + (* 409600.0 (seconds-per-frame)) + ) + ) + (let ((v0-2 (the-as object (current-time)))) + (set! (-> self last-turn-time) (the-as time-frame v0-2)) + v0-2 + ) + ) + (('running?) + #t + ) + (else + (min-rat-engine-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set! (-> self rot-speed) 0.0) + (set-time! (-> self state-time)) + (set-time! (-> self last-turn-time)) + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-10 (-> self notify-actor)) + ) + (t9-0 + (if v1-10 + (-> v1-10 extra process) + ) + a1-0 + ) + ) + ) + (dotimes (gp-0 (+ (-> self actor-group-count) -1)) + (let ((s5-0 (-> self actor-group gp-0))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-1 send-event-function) + (v1-19 (-> s5-0 data s4-0 actor)) + ) + (t9-1 + (if v1-19 + (-> v1-19 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + ) + (let ((v1-32 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-32 prim-core action) (collide-action solid)) + (set! (-> v1-32 prim-core collide-as) (collide-spec obstacle camera-blocker)) + ) + (sound-play "rat-wheel-raise") + (set! (-> self wheel-sound-volume) 0.0) + ) + :trans (behavior () + (rider-trans) + (if (time-elapsed? (-> self last-turn-time) (seconds 0.5)) + (go-virtual shutdown) + ) + ) + :code (behavior () + (ja-no-eval :group! min-rat-engine-raise-ja :num! (seek! max 0.04) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.04)) + ) + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status bit-13)))) + (if (res-lump-struct (-> self entity) 'camera-name structure) + (process-spawn + external-camera-controller + (-> self entity) + 1200 + #f + :name "external-camera-controller" + :to *entity-pool* + ) + ) + (process-entity-status! self (entity-perm-status bit-13) #t) + ) + (let ((gp-1 (+ (-> self actor-group-count) -1))) + (dotimes (s5-0 (-> self actor-group gp-1 length)) + (toggle-status + (the-as entity-actor (-> self actor-group gp-1 data s5-0 actor)) + (entity-perm-status subtask-complete) + #f + ) + ) + ) + (until #f + (ja-no-eval :group! min-rat-engine-spin-ja :num! (seek! max 0.4) :frame-num 0.0) + (until (ja-done? 0) + (seek! (-> self light-target) 1.0 (seconds-per-frame)) + (let ((gp-2 (-> self actor-group (+ (-> self actor-group-count) -1)))) + (dotimes (s5-1 (-> gp-2 length)) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) (process->ppointer self)) + (set! (-> a1-10 num-params) 0) + (set! (-> a1-10 message) 'start) + (let ((t9-11 send-event-function) + (v1-70 (-> gp-2 data s5-1 actor)) + ) + (t9-11 + (if v1-70 + (-> v1-70 extra process) + ) + a1-10 + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max 0.4)) + ) + ) + #f + ) + :post (behavior () + (sound-play "rat-whl-squeak" :id (-> self rat-sound-id)) + (sound-play-by-name + (static-sound-name "rat-wheel-gear") + (-> self rat-wheel-sound-id) + (the int (* 1024.0 (-> self wheel-sound-volume))) + 0 + 0 + (sound-group) + #t + ) + (seek! (-> self wheel-sound-volume) 1.0 (* 2.0 (seconds-per-frame))) + (min-rat-engine-post) + ) + ) + +;; failed to figure out what this is: +(defstate shutdown (min-rat-engine) + :virtual #t + :event min-rat-engine-handler + :enter (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-3 prim-core action) (collide-action)) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + ) + 0 + ) + :trans rider-trans + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! min-rat-engine-lower-ja :num! (seek! max 0.03) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.03)) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (go-virtual inactive) + ) + :post (behavior () + (seek! (-> self wheel-sound-volume) 1.0 (* 2.0 (seconds-per-frame))) + (min-rat-engine-post) + ) + ) + +;; definition for method 25 of type min-rat-engine +;; WARN: Return type mismatch sound-id vs none. +(defmethod min-rat-engine-method-25 ((this min-rat-engine)) + (if (!= (-> this ang-momentum) 0.0) + (sound-play-by-name + (static-sound-name "rat-wheel-loop") + (-> this sound-id) + (the int (* 1024.0 (lerp-scale 0.0 1.0 (fabs (-> this ang-momentum)) 0.0 409600.0))) + (the int (* 1524.0 (lerp-scale -1.0 0.0 (fabs (-> this ang-momentum)) 0.0 409600.0))) + 0 + (sound-group) + #t + ) + ) + (none) + ) + +;; definition for method 27 of type min-rat-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod min-rat-engine-method-27 ((this min-rat-engine) (arg0 process) (arg1 focus)) + (when (= arg0 this) + (let ((a2-1 (handle->process (-> arg1 handle)))) + (if a2-1 + (set! (-> this force-pos quad) (-> (the-as process-focusable a2-1) root trans quad)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type min-rat-engine +;; WARN: Return type mismatch int vs none. +(defmethod min-rat-engine-method-28 ((this min-rat-engine)) + (let ((a0-2 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this init-quat))) + (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> this force-pos) (-> this root trans))) + ) + (+! (-> this ang-momentum) (* 10.0 (seconds-per-frame) (- (vector-dot a0-2 v1-1)))) + ) + (set! (-> this wheel-angle) + (the float + (sar + (shl + (the int (+ (-> this wheel-angle) (* 182.04445 (seconds-per-frame) (* 0.00024414062 (-> this ang-momentum))))) + 48 + ) + 48 + ) + ) + ) + (set! (-> this ang-momentum) (* 0.99 (-> this ang-momentum))) + 0 + (none) + ) + +;; definition for method 26 of type min-rat-engine +(defmethod min-rat-engine-method-26 ((this min-rat-engine) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (with-pp + (let ((v1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-0 from) (process->ppointer pp)) + (set! (-> v1-0 num-params) 1) + (set! (-> v1-0 message) 'trans) + (set! (-> v1-0 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let ((s2-0 (send-event-function (the-as process-tree arg0) v1-0))) + (when s2-0 + (let* ((s1-0 (-> this root trans)) + (a2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (a1-4 (vector-! (new 'stack-no-clear 'vector) (the-as vector s2-0) s1-0)) + (f30-0 (vector-dot a1-4 a2-2)) + (s3-1 (vector-flatten! (new 'stack-no-clear 'vector) a1-4 a2-2)) + ) + (and (< 0.0 f30-0) + (< f30-0 arg1) + (< (vector-length s3-1) arg2) + (< (cos arg3) (fabs (vector-dot s3-1 (vector-negate! (new 'stack-no-clear 'vector) *y-vector*)))) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 10 of type min-rat-engine +(defmethod deactivate ((this min-rat-engine)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this sound-id)) + (sound-stop (-> this rat-sound-id)) + (sound-stop (-> this rat-wheel-sound-id)) + (call-parent-method this) + (none) + ) + +;; definition for function joint-mod-rat-engine-callback +(defun joint-mod-rat-engine-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (-> arg0 param1))) + (quaternion-rotate-z! (-> arg1 quat) (-> arg1 quat) (-> (the-as min-rat-engine v1-0) wheel-angle)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; definition for method 11 of type min-rat-engine +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this min-rat-engine) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (min-rat-engine-method-24 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-rat-engine" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (set! (-> this notify-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-14 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-14 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-14)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (let ((a0-10 (-> this node-list data 6))) + (set! (-> a0-10 param0) joint-mod-rat-engine-callback) + (set! (-> a0-10 param1) this) + ) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this rat-sound-id) (new-sound-id)) + (set! (-> this rat-wheel-sound-id) (new-sound-id)) + (set! (-> this light-index) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) + (set! (-> this light-target) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + 1.0 + 0.0 + ) + ) + (set! (-> this wheel-angle) 0.0) + (set! (-> this rat-count) (the-as uint 0)) + (set! (-> this ang-momentum) 0.0) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (go (method-of-object this inactive)) + ) + +;; definition of type min-crane +(deftype min-crane (process-drawable) + () + (:state-methods + idle + ) + (:methods + (min-crane-method-21 (_type_) none) + ) + ) + +;; definition for method 3 of type min-crane +(defmethod inspect ((this min-crane)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-crane min-crane min-crane-lod0-jg min-crane-idle-ja + ((min-crane-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 12) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (min-crane) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 21 of type min-crane +;; WARN: Return type mismatch int vs none. +(defmethod min-crane-method-21 ((this min-crane)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 9) 0))) + (set! (-> s5-0 total-prims) (the-as uint 10)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 82.7392 -16090.727 1494.6304 47322.727) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 8350.516 3842.048 -22282.24 10069.197) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 6) + (set-vector! (-> v1-10 local-sphere) 8350.516 3842.048 -1823.9489 10069.197) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 5) + (set-vector! (-> v1-12 local-sphere) 8362.394 -8660.173 -23385.293 18361.959) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 5) + (set-vector! (-> v1-14 local-sphere) 8362.394 -8660.173 -2926.592 18361.959) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 9) + (set-vector! (-> v1-16 local-sphere) -8350.516 -3841.2288 22282.24 10069.197) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 9) + (set-vector! (-> v1-18 local-sphere) -8350.516 -3841.2288 1823.9489 10069.197) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 8) + (set-vector! (-> v1-20 local-sphere) -8362.394 8660.173 23385.293 18361.959) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-22 prim-core action) (collide-action solid)) + (set! (-> v1-22 transform-index) 8) + (set-vector! (-> v1-22 local-sphere) -8362.394 8660.173 2926.592 18361.959) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-24 prim-core action) (collide-action solid)) + (set! (-> v1-24 transform-index) 4) + (set-vector! (-> v1-24 local-sphere) 0.0 -4455.629 0.0 23633.51) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type min-crane +(defmethod init-from-entity! ((this min-crane) (arg0 entity-actor)) + (min-crane-method-21 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-crane" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +;; definition of type min-target-sign +(deftype min-target-sign (mine-platform-base) + ((off-part sparticle-launch-control) + (on-part sparticle-launch-control) + (track-pos vector :inline) + (alt-actor entity-actor) + (touched-train? symbol) + ) + (:state-methods + dormant + idle + lowering + idle-down + ) + (:methods + (spawn-on-off-part (_type_ symbol) object) + ) + ) + +;; definition for method 3 of type min-target-sign +(defmethod inspect ((this min-target-sign)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mine-platform-base inspect))) + (t9-0 this) + ) + (format #t "~2Toff-part: ~A~%" (-> this off-part)) + (format #t "~2Ton-part: ~A~%" (-> this on-part)) + (format #t "~2Ttrack-pos: #~%" (-> this track-pos)) + (format #t "~2Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~2Ttouched-train?: ~A~%" (-> this touched-train?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-target-sign min-target-sign min-target-sign-lod0-jg min-target-sign-idle-ja + ((min-target-sign-lod0-mg (meters 999999))) + :bounds (static-spherem 0 3 3 22) + ) + +;; definition for function target-sign-event-handler +;; WARN: Return type mismatch symbol vs object. +(defbehavior target-sign-event-handler min-target-sign ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('down?) + (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate dormant (min-target-sign) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :enter (behavior () + (setup-masks (-> self draw) 4 10) + ) + :trans (behavior () + (if (task-node-open? (game-task-node mine-blow-resolution)) + (go-virtual idle) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (min-target-sign) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (-> block param 1) + (let ((gp-0 (the-as touching-shapes-entry (-> block param 0)))) + (cond + (gp-0 + (let ((s5-0 (-> gp-0 head))) + (while s5-0 + (let ((v1-5 (get-touched-prim s5-0 (-> self root) gp-0))) + (when (= (-> v1-5 prim-id) #x7400e700) + (sound-play "target-hit") + (go-virtual lowering) + ) + ) + (set! s5-0 (-> s5-0 next)) + ) + ) + #f + ) + (else + (sound-play "target-hit") + (go-virtual lowering) + ) + ) + ) + ) + (('hit) + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + (go-virtual lowering) + ) + (else + (target-sign-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self mask) (process-mask enemy)) + (setup-masks (-> self draw) 8 6) + ) + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (spawn-on-off-part self #f) + ) + :code transform-and-sleep-code + ) + +;; failed to figure out what this is: +(defstate lowering (min-target-sign) + :virtual #t + :parent (min-target-sign plat-base-state) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (when (send-event proc 'go-explode) + (let ((v0-1 (the-as object #t))) + (set! (-> self touched-train?) (the-as symbol v0-1)) + v0-1 + ) + ) + ) + (else + (target-sign-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (setup-masks (-> self draw) 2 12) + ) + :trans (behavior () + (when (>= 2.75 (ja-frame-num 0)) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-0) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-0 0)) + (ja-no-eval :group! min-target-sign-trackdown-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((f30-0 (ja-frame-num 0)) + (s5-0 (ja-num-frames 0)) + ) + (when (and (< 2.75 f30-0) + (not (-> self touched-train?)) + (not (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'rail-down) + (let ((t9-4 send-event-function) + (v1-27 (-> self alt-actor)) + ) + (t9-4 + (if v1-27 + (-> v1-27 extra process) + ) + a1-2 + ) + ) + ) + ) + (when (< gp-0 (the int f30-0)) + (if (= (the int f30-0) (+ s5-0 -13)) + (sound-play "track-fall") + ) + ) + ) + (set! gp-0 (the int (ja-frame-num 0))) + (spawn-on-off-part self #t) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual idle-down) + ) + ) + +;; failed to figure out what this is: +(defstate idle-down (min-target-sign) + :virtual #t + :parent (min-target-sign plat-base-state) + :event target-sign-event-handler + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (spawn-on-off-part self #t) + ) + :code (behavior () + (ja :group! min-target-sign-idleb-ja :num! none :frame-num 0.0) + (transform-and-sleep-code) + ) + ) + +;; definition for method 42 of type min-target-sign +(defmethod spawn-on-off-part ((this min-target-sign) (arg0 symbol)) + (spawn + (if arg0 + (-> this on-part) + (-> this off-part) + ) + (-> this node-list data 15 bone transform trans) + ) + (spawn + (if arg0 + (-> this on-part) + (-> this off-part) + ) + (-> this node-list data 16 bone transform trans) + ) + ) + +;; definition for method 7 of type min-target-sign +;; WARN: Return type mismatch mine-platform-base vs min-target-sign. +(defmethod relocate ((this min-target-sign) (offset int)) + (if (nonzero? (-> this off-part)) + (&+! (-> this off-part) offset) + ) + (if (nonzero? (-> this on-part)) + (&+! (-> this on-part) offset) + ) + (the-as min-target-sign ((method-of-type mine-platform-base relocate) this offset)) + ) + +;; definition for method 10 of type min-target-sign +(defmethod deactivate ((this min-target-sign)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this off-part)) + (kill-particles (-> this off-part)) + ) + (if (nonzero? (-> this on-part)) + (kill-particles (-> this on-part)) + ) + ((method-of-type mine-platform-base deactivate) this) + (none) + ) + +;; definition for method 36 of type min-target-sign +(defmethod get-skel ((this min-target-sign)) + (art-group-get-by-name *level* "skel-min-target-sign" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type min-target-sign +;; WARN: Return type mismatch symbol vs none. +(defmethod init-collision! ((this min-target-sign)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) + (set! (-> s5-0 total-prims) (the-as uint 6)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak obstacle hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 14) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 24576.0 69632.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-with) (collide-spec obstacle hit-by-others-list)) + (set! (-> v1-11 prim-core action) (collide-action)) + (set! (-> v1-11 transform-index) 14) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 49152.0 32768.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> v1-13 transform-index) 14) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 38912.0 53248.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 -20480.0 4096.0 24576.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint #x7400e700)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-17 prim-core action) (collide-action)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 10240.0 -23756.8 1228.8 10240.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint #x7400e700)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-19 prim-core action) (collide-action)) + (set! (-> v1-19 transform-index) 3) + (set-vector! (-> v1-19 local-sphere) -10240.0 -23756.8 1228.8 10240.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-22 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this root event-self) 'touched) + (none) + ) + +;; definition for method 21 of type min-target-sign +;; WARN: Return type mismatch structure vs vector. +(defmethod get-trans ((this min-target-sign) (arg0 int)) + "Get the `trans` for this process." + (the-as vector (cond + ((= arg0 3) + (let* ((s4-0 (-> this root)) + (gp-0 (-> s4-0 root-prim)) + ) + (if (< 0.0 (vector-dot + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> s4-0 trans)) + (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) + ) + ) + (-> (the-as collide-shape-prim-group gp-0) child 3 prim-core) + (-> (the-as collide-shape-prim-group gp-0) child 4 prim-core) + ) + ) + ) + (else + ((method-of-type process-focusable get-trans) this arg0) + ) + ) + ) + ) + +;; definition for method 20 of type min-target-sign +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this min-target-sign)) + (let ((v0-0 0)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (set! v0-0 (logior v0-0 40)) + ) + (the-as search-info-flag v0-0) + ) + ) + +;; definition for method 11 of type min-target-sign +(defmethod init-from-entity! ((this min-target-sign) (arg0 entity-actor)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this off-part) (create-launch-control (-> *part-group-id-table* 598) this)) + (set! (-> this on-part) (create-launch-control (-> *part-group-id-table* 599) this)) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this touched-train?) #f) + (let ((v1-11 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution)))) + (when (and v1-11 (< (the-as uint 2) (-> v1-11 death-count))) + (let ((f0-1 (/ 1.0 (- 1.0 (* 0.04 (the float (max 0 (min 5 (the-as int (+ (-> v1-11 death-count) -2))))))))) + (v1-15 (the-as collide-shape-prim-group (-> this root root-prim))) + ) + (set! (-> v1-15 child 3 local-sphere w) (* (-> v1-15 child 3 local-sphere w) f0-1)) + (set! (-> v1-15 child 4 local-sphere w) (* (-> v1-15 child 4 local-sphere w) f0-1)) + ) + ) + ) + (cond + ((or (task-node-closed? (game-task-node mine-blow-resolution)) + (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + ) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) + (set! (-> a0-23 frame-num) 0.0) + (joint-control-channel-group-eval! + a0-23 + (the-as art-joint-anim (-> this draw art-group data 5)) + num-func-none + ) + ) + (ja-post) + (go (method-of-object this idle-down)) + ) + ((task-node-open? (game-task-node mine-blow-resolution)) + (let ((a0-25 (-> this skel root-channel 0))) + (set! (-> a0-25 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-25 frame-num) 1.0) + (joint-control-channel-group-eval! + a0-25 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-none + ) + ) + (ja-post) + (go (method-of-object this idle)) + ) + (else + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + (set! (-> a0-26 frame-num) 0.0) + (joint-control-channel-group-eval! + a0-26 + (the-as art-joint-anim (-> this draw art-group data 2)) + num-func-none + ) + ) + (ja-post) + (go (method-of-object this dormant)) + ) + ) + ) + +;; definition of type min-bomb-elevator +(deftype min-bomb-elevator (elevator) + ((alt-actor entity-actor) + (bomb-train-offset float) + (wheel-angle float) + ) + ) + +;; definition for method 3 of type min-bomb-elevator +(defmethod inspect ((this min-bomb-elevator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (format #t "~2Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~2Tbomb-train-offset: ~f~%" (-> this bomb-train-offset)) + (format #t "~2Twheel-angle: ~f~%" (-> this wheel-angle)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-bomb-elevator min-bomb-elevator min-bomb-elevator-lod0-jg min-bomb-elevator-idle-ja + ((min-bomb-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +;; failed to figure out what this is: +(defstate waiting (min-bomb-elevator) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('ridden) + (process-grab? *target* #f) + ) + ) + ((-> (method-of-type elevator waiting) event) proc argc message block) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator waiting) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (when (task-node-closed? (game-task-node mine-blow-elevator)) + (send-event self 'jump-to 'top) + (go-virtual dormant) + ) + ) + ) + +;; failed to figure out what this is: +(defstate running (min-bomb-elevator) + :virtual #t + :enter (behavior () + (set-setting! 'music #f 0.0 0) + (let ((t9-1 (-> (method-of-type elevator running) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator running) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (let* ((a0-0 (-> self alt-actor)) + (v1-4 (if a0-0 + (-> a0-0 extra process) + ) + ) + ) + (if v1-4 + (set! (-> (the-as process-drawable v1-4) root trans y) (+ (-> self root trans y) (-> self bomb-train-offset))) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate arrived (min-bomb-elevator) + :virtual #t + :enter (behavior () + (remove-setting! 'music) + (let ((t9-1 (-> (method-of-type elevator arrived) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (let ((a1-0 (new 'stack-no-clear 'array 'symbol 3))) + (set! (-> a1-0 2) 'mine6) + (set! (-> a1-0 1) 'mine5) + (set! (-> a1-0 0) 'mine4) + (want-sound-banks *load-state* a1-0) + ) + (go-virtual dormant) + ) + ) + +;; definition for function min-bomb-elevator-callback +;; WARN: Return type mismatch int vs none. +(defun min-bomb-elevator-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as min-bomb-elevator (-> arg0 param1)))) + (when (and (-> v1-0 next-state) (= (-> v1-0 next-state name) 'running)) + (set! (-> v1-0 wheel-angle) + (the float + (sar (shl (the int (+ (-> v1-0 wheel-angle) (* -0.52040726 (seconds-per-frame) (-> v1-0 speed)))) 48) 48) + ) + ) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> v1-0 wheel-angle)) + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type min-bomb-elevator +(defmethod get-art-group ((this min-bomb-elevator)) + (art-group-get-by-name *level* "skel-min-bomb-elevator" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type min-bomb-elevator +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-bomb-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 11) 0))) + (set! (-> s5-0 total-prims) (the-as uint 12)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 204800.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 61.0304 4443.7505 -46.6944 153172.38) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 30.72 13204.275 -46.6944 137356.9) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) -7494.0415 18259.148 -1234.1248 130382.234) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 3) + (set-vector! (-> v1-19 local-sphere) 13039.616 18259.148 -1234.1248 130382.234) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-21 prim-core action) (collide-action solid rideable)) + (set! (-> v1-21 transform-index) 3) + (set-vector! (-> v1-21 local-sphere) -51408.895 58564.61 -18715.443 124619.984) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 51921.305 58564.61 -18715.443 124619.984) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-25 prim-core action) (collide-action solid rideable)) + (set! (-> v1-25 transform-index) 3) + (set-vector! (-> v1-25 local-sphere) 56478.926 37066.344 -122880.0 32969.113) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-27 prim-core action) (collide-action solid rideable)) + (set! (-> v1-27 transform-index) 3) + (set-vector! (-> v1-27 local-sphere) -56412.98 37066.344 -122880.0 32969.113) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-29 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-29 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-29 prim-core action) (collide-action solid rideable)) + (set! (-> v1-29 transform-index) 3) + (set-vector! (-> v1-29 local-sphere) -78.2336 100379.03 -123167.945 81738.14) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 9) (the-as uint 0)))) + (set! (-> v1-31 prim-core collide-as) (collide-spec obstacle camera-blocker)) + (set! (-> v1-31 prim-core collide-with) (collide-spec jak bot player-list pusher)) + (set! (-> v1-31 prim-core action) (collide-action solid rideable)) + (set! (-> v1-31 transform-index) 3) + (set-vector! (-> v1-31 local-sphere) -78.2336 39539.918 -123167.945 50748.62) + ) + (let ((v1-34 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 10) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-34 prim-core action) (collide-action solid)) + (set! (-> v1-34 transform-index) 3) + (set-vector! (-> v1-34 local-sphere) 0.0 0.0 0.0 204800.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-37 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-37 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-37 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 34 of type min-bomb-elevator +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this min-bomb-elevator)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (if (-> this alt-actor) + (set! (-> this bomb-train-offset) (- (-> this alt-actor extra trans y) (-> this entity extra trans y))) + ) + (let ((v1-9 (-> this skel root-channel 0))) + (set! (-> v1-9 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (ja-post) + (let ((a0-7 (-> this node-list data 4))) + (set! (-> a0-7 param0) min-bomb-elevator-callback) + (set! (-> a0-7 param1) this) + (set! (-> a0-7 param2) (the-as basic 0)) + ) + (set! (-> this sound-running-loop) (static-sound-spec "mine-elev-start" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "mine-elev-stop" :group 1)) + (none) + ) + +;; definition for method 42 of type min-bomb-elevator +;; WARN: Return type mismatch object vs none. +(defmethod go-arrived-or-waiting ((this min-bomb-elevator)) + (if (task-node-closed? (game-task-node mine-blow-introduction)) + (go (method-of-object this waiting)) + ) + (go (method-of-object this dormant)) + (none) + ) + +;; definition of type min-elev-doors +(deftype min-elev-doors (process-drawable) + () + (:state-methods + idle + open + opened + ) + (:methods + (min-elev-doors-method-23 (_type_) none) + ) + ) + +;; definition for method 3 of type min-elev-doors +(defmethod inspect ((this min-elev-doors)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-elev-doors min-elev-doors min-elev-doors-lod0-jg min-elev-doors-idle-ja + ((min-elev-doors-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + ) + +;; failed to figure out what this is: +(defstate idle (min-elev-doors) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual open) + ) + (('open?) + #f + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate open (min-elev-doors) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open?) + #t + ) + ) + ) + :code (behavior () + (sound-play "mine-door") + (ja-no-eval :group! min-elev-doors-open-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual opened) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate opened (min-elev-doors) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('open?) + #t + ) + ) + ) + :code (behavior () + (ja-channel-set! 1) + (ja :group! min-elev-doors-open-ja :num! (identity (the float (ja-num-frames 0)))) + (transform-post) + (sleep-code) + ) + ) + +;; definition for method 23 of type min-elev-doors +;; WARN: Return type mismatch int vs none. +(defmethod min-elev-doors-method-23 ((this min-elev-doors)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 409600.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 -40960.0 184320.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 40960.0 184320.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type min-elev-doors +(defmethod init-from-entity! ((this min-elev-doors) (arg0 entity-actor)) + (min-elev-doors-method-23 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-elev-doors" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (task-node-open? (game-task-node mine-blow-resolution)) + ) + (go (method-of-object this opened)) + ) + (go (method-of-object this idle)) + ) + +;; definition of type min-crane-switch +(deftype min-crane-switch (basebutton) + ((rog handle) + ) + ) + +;; definition for method 3 of type min-crane-switch +(defmethod inspect ((this min-crane-switch)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type basebutton inspect))) + (t9-0 this) + ) + (format #t "~2Trog: ~D~%" (-> this rog)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-crane-switch min-crane-switch min-crane-switch-lod0-jg min-crane-switch-idle-ja + ((min-crane-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate down-idle (min-crane-switch) + :virtual #t + :code (behavior () + (sound-play "floor-switch") + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.5)) + (suspend) + ) + ) + (when (not (task-node-closed? (game-task-node mine-blow-introduction))) + (let ((a1-1 (new 'stack-no-clear 'array 'symbol 3))) + (set! (-> a1-1 2) 'mine6) + (set! (-> a1-1 1) 'mine5) + (set! (-> a1-1 0) 'mine10) + (want-sound-banks *load-state* a1-1) + ) + (suspend) + (process-spawn scene-player :init scene-player-init "mine-train-intro" #t #f :name "scene-player") + ) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate up-idle (min-crane-switch) + :virtual #t + :exit (behavior () + (send-event (handle->process (-> self rog)) 'leave) + (let ((t9-1 (-> (method-of-type basebutton up-idle) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type basebutton up-idle) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (or (task-node-closed? (game-task-node mine-explore-armor)) + (and (kiosk?) (task-node-open? (game-task-node mine-explore-armor))) + ) + (= (-> self rog) #f) + ) + (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-0 pos quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 quat)) + (set! (-> gp-0 flags) (task-arrow-flags taf8)) + (set! (-> gp-0 map-icon) (the-as uint 13)) + (set! (-> self rog) (process->handle (task-arrow-spawn gp-0 self))) + ) + ) + ) + ) + +;; definition for method 35 of type min-crane-switch +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this min-crane-switch)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 3686.4 1843.2 5324.8) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 34 of type min-crane-switch +;; WARN: Return type mismatch int vs none. +(defmethod init-skel-and-ja! ((this min-crane-switch)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-crane-switch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-channel-set! 1) + (cond + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) + ) + ) + ) + (else + (let ((s5-2 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-2 + (the-as art-joint-anim (-> this draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-2 frame-num) 0.0) + ) + ) + ) + (set! (-> this anim-speed) 2.0) + (set! (-> this rog) (the-as handle #f)) + (transform-post) + (none) + ) + +;; definition for method 36 of type min-crane-switch +;; WARN: Return type mismatch int vs none. +(defmethod prepare-trigger-event! ((this min-crane-switch)) + (logior! (-> this button-status) (button-status button-status-3)) + 0 + (none) + ) + +;; definition of type min-door +(deftype min-door (process-drawable) + () + (:state-methods + idle + exploded + ) + (:methods + (min-door-method-22 (_type_) none) + (min-door-method-23 (_type_) none) + ) + ) + +;; definition for method 3 of type min-door +(defmethod inspect ((this min-door)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-door min-door min-door-lod0-jg min-door-idle-ja + ((min-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-door-break min-door-break min-door-break-lod0-jg min-door-break-idle-ja + ((min-door-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (min-door) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('subtask-complete) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + ) + ) + :code (behavior () + (ja :group! (ja-group) :num! min) + (transform-and-sleep) + ) + ) + +;; failed to figure out what this is: +(defstate exploded (min-door) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (transform-and-sleep) + ) + ) + +;; definition for method 22 of type min-door +;; WARN: Return type mismatch int vs none. +(defmethod min-door-method-22 ((this min-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 143360.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 143360.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 23 of type min-door +;; WARN: Return type mismatch int vs none. +(defmethod min-door-method-23 ((this min-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 163840.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 38912.0 0.0 102400.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) -71680.0 -51200.0 71680.0 40960.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) -61440.0 -51200.0 0.0 61440.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 40960.0 -40960.0 20480.0 81920.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type min-door +(defmethod init-from-entity! ((this min-door) (arg0 entity-actor)) + (cond + ((or (task-node-closed? (game-task-node mine-blow-resolution)) + (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + ) + (min-door-method-23 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-door-break" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this exploded)) + ) + (else + (min-door-method-22 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + ) + ) + +;; definition of type min-elec-gate +(deftype min-elec-gate (elec-gate) + () + ) + +;; definition for method 3 of type min-elec-gate +(defmethod inspect ((this min-elec-gate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elec-gate inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 30 of type min-elec-gate +;; WARN: Return type mismatch int vs none. +(defmethod elec-gate-method-30 ((this min-elec-gate) (arg0 float)) + (let ((v1-1 (level-get *level* 'minec))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 3) (the-as uint arg0)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type min-elec-gate +;; WARN: Return type mismatch int vs object. +(defmethod go-initial-state ((this min-elec-gate)) + (if (task-node-closed? (game-task-node mine-blow-elevator)) + ((method-of-type elec-gate go-initial-state) this) + (go (method-of-object this idle)) + ) + 0 + ) + +;; definition of type min-boss-elev +(deftype min-boss-elev (elevator) + ((going-down? symbol) + (sound-rotating-loop sound-spec) + ) + ) + +;; definition for method 3 of type min-boss-elev +(defmethod inspect ((this min-boss-elev)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (format #t "~2Tgoing-down?: ~A~%" (-> this going-down?)) + (format #t "~2Tsound-rotating-loop: ~A~%" (-> this sound-rotating-loop)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-boss-elev min-boss-elev min-boss-elev-lod0-jg min-boss-elev-idle-ja + ((min-boss-elev-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +;; failed to figure out what this is: +(defstate dormant (min-boss-elev) + :virtual #t + :enter (behavior () + (quaternion-copy! (-> self root quat) (-> self entity quat)) + ) + ) + +;; failed to figure out what this is: +(defstate running (min-boss-elev) + :virtual #t + :post (behavior () + (let ((gp-0 (-> self root quat)) + (s5-0 (-> self entity quat)) + ) + (quaternion-pseudo-seek gp-0 gp-0 s5-0 0.005) + (if (nonzero? (-> self sound-rotating-loop)) + (sound-play-by-spec (-> self sound-rotating-loop) (-> self sound-id) (-> self root trans)) + ) + (cond + ((< 0.9999976 (fabs (-> (quaternion*! + (new 'stack-no-clear 'quaternion) + (quaternion-inverse! (new 'stack-no-clear 'quaternion) gp-0) + s5-0 + ) + w + ) + ) + ) + (when (not (-> self going-down?)) + (set! (-> self going-down?) #t) + (sound-stop (-> self sound-id)) + (set! (-> self sound-id) (new-sound-id)) + ) + (let ((t9-6 (-> (method-of-type elevator running) post))) + (if t9-6 + ((the-as (function none) t9-6)) + ) + ) + ) + (else + (move-post) + ) + ) + ) + ) + ) + +;; definition for method 31 of type min-boss-elev +(defmethod get-art-group ((this min-boss-elev)) + (art-group-get-by-name *level* "skel-min-boss-elev" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type min-boss-elev +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-boss-elev)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 61440.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! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 34 of type min-boss-elev +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this min-boss-elev)) + (set! (-> this bounce-scale) 0.0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) -11468.8) + (set! (-> this going-down?) #f) + (set! (-> this sound-running-loop) (static-sound-spec "boss-elev" :group 1)) + (set! (-> this sound-rotating-loop) (static-sound-spec "platform-turn" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "boss-elev-end" :group 1)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-airlock-door min-airlock-door min-airlock-door-lod0-jg min-airlock-door-idle-ja + ((min-airlock-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + ) + +;; definition of type min-airlock-door +(deftype min-airlock-door (com-airlock) + () + ) + +;; definition for method 3 of type min-airlock-door +(defmethod inspect ((this min-airlock-door)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type min-airlock-door +(defmethod init-from-entity! ((this min-airlock-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 40960.0 0.0 102400.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 51200.0 40960.0 0.0 61440.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -51200.0 40960.0 0.0 61440.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-airlock-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this open-frame) 30.0) + (set! (-> this sound-open) (static-sound-spec "mine-door2" :group 1)) + (set! (-> this sound-close) (static-sound-spec "mine-door2" :group 1)) + (go (method-of-object this close) #t) + ) + +;; definition of type mine-music-manager +(deftype mine-music-manager (task-manager) + () + ) + +;; definition for method 3 of type mine-music-manager +(defmethod inspect ((this mine-music-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 21 of type mine-music-manager +(defmethod set-time-limit ((this mine-music-manager)) + ((method-of-type task-manager set-time-limit) this) + (set-setting! 'music 'minexplr 0.0 0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mine-part_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-part_REF.gc new file mode 100644 index 0000000000..6b6a826497 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mine-part_REF.gc @@ -0,0 +1,1784 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-minb-light-glow + :id 597 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2310 :fade-after (meters 120) :flags (sp6)) + (sp-item 2311 :fade-after (meters 120) :flags (sp6)) + (sp-item 2312 :fade-after (meters 120) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 2310 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 70.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 2311 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 30.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 2312 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 2.0 1.0) + (:omega (degrees 1815.7499)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-min-target-sign-off + :id 598 + :bounds (static-bspherem 0 0 0 2.5) + :parts ((sp-item 2313 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2313 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0) + (:b 16.0) + (:a 28.0 2.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-min-target-sign-on + :id 599 + :bounds (static-bspherem 0 0 0 2.5) + :parts ((sp-item 2314 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2314 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 16.0) + (:b 255.0) + (:a 28.0 2.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2315 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.1)) + (:r 120.0 5.0) + (:g 120.0 5.0) + (:b 80.0 5.0) + (:a 128.0) + (:vel-z (meters -0.016666668) (meters -0.083333336)) + (:scalevel-x (meters -0.00066666666)) + (:rotvel-z (degrees -0.6666667) (degrees 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667) (meters -0.00033333333)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x408b00 #x40a200 #x40a600 #x40aa00)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -40) (degrees 80)) + (:conerot-y (degrees -40) (degrees 80)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2316 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.4) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 70.0) + (:b 50.0) + (:a 40.0 40.0) + (:vel-z (meters -0.033333335) (meters -0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.94) + (:timer (seconds 2.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees -40) (degrees 80)) + (:conerot-y (degrees -40) (degrees 80)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-minc-round-light-glow-always-on + :id 600 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2317 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2318 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2319 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2320 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2321 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2322 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2323 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2324 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2325 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2326 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2327 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2328 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2329 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-minc-round-light-glow + :id 601 + :flags (sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2317 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2318 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2319 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2320 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2321 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2322 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2323 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2324 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2325 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2326 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2327 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2328 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2329 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 2317 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.1)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 10)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2318 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 1.55)) + (:y (meters -0.05)) + (:z (meters -1.1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2319 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:y (meters -1.7)) + (:z (meters -1.15)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2320 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -2)) + (:y (meters 0.1)) + (:z (meters -1.13)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2321 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.1)) + (:y (meters 1.7)) + (:z (meters -1.05)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2322 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 1.2)) + (:y (meters 1.2)) + (:z (meters -1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2323 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -1.25)) + (:y (meters 1.1)) + (:z (meters -1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2324 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -1.4)) + (:y (meters -1.1)) + (:z (meters -1.1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2325 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 1.05)) + (:y (meters -1.3)) + (:z (meters -1)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 20.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2326 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2327 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 45)) + ) + ) + +;; failed to figure out what this is: +(defpart 2328 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees -45)) + ) + ) + +;; failed to figure out what this is: +(defpart 2329 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-minc-t-light-glow-always-on + :id 602 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2330 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2331 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2332 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2333 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2334 :fade-after (meters 200) :flags (sp6 sp7)) + (sp-item 2335 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2336 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2337 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2338 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2339 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2340 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2341 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2342 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2343 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2344 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2345 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2346 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2347 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2348 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2349 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2350 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2351 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2352 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2353 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + (sp-item 2354 :fade-after (meters 200) :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-minc-t-light-glow + :id 603 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2330 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2331 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2332 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2333 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2334 :fade-after (meters 200) :flags (sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2335 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2336 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2337 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2338 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2339 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2340 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2341 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2342 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2343 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2344 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2345 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2346 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2347 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2348 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2349 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2350 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2351 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2352 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2353 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + (sp-item 2354 :fade-after (meters 200) :flags (is-3d sp6 sp7) :hour-mask #b111111111111000000) + ) + ) + +;; failed to figure out what this is: +(defpart 2330 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -0.2)) + (:scale-x (meters 3)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2331 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 0)) + (:scale-x (meters 3)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2332 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters -0.78)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2333 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters -0.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2334 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters -0.2)) + (:scale-x (meters 2)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 30.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2335 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2336 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2337 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2338 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2339 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2340 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2341 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2342 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -2.12)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2343 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2344 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2345 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2346 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -4)) + (:y (meters -2.2)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2347 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2348 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2349 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2350 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 3.65)) + (:y (meters -2.2)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2351 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2352 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2353 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9.8)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2354 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters -0.07)) + (:y (meters -3.6)) + (:z (meters 9)) + (:scale-x (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-bomb-train-explode + :id 604 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 80) + :parts ((sp-item 2355 :flags (sp3) :period (seconds 30) :length (seconds 0.035)) + (sp-item 2356 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2357 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2358 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2359 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2360 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 2355 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 60)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:fade-a -0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2361 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 30.0) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2362 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.6666667) (meters 0.26666668)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2356 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.1)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-bomb-train-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-bomb-train-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2356 init-specs 14 initial-valuef) + (the-as float *part-bomb-train-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* color-start) *range-explo-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* alpha-start) *range-explo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-x-start) *range-explo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-y-start) *range-explo-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* a-scalar) *curve-explo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-x-scalar) *curve-explo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-dust-in-curve-settings* scale-y-scalar) *curve-explo-dust-scale-y*) + +;; failed to figure out what this is: +(defpart 2358 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.85) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2359 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -4) (meters 8)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-bomb-train-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-bomb-train-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2359 init-specs 16 initial-valuef) + (the-as float *part-bomb-train-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* color-start) *range-explo-color*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* alpha-start) *range-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-x-start) *range-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-y-start) *range-explo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* a-scalar) *curve-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-x-scalar) *curve-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-train-explosion-texture-curve-settings* scale-y-scalar) *curve-explo-scale-y*) + +;; failed to figure out what this is: +(defpart 2357 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -2)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2360 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-b -1.7066667) + (:fade-a -1.7066667) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-bomb-train-sparks + :id 605 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2363 :flags (sp7)) (sp-item 2364 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2363 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2364 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5 0.5) + (:scale-x (meters 0.05) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.64) + (:fade-b -2.56) + (:fade-a -1.28 -1.28) + (:accel-y (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-bomb-train-smoke + :id 606 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2365 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2365 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28 1.28) + (:accel-y (meters 0.0016666667)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 2366) + ) + ) + +;; failed to figure out what this is: +(defpart 2366 + :init-specs ((:fade-a -0.23272727 -0.23272727)) + ) + +;; failed to figure out what this is: +(defpartgroup group-bomb-train-light + :id 607 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2367 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2367 + :init-specs ((:texture (glow level-default-sprite)) + (:num 4.0) + (:scale-x (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 200.0) + (:b 128.0) + (:a 32.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-min-elec-gate + :id 608 + :bounds (static-bspherem 0 -3.5 0 4) + :parts ((sp-item 2368 :fade-after (meters 160) :flags (sp6) :period (seconds 0.1) :length (seconds 0.05)) + (sp-item 2369 :fade-after (meters 160) :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 2369 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 2.0) + (:y (meters -1.2) 6 (meters -1)) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 3.6) (meters 0.1)) + (:r 0.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2368 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.6) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 32.0 4.0) + (:omega (degrees 3615.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc new file mode 100644 index 0000000000..03366c4469 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc @@ -0,0 +1,2288 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mine-platform-base +(deftype mine-platform-base (base-plat) + () + (:state-methods + plat-base-state + ) + (:methods + (get-skel (_type_) art-group) + (alloc-path! (_type_ entity) none) + ) + ) + +;; definition for method 3 of type mine-platform-base +(defmethod inspect ((this mine-platform-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type base-plat inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate plat-base-state (mine-platform-base) + :virtual #t + :event plat-event + :trans plat-trans + :code sleep-code + :post plat-post + ) + +;; definition for method 37 of type mine-platform-base +;; WARN: Return type mismatch symbol vs none. +(defmethod alloc-path! ((this mine-platform-base) (arg0 entity)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (not (logtest? (-> this path flags) (path-control-flag not-found))) + (none) + ) + +;; definition for method 11 of type mine-platform-base +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this mine-platform-base) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (init-bounce-params! this) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-6 param 0) 1.0) + (set! (-> a0-6 frame-num) 0.0) + (joint-control-channel-group! + a0-6 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + ) + +;; definition of type min-moving-plat-spooler +(deftype min-moving-plat-spooler (process-drawable) + ((spool-sound sound-id) + ) + (:state-methods + active + ) + (:methods + (queue-drill-sound (_type_) none) + ) + ) + +;; definition for method 3 of type min-moving-plat-spooler +(defmethod inspect ((this min-moving-plat-spooler)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tspool-sound: ~D~%" (-> this spool-sound)) + (label cfg-4) + this + ) + +;; definition for function min-moving-plat-spooler-init-by-other +;; INFO: Used lq/sq +(defbehavior min-moving-plat-spooler-init-by-other min-moving-plat-spooler ((arg0 vector)) + (stack-size-set! (-> self main-thread) 32) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self spool-sound) (new-sound-id)) + (set! (-> self root trans quad) (-> arg0 quad)) + (queue-drill-sound self) + (go-virtual active) + ) + +;; definition for method 21 of type min-moving-plat-spooler +;; WARN: Return type mismatch gui-connection vs none. +(defmethod queue-drill-sound ((this min-moving-plat-spooler)) + (remove-process *gui-control* this (gui-channel guard)) + (set! (-> this spool-sound) + (add-process *gui-control* this (gui-channel guard) (gui-action queue) "lng-dril" -99.0 0) + ) + (sound-params-set! + *gui-control* + (-> this spool-sound) + #t + 35 + 70 + 9 + (-> *setting-control* user-current sfx-volume) + ) + (none) + ) + +;; definition for method 10 of type min-moving-plat-spooler +(defmethod deactivate ((this min-moving-plat-spooler)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set-action! + *gui-control* + (gui-action stop) + (-> this spool-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate active (min-moving-plat-spooler) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('play-sound) + (set-action! + *gui-control* + (gui-action play) + (-> self spool-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (('queue-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self spool-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (queue-drill-sound self) + ) + ) + ) + :trans (behavior () + (case (get-status *gui-control* (-> self spool-sound)) + (((gui-status active)) + (when *sound-player-enable* + (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-3 command) (sound-command set-param)) + (set! (-> v1-3 id) (-> self spool-sound)) + (set! (-> v1-3 params volume) (the int (* 1024.0 (-> *setting-control* user-current sfx-volume)))) + (set! (-> v1-3 params mask) (the-as uint 1)) + (-> v1-3 id) + ) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition of type min-moving-plat +(deftype min-moving-plat (mine-platform-base) + ((animation-speed float) + (sync sync-linear :inline) + (min-frame-num float) + (max-frame-num float) + (sound-drill-spool uint32) + (sound-loop uint32) + (sound-bit uint32) + (sound-gear uint32) + (last-frame float) + (spooler handle) + (sync-offset float) + ) + (:state-methods + idle + active + ) + ) + +;; definition for method 3 of type min-moving-plat +(defmethod inspect ((this min-moving-plat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mine-platform-base inspect))) + (t9-0 this) + ) + (format #t "~2Tanimation-speed: ~f~%" (-> this animation-speed)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tmin-frame-num: ~f~%" (-> this min-frame-num)) + (format #t "~2Tmax-frame-num: ~f~%" (-> this max-frame-num)) + (format #t "~2Tsound-drill-spool: ~D~%" (-> this sound-drill-spool)) + (format #t "~2Tsound-loop: ~D~%" (-> this sound-loop)) + (format #t "~2Tsound-bit: ~D~%" (-> this sound-bit)) + (format #t "~2Tsound-gear: ~D~%" (-> this sound-gear)) + (format #t "~2Tlast-frame: ~f~%" (-> this last-frame)) + (format #t "~2Tspooler: ~D~%" (-> this spooler)) + (format #t "~2Tsync-offset: ~f~%" (-> this sync-offset)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-moving-plat min-moving-plat min-moving-plat-lod0-jg min-moving-plat-idle-ja + ((min-moving-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 24) + ) + +;; definition for method 32 of type min-moving-plat +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this min-moving-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 98304.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 5) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 43008.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 12288.0 81920.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 43008.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 36 of type min-moving-plat +(defmethod get-skel ((this min-moving-plat)) + (art-group-get-by-name *level* "skel-min-moving-plat" (the-as (pointer level) #f)) + ) + +;; definition for method 11 of type min-moving-plat +(defmethod init-from-entity! ((this min-moving-plat) (arg0 entity-actor)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-1 0)) + (if #f + (set! v1-1 (logior v1-1 1)) + ) + (set! (-> a1-2 sync-type) 'sync-linear) + (set! (-> a1-2 sync-flags) (the-as sync-flags v1-1)) + ) + (set! (-> a1-2 entity) arg0) + (set! (-> a1-2 period) (the-as uint 3000)) + (set! (-> a1-2 percent) 0.0) + (initialize! (-> this sync) a1-2) + ) + (let ((f0-1 (res-lump-float (-> this entity) 'scale :default 1.0))) + (set! (-> this root scale x) f0-1) + (set! (-> this root scale y) f0-1) + (set! (-> this root scale z) f0-1) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (ja-channel-push! 1 0) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-1 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + (set! (-> s5-1 frame-num) 0.0) + ) + (sync-now! (-> this sync) 0.6) + (let ((f0-5 (* (get-norm! (-> this sync) 0) (the float (ja-num-frames 0)))) + (v1-24 (-> this skel root-channel 0)) + ) + (set! (-> v1-24 num-func) num-func-identity) + (set! (-> v1-24 frame-num) f0-5) + ) + (ja-post) + (set! (-> this sound-drill-spool) (the-as uint (new-sound-id))) + (set! (-> this sound-loop) (the-as uint (new-sound-id))) + (set! (-> this sound-bit) (the-as uint (new-sound-id))) + (set! (-> this sound-gear) (the-as uint (new-sound-id))) + (set! (-> this spooler) (the-as handle #f)) + (when (string= (-> this name) "min-moving-plat-2") + (let ((s5-2 (get-process *default-dead-pool* min-moving-plat-spooler #x4000 1))) + (set! (-> this spooler) + (process->handle + (-> (when s5-2 + (let ((t9-15 (method-of-type min-moving-plat-spooler activate))) + (t9-15 (the-as min-moving-plat-spooler s5-2) this "min-moving-plat-spooler" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 min-moving-plat-spooler-init-by-other (-> this root trans)) + (-> s5-2 ppointer) + ) + 0 + ) + ) + ) + ) + ) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this active)) + ) + (go (method-of-object this idle)) + ) + +;; definition for method 10 of type min-moving-plat +(defmethod deactivate ((this min-moving-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (the-as sound-id (-> this sound-loop))) + (sound-stop (the-as sound-id (-> this sound-bit))) + (sound-stop (the-as sound-id (-> this sound-gear))) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> this sound-drill-spool)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ((method-of-type mine-platform-base deactivate) this) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (min-moving-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (sync-now! (-> self sync) 0.6) + (go-virtual active) + ) + ) + (plat-event proc argc message block) + ) + :trans plat-trans + :code sleep-code + :post plat-post + ) + +;; failed to figure out what this is: +(when (or (zero? *drill-loop-mid-curve*) (!= loading-level global)) + (set! *drill-loop-mid-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *drill-loop-mid-curve* 3 'loading-level (the-as int #t)) + ) + +;; failed to figure out what this is: +(set! (-> *drill-loop-mid-curve* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *drill-loop-mid-curve* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *drill-loop-mid-curve* pts data 1 first) 0.5) + +;; failed to figure out what this is: +(set! (-> *drill-loop-mid-curve* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *drill-loop-mid-curve* pts data 2 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *drill-loop-mid-curve* pts data 2 second) 0.0) + +;; failed to figure out what this is: +(defstate active (min-moving-plat) + :virtual #t + :event plat-event + :trans (behavior () + (sound-play "mine-drill-bit" :id (the-as sound-id (-> self sound-bit))) + (let ((f30-0 (ja-frame-num 0))) + (cond + ((and (< 15.0 f30-0) (< f30-0 28.0)) + (let ((f0-3 (* 0.07692308 (+ -15.0 f30-0)))) + 0.0 + 0.0 + (let* ((f26-0 (curve2d-method-9 *drill-loop-mid-curve* f0-3 3)) + (f28-0 (lerp -0.5 0.25 f26-0)) + ) + (sound-play-by-name + (static-sound-name "mine-drill-loop") + (the-as sound-id (-> self sound-loop)) + (the int (* 1024.0 f26-0)) + 0 + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "mine-drill-gear") + (the-as sound-id (-> self sound-gear)) + (the int (* 1024.0 f26-0)) + (the int (* 1524.0 f28-0)) + 0 + (sound-group) + #t + ) + ) + ) + ) + ((< f30-0 46.0) + (let ((f0-15 (* 0.055555556 (+ -28.0 f30-0)))) + 0.0 + 0.0 + (let* ((f26-1 (curve2d-method-9 *drill-loop-mid-curve* f0-15 3)) + (f28-1 (lerp -0.5 0.25 f26-1)) + ) + (sound-play-by-name + (static-sound-name "mine-drill-loop") + (the-as sound-id (-> self sound-loop)) + (the int (* 1024.0 f26-1)) + 0 + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "mine-drill-gear") + (the-as sound-id (-> self sound-gear)) + (the int (* 1024.0 f26-1)) + (the int (* 1524.0 f28-1)) + 0 + (sound-group) + #t + ) + ) + ) + ) + (else + (sound-play "mine-drill-loop" :id (the-as sound-id (-> self sound-loop)) :vol 0) + (sound-play "mine-drill-gear" :id (the-as sound-id (-> self sound-gear)) :vol 0) + ) + ) + (if (or (and (< (-> self last-frame) 50.0) (>= f30-0 50.0)) (and (< (-> self last-frame) 8.75) (>= f30-0 8.75))) + (sound-play "drill-arm-snap") + ) + (if (and (< (-> self last-frame) 50.0) (>= f30-0 50.0)) + (send-event (handle->process (-> self spooler)) 'play-sound) + ) + (if (and (< (-> self last-frame) 12.0) (>= f30-0 12.0)) + (send-event (handle->process (-> self spooler)) 'queue-sound) + ) + (set! (-> self last-frame) f30-0) + ) + (plat-trans) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s4-0 #t) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! min-moving-plat-idle-ja :num! min) + (sync-now! (-> self sync) 0.6) + (until #f + (let ((f30-1 (* (get-norm! (-> self sync) 0) (the float (ja-num-frames 0))))) + (let ((a0-8 (-> self skel root-channel 0))) + (set! (-> a0-8 param 0) f30-1) + (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (cond + ((or (< 55.0 f30-1) (< f30-1 5.0)) + (if s4-0 + (set! s4-0 #f) + ) + (let ((s3-1 (new 'stack-no-clear 'matrix))) + (vector+float*! (-> s3-1 trans) (-> self root trans) *up-vector* (* 40960.0 (-> self root scale x))) + (vector+float*! (-> s3-1 trans) (-> s3-1 trans) gp-1 (* 106496.0 (-> self root scale x))) + (vector+float*! (-> s3-1 trans) (-> s3-1 trans) s5-0 (* -8192.0 (-> self root scale x))) + (vector-float*! (-> s3-1 fvec) gp-1 1.0) + (set! (-> s3-1 uvec quad) (-> *up-vector* quad)) + (set! (-> s3-1 rvec quad) (-> s5-0 quad)) + (launch-particles (-> *part-id-table* 2316) s3-1 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 2315) s3-1 :origin-is-matrix #t) + ) + ) + (else + (set! s4-0 #t) + ) + ) + ) + (suspend) + ) + ) + #f + ) + :post plat-post + ) + +;; definition of type min-rotating-plat +(deftype min-rotating-plat (mine-platform-base) + ((animation-speed float) + (sync sync-linear :inline) + (sound-loop-id sound-id) + ) + (:state-methods + idle + active + ) + ) + +;; definition for method 3 of type min-rotating-plat +(defmethod inspect ((this min-rotating-plat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type mine-platform-base inspect))) + (t9-0 this) + ) + (format #t "~2Tanimation-speed: ~f~%" (-> this animation-speed)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tsound-loop-id: ~D~%" (-> this sound-loop-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-rotating-plat min-rotating-plat min-rotating-plat-lod0-jg min-rotating-plat-idle-ja + ((min-rotating-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 24) + ) + +;; definition for method 32 of type min-rotating-plat +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this min-rotating-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (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 pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 12288.0 81920.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid rideable)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 43008.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 5) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 43008.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 36 of type min-rotating-plat +(defmethod get-skel ((this min-rotating-plat)) + (art-group-get-by-name *level* "skel-min-rotating-plat" (the-as (pointer level) #f)) + ) + +;; definition for method 11 of type min-rotating-plat +(defmethod init-from-entity! ((this min-rotating-plat) (arg0 entity-actor)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (set! (-> this bounce-scale) 0.0) + (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-1 0)) + (if #f + (set! v1-1 (logior v1-1 1)) + ) + (set! (-> a1-2 sync-type) 'sync-linear) + (set! (-> a1-2 sync-flags) (the-as sync-flags v1-1)) + ) + (set! (-> a1-2 entity) arg0) + (set! (-> a1-2 period) (the-as uint 4500)) + (set! (-> a1-2 percent) 0.0) + (initialize! (-> this sync) a1-2) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (ja-channel-push! 1 0) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-1 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) + (set! (-> s5-1 frame-num) 0.0) + ) + (sync-now! (-> this sync) 0.0) + (let ((f0-5 (* (get-norm! (-> this sync) 0) (the float (ja-num-frames 0)))) + (a0-12 (-> this skel root-channel 0)) + ) + (set! (-> a0-12 param 0) f0-5) + (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (ja-post) + (set! (-> this sound-loop-id) (new-sound-id)) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this active)) + ) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate idle (min-rotating-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual active) + ) + ) + (plat-event proc argc message block) + ) + :trans plat-trans + :code sleep-code + :post plat-post + ) + +;; failed to figure out what this is: +(defstate active (min-rotating-plat) + :virtual #t + :event plat-event + :exit (behavior () + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + ) + :trans plat-trans + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! min-rotating-plat-idle-ja :num! min) + (sync-now! (-> self sync) 0.0) + (until #f + (let ((f0-3 (* (get-norm! (-> self sync) 0) (the float (ja-num-frames 0)))) + (a0-6 (-> self skel root-channel 0)) + ) + (set! (-> a0-6 param 0) f0-3) + (joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (if (nonzero? (-> self sound-loop-id)) + (sound-play "min-rotate-plat" :id (-> self sound-loop-id)) + ) + (suspend) + ) + #f + ) + :post plat-post + ) + +;; definition of type min-falling-elevator +(deftype min-falling-elevator (elevator) + ((wheel-angle float) + (stop-sound symbol) + (pad uint8 4) + ) + (:state-methods + unstable + falling + resetting + ) + ) + +;; definition for method 3 of type min-falling-elevator +(defmethod inspect ((this min-falling-elevator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (format #t "~2Twheel-angle: ~f~%" (-> this wheel-angle)) + (format #t "~2Tstop-sound: ~A~%" (-> this stop-sound)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-falling-elevator min-falling-elevator min-falling-elevator-lod0-jg min-falling-elevator-idle-ja + ((min-falling-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 5 10) + ) + +;; definition for function min-falling-elevator-callback +;; WARN: Return type mismatch int vs none. +(defun min-falling-elevator-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as min-falling-elevator (-> arg0 param1)))) + (when (and (-> v1-0 next-state) (= (-> v1-0 next-state name) 'running)) + (set! (-> v1-0 wheel-angle) + (the float + (sar (shl (the int (+ (-> v1-0 wheel-angle) (* -4.956458 (seconds-per-frame) (-> v1-0 speed)))) 48) 48) + ) + ) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> v1-0 wheel-angle)) + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + 0 + (none) + ) + +;; definition for method 34 of type min-falling-elevator +;; WARN: Return type mismatch cspace vs none. +(defmethod base-plat-method-34 ((this min-falling-elevator)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "min-fall-elev" :group 1)) + (set! (-> this stop-sound) #f) + (let ((v1-3 (-> this skel root-channel 0))) + (set! (-> v1-3 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (ja-post) + (let ((v0-1 (-> this node-list data 4))) + (set! (-> v0-1 param0) min-falling-elevator-callback) + (set! (-> v0-1 param1) this) + (set! (-> v0-1 param2) (the-as basic 0)) + ) + (none) + ) + +;; definition for method 32 of type min-falling-elevator +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this min-falling-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 20480.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 20480.0 40960.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-20 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 31 of type min-falling-elevator +(defmethod get-art-group ((this min-falling-elevator)) + (art-group-get-by-name *level* "skel-min-falling-elevator" (the-as (pointer level) #f)) + ) + +;; failed to figure out what this is: +(defstate running (min-falling-elevator) + :virtual #t + :enter (behavior () + (if (task-node-closed? (game-task-node mine-blow-resolution)) + (go-virtual dormant) + ) + (let ((t9-2 (-> (method-of-type elevator running) enter))) + (if t9-2 + (t9-2) + ) + ) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "mfal-end" -99.0 0) + ) + (set! (-> self stop-sound) #t) + ) + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator running) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (if (not (send-event self 'query 'player-standing-on?)) + (send-event self 'use-camera #f) + ) + ) + ) + +;; failed to figure out what this is: +(defstate arrived (min-falling-elevator) + :virtual #t + :post (behavior () + (let ((t9-0 (-> (method-of-type elevator arrived) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'player-standing-on?)) + (cond + ((and (send-event-function self a1-0) (!= (-> self prev-state name) 'resetting)) + (go-virtual unstable) + ) + (else + (send-event self 'use-camera #f) + (if (-> self stop-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate unstable (min-falling-elevator) + :virtual #t + :parent (min-falling-elevator dormant) + :event elevator-event + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 2)) + (go-virtual falling) + ) + (if (not (send-event self 'query 'player-standing-on?)) + (send-event self 'use-camera #f) + ) + (let ((v1-18 (-> self state parent))) + (when v1-18 + (let ((t9-3 (-> v1-18 trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + ) + :code (behavior () + (when (-> self stop-sound) + (set! (-> self stop-sound) #f) + (sound-params-set! *gui-control* (-> self sound-id) #t -1 -1 -1 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (ja-no-eval :group! min-falling-elevator-start-unstable-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! min-falling-elevator-unstable-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate falling (min-falling-elevator) + :virtual #t + :parent (min-falling-elevator dormant) + :event elevator-event + :enter (behavior () + (send-event self 'use-camera #f) + (set-time! (-> self state-time)) + ) + :code (behavior () + (ja-no-eval :group! min-falling-elevator-drop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + (go-virtual resetting) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate resetting (min-falling-elevator) + :virtual #t + :parent (min-falling-elevator dormant) + :event elevator-event + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (sound-play "falling-step-up") + (ja-no-eval :group! min-falling-elevator-reset-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + (go-virtual arrived) + ) + ) + +;; definition of type min-falling-step +(deftype min-falling-step (mine-platform-base) + ((should-fall symbol) + (actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + lowering + lowered + ) + ) + +;; definition for method 3 of type min-falling-step +(defmethod inspect ((this min-falling-step)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type mine-platform-base inspect))) + (t9-0 this) + ) + (format #t "~2Tshould-fall: ~A~%" (-> this should-fall)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-falling-step min-falling-step min-falling-step-lod0-jg min-falling-step-idle-ja + ((min-falling-step-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 4 20) + :origin-joint-index 4 + ) + +;; definition for method 20 of type min-falling-step +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this min-falling-step)) + (let ((v0-0 0)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'idle)) + (set! v0-0 (logior v0-0 32)) + ) + ((and (-> this next-state) (= (-> this next-state name) 'lowering)) + (set! v0-0 (logior v0-0 1)) + ) + ) + (the-as search-info-flag v0-0) + ) + ) + +;; definition for method 21 of type min-falling-step +(defmethod get-trans ((this min-falling-step) (arg0 int)) + "Get the `trans` for this process." + (cond + ((= arg0 3) + (let ((a2-0 (-> this node-list data 4 bone transform)) + (gp-0 (new 'static 'vector)) + ) + (set-vector! gp-0 0.0 0.0 24576.0 1.0) + (vector-matrix*! gp-0 gp-0 a2-0) + (set! (-> gp-0 w) 16384.0) + gp-0 + ) + ) + (else + ((method-of-type process-focusable get-trans) this arg0) + ) + ) + ) + +;; definition for method 32 of type min-falling-step +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this min-falling-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak hit-by-others-list player-list projectile)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 4) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 16384.0 81920.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 36 of type min-falling-step +(defmethod get-skel ((this min-falling-step)) + (art-group-get-by-name *level* "skel-min-falling-step" (the-as (pointer level) #f)) + ) + +;; failed to figure out what this is: +(defstate idle (min-falling-step) + :virtual #t + :parent (min-falling-step plat-base-state) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (go-virtual lowering) + ) + (else + (plat-event proc argc message block) + ) + ) + ) + :trans (behavior () + (let ((v1-1 (-> self state parent))) + (when v1-1 + (let ((t9-0 (-> v1-1 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (if (not (and v1-2 (= v1-2 min-falling-step-idle-ja))) + (ja-channel-push! 1 0) + ) + ) + (until #f + (ja-no-eval :group! min-falling-step-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate lowering (min-falling-step) + :virtual #t + :parent (min-falling-step plat-base-state) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) + ) + :code (behavior () + (dotimes (gp-0 (-> self actor-group-count)) + (let ((s5-0 (-> self actor-group gp-0))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'cue-chase) + (let ((t9-0 send-event-function) + (v1-6 (-> s5-0 data s4-0 actor)) + ) + (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + ) + (ja-channel-push! 1 0) + (sound-play "fall-step-hinge") + (let ((gp-2 0)) + (ja-no-eval :group! min-falling-step-falling-a-ja :num! (seek! max 0.6) :frame-num 0.0) + (until (ja-done? 0) + (let ((f30-0 (ja-frame-num 0)) + (v1-31 (ja-num-frames 0)) + ) + (when (< gp-2 (the int f30-0)) + (if (= (the int f30-0) (+ v1-31 -17)) + (sound-play "falling-step") + ) + ) + ) + (set! gp-2 (the int (ja-frame-num 0))) + (suspend) + (ja :num! (seek! max 0.6)) + ) + ) + (go-virtual lowered) + ) + ) + +;; failed to figure out what this is: +(defstate lowered (min-falling-step) + :virtual #t + :parent (min-falling-step plat-base-state) + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (ja :group! min-falling-step-falling-a-ja :num! max) + (transform-post) + (sleep-code) + ) + ) + +;; definition for method 11 of type min-falling-step +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this min-falling-step) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) + (t9-0 this arg0) + ) + (set! (-> this bounce-scale) 204.8) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this lowered)) + (go (method-of-object this idle)) + ) + ) + +;; definition of type min-elev-track +(deftype min-elev-track (elevator) + () + ) + +;; definition for method 3 of type min-elev-track +(defmethod inspect ((this min-elev-track)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-elev-track min-elev-track min-elev-track-lod0-jg min-elev-track-idle-ja + ((min-elev-track-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 4 8) + ) + +;; definition for method 31 of type min-elev-track +(defmethod get-art-group ((this min-elev-track)) + (art-group-get-by-name *level* "skel-min-elev-track" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type min-elev-track +;; WARN: Return type mismatch collide-shape vs none. +(defmethod init-collision! ((this min-elev-track)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 -8192.0 16384.0 28672.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid rideable)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 -8192.0 16384.0 28672.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-14 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 30 of type min-elev-track +;; WARN: Return type mismatch int vs none. +(defmethod start-bounce! ((this min-elev-track)) + 0 + (none) + ) + +;; definition for method 34 of type min-elev-track +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this min-elev-track)) + (set! (-> this sound-running-loop) (static-sound-spec "min-elev-track" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "min-elev-end" :group 1)) + (none) + ) + +;; definition of type min-folding-plat +(deftype min-folding-plat (process-drawable) + ((root collide-shape-moving :override) + (stop-sound symbol) + (sound-id sound-id) + ) + (:state-methods + idle + extend + extended + ) + (:methods + (set-bounds! (_type_) none) + ) + ) + +;; definition for method 3 of type min-folding-plat +(defmethod inspect ((this min-folding-plat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tstop-sound: ~A~%" (-> this stop-sound)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-folding-plat min-folding-plat min-folding-plat-lod0-jg min-folding-plat-idle-ja + ((min-folding-plat-lod0-mg (meters 20)) (min-folding-plat-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 4 10) + :origin-joint-index 5 + ) + +;; failed to figure out what this is: +(defstate idle (min-folding-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual extend) + ) + ) + ) + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (ja-channel-set! 1) + (ja-no-eval :group! min-folding-plat-idle-ja :num! zero) + (transform-post) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate extend (min-folding-plat) + :virtual #t + :enter (behavior () + (set! (-> self stop-sound) #t) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "minbridg" -99.0 0) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (set-bounds! self) + ) + :exit (behavior () + (if (-> self stop-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + :trans rider-trans + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + (suspend) + ) + ) + (when (-> self stop-sound) + (set! (-> self stop-sound) #f) + (sound-params-set! *gui-control* (-> self sound-id) #t -1 -1 -1 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (ja-no-eval :group! min-folding-plat-extend-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (go-virtual extended) + ) + :post rider-post + ) + +;; failed to figure out what this is: +(defstate extended (min-folding-plat) + :virtual #t + :code (behavior () + (set-bounds! self) + (ja-no-eval :group! min-folding-plat-extend-ja + :num! (identity (the float (+ (-> (the-as art-joint-anim min-folding-plat-extend-ja) frames num-frames) -1))) + ) + (transform-post) + (sleep-code) + ) + ) + +;; definition for method 23 of type min-folding-plat +;; WARN: Return type mismatch int vs none. +(defmethod set-bounds! ((this min-folding-plat)) + (set! (-> this root root-prim local-sphere w) 69632.0) + (set! (-> this draw bounds w) 71680.0) + 0 + (none) + ) + +;; definition for method 11 of type min-folding-plat +(defmethod init-from-entity! ((this min-folding-plat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 5) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 16384.0 32768.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 8192.0 32768.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 5) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 8192.0 32768.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 7) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 8192.0 32768.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-22 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this stop-sound) #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-folding-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this extended)) + (go (method-of-object this idle)) + ) + ) + +;; definition of type min-ramp +(deftype min-ramp (process-drawable) + ((angle degrees) + (play-anim? symbol) + (play-ramp-sound? symbol) + (stop-ramp-sound symbol) + (ramp-sound sound-id) + ) + (:state-methods + idle + rotating + rotated + ) + ) + +;; definition for method 3 of type min-ramp +(defmethod inspect ((this min-ramp)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Tplay-anim?: ~A~%" (-> this play-anim?)) + (format #t "~2Tplay-ramp-sound?: ~A~%" (-> this play-ramp-sound?)) + (format #t "~2Tstop-ramp-sound: ~A~%" (-> this stop-ramp-sound)) + (format #t "~2Tramp-sound: ~D~%" (-> this ramp-sound)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-ramp min-ramp min-ramp-lod0-jg min-ramp-idle-ja + ((min-ramp-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 2 5.5) + :origin-joint-index 4 + ) + +;; failed to figure out what this is: +(defstate idle (min-ramp) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual rotating) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! min-ramp-idle-ja :num! zero) + (transform-post) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate rotating (min-ramp) + :virtual #t + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (when (-> self play-ramp-sound?) + (set! (-> self stop-ramp-sound) #t) + (set! (-> self ramp-sound) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "min-ramp" -99.0 0) + ) + ) + ) + :exit (behavior () + (if (and (-> self play-ramp-sound?) (-> self stop-ramp-sound)) + (set-action! + *gui-control* + (gui-action stop) + (-> self ramp-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + :trans (behavior () + (when (-> self play-anim?) + (when (time-elapsed? (-> self state-time) (seconds 0.75)) + (let ((gp-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-0 from) (process->ppointer self)) + (set! (-> gp-0 num-params) 0) + (set! (-> gp-0 message) 'trigger) + (let ((s5-0 send-event-function) + (v1-7 (entity-actor-lookup (-> self entity) 'alt-actor 0)) + ) + (s5-0 + (if v1-7 + (-> v1-7 extra process) + ) + gp-0 + ) + ) + ) + ) + (if (= (-> self angle) 0.0) + (go-virtual rotated) + ) + (set! (-> self angle) + (seek-ease (-> self angle) 0.0 (* 8192.0 (seconds-per-frame)) 3640.889 (* 2048.0 (seconds-per-frame))) + ) + (rider-trans) + ) + ) + :code (behavior () + (when (-> self play-ramp-sound?) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (suspend) + ) + ) + (until (= (get-status *gui-control* (-> self ramp-sound)) (gui-status ready)) + (suspend) + ) + (when (-> self stop-ramp-sound) + (set! (-> self stop-ramp-sound) #f) + (sound-params-set! *gui-control* (-> self ramp-sound) #t -1 150 2 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self ramp-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self play-anim?) #t) + (sleep-code) + ) + :post rider-post + ) + +;; failed to figure out what this is: +(defstate rotated (min-ramp) + :virtual #t + :code (behavior () + (set! (-> self angle) 0.0) + (transform-post) + (sleep-code) + ) + ) + +;; definition for function min-ramp-callback +;; WARN: Return type mismatch int vs none. +(defun min-ramp-callback ((arg0 cspace) (arg1 transformq)) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> (the-as min-ramp (-> arg0 param1)) angle)) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +;; definition for method 11 of type min-ramp +(defmethod init-from-entity! ((this min-ramp) (arg0 entity-actor)) + (local-vars (s5-3 symbol)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable)) + (set! (-> s3-0 transform-index) 4) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 8192.0 20480.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-ramp" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this play-anim?) #f) + (let* ((s5-2 #t) + (a0-10 (-> this entity)) + (v1-18 (the-as uint128 ((method-of-object a0-10 get-property-value) + a0-10 + 'play-sound + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (cmove-#f-zero s5-3 v1-18 s5-2) + ) + (set! (-> this play-ramp-sound?) s5-3) + (set! (-> this ramp-sound) (new-sound-id)) + (set! (-> this stop-ramp-sound) #f) + (set! (-> this angle) 8192.0) + (let ((a0-11 (-> this node-list data 4))) + (set! (-> a0-11 param0) min-ramp-callback) + (set! (-> a0-11 param1) this) + (set! (-> a0-11 param2) (the-as basic 0)) + ) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this rotated)) + ) + (go (method-of-object this idle)) + ) + +;; definition of type min-bridge +(deftype min-bridge (process-drawable) + ((stop-bridge-sound symbol) + (bridge-sound sound-id) + ) + (:state-methods + idle + extend + extended + ) + (:methods + (init-collision! (_type_) none) + ) + ) + +;; definition for method 3 of type min-bridge +(defmethod inspect ((this min-bridge)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tstop-bridge-sound: ~A~%" (-> this stop-bridge-sound)) + (format #t "~2Tbridge-sound: ~D~%" (-> this bridge-sound)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-bridge min-bridge min-bridge-lod0-jg min-bridge-idle-ja + ((min-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 10 25) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (min-bridge) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual extend) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! min-bridge-idle-ja :num! zero) + (transform-post) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate extend (min-bridge) + :virtual #t + :enter (behavior () + (set! (-> self stop-bridge-sound) #t) + (set! (-> self bridge-sound) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "minbridg" -99.0 0) + ) + ) + :exit (behavior () + (if (-> self stop-bridge-sound) + (set-action! + *gui-control* + (gui-action stop) + (-> self bridge-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + :trans rider-trans + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + (suspend) + ) + ) + (when (-> self stop-bridge-sound) + (set! (-> self stop-bridge-sound) #f) + (sound-params-set! *gui-control* (-> self bridge-sound) #t -1 150 2 -1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self bridge-sound) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (ja-no-eval :group! min-bridge-move-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (go-virtual extended) + ) + :post rider-post + ) + +;; failed to figure out what this is: +(defstate extended (min-bridge) + :virtual #t + :code (behavior () + (ja-no-eval :group! min-bridge-move-ja + :num! (identity (the float (+ (-> (the-as art-joint-anim min-bridge-move-ja) frames num-frames) -1))) + ) + (transform-post) + (sleep-code) + ) + ) + +;; definition for method 23 of type min-bridge +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-bridge)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 61440.0 122880.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 5) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid rideable)) + (set! (-> v1-19 transform-index) 8) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action solid rideable)) + (set! (-> v1-21 transform-index) 6) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-24 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 11 of type min-bridge +(defmethod init-from-entity! ((this min-bridge) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-bridge" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this bridge-sound) (new-sound-id)) + (set! (-> this stop-bridge-sound) #f) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this extended)) + ) + (go (method-of-object this idle)) + ) + +;; definition of type min-plat-updown +(deftype min-plat-updown (base-plat) + ((sync sync-eased :inline) + (path-pos float) + ) + (:state-methods + idle + active + ) + (:methods + (get-skel (_type_) art-group) + ) + ) + +;; definition for method 3 of type min-plat-updown +(defmethod inspect ((this min-plat-updown)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type base-plat inspect))) + (t9-0 this) + ) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (min-plat-updown) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate active (min-plat-updown) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post plat-post + ) + +;; definition for method 34 of type min-plat-updown +;; WARN: Return type mismatch object vs none. +(defmethod base-plat-method-34 ((this min-plat-updown)) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((> (-> this sync period) 0) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this idle)) + ) + ) + (none) + ) + +;; definition for method 11 of type min-plat-updown +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this min-plat-updown) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-5 param 0) 1.0) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! + a0-5 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-24 0)) + (if (not (logtest? (-> this fact options) (actor-option loop))) + (set! v1-24 (logior v1-24 1)) + ) + (set! (-> a1-6 sync-type) 'sync-eased) + (set! (-> a1-6 sync-flags) (the-as sync-flags v1-24)) + ) + (set! (-> a1-6 period) (the-as uint 1500)) + (set! (-> a1-6 entity) arg0) + (set! (-> a1-6 percent) 0.0) + (set! (-> a1-6 ease-in) 0.15) + (set! (-> a1-6 ease-out) 0.15) + (set! (-> a1-6 pause-in) 0.1) + (set! (-> a1-6 pause-out) 0.0) + (initialize! (-> this sync) a1-6) + ) + (base-plat-method-34 this) + ) + +;; definition of type min-moving-step +(deftype min-moving-step (min-plat-updown) + ((holding? basic) + ) + (:state-methods + dormant + ) + ) + +;; definition for method 3 of type min-moving-step +(defmethod inspect ((this min-moving-step)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type min-plat-updown inspect))) + (t9-0 this) + ) + (format #t "~2Tholding?: ~A~%" (-> this holding?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-moving-step min-moving-step min-moving-step-lod0-jg min-moving-step-idle-ja + ((min-moving-step-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 3 8) + ) + +;; failed to figure out what this is: +(defstate dormant (min-moving-step) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code (behavior () + (set! (-> self path-pos) 0.0) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate active (min-moving-step) + :virtual #t + :trans (behavior () + (if (and (not (-> self holding?)) (or (= (-> self path-pos) 0.0) (= (-> self path-pos) 1.0))) + (set! (-> self holding?) (the-as basic #t)) + ) + (when (and (and (< 0.0 (-> self path-pos)) (< (-> self path-pos) 1.0)) (-> self holding?)) + (set! (-> self holding?) #f) + (sound-play "min-moving-step") + ) + (let ((t9-2 (-> (method-of-type min-plat-updown active) trans))) + (if t9-2 + (t9-2) + ) + ) + ) + ) + +;; definition for method 37 of type min-moving-step +(defmethod get-skel ((this min-moving-step)) + (art-group-get-by-name *level* "skel-min-moving-step" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type min-moving-step +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this min-moving-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 12288.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 34 of type min-moving-step +;; WARN: Return type mismatch object vs none. +(defmethod base-plat-method-34 ((this min-moving-step)) + (set! (-> this holding?) #f) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((and (or (task-node-open? (game-task-node mine-blow-resolution)) + (task-node-closed? (game-task-node mine-blow-resolution)) + ) + (> (-> this sync period) 0) + ) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this dormant)) + ) + ) + (none) + ) + +;; definition of type min-elevator +(deftype min-elevator (elevator) + () + ) + +;; definition for method 3 of type min-elevator +(defmethod inspect ((this min-elevator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-elevator min-elevator min-elevator-lod0-jg min-elevator-idle-ja + ((min-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate running (min-elevator) + :virtual #t + :enter (behavior () + (setup-masks (-> self draw) 3 0) + (let ((t9-1 (-> (method-of-type elevator running) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :exit (behavior () + (setup-masks (-> self draw) 1 2) + (let ((t9-1 (-> (method-of-type elevator running) exit))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +;; definition for method 31 of type min-elevator +(defmethod get-art-group ((this min-elevator)) + (art-group-get-by-name *level* "skel-min-elevator" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type min-elevator +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this min-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 34 of type min-elevator +;; WARN: Return type mismatch int vs none. +(defmethod base-plat-method-34 ((this min-elevator)) + (setup-masks (-> this draw) 1 2) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "min-elevator" :group 1)) + (set! (-> this draw light-index) (the-as uint 2)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mine-scenes_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-scenes_REF.gc new file mode 100644 index 0000000000..836d771c11 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mine-scenes_REF.gc @@ -0,0 +1,1568 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-leggings-fma leggings-fma leggings-fma-lod0-jg leggings-fma-idle-ja + ((leggings-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-elevator-movie min-elevator min-elevator-lod0-jg min-elevator-idle-ja + ((min-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defpartgroup group-min-door-explode + :id 609 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2370 :flags (sp3) :period (seconds 30) :length (seconds 0.035)) + (sp-item 2371 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2372 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2373 :period (seconds 30) :length (seconds 0.667)) + (sp-item 2374 :period (seconds 30) :length (seconds 0.667)) + (sp-item 2375 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 2370 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 60)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2371 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.1)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 90.0 :y 90.0 :z 90.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 16.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-door-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -2.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-door-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-door-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-bomb-door-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-bomb-door-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 4) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2371 init-specs 14 initial-valuef) + (the-as float *part-bomb-door-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* color-start) *range-explo-door-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* alpha-start) *range-explo-door-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-x-start) *range-explo-door-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-y-start) *range-explo-door-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* a-scalar) *curve-explo-door-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-x-scalar) *curve-explo-door-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-dust-in-curve-settings* scale-y-scalar) *curve-explo-door-dust-scale-y*) + +;; failed to figure out what this is: +(defpart 2373 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 6) (meters 4)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.85 0.05) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2374 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:x (meters -4) (meters 8)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-door-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 30.0 :z 31.0 :w 32.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-door-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-door-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.9 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.125 :y 0.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-door-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 0.9 :z 1.0 :w 2.0) + :one-over-x-deltas (new 'static 'vector :x 1.125 :y 0.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-bomb-door-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-bomb-door-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2374 init-specs 16 initial-valuef) + (the-as float *part-bomb-door-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* color-start) *range-explo-door-color*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* alpha-start) *range-explo-door-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-x-start) *range-explo-door-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-y-start) *range-explo-door-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* a-scalar) *curve-explo-door-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-x-scalar) *curve-explo-door-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-bomb-door-explosion-texture-curve-settings* scale-y-scalar) *curve-explo-door-scale-y*) + +;; failed to figure out what this is: +(defpart 2372 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -2)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2375 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-b -1.7066667) + (:fade-a -1.7066667) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2376 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 16.0 10.0) + (:y (meters -2.5)) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0)) + (:scale-y (meters 3.4) (meters 0.6)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.32) + (:friction 0.94) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 2377) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 90)) + (:conerot-radius (meters 0) (meters 8)) + ) + ) + +;; failed to figure out what this is: +(defpart 2377 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 2378)) + ) + +;; failed to figure out what this is: +(defpart 2378 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2379) + ) + ) + +;; failed to figure out what this is: +(defpart 2379 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2) + (:fade-g -0.7111111) + (:fade-b -0.2) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 2380) + ) + ) + +;; failed to figure out what this is: +(defpart 2380 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 2381 + :init-specs ((:texture (specs level-default-sprite)) + (:num 6.0 8.0) + (:x (meters 0.25)) + (:y (meters -2.5)) + (:scale-x (meters 3) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.06666667) (meters 0.4)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00033333333) (meters -0.0023333333)) + (:friction 0.88 0.02) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2382) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 90)) + (:conerot-radius (meters 3) (meters 5)) + ) + ) + +;; failed to figure out what this is: +(defpart 2382 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2383) + ) + ) + +;; failed to figure out what this is: +(defpart 2383 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-b -0.5543478) (:fade-a -0.10666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpart 2384 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 4.0 8.0) + (:x (meters 0) (meters 0.6)) + (:y (meters -2.5)) + (:scale-x (meters 8.5) (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.2)) + (:scalevel-x (meters 0.033333335) (meters 0.086666666)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.89) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2385) + (:conerot-x (degrees -1440) (degrees 2880)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 2385 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2386) + ) + ) + +;; failed to figure out what this is: +(defpart 2386 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 2387 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 9.0) + (:y (meters -2.5)) + (:scale-x (meters 4) (meters 8)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.4)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-min-door-trailer + :id 610 + :duration (seconds 3) + :linger-duration (seconds 2) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2388 :flags (sp7) :period (seconds 30) :length (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 2388 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.28) + (:fade-b -2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 2389) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2389 + :init-specs ((:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "catacombs-travel-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-140" + :art-group "scenecamera" + :anim "catacombs-travel-res" + :parts 6 + :command-list '((0 (fadein (frame-time-30 10)) (send-event "pecker-ingame-1" 'die)) + (620 (fadeout (frame-time-30 10))) + (10000 (task-close! "mine-explore-introduction")) + ) + :cut-list '(40 122 255 301 440 491) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x3a0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-ingame" + :level 'minea + :art-group "skel-pecker-ingame" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "minec-start" + :end-point "minec-intro" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "mine-amb-mov") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "mine-explore-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf8) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-195" + :art-group "scenecamera" + :anim "mine-explore-res" + :parts 3 + :command-list '((0 (fadein (frame-time-30 10)) (kill "leggings-2")) + (140 (send-event "jakc-highres" 'segment 32 0)) + (290 (fadeout (frame-time-30 10))) + (10000 + (send-event self 'user-data-set! (task-closed? "mine-explore-resolution")) + (task-close! "mine-explore-resolution") + ) + ) + :cut-list '(80 140) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(140) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #xa0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "leggings-fma" + :level 'minea + :art-group "skel-leggings-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mineb-elevator-room" + :end-point "mineb-after-armor" + :borrow '() + :sfx-volume -1.0 + :music-delay 1500.0 + :scene-task #x72 + :on-running '(sound-play-loop "mine-amb-mov") + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup005")) + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "mine-train-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-109" + :art-group "scenecamera" + :anim "mine-train-intro" + :parts 3 + :command-list '((0 (kill "min-crane-8") (kill "min-bomb-train-1")) + (335 (fadeout (frame-time-30 15))) + (10000 (task-close! "mine-blow-introduction") (send-event "min-bomb-elevator-1" 'trigger)) + ) + :cut-list '(95 208) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x3a0 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-crane" + :level 'mineb + :art-group "skel-min-crane" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-bomb-train" + :level 'minea + :art-group "skel-min-bomb-train" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "mineb-elevator-room" + :end-point "mineb-on-elevator" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "comb-exit" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-171" + :art-group "scenecamera" + :anim "comb-exit" + :parts 6 + :command-list '((0 + (kill "comb-elevator-1") + (kill "min-elevator-7") + (send-event "pecker-ingame-2" 'die) + (send-event "min-elevator-movie" 'segment 1 2) + (want-display 'minea 'display) + ) + (105 (send-event "min-elevator-movie" 'segment 3)) + (155 (want-load 'minea 'minec)) + (526 (want-display 'minec 'display)) + (609 (send-event "min-elevator-movie" 'segment 1 2)) + (10000 (restore "comb-elevator-1") (restore "min-elevator-7") (save) (task-close! "comb-travel-resolution")) + ) + :cut-list '(155 526 571) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'minea + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((145 575)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'minea + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-elevator-movie" + :level 'minea + :art-group "skel-min-elevator-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x2 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-ingame" + :level 'minea + :art-group "skel-pecker-ingame" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "combn-start" + :end-point "minec-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "tunnel-amb-mov") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "mine-train-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-113" + :art-group "scenecamera" + :anim "mine-train-res" + :parts 2 + :command-list '((0 + (send-event "min-door-1" 'subtask-complete) + (kill "min-door-1") + (kill "manta-1") + (kill "manta-3") + (kill "manta-4") + (part-tracker + "group-bomb-train-sparks" + entity + "min-bomb-train" + joint + "sparks" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-smoke" + entity + "min-bomb-train" + joint + "sparks1" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-sparks" + entity + "min-bomb-train" + joint + "sparks2" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-smoke" + entity + "min-bomb-train" + joint + "sparks3" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-sparks" + entity + "min-bomb-train" + joint + "sparks4" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-light" + entity + "min-bomb-train" + joint + "light" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-light" + entity + "min-bomb-train" + joint + "light1" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-bomb-train-light" + entity + "min-bomb-train" + joint + "light2" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (78 + (part-tracker + "group-min-door-explode" + entity + "min-bomb-train" + joint + "main" + track + #f + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (send-event "min-bomb-train-3" 'doors-exploded) + ) + (80 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "h" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "i" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "k" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "l" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "n" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "o" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "s" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "t" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "u" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "v" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "x" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "y" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ad" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ag" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (81 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "m" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "w" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "z" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (82 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "g" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "zz" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (83 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "d" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (88 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "aa" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (93 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ab" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (95 + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "f" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "ac" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (98 (part-tracker + "group-min-door-trailer" + entity + "min-door-break" + joint + "e" + track + #t + duration + (seconds (new 'static 'bfloat :data 5.0)) + ) + ) + (10000 (kill "min-boss-elev-1") (task-close! "mine-blow-resolution")) + ) + :cut-list '(95 208) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-door-break" + :level 'minec + :art-group "skel-min-door-break" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "min-bomb-train" + :level 'minea + :art-group "skel-min-bomb-train" + :prefix "" + :draw-frames '((min 88)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "minec-train" + :end-point "minec-resolution" + :borrow '() + :sfx-volume 1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; definition of type leggings +(deftype leggings (process-drawable) + ((alt-actor entity-actor) + ) + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type leggings +(defmethod inspect ((this leggings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Talt-actor: ~A~%" (-> this alt-actor)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-leggings leggings leggings-lod0-jg leggings-idle-ja + ((leggings-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defstate idle (leggings) + :virtual #t + :code (behavior () + (ja :group! (ja-group) :num! min) + (ja-post) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate die (leggings) + :virtual #t + :code (behavior () + (suspend) + 0 + ) + ) + +;; definition for method 11 of type leggings +(defmethod init-from-entity! ((this leggings) (arg0 entity-actor)) + (when (task-node-closed? (game-task-node mine-explore-resolution)) + (cleanup-for-death this) + (return #f) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-leggings" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (if (or (kiosk?) (demo?)) + (go (method-of-object this die)) + (go (method-of-object this idle)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc new file mode 100644 index 0000000000..ae7c27ff1f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc @@ -0,0 +1,995 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *min-bomb-train-times*, type (array float) +(define *min-bomb-train-times* + (new 'static 'boxed-array :type float 12.0 15.0 27.0 33.0 55.0 59.0 90.0 92.0 106.0 127.0 131.0 143.0 146.0) + ) + +;; definition of type min-bomb-train +(deftype min-bomb-train (process-focusable) + ((path-pos float) + (path-length float) + (speed float) + (fall-travel-time float) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (wheel-angle degrees) + (sound-loop-id sound-id) + (attack-id uint32) + (spark-part sparticle-launch-control) + (smoke-part sparticle-launch-control) + (light-part sparticle-launch-control) + (doors-exploded? symbol) + (taskman handle) + (current-rail uint8) + (suck-level float) + (minimap (array connection-minimap)) + ) + (:state-methods + idle + wait + active + explode + fall + die + explode-doors + ) + (:methods + (alloc-path! (_type_) symbol) + (init-collision! (_type_) none) + (get-path-progress (_type_ float float) float) + (update-task-manager (_type_) object) + (spawn-debris (_type_) none) + (explode-sound (_type_) none) + ) + ) + +;; definition for method 3 of type min-bomb-train +(defmethod inspect ((this min-bomb-train)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tpath-length: ~f~%" (-> this path-length)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tfall-travel-time: ~f~%" (-> this fall-travel-time)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Twheel-angle: ~f~%" (-> this wheel-angle)) + (format #t "~2Tsound-loop-id: ~D~%" (-> this sound-loop-id)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tspark-part: ~A~%" (-> this spark-part)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tlight-part: ~A~%" (-> this light-part)) + (format #t "~2Tdoors-exploded?: ~A~%" (-> this doors-exploded?)) + (format #t "~2Ttaskman: ~D~%" (-> this taskman)) + (format #t "~2Tcurrent-rail: ~D~%" (-> this current-rail)) + (format #t "~2Tsuck-level: ~f~%" (-> this suck-level)) + (format #t "~2Tminimap: ~A~%" (-> this minimap)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-bomb-train min-bomb-train min-bomb-train-lod0-jg min-bomb-train-idle-ja + ((min-bomb-train-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 18) + :shadow min-bomb-train-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-bomb-train-debris-a min-bomb-train-debris min-bomb-train-debris-a-lod0-jg -1 + ((min-bomb-train-debris-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-bomb-train-debris-b min-bomb-train-debris min-bomb-train-debris-b-lod0-jg -1 + ((min-bomb-train-debris-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-bomb-train-debris-c min-bomb-train-debris min-bomb-train-debris-c-lod0-jg -1 + ((min-bomb-train-debris-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-min-bomb-train-debris-d min-bomb-train-debris min-bomb-train-debris-d-lod0-jg -1 + ((min-bomb-train-debris-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; definition for symbol *min-bomb-train-debris-params*, type debris-static-params +(define *min-bomb-train-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 13 :group "skel-min-bomb-train-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 14 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 15 :group "skel-min-bomb-train-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 16 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-min-bomb-train-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-min-bomb-train-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-min-bomb-train-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 12 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-min-bomb-train-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-min-bomb-train-debris-c") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "train-pieces") + ) + ) + +;; definition for method 36 of type min-bomb-train +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this min-bomb-train)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 4096.0 28672.0 12288.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 0.0 12288.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 39 of type min-bomb-train +;; WARN: Return type mismatch int vs none. +(defmethod spawn-debris ((this min-bomb-train)) + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 0)))) + (set! (-> a1-1 scale-rand-lo) 1.0) + (set! (-> a1-1 scale-rand-hi) 1.5) + (set-vector! (-> a1-1 fountain-rand-transv-lo) -327680.0 163840.0 -327680.0 1.0) + (set-vector! (-> a1-1 fountain-rand-transv-hi) 327680.0 163840.0 327680.0 1.0) + (debris-spawn this a1-1 *min-bomb-train-debris-params* (the-as process-drawable #f)) + ) + 0 + (none) + ) + +;; definition for method 40 of type min-bomb-train +;; WARN: Return type mismatch int vs none. +(defmethod explode-sound ((this min-bomb-train)) + (set-setting! 'music #f 0.0 0) + (sound-play "train-explode") + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (min-bomb-train) + :virtual #t + :trans (behavior () + (if (and (task-node-open? (game-task-node mine-blow-resolution)) + (not (logtest? (-> self path flags) (path-control-flag not-found))) + ) + (go-virtual active) + ) + (when (task-node-closed? (game-task-node mine-blow-resolution)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate wait (min-bomb-train) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :trans (behavior () + (if (or (task-open? (the-as string ((method-of-type res-lump get-property-struct) + (-> self entity) + 'task-name + 'interp + -1000000000.0 + "mine-blow-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (task-node-open? (game-task-node mine-blow-resolution)) + ) + (go-virtual idle) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate active (min-bomb-train) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let ((s4-0 (the-as object (-> block param 0))) + (s3-0 (if (= message 'attack) + (-> block param 1) + #f + ) + ) + (s2-0 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1)) + ) + (when (the-as touching-shapes-entry s4-0) + (let ((s1-0 (-> (the-as touching-shapes-entry s4-0) head))) + (while s1-0 + (when (= (get-touched-prim s1-0 (-> self root) (the-as touching-shapes-entry s4-0)) s2-0) + (let ((s4-1 (if (type? proc process-focusable) + (the-as process-focusable proc) + ) + ) + ) + (when (and s4-1 + (= (-> s4-1 type) target) + (or (not (the-as uint s3-0)) + (not (logtest? (penetrate dark-bomb dark-smack) (-> (the-as attack-info s3-0) penetrate-using))) + ) + ) + (let ((v1-14 (-> self root root-prim))) + (set! (-> v1-14 prim-core collide-as) (collide-spec)) + (set! (-> v1-14 prim-core collide-with) (collide-spec)) + ) + 0 + (send-event + s4-1 + 'attack-invinc + (the-as touching-shapes-entry (-> block param 0)) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (-> self attack-id)) + (damage 1000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'smush) + (vector (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (angle 'back) + ) + ) + ) + ) + ) + (return #f) + ) + (set! s1-0 (-> s1-0 next)) + ) + ) + #f + ) + ) + ) + (('rail-down) + (when (>= (-> self actor-group-count) 3) + (dotimes (s5-2 (-> self actor-group 3 length)) + (let ((s4-2 (-> self actor-group 3 data s5-2 actor))) + (cond + ((and s4-2 (not (logtest? (-> s4-2 extra perm status) (entity-perm-status subtask-complete)))) + (let* ((s4-3 (handle->process (-> self taskman))) + (v1-42 (if (type? s4-3 task-manager) + s4-3 + ) + ) + ) + (when v1-42 + (set! (-> self current-rail) (the-as uint s5-2)) + (let ((f0-3 (-> *min-bomb-train-times* s5-2))) + (if (< 0.0 (-> self suck-level)) + (set! f0-3 (* f0-3 (/ 1.0 (-> self suck-level)))) + ) + (set! (-> (the-as task-manager v1-42) time-limit) (the-as time-frame (the int (* 300.0 f0-3)))) + ) + (return #t) + ) + ) + ) + ((= s4-2 (-> proc entity)) + (when (and (nonzero? (-> self minimap s5-2)) *minimap*) + (kill-callback (-> *minimap* engine) (-> self minimap s5-2)) + (set! (-> self minimap s5-2) + (add-icon! *minimap* self (the-as uint 155) (the-as int #f) (-> s4-2 extra trans) 0) + ) + ) + ) + ) + ) + ) + #f + ) + ) + (('go-explode) + (go-virtual explode) + ) + (('go-explode-doors) + (go-virtual explode-doors) + ) + ) + ) + :enter (behavior () + (set-setting! 'music 'mineblow 0.0 0) + (when (not (handle->process (-> self taskman))) + (let ((v1-8 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution)))) + (set! (-> self taskman) (if (-> v1-8 manager) + (-> v1-8 manager manager) + (the-as handle #f) + ) + ) + ) + ) + (let ((v1-13 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution)))) + (if (and v1-13 (< (the-as uint 2) (-> v1-13 death-count))) + (set! (-> self suck-level) + (- 1.0 (* 0.04 (the float (max 0 (min 5 (the-as int (+ (-> v1-13 death-count) -2))))))) + ) + ) + ) + (add-icon! *minimap* self (the-as uint 129) (the-as int #f) (the-as vector #t) 0) + 0 + ) + :trans (behavior () + (if (not (task-node-open? (game-task-node mine-blow-resolution))) + (go-virtual idle) + ) + (set! (-> self path-pos) (get-path-progress self (-> self path-pos) (* (-> self speed) (seconds-per-frame)))) + (spawn-from-cspace (-> self spark-part) (joint-node min-bomb-train-lod0-jg sparks)) + (spawn-from-cspace (-> self smoke-part) (joint-node min-bomb-train-lod0-jg sparks1)) + (spawn-from-cspace (-> self spark-part) (joint-node min-bomb-train-lod0-jg sparks2)) + (spawn-from-cspace (-> self smoke-part) (joint-node min-bomb-train-lod0-jg sparks3)) + (spawn-from-cspace (-> self spark-part) (joint-node min-bomb-train-lod0-jg sparks4)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light1)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light2)) + (spawn-from-cspace (-> self light-part) (joint-node min-bomb-train-lod0-jg light3)) + (if (nonzero? (-> self sound-loop-id)) + (sound-play-by-name + (static-sound-name "bomb-train") + (-> self sound-loop-id) + 1024 + (the int (* 1524.0 (lerp-scale -0.25 0.0 (-> self speed) 28672.0 57344.0))) + 0 + (sound-group) + #t + ) + ) + (let ((f1-1 (* 28672.0 ((method-of-type res-lump get-property-value-float) + (-> self entity) + 'speed + 'interp + (-> self path-pos) + 1.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (f0-10 1.0) + ) + (when (< 0.0 (-> self suck-level)) + (set! f0-10 (-> self suck-level)) + (set! f1-1 (* f1-1 f0-10)) + ) + (let ((f0-14 (seek (-> self speed) f1-1 (* 7168.0 (seconds-per-frame) (* f0-10 f0-10))))) + (set! (-> self speed) f0-14) + (set! (-> self speed) f0-14) + ) + ) + 0 + (update-task-manager self) + ) + :code (behavior () + (local-vars (v1-8 process)) + (let* ((s5-0 (handle->process (-> self taskman))) + (gp-0 (if (type? s5-0 task-manager) + (the-as task-manager s5-0) + ) + ) + ) + (when gp-0 + (logior! (-> gp-0 info mask) (task-manager-mask time-limit)) + (until v1-8 + (suspend) + (set! v1-8 (handle->process (-> gp-0 hud-timer))) + ) + (let ((f0-0 (-> *min-bomb-train-times* 0))) + (if (< 0.0 (-> self suck-level)) + (set! f0-0 (* f0-0 (/ 1.0 (-> self suck-level)))) + ) + (set! (-> gp-0 time-limit) (the-as time-frame (the int (* 300.0 f0-0)))) + ) + ) + ) + (sleep-code) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate die (min-bomb-train) + :virtual #t + :code (behavior () + (cleanup-for-death self) + (send-event (handle->process (-> self taskman)) 'fail) + ) + ) + +;; failed to figure out what this is: +(defstate fall (min-bomb-train) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('go-explode) + (go-virtual explode) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self root transv quad) (the-as uint128 0)) + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + (set! (-> self fall-travel-time) (/ 2764800.0 (-> self speed))) + ) + :trans (behavior () + (cond + ((not (time-elapsed? (-> self state-time) (the int (-> self fall-travel-time)))) + (set! (-> self path-pos) + (path-control-method-26 (-> self path) (-> self path-pos) (* (-> self speed) (seconds-per-frame))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + ) + (else + (let ((gp-0 (displacement-between-points-at-percent-normalized! + (-> self path) + (new 'stack-no-clear 'vector) + (-> self path-pos) + ) + ) + ) + (vector-normalize! gp-0 (-> self speed)) + (set! (-> self root transv y) (- (-> self root transv y) (* 3.3333333 (seconds-per-frame) (-> self speed)))) + (+! (-> gp-0 y) (-> self root transv y)) + (vector+float*! (-> self root trans) (-> self root trans) gp-0 (seconds-per-frame)) + ) + ) + ) + (let ((a1-6 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-1 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-vector-angle! gp-1 a1-6 (* 0.26666668 (seconds-per-frame) (-> self speed))) + (quaternion*! (-> self root quat) gp-1 (-> self root quat)) + ) + (quaternion-normalize! (-> self root quat)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (when (type? (-> self root) collide-shape) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (transform-post) + (spawn-debris self) + (explode-sound self) + (cond + ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + ) + (activate! *camera-smush-control* 819.2 36 210 0.5 1.0 (-> self clock)) + (activate! *camera-smush-control-horizontal* 3276.8 24 210 0.5 1.0 (-> self clock)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate explode (min-bomb-train) + :virtual #t + :enter (behavior () + (set-setting! 'allow-progress #f 0.0 0) + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + ) + :code (behavior () + (when (type? (-> self root) collide-shape) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (transform-post) + (spawn-debris self) + (explode-sound self) + (cond + ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) + ) + ) + (activate! *camera-smush-control* 819.2 36 210 0.5 1.0 (-> self clock)) + (activate! *camera-smush-control-horizontal* 3276.8 24 210 0.5 1.0 (-> self clock)) + (while (-> self child) + (suspend) + ) + (go-virtual die) + ) + ) + +;; failed to figure out what this is: +(defstate explode-doors (min-bomb-train) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('doors-exploded) + (let ((v0-0 #t)) + (set! (-> self doors-exploded?) v0-0) + v0-0 + ) + ) + ) + ) + :exit (behavior () + (if (nonzero? (-> self sound-loop-id)) + (sound-stop (-> self sound-loop-id)) + ) + ) + :trans (behavior () + (if (nonzero? (-> self sound-loop-id)) + (sound-play "bomb-train" :id (-> self sound-loop-id)) + ) + ) + :code (behavior () + (when (type? (-> self root) collide-shape) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (transform-post) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) 1.0 'interp) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'complete) + (let ((t9-3 send-event-function) + (v1-14 (-> *game-info* sub-task-list (game-task-node mine-blow-resolution))) + ) + (t9-3 + (handle->process (if (-> v1-14 manager) + (-> v1-14 manager manager) + (the-as handle #f) + ) + ) + a1-2 + ) + ) + ) + (until (-> self doors-exploded?) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 7 of type min-bomb-train +;; WARN: Return type mismatch process-focusable vs min-bomb-train. +(defmethod relocate ((this min-bomb-train) (offset int)) + (if (nonzero? (-> this minimap)) + (&+! (-> this minimap) offset) + ) + (if (nonzero? (-> this spark-part)) + (&+! (-> this spark-part) offset) + ) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this light-part)) + (&+! (-> this light-part) offset) + ) + (the-as min-bomb-train ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 35 of type min-bomb-train +(defmethod alloc-path! ((this min-bomb-train)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (not (logtest? (-> this path flags) (path-control-flag not-found))) + ) + +;; definition for method 38 of type min-bomb-train +;; WARN: Return type mismatch int vs object. +(defmethod update-task-manager ((this min-bomb-train)) + (if (or (< (-> this actor-group-count) 3) (not (handle->process (-> this taskman)))) + (return (the-as object 0)) + ) + (let ((s4-0 0) + (s5-0 #t) + ) + (let ((v1-10 (-> this actor-group 3 data (-> this current-rail) actor))) + (when v1-10 + (dotimes (a0-9 2) + (let ((f28-0 (if (zero? a0-9) + 94208.0 + 40960.0 + ) + ) + (s3-0 (if (zero? a0-9) + (method-of-object this fall) + (method-of-object this explode) + ) + ) + ) + (dotimes (a1-4 (-> this actor-group a0-9 length)) + (let ((a2-4 (-> this actor-group a0-9 data a1-4 actor))) + (when (and a2-4 (= v1-10 a2-4) (not (logtest? (-> a2-4 extra perm status) (entity-perm-status subtask-complete)))) + (set! s5-0 #f) + 0.0 + (let* ((s2-0 (-> a2-4 extra trans)) + (f1-0 (path-control-method-23 (-> this path) s2-0)) + (f30-0 (* (-> this path-length) (- f1-0 (-> this path-pos)))) + ) + (when (and (< f30-0 f28-0) (< (vector-vector-distance (-> this root trans) s2-0) f28-0)) + (let ((v1-19 (handle->process (-> this taskman)))) + (when (and v1-19 (handle->process (-> (the-as task-manager v1-19) hud-timer))) + (logclear! (-> (the-as task-manager v1-19) info mask) (task-manager-mask time-limit)) + (send-event (handle->process (-> (the-as task-manager v1-19) hud-timer)) 'hide-and-die) + ) + ) + (go s3-0) + ) + (cond + ((and (< s4-0 3) (< f30-0 163840.0)) + (set! s4-0 3) + ) + ((and (< s4-0 2) (< f30-0 286720.0)) + (set! s4-0 2) + ) + ((and (< s4-0 1) (< f30-0 409600.0)) + (set! s4-0 1) + ) + ) + ) + #t + (goto cfg-81) + ) + ) + ) + ) + ) + ) + ) + (label cfg-81) + (let ((v1-42 (handle->process (-> this taskman)))) + (if (and v1-42 (handle->process (-> (the-as task-manager v1-42) hud-timer))) + (send-event (handle->process (-> (the-as task-manager v1-42) hud-timer)) 'alert s4-0) + ) + ) + (let ((a0-48 (-> this actor-group 2 data 0 actor))) + (if (and a0-48 s5-0 (logtest? (-> a0-48 extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this explode-doors)) + ) + ) + ) + 0 + ) + +;; definition for method 37 of type min-bomb-train +;; INFO: Used lq/sq +(defmethod get-path-progress ((this min-bomb-train) (arg0 float) (arg1 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (when (nonzero? (-> this path)) + (/ 28672.0 (-> this path-length)) + 0.0 + 0.0 + (let ((f30-0 (path-control-method-26 (-> this path) arg0 arg1))) + (let ((f28-0 (path-control-method-26 (-> this path) arg0 -28672.0)) + (f26-0 (path-control-method-26 (-> this path) arg0 28672.0)) + (s5-1 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) f30-0 'interp)) + ) + (let ((s4-0 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) f28-0 'interp)) + (a2-6 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) f26-0 'interp)) + (v1-11 (new 'stack-no-clear 'vector)) + (a1-7 (new 'stack-no-clear 'matrix)) + ) + (let ((a0-7 (new 'stack-no-clear 'vector))) + (set! (-> a0-7 quad) (-> *up-vector* quad)) + (vector-! v1-11 a2-6 s4-0) + (let ((a2-7 v1-11)) + (let ((f0-4 1.0)) + (.lvf vf1 (&-> a2-7 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a3-8 f0-4)) + (.mov vf3 a3-8) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> a2-7 quad) vf1) + ) + (let ((a2-8 a1-7)) + (set! (-> a2-8 fvec quad) (-> v1-11 quad)) + (set! (-> a2-8 uvec quad) (-> a0-7 quad)) + (vector-cross! (-> a2-8 rvec) (-> a2-8 uvec) v1-11) + ) + ) + (matrix->quaternion (-> this root quat) a1-7) + ) + (set! (-> this root trans quad) (-> s5-1 quad)) + ) + f30-0 + ) + ) + ) + ) + +;; definition for function min-bomb-train-callback +;; WARN: Return type mismatch int vs none. +(defun min-bomb-train-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as min-bomb-train (-> arg0 param1)))) + (when (and (-> v1-0 next-state) (= (-> v1-0 next-state name) 'active)) + (set! (-> v1-0 wheel-angle) + (the float + (sar (shl (the int (+ (-> v1-0 wheel-angle) (* -8.439792 (seconds-per-frame) (-> v1-0 speed)))) 48) 48) + ) + ) + (quaternion-rotate-local-x! (-> arg1 quat) (-> arg1 quat) (-> v1-0 wheel-angle)) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type min-bomb-train +(defmethod deactivate ((this min-bomb-train)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-loop-id)) + (sound-stop (-> this sound-loop-id)) + ) + (if (nonzero? (-> this spark-part)) + (kill-particles (-> this spark-part)) + ) + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this light-part)) + (kill-particles (-> this light-part)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 12 of type min-bomb-train +(defmethod run-logic? ((this min-bomb-train)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 11 of type min-bomb-train +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this min-bomb-train) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (when (task-node-closed? (game-task-node mine-blow-resolution)) + (cleanup-for-death this) + (return #f) + ) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-min-bomb-train" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (not (alloc-path! this)) + (go (method-of-object this idle)) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-9 param 0) 1.0) + (set! (-> a0-9 frame-num) 0.0) + (joint-control-channel-group! + a0-9 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (let ((a0-10 (-> this node-list data 13))) + (set! (-> a0-10 param0) min-bomb-train-callback) + (set! (-> a0-10 param1) this) + (set! (-> a0-10 param2) (the-as basic 0)) + ) + (let ((a0-11 (-> this node-list data 14))) + (set! (-> a0-11 param0) min-bomb-train-callback) + (set! (-> a0-11 param1) this) + (set! (-> a0-11 param2) (the-as basic 0)) + ) + (let ((a0-12 (-> this node-list data 15))) + (set! (-> a0-12 param0) min-bomb-train-callback) + (set! (-> a0-12 param1) this) + (set! (-> a0-12 param2) (the-as basic 0)) + ) + (let ((a0-13 (-> this node-list data 16))) + (set! (-> a0-13 param0) min-bomb-train-callback) + (set! (-> a0-13 param1) this) + (set! (-> a0-13 param2) (the-as basic 0)) + ) + (set! (-> this speed) 0.0) + (if (nonzero? (-> this path)) + (set! (-> this path-length) (total-distance (-> this path))) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-44 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-44 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-44)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (when (>= (-> this actor-group-count) 3) + (let ((s5-1 (-> this actor-group 3 length))) + (set! (-> this minimap) (new 'process 'boxed-array connection-minimap s5-1)) + (dotimes (s4-1 s5-1) + (let ((v1-57 (-> this actor-group 3 data s4-1 actor))) + (if v1-57 + (set! (-> this minimap s4-1) + (add-icon! *minimap* this (the-as uint 154) (the-as int #f) (-> v1-57 extra trans) 0) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this sound-loop-id) (new-sound-id)) + (let* ((v1-64 *game-info*) + (a0-24 (+ (-> v1-64 attack-id) 1)) + ) + (set! (-> v1-64 attack-id) a0-24) + (set! (-> this attack-id) a0-24) + ) + (set! (-> this spark-part) (create-launch-control (-> *part-group-id-table* 605) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 606) this)) + (set! (-> this light-part) (create-launch-control (-> *part-group-id-table* 607) this)) + (set! (-> this doors-exploded?) #f) + (set! (-> this taskman) (the-as handle #f)) + (when (not (task-open? (the-as string ((method-of-type res-lump get-property-struct) + (-> this entity) + 'task-name + 'interp + -1000000000.0 + "mine-blow-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this wait)) + ) + (if (task-node-open? (game-task-node mine-explore-resolution)) + (go (method-of-object this idle)) + ) + (go (method-of-object this active)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/mined-mood_REF.gc b/test/decompiler/reference/jak3/levels/mine/mined-mood_REF.gc new file mode 100644 index 0000000000..7b290b0259 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/mined-mood_REF.gc @@ -0,0 +1,96 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mined-states +(deftype mined-states (structure) + ((filter vector 2 :inline) + (light light-sphere 2) + ) + ) + +;; definition for method 3 of type mined-states +(defmethod inspect ((this mined-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mined-states) + (format #t "~1Tfilter[2] @ #x~X~%" (-> this filter)) + (format #t "~1Tlight[2] @ #x~X~%" (-> this light)) + (label cfg-4) + this + ) + +;; definition for function set-mined-filter-light! +(defun set-mined-filter-light! ((arg0 string) (arg1 light-hash) (arg2 vector) (arg3 light-sphere)) + (cond + ((and arg3 (nonzero? arg3)) + (let ((v1-1 (-> arg3 color))) + (set! (-> v1-1 x) (-> arg2 x)) + (set! (-> v1-1 y) (-> arg2 y)) + (set! (-> v1-1 z) (-> arg2 z)) + ) + (set! (-> arg3 brightness) (-> arg2 w)) + arg3 + ) + (else + (lookup-light-sphere-by-name arg0 arg1) + ) + ) + ) + +;; definition for function init-mood-mined +(defun init-mood-mined ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 1))) + (set-vector! (-> v1-0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 dir0 extra x) 0.0) + (set! (-> v1-0 dir1 extra x) 0.0) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 1.0) + ) + ) + +;; definition for function update-mood-mined +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mined time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((s5-0 (the-as mined-states (-> arg0 state)))) + (let ((s4-1 (-> *level* level arg2 bsp light-hash))) + (set! (-> s5-0 light 0) + (set-mined-filter-light! "light-3802" s4-1 (the-as vector (-> s5-0 filter)) (-> s5-0 light 0)) + ) + (set! (-> s5-0 light 1) (set-mined-filter-light! "light-3803" s4-1 (-> s5-0 filter 1) (-> s5-0 light 1))) + ) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 quad) (-> s5-0 filter 0 quad)) + (set! (-> arg0 times 2 quad) (-> s5-0 filter 1 quad)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-mined-filter! +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defun set-mined-filter! ((arg0 vector) (arg1 int)) + (let ((v1-1 (level-get *level* 'mined))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as mined-states v1-2) filter arg1 quad) (-> arg0 quad)) + ) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc b/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc new file mode 100644 index 0000000000..3fc7fc68fb --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc @@ -0,0 +1,991 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-monster-frog monster-frog monster-frog-lod0-jg monster-frog-idle0-ja + ((monster-frog-lod0-mg (meters 20)) (monster-frog-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + :shadow monster-frog-shadow-mg + :origin-joint-index 12 + ) + +;; definition of type monster-frog +(deftype monster-frog (nav-enemy) + () + (:state-methods + (attack vector) + attack-recover + turn + ) + ) + +;; definition for method 3 of type monster-frog +(defmethod inspect ((this monster-frog)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-monster-frog-defaults*, type fact-info-enemy-defaults +(define *fact-info-monster-frog-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +;; definition for symbol *monster-frog-nav-enemy-info*, type nav-enemy-info +(define *monster-frog-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :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 'inline-array idle-control-frame 5 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 2 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 2 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 8 + :hostile-anim 18 + :hit-anim 30 + :knocked-anim 30 + :knocked-land-anim 31 + :die-anim 4 + :die-falling-anim 4 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-die (static-sound-name "frog-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 40) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 2.87) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 4551.1113 + :knocked-soft-vxz-lo 75776.0 + :knocked-soft-vxz-hi 75776.0 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 81920.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 79872.0 + :knocked-hard-vxz-hi 79872.0 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 75776.0 + :knocked-yellow-vxz-hi 75776.0 + :knocked-yellow-vy-lo 81920.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 73728.0 + :knocked-red-vxz-hi 73728.0 + :knocked-red-vy-lo 96256.0 + :knocked-red-vy-hi 96256.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 16 + :turn-anim 16 + :run-anim 18 + :taunt-anim -1 + :run-travel-speed (meters 18) + :run-acceleration (meters 10) + :run-turning-acceleration (meters 80) + :walk-travel-speed (meters 11.44) + :walk-acceleration (meters 5) + :walk-turning-acceleration (meters 20) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 1.5) + :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! (-> *monster-frog-nav-enemy-info* fact-defaults) *fact-info-monster-frog-defaults*) + +;; definition for function monster-frog-hop-slow-code +;; WARN: new jak 2 until loop case, check carefully +(defbehavior monster-frog-hop-slow-code monster-frog () + (until #f + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (cond + ((zero? (rnd-int self 4)) + (let ((v1-7 (ja-group))) + (if (not (and v1-7 (= v1-7 monster-frog-idle0-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let ((v1-38 (ja-group))) + (if (not (and v1-38 (= v1-38 monster-frog-idle1-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (let ((v1-71 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-71 enemy-flags))) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-71 enemy-flags)))) + ) + (set! (-> v1-71 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-71 enemy-flags)))) + (set! (-> v1-71 nav callback-info) (-> v1-71 enemy-info callback-info)) + ) + 0 + (ja-channel-push! 1 (seconds 0.035)) + (let ((v1-74 self)) + (set! (-> v1-74 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-74 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (let ((v1-78 (-> self nav))) + (set! (-> v1-78 target-speed) (* 1.4 (-> self enemy-info walk-travel-speed))) + ) + 0 + (let ((v1-80 self)) + (set! (-> v1-80 enemy-flags) (the-as enemy-flag (logclear (-> v1-80 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek! max 1.4) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.4)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek! max 1.4) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.4)) + ) + ) + #f + ) + +;; definition for function monster-frog-hop-fast-code +;; WARN: new jak 2 until loop case, check carefully +(defbehavior monster-frog-hop-fast-code monster-frog () + (until #f + (nav-enemy-method-177 self) + (ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate ambush (monster-frog) + :virtual #t + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let ((v1-12 (-> self root root-prim))) + (set! (-> v1-12 prim-core collide-as) (collide-spec)) + (set! (-> v1-12 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (update-focus self) + (let ((a0-2 (handle->process (-> self focus handle)))) + (when a0-2 + (let* ((gp-0 (-> self root)) + (s3-0 + (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> gp-0 trans)) + 1.0 + ) + ) + (f0-0 (deg-diff (quaternion-y-angle (-> gp-0 quat)) (vector-y-angle s3-0))) + ) + (quaternion-rotate-y! (-> gp-0 quat) (-> gp-0 quat) f0-0) + ) + ) + ) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (ja-no-eval :group! monster-frog-popup0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-37 (-> self root root-prim))) + (set! (-> v1-37 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-37 prim-core collide-with) (-> self root backup-collide-with)) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate notice (monster-frog) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (new 'stack-no-clear 'vector) + (ja-no-eval :group! monster-frog-notice0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! monster-frog-notice0-jump-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a0-7 (handle->process (-> self focus handle)))) + (if a0-7 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-7) 0) + (* 98304.0 f30-0) + (seconds 0.02) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-no-eval :group! monster-frog-notice0-land-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate active (monster-frog) + :virtual #t + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (nav-enemy-method-176 self) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (when (enemy-method-134 self 0.2) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (let ((v1-57 self)) + (set! (-> v1-57 enemy-flags) (the-as enemy-flag (logclear (-> v1-57 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-57 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (let ((v1-121 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-121 enemy-flags))) + (set! (-> v1-121 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-121 enemy-flags)))) + ) + (set! (-> v1-121 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-121 enemy-flags)))) + (set! (-> v1-121 nav callback-info) (-> v1-121 enemy-info callback-info)) + ) + 0 + (nav-enemy-method-176 self) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate pacing (monster-frog) + :virtual #t + :code monster-frog-hop-slow-code + ) + +;; failed to figure out what this is: +(defstate circling (monster-frog) + :virtual #t + :code monster-frog-hop-slow-code + ) + +;; failed to figure out what this is: +(defstate stare (monster-frog) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy 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 ef38)))) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate hostile (monster-frog) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag alert)) + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-6 self)) + (set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + (nav-enemy-method-171 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (nav-enemy-method-174 self) + (go-stare2 self) + ) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) + (go-stare self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + (when (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags))) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-stare self) + ) + ) + ) + ) + :code (behavior () + (until #f + (let* ((gp-0 (handle->process (-> self focus handle))) + (a0-4 (if (type? gp-0 process-focusable) + (the-as process-focusable gp-0) + ) + ) + ) + (cond + (a0-4 + (let* ((s5-0 (get-trans a0-4 0)) + (a1-4 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self root trans))) + (f30-0 (vector-length a1-4)) + (gp-1 (-> self enemy-info)) + ) + (let ((a1-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-4 1.0))) + (if (not (enemy-method-103 self a1-5 6371.5557)) + (go-virtual turn) + ) + ) + (if (< f30-0 32768.0) + (go-virtual attack s5-0) + ) + (let* ((f28-0 (fmax 0.0 (fmin 1.0 (* 0.000034877234 (+ -32768.0 f30-0))))) + (f26-0 (lerp 0.5 1.0 f28-0)) + (f30-1 (lerp 0.0 1.0 f28-0)) + (f28-1 (lerp 1.4 1.0 f28-0)) + ) + (let ((v1-21 (-> self nav))) + (set! (-> v1-21 target-speed) (/ (* f26-0 (-> gp-1 run-travel-speed)) f28-1)) + ) + 0 + (let ((v1-23 (-> self nav))) + (set! (-> v1-23 acceleration) (-> gp-1 run-acceleration)) + ) + 0 + (let ((v1-25 (-> self nav))) + (set! (-> v1-25 turning-acceleration) (-> gp-1 run-turning-acceleration)) + ) + 0 + (ja-channel-push! 2 (seconds 0.01)) + (ja-no-eval :group! monster-frog-hop-small-start-ja :num! (seek! max f28-1) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! monster-frog-hop-slow-start-ja + :num! (chan 0) + :frame-interp0 f30-1 + :frame-interp1 f30-1 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f28-1)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-1 :frame-interp1 f30-1) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! monster-frog-hop-small-end-ja :num! (seek! max f28-1) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! monster-frog-hop-slow-end-ja + :num! (chan 0) + :frame-interp0 f30-1 + :frame-interp1 f30-1 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f28-1)) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-1 :frame-interp1 f30-1) + ) + ) + ) + ) + (else + (suspend) + 0 + ) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate turn (monster-frog) + :virtual #t + :event enemy-event-handler + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-0 enemy-flags)))) + ) + 0 + (ja-no-eval :group! monster-frog-rotate-left-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-26 self)) + (set! (-> v1-26 enemy-flags) (the-as enemy-flag (logclear (-> v1-26 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (ja-no-eval :group! monster-frog-rotate-left-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 self)) + (when (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags)) + (let ((a0-4 (handle->process (-> self focus handle)))) + (if a0-4 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-4) 0) + 81920.0 + (seconds 0.02) + ) + ) + ) + ) + ) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate attack (monster-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior ((arg0 vector)) + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-9 *game-info*) + (a1-15 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a1-15) + (set! (-> self attack-id) a1-15) + ) + (let* ((gp-0 (-> self root trans)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) arg0 gp-0)) + ) + (let ((f0-0 (vector-length s5-1))) + (vector-normalize! s5-1 (fmin f0-0 (-> self enemy-info run-travel-speed))) + ) + (let ((a0-3 (-> self nav state)) + (v1-17 (vector+! (new 'stack-no-clear 'vector) gp-0 s5-1)) + ) + (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-3 target-pos quad) (-> v1-17 quad)) + ) + ) + 0 + ) + :exit (behavior () + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior ((arg0 vector)) + (ja-channel-push! 1 (seconds 0.04)) + (nav-enemy-method-177 self) + (ja-no-eval :group! monster-frog-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (go-virtual attack-recover) + ) + :post nav-enemy-travel-post + ) + +;; failed to figure out what this is: +(defstate attack-recover (monster-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :code (behavior () + (ja-no-eval :group! monster-frog-attack0-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (cond + ((zero? (rnd-int self 4)) + (let ((v1-28 (ja-group))) + (if (not (and v1-28 (= v1-28 monster-frog-idle0-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let ((v1-59 (ja-group))) + (if (not (and v1-59 (= v1-59 monster-frog-idle1-ja))) + (ja-channel-push! 1 (seconds 0.1)) + ) + ) + (ja-no-eval :group! monster-frog-idle1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +;; definition for method 85 of type monster-frog +(defmethod knocked-anim ((this monster-frog) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 0) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) + ) + #t + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 0) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) 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 (-> this draw art-group data 22)) num-func-seek!) + ) + #t + ) + (else + (cond + ((= (-> this incoming knocked-type) (knocked-type none)) + (ja-channel-push! 1 0) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) + (set! (-> a0-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) + ) + (set! (-> a0-8 param 1) (-> arg0 anim-speed)) + (set! (-> a0-8 frame-num) 0.0) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 0) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 32))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 32)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 32)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +;; definition for method 86 of type monster-frog +(defmethod knocked-land-anim ((this monster-frog) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) + (set! (-> a0-3 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) + ) + #t + ) + (((knocked-type blue-shot)) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) + (set! (-> a0-6 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) 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 (-> this draw art-group data 23)) num-func-seek!) + ) + #t + ) + (else + (cond + ((= (-> this incoming knocked-type) (knocked-type none)) + (ja-channel-push! 1 0) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) + (set! (-> a0-8 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 31)) frames num-frames) -1)) + ) + (set! (-> a0-8 param 1) (-> arg0 anim-speed)) + (set! (-> a0-8 frame-num) 0.0) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 31)) num-func-seek!) + ) + ) + (else + (ja-channel-push! 1 0) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) + (set! (-> a0-10 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) + ) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) + ) + ) + ) + #t + ) + ) + ) + +;; definition for method 59 of type monster-frog +(defmethod enemy-common-post ((this monster-frog)) + (water-control-method-10 (-> this water)) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 120 of type monster-frog +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this monster-frog)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 8192.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 1638.4 3276.8) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set! (-> v1-15 transform-index) 5) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 2048.0 2662.4) + ) + (set! (-> s5-0 nav-radius) 4915.2) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type monster-frog +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this monster-frog)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-monster-frog" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *monster-frog-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) + (set! (-> this water flags) + (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) + ) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this water wake-size) 6144.0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc new file mode 100644 index 0000000000..d1170aeea9 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc @@ -0,0 +1,1397 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type cav-break-bridge +(deftype cav-break-bridge (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type cav-break-bridge +(defmethod inspect ((this cav-break-bridge)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (cav-break-bridge) + :virtual #t + :enter (behavior () + (transform-post) + ) + :code sleep-code + ) + +;; definition for method 11 of type cav-break-bridge +(defmethod init-from-entity! ((this cav-break-bridge) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 4) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 21.7088 769.2288 5129.8306 14745.19) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 4) + (set-vector! (-> v1-11 local-sphere) -10593.075 -778.24 26691.584 37455.87) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-break-bridge" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (when (task-node-closed? (game-task-node mine-boss-introduction)) + (cleanup-for-death this) + (deactivate this) + ) + (go (method-of-object this idle)) + ) + +;; definition for method 20 of type cav-railblocker +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this cav-railblocker)) + (the-as search-info-flag (if (-> this trackable) + 24 + 1 + ) + ) + ) + +;; definition for method 30 of type cav-railblocker +;; WARN: Return type mismatch connection vs none. +(defmethod cav-railblocker-method-30 ((this cav-railblocker) (arg0 symbol)) + (when (>= (- (current-time) (-> this red-tip-change-time)) 0) + (set! (-> this alt-red-tip-on) (not (-> this alt-red-tip-on))) + (let* ((f30-0 37.5) + (v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-9 (the-as number (logior #x3f800000 v1-8))) + ) + (set! (-> this red-tip-change-time) + (the-as time-frame (+ (the int (* f30-0 (+ -1.0 (the-as float v1-9)))) 150 (current-time))) + ) + ) + (set! arg0 #t) + ) + (when arg0 + (remove-from-process *part-engine* this) + (if (-> this alt-red-tip-on) + (add-connection *part-engine* this 5 this 4490 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 6 this 4490 (new 'static 'vector :w 819200.0)) + ) + (add-connection *part-engine* this 7 this 4489 (new 'static 'vector :w 819200.0)) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (cav-railblocker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (or (not (-> self notify-on-die)) (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) 'railblocker-hittable?) + (set! (-> a1-1 param 0) (the-as uint #t)) + (let ((t9-0 send-event-function) + (v1-7 (-> self notify-on-die)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-1 + ) + ) + ) + ) + (let ((f0-0 1.0) + (v1-11 (the-as attack-info (-> block param 1))) + ) + (when (and (or (not (logtest? (-> v1-11 mask) (attack-mask id))) (!= (-> self incoming-attack-id) (-> v1-11 id))) + (!= (-> self hit-points) 0.0) + ) + (if (logtest? (-> v1-11 mask) (attack-mask id)) + (set! (-> self incoming-attack-id) (-> v1-11 id)) + ) + (if (logtest? (attack-mask damage) (-> v1-11 mask)) + (set! f0-0 (-> v1-11 damage)) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! f0-0 (* 0.6666667 f0-0)) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f0-0))) + (cond + ((= (-> self hit-points) 0.0) + (go-virtual fall) + ) + ((< (-> self hit-points) 5.0) + (setup-masks (-> self draw) 8 22) + ) + ((< (-> self hit-points) 10.0) + (setup-masks (-> self draw) 6 24) + ) + (else + (setup-masks (-> self draw) 0 12) + ) + ) + ) + ) + ) + #t + ) + ) + ) + :enter (behavior () + (transform-post) + (cav-railblocker-method-30 self #t) + ) + :trans (behavior () + (set! (-> self trackable) + (the-as symbol (or (not (-> self notify-on-die)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'railblocker-hittable?) + (set! (-> a1-0 param 0) (the-as uint #f)) + (let ((t9-0 send-event-function) + (v1-5 (-> self notify-on-die)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + ) + (cav-railblocker-method-30 self #f) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate fall (cav-railblocker) + :virtual #t + :enter (behavior () + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-cav-railblocker-explode" (the-as (pointer level) #f)) + 5 + gp-0 + *cav-railblocker-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 218)) + (set! (-> gp-1 collide-with) (collide-spec)) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (the-as process-drawable *default-pool*)) + ) + (set-time! (-> self state-time)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-22 (-> self root root-prim))) + (set! (-> v1-22 prim-core collide-as) (collide-spec)) + (set! (-> v1-22 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :trans (behavior () + (when (+ (current-time) -1) + (ja-channel-set! 0) + (ja-post) + ) + (let ((gp-0 (res-lump-value (-> self entity) 'animation-select uint128 :time -1000000000.0))) + (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) 'blocker-died) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-3 send-event-function) + (v1-9 (-> self notify-on-die)) + ) + (t9-3 + (if v1-9 + (-> v1-9 extra process) + ) + a1-1 + ) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'blocker-died) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-4 send-event-function) + (v1-15 (-> self notify-on-die-2)) + ) + (t9-4 + (if v1-15 + (-> v1-15 extra process) + ) + a1-2 + ) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + ) + +;; definition for method 11 of type cav-railblocker +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this cav-railblocker) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set-vector! (-> v1-2 local-sphere) 0.0 8192.0 0.0 12288.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-railblocker" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this incoming-attack-id) (the-as uint 0)) + (set! (-> this hit-points) 10.0) + (set! (-> this trackable) #t) + (set! (-> this notify-on-die) #f) + (set! (-> this notify-on-die-2) #f) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-17 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (when (and v1-17 (nonzero? (-> sv-16 elt-count))) + (let ((v1-18 (-> v1-17 0))) + (if (> (-> v1-18 length) 0) + (set! (-> this notify-on-die) (-> v1-18 data 0 actor)) + ) + (if (< 1 (-> v1-18 length)) + (set! (-> this notify-on-die-2) (-> v1-18 data 1 actor)) + ) + ) + ) + ) + (set! (-> this red-tip-change-time) 0) + (set! (-> this alt-red-tip-on) #f) + (setup-masks (-> this draw) 0 12) + (when (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (cleanup-for-death this) + (deactivate this) + ) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate idle (cav-minecar) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('blocker-died) + (cleanup-for-death self) + (deactivate self) + ) + ) + ) + :enter (behavior () + (transform-post) + ) + :code sleep-code + ) + +;; definition for method 11 of type cav-minecar +(defmethod init-from-entity! ((this cav-minecar) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set-vector! (-> v1-2 local-sphere) 0.0 8192.0 0.0 4096.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-minecar" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 10)) + (when (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (cleanup-for-death this) + (deactivate this) + ) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate idle (prebot-sword) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-1 object)) + (case message + (('touch 'bonk 'attack) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'attack) + (set! (-> a1-3 param 0) (the-as uint #f)) + (set! (-> a1-3 param 1) + (the-as uint (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + (if (and (send-event-function proc a1-3) (= proc *target*)) + (sound-play "sword-hit-jak" :position (-> (the-as process-drawable proc) root trans)) + ) + ) + ) + (('scale) + (set! (-> self blade-scale target) (the-as float (-> block param 0))) + ) + (('use-pos-pitch) + (set! v0-1 (-> block param 0)) + (set! (-> self use-pos-pitch) (the-as symbol v0-1)) + v0-1 + ) + (('whoosh-lead) + (set! (-> self whoosh-lead) (the-as float (-> block param 0))) + (set! v0-1 #t) + (set! (-> self allow-whoosh) (the-as symbol v0-1)) + v0-1 + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + (update! (-> self blade-scale) 0.0) + (set-vector! (-> self blade-jm scale) 1.0 (-> self blade-scale value) 1.0 1.0) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-sword-lod0-jg blade))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (vector-float*! gp-0 gp-0 0.5) + (vector+float*! + gp-0 + gp-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-sword-lod0-jg tip)) + 0.5 + ) + (vector-! s5-0 gp-0 (-> self prev-position)) + (set! (-> self prev-position quad) (-> gp-0 quad)) + (let ((v1-13 s5-0)) + (.lvf vf1 (&-> s5-0 quad)) + (let ((f0-7 (-> self 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 (&-> v1-13 quad) vf1) + ) + (let ((f30-1 (fabs (- (-> gp-0 x) (-> (target-pos 0) x))))) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) + (set! (-> self sword-sound-playing) #t) + (let* ((s2-0 (new 'stack-no-clear 'vector)) + (v1-19 gp-0) + (a0-19 (-> self parent)) + (s2-1 (vector-! s2-0 v1-19 (-> (the-as prebot (if a0-19 + (the-as prebot (-> a0-19 0 self)) + ) + ) + entity + extra + trans + ) + ) + ) + (s3-2 (vector-! (new 'stack-no-clear 'vector) gp-0 (target-pos 0))) + (f28-0 (doppler-pitch-shift gp-0 s5-0)) + (s4-3 (if (-> self alternate-sound) + (static-sound-spec "boss-sword-2" :group 1 :volume 0.0 :mask (pitch reg0)) + (static-sound-spec "boss-sword" :group 1 :volume 0.0 :mask (pitch reg0)) + ) + ) + ) + 1.0 + (let ((f26-0 (lerp-scale + 0.0 + 1.0 + f30-1 + (if (< f30-1 (-> self old-target-dist)) + 40960.0 + 20480.0 + ) + 0.0 + ) + ) + ) + (let ((f0-13 (* 0.002 f28-0))) + (fmin 0.1 f0-13) + ) + (let ((f28-4 (+ 0.0 + (lerp-scale 0.0 0.1 (-> s2-1 y) 20480.0 122880.0) + (lerp-scale 0.0 0.1 (-> s5-0 y) 204800.0 1024000.0) + (lerp-scale 0.0 -0.2 (-> s5-0 y) -204800.0 -1024000.0) + ) + ) + ) + (when (-> self use-pos-pitch) + (+! f28-4 (* 0.2 f26-0)) + (when (and (-> self allow-whoosh) (< (fabs (-> s3-2 x)) (-> self whoosh-lead))) + (set! (-> self allow-whoosh) #f) + (sound-play "sword-whoosh-by" :position gp-0) + ) + ) + (seek! (-> self current-volume) (lerp-scale 1.0 1.5 (vector-length s5-0) 204800.0 1024000.0) 0.02) + (set! (-> s4-3 volume) (the int (* 1024.0 (-> self current-volume)))) + (set! (-> s4-3 pitch-mod) (the int (* 1524.0 f28-4))) + ) + ) + (sound-play-by-spec s4-3 (-> self sword-sound) gp-0) + ) + ) + (set! (-> self old-target-dist) f30-1) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + ) + ) + +;; definition for method 7 of type prebot-sword +(defmethod relocate ((this prebot-sword) (offset int)) + (if (nonzero? (-> this blade-jm)) + (&+! (-> this blade-jm) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type prebot-sword +(defmethod deactivate ((this prebot-sword)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this sword-sound-playing) + (sound-stop (-> this sword-sound)) + ) + ((method-of-type process-focusable deactivate) (the-as process-focusable this)) + (none) + ) + +;; definition of type prebot-shockwave-joint-position +(deftype prebot-shockwave-joint-position (structure) + ((joint-index int8) + (position vector :inline) + ) + ) + +;; definition for method 3 of type prebot-shockwave-joint-position +(defmethod inspect ((this prebot-shockwave-joint-position)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prebot-shockwave-joint-position) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Tposition: #~%" (-> this position)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (prebot-shockwave) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'bonk) + (if (= proc *target*) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (ja :num! (seek!)) + (if (ja-done? 0) + (deactivate self) + ) + (let ((gp-0 (new 'stack-no-clear 'collide-query)) + (s4-0 (new 'stack-no-clear 'bounding-box)) + (s5-0 + (new 'static 'boxed-array :type prebot-shockwave-joint-position + (new 'static 'prebot-shockwave-joint-position :joint-index 33) + (new 'static 'prebot-shockwave-joint-position :joint-index 15) + (new 'static 'prebot-shockwave-joint-position :joint-index 29) + (new 'static 'prebot-shockwave-joint-position :joint-index 13) + (new 'static 'prebot-shockwave-joint-position :joint-index 27) + (new 'static 'prebot-shockwave-joint-position :joint-index 11) + (new 'static 'prebot-shockwave-joint-position :joint-index 25) + (new 'static 'prebot-shockwave-joint-position :joint-index 19) + (new 'static 'prebot-shockwave-joint-position :joint-index 31) + (new 'static 'prebot-shockwave-joint-position :joint-index 17) + (new 'static 'prebot-shockwave-joint-position :joint-index 36) + ) + ) + ) + (vector<-cspace! (-> s4-0 min) (-> self node-list data (-> s5-0 (+ (-> s5-0 length) -1) joint-index))) + (set! (-> s4-0 max quad) (-> s4-0 min quad)) + (set! (-> s5-0 (+ (-> s5-0 length) -1) position quad) (-> s4-0 min quad)) + (dotimes (s3-0 (+ (-> s5-0 length) -1)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (vector<-cspace! (-> s5-0 s3-0 position) (-> self node-list data (-> s5-0 s3-0 joint-index))) + (vector+! s2-0 (-> s5-0 s3-0 position) (new 'static 'vector :x 2048.0 :y 2048.0 :z 2048.0)) + (set! (-> s4-0 max x) (fmax (-> s2-0 x) (-> s4-0 max x))) + (set! (-> s4-0 max y) (fmax (-> s2-0 y) (-> s4-0 max y))) + (set! (-> s4-0 max z) (fmax (-> s2-0 z) (-> s4-0 max z))) + (vector-! s2-0 (-> s5-0 s3-0 position) (new 'static 'vector :x 2048.0 :y 2048.0 :z 2048.0)) + (set! (-> s4-0 min x) (fmin (-> s2-0 x) (-> s4-0 min x))) + (set! (-> s4-0 min y) (fmin (-> s2-0 y) (-> s4-0 min y))) + (set! (-> s4-0 min z) (fmin (-> s2-0 z) (-> s4-0 min z))) + ) + ) + (set! (-> gp-0 collide-with) (collide-spec jak player-list)) + (set! (-> gp-0 ignore-process0) #f) + (set! (-> gp-0 ignore-process1) #f) + (set! (-> gp-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> gp-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer s4-0) 32) + (fill-using-bounding-box *collide-cache* gp-0) + (dotimes (s4-1 (+ (-> s5-0 length) -1)) + (set! (-> gp-0 start-pos quad) (-> s5-0 s4-1 position quad)) + (vector-! (-> gp-0 move-dist) (-> s5-0 (+ s4-1 1) position) (-> gp-0 start-pos)) + (let ((v1-52 gp-0)) + (set! (-> v1-52 radius) 2048.0) + (set! (-> v1-52 collide-with) (collide-spec jak player-list)) + (set! (-> v1-52 ignore-process0) #f) + (set! (-> v1-52 ignore-process1) #f) + (set! (-> v1-52 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-52 action-mask) (collide-action solid)) + ) + (if (>= (probe-using-line-sphere *collide-cache* gp-0) 0.0) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + ) + ) + +;; definition of type prebot-gun-shot +(deftype prebot-gun-shot (projectile) + ((whoosh-sound uint32) + ) + ) + +;; definition for method 3 of type prebot-gun-shot +(defmethod inspect ((this prebot-gun-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Twhoosh-sound: ~D~%" (-> this whoosh-sound)) + (label cfg-4) + this + ) + +;; definition for method 40 of type prebot-gun-shot +(defmethod projectile-method-40 ((this prebot-gun-shot)) + 256 + ) + +;; definition for method 30 of type prebot-gun-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this prebot-gun-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-projectile) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-6 prim-core collide-with) + (collide-spec + backgnd + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 3072.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 2)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type prebot-gun-shot +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this prebot-gun-shot)) + (set! (-> this attack-mode) 'eco-dark) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1335) this)) + (set! (-> this sound-id) (new-sound-id)) + ((method-of-type projectile init-proj-settings!) this) + 0 + (none) + ) + +;; definition for method 28 of type prebot-gun-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this prebot-gun-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "launch-bomb" :position (-> this root trans)) + (set! (-> this whoosh-sound) (the-as uint (sound-play "bomb-whoosh" :position (-> this root trans)))) + ) + ((= v1-0 (projectile-options po0)) + (sound-stop (the-as sound-id (-> this whoosh-sound))) + (sound-play "bomb-explode" :position (-> this root trans)) + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-16 (static-sound-spec "blue-trail" :group 1 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-16 volume) 1024) + (set! (-> a0-16 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-16 (-> this sound-id) (-> this root trans)) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate moving (prebot-gun-shot) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type projectile moving) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (logtest? (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + no-touch + blocked + on-water + impact-surface + touch-background + stuck + touch-ceiling-sticky + glance + probe-hit + ) + (-> self root status) + ) + (go-impact! self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate impact (prebot-gun-shot) + :virtual #t + :code (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-0 spawn-quat)) + (set! (-> gp-0 radius) 8192.0) + (set! (-> gp-0 scale) 1.0) + (set! (-> gp-0 group) (-> *part-group-id-table* 1343)) + (set! (-> gp-0 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-0 damage) 2.0) + (set! (-> gp-0 damage-scale) 1.0) + (set! (-> gp-0 vehicle-damage-factor) 1.0) + (set! (-> gp-0 vehicle-impulse-factor) 1.0) + (set! (-> gp-0 ignore-proc) (process->handle #f)) + (explosion-spawn gp-0 (the-as process-drawable (ppointer->process (-> self parent)))) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (let ((gp-1 (current-time))) + (while (or (-> self child) (not (time-elapsed? gp-1 (seconds 10)))) + (suspend) + ) + ) + (deactivate self) + ) + ) + +;; failed to figure out what this is: +(defstate idle (prebot-gun) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fire) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> gp-0 ent) (-> self entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-gun-lod0-jg gunTip)) quad) + ) + (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> self node-list data 7 bone transform uvec) + (* 4096.0 (-> self clock frames-per-second)) + ) + quad + ) + ) + (set! (-> gp-0 notify-handle) (the-as handle #f)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-18 *game-info*) + (a0-10 (+ (-> v1-18 attack-id) 1)) + ) + (set! (-> v1-18 attack-id) a0-10) + (set! (-> gp-0 attack-id) a0-10) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (spawn-projectile prebot-gun-shot gp-0 (ppointer->process (-> self parent)) *default-dead-pool*) + ) + (if (logtest? (-> *part-group-id-table* 1334 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> self node-list data 7 bone transform) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> self node-list data 7 bone transform) + ) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for method 7 of type prebot-tentacle +(defmethod relocate ((this prebot-tentacle) (offset int)) + (if (nonzero? (-> this aim-jm)) + (&+! (-> this aim-jm) offset) + ) + (if (nonzero? (-> this half-aim-jm)) + (&+! (-> this half-aim-jm) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type prebot-tentacle +(defmethod deactivate ((this prebot-tentacle)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this laser-sound-playing) + (sound-stop (-> this laser-sound)) + ) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (prebot-tentacle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('look-at) + (cond + ((-> block param 0) + (let ((s5-0 (-> block param 0))) + (blend-on! (-> self aim-jm) (seconds 0.25) 1.0 #f) + (set-target! (-> self aim-jm) (the-as vector s5-0)) + (blend-on! (-> self half-aim-jm) (seconds 0.25) 0.5 #f) + (set-target! (-> self half-aim-jm) (the-as vector s5-0)) + ) + ) + (else + (blend-to-off! (-> self aim-jm) (seconds 0.25) #f) + (blend-to-off! (-> self half-aim-jm) (seconds 0.25) #f) + ) + ) + (cond + ((-> block param 1) + (let ((t2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-tentacle-lod0-jg gun)))) + (sound-play "prebot-laser" :id (-> self laser-sound) :position t2-0) + ) + (let ((v0-0 #t)) + (set! (-> self laser-sound-playing) v0-0) + v0-0 + ) + ) + ((-> self laser-sound-playing) + (sound-stop (-> self laser-sound)) + (set! (-> self laser-sound-playing) #f) + #f + ) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (clone-anim-once (ppointer->handle (-> self parent)) #t (-> self prefix)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for symbol *prebot-eco-pillar-debris-params*, type debris-static-params +(define *prebot-eco-pillar-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 3 :group "skel-cav-molten-pil-debris-a") + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-cav-molten-pil-debris-b" + :offset (new 'static 'vector :y -4096.0 :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-cav-molten-pil-debris-c" + :offset (new 'static 'vector :y -20480.0 :w 1.0) + ) + (new 'static 'debris-static-joint-params + :parent-joint-index 3 + :group "skel-cav-molten-pil-debris-d" + :offset (new 'static 'vector :y -36864.0 :w 1.0) + ) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition for method 7 of type prebot-eco-pillar +(defmethod relocate ((this prebot-eco-pillar) (offset int)) + (if (nonzero? (-> this heat-part)) + (&+! (-> this heat-part) offset) + ) + (if (nonzero? (-> this cool-part)) + (&+! (-> this cool-part) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type prebot-eco-pillar +(defmethod deactivate ((this prebot-eco-pillar)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this heat-part)) + (kill-particles (-> this heat-part)) + ) + (if (nonzero? (-> this cool-part)) + (kill-particles (-> this cool-part)) + ) + (call-parent-method this) + (none) + ) + +;; definition for function prebot-eco-pillar-handler +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs object. +(defbehavior prebot-eco-pillar-handler prebot-eco-pillar ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touch 'bonk) + (when (and (= arg0 *target*) (-> self hot)) + (if (send-event + *target* + 'attack-or-shove + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-up (meters 1)) + (shove-back (meters 3)) + ) + ) + ) + (send-event (ppointer->process (-> self parent)) 'touched-hot-pillar) + ) + ) + #t + ) + (('vulnerable) + (let ((v0-2 #t)) + (set! (-> self vulnerable) v0-2) + v0-2 + ) + ) + (('attack) + (when (and (-> self vulnerable) (type? arg0 prebot-gun-shot)) + (let ((a1-12 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-12 hit-xz-reaction) 0.95) + (set! (-> a1-12 hit-y-reaction) 0.6) + (set! (-> a1-12 fountain-rand-transv-lo quad) (-> self root trans quad)) + (+! (-> a1-12 fountain-rand-transv-lo z) 4096.0) + (debris-spawn + (the-as process-drawable (ppointer->process (-> self parent))) + a1-12 + *prebot-eco-pillar-debris-params* + self + ) + ) + (sound-play "columns-break" :position (-> self root trans)) + (cond + ((logtest? (-> *part-group-id-table* 1344 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1344)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1344)) + ) + ) + (go-virtual wait-to-die) + ) + #f + ) + ) + ) + +;; failed to figure out what this is: +(defstate wait-to-die (prebot-eco-pillar) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (+ (current-time) -1) + (deactivate self) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :code sleep-code + :post (behavior () + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate cool-down (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self hot) #f) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual idle) + ) + (let ((f30-0 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 0.0 300.0))) + (let ((f28-0 (lerp-scale 1.0 0.0 f30-0 0.5 1.0))) + (set-mined-pillar-texture! f30-0) + (set-vector! (-> self draw color-emissive) f28-0 f28-0 f28-0 1.0) + ) + (set-vector! (-> self draw color-mult) f30-0 f30-0 f30-0 1.0) + ) + (let ((a1-2 (new 'stack-no-clear 'vector))) + (set! (-> a1-2 quad) (-> self root trans quad)) + (set! (-> a1-2 y) (-> self start-y)) + (spawn (-> self cool-part) a1-2) + ) + ) + :code sleep-code + :post (behavior () + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate wait-to-cool (prebot-eco-pillar) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('cool-down) + (go-virtual cool-down) + ) + (else + (prebot-eco-pillar-handler proc argc message block) + ) + ) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 y) (-> self start-y)) + (spawn (-> self part) a1-0) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate grow (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* 819.2 37 600 1.0 1.1 (-> *display* camera-clock)) + (sound-play "columns-raise" :position (-> self root trans)) + ) + :exit (behavior () + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* 819.2 37 300 1.0 1.1 (-> *display* camera-clock)) + ) + :trans (behavior () + (set! (-> self root trans y) (lerp-scale + (+ 4300.8 (-> self start-y)) + (-> self end-y) + (the float (- (current-time) (-> self state-time))) + 0.0 + 75.0 + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 0.25)) + (go-virtual wait-to-cool) + ) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> self root trans quad)) + (set! (-> a1-1 y) (-> self start-y)) + (spawn (-> self part) a1-1) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate heat-up (prebot-eco-pillar) + :virtual #t + :event prebot-eco-pillar-handler + :enter (behavior () + (ja :num-func num-func-identity :frame-num max) + (set-time! (-> self state-time)) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + ) + :exit (behavior () + (set! (-> self hot) #t) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (set! (-> self hot) #t) + ) + (if (time-elapsed? (-> self state-time) (seconds 5)) + (go-virtual grow) + ) + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self root trans quad)) + (set! (-> a1-0 y) (-> self start-y)) + (spawn (-> self heat-part) a1-0) + ) + (set! (-> self root trans y) (lerp-scale + (-> self start-y) + (+ 4300.8 (-> self start-y)) + (the float (- (current-time) (-> self state-time))) + 0.0 + 300.0 + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition of type cav-exit-door +(deftype cav-exit-door (process-drawable) + ((initial-y float) + ) + (:state-methods + idle + rise + ) + ) + +;; definition for method 3 of type cav-exit-door +(defmethod inspect ((this cav-exit-door)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tinitial-y: ~f~%" (-> this initial-y)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate rise (cav-exit-door) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (sound-play "mb-door-open") + ) + :trans (behavior () + (set! (-> self root trans y) + (+ (-> self initial-y) (lerp-scale 0.0 32768.0 (the float (- (current-time) (-> self state-time))) 0.0 300.0)) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (sound-play "mb-door-hit") + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + :post transform-post + ) + +;; failed to figure out what this is: +(defstate idle (cav-exit-door) + :virtual #t + :enter (behavior () + (transform-post) + ) + :trans (behavior () + (let ((f0-0 (vector-vector-distance-squared (-> self root trans) (target-pos 0))) + (f1-0 16384.0) + ) + (if (< f0-0 (* f1-0 f1-0)) + (go-virtual rise) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 11 of type cav-exit-door +(defmethod init-from-entity! ((this cav-exit-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 74.1376 13979.238 -22.528 20222.771) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-exit-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this initial-y) (-> this root trans y)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-part_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-part_REF.gc new file mode 100644 index 0000000000..5f5ee1d8bc --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/prebot-part_REF.gc @@ -0,0 +1,1709 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function birth-func-pillar-rocks-bounce +;; WARN: Return type mismatch float vs none. +(defun birth-func-pillar-rocks-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg1 omega) (-> arg2 launchrot y)) + (none) + ) + +;; definition for function spt-func-pillar-rocks-bounce1 +;; INFO: Used lq/sq +(defun spt-func-pillar-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 4464) s4-0) + ) + ) + (none) + ) + +;; definition for function spt-func-pillar-rocks-bounce2 +;; INFO: Used lq/sq +(defun spt-func-pillar-rocks-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 4465) s4-0) + ) + ) + (none) + ) + +;; definition for function spt-func-pillar-rocks-bounce3 +;; WARN: Return type mismatch object vs none. +(defun spt-func-pillar-rocks-bounce3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (cond + ((or (< (-> arg1 omega) (-> arg2 launchrot y)) (< 0.0 (-> arg1 vel-sxvel y))) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + ) + (else + (set! (-> arg1 acc x) 0.0) + (set! (-> arg1 acc y) 0.0) + (set! (-> arg1 acc z) 0.0) + (set! (-> arg1 vel-sxvel x) (* 0.7 (-> arg1 vel-sxvel x))) + (set! (-> arg1 vel-sxvel z) (* 0.7 (-> arg1 vel-sxvel z))) + (set! (-> arg2 launchrot y) (-> arg1 omega)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-launch-critter + :id 1334 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4466 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4467 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4468 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4466 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.10666667)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4467 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 48.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees 70) (degrees 40)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4468 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 9011.25)) + (:scalevel-x (meters 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.4) + (:timer (seconds 0.15)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4469 + :init-specs ((:texture (pal-lightning-red level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 80.0 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4470 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 80.0 20.0) + (:b 128.0 64.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4471 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 1) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 100.0) + (:a 200.0 55.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-gun-shot-trail + :id 1335 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4472 :flags (sp6)) + (sp-item 4473 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 4474 :flags (sp6)) + (sp-item 4475 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +;; failed to figure out what this is: +(defpart 4472 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 10.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4475 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 6.0) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 30.0 30.0) + (:g :copy r) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:fade-a -0.42666668) + (:accel-y (meters -0.000033333334) (meters -0.000016666667)) + (:friction 0.96 0.01) + (:timer (seconds 0.5) (seconds 3.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.017) (seconds 0.497)) + (:next-launcher 4476) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4476 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 4477)) + ) + +;; failed to figure out what this is: +(defpart 4477 + :init-specs ((:r 30.0 30.0) (:g :copy r) (:b 255.0) (:next-time (seconds 0.017) (seconds 0.497)) (:next-launcher 4476)) + ) + +;; failed to figure out what this is: +(defpart 4474 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + (:next-time (seconds 0.035)) + (:next-launcher 4478) + ) + ) + +;; failed to figure out what this is: +(defpart 4478 + :init-specs ((:scale-x (meters 2.5)) (:scale-y :copy scale-x) (:r 0.0) (:g 0.0) (:b 255.0) (:a 16.0) (:fade-a -1.6)) + ) + +;; failed to figure out what this is: +(defpart 4473 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 3.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.005) (meters 0.008333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.2) + (:fade-g 3.2) + (:fade-b -3.2) + (:fade-a -0.10666667 -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x400000 #x405c00)) + (:next-time (seconds 0.135)) + (:next-launcher 4479) + ) + ) + +;; failed to figure out what this is: +(defpart 4479 + :init-specs ((:r 128.0) (:g 128.0) (:b 128.0) (:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-eco-pillar-heat-up + :id 1336 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4480) (sp-item 4481) (sp-item 4482 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4480 + :init-specs ((:texture (lava-drop-01 mined-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 1) (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:rotvel-z (degrees -2) (degrees 4)) + (:accel-y (meters -0.0023333333)) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 -1384120320 -1384120064 -1384119808 -1384119552)) + (:func 'check-drop-group-center) + (:next-time (seconds 0.167) (seconds 0.165)) + (:next-launcher 4483) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4483 + :init-specs ((:fade-r -1.275) (:fade-g -0.7) (:fade-b 0.05)) + ) + +;; failed to figure out what this is: +(defpart 4481 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0023333333)) + (:timer (seconds 1)) + (:flags (launch-along-z)) + (:func 'check-drop-group-center) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4482 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 0.1) + (:y (meters 1)) + (:scale-x (meters 10) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 0.0) + (:fade-a 1.7066667) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.25)) + (:next-launcher 4484) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4484 + :init-specs ((:fade-a -1.7066667)) + ) + +;; definition for function spt-birth-func-brightness-prebot-eco-pillar-rocks +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-eco-pillar-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 160)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 60)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 100)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; definition for function spt-birth-func-brightness-prebot-eco-pillar-rocks2 +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-eco-pillar-rocks2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 100)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 60)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 80)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; definition for function spt-birth-func-brightness-prebot-eco-pillar-rocks3 +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-eco-pillar-rocks3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 70)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 40)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-eco-pillar-grow + :id 1337 + :duration (seconds 0.017) + :linger-duration (seconds 10) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4485) + (sp-item 4486 :flags (is-3d sp3 sp7)) + (sp-item 4487 :period (seconds 20) :length (seconds 0.167)) + ) + ) + +;; failed to figure out what this is: +(defpart 4485 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.3) + (:x (meters 1) (meters 1)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g 0.14166667) + (:fade-b 0.20833333) + (:fade-a -0.053333335) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.95 0.01) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4486 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 11)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 60.0) + (:b 0.0) + (:a 128.0) + (:fade-a -0.08533333) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4487 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-rocks) + (:num 3.0) + (:x (meters 1) (meters 0.5)) + (:y (meters 0.5)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.023333333) (meters 0.06666667)) + (:rotvel-z (degrees -1) (degrees 2)) + (:fade-r -0.33333334) + (:fade-g -0.33333334) + (:fade-b -0.33333334) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-prebot-eco-pillar-rocks) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-prebot-eco-pillar-rocks +(defun spt-birth-func-part-prebot-eco-pillar-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-pillar-rocks-bounce arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-eco-pillar-rocks arg0 arg1 arg2) + (none) + ) + +;; definition for function spt-func-part-prebot-eco-pillar-rocks +(defun spt-func-part-prebot-eco-pillar-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-pillar-rocks-bounce1 arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 4464 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-rocks-bounce1) + (:num 0.5) + (:scale-x (meters 0.3) (meters 1) :store) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1) (degrees 2)) + (:fade-r -0.33333334) + (:fade-g -0.33333334) + (:fade-b -0.33333334) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x40ae00 + #x40ad00 + #x40ac00 + #x40ab00 + #x40aa00 + #x40a900 + #x40a800 + #x40a700 + #x40a600 + #x40a500 + #x40a400 + #x40a300 + #x40a200 + #x40a100 + #x408c00 + #x408b00 + ) + ) + (:func 'spt-func-part-prebot-eco-pillar-rocks-bounce1) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-prebot-eco-pillar-rocks-bounce1 +(defun spt-birth-func-part-prebot-eco-pillar-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-pillar-rocks-bounce arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-eco-pillar-rocks2 arg0 arg1 arg2) + (none) + ) + +;; definition for function spt-func-part-prebot-eco-pillar-rocks-bounce1 +(defun spt-func-part-prebot-eco-pillar-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-pillar-rocks-bounce2 arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 4465 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-rocks-bounce2) + (:num 0.5) + (:scale-x '*sp-temp*) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.3) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.01) (meters 0.016666668)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.33333334) + (:fade-g -0.33333334) + (:fade-b -0.33333334) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-pillar-rocks-bounce3) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-prebot-eco-pillar-rocks-bounce2 +(defun spt-birth-func-part-prebot-eco-pillar-rocks-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-pillar-rocks-bounce arg0 arg1 arg2) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-eco-pillar-rocks3 arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-eco-pillar-cool-down + :id 1338 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4488)) + ) + +;; failed to figure out what this is: +(defpart 4488 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.3) + (:x (meters 1) (meters 1)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 0.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.0016666667) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g 0.14166667) + (:fade-b 0.20833333) + (:fade-a -0.026666667) + (:accel-y (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.95 0.01) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4489 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 1)) + (:rot-x (degrees 22.725)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 150.0) + (:b 60.0) + (:a 100.0 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4490 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees -4) (degrees 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 64.0 16.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-stuck-flame + :id 1339 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4491)) + ) + +;; failed to figure out what this is: +(defpart 4491 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:friction 0.99 0.01) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-stuck-flame-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-stuck-flame-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-stuck-flame-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 6.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x -3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-stuck-flame-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 6.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x -3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *r-curve-mine-boss-stuck-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *g-curve-mine-boss-stuck-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.5 :w 0.3) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :y -5.0000005 :z -0.3333333 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *b-curve-mine-boss-stuck-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mine-boss-stuck-flame-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mine-boss-stuck-flame-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mine-boss-stuck-flame-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-prebot-stuck-flame-curve-settings*, type particle-curve-settings +(define *part-prebot-stuck-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.4) + :flags (particle-curve-flags pcf1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4491 init-specs 13 initial-valuef) + (the-as float *part-prebot-stuck-flame-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* color-start) *range-mine-boss-stuck-flame-color*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* alpha-start) *range-mine-boss-stuck-flame-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-x-start) *range-mine-boss-stuck-flame-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-y-start) *range-mine-boss-stuck-flame-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* r-scalar) *r-curve-mine-boss-stuck-flame*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* g-scalar) *g-curve-mine-boss-stuck-flame*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* b-scalar) *b-curve-mine-boss-stuck-flame*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* a-scalar) *curve-mine-boss-stuck-flame-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-x-scalar) *curve-mine-boss-stuck-flame-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-stuck-flame-curve-settings* scale-y-scalar) *curve-mine-boss-stuck-flame-scale-y*) + +;; failed to figure out what this is: +(defpartgroup group-prebot-chasm-explosion + :id 1340 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4492 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4493 :period (seconds 30) :length (seconds 1)) + (sp-item 4494 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4495 :period (seconds 30) :length (seconds 0.5)) + (sp-item 4496 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 4494 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 450)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.56) + (:fade-b -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4492 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 150)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.14222223) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4493 + :init-specs ((:texture (middot level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.00225)) + (:vel-y (meters 0.33333334) (meters 1.6666666)) + (:fade-g -0.128) + (:fade-b -0.42666668) + (:friction 0.95) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 4497) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees -20) (degrees 40)) + ) + ) + +;; failed to figure out what this is: +(defpart 4497 + :init-specs ((:omega (degrees 0.0225)) (:friction 0.97)) + ) + +;; failed to figure out what this is: +(defpart 4495 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 10.0) + (:scale-x (meters 5) (meters 5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 1) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y (meters 0.06666667) (meters 0.06666667)) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4496 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 10.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.6666667) (meters 0.33333334)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-prebot-chasm-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-prebot-chasm-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.3) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4496 init-specs 16 initial-valuef) + (the-as float *part-prebot-chasm-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* color-start) *range-mine-boss-explo-color*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* alpha-start) *range-mine-boss-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-x-start) *range-mine-boss-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-y-start) *range-mine-boss-explo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* a-scalar) *curve-mine-boss-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-x-scalar) + *curve-mine-boss-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-prebot-chasm-explosion-texture-curve-settings* scale-y-scalar) + *curve-mine-boss-explo-scale-y* + ) + +;; failed to figure out what this is: +(defpartgroup group-final-prebot-chasm-explosion + :id 1341 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 4498 :flags (sp3) :period (seconds 10) :length (seconds 0.017)) + (sp-item 4499 :flags (sp3) :period (seconds 10) :length (seconds 0.017)) + (sp-item 4500 :period (seconds 10) :length (seconds 0.085)) + (sp-item 4501 :period (seconds 10) :length (seconds 1)) + (sp-item 4502 :period (seconds 10) :length (seconds 1)) + ) + ) + +;; failed to figure out what this is: +(defpart 4498 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 450)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.56) + (:fade-b -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4499 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 120)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.14222223) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4500 + :init-specs ((:texture (middot level-default-sprite)) + (:num 50.0) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.06666667) (meters 0.33333334)) + (:fade-g -1.28) + (:fade-b -2.56) + (:friction 0.9) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -130) (degrees 260)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4501 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.2) (meters 0.16666667)) + (:scalevel-x (meters 0.006666667) (meters 0.016666668)) + (:scalevel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4502 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 3.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.16666667)) + (:friction 0.85 0.05) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-final-mine-boss-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-final-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-final-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 15.0 :z 16.0 :w 17.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-final-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 10.0 :y 15.0 :z 16.0 :w 17.0) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-final-mine-boss-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-final-mine-boss-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-final-mine-boss-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-final-prebot-chasm-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-final-prebot-chasm-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4502 init-specs 16 initial-valuef) + (the-as float *part-final-prebot-chasm-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* color-start) + *range-final-mine-boss-explo-color* + ) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* alpha-start) + *range-final-mine-boss-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-x-start) + *range-final-mine-boss-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-y-start) + *range-final-mine-boss-explo-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* a-scalar) + *curve-final-mine-boss-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-x-scalar) + *curve-final-mine-boss-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-final-prebot-chasm-explosion-texture-curve-settings* scale-y-scalar) + *curve-final-mine-boss-explo-scale-y* + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-chasm-explosion-comets + :id 1342 + :flags (sp0) + :bounds (static-bspherem 0 0 0 600) + :parts ((sp-item 4504 :flags (sp3) :binding 4503) + (sp-item 4504 :flags (sp3) :binding 4503) + (sp-item 4504 :flags (sp3) :binding 4503) + (sp-item 4503 :flags (sp2)) + (sp-item 4503 :flags (sp2)) + (sp-item 4503 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 4504 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 30)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 100.0) + (:a 1.0) + (:vel-y (meters 0.53333336) (meters 0.06666667)) + (:scalevel-x (meters -0.083333336)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.1 -0.1) + (:fade-b -0.05 -0.05) + (:accel-y (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 6.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405c00 #x406500 #x400000 #x400700)) + (:conerot-x (degrees 10) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4503 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.2) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0) + (:g 60.0 20.0) + (:b 20.0 10.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.1 -0.1) + (:fade-b -0.05 -0.05) + (:fade-a -0.016666668 -0.1) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-gun-shot-explosion + :id 1343 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4505 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4506 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4507 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4508 :period (seconds 30) :length (seconds 0.335)) + ) + ) + +;; failed to figure out what this is: +(defpart 4505 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4506 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.4) + (:fade-g -0.4) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4507 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 60.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4508 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g :copy r) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.26666668) + (:fade-g -0.26666668) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.85) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-brightness-prebot-pillar-shatter-rocks +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-prebot-pillar-shatter-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 90)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 40)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-prebot-pillar-shatter + :id 1344 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4509 :period (seconds 20) :length (seconds 0.035))) + ) + +;; failed to figure out what this is: +(defpart 4509 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-prebot-eco-pillar-shatter) + (:num 30.0) + (:x (meters 0) (meters 1)) + (:y (meters 0) (meters -10)) + (:scale-x (meters 0.1) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.023333333) (meters 0.06666667)) + (:scalevel-x (meters 0) (meters 0.06666667)) + (:rotvel-z (degrees -2) (degrees 4)) + (:scalevel-y (meters 0) (meters 0.06666667)) + (:fade-r -0.06666667) + (:fade-g -0.06666667) + (:fade-b -0.06666667) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-prebot-eco-pillar-shatter) + (:next-time (seconds 0.017)) + (:next-launcher 4510) + (:conerot-x (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4510 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0))) + ) + +;; definition for function spt-birth-func-part-prebot-eco-pillar-shatter +(defun spt-birth-func-part-prebot-eco-pillar-shatter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-prebot-pillar-shatter-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; definition for function spt-func-part-prebot-eco-pillar-shatter +(defun spt-func-part-prebot-eco-pillar-shatter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-setup_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-setup_REF.gc new file mode 100644 index 0000000000..20453fba5a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/prebot-setup_REF.gc @@ -0,0 +1,1351 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-prebot-camera prebot-camera prebot-camera-lod0-jg -1 + ((prebot-camera-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-exit-door cav-exit-door cav-exit-door-lod0-jg cav-exit-door-idle-ja + ((cav-exit-door-lod0-mg (meters 20)) (cav-exit-door-lod1-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-break-bridge cav-break-bridge cav-break-bridge-lod0-jg cav-break-bridge-idle-ja + ((cav-break-bridge-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -20 0 50) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil cav-pillar cav-pillar-lod0-jg cav-pillar-idle-ja + ((cav-pillar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil-b cav-pillar cav-pillar-b-lod0-jg cav-pillar-b-idle-ja + ((cav-pillar-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil-c cav-pillar cav-pillar-c-lod0-jg cav-pillar-c-idle-ja + ((cav-pillar-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil-d cav-pillar cav-pillar-d-lod0-jg cav-pillar-d-idle-ja + ((cav-pillar-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -10 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil-debris-a cav-pillar cav-pillar-debris-a-lod0-jg cav-pillar-debris-a-idle-ja + ((cav-pillar-debris-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil-debris-b cav-pillar cav-pillar-debris-b-lod0-jg cav-pillar-debris-b-idle-ja + ((cav-pillar-debris-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil-debris-c cav-pillar cav-pillar-debris-c-lod0-jg cav-pillar-debris-c-idle-ja + ((cav-pillar-debris-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-molten-pil-debris-d cav-pillar cav-pillar-debris-d-lod0-jg cav-pillar-debris-d-idle-ja + ((cav-pillar-debris-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-railblocker cav-railblocker cav-railblocker-lod0-jg cav-railblocker-idle-ja + ((cav-railblocker-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-railblocker-explode cav-railblocker cav-railblocker-explode-lod0-jg cav-railblocker-explode-idle-ja + ((cav-railblocker-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; definition for symbol *cav-railblocker-exploder-params*, type joint-exploder-static-params +(define *cav-railblocker-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 27 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-cav-minecar min-bomb-train min-bomb-train-lod0-jg min-bomb-train-idle-ja + ((min-bomb-train-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-prebot-tentacle prebot-tentacle prebot-tentacle-lod0-jg prebot-tentacle-idle-ja + ((prebot-tentacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-prebot-shockwave prebot-shockwave prebot-shockwave-lod0-jg prebot-shockwave-shockwave-ja + ((prebot-shockwave-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 62) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-prebot-sword prebot 80 prebot-sword-shadow-mg + ((prebot-sword-lod0-jg (meters 999999))) + :bounds (static-spherem 0 20 0 20) + :origin-joint-index 4 + ) + +;; failed to figure out what this is: +(defskelgroup skel-prebot-gun prebot prebot-sword-r-swords-horizontal-L2R-complete-ja prebot-gun-shadow-mg + ((prebot-gun-lod0-jg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-prebot prebot prebot-lod0-jg prebot-idle-ja + ((prebot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2 0 13.5) + :shadow prebot-shadow-mg + :origin-joint-index 3 + ) + +;; definition of type prebot-eco-pillar-launch-spec +(deftype prebot-eco-pillar-launch-spec (structure) + ((offset vector) + (height float) + (style int8) + ) + ) + +;; definition for method 3 of type prebot-eco-pillar-launch-spec +(defmethod inspect ((this prebot-eco-pillar-launch-spec)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prebot-eco-pillar-launch-spec) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Theight: ~f~%" (-> this height)) + (format #t "~1Tstyle: ~D~%" (-> this style)) + (label cfg-4) + this + ) + +;; definition of type prebot-eco-pillar +(deftype prebot-eco-pillar (process-drawable) + ((root collide-shape-moving :override) + (vulnerable symbol) + (hot symbol) + (start-y float) + (end-y float) + (heat-part sparticle-launch-control) + (cool-part sparticle-launch-control) + ) + (:state-methods + wait-to-die + heat-up + grow + cool-down + wait-to-cool + idle + ) + ) + +;; definition for method 3 of type prebot-eco-pillar +(defmethod inspect ((this prebot-eco-pillar)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tvulnerable: ~A~%" (-> this vulnerable)) + (format #t "~2Thot: ~A~%" (-> this hot)) + (format #t "~2Tstart-y: ~f~%" (-> this start-y)) + (format #t "~2Tend-y: ~f~%" (-> this end-y)) + (format #t "~2Theat-part: ~A~%" (-> this heat-part)) + (format #t "~2Tcool-part: ~A~%" (-> this cool-part)) + (label cfg-4) + this + ) + +;; definition of type cav-railblocker +(deftype cav-railblocker (process-focusable) + ((incoming-attack-id uint32) + (hit-points float) + (notify-on-die entity) + (notify-on-die-2 entity) + (trackable symbol) + (red-tip-change-time time-frame) + (alt-red-tip-on symbol) + ) + (:state-methods + idle + fall + ) + (:methods + (cav-railblocker-method-30 (_type_ symbol) none) + ) + ) + +;; definition for method 3 of type cav-railblocker +(defmethod inspect ((this cav-railblocker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tnotify-on-die: ~A~%" (-> this notify-on-die)) + (format #t "~2Tnotify-on-die-2: ~A~%" (-> this notify-on-die-2)) + (format #t "~2Ttrackable: ~A~%" (-> this trackable)) + (format #t "~2Tred-tip-change-time: ~D~%" (-> this red-tip-change-time)) + (format #t "~2Talt-red-tip-on: ~A~%" (-> this alt-red-tip-on)) + (label cfg-4) + this + ) + +;; definition of type cav-minecar +(deftype cav-minecar (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type cav-minecar +(defmethod inspect ((this cav-minecar)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type prebot-sword +(deftype prebot-sword (process-drawable) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string) + (blade-scale cam-float-seeker :inline) + (blade-jm joint-mod) + (sword-sound sound-id) + (sword-sound-playing symbol) + (prev-position vector :inline) + (use-pos-pitch symbol) + (old-target-dist float) + (alternate-sound sound-spec) + (whoosh-lead float) + (allow-whoosh symbol) + (current-volume float) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type prebot-sword +(defmethod inspect ((this prebot-sword)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (format #t "~2Tblade-scale: #~%" (-> this blade-scale)) + (format #t "~2Tblade-jm: ~A~%" (-> this blade-jm)) + (format #t "~2Tsword-sound: ~D~%" (-> this sword-sound)) + (format #t "~2Tsword-sound-playing: ~A~%" (-> this sword-sound-playing)) + (format #t "~2Tprev-position: #~%" (-> this prev-position)) + (format #t "~2Tuse-pos-pitch: ~A~%" (-> this use-pos-pitch)) + (format #t "~2Told-target-dist: ~f~%" (-> this old-target-dist)) + (format #t "~2Talternate-sound: ~A~%" (-> this alternate-sound)) + (format #t "~2Twhoosh-lead: ~f~%" (-> this whoosh-lead)) + (format #t "~2Tallow-whoosh: ~A~%" (-> this allow-whoosh)) + (format #t "~2Tcurrent-volume: ~f~%" (-> this current-volume)) + (label cfg-4) + this + ) + +;; definition of type prebot-shockwave +(deftype prebot-shockwave (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type prebot-shockwave +(defmethod inspect ((this prebot-shockwave)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type prebot-gun +(deftype prebot-gun (process-drawable) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type prebot-gun +(defmethod inspect ((this prebot-gun)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (label cfg-4) + this + ) + +;; definition of type prebot-tentacle +(deftype prebot-tentacle (process-drawable) + ((parent (pointer prebot) :override) + (root collide-shape-moving :override) + (prefix string) + (aim-jm joint-mod-polar-look-at) + (half-aim-jm joint-mod-polar-look-at) + (laser-sound sound-id) + (laser-sound-playing symbol) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type prebot-tentacle +(defmethod inspect ((this prebot-tentacle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (format #t "~2Taim-jm: ~A~%" (-> this aim-jm)) + (format #t "~2Thalf-aim-jm: ~A~%" (-> this half-aim-jm)) + (format #t "~2Tlaser-sound: ~D~%" (-> this laser-sound)) + (format #t "~2Tlaser-sound-playing: ~A~%" (-> this laser-sound-playing)) + (label cfg-4) + this + ) + +;; definition of type prebot-ammo-tracker +(deftype prebot-ammo-tracker (structure) + ((handle handle) + (where vector :inline) + (birth-next-time symbol) + (timer time-frame) + ) + ) + +;; definition for method 3 of type prebot-ammo-tracker +(defmethod inspect ((this prebot-ammo-tracker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prebot-ammo-tracker) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Twhere: #~%" (-> this where)) + (format #t "~1Tbirth-next-time: ~A~%" (-> this birth-next-time)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (label cfg-4) + this + ) + +;; definition of type prebot +(deftype prebot (process-focusable) + ((critters handle 28) + (critters-to-launch int8) + (gun handle) + (swords handle 2) + (tentacles handle 5) + (beam-projectile handle) + (pillars handle 5) + (original-position vector :inline) + (position cam-vector-seeker :inline) + (stage int8) + (stage-hit-points float) + (last-attack-id uint32) + (neck-angle cam-float-seeker :inline) + (no-collision-timer time-frame) + (num-attacks uint8) + (shoulder-aim-jm joint-mod-polar-look-at) + (shot-extra-y float) + (shot-extra-xz float) + (which-movie int8) + (light-flash cam-vector-seeker :inline) + (light-pulse oscillating-vector :inline) + (light-pulse-flicker delayed-rand-vector :inline) + (laugh-played symbol) + (grunt-played symbol) + (trythis-played symbol) + (laugh-timer time-frame) + (blocker handle) + (flags prebot-flag) + (pillar-hint-timer time-frame) + (minecar-hint-timer time-frame) + (ammo prebot-ammo-tracker 20 :inline) + ) + (:state-methods + beaten + play-fma + play-hit-movie + destroy-pillars + watch-pillars + create-pillars + activate-tentacles + watch-critters + launch-critters + sweep-done + sweep + slam-done + slam + pre-slam + jump-to-hover + hidden + test + ) + (:methods + (prebot-method-45 (_type_) none) + (prebot-method-46 (_type_) none) + ) + ) + +;; definition for method 3 of type prebot +(defmethod inspect ((this prebot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tcritters[28] @ #x~X~%" (-> this critters)) + (format #t "~2Tcritters-to-launch: ~D~%" (-> this critters-to-launch)) + (format #t "~2Tgun: ~D~%" (-> this gun)) + (format #t "~2Tswords[2] @ #x~X~%" (-> this swords)) + (format #t "~2Ttentacles[5] @ #x~X~%" (-> this tentacles)) + (format #t "~2Tbeam-projectile: ~D~%" (-> this beam-projectile)) + (format #t "~2Tpillars[5] @ #x~X~%" (-> this pillars)) + (format #t "~2Toriginal-position: #~%" (-> this original-position)) + (format #t "~2Tposition: #~%" (-> this position)) + (format #t "~2Tstage: ~D~%" (-> this stage)) + (format #t "~2Tstage-hit-points: ~f~%" (-> this stage-hit-points)) + (format #t "~2Tlast-attack-id: ~D~%" (-> this last-attack-id)) + (format #t "~2Tneck-angle: #~%" (-> this neck-angle)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tnum-attacks: ~D~%" (-> this num-attacks)) + (format #t "~2Tshoulder-aim-jm: ~A~%" (-> this shoulder-aim-jm)) + (format #t "~2Tshot-extra-y: ~f~%" (-> this shot-extra-y)) + (format #t "~2Tshot-extra-xz: ~f~%" (-> this shot-extra-xz)) + (format #t "~2Twhich-movie: ~D~%" (-> this which-movie)) + (format #t "~2Tlight-flash: #~%" (-> this light-flash)) + (format #t "~2Tlight-pulse: #~%" (-> this light-pulse)) + (format #t "~2Tlight-pulse-flicker: #~%" (-> this light-pulse-flicker)) + (format #t "~2Tlaugh-played: ~A~%" (-> this laugh-played)) + (format #t "~2Tgrunt-played: ~A~%" (-> this grunt-played)) + (format #t "~2Ttrythis-played: ~A~%" (-> this trythis-played)) + (format #t "~2Tlaugh-timer: ~D~%" (-> this laugh-timer)) + (format #t "~2Tblocker: ~D~%" (-> this blocker)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tpillar-hint-timer: ~D~%" (-> this pillar-hint-timer)) + (format #t "~2Tminecar-hint-timer: ~D~%" (-> this minecar-hint-timer)) + (format #t "~2Tammo[20] @ #x~X~%" (-> this ammo)) + (label cfg-4) + this + ) + +;; definition for function prebot-eco-pillar-init-by-other +;; INFO: Used lq/sq +(defbehavior prebot-eco-pillar-init-by-other prebot-eco-pillar ((arg0 vector) (arg1 prebot-eco-pillar-launch-spec)) + (let ((v1-0 (-> arg1 style))) + (cond + ((zero? v1-0) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-7) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-10 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> self root) s4-0) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 1) + (let ((s4-2 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-2 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-2 reaction) cshape-reaction-default) + (set! (-> s4-2 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 3) + (set-vector! (-> v1-21 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-2 total-prims) (the-as uint 1)) + (set! (-> s4-2 root-prim) v1-21) + ) + (set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w))) + (let ((v1-24 (-> s4-2 root-prim))) + (set! (-> s4-2 backup-collide-as) (-> v1-24 prim-core collide-as)) + (set! (-> s4-2 backup-collide-with) (-> v1-24 prim-core collide-with)) + ) + (set! (-> self root) s4-2) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ((= v1-0 2) + (let ((s4-4 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-4 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-4 reaction) cshape-reaction-default) + (set! (-> s4-4 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-mesh s4-4 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-35 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-35 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 3) + (set-vector! (-> v1-35 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-4 total-prims) (the-as uint 1)) + (set! (-> s4-4 root-prim) v1-35) + ) + (set! (-> s4-4 nav-radius) (* 0.75 (-> s4-4 root-prim local-sphere w))) + (let ((v1-38 (-> s4-4 root-prim))) + (set! (-> s4-4 backup-collide-as) (-> v1-38 prim-core collide-as)) + (set! (-> s4-4 backup-collide-with) (-> v1-38 prim-core collide-with)) + ) + (set! (-> self root) s4-4) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + (else + (let ((s4-6 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-6 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-6 reaction) cshape-reaction-default) + (set! (-> s4-6 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-49 (new 'process 'collide-shape-prim-mesh s4-6 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-49 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-49 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-49 prim-core action) (collide-action solid)) + (set! (-> v1-49 transform-index) 3) + (set-vector! (-> v1-49 local-sphere) 1337.7535 -32947.812 542.3104 36864.0) + (set! (-> s4-6 total-prims) (the-as uint 1)) + (set! (-> s4-6 root-prim) v1-49) + ) + (set! (-> s4-6 nav-radius) (* 0.75 (-> s4-6 root-prim local-sphere w))) + (let ((v1-52 (-> s4-6 root-prim))) + (set! (-> s4-6 backup-collide-as) (-> v1-52 prim-core collide-as)) + (set! (-> s4-6 backup-collide-with) (-> v1-52 prim-core collide-with)) + ) + (set! (-> self root) s4-6) + ) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-molten-pil-d" (the-as (pointer level) #f))) + (the-as pair 0) + ) + ) + ) + ) + (set! (-> self root event-self) 'touched) + (let ((s4-8 (new 'stack-no-clear 'vector))) + (let* ((s3-4 sincos!) + (s2-0 s4-8) + (f30-0 -16384.0) + (f28-0 32768.0) + (v1-61 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-62 (the-as number (logior #x3f800000 v1-61))) + ) + (s3-4 s2-0 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-62))))) + ) + (quaternion-set! (-> self root quat) 0.0 (-> s4-8 x) 0.0 (-> s4-8 y)) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self start-y) (-> self root trans y)) + (set! (-> self end-y) (+ (-> arg0 y) (-> arg1 height))) + (set! (-> self vulnerable) #f) + (set! (-> self hot) #f) + (set! (-> self heat-part) (create-launch-control (-> *part-group-id-table* 1336) self)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1337) self)) + (set! (-> self cool-part) (create-launch-control (-> *part-group-id-table* 1338) self)) + (go-virtual heat-up) + ) + +;; failed to figure out what this is: +(when (or (zero? *prebot-sword-color-curve*) (!= loading-level global)) + (set! *prebot-sword-color-curve* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *prebot-sword-color-curve* 2 'loading-level (the-as uint #t)) + ) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 0 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 0 second y) 0.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 0 second z) 0.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 0 second w) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 1 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 1 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 1 second z) 0.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-curve* pts data 1 second w) 1.0) + +;; failed to figure out what this is: +(when (or (zero? *prebot-sword-white-red-curve*) (!= loading-level global)) + (set! *prebot-sword-white-red-curve* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *prebot-sword-white-red-curve* 3 'loading-level (the-as uint #t)) + ) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 0 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 0 second y) 0.3125) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 0 second z) 0.3125) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 0 second w) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 1 first) 0.5) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 1 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 1 second y) 0.078125) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 1 second z) 0.078125) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 1 second w) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 2 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 2 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 2 second y) 0.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 2 second z) 0.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-white-red-curve* pts data 2 second w) 1.0) + +;; failed to figure out what this is: +(if #t + (set! *prebot-sword-width-curve* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if (or (zero? *prebot-sword-color-array*) (!= loading-level global)) + (set! *prebot-sword-color-array* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* color-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* alpha-2-mode) (the-as uint 6)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* alpha-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* width-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* base-width) 1.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* uv-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* uv-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* max-age) (seconds 0.3)) + +;; failed to figure out what this is: +(if #f + (set! (-> *prebot-sword-color-array* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *prebot-sword-color-array* tex-id) (the-as uint #x100300)) + ) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* width-curve) (the-as curve2d-piecewise *prebot-sword-width-curve*)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* color-curve) *prebot-sword-white-red-curve*) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* alpha-curve-2) #f) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* zbuffer?) #t) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* use-tape-mode?) #t) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *prebot-sword-color-array* frame-stagger) (the-as uint 1)) + +;; definition for function prebot-sword-init-by-other +;; INFO: Used lq/sq +(defbehavior prebot-sword-init-by-other prebot-sword ((arg0 string) (arg1 vector) (arg2 basic) (arg3 sound-spec)) + (let ((s2-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s2-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s2-0 reaction) cshape-reaction-default) + (set! (-> s2-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 4) + (set-vector! (-> v1-6 local-sphere) 0.0 45056.0 0.0 49152.0) + (set! (-> s2-0 total-prims) (the-as uint 1)) + (set! (-> s2-0 root-prim) v1-6) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-9 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s2-0 event-self) 'touched) + (set! (-> self root) s2-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self prev-position quad) (-> arg1 quad)) + (set! (-> self old-target-dist) 204800.0) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-sword" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-21 (-> self parent))) + (set! (-> self draw light-index) (-> (the-as prebot (if v1-21 + (the-as prebot (-> v1-21 0 self)) + ) + ) + draw + light-index + ) + ) + ) + (logior! (-> self mask) (process-mask enemy)) + (let ((v1-28 (-> self node-list data))) + (set! (-> v1-28 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-28 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-28 0 param2) arg2) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (let ((s5-1 (new 'stack-no-clear 'weapon-trail-tracker-spawn-params))) + (set! (-> s5-1 tracked-obj) (process->handle self)) + (set! (-> s5-1 max-num-crumbs) 200) + (set! (-> s5-1 joint0) 3) + (set! (-> s5-1 joint1) 5) + (set! (-> s5-1 appearance) *prebot-sword-color-array*) + (set! (-> *prebot-sword-color-array* tex-id) + (the-as uint (lookup-texture-id-by-name "sword-trail-low" (the-as string #f))) + ) + (let* ((v1-43 (estimate-light-trail-mem-usage + (the-as uint (-> s5-1 max-num-crumbs)) + (the-as uint (= (-> s5-1 appearance lie-mode) 3)) + ) + ) + (s4-2 (get-process *default-dead-pool* weapon-trail-tracker (+ v1-43 8192) 1)) + (s5-2 (-> (when s4-2 + (let ((t9-8 (method-of-type process activate))) + (t9-8 s4-2 (ppointer->process (-> self parent)) "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-2 weapon-trail-tracker-init-by-other s5-1) + (-> s4-2 ppointer) + ) + 0 + ) + ) + (s3-2 (-> (level-get *level* 'mined) draw-index)) + (s4-3 (vu1-bucket-map s3-2 4 (merc-mode mercneric2))) + (v1-50 (vu1-bucket-map s3-2 4 (merc-mode mm5))) + ) + (set! (-> (the-as weapon-trail-tracker s5-2) trail strip bucket) s4-3) + (set! (-> (the-as weapon-trail-tracker s5-2) trail strip sink) (the-as uint v1-50)) + ) + ) + (init (-> self blade-scale) 1.0 0.03 0.2 0.9) + (set! (-> self blade-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 4)) + (set! (-> self blade-jm track-mode) (track-mode no-trans no-rotate)) + (set-vector! (-> self blade-jm scale) 1.0 1.0 1.0 1.0) + (set! (-> self sword-sound) (new-sound-id)) + (set! (-> self sword-sound-playing) #f) + (set! (-> self use-pos-pitch) #f) + (set! (-> self alternate-sound) arg3) + (set! (-> self allow-whoosh) #f) + (set! (-> self whoosh-lead) 20480.0) + (set! (-> self current-volume) 1.0) + (go-virtual idle) + ) + +;; definition for function prebot-shockwave-init-by-other +;; INFO: Used lq/sq +(defbehavior prebot-shockwave-init-by-other prebot-shockwave ((arg0 vector) (arg1 quaternion)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-shockwave" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +;; definition for function prebot-gun-init-by-other +;; INFO: Used lq/sq +(defbehavior prebot-gun-init-by-other prebot-gun ((arg0 string) (arg1 vector)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 -32768.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-16 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> self root) s4-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-gun" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-26 (-> self parent))) + (set! (-> self draw light-index) (-> (the-as prebot (if v1-26 + (the-as prebot (-> v1-26 0 self)) + ) + ) + draw + light-index + ) + ) + ) + (logior! (-> self mask) (process-mask enemy)) + (let ((v1-33 (-> self node-list data))) + (set! (-> v1-33 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-33 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-33 0 param2) (the-as basic 44)) + ) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +;; definition for function prebot-tentacle-init-by-other +;; INFO: Used lq/sq +(defbehavior prebot-tentacle-init-by-other prebot-tentacle ((arg0 string) (arg1 vector) (arg2 int)) + (let ((s3-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s3-0 reaction) cshape-reaction-default) + (set! (-> s3-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s2-0 (new 'process 'collide-shape-prim-group s3-0 (the-as uint 1) 0))) + (set! (-> s3-0 total-prims) (the-as uint 2)) + (set! (-> s2-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s2-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> s2-0 prim-core action) (collide-action solid)) + (set! (-> s2-0 transform-index) 4) + (set-vector! (-> s2-0 local-sphere) 0.0 -32768.0 0.0 49152.0) + (set! (-> s3-0 root-prim) s2-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) + (let ((v1-16 (-> s3-0 root-prim))) + (set! (-> s3-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s3-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> s3-0 event-self) 'touched) + (set! (-> self root) s3-0) + ) + (set! (-> self root pause-adjust-distance) 409600.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (set! (-> self prefix) arg0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot-tentacle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-26 (-> self parent))) + (set! (-> self draw light-index) (-> (the-as prebot (if v1-26 + (the-as prebot (-> v1-26 0 self)) + ) + ) + draw + light-index + ) + ) + ) + (logior! (-> self mask) (process-mask enemy)) + (let ((v1-33 (-> self node-list data))) + (set! (-> v1-33 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!)) + (set! (-> v1-33 0 param1) (the-as basic (-> self parent))) + (set! (-> v1-33 0 param2) (the-as basic arg2)) + ) + (set! (-> self aim-jm) (new 'process 'joint-mod-polar-look-at)) + (initialize (-> self aim-jm) self 13) + (set! (-> self aim-jm ear) 2) + (set! (-> self aim-jm up) 0) + (set! (-> self aim-jm nose) 1) + (set! (-> self half-aim-jm) (new 'process 'joint-mod-polar-look-at)) + (initialize (-> self half-aim-jm) self 12) + (set! (-> self half-aim-jm ear) 2) + (set! (-> self half-aim-jm up) 0) + (set! (-> self half-aim-jm nose) 1) + (set! (-> self laser-sound) (new-sound-id)) + (set! (-> self laser-sound-playing) #f) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + +;; definition for method 11 of type prebot +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this prebot) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 18) 0))) + (set! (-> s4-0 total-prims) (the-as uint 19)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 8) + (set-vector! (-> s3-0 local-sphere) 0.0 -20480.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 10) + (set-vector! (-> v1-13 local-sphere) 0.0 2957.7217 3380.8384 20891.238) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 15) + (set-vector! (-> v1-15 local-sphere) 0.0 7224.115 0.0 16506.88) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 13) + (set-vector! (-> v1-17 local-sphere) 423.5264 3772.0063 0.0 10656.973) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 12) + (set-vector! (-> v1-19 local-sphere) -0.4096 0.0 0.0 11988.992) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 4) (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 31) + (set-vector! (-> v1-21 local-sphere) 0.0 7223.7056 0.0 16506.88) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 5) (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set! (-> v1-23 transform-index) 29) + (set-vector! (-> v1-23 local-sphere) -423.5264 3772.0063 0.0 10656.973) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 6) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 28) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 11988.992) + ) + (let ((v1-27 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 7) (the-as uint 0)))) + (set! (-> v1-27 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 8) + (set-vector! (-> v1-27 local-sphere) 0.0 1914.0608 1339.392 24913.51) + ) + (let ((v1-29 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 8) (the-as uint 0)))) + (set! (-> v1-29 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-29 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-29 prim-core action) (collide-action solid)) + (set! (-> v1-29 transform-index) 5) + (set-vector! (-> v1-29 local-sphere) 0.0 0.0 0.0 13063.373) + ) + (let ((v1-31 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 9) (the-as uint 0)))) + (set! (-> v1-31 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-31 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-31 prim-core action) (collide-action solid)) + (set! (-> v1-31 transform-index) 56) + (set-vector! (-> v1-31 local-sphere) 791.3472 14204.108 -1401.6512 12302.336) + ) + (let ((v1-33 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 10) (the-as uint 0)))) + (set! (-> v1-33 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-33 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-33 prim-core action) (collide-action solid)) + (set! (-> v1-33 transform-index) 57) + (set-vector! (-> v1-33 local-sphere) 120.0128 13062.144 1252.1472 11315.609) + ) + (let ((v1-35 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 11) (the-as uint 0)))) + (set! (-> v1-35 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-35 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-35 prim-core action) (collide-action solid)) + (set! (-> v1-35 transform-index) 54) + (set-vector! (-> v1-35 local-sphere) 557.056 12469.043 1004.3392 23741.234) + ) + (let ((v1-37 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 12) (the-as uint 0)))) + (set! (-> v1-37 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-37 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-37 prim-core action) (collide-action solid)) + (set! (-> v1-37 transform-index) 52) + (set-vector! (-> v1-37 local-sphere) 1070.2848 7083.6226 264.6016 14952.857) + ) + (let ((v1-39 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 13) (the-as uint 0)))) + (set! (-> v1-39 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-39 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-39 prim-core action) (collide-action solid)) + (set! (-> v1-39 transform-index) 63) + (set-vector! (-> v1-39 local-sphere) -790.528 14204.519 -1401.6512 12301.927) + ) + (let ((v1-41 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 14) (the-as uint 0)))) + (set! (-> v1-41 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-41 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-41 prim-core action) (collide-action solid)) + (set! (-> v1-41 transform-index) 64) + (set-vector! (-> v1-41 local-sphere) -120.4224 13062.963 1252.5568 11315.2) + ) + (let ((v1-43 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 15) (the-as uint 0)))) + (set! (-> v1-43 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-43 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-43 prim-core action) (collide-action solid)) + (set! (-> v1-43 transform-index) 61) + (set-vector! (-> v1-43 local-sphere) -556.6464 12469.453 1004.3392 23741.645) + ) + (let ((v1-45 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 16) (the-as uint 0)))) + (set! (-> v1-45 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-45 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-45 prim-core action) (collide-action solid)) + (set! (-> v1-45 transform-index) 59) + (set-vector! (-> v1-45 local-sphere) -1069.8752 7083.6226 264.192 14952.448) + ) + (let ((v1-47 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 17) (the-as uint 0)))) + (set! (-> v1-47 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-47 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list projectile)) + (set! (-> v1-47 prim-core action) (collide-action solid)) + (set! (-> v1-47 transform-index) 50) + (set-vector! (-> v1-47 local-sphere) 0.0 -3032.2688 430.08 11688.755) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-50 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-50 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-50 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (set! (-> this root pause-adjust-distance) 409600.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-prebot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this original-position quad) (-> this root trans quad)) + (init (-> this position) (-> this original-position) 0.004096 2048.0 0.125) + (set! (-> this draw light-index) (the-as uint 10)) + (dotimes (v1-64 28) + (set! (-> this critters v1-64) (the-as handle #f)) + ) + (set! (-> this gun) (the-as handle #f)) + (dotimes (v1-67 2) + (set! (-> this swords v1-67) (the-as handle #f)) + ) + (dotimes (v1-70 5) + (set! (-> this tentacles v1-70) (the-as handle #f)) + ) + (set! (-> this beam-projectile) (the-as handle #f)) + (dotimes (v1-73 5) + (set! (-> this pillars v1-73) (the-as handle #f)) + ) + (set! (-> this last-attack-id) (the-as uint 0)) + (let ((a0-133 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) + (if a0-133 + (change-to a0-133 this) + ) + ) + (init (-> this neck-angle) 0.0 0.01 0.1 0.9) + (let ((a0-135 (-> this node-list data 9))) + (set! (-> a0-135 param0) prebot-neck-callback) + ) + (prebot-method-45 this) + (set! (-> this shoulder-aim-jm) (new 'process 'joint-mod-polar-look-at)) + (initialize (-> this shoulder-aim-jm) this 28) + (set! (-> this shoulder-aim-jm ear) 2) + (set! (-> this shoulder-aim-jm up) 0) + (set! (-> this shoulder-aim-jm nose) 1) + (let ((v1-92 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-92 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-92 prim-core collide-with)) + ) + (set! (-> this no-collision-timer) 0) + (init (-> this light-flash) (the-as vector #f) 0.01 0.1 0.9) + (set-params! (-> this light-pulse) (the-as vector #f) 0.01 0.1 0.9) + (prebot-light-pulse-off) + (set-params! (-> this light-pulse-flicker) 15 120 0.1 0.1) + (set! (-> this laugh-timer) 0) + (set! (-> this blocker) (the-as handle #f)) + (let ((v1-102 (-> this entity extra perm))) + (logior! (-> v1-102 status) (entity-perm-status bit-5)) + (set! (-> this flags) (the-as prebot-flag (-> v1-102 user-object 0))) + ) + (dotimes (v1-104 20) + (set! (-> this ammo v1-104 handle) (the-as handle #f)) + (set! (-> this ammo v1-104 birth-next-time) #f) + ) + (prebot-go-next-stage) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc new file mode 100644 index 0000000000..d8f1e3cef7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc @@ -0,0 +1,2596 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function prebot-neck-callback +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior prebot-neck-callback prebot ((arg0 cspace) (arg1 transformq)) + (cspace<-parented-transformq-joint! arg0 arg1) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) arg0)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 bone transform fvec) 1.0)) + (s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 bone transform uvec) 1.0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) s4-0)) + (f28-0 (vector-normalize-ret-len! s3-1 1.0)) + ) + (vector-flatten! s3-1 s3-1 s5-0) + (vector-normalize! s3-1 1.0) + (let ((s4-1 self)) + (let ((f30-0 (vector-dot s3-1 s2-0))) + (cond + ((or (< 163840.0 f28-0) + (and (< 143360.0 f28-0) (= (fabs (-> s4-1 neck-angle target)) 0.0)) + (< f30-0 (cos 15473.777)) + (and (< f30-0 (cos 8192.0)) (= (fabs (-> s4-1 neck-angle target)) 0.0)) + (not (-> arg0 param1)) + ) + (set! (-> s4-1 neck-angle target) 0.0) + ) + (else + (set! (-> s4-1 neck-angle target) (fmin 1.0 (* 0.00012207031 (acos f30-0)))) + (if (< (vector-dot s3-1 (the-as vector (-> arg0 bone transform))) 0.0) + (set! (-> s4-1 neck-angle target) (- (-> s4-1 neck-angle target))) + ) + ) + ) + ) + (update! (-> s4-1 neck-angle) 0.0) + (let ((a1-9 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s5-0 (* 8192.0 (-> s4-1 neck-angle value)))) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-1 quad) (-> arg0 bone transform trans quad)) + (vector-reset! (-> arg0 bone transform trans)) + (matrix*! (-> arg0 bone transform) a1-9 (-> arg0 bone transform)) + (set! (-> arg0 bone transform trans quad) (-> s5-1 quad)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function prebot-light-pulse-off +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior prebot-light-pulse-off prebot () + (set! (-> self light-pulse target quad) (the-as uint128 0)) + (set! (-> self light-pulse value quad) (the-as uint128 0)) + (set! (-> self light-pulse vel quad) (the-as uint128 0)) + 0 + (none) + ) + +;; definition for function prebot-light-pulse-on +(defbehavior prebot-light-pulse-on prebot ((arg0 float) (arg1 float) (arg2 float)) + (let ((v0-0 (-> self light-pulse target))) + (set! (-> v0-0 x) arg0) + (set! (-> v0-0 y) arg1) + (set! (-> v0-0 z) arg2) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + +;; definition for function prebot-light-flash +;; INFO: Used lq/sq +(defbehavior prebot-light-flash prebot ((arg0 float) (arg1 float) (arg2 float)) + (local-vars (v1-1 float) (a3-2 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) arg0) + (set! (-> v1-0 y) arg1) + (set! (-> v1-0 z) arg2) + (set! (-> v1-0 w) 1.0) + (.lvf vf1 (&-> (-> self light-flash value) 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 a3-2 vf1) + (let ((f0-4 a3-2)) + (.lvf vf1 (&-> v1-0 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-1 vf1) + (when (< f0-4 v1-1) + (set-vector! (-> self light-flash value) arg0 arg1 arg2 1.0) + (let ((v0-0 (-> self light-flash vel))) + (set! (-> v0-0 quad) (the-as uint128 0)) + v0-0 + ) + ) + ) + ) + ) + ) + +;; definition for function prebot-prespool +(defbehavior prebot-prespool prebot () + (case (-> self stage) + ((1) + (script-eval '(want-anim "prebot-hit-a")) + ) + ((2) + (script-eval '(want-anim "prebot-hit-b")) + ) + (else + (script-eval '(want-anim "mine-boss-res")) + ) + ) + ) + +;; definition for function prebot-common +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior prebot-common prebot () + (dotimes (gp-0 20) + (cond + ((handle->process (-> self ammo gp-0 handle)) + (if (and (nonzero? (-> self ammo gp-0 timer)) (time-elapsed? (-> self ammo gp-0 timer) (seconds 20))) + (send-event (handle->process (-> self ammo gp-0 handle)) 'die) + ) + ) + ((-> self ammo gp-0 birth-next-time) + (set! (-> self ammo gp-0 birth-next-time) #f) + (set-time! (-> self ammo gp-0 timer)) + (let ((a0-16 (new 'static 'fact-info))) + (set-vector! (new 'stack-no-clear 'vector) 0.0 57001.605 0.0 1.0) + (set! (-> a0-16 options) (actor-option fade-out fall no-distance-check-fadeout)) + (set! (-> a0-16 fade-time) (seconds 10)) + (set! (-> a0-16 pickup-spawn-amount) 1.0) + (set! (-> a0-16 pickup-type) (pickup-type ammo-random)) + (set! (-> a0-16 pickup-amount) 10.0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self root trans quad)) + (set! (-> self root trans quad) + (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 gp-0)))) + ) + (set! (-> a0-16 process) self) + (set! (-> self ammo gp-0 handle) + (ppointer->handle (drop-pickup a0-16 #t *entity-pool* (the-as fact-info #f) 0 #t)) + ) + (set! (-> self root trans quad) (-> s5-0 quad)) + ) + ) + ) + ) + ) + (update! (-> self light-flash) (the-as vector #f)) + (when (!= (-> self light-pulse target w) 0.0) + (update-with-delay! (-> self light-pulse-flicker)) + (update! (-> self light-pulse) (-> self light-pulse-flicker value)) + ) + (let ((a0-27 (new 'stack-no-clear 'vector))) + (vector+! a0-27 (-> self light-flash value) (the-as vector (-> self light-pulse))) + (set! (-> a0-27 x) (fmax 0.0 (-> a0-27 x))) + (set! (-> a0-27 y) (fmax 0.0 (-> a0-27 y))) + (set! (-> a0-27 z) (fmax 0.0 (-> a0-27 z))) + (set! (-> a0-27 w) 1.0) + (set-mined-filter! a0-27 0) + ) + (set! (-> *game-info* counter) (the float (-> self stage))) + (prebot-prespool) + (update! (-> self position) (the-as vector #f)) + (set! (-> self root trans quad) (-> self position value quad)) + (let* ((f0-17 (* 54.613335 (the float (current-time)))) + (f0-18 (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0))) + ) + (+! (-> self root trans y) (* 2048.0 (cos f0-18))) + ) + (cond + ((and (-> self next-state) (= (-> self next-state name) 'watch-critters)) + (remove-setting! 'point-of-interest) + ) + (else + (let ((t0-1 (new 'static 'vector))) + (set! (-> t0-1 quad) (-> self root trans quad)) + (+! (-> t0-1 y) 16384.0) + (set-setting! 'point-of-interest 'abs t0-1 0) + ) + ) + ) + ) + +;; definition for method 10 of type prebot +(defmethod deactivate ((this prebot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set-mined-filter! *zero-vector* 0) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 7 of type prebot +;; WARN: Return type mismatch process-focusable vs prebot. +(defmethod relocate ((this prebot) (offset int)) + (if (nonzero? (-> this shoulder-aim-jm)) + (&+! (-> this shoulder-aim-jm) offset) + ) + (the-as prebot ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for function prebot-go-next-stage +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defbehavior prebot-go-next-stage prebot () + (local-vars (v1-4 (pointer actor-group)) (sv-16 res-tag)) + (cond + ((not (task-node-closed? (game-task-node mine-boss-introduction))) + (set! (-> self stage) 0) + 0 + ) + ((task-node-closed? (game-task-node mine-boss-resolution)) + (set! (-> self stage) 4) + ) + ((begin + (set! (-> self stage) 1) + (set! sv-16 (new 'static 'res-tag)) + (set! v1-4 (res-lump-data (-> self entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16))) + (and v1-4 (nonzero? (-> sv-16 elt-count))) + ) + (let ((v1-5 (-> v1-4 0))) + (dotimes (a0-5 (-> v1-5 length)) + (let ((a1-7 (-> v1-5 data a0-5 actor))) + (when a1-7 + (if (logtest? (-> a1-7 extra perm status) (entity-perm-status subtask-complete)) + (+! (-> self stage) 1) + ) + ) + ) + ) + ) + ) + (else + (format #t "ERROR: could not find actor-group for ~S~%" (-> self name)) + ) + ) + (set! (-> self stage-hit-points) 1.0) + (remove-setting! 'entity-name) + (when (and (< (-> self stage) 4) (not (handle->process (-> self blocker)))) + (let ((gp-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (set! (-> gp-0 0 quad) (-> self entity extra trans quad)) + (+! (-> gp-0 0 x) 163840.0) + (+! (-> gp-0 0 y) -81920.0) + (+! (-> gp-0 0 z) 4096.0) + (set! (-> gp-0 1 quad) (-> self entity extra trans quad)) + (+! (-> gp-0 1 x) -163840.0) + (+! (-> gp-0 1 y) -81920.0) + (+! (-> gp-0 1 z) 4096.0) + (set! (-> self blocker) + (ppointer->handle (process-spawn blocking-plane gp-0 #x48c80000 :name "blocking-plane" :to self)) + ) + ) + (send-event (handle->process (-> self blocker)) 'collide-as #x4000000) + ) + (let ((v1-39 (-> self stage))) + (cond + ((zero? v1-39) + (go-virtual hidden) + ) + ((= v1-39 1) + (set-setting! 'entity-name "camera-308" 0.0 0) + (set! (-> self laugh-played) #f) + (go-virtual jump-to-hover) + ) + ((or (= v1-39 2) (= v1-39 3)) + (set-setting! 'entity-name "camera-308" 0.0 0) + (set! (-> self laugh-played) #f) + (go-virtual pre-slam) + ) + (else + (go-virtual beaten) + ) + ) + ) + 0 + ) + +;; definition for method 20 of type prebot +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this prebot)) + (the-as search-info-flag 0) + ) + +;; definition for method 45 of type prebot +;; WARN: Return type mismatch symbol vs none. +(defmethod prebot-method-45 ((this prebot)) + (set! (-> this node-list data 9 param1) (the-as basic #t)) + (none) + ) + +;; definition for method 46 of type prebot +;; WARN: Return type mismatch symbol vs none. +(defmethod prebot-method-46 ((this prebot)) + (set! (-> this node-list data 9 param1) #f) + (none) + ) + +;; definition for function prebot-handler +;; INFO: Used lq/sq +(defbehavior prebot-handler prebot ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('touched-hot-pillar) + (when (not (logtest? (-> self flags) (prebot-flag pf0))) + (logior! (-> self flags) (prebot-flag pf0)) + (let ((v1-7 (-> self entity extra perm))) + (logior! (-> v1-7 status) (entity-perm-status bit-5)) + (set! (-> v1-7 user-object 0) (-> self flags)) + ) + (talker-spawn-func (-> *talker-speech* 331) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ) + (('shot-hit) + (if (line-in-view-frustum? (the-as vector (-> arg3 param 0)) (the-as vector (-> arg3 param 0))) + (prebot-light-flash 0.0 0.4 1.0) + ) + ) + (('skip 'blocker-died) + (if (= arg2 'blocker-died) + (prebot-light-flash 1.0 0.4 0.0) + ) + (set! (-> self which-movie) (the-as int (-> arg3 param 0))) + (go-virtual play-hit-movie) + ) + (('railblocker-hittable?) + (when (-> arg3 param 0) + (set! (-> self minecar-hint-timer) 0) + 0 + ) + (and (and (-> self next-state) (let ((v1-21 (-> self next-state name))) + (or (= v1-21 'watch-pillars) (= v1-21 'destroy-pillars)) + ) + ) + (< (+ 32358.4 (-> self entity extra trans y)) (-> (target-pos 0) y)) + ) + ) + (('attack) + (when (>= (+ (current-time) (seconds -5.1)) (-> self laugh-timer)) + (set-time! (-> self laugh-timer)) + (sound-play "prebot-laugh" :position (-> self root trans)) + ) + #t + ) + (('start-critter) + (dotimes (v1-34 28) + (when (not (handle->process (-> self critters v1-34))) + (set! (-> self critters v1-34) (process->handle arg0)) + (set! v0-0 #f) + (goto cfg-50) + ) + ) + (set! v0-0 #f) + (label cfg-50) + v0-0 + ) + (('eco-creature-died) + (dotimes (v1-38 20) + (when (and (not (-> self ammo v1-38 birth-next-time)) (not (handle->process (-> self ammo v1-38 handle)))) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 v1-38)))) + (-> (the-as vector (-> arg3 param 0)) quad) + ) + (set! (-> self ammo v1-38 birth-next-time) #t) + (return 0) + ) + ) + #f + ) + ) + ) + +;; failed to figure out what this is: +(defstate beaten (prebot) + :virtual #t + :enter (behavior () + (ja-channel-set! 0) + (ja-post) + (let ((a0-2 (handle->process (-> self blocker)))) + (if a0-2 + (deactivate a0-2) + ) + ) + (remove-setting! 'point-of-interest) + ) + :exit (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! prebot-idle-ja :num! min) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate play-fma (prebot) + :virtual #t + :enter (behavior () + (set-blackout-frames (seconds 0.007)) + (set-time! (-> self state-time)) + (case (-> self stage) + ((1) + (process-spawn scene-player :init scene-player-init "prebot-hit-a" #t #f :name "scene-player") + ) + ((2) + (process-spawn scene-player :init scene-player-init "prebot-hit-b" #t #f :name "scene-player") + ) + (else + (let* ((v1-13 (-> *game-info* sub-task-list (game-task-node mine-boss-resolution))) + (v1-15 (if (-> v1-13 manager) + (-> v1-13 manager manager) + (the-as handle #f) + ) + ) + ) + (send-event (handle->process v1-15) 'complete) + ) + ) + ) + (deactivate self) + ) + :trans (behavior () + (remove-setting! 'point-of-interest) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) + (deactivate self) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate play-hit-movie (prebot) + :virtual #t + :enter (behavior () + (kill-by-type eco-pill *active-pool*) + (kill-by-type ammo-collectable *active-pool*) + (prebot-light-pulse-off) + ) + :exit (behavior () + (process-release? *target*) + ) + :trans (behavior () + (remove-setting! 'point-of-interest) + (prebot-prespool) + (set-letterbox-frames (seconds 0.007)) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (or (= v1-4 prebot-mine-boss-train-1-ja) + (= v1-4 prebot-mine-boss-train-2-ja) + (= v1-4 prebot-mine-boss-train-3-ja) + ) + ) + (process-grab? *target* #f) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self root trans quad) (-> self entity extra trans quad)) + (process-release? *target*) + (go-virtual play-fma) + ) + ) + (else + (let ((gp-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) + (let ((v1-19 (the-as entity-actor (entity-by-name "scene-stage-133")))) + (when v1-19 + (set! (-> self root trans quad) (-> v1-19 extra trans quad)) + (quaternion-copy! gp-0 (-> v1-19 quat)) + ) + ) + (ja-channel-push! 1 0) + (let ((v1-20 (-> self which-movie))) + (cond + ((zero? v1-20) + (ja :group! prebot-mine-boss-train-1-ja :num! min) + ) + ((= v1-20 1) + (ja :group! prebot-mine-boss-train-2-ja :num! min) + ) + (else + (ja :group! prebot-mine-boss-train-3-ja :num! min) + ) + ) + ) + (process-grab? *target* #f) + (let ((s5-3 (process-spawn + manipy + :init manipy-init + (-> self root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-cav-minecar" (the-as (pointer level) #f)) + #f + 0 + :name "cav-minecar" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-3 + (send-event (ppointer->process s5-3) 'anim-mode 'clone-anim) + (send-event (ppointer->process s5-3) 'clone-copy-trans #f) + (send-event (ppointer->process s5-3) 'rot-quat gp-0) + ) + ) + (let ((s5-5 (process-spawn + manipy + :init manipy-init + (-> self root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-prebot-camera" (the-as (pointer level) #f)) + #f + 0 + :name "prebot-camera" + :to self + :stack-size #x20000 + ) + ) + ) + (when s5-5 + (send-event (ppointer->process s5-5) 'anim-mode 'clone-anim) + (send-event (ppointer->process s5-5) 'clone-copy-trans #f) + (send-event (ppointer->process s5-5) 'rot-quat gp-0) + (let ((v1-83 + (process-spawn othercam (ppointer->process s5-5) 4 #f #f :name "othercam" :to (ppointer->process s5-5)) + ) + ) + (if v1-83 + (send-event (ppointer->process v1-83) 'mask 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for function prebot-set-cam-slave-fov +(defbehavior prebot-set-cam-slave-fov prebot ((arg0 float)) + (let ((v1-1 (-> *camera* slave))) + (if v1-1 + (set! (-> v1-1 0 fov) arg0) + ) + ) + ) + +;; failed to figure out what this is: +(defstate destroy-pillars (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set! (-> self state-time) 0) + (set! (-> self num-attacks) (the-as uint 0)) + (set-setting! 'entity-name "camera-312" 0.0 0) + (dotimes (gp-0 5) + (send-event (handle->process (-> self pillars gp-0)) 'vulnerable) + ) + ) + :exit (behavior () + (prebot-set-cam-slave-fov 11650.845) + (set-setting! 'entity-name "camera-308" 0.0 0) + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + ) + :trans (behavior () + (if (= (get-aspect-ratio) 'aspect16x9) + (prebot-set-cam-slave-fov 13653.333) + (prebot-set-cam-slave-fov 11650.845) + ) + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (= v1-4 prebot-gun-stow-again-ja)) + (ja :num! (seek!)) + (when (and (= (-> self stage) 1) (not (-> self laugh-played)) (>= (ja-aframe-num 0) 280.0)) + (set-time! (-> self laugh-timer)) + (set! (-> self laugh-played) #t) + (sound-play "prebot-laugh" :position (-> self root trans)) + ) + (when (ja-done? 0) + (let ((a0-14 (handle->process (-> self gun)))) + (if a0-14 + (deactivate a0-14) + ) + ) + (go-virtual slam) + ) + ) + ((let ((v1-39 (ja-group))) + (and v1-39 (= v1-39 prebot-gun-fire-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + (set-time! (-> self state-time)) + ) + ) + ((let ((v1-60 (ja-group))) + (and v1-60 (= v1-60 prebot-gun-target-ja)) + ) + (ja :num! (loop!)) + (while (and (< (-> self num-attacks) (the-as uint 4)) + (not (handle->process (-> self pillars (-> self num-attacks)))) + ) + (+! (-> self num-attacks) 1) + ) + (let ((gp-3 (handle->process (-> self pillars (-> self num-attacks))))) + (when gp-3 + (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) + (let ((a1-10 (new 'stack-no-clear 'vector))) + (set! (-> a1-10 quad) (-> (the-as process-drawable gp-3) root trans quad)) + (+! (-> a1-10 y) -14336.0) + (set-target! (-> self shoulder-aim-jm) a1-10) + ) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set-time! (-> self state-time)) + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((and (>= (-> self num-attacks) (the-as uint 4)) + (not (handle->process (-> self pillars (-> self num-attacks)))) + ) + (ja :group! prebot-gun-stow-again-ja :num! min) + (set! (-> self laugh-played) #f) + ) + (else + (ja :group! prebot-gun-fire-ja :num! min) + (send-event (handle->process (-> self gun)) 'fire) + (prebot-light-flash 1.0 0.4 0.0) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for function prebot-setup-shot-offsets +;; WARN: Return type mismatch float vs object. +(defbehavior prebot-setup-shot-offsets prebot () + (let* ((f30-0 -2048.0) + (f28-0 12288.0) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + ) + (set! (-> self shot-extra-y) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) + ) + (let* ((f30-1 12288.0) + (f28-1 8192.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (set! (-> self shot-extra-xz) (+ f30-1 (* f28-1 (+ -1.0 (the-as float v1-10))))) + ) + (let* ((v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-14 (the-as number (logior #x3f800000 v1-13))) + ) + (if (< (+ -1.0 (the-as float v1-14)) 0.5) + (set! (-> self shot-extra-xz) (- (-> self shot-extra-xz))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate watch-pillars (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (cond + ((and (logtest? (-> self flags) (prebot-flag pf1)) (logtest? (-> self flags) (prebot-flag pf2))) + (set! (-> self pillar-hint-timer) 0) + 0 + ) + (else + (set-time! (-> self pillar-hint-timer)) + ) + ) + (set-time! (-> self minecar-hint-timer)) + (case (-> self stage) + ((1) + (set! (-> self num-attacks) (the-as uint 20)) + ) + ((2) + (set! (-> self num-attacks) (the-as uint 15)) + ) + (else + (set! (-> self num-attacks) (the-as uint 10)) + ) + ) + (prebot-setup-shot-offsets) + (set-setting! 'entity-name "camera-312" 0.0 0) + ) + :exit (behavior () + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + (prebot-set-cam-slave-fov 11650.845) + (set-setting! 'entity-name "camera-308" 0.0 0) + ) + :trans (behavior () + (when (send-event self 'railblocker-hittable? #f) + (set! (-> self pillar-hint-timer) 0) + 0 + ) + (when (nonzero? (-> self pillar-hint-timer)) + (set! (-> self minecar-hint-timer) (+ (current-time) (seconds -4))) + (when (time-elapsed? (-> self pillar-hint-timer) (seconds 10)) + (set! (-> self pillar-hint-timer) 0) + (cond + ((not (logtest? (-> self flags) (prebot-flag pf1))) + (talker-spawn-func (-> *talker-speech* 328) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf1)) + ) + ((not (logtest? (-> self flags) (prebot-flag pf2))) + (talker-spawn-func (-> *talker-speech* 330) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf2)) + ) + ) + (let ((v1-28 (-> self entity extra perm))) + (logior! (-> v1-28 status) (entity-perm-status bit-5)) + (set! (-> v1-28 user-object 0) (-> self flags)) + ) + ) + ) + (when (and (nonzero? (-> self minecar-hint-timer)) (time-elapsed? (-> self minecar-hint-timer) (seconds 10))) + (set! (-> self minecar-hint-timer) 0) + (cond + ((< 1 (-> self stage)) + (when (not (logtest? (-> self flags) (prebot-flag pf6))) + (talker-spawn-func (-> *talker-speech* 333) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf6)) + ) + ) + ((not (logtest? (-> self flags) (prebot-flag pf3))) + (talker-spawn-func (-> *talker-speech* 327) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf3)) + ) + ((not (logtest? (-> self flags) (prebot-flag pf4))) + (talker-spawn-func (-> *talker-speech* 329) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf4)) + ) + ((not (logtest? (-> self flags) (prebot-flag pf5))) + (talker-spawn-func (-> *talker-speech* 332) *entity-pool* (target-pos 0) (the-as region #f)) + (logior! (-> self flags) (prebot-flag pf5)) + ) + ) + (let ((v1-63 (-> self entity extra perm))) + (logior! (-> v1-63 status) (entity-perm-status bit-5)) + (set! (-> v1-63 user-object 0) (-> self flags)) + ) + ) + (if (= (get-aspect-ratio) 'aspect16x9) + (prebot-set-cam-slave-fov 13653.333) + (prebot-set-cam-slave-fov 11650.845) + ) + (let ((v1-68 (ja-group))) + (cond + ((and v1-68 (= v1-68 prebot-gun-from-tentacle-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + (set-time! (-> self state-time)) + (prebot-setup-shot-offsets) + ) + ) + ((let ((v1-90 (ja-group))) + (and v1-90 (= v1-90 prebot-gun-fire-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (if (>= (the-as uint 1) (-> self num-attacks)) + (go-virtual destroy-pillars) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-target-ja :num! min) + (set-time! (-> self state-time)) + (prebot-setup-shot-offsets) + ) + ) + ((let ((v1-117 (ja-group))) + (and v1-117 (= v1-117 prebot-gun-target-ja)) + ) + (ja :num! (loop!)) + (cond + ((time-elapsed? (-> self state-time) (seconds 1)) + (send-event (handle->process (-> self gun)) 'fire) + (prebot-light-flash 1.0 0.4 0.0) + (+! (-> self num-attacks) -1) + (set-time! (-> self state-time)) + (blend-to-off! (-> self shoulder-aim-jm) (seconds 0.1) #f) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! prebot-gun-fire-ja :num! min) + ) + (else + (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) + (let ((gp-10 (new 'stack-no-clear 'vector))) + (set! (-> gp-10 quad) (-> (target-pos 0) quad)) + (let ((s5-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-lod0-jg shoulderL)))) + (+! (-> gp-10 y) (-> self shot-extra-y)) + (set! (-> s5-6 y) (-> s5-6 x)) + (set! (-> s5-6 x) (-> s5-6 z)) + (set! (-> s5-6 z) (- (-> s5-6 y))) + (set! (-> s5-6 y) 0.0) + (vector-normalize! s5-6 (-> self shot-extra-xz)) + (vector+! gp-10 gp-10 s5-6) + ) + (set-target! (-> self shoulder-aim-jm) gp-10) + ) + ) + ) + ) + ((let ((v1-154 (ja-group))) + (and v1-154 (= v1-154 prebot-tentacle-stow-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-from-tentacle-ja :num! min) + (set! (-> self gun) + (ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self)) + ) + (setup-masks (-> self draw) 0 0) + (dotimes (gp-13 5) + (let ((a0-81 (handle->process (-> self tentacles gp-13)))) + (if a0-81 + (deactivate a0-81) + ) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-tentacle-stow-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for function prebot-fire-tentacle +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defbehavior prebot-fire-tentacle prebot ((arg0 handle) (arg1 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> self root trans quad)) + (let ((v1-2 (handle->process arg0))) + (if v1-2 + (vector<-cspace! s5-0 (-> (the-as prebot-tentacle v1-2) node-list data 14)) + ) + ) + (let ((a2-0 (new 'stack-no-clear 'vector))) + (vector-! a2-0 arg1 s5-0) + (set! (-> *part-id-table* 4469 init-specs 4 initial-valuef) (vector-length a2-0)) + (draw-beam (-> *part-id-table* 4469) s5-0 a2-0 #f) + ) + (launch-particles (-> *part-id-table* 4470) s5-0) + ) + (launch-particles (-> *part-id-table* 4471) arg1) + ) + +;; failed to figure out what this is: +(defstate create-pillars (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self num-attacks) (the-as uint 0)) + (set-setting! 'entity-name "camera-309" 0.0 0) + (set-mined-pillar-texture! 0.0) + ) + :exit (behavior () + (set-setting! 'entity-name "camera-312" 0.0 0) + (set-mined-pillar-texture! 1.0) + (let ((a0-3 (handle->process (-> self beam-projectile)))) + (when a0-3 + (deactivate a0-3) + (set! (-> self beam-projectile) (the-as handle #f)) + ) + ) + ) + :trans (behavior () + (let* ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (v1-0 (-> self stage)) + (gp-0 (cond + ((= v1-0 1) + (new 'static 'boxed-array :type prebot-eco-pillar-launch-spec + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 40960.0 :z 163840.0 :w 1.0) + :height 12288.0 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 20480.0 :z 204800.0 :w 1.0) + :height 22528.0 + :style 1 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -20480.0 :z 204800.0 :w 1.0) + :height 32768.0 + :style 2 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :z 184320.0 :w 1.0) + :height 43008.0 + :style 3 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -40960.0 :z 163840.0 :w 1.0) + :height 53248.0 + ) + ) + ) + ((= v1-0 2) + (new 'static 'boxed-array :type prebot-eco-pillar-launch-spec + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 12288.0 :z 184320.0 :w 1.0) + :height 12288.0 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -40960.0 :z 204800.0 :w 1.0) + :height 22528.0 + :style 1 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -32768.0 :z 163840.0 :w 1.0) + :height 32768.0 + :style 2 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :z 131072.0 :w 1.0) + :height 43008.0 + :style 3 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 49152.0 :z 143360.0 :w 1.0) + :height 53248.0 + ) + ) + ) + (else + (new 'static 'boxed-array :type prebot-eco-pillar-launch-spec + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -73728.0 :z 163840.0 :w 1.0) + :height 12288.0 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -40960.0 :z 204800.0 :w 1.0) + :height 22528.0 + :style 1 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x -20480.0 :z 163840.0 :w 1.0) + :height 32768.0 + :style 2 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 24576.0 :z 163840.0 :w 1.0) + :height 43008.0 + :style 3 + ) + (new 'static 'prebot-eco-pillar-launch-spec + :offset (new 'static 'vector :x 8192.0 :z 204800.0 :w 1.0) + :height 53248.0 + ) + ) + ) + ) + ) + ) + (let ((f30-0 0.0)) + (set! (-> self num-attacks) (the-as uint 0)) + (dotimes (s3-0 (min 5 (-> gp-0 length))) + (vector+! s5-0 (-> gp-0 s3-0 offset) (-> self original-position)) + (set! (-> s4-0 quad) (-> s5-0 quad)) + (+! (-> s4-0 x) + (* 4096.0 (cos (* 1747.6267 (the float (+ (* 30 s3-0) (- (current-time) (-> self state-time))))))) + ) + (cond + ((not (time-elapsed? (-> self state-time) (+ (* 240 s3-0) 75))) + (send-event (handle->process (-> self tentacles s3-0)) 'look-at s5-0 #f) + ) + ((not (handle->process (-> self pillars s3-0))) + (let ((v1-27 (process-spawn prebot-eco-pillar s5-0 (-> gp-0 s3-0) :name "prebot-eco-pillar" :to self))) + (if v1-27 + (set! (-> self pillars s3-0) (ppointer->handle v1-27)) + ) + ) + (send-event (handle->process (-> self tentacles s3-0)) 'look-at s5-0 #t) + ) + (else + (set! f30-0 (cond + ((not (time-elapsed? (-> self state-time) (+ (* 240 s3-0) 1575))) + (prebot-fire-tentacle (-> self tentacles s3-0) s4-0) + (+ 1.0 f30-0) + ) + (else + (send-event (handle->process (-> self tentacles s3-0)) 'look-at #f #f) + f30-0 + ) + ) + ) + ) + ) + (let ((v1-63 (handle->process (-> self pillars s3-0)))) + (when v1-63 + (if (and (-> v1-63 next-state) (= (-> v1-63 next-state name) 'wait-to-cool)) + (+! (-> self num-attacks) 1) + ) + ) + ) + ) + (if (= f30-0 0.0) + (prebot-light-pulse-off) + (prebot-light-pulse-on (+ 0.2 (* 0.1 f30-0)) (+ 0.1 (* 0.04 f30-0)) 0.0) + ) + ) + (when (>= (-> self num-attacks) (the-as uint (min 5 (-> gp-0 length)))) + (dotimes (s5-1 (min 5 (-> gp-0 length))) + (send-event (handle->process (-> self pillars s5-1)) 'cool-down) + ) + (sound-play "pillar-cool") + (go-virtual watch-pillars) + ) + ) + (ja :num! (loop!)) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate activate-tentacles (prebot) + :virtual #t + :event prebot-handler + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-tentacle-launch-ja)) + (ja :num! (seek!)) + (when (and (not (-> self grunt-played)) (or (and (= (-> self stage) 1) (>= (ja-aframe-num 0) 165.0)) + (and (= (-> self stage) 2) (>= (ja-aframe-num 0) 167.0)) + (and (= (-> self stage) 3) (>= (ja-aframe-num 0) 178.0)) + ) + ) + (set! (-> self grunt-played) #t) + (case (-> self stage) + ((1) + (sound-play "prebot-grunts" :position (-> self root trans)) + ) + ((2) + (sound-play "prebot-trythis" :position (-> self root trans)) + ) + ((3) + (sound-play "prebot-greeting" :position (-> self root trans)) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-hatch-hover-ja :num! min) + (go-virtual create-pillars) + ) + ) + (else + (let ((v1-53 (ja-group))) + (cond + ((and v1-53 (= v1-53 prebot-tentacle-launch-pre-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self tentacles 0) + (ppointer->handle + (process-spawn prebot-tentacle "a-" (-> self root trans) 47 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 1) + (ppointer->handle + (process-spawn prebot-tentacle "b-" (-> self root trans) 48 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 2) + (ppointer->handle + (process-spawn prebot-tentacle "c-" (-> self root trans) 49 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 3) + (ppointer->handle + (process-spawn prebot-tentacle "d-" (-> self root trans) 45 :name "prebot-tentacle" :to self) + ) + ) + (set! (-> self tentacles 4) + (ppointer->handle + (process-spawn prebot-tentacle "e-" (-> self root trans) 46 :name "prebot-tentacle" :to self) + ) + ) + (ja-channel-push! 1 0) + (ja :group! prebot-tentacle-launch-ja :num! min) + (set! (-> self grunt-played) #f) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-tentacle-launch-pre-ja :num! min) + (setup-masks (-> self draw) 0 0) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate watch-critters (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-idle-ja)) + (ja :num! (loop!)) + (dotimes (gp-0 28) + (let ((a0-6 (handle->process (-> self critters gp-0)))) + (when a0-6 + (if (or (time-elapsed? (-> self state-time) (seconds 45)) + (< (-> (the-as process-drawable a0-6) root trans y) (+ -40960.0 (-> self entity extra trans y))) + ) + (send-event a0-6 'instant-death) + (goto cfg-26) + ) + ) + ) + ) + (go-virtual activate-tentacles) + (label cfg-26) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-idle-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for function prebot-launch-critter +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defbehavior prebot-launch-critter prebot () + (cond + ((zero? (-> self nav)) + (format #t "ERROR: ~s nav mesh not found~%" (-> self name)) + (set! (-> self critters-to-launch) 0) + 0 + ) + (else + (let ((s4-0 (new 'stack-no-clear 'enemy-init-by-other-params)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (handle->process (-> self gun)))) + (cond + (s3-0 + (vector<-cspace! gp-0 (-> (the-as process-drawable s3-0) node-list data 7)) + (if (logtest? (-> *part-group-id-table* 1334 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> (the-as process-drawable s3-0) node-list data 7 bone transform) + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1334) + :duration (seconds 1) + :mat-joint (-> (the-as process-drawable s3-0) node-list data 7 bone transform) + ) + ) + ) + (else + (vector<-cspace! gp-0 (joint-node prebot-lod0-jg head)) + ) + ) + ) + (set! (-> s5-0 quad) (-> self nav state mesh bounds quad)) + (case (-> self stage) + ((1) + (+! (-> s5-0 x) 61440.0) + (set! (-> s5-0 x) (- (-> s5-0 x) (* 32768.0 (the float (-> self critters-to-launch))))) + ) + (else + (+! (-> s5-0 x) 61440.0) + (set! (-> s5-0 x) (- (-> s5-0 x) (* 28672.0 (the float (-> self critters-to-launch))))) + ) + ) + (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (quaternion-copy! (-> s4-0 quat) (-> self root quat)) + (set! (-> s4-0 entity) (-> self entity)) + (set! (-> s4-0 directed?) #f) + (set! (-> s4-0 no-initial-move-to-ground?) #f) + (set! (-> s4-0 art-level) #f) + (let ((v1-53 (process-spawn + prebot-large-eco-creature + :init enemy-init-by-other + self + s4-0 + :name "prebot-large-eco-creature" + :to self + ) + ) + ) + (when v1-53 + (send-event (ppointer->process v1-53) 'set-dest gp-0 s5-0 #x46c00000 #x44160000) + (+! (-> self critters-to-launch) -1) + (prebot-light-flash 1.0 0.4 0.0) + (sound-play "launch-cav-eco" :position gp-0) + (the-as int (sound-play "launch-whoosh" :position gp-0)) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate launch-critters (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (case (-> self stage) + ((1) + (set! (-> self critters-to-launch) 2) + ) + (else + (set! (-> self critters-to-launch) 3) + ) + ) + ) + :exit (behavior () + (sound-play "boss-win-vox" :position (-> self root trans)) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-gun-stow-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((a0-7 (handle->process (-> self gun)))) + (if a0-7 + (deactivate a0-7) + ) + ) + (go-virtual watch-critters) + ) + ) + (else + (let ((v1-25 (ja-group))) + (cond + ((and v1-25 (= v1-25 prebot-gun-launch-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (cond + ((= (-> self critters-to-launch) 1) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-stow-ja :num! min) + ) + (else + (ja :num-func num-func-identity :frame-num 0.0) + ) + ) + (prebot-launch-critter) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-launch-ja :num! min) + (prebot-launch-critter) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate sweep-done (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set! (-> self position target quad) (-> self original-position quad)) + (set! (-> self position target y) (-> self original-position y)) + ) + :exit (behavior () + (dotimes (gp-0 2) + (let ((a0-1 (handle->process (-> self swords gp-0)))) + (if a0-1 + (deactivate a0-1) + ) + ) + ) + (prebot-light-pulse-off) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-swords-horizontal-R2L-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-12 (ja-group))) + (and v1-12 (= v1-12 prebot-sword-R-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-22 (ja-group))) + (and v1-22 (= v1-22 prebot-sword-R-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-complete-ja :num! min) + ) + ((let ((v1-32 (ja-group))) + (and v1-32 (= v1-32 prebot-swords-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-42 (ja-group))) + (and v1-42 (= v1-42 prebot-sword-L-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-complete-ja :num! min) + ) + ((let ((v1-52 (ja-group))) + (and v1-52 (= v1-52 prebot-sword-L-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-complete-ja :num! min) + ) + ((let ((v1-62 (ja-group))) + (and v1-62 (or (= v1-62 prebot-sword-R-horizontal-L2R-complete-ja) + (= v1-62 prebot-sword-R-horizontal-R2L-complete-ja) + (= v1-62 prebot-sword-L-horizontal-L2R-complete-ja) + (= v1-62 prebot-sword-L-horizontal-R2L-complete-ja) + (= v1-62 prebot-swords-horizontal-L2R-complete-ja) + (= v1-62 prebot-swords-horizontal-R2L-complete-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (dotimes (gp-6 2) + (let ((a0-58 (handle->process (-> self swords gp-6)))) + (if a0-58 + (deactivate a0-58) + ) + ) + ) + (setup-masks (-> self draw) 28 0) + (prebot-light-pulse-off) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-from-sword-R-ja :num! min) + (set! (-> self gun) + (ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self)) + ) + ) + ) + (else + (let ((v1-99 (ja-group))) + (cond + ((and v1-99 (= v1-99 prebot-gun-from-sword-R-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-gun-aim-ja :num! min) + ) + ) + (else + (let ((f0-14 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-0 1024.0) + ) + (if (< f0-14 (* f1-0 f1-0)) + (go-virtual launch-critters) + ) + ) + (ja :num! (loop!)) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate sweep (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (prebot-method-46 self) + (case (-> self stage) + ((1) + (set! (-> self num-attacks) (the-as uint 2)) + (set! (-> self position max-vel) 1638.4) + ) + ((2) + (set! (-> self num-attacks) (the-as uint 3)) + (set! (-> self position max-vel) 2048.0) + ) + (else + (set! (-> self num-attacks) (the-as uint 3)) + (set! (-> self position max-vel) 2457.6) + ) + ) + (set! (-> self position accel) 409.6) + (set! (-> self position max-partial) 0.99) + (dotimes (gp-0 2) + (send-event (handle->process (-> self swords gp-0)) 'whoosh-lead (* 15.0 (-> self position max-vel))) + (send-event (handle->process (-> self swords gp-0)) 'use-pos-pitch #t) + ) + ) + :exit (behavior () + (prebot-method-45 self) + (set! (-> self position accel) 0.004096) + (set! (-> self position max-vel) 2048.0) + (set! (-> self position max-partial) 0.125) + (dotimes (gp-0 2) + (send-event (handle->process (-> self swords gp-0)) 'scale #x3f800000) + (send-event (handle->process (-> self swords gp-0)) 'use-pos-pitch #f) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-swords-horizontal-R2L-strike-ja)) + (ja :num! (seek!)) + (cond + ((>= (ja-aframe-num 0) 195.0) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + ) + ((>= (ja-aframe-num 0) 190.0) + (dotimes (gp-0 2) + (send-event (handle->process (-> self swords gp-0)) 'scale #x3ff33333) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-hold-ja :num! min) + ) + ) + ((let ((v1-39 (ja-group))) + (and v1-39 (= v1-39 prebot-swords-horizontal-L2R-strike-ja)) + ) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 231.0) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (dotimes (gp-2 2) + (send-event (handle->process (-> self swords gp-2)) 'scale #x3ff33333) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-L2R-hold-ja :num! min) + ) + ) + ((let ((v1-73 (ja-group))) + (and v1-73 (= v1-73 prebot-sword-R-horizontal-R2L-strike-ja)) + ) + (ja :num! (seek!)) + (cond + ((>= (ja-aframe-num 0) 252.0) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + ) + ((>= (ja-aframe-num 0) 248.0) + (dotimes (gp-4 2) + (send-event (handle->process (-> self swords gp-4)) 'scale #x3ff33333) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-hold-ja :num! min) + ) + ) + ((let ((v1-110 (ja-group))) + (and v1-110 (= v1-110 prebot-sword-R-horizontal-L2R-strike-ja)) + ) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 207.0) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (dotimes (gp-6 2) + (send-event (handle->process (-> self swords gp-6)) 'scale #x3ff33333) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-hold-ja :num! min) + ) + ) + ((let ((v1-144 (ja-group))) + (and v1-144 (= v1-144 prebot-sword-L-horizontal-R2L-strike-ja)) + ) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 207.0) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + (dotimes (gp-8 2) + (send-event (handle->process (-> self swords gp-8)) 'scale #x3ff33333) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-hold-ja :num! min) + ) + ) + ((let ((v1-178 (ja-group))) + (and v1-178 (= v1-178 prebot-sword-L-horizontal-L2R-strike-ja)) + ) + (ja :num! (seek!)) + (cond + ((>= (ja-aframe-num 0) 252.0) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + ) + ((>= (ja-aframe-num 0) 248.0) + (dotimes (gp-10 2) + (send-event (handle->process (-> self swords gp-10)) 'scale #x3ff33333) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-hold-ja :num! min) + ) + ) + ((let ((v1-215 (ja-group))) + (and v1-215 (or (= v1-215 prebot-sword-R-horizontal-R2L-hold-ja) + (= v1-215 prebot-sword-R-horizontal-L2R-hold-ja) + (= v1-215 prebot-sword-L-horizontal-R2L-hold-ja) + (= v1-215 prebot-sword-L-horizontal-L2R-hold-ja) + (= v1-215 prebot-swords-horizontal-R2L-hold-ja) + (= v1-215 prebot-swords-horizontal-L2R-hold-ja) + ) + ) + ) + (ja :num! (loop!)) + (dotimes (gp-12 2) + (send-event (handle->process (-> self swords gp-12)) 'scale #x3ff33333) + ) + (let ((f0-46 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-15 1024.0) + ) + (when (< f0-46 (* f1-15 f1-15)) + (dotimes (gp-13 2) + (send-event (handle->process (-> self swords gp-13)) 'scale #x3f800000) + ) + (+! (-> self num-attacks) -1) + (if (<= (-> self num-attacks) 0) + (go-virtual sweep-done) + ) + (let ((v1-258 (ja-group))) + (cond + ((and v1-258 (= v1-258 prebot-swords-horizontal-R2L-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-return-ja :num! min) + (set! (-> self position target y) (+ -34816.0 (-> self original-position y))) + ) + ((let ((v1-270 (ja-group))) + (and v1-270 (= v1-270 prebot-swords-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-L2R-return-ja :num! min) + (set! (-> self position target y) (+ -34816.0 (-> self original-position y))) + ) + ((let ((v1-282 (ja-group))) + (and v1-282 (= v1-282 prebot-sword-R-horizontal-R2L-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + ((let ((v1-294 (ja-group))) + (and v1-294 (= v1-294 prebot-sword-R-horizontal-L2R-hold-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + (else + (let ((v1-306 (ja-group))) + (cond + ((and v1-306 (= v1-306 prebot-sword-L-horizontal-R2L-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-return-ja :num! min) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-325 (ja-group))) + (and v1-325 (or (= v1-325 prebot-sword-R-horizontal-R2L-return-ja) + (= v1-325 prebot-sword-L-horizontal-R2L-return-ja) + (= v1-325 prebot-swords-horizontal-R2L-return-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (dotimes (gp-20 2) + (send-event (handle->process (-> self swords gp-20)) 'whoosh-lead (* 15.0 (-> self position max-vel))) + ) + (let ((v1-352 (ja-group))) + (cond + ((and v1-352 (= v1-352 prebot-swords-horizontal-R2L-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-L2R-strike-ja :num! min) + ) + (else + (let ((v1-362 (ja-group))) + (cond + ((and v1-362 (= v1-362 prebot-sword-R-horizontal-R2L-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-L2R-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-377 (ja-group))) + (and v1-377 (or (= v1-377 prebot-sword-R-horizontal-L2R-return-ja) + (= v1-377 prebot-sword-L-horizontal-L2R-return-ja) + (= v1-377 prebot-swords-horizontal-L2R-return-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (dotimes (gp-24 2) + (send-event (handle->process (-> self swords gp-24)) 'whoosh-lead (* 15.0 (-> self position max-vel))) + ) + (let ((v1-404 (ja-group))) + (cond + ((and v1-404 (= v1-404 prebot-swords-horizontal-L2R-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-strike-ja :num! min) + ) + (else + (let ((v1-414 (ja-group))) + (cond + ((and v1-414 (= v1-414 prebot-sword-R-horizontal-L2R-return-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-R2L-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate slam-done (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (case (-> self stage) + ((1) + (set! (-> self position target x) (+ -94208.0 (-> self original-position x))) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + ((2) + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (set! (-> self position target y) (+ -36864.0 (-> self original-position y))) + ) + (else + (set! (-> self position target x) (+ 94208.0 (-> self original-position x))) + (set! (-> self position target y) (+ -34816.0 (-> self original-position y))) + ) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 prebot-sword-R-strike2pose-ja) + (= v1-2 prebot-sword-L-strike2pose-ja) + (= v1-2 prebot-swords-strike2pose-ja) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self trythis-played) #f) + (let ((v1-16 (ja-group))) + (cond + ((and v1-16 (= v1-16 prebot-swords-strike2pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-pose-ja :num! min) + ) + (else + (let ((v1-26 (ja-group))) + (cond + ((and v1-26 (= v1-26 prebot-sword-R-strike2pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-pose-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-pose-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-41 (ja-group))) + (and v1-41 + (or (= v1-41 prebot-sword-R-pose-ja) (= v1-41 prebot-sword-L-pose-ja) (= v1-41 prebot-swords-pose-ja)) + ) + ) + (ja :num! (seek!)) + (when (and (not (-> self trythis-played)) (or (and (= (-> self stage) 1) + (let ((v1-59 (ja-group))) + (and v1-59 (= v1-59 prebot-sword-R-pose-ja)) + ) + (>= (ja-aframe-num 0) 162.0) + ) + (and (= (-> self stage) 2) + (let ((v1-68 (ja-group))) + (and v1-68 (= v1-68 prebot-sword-L-pose-ja)) + ) + (>= (ja-aframe-num 0) 156.0) + ) + (and (= (-> self stage) 3) + (let ((v1-76 (ja-group))) + (and v1-76 (= v1-76 prebot-swords-pose-ja)) + ) + (>= (ja-aframe-num 0) 166.0) + ) + ) + ) + (set! (-> self trythis-played) #t) + (case (-> self stage) + ((1) + (sound-play "prebot-trythis" :position (-> self root trans)) + ) + ((2) + (sound-play "prebot-grunts" :position (-> self root trans)) + ) + ((2) + (sound-play "prebot-harumph" :position (-> self root trans)) + ) + ) + ) + (when (ja-done? 0) + (let ((v1-99 (ja-group))) + (cond + ((and v1-99 (= v1-99 prebot-swords-pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-pre-ja :num! min) + ) + (else + (let ((v1-109 (ja-group))) + (cond + ((and v1-109 (= v1-109 prebot-sword-R-pose-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-pre-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-pre-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (let ((v1-124 (ja-group))) + (cond + ((and v1-124 (or (= v1-124 prebot-sword-R-horizontal-L2R-pre-ja) + (= v1-124 prebot-sword-L-horizontal-R2L-pre-ja) + (= v1-124 prebot-swords-horizontal-R2L-pre-ja) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((v1-138 (ja-group))) + (cond + ((and v1-138 (= v1-138 prebot-swords-horizontal-R2L-pre-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-horizontal-R2L-strike-ja :num! min) + ) + (else + (let ((v1-148 (ja-group))) + (cond + ((and v1-148 (= v1-148 prebot-sword-R-horizontal-L2R-pre-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-horizontal-L2R-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-horizontal-R2L-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + (go-virtual sweep) + ) + ) + ((let ((v1-166 (ja-group))) + (and v1-166 (= v1-166 prebot-swords-L-vertical-strike-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-strike2pose-ja :num! min) + ) + (else + (let ((v1-176 (ja-group))) + (cond + ((and v1-176 (= v1-176 prebot-sword-R-vertical-strike-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-strike2pose-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-strike2pose-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for function prebot-spawn-shockwave +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defbehavior prebot-spawn-shockwave prebot () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s5-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) + L162 + (let* ((v1-6 (ja-group)) + (v1-13 (handle->process (-> self swords (if (and v1-6 (= v1-6 prebot-swords-R-vertical-strike-ja)) + 1 + 0 + ) + ) + ) + ) + ) + (when v1-13 + (vector<-cspace! gp-0 (-> (the-as process-drawable v1-13) node-list data 5)) + (+! (-> gp-0 z) -90112.0) + (set! (-> gp-0 y) (+ 4096.0 (-> self original-position y))) + ) + ) + (quaternion-set! s5-0 0.0 1.0 0.0 0.0) + (process-spawn prebot-shockwave gp-0 s5-0 :name "prebot-shockwave" :to self) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* 819.2 37 300 1.0 1.1 (-> *display* camera-clock)) + (prebot-light-flash 1.0 0.0 0.0) + (sound-play "shockwave" :position gp-0) + (sound-play "sword-hit" :position gp-0) + ) + 0 + ) + +;; failed to figure out what this is: +(defstate slam (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set! (-> self position target x) (-> self original-position x)) + (set! (-> self position target y) (+ 6144.0 (-> self original-position y))) + (set! (-> self position target z) (+ 61440.0 (-> self original-position z))) + (case (-> self stage) + ((1) + (set! (-> self num-attacks) (the-as uint 2)) + ) + ((2) + (set! (-> self num-attacks) (the-as uint 3)) + ) + (else + (set! (-> self num-attacks) (the-as uint 4)) + ) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-sword-grab-both-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-swords-vertical-pre-ja :num! min) + (setup-masks (-> self draw) 0 24) + (prebot-light-pulse-on 0.7 0.2 0.0) + (set! (-> self swords 0) + (ppointer->handle + (process-spawn prebot-sword "sword-l-" (-> self root trans) 43 #f :name "prebot-sword" :to self) + ) + ) + (set! (-> self swords 1) + (ppointer->handle + (process-spawn prebot-sword "sword-r-" (-> self root trans) 27 #t :name "prebot-sword" :to self) + ) + ) + ) + ) + (else + (let ((v1-35 (ja-group))) + (cond + ((and v1-35 (= v1-35 prebot-sword-grab-AR-ja)) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-pre-ja :num! min) + (setup-masks (-> self draw) 0 4) + (prebot-light-pulse-on 0.7 0.2 0.0) + (set! (-> self swords 0) + (ppointer->handle + (process-spawn prebot-sword "sword-" (-> self root trans) 27 #f :name "prebot-sword" :to self) + ) + ) + ) + ) + ((let ((v1-62 (ja-group))) + (and v1-62 (= v1-62 prebot-sword-grab-AL-ja)) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-L-vertical-pre-ja :num! min) + (setup-masks (-> self draw) 0 2) + (prebot-light-pulse-on 0.7 0.2 0.0) + (set! (-> self swords 0) + (ppointer->handle + (process-spawn prebot-sword "sword-" (-> self root trans) 43 #f :name "prebot-sword" :to self) + ) + ) + ) + ) + ((not (handle->process (-> self swords 0))) + (case (-> self stage) + ((1) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-grab-AR-ja :num! min) + ) + ((2) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-grab-AL-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-grab-both-ja :num! min) + ) + ) + ) + ((let ((v1-108 (ja-group))) + (and v1-108 (or (= v1-108 prebot-sword-R-vertical-pre-ja) + (= v1-108 prebot-sword-L-vertical-pre-ja) + (= v1-108 prebot-swords-vertical-pre-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((f0-18 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-0 1024.0) + ) + (cond + ((< f0-18 (* f1-0 f1-0)) + (let ((v1-124 (ja-group))) + (cond + ((and v1-124 (= v1-124 prebot-swords-vertical-pre-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-swords-R-vertical-strike-ja :num! min) + ) + (else + (let ((v1-134 (ja-group))) + (cond + ((and v1-134 (= v1-134 prebot-sword-R-vertical-pre-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-L-vertical-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-149 (ja-group))) + (and v1-149 (= v1-149 prebot-swords-vertical-pre-ja)) + ) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-swords-vertical-hold-ja :num! min) + ) + (else + (let ((v1-159 (ja-group))) + (cond + ((and v1-159 (= v1-159 prebot-sword-R-vertical-pre-ja)) + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-hold-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.02)) + (ja :group! prebot-sword-R-vertical-hold-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-174 (ja-group))) + (and (and v1-174 (or (= v1-174 prebot-sword-R-vertical-hold-ja) + (= v1-174 prebot-sword-L-vertical-hold-ja) + (= v1-174 prebot-swords-vertical-hold-ja) + ) + ) + (let ((f0-25 (vector-vector-distance-squared (the-as vector (-> self position)) (-> self position value))) + (f1-3 1024.0) + ) + (< f0-25 (* f1-3 f1-3)) + ) + ) + ) + (let ((v1-182 (ja-group))) + (cond + ((and v1-182 (= v1-182 prebot-swords-vertical-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-R-vertical-strike-ja :num! min) + ) + (else + (let ((v1-192 (ja-group))) + (cond + ((and v1-192 (= v1-192 prebot-sword-R-vertical-hold-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-vertical-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-vertical-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-207 (ja-group))) + (and v1-207 (or (= v1-207 prebot-sword-R-vertical-strike-ja) + (= v1-207 prebot-sword-L-vertical-strike-ja) + (= v1-207 prebot-swords-L-vertical-strike-ja) + (= v1-207 prebot-swords-R-vertical-strike-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (prebot-spawn-shockwave) + (+! (-> self num-attacks) -1) + (cond + ((zero? (-> self num-attacks)) + (go-virtual slam-done) + ) + ((let ((v1-227 (ja-group))) + (and v1-227 (= v1-227 prebot-swords-R-vertical-strike-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-R-vertical-between-ja :num! min) + ) + ((let ((v1-237 (ja-group))) + (and v1-237 (= v1-237 prebot-swords-L-vertical-strike-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-L-vertical-between-ja :num! min) + ) + (else + (let ((v1-247 (ja-group))) + (cond + ((and v1-247 (= v1-247 prebot-sword-R-vertical-strike-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-vertical-between-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-vertical-between-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ((let ((v1-262 (ja-group))) + (and v1-262 (or (= v1-262 prebot-sword-R-vertical-between-ja) + (= v1-262 prebot-sword-L-vertical-between-ja) + (= v1-262 prebot-swords-R-vertical-between-ja) + (= v1-262 prebot-swords-L-vertical-between-ja) + ) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (let ((v1-276 (ja-group))) + (cond + ((and v1-276 (= v1-276 prebot-swords-R-vertical-between-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-L-vertical-strike-ja :num! min) + ) + ((let ((v1-286 (ja-group))) + (and v1-286 (= v1-286 prebot-swords-L-vertical-between-ja)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-swords-R-vertical-strike-ja :num! min) + ) + (else + (let ((v1-296 (ja-group))) + (cond + ((and v1-296 (= v1-296 prebot-sword-R-vertical-between-ja)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-R-vertical-strike-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-sword-L-vertical-strike-ja :num! min) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate pre-slam (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self laugh-played) #f) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-idle-ja)) + (ja :num! (loop!)) + (when (and (not (-> self laugh-played)) (or (and (= (-> self stage) 1) (>= (ja-aframe-num 0) 3.0)) + (and (= (-> self stage) 2) (>= (ja-aframe-num 0) 4.0)) + (and (= (-> self stage) 3) (>= (ja-aframe-num 0) 5.0)) + ) + ) + (set-time! (-> self laugh-timer)) + (set! (-> self laugh-played) #t) + (sound-play "prebot-laugh" :position (-> self root trans)) + ) + (if (or (-> self laugh-played) (time-elapsed? (-> self state-time) (seconds 0.25))) + (go-virtual slam) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-idle-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate jump-to-hover (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status bit-13)))) + (talker-spawn-func (-> *talker-speech* 326) *entity-pool* (target-pos 0) (the-as region #f)) + (process-entity-status! self (entity-perm-status bit-13) #t) + ) + ) + :trans (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 prebot-jump-to-hover-ja)) + (ja :num! (seek!)) + (if (or (ja-done? 0) (< -40.0 (ja-aframe-num 0))) + (go-virtual pre-slam) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! prebot-jump-to-hover-ja :num! min) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate hidden (prebot) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (remove-setting! 'point-of-interest) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (task-node-closed? (game-task-node mine-boss-introduction)) + (prebot-go-next-stage) + ) + (set-time! (-> self state-time)) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate test (prebot) + :virtual #t + :event prebot-handler + :enter (behavior () + (set-time! (-> self state-time)) + (cond + ((zero? (-> self nav)) + (format #t "ERROR: ~s nav mesh not found~%" (-> self name)) + ) + (else + (let ((gp-0 (new 'stack-no-clear 'enemy-init-by-other-params))) + (let ((v1-4 (new 'stack-no-clear 'vector))) + (set! (-> v1-4 quad) (-> self nav state mesh bounds quad)) + (set! (-> gp-0 trans quad) (-> v1-4 quad)) + ) + (quaternion-copy! (-> gp-0 quat) (-> self root quat)) + (set! (-> gp-0 entity) (-> self entity)) + (set! (-> gp-0 directed?) #f) + (set! (-> gp-0 no-initial-move-to-ground?) #f) + (set! (-> gp-0 art-level) #f) + (process-spawn + prebot-large-eco-creature + :init enemy-init-by-other + self + gp-0 + :name "prebot-large-eco-creature" + :to self + ) + ) + ) + ) + (ja-channel-push! 1 0) + (ja :group! prebot-idle-ja :num! min) + (set! (-> self position target z) (+ -61440.0 (-> self original-position z))) + ) + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (cpad-pressed? 1 x)) + (go-virtual test) + ) + (ja :num! (loop!)) + (show-maya-skeleton self -1 #x45800000) + (let ((gp-0 (handle->process (-> self gun)))) + (cond + ((>= (ja-aframe-num 0) 60.0) + (if (not gp-0) + (set! (-> self gun) + (ppointer->handle (process-spawn prebot-gun "gun-" (-> self root trans) :name "prebot-gun" :to self)) + ) + ) + ) + (gp-0 + (deactivate gp-0) + ) + ) + ) + (prebot-common) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for method 15 of type hud-prebot +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-prebot)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 130.0 (-> this offset)))) + 150 + ) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) -9 70) + (case (-> this values 0 current) + ((1) + (set! (-> this sprites 4 scale-x) 6.0) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ((2) + (set! (-> this sprites 4 scale-x) 4.0) + (set! (-> this sprites 4 color x) 128) + (set! (-> this sprites 4 color y) 128) + (set! (-> this sprites 4 color z) 0) + 0 + ) + (else + (set! (-> this sprites 4 scale-x) 2.0) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) -8 68) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) -51 68) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -12 68) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-prebot +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-prebot)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-prebot +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-prebot)) + (set! (-> this level) (level-get *level* 'mined)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-caveboss-01 mined-minimap))) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 4 tid) (the-as texture-id (get-texture hud-caveboss-health-01 mined-minimap))) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 0.5) + (set! (-> this sprites 4 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 3 tid) (the-as texture-id (get-texture hud-small-frame-01 mined-minimap))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 flags) (hud-sprite-flags hsf0 hsf2)) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-small-frame-01 mined-minimap))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set! (-> this sprites 2 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-small-frame-02 mined-minimap))) + (set! (-> this sprites 1 scale-x) 10.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set! (-> this sprites 1 flags) (hud-sprite-flags hsf2)) + 0 + (none) + ) + +;; definition of type task-manager-prebot +(deftype task-manager-prebot (task-manager) + ((manager-entity entity) + (check-timer time-frame) + ) + ) + +;; definition for method 3 of type task-manager-prebot +(defmethod inspect ((this task-manager-prebot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tmanager-entity: ~A~%" (-> this manager-entity)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-prebot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self check-timer) 0) + 0 + ) + ) + +;; definition for method 26 of type task-manager-prebot +;; WARN: Return type mismatch time-frame vs none. +(defmethod task-manager-method-26 ((this task-manager-prebot)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (and (not (-> this manager-entity)) (time-elapsed? (-> this check-timer) (seconds 0.1))) + (let* ((a0-3 "prebot-2") + (v1-6 (entity-by-name a0-3)) + ) + (when v1-6 + (set! (-> this manager-entity) v1-6) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-prebot :init hud-init-by-other :name "hud-prebot" :to this)) + ) + ) + ) + (set-time! (-> this check-timer)) + ) + (none) + ) + +;; definition for method 21 of type task-manager-prebot +(defmethod set-time-limit ((this task-manager-prebot)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this manager-entity) #f) + (set-setting! 'music 'mineboss 0.0 0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/mine/rat_REF.gc b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc new file mode 100644 index 0000000000..1ffc9e541a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc @@ -0,0 +1,2128 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-rat rat rat-lod0-jg -1 + ((rat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow rat-shadow-mg + :origin-joint-index 18 + ) + +;; definition of type rat +(deftype rat (nav-enemy) + ((init-quat quaternion :inline) + (roll-transform transformq :inline) + (face-dir vector :inline) + (flee-focus-pos vector :inline) + (wheel-actor entity-actor) + (permanently-scared symbol) + (slide-sound-id uint32) + (scared-timer time-frame) + (scared-interval time-frame) + (return-to-nav-mesh? symbol) + ) + (:state-methods + wait-by-wheel-seek + wait-by-wheel-wait + active-turn + attack + flee-stare + undefined + running-in-wheel + wheel-die + ) + ) + +;; definition for method 3 of type rat +(defmethod inspect ((this rat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Troll-transform: #~%" (-> this roll-transform)) + (format #t "~2Tface-dir: #~%" (-> this face-dir)) + (format #t "~2Tflee-focus-pos: #~%" (-> this flee-focus-pos)) + (format #t "~2Twheel-actor: ~A~%" (-> this wheel-actor)) + (format #t "~2Tpermanently-scared: ~A~%" (-> this permanently-scared)) + (format #t "~2Tslide-sound-id: ~D~%" (-> this slide-sound-id)) + (format #t "~2Tscared-timer: ~D~%" (-> this scared-timer)) + (format #t "~2Tscared-interval: ~D~%" (-> this scared-interval)) + (format #t "~2Treturn-to-nav-mesh?: ~A~%" (-> this return-to-nav-mesh?)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-rat-defaults*, type fact-info-enemy-defaults +(define *fact-info-rat-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +;; definition for symbol *rat-nav-enemy-info*, type nav-enemy-info +(define *rat-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 7 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 1 + :param1 3 + :param2 '((new 'static 'bfloat :data 0.75) (new 'static 'bfloat :data 1.5)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 2 + :param1 5 + :param2 '((new 'static 'bfloat :data 0.75) (new 'static 'bfloat :data 1.5)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 6 + :notice-anim 5 + :hostile-anim 11 + :hit-anim 6 + :knocked-anim 16 + :knocked-land-anim 17 + :die-anim 24 + :die-falling-anim 24 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 6 + :sound-hit (static-sound-name "rat-squeal") + :sound-die (static-sound-name "rat-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 5.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 49152.0 + :knocked-soft-vxz-hi 77824.0 + :knocked-soft-vy-lo 65536.0 + :knocked-soft-vy-hi 102400.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9898 :y 0.0756 :z 0.1191 :w 16871.352) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd obstacle hit-by-others-list pusher) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9975 :y 0.0623 :z -0.0291 :w 23209.137) + :geo-tform (new 'static 'vector :x 1.0 :w 12952.898) + :axial-slop 1800.5653 + :max-angle 3301.7039 + :coll-rad 2231.0913 + :hit-sound (static-sound-name "rat-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9999 :z 0.0004 :w 32758.518) + :geo-tform (new 'static 'vector :x 1.0 :z 0.0004 :w 32768.02) + :axial-slop 1800.5653 + :max-angle 3299.4827 + :coll-rad 1563.4432 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7428 :y -0.0498 :z 0.6675 :w 33924.785) + :geo-tform (new 'static 'vector :x 0.6487 :y 0.4895 :z 0.5825 :w 43181.707) + :axial-slop 1800.5653 + :max-angle 4193.594 + :coll-rad 1294.7456 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1409 :y -0.1438 :z 0.9794 :w 5063.1294) + :geo-tform (new 'static 'vector :x 0.7137 :y 0.3672 :z 0.5963 :w 41407.32) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1197.6704 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.4227 :y 0.5005 :z 0.7554 :w 43021.234) + :geo-tform (new 'static 'vector :x -0.48 :y -0.8771 :z 0.0154 :w 16837.107) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint 6 + :pre-tform (new 'static 'vector :x -0.4637 :y -0.5607 :z 0.6859 :w 24477.533) + :geo-tform (new 'static 'vector :x -0.5132 :y -0.0929 :z 0.8532 :w 39898.88) + :axial-slop 1800.5653 + :max-angle 4806.5015 + :coll-rad 991.6416 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.5308 :y -0.0302 :z -0.8469 :w 9008.215) + :geo-tform (new 'static 'vector :x 0.8575 :y 0.4582 :z -0.2339 :w 23058.24) + :axial-slop 1800.5653 + :max-angle 3692.2073 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9113 :y 0.3345 :z -0.2396 :w 9324.316) + :geo-tform (new 'static 'vector :x -0.6075 :y 0.6787 :z 0.4125 :w 11790.964) + :axial-slop 1800.5653 + :max-angle 3223.1514 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5485 :y 0.0296 :z 0.8355 :w 8436.723) + :geo-tform (new 'static 'vector :x -0.5367 :y 0.8135 :z 0.2236 :w 9872.307) + :axial-slop 1800.5653 + :max-angle 2035.4388 + :coll-rad 697.5488 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7012 :y -0.0152 :z 0.7127 :w 6800.543) + :geo-tform (new 'static 'vector :x 0.7478 :y -0.0492 :z 0.662 :w 16398.764) + :axial-slop 1800.5653 + :max-angle 3487.4438 + :coll-rad 556.2368 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.4697 :y 0.169 :z 0.8664 :w 9123.412) + :geo-tform (new 'static 'vector :x 0.8284 :y -0.482 :z 0.2849 :w 23692.027) + :axial-slop 1800.5653 + :max-angle 3475.6653 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8702 :y -0.3516 :z 0.3448 :w 9364.0205) + :geo-tform (new 'static 'vector :x -0.5482 :y -0.7233 :z -0.4196 :w 12565.746) + :axial-slop 1800.5653 + :max-angle 3745.783 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5319 :y -0.3084 :z -0.7885 :w 8845.867) + :geo-tform (new 'static 'vector :x -0.6153 :y -0.7608 :z -0.2061 :w 8654.2295) + :axial-slop 1800.5653 + :max-angle 2274.791 + :coll-rad 757.76 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8155 :y -0.1199 :z -0.5661 :w 6821.0957) + :geo-tform (new 'static 'vector :x 0.7005 :y 0.2295 :z -0.6757 :w 16967.252) + :axial-slop 1800.5653 + :max-angle 3639.3962 + :coll-rad 397.7216 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.9985 :y -0.0463 :z 0.0288 :w 11897.897) + :geo-tform (new 'static 'vector :x -0.997 :y 0.0705 :z 0.0292 :w 8203.996) + :axial-slop 1800.5653 + :max-angle 3417.666 + :coll-rad 1127.2192 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3436 :y -0.9382 :z 0.0401 :w 1372.5969) + :geo-tform (new 'static 'vector :x -0.984 :y 0.1534 :z 0.0897 :w 11190.399) + :axial-slop 1800.5653 + :max-angle 3380.966 + :coll-rad 1597.8496 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3309 :y 0.0632 :z -0.9415 :w 15700.951) + :geo-tform (new 'static 'vector :x 0.7557 :y 0.568 :z 0.3258 :w 34107.156) + :axial-slop 1800.5653 + :max-angle 3795.7178 + :coll-rad 1286.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9673 :y -0.2207 :z 0.1243 :w 10359.821) + :geo-tform (new 'static 'vector :x 0.7738 :y -0.299 :z 0.5583 :w 23514.645) + :axial-slop 1800.5653 + :max-angle 3626.18 + :coll-rad 1030.144 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.4253 :y -0.0324 :z 0.9044 :w 21694.164) + :geo-tform (new 'static 'vector :x -0.816 :y -0.3366 :z -0.4697 :w 21449.367) + :axial-slop 1800.5653 + :max-angle 3774.4185 + :coll-rad 591.4624 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5431 :y -0.0261 :z -0.8392 :w 19577.861) + :geo-tform (new 'static 'vector :x 0.4968 :y -0.8225 :z 0.2766 :w 11542.782) + :axial-slop 1800.5653 + :max-angle 2293.8694 + :coll-rad 626.2784 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5367 :y 0.0778 :z 0.8401 :w 6345.687) + :geo-tform (new 'static 'vector :x -0.62 :y -0.7018 :z -0.3505 :w 13527.996) + :axial-slop 1800.5653 + :max-angle 2710.7876 + :coll-rad 445.2352 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 18 + :pre-tform (new 'static 'vector :x 0.9719 :y -0.1118 :z -0.2067 :w 4947.2944) + :geo-tform (new 'static 'vector :x 0.9852 :y 0.1266 :z -0.1151 :w 13674.414) + :axial-slop 1800.5653 + :max-angle 1986.9968 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3961 :y -0.884 :z -0.248 :w 1440.9546) + :geo-tform (new 'static 'vector :x -0.4417 :y 0.8968 :z 0.0222 :w 3241.5017) + :axial-slop 1800.5653 + :max-angle 2815.7542 + :coll-rad 791.3472 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7521 :y -0.6312 :z 0.1891 :w 1846.6588) + :geo-tform (new 'static 'vector :x 0.1732 :y 0.9842 :z -0.0343 :w 4142.276) + :axial-slop 1800.5653 + :max-angle 3795.7178 + :coll-rad 760.2176 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5148 :y -0.8218 :z -0.2441 :w 1278.8622) + :geo-tform (new 'static 'vector :x 0.0427 :y 0.999 :z -0.0107 :w 5133.7627) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 575.0784 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1457 :y -0.9851 :z -0.0908 :w 1308.1167) + :geo-tform (new 'static 'vector :x -0.0891 :y 0.9956 :z 0.0283 :w 6443.0444) + :axial-slop 1800.5653 + :max-angle 5359.261 + :coll-rad 513.2288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint 18 + :pre-tform (new 'static 'vector :x -0.084 :y 0.0546 :z 0.9949 :w 15687.553) + :geo-tform (new 'static 'vector :x 0.7291 :y -0.57 :z -0.3786 :w 33257.48) + :axial-slop 1800.5653 + :max-angle 3678.281 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7243 :y 0.6445 :z -0.2448 :w 13605.893) + :geo-tform (new 'static 'vector :x 0.9233 :y 0.1682 :z -0.345 :w 22198.062) + :axial-slop 1800.5653 + :max-angle 3652.5945 + :coll-rad 931.0208 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8853 :y 0.1044 :z -0.4529 :w 21871.893) + :geo-tform (new 'static 'vector :x -0.9877 :y 0.0861 :z 0.1303 :w 19674.363) + :axial-slop 1800.5653 + :max-angle 3709.101 + :coll-rad 675.4304 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9484 :y -0.0508 :z 0.3126 :w 19602.928) + :geo-tform (new 'static 'vector :x 0.8427 :y 0.5037 :z -0.1896 :w 7369.013) + :axial-slop 1800.5653 + :max-angle 3767.8103 + :coll-rad 740.5568 + :hit-sound (static-sound-name "rat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8652 :y -0.2236 :z -0.4486 :w 6495.9824) + :geo-tform (new 'static 'vector :x -0.854 :y 0.4607 :z 0.2416 :w 10556.411) + :axial-slop 1800.5653 + :max-angle 2548.5496 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 0.5956 :y -0.5418 :z 0.5929 :w 18988.164) + :geo-tform (new 'static 'vector :x -0.75 :y -0.6581 :z -0.0655 :w 2752.0388) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1277.1328 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint 7 + :pre-tform (new 'static 'vector :x -0.8792 :y 0.2318 :z -0.4161 :w 7033.5786) + :geo-tform (new 'static 'vector :x -0.0562 :y -0.9874 :z -0.1475 :w 16494.428) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 744.2432 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 8 + :pre-tform (new 'static 'vector :x -0.5619 :y -0.0979 :z 0.8213 :w 6875.181) + :geo-tform (new 'static 'vector :x -0.5163 :y -0.1113 :z 0.8491 :w 33034.82) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 645.5296 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 0.8388 :y -0.5396 :z -0.0716 :w 22881.477) + :geo-tform (new 'static 'vector :x -0.0691 :y 0.6797 :z 0.7301 :w 12063.759) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 0.2823 :y -0.5464 :z 0.7884 :w 23099.492) + :geo-tform (new 'static 'vector :x 0.9118 :y -0.3801 :z 0.1549 :w 29933.094) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1030.144 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 12 + :pre-tform (new 'static 'vector :x -0.7122 :y 0.0482 :z 0.7002 :w 7344.5103) + :geo-tform (new 'static 'vector :x 0.5743 :y 0.7856 :z -0.2297 :w 9826.541) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1135.8208 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint 16 + :pre-tform (new 'static 'vector :x -0.755 :y 0.3048 :z -0.5805 :w 6001.295) + :geo-tform (new 'static 'vector :x 0.9264 :y 0.104 :z 0.3618 :w 38196.477) + :axial-slop 1800.5653 + :max-angle 4537.8584 + :coll-rad 1147.6992 + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 10 + :turn-anim -1 + :run-anim 11 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 60) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 2) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *rat-nav-enemy-info* fact-defaults) *fact-info-rat-defaults*) + +;; definition for method 120 of type rat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this rat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle 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 4915.2 0.0 10240.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-13 prim-core action) (collide-action solid can-ride)) + (set-vector! (-> v1-13 local-sphere) 0.0 819.2 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-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 4956.16 0.0 4915.2) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-17 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 1228.8 3276.8) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-19 transform-index) 34) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 1228.8 2048.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-21 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-21 transform-index) 18) + (set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2867.2) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-23 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-23 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-23 transform-index) 25) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 1638.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function rat-run-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior rat-run-code rat () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! rat-run0-ja + :num! (seek! max (lerp-scale 0.5 1.333 (vector-length (-> self root transv)) 0.0 32768.0)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (lerp-scale 0.5 1.333 (vector-length (-> self root transv)) 0.0 32768.0))) + ) + ) + #f + (none) + ) + +;; definition for function rat-falling-post +(defbehavior rat-falling-post rat () + (nav-enemy-falling-post) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (rat) + :virtual #t + :enter (behavior () + (if (enemy-method-109 self) + (go-virtual die) + ) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate ambush (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy ambush) enter))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (let ((v1-8 self)) + (set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-8 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-11 self)) + (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logclear (-> v1-11 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-time! (-> self state-time)) + (logclear! (-> self enemy-flags) (enemy-flag alert)) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((a0-8 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector+float*! gp-0 (-> self root trans) a0-8 32768.0) + ) + (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) + ) + (set! (-> self root gspot-pos quad) (-> gp-0 quad)) + ) + (sound-play "rat-spawner") + ) + :exit (behavior () + (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :trans (behavior () + (let* ((v1-2 (- (current-time) (-> self state-time))) + (f0-1 (fmin 1.0 (* 0.0016666667 (the float v1-2)))) + ) + (set-vector! (-> self draw color-mult) f0-1 f0-1 f0-1 1.0) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! rat-pipe-jump0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! rat-pipe-jump0-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0) + (cond + ((>= (-> self root gspot-pos y) (-> self root trans y)) + (set! (-> self root trans y) (-> self root gspot-pos y)) + ) + (else + (vector-v++! + (-> self root transv) + (compute-acc-due-to-gravity (-> self root) (new 'stack-no-clear 'vector) (-> self enemy-info slip-factor)) + ) + (vector-v++! (-> self root trans) (-> self root transv)) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate active (rat) + :virtual #t + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (set-look-at-mode! self 2) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (f0-1 (* 4096.0 (rnd-float-range self 8.0 20.0))) + ) + (vector+float*! (-> self move-dest) (-> self root trans) gp-0 f0-1) + ) + (closest-point-on-mesh (-> self nav) (-> self move-dest) (-> self move-dest) (the-as nav-poly #f)) + (let ((a0-22 (-> self nav state)) + (v1-18 (-> self move-dest)) + ) + (logclear! (-> a0-22 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-22 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-22 target-pos quad) (-> v1-18 quad)) + ) + 0 + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (if (< (vector-vector-distance (-> self root trans) (-> self move-dest)) 8192.0) + (go-virtual active-turn) + ) + (ja-no-eval :group! rat-walk0-ja + :num! (seek! max (lerp-scale 0.0 1.0 (vector-length (-> self root transv)) 0.0 12288.0)) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (lerp-scale 0.0 1.0 (vector-length (-> self root transv)) 0.0 12288.0))) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate active-turn (rat) + :virtual #t + :parent (rat active) + :enter (behavior () + (local-vars (v1-20 symbol)) + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (nav-enemy-method-176 self) + (set-look-at-mode! self 2) + (let ((gp-0 (-> self root trans))) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (until v1-20 + (+! f30-0 (* 182.04445 (rnd-float-range self 42.0 198.0))) + (vector-rotate-around-y! s4-0 s5-0 f30-0) + (vector+float*! s3-0 gp-0 s4-0 24576.0) + (closest-point-on-mesh (-> self nav) s2-0 s3-0 (the-as nav-poly #f)) + (set! v1-20 (or (>= 2048.0 (vector-vector-distance s2-0 s3-0)) (>= f30-0 65536.0))) + ) + (vector-rotate-around-y! (-> self face-dir) s5-0 f30-0) + ) + (vector+float*! (-> self move-dest) gp-0 (-> self face-dir) 24576.0) + ) + ) + :trans (behavior () + (let ((a0-0 (method-of-type nav-enemy active))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (if (enemy-method-103 self (-> self face-dir) 1820.4445) + (go-virtual active) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (until #f + (cond + ((< 0.0 (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle (-> self face-dir)))) + (ja-no-eval :group! rat-turn-left-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! rat-turn-right-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (seek-toward-heading-vec! + (-> self root) + (-> self face-dir) + (* 0.5 (-> self nav max-rotation-rate)) + (seconds 0.02) + ) + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate notice (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (stop-look-at! self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (ja-no-eval :group! rat-walk-to-sit-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (seek-to-point-toward-point! + (-> self root) + (-> self focus-pos) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (ja-no-eval :group! rat-sit-to-alert-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-look-at-mode! self 1) + (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (ja-no-eval :group! rat-sit-alert-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (ja-no-eval :group! rat-sit-to-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate wait-by-wheel-seek (rat) + :virtual #t + :enter (behavior () + (let ((v1-0 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags))) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags)))) + ) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags)))) + (set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info)) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (nav-enemy-method-177 self) + (set-time! (-> self state-time)) + (let ((v1-9 (-> self nav))) + (set! (-> v1-9 sphere-mask) (the-as uint #x1000fe)) + ) + 0 + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 8192.0) + (go-virtual wait-by-wheel-wait) + ) + ) + ) + :code rat-run-code + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'wait-pos) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-3 (-> self wheel-actor)) + ) + (if (not (t9-0 + (if v1-3 + (-> v1-3 extra process) + ) + a1-0 + ) + ) + (set! (-> gp-0 quad) (-> self wheel-actor extra trans quad)) + ) + ) + ) + (closest-point-on-mesh (-> self nav) (-> self move-dest) gp-0 (the-as nav-poly #f)) + ) + (let ((a0-7 (-> self nav state)) + (v1-11 (-> self move-dest)) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-11 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate wait-by-wheel-wait (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-0 self)) + (set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (nav-enemy-method-178 self) + (vector-reset! (-> self root transv)) + (set-look-at-mode! self 1) + ) + :code (behavior () + (until #f + (when (not (enemy-method-105 self 4551.1113 #t)) + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! rat-turn-left-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop!)) + ) + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-23 (ja-group))) + (if (not (and v1-23 (= v1-23 rat-idle-stand-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-stare-post + ) + +;; failed to figure out what this is: +(defstate hostile (rat) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (and (< (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)) 20480.0) (get-focus! self)) + ) + (go-virtual attack) + ) + ) + :code rat-run-code + ) + +;; failed to figure out what this is: +(defstate attack (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self scared-timer)) + (set! (-> self scared-interval) (seconds 3)) + ) + :exit (behavior () + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! rat-run0-ja :num! (seek! max 1.5) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.5)) + ) + (go-best-state self) + ) + :post nav-enemy-chase-post + ) + +;; failed to figure out what this is: +(defstate flee (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy flee) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-look-at-mode! self 2) + ) + :code rat-run-code + ) + +;; failed to figure out what this is: +(defstate flee-stare (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self flee-focus-pos quad) (-> self focus-pos quad)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (seconds 1)) + (if (and (handle->process (-> self focus handle)) + (< 12288.0 (vector-vector-distance (-> self flee-focus-pos) (-> self focus-pos))) + ) + (go-virtual flee) + ) + ) + ) + :code (behavior () + (until #f + (when (not (enemy-method-105 self 4551.1113 #t)) + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! rat-turn-left-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop!)) + ) + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-23 (ja-group))) + (if (not (and v1-23 (= v1-23 rat-idle-stand-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-face-focus-post + ) + +;; failed to figure out what this is: +(defstate stare (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-look-at-mode! self 1) + ) + :code (behavior () + (until #f + (when (not (enemy-method-105 self 4551.1113 #t)) + (let ((v1-3 self)) + (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) + ) + 0 + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! rat-turn-left-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 1820.4445 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop!)) + ) + (let ((v1-19 self)) + (set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + (let ((v1-23 (ja-group))) + (if (not (and v1-23 (= v1-23 rat-idle-stand-ja))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate knocked (rat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (if (nonzero? (-> self slide-sound-id)) + (sound-stop (the-as sound-id (-> self slide-sound-id))) + ) + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (rat) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self return-to-nav-mesh?) #t) + ) + :trans #f + :code (behavior () + (cond + ((handle->process (-> self ragdoll-proc)) + (vector-reset! (-> self root transv)) + (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (ja-channel-push! 1 0) + (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) + (let ((gp-0 (-> (the-as ragdoll-proc (-> self ragdoll-proc process 0)) ragdoll))) + (enable-ragdoll! gp-0 self) + (quaternion-copy! (-> self root quat) (the-as quaternion (-> gp-0 ragdoll-joints))) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'inside?) + (let ((t9-5 send-event-function) + (v1-31 (-> self wheel-actor)) + ) + (when (t9-5 + (if v1-31 + (-> v1-31 extra process) + ) + a1-6 + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'claim-wheel?) + (let ((t9-6 send-event-function) + (v1-37 (-> self wheel-actor)) + ) + (if (t9-6 + (if v1-37 + (-> v1-37 extra process) + ) + a1-7 + ) + (go-virtual running-in-wheel) + (go-virtual die) + ) + ) + ) + ) + ) + ) + (let ((f30-0 0.12)) + (ja-channel-push! 1 (the-as time-frame (the int (* 300.0 f30-0)))) + (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-1 (new 'stack-no-clear 'quaternion)) + (f28-0 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 0.0 (* 300.0 f30-0))) + ) + (forward-up-nopitch->quaternion + gp-1 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + *y-vector* + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 f28-0) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! rat-on-back-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-virtual flee) + ) + ) + :post rat-falling-post + ) + +;; failed to figure out what this is: +(defstate running-in-wheel (rat) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logclear! (-> self enemy-flags) (enemy-flag trackable)) + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (let ((gp-0 (-> self parent 0 child))) + (while gp-0 + (if (!= gp-0 self) + (send-event (ppointer->process gp-0) 'scared) + ) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (let ((v1-18 (-> self root root-prim))) + (logclear! (-> v1-18 prim-core action) (collide-action can-ride)) + (dotimes (a0-6 (the-as int (-> v1-18 specific 0))) + (logclear! (-> (the-as collide-shape-prim-group v1-18) child a0-6 prim-core action) (collide-action can-ride)) + ) + ) + ) + :trans (behavior () + (let ((v1-0 (-> self wheel-actor))) + (if (not (if v1-0 + (-> v1-0 extra process) + ) + ) + (go empty-state) + ) + ) + (if (and (time-elapsed? (-> self state-time) (seconds 8)) + (< 204800.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + ) + (go-virtual wheel-die) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 2.0)) + (until #f + (ja-no-eval :group! rat-run-wheel0-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 0) + (set! (-> a1-5 message) 'turn) + (let* ((t9-6 send-event-function) + (v1-41 (-> self wheel-actor)) + (a0-6 (if v1-41 + (-> v1-41 extra process) + ) + ) + ) + (t9-6 a0-6 a1-5) + ) + ) + (set! f30-0 (seek f30-0 1.5 (* 0.1 (seconds-per-frame)))) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'run-dir) + (set! (-> a1-0 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let* ((t9-0 send-event-function) + (v1-4 (-> self wheel-actor)) + (a1-1 (t9-0 + (if v1-4 + (-> v1-4 extra process) + ) + a1-0 + ) + ) + ) + (seek-toward-heading-vec! (-> self root) (the-as vector a1-1) (-> self nav max-rotation-rate) (seconds 0.02)) + ) + ) + (let ((gp-0 (-> self root)) + (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) 'run-pos) + (set! (-> a1-2 param 0) (the-as uint (-> gp-0 trans))) + (set! (-> a1-2 param 1) (the-as uint (new 'stack-no-clear 'vector))) + (let* ((t9-2 send-event-function) + (v1-14 (-> self wheel-actor)) + (s5-0 (t9-2 + (if v1-14 + (-> v1-14 extra process) + ) + a1-2 + ) + ) + (a1-3 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'run-up) + (set! (-> a1-3 param 0) (the-as uint (-> gp-0 trans))) + (set! (-> a1-3 param 1) (the-as uint (new 'stack-no-clear 'vector))) + (let* ((t9-3 send-event-function) + (v1-21 (-> self wheel-actor)) + (s4-0 (t9-3 + (if v1-21 + (-> v1-21 extra process) + ) + a1-3 + ) + ) + ) + (vector-seek! (-> gp-0 trans) (the-as vector s5-0) (* 10240.0 (seconds-per-frame))) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (forward-up-nopitch->quaternion + s5-1 + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat)) + (the-as vector s4-0) + ) + (quaternion-slerp! (-> gp-0 quat) (-> gp-0 quat) s5-1 (* 4.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate wheel-die (rat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> self enemy-flags) (enemy-flag attackable attackable-backup)) + (logclear! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> self focus-status) (focus-status dead)) + (if (-> self skel effect) + (logior! (-> self skel effect flags) (effect-control-flag ecf1)) + ) + (stop-look-at! self) + (let ((v1-24 (-> self root root-prim))) + (set! (-> v1-24 prim-core collide-as) (collide-spec)) + (set! (-> v1-24 prim-core collide-with) (collide-spec)) + ) + 0 + (set-time! (-> self state-time)) + (send-event (ppointer->process (-> self parent)) 'die) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! rat-run-wheel0-die-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (send-event self 'death-end) + (cleanup-for-death self) + ) + :post nav-enemy-simple-post + ) + +;; definition for function rat-joint-mod-roll +;; WARN: Return type mismatch vector vs none. +(defun rat-joint-mod-roll ((arg0 cspace) (arg1 transformq)) + (let ((gp-0 (-> arg0 param1))) + (cspace<-parented-transformq-joint! arg0 arg1) + (vector+! + (-> arg0 bone transform trans) + (-> arg0 bone transform trans) + (the-as vector (-> (the-as rat gp-0) roll-transform)) + ) + ) + (none) + ) + +;; definition for method 108 of type rat +(defmethod enemy-method-108 ((this rat) (arg0 process-focusable)) + (or (not (time-elapsed? (-> this scared-timer) (-> this scared-interval))) (-> this permanently-scared)) + ) + +;; definition for method 109 of type rat +(defmethod enemy-method-109 ((this rat)) + (with-pp + (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) 'near?) + (let ((t9-0 send-event-function) + (v1-2 (-> this wheel-actor)) + ) + (when (not (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + (let ((s5-0 (-> this root)) + (gp-0 (new 'stack-no-clear 'vector)) + (v1-6 (-> this nav state)) + ) + (new 'stack-no-clear 'vector) + (or (not (closest-point-on-mesh (-> v1-6 nav) gp-0 (-> s5-0 trans) (the-as nav-poly #f))) + (< 24576.0 (vector-vector-xz-distance (-> s5-0 trans) gp-0)) + (< (-> s5-0 trans y) (+ -16384.0 (-> gp-0 y))) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 89 of type rat +(defmethod within-gspot-range? ((this rat)) + (with-pp + (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) 'near?) + (let ((t9-0 send-event-function) + (v1-2 (-> this wheel-actor)) + ) + (if (not (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ((method-of-type nav-enemy within-gspot-range?) this) + ) + ) + ) + ) + ) + +;; definition for method 125 of type rat +(defmethod ragdoll-settled? ((this rat)) + (with-pp + (and (or (time-elapsed? (-> this state-time) (seconds 3)) (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) 'inside?) + (let ((t9-0 send-event-function) + (v1-6 (-> this wheel-actor)) + ) + (t9-0 + (if v1-6 + (-> v1-6 extra process) + ) + a1-0 + ) + ) + ) + ) + (call-parent-method this) + ) + ) + ) + +;; definition for method 56 of type rat +;; WARN: Return type mismatch float vs object. +(defmethod knocked-handler ((this rat) (arg0 vector)) + (get-knockback-dir! this arg0) + (let ((f30-0 (rnd-float-range this 0.9 1.0))) + (let ((f0-0 0.0) + (f1-0 98304.0) + ) + (vector-float*! arg0 arg0 (lerp f0-0 f1-0 f30-0)) + ) + (set! (-> arg0 y) (lerp 0.0 73728.0 f30-0)) + ) + ) + +;; definition for method 63 of type rat +(defmethod enemy-method-63 ((this rat) (arg0 float)) + (if (= (-> this hit-points) (-> this enemy-info default-hit-points)) + 1.0 + 0.0 + ) + ) + +;; definition for method 142 of type rat +;; WARN: Return type mismatch int vs knocked-type. +(defmethod penetrate->knocked-type ((this rat) (arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + 3 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + (else + 0 + ) + ) + ) + ) + +;; definition for method 78 of type rat +(defmethod go-hostile ((this rat)) + (if (logtest? (-> this fact enemy-options) (enemy-option user8)) + (go (method-of-object this wait-by-wheel-seek)) + (go (method-of-object this hostile)) + ) + ) + +;; definition for method 67 of type rat +(defmethod coin-flip? ((this rat)) + #f + ) + +;; definition for method 59 of type rat +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this rat)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (if a0-2 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + ) + ) + (when (-> this return-to-nav-mesh?) + (format *stdebug* "~s ~d off nav-mesh~%" (-> this name) (-> this pid)) + (when (enemy-method-109 this) + (set! (-> this return-to-nav-mesh?) #f) + (go-die this) + ) + (let ((s5-2 (new 'stack-no-clear 'vector)) + (s4-0 (-> this root)) + ) + (if (and (closest-point-on-mesh (-> this nav state nav) s5-2 (-> s4-0 trans) (the-as nav-poly #f)) + (< (vector-vector-xz-distance (-> s4-0 trans) s5-2) 409.6) + (< (fabs (- (-> s4-0 trans y) (-> s5-2 y))) 8192.0) + ) + (set! (-> this return-to-nav-mesh?) #f) + ) + ) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 50 of type rat +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this rat) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-8 prim-core action) (collide-action)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + (none) + ) + +;; definition for method 20 of type rat +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this rat)) + (the-as search-info-flag 8) + ) + +;; definition for method 82 of type rat +;; INFO: Used lq/sq +(defmethod event-handler ((this rat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-5 object)) + (case arg2 + (('hit 'hit-knocked 'hit-flinch) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + #t + ) + (('rat?) + #t + ) + (('scared) + (set! v0-5 #t) + (set! (-> this permanently-scared) (the-as symbol v0-5)) + v0-5 + ) + (('trans) + (set! v0-5 (-> arg3 param 0)) + (set! (-> (the-as vector v0-5) quad) (-> this root trans quad)) + v0-5 + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 10 of type rat +(defmethod deactivate ((this rat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this slide-sound-id)) + (sound-stop (the-as sound-id (-> this slide-sound-id))) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 121 of type rat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this rat)) + (with-pp + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-rat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *rat-nav-enemy-info*) + (let ((v1-5 (-> this neck))) + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-5 ignore-angle) 30947.555) + ) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this slide-sound-id) (the-as uint (new-sound-id))) + (set! (-> this wheel-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (.svf (&-> (-> this roll-transform) trans quad) vf0) + (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) 'running?) + (let ((t9-6 send-event-function) + (v1-11 (-> this wheel-actor)) + ) + (set! (-> this permanently-scared) (the-as symbol (t9-6 + (if v1-11 + (-> v1-11 extra process) + ) + a1-8 + ) + ) + ) + ) + ) + (set! (-> this scared-timer) 0) + (set! (-> this scared-interval) 0) + (set! (-> this return-to-nav-mesh?) #f) + 0 + (none) + ) + ) + ) + +;; definition of type rat-spawner +(deftype rat-spawner (process) + ((rats-spawned uint32) + (wheel-entity entity-actor) + (state-time time-frame) + (active? symbol) + (rats-to-spawn uint32) + (actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type rat-spawner +(defmethod inspect ((this rat-spawner)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Trats-spawned: ~D~%" (-> this rats-spawned)) + (format #t "~2Twheel-entity: ~A~%" (-> this wheel-entity)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tactive?: ~A~%" (-> this active?)) + (format #t "~2Trats-to-spawn: ~D~%" (-> this rats-to-spawn)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate idle (rat-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die) + (go-virtual die) + ) + (('child-die) + (let ((v0-0 (the-as object (max 0 (the-as int (+ (-> self rats-spawned) -1)))))) + (set! (-> self rats-spawned) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self active?) #f) + ) + :code sleep-code + :post (behavior () + (local-vars (v1-19 symbol) (v1-37 symbol)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.5)) + (< (-> self rats-spawned) (-> self rats-to-spawn)) + (or (-> self active?) (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 163840.0)) + ) + (set! (-> self active?) #t) + (if (logtest? (-> self wheel-entity extra perm status) (entity-perm-status subtask-complete)) + (go-virtual die) + ) + (dotimes (v1-18 (-> self actor-group-count)) + (dotimes (a0-6 (-> self actor-group v1-18 length)) + (let ((a1-4 (-> self actor-group v1-18 data a0-6 actor))) + (when (if a1-4 + (-> a1-4 extra process) + ) + (set! v1-19 #f) + (goto cfg-23) + ) + ) + ) + ) + (set! v1-19 #t) + (label cfg-23) + (when (and v1-19 + (begin + (let ((gp-1 (-> self entity extra trans)) + (s5-1 (-> self child)) + ) + (while s5-1 + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 1) + (set! (-> a1-11 message) 'trans) + (set! (-> a1-11 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let ((s4-0 (the-as vector (send-event-function (ppointer->process s5-1) a1-11)))) + (when (and s4-0 (< (vector-vector-xz-distance gp-1 s4-0) 40960.0) (< (fabs (- (-> s4-0 y) (-> gp-1 y))) 16384.0)) + (set! v1-37 #t) + (goto cfg-44) + ) + ) + ) + (set! s5-1 (-> s5-1 0 brother)) + ) + ) + (set! v1-37 #f) + (label cfg-44) + (not v1-37) + ) + ) + (let ((s5-2 (-> self entity)) + (gp-2 (new 'stack-no-clear 'enemy-init-by-other-params)) + ) + (set! (-> gp-2 trans quad) (-> s5-2 extra trans quad)) + (quaternion-copy! (-> gp-2 quat) (-> s5-2 quat)) + (set! (-> gp-2 entity) s5-2) + (set! (-> gp-2 directed?) #f) + (set! (-> gp-2 no-initial-move-to-ground?) #f) + (set! (-> gp-2 art-level) #f) + (let ((s5-3 (get-process *default-dead-pool* rat #x4000 1))) + (if (ppointer->handle (when s5-3 + (let ((t9-7 (method-of-type process activate))) + (t9-7 s5-3 self "rat" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-3 enemy-init-by-other self gp-2) + (-> s5-3 ppointer) + ) + ) + (+! (-> self rats-spawned) 1) + ) + ) + ) + ) + (set-time! (-> self state-time)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (rat-spawner) + :virtual #t + :enter (behavior () + (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) + ) + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (while (-> self child) + (suspend) + ) + (process-entity-status! self (entity-perm-status dead) #t) + ) + ) + +;; definition for method 11 of type rat-spawner +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this rat-spawner) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set! (-> this wheel-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this rats-spawned) (the-as uint 0)) + (set! (-> this rats-to-spawn) + (res-lump-value (-> this entity) 'extra-id uint :default (the-as uint128 1) :time -1000000000.0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-2)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (if (logtest? (-> arg0 extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this die)) + (go (method-of-object this idle)) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc b/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc new file mode 100644 index 0000000000..462c4d2be0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc @@ -0,0 +1,176 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type jump-pad +(deftype jump-pad (bouncer) + ((fan-quat quaternion :inline) + (rot-vel float) + (fan-loop-sound-id sound-id) + (fan-loop-sound sound-spec) + (jump-sound sound-spec) + ) + (:methods + (get-skel (_type_) art-group) + (get-fan-joint-idx (_type_) int) + (init-sounds (_type_) none) + ) + ) + +;; definition for method 3 of type jump-pad +(defmethod inspect ((this jump-pad)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bouncer inspect))) + (t9-0 this) + ) + (format #t "~2Tfan-quat: #~%" (-> this fan-quat)) + (format #t "~2Trot-vel: ~f~%" (-> this rot-vel)) + (format #t "~2Tfan-loop-sound-id: ~D~%" (-> this fan-loop-sound-id)) + (format #t "~2Tfan-loop-sound: ~A~%" (-> this fan-loop-sound)) + (format #t "~2Tjump-sound: ~A~%" (-> this jump-sound)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (jump-pad) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual fire) + ) + (('attack) + (let ((v1-3 (the-as object (-> block param 1))) + (a0-3 (-> block param 0)) + (a2-1 0) + ) + 0.0 + (let ((f30-0 (-> self spring-height))) + (cond + ((= (-> (the-as attack-info v1-3) mode) 'flop) + (set! a2-1 1) + ) + ((= (-> (the-as attack-info v1-3) mode) 'board) + (set! a2-1 9) + ) + ) + (when (and (nonzero? a2-1) (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry a0-3) + (-> self root) + (the-as uint a2-1) + ) + (send-event proc 'jump f30-0 f30-0 (-> self mods)) + ) + ) + (sound-play "trampoline") + (go-virtual fire) + #f + ) + ) + ) + ) + (else + ((-> (method-of-type bouncer idle) event) proc argc message block) + ) + ) + ) + :trans (behavior () + (seek! (-> self rot-vel) 10922.667 (* 21845.334 (seconds-per-frame))) + ) + :code (behavior () + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) + (transform-post) + (sleep-code) + ) + :post (behavior () + (when (-> self fan-loop-sound) + (set! (-> self fan-loop-sound pitch-mod) + (the int (* 1524.0 (lerp-scale -0.9 0.6 (-> self rot-vel) 10922.667 87381.336))) + ) + (sound-play-by-spec (-> self fan-loop-sound) (-> self fan-loop-sound-id) (-> self root trans)) + ) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate fire (jump-pad) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (seek! (-> self rot-vel) 87381.336 (* 87381.336 (seconds-per-frame))) + ) + :code (behavior () + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.1)) + (if (-> self jump-sound) + (sound-play-by-spec (-> self jump-sound) (new-sound-id) (the-as vector #t)) + ) + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + (go-virtual idle) + ) + :post (behavior () + (when (-> self fan-loop-sound) + (set! (-> self fan-loop-sound pitch-mod) + (the int (* 1524.0 (lerp-scale -0.9 0.6 (-> self rot-vel) 10922.667 87381.336))) + ) + (sound-play-by-spec (-> self fan-loop-sound) (-> self fan-loop-sound-id) (-> self root trans)) + ) + (let ((t9-2 (-> (method-of-type bouncer fire) post))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + +;; definition for function jump-pad-joint-fan +;; WARN: Return type mismatch int vs none. +(defun jump-pad-joint-fan ((arg0 cspace) (arg1 quaternion)) + (let ((gp-0 (-> arg0 param1))) + (quaternion-rotate-local-y! + (-> (the-as jump-pad gp-0) fan-quat) + (-> (the-as jump-pad gp-0) fan-quat) + (* (-> (the-as jump-pad gp-0) rot-vel) (seconds-per-frame)) + ) + (quaternion-copy! (&+ arg1 16) (-> (the-as jump-pad gp-0) fan-quat)) + ) + (cspace<-parented-transformq-joint! arg0 (the-as transformq arg1)) + 0 + (none) + ) + +;; definition for method 23 of type jump-pad +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-23 ((this jump-pad)) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (quaternion-copy! (-> this fan-quat) (-> this root quat)) + (let ((a0-6 (-> this node-list data (get-fan-joint-idx this)))) + (set! (-> a0-6 param0) (the-as (function cspace transformq none) jump-pad-joint-fan)) + (set! (-> a0-6 param1) this) + (set! (-> a0-6 param2) (the-as basic 0)) + ) + 0 + (none) + ) + +;; definition for method 11 of type jump-pad +(defmethod init-from-entity! ((this jump-pad) (arg0 entity-actor)) + (set! (-> this fan-loop-sound) #f) + (set! (-> this jump-sound) #f) + (init-sounds this) + (if (-> this fan-loop-sound) + (set! (-> this fan-loop-sound-id) (new-sound-id)) + ) + (call-parent-method this arg0) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/kg-hopper_REF.gc b/test/decompiler/reference/jak3/levels/sewer/kg-hopper_REF.gc new file mode 100644 index 0000000000..6319389dab --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/kg-hopper_REF.gc @@ -0,0 +1,1047 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type kg-hopper +(deftype kg-hopper (nav-enemy) + ((speed-y float) + (accel-y float) + (next-jump-time int32) + (path-intro path-control) + (can-go-knocked? symbol) + (land-anim-index int32) + (step-num int32) + (best-point vector :inline) + (best-score float) + (origin vector :inline) + (direction vector :inline) + (jump-dist float) + (side float) + (jump-start-anim uint32) + (jump-air-anim uint32) + (jump-land-anim uint32) + (jump-height-min float) + (jump-anim-start-frame float) + (minimap connection-minimap) + ) + (:state-methods + explode + ) + (:methods + (kg-hopper-method-191 (_type_) symbol) + (kg-hopper-method-192 () none) + (get-skel (_type_) art-group) + ) + ) + +;; definition for method 3 of type kg-hopper +(defmethod inspect ((this kg-hopper)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tspeed-y: ~f~%" (-> this speed-y)) + (format #t "~2Taccel-y: ~f~%" (-> this accel-y)) + (format #t "~2Tnext-jump-time: ~D~%" (-> this next-jump-time)) + (format #t "~2Tpath-intro: ~A~%" (-> this path-intro)) + (format #t "~2Tcan-go-knocked?: ~A~%" (-> this can-go-knocked?)) + (format #t "~2Tland-anim-index: ~D~%" (-> this land-anim-index)) + (format #t "~2Tstep-num: ~D~%" (-> this step-num)) + (format #t "~2Tbest-point: #~%" (-> this best-point)) + (format #t "~2Tbest-score: ~f~%" (-> this best-score)) + (format #t "~2Torigin: #~%" (-> this origin)) + (format #t "~2Tdirection: #~%" (-> this direction)) + (format #t "~2Tjump-dist: ~f~%" (-> this jump-dist)) + (format #t "~2Tside: ~f~%" (-> this side)) + (format #t "~2Tjump-start-anim: ~D~%" (-> this jump-start-anim)) + (format #t "~2Tjump-air-anim: ~D~%" (-> this jump-air-anim)) + (format #t "~2Tjump-land-anim: ~D~%" (-> this jump-land-anim)) + (format #t "~2Tjump-height-min: ~f~%" (-> this jump-height-min)) + (format #t "~2Tjump-anim-start-frame: ~f~%" (-> this jump-anim-start-frame)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-kg-hopper kg-hopper kg-hopper-lod0-jg kg-hopper-idle-ja + ((kg-hopper-lod0-mg (meters 20)) (kg-hopper-lod1-mg (meters 999999))) + :bounds (static-spherem 0 1 0 3.5) + :shadow kg-hopper-shadow-mg + ) + +;; definition for symbol *kg-hopper-debris-params*, type debris-static-params +(define *kg-hopper-debris-params* + (new 'static 'debris-static-params + :joints (new 'static 'boxed-array :type debris-static-joint-params + (new 'static 'debris-static-joint-params :parent-joint-index 4 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 5 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 6 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 7 :group "skel-kg-debris-d") + (new 'static 'debris-static-joint-params :parent-joint-index 8 :group "skel-kg-debris-a") + (new 'static 'debris-static-joint-params :parent-joint-index 9 :group "skel-kg-debris-b") + (new 'static 'debris-static-joint-params :parent-joint-index 10 :group "skel-kg-debris-c") + (new 'static 'debris-static-joint-params :parent-joint-index 11 :group "skel-kg-debris-d") + ) + :collide-spec (collide-spec backgnd) + :sound-hit (static-sound-name "kg-debris") + ) + ) + +;; definition of type kg-hopper-anim-info +(deftype kg-hopper-anim-info (structure) + ((hit-anim-index int32) + (land-anim-index int32) + ) + :pack-me + ) + +;; definition for method 3 of type kg-hopper-anim-info +(defmethod inspect ((this kg-hopper-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'kg-hopper-anim-info) + (format #t "~1Thit-anim-index: ~D~%" (-> this hit-anim-index)) + (format #t "~1Tland-anim-index: ~D~%" (-> this land-anim-index)) + (label cfg-4) + this + ) + +;; definition of type kg-hopper-global-info +(deftype kg-hopper-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (yellow-hit-anim kg-hopper-anim-info 3 :inline) + (blue-hit-anim kg-hopper-anim-info 3 :inline) + ) + ) + +;; definition for method 3 of type kg-hopper-global-info +(defmethod inspect ((this kg-hopper-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tyellow-hit-anim[3] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) + (label cfg-4) + this + ) + +;; definition for symbol *kg-hopper-global-info*, type kg-hopper-global-info +(define *kg-hopper-global-info* (new 'static 'kg-hopper-global-info + :yellow-hit-anim (new 'static 'inline-array kg-hopper-anim-info 3 + (new 'static 'kg-hopper-anim-info :hit-anim-index 25 :land-anim-index 26) + (new 'static 'kg-hopper-anim-info :hit-anim-index 27 :land-anim-index 28) + (new 'static 'kg-hopper-anim-info :hit-anim-index 29 :land-anim-index 30) + ) + :blue-hit-anim (new 'static 'inline-array kg-hopper-anim-info 3 + (new 'static 'kg-hopper-anim-info :hit-anim-index 21 :land-anim-index 24) + (new 'static 'kg-hopper-anim-info :hit-anim-index 22 :land-anim-index 24) + (new 'static 'kg-hopper-anim-info :hit-anim-index 23 :land-anim-index 24) + ) + ) + ) + +;; definition for method 85 of type kg-hopper +(defmethod knocked-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let* ((a2-0 (ash 1 (-> *kg-hopper-global-info* prev-blue-hit))) + (v1-3 (enemy-method-131 this 3 a2-0)) + (a1-5 (-> this draw art-group data (-> *kg-hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) + ) + (set! (-> *kg-hopper-global-info* prev-blue-hit) v1-3) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim a1-5)) + (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim a1-5) frames num-frames) -1))) + (set! (-> a0-12 param 1) 1.0) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! a0-12 (the-as art-joint-anim a1-5) num-func-seek!) + ) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let* ((a2-2 (ash 1 (-> *kg-hopper-global-info* prev-yellow-hit))) + (v1-13 (enemy-method-131 this 3 a2-2)) + (a1-11 (-> this draw art-group data (-> *kg-hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) + ) + (set! (-> this land-anim-index) (-> *kg-hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) + (set! (-> *kg-hopper-global-info* prev-yellow-hit) v1-13) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11)) + (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) + (set! (-> a0-27 param 1) (-> arg0 anim-speed)) + (set! (-> a0-27 frame-num) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim a1-11) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 86 of type kg-hopper +(defmethod knocked-land-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index)))) + (set! (-> a0-3 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) frames num-frames) -1) + ) + ) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! + a0-3 + (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) + num-func-seek! + ) + ) + #t + ) + ) + ) + +;; definition for symbol *kg-hopper-nav-enemy-info*, type nav-enemy-info +(define *kg-hopper-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 5 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 5 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 1 + :param1 5 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 7 + :hostile-anim 4 + :hit-anim 4 + :knocked-anim 25 + :knocked-land-anim 26 + :die-anim 19 + :die-falling-anim 20 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 5 + :look-at-joint 5 + :bullseye-joint 4 + :sound-hit (static-sound-name "kg-impact") + :sound-die (static-sound-name "kg-explo") + :notice-distance (meters 40) + :notice-distance-delta (meters 40) + :proximity-notice-distance (meters 4) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 4551.1113 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim 9 + :run-anim 13 + :taunt-anim -1 + :run-travel-speed (meters 1) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 2) + :walk-travel-speed (meters 1) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 720) + :notice-nav-radius (meters 2) + :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! (-> *kg-hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 81 of type kg-hopper +(defmethod go-die ((this kg-hopper)) + (go (method-of-object this explode)) + ) + +;; failed to figure out what this is: +(defstate explode (kg-hopper) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "kg-explo") + ) + :code (behavior () + (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) + (set! (-> a1-1 hit-xz-reaction) 0.95) + (set! (-> a1-1 hit-y-reaction) 0.6) + (set! (-> a1-1 scale-rand-lo) 0.5) + (set! (-> a1-1 scale-rand-hi) 1.2) + (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (debris-spawn self a1-1 *kg-hopper-debris-params* (the-as process-drawable #f)) + ) + (let ((v1-8 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-hopper-lod0-jg chest)))) + (cond + ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 221)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 221)) + ) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 82 of type kg-hopper +(defmethod event-handler ((this kg-hopper) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (= (-> this hit-points) 0.0) + (go (method-of-object this explode)) + (go (method-of-object this knocked)) + ) + #t + ) + (('death-start) + (set! (-> this draw death-timer) (the-as uint 0)) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 99 of type kg-hopper +;; INFO: Used lq/sq +(defmethod jump-anim-handler ((this kg-hopper) (arg0 int) (arg1 enemy-jump-info)) + (when (= (-> this jump-why) 2) + (cond + ((zero? arg0) + (logior! (-> this focus-status) (focus-status touch-water under-water)) + ) + (else + (when (focus-test? this touch-water) + (let ((s3-0 (new 'stack-no-clear 'water-info))) + (water-info-init! (-> this root) s3-0 (collide-action solid semi-solid)) + (let ((v1-7 #f)) + (cond + ((not (logtest? (water-flag touch-water) (-> s3-0 flags))) + (if (focus-test? this under-water) + (set! v1-7 #t) + ) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) + ) + ((focus-test? this under-water) + (let ((f0-1 (+ 11264.0 (-> this root trans y)))) + (if (< (-> s3-0 trans y) f0-1) + (set! v1-7 #t) + ) + ) + ) + ) + (when v1-7 + (logclear! (-> this focus-status) (focus-status under-water)) + (let ((v1-10 (new 'stack-no-clear 'vector))) + (set! (-> v1-10 quad) (-> this root trans quad)) + (when (logtest? (water-flag touch-water) (-> s3-0 flags)) + (set! (-> v1-10 y) (-> s3-0 trans y)) + (cond + ((logtest? (-> *part-group-id-table* 192 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 192)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 192)) + ) + ) + (sound-play "splash-out") + ) + ) + ) + ) + ) + ) + ) + ) + ) + ((method-of-type nav-enemy jump-anim-handler) this arg0 arg1) + ) + +;; definition for method 98 of type kg-hopper +(defmethod jump-wind-up-anim ((this kg-hopper) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +;; definition for method 96 of type kg-hopper +(defmethod jump-in-air-anim ((this kg-hopper) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +;; definition for method 97 of type kg-hopper +(defmethod jump-land-anim ((this kg-hopper) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.075)) + (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +;; failed to figure out what this is: +(defstate jump (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) exit))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self draw shadow-ctrl))) + (logclear! (-> v1-5 settings flags) (shadow-flags shdf03)) + (let ((a0-2 v1-5)) + (set! (-> a0-2 settings top-plane w) (- 4096.0)) + ) + 0 + (set! (-> v1-5 settings bot-plane w) (- -4096.0)) + ) + 0 + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy jump) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-5 (-> self draw shadow-ctrl))) + (logior! (-> v1-5 settings flags) (shadow-flags shdf03)) + (let ((a0-2 v1-5)) + (set! (-> a0-2 settings bot-plane w) (- (+ (- -4096.0 (-> self root trans y)) (-> self root gspot-pos y)))) + ) + 0 + (set! (-> v1-5 settings top-plane w) (- (+ (- 8192.0 (-> self root trans y)) (-> self root gspot-pos y)))) + ) + 0 + ) + ) + +;; definition for method 191 of type kg-hopper +;; INFO: Used lq/sq +(defmethod kg-hopper-method-191 ((this kg-hopper)) + (local-vars (sv-752 collide-query)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (+! (-> this step-num) -1) + (cond + ((>= (-> this step-num) 0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-rotate-around-y! + s3-0 + (-> this direction) + (* 182.04445 (the float (+ (* (-> this step-num) 16) -135))) + ) + (let ((a1-1 s5-0)) + (let ((v1-7 (-> this origin))) + (let ((a0-2 s3-0)) + (let ((a2-1 (-> this jump-dist))) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-7 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-1 quad) vf6) + ) + (let ((v1-8 (-> this nav)) + (a0-3 s5-0) + (a1-2 (new 'stack-no-clear 'nav-poly)) + ) + (vector-! (the-as vector (-> a1-2 vertex)) a0-3 (the-as vector (-> v1-8 state mesh bounds))) + (set! (-> a1-2 vertex1 x) (-> v1-8 nearest-y-threshold)) + (set! (-> a1-2 data 20) (the-as uint 2)) + (let ((s4-0 (nav-mesh-method-45 (-> v1-8 state mesh) a1-2))) + (when s4-0 + (let ((f30-0 (vector-dot s3-0 (-> this direction)))) + (new 'stack-no-clear 'vector) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (set! (-> a1-3 quad) (-> s5-0 quad)) + (set! (-> a1-3 w) 6144.0) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x10006c)) + (when (< (-> this best-score) f30-0) + (set! (-> this best-score) f30-0) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! sv-752 (new 'stack-no-clear 'collide-query)) + (let ((s3-1 (new 'stack 'collide-query))) + (let ((s0-0 (-> this nav)) + (s1-0 s2-0) + ) + (let* ((v1-21 s5-0) + (a0-10 (-> s0-0 state mesh)) + (t9-4 (method-of-object a0-10 project-point-onto-plane-of-poly-local)) + (a2-5 s1-0) + (t0-1 (vector-! (new 'stack-no-clear 'vector) v1-21 (the-as vector (-> s0-0 state mesh bounds)))) + ) + (t9-4 a0-10 s4-0 a2-5 (the-as vector sv-752) t0-1) + ) + (vector+! s1-0 s1-0 (the-as vector (-> s0-0 state mesh bounds))) + ) + 0 + (set! (-> s5-0 y) (-> s2-0 y)) + (if (enemy-above-ground? this s3-1 s5-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> s5-0 y) (-> s3-1 best-other-tri intersect y)) + ) + ) + ) + (set! (-> this best-point quad) (-> s5-0 quad)) + ) + ) + ) + ) + ) + ) + ) + ) + #t + ) + (else + #f + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate stare (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-184 self) + ) + ) + +;; definition for symbol *kg-hopper-next-jump-time*, type time-frame +(define *kg-hopper-next-jump-time* (the-as time-frame 0)) + +;; failed to figure out what this is: +(defstate hostile (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-182 self) + (nav-enemy-method-183 self) + (set! (-> self speed-y) 0.0) + (set! (-> self accel-y) 0.0) + (set! (-> self next-jump-time) (the-as int (+ (current-time) (set-reaction-time! self 0 (seconds 0.4))))) + (set! (-> self step-num) 0) + (set! (-> self best-score) -2.0) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate active (kg-hopper) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (nav-enemy-method-164 self) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (let ((a2-0 (-> self nav state))) + (set! (-> v1-2 quad) (-> a2-0 target-pos quad)) + ) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 2 v1-2) + ) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate notice (kg-hopper) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((f30-0 (rnd-float-range self 0.8 1.2)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (if (zero? (rnd-int self 2)) + (ja :group! kg-hopper-notice-ja) + (ja :group! kg-hopper-notice-alt-ja) + ) + (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-4 (-> self nav state))) + (set! (-> gp-0 quad) (-> a1-4 travel quad)) + ) + (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate ambush (kg-hopper) + :virtual #t + :enter (behavior () + (when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)) + (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice)) + (let ((gp-0 (-> self on-notice))) + (if gp-0 + (script-eval gp-0 :vector (-> self root trans)) + ) + ) + ) + (let ((v1-12 (-> self root root-prim))) + (set! (-> self root backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> self root backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (let ((v1-15 (-> self root root-prim))) + (set! (-> v1-15 prim-core collide-as) (collide-spec)) + (set! (-> v1-15 prim-core collide-with) (collide-spec)) + ) + 0 + (when (handle->process (-> self focus handle)) + (let ((gp-1 (-> self root)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + (get-point-in-path! (-> self path-intro) s5-0 0.0 'exact) + (+! (-> s5-0 y) -16384.0) + (get-point-in-path! (-> self path-intro) s4-0 1.0 'exact) + (let ((f0-3 (deg-diff + (quaternion-y-angle (-> gp-1 quat)) + (vector-y-angle (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0) 1.0)) + ) + ) + ) + (quaternion-rotate-y! (-> gp-1 quat) (-> gp-1 quat) f0-3) + ) + ) + (set! (-> gp-1 trans quad) (-> s5-0 quad)) + ) + ) + ) + :exit (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-1 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (new 'stack 'collide-query))) + (get-point-in-path! (-> self path-intro) gp-0 1.0 'exact) + (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) + ) + ) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event self 'jump 2 gp-0) + ) + (go-virtual hostile) + ) + ) + +;; definition for method 143 of type kg-hopper +(defmethod on-dying ((this kg-hopper)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type kg-hopper +(defmethod relocate ((this kg-hopper) (offset int)) + (if (nonzero? (-> this path-intro)) + (&+! (-> this path-intro) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 120 of type kg-hopper +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this kg-hopper)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> s4-0 transform-index) 12) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 9216.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 3686.4 0.0 3686.4) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action deadly)) + (set! (-> v1-16 transform-index) 5) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 819.2 3276.8) + ) + (set! (-> s5-0 nav-radius) 4096.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! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 193 of type kg-hopper +(defmethod get-skel ((this kg-hopper)) + (art-group-get-by-name *level* "skel-kg-hopper" (the-as (pointer level) #f)) + ) + +;; definition for method 121 of type kg-hopper +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this kg-hopper)) + (stack-size-set! (-> this main-thread) 256) + (logior! (-> this mask) (process-mask kg-robot)) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-defaults! this *kg-hopper-nav-enemy-info*) + (set! (-> this can-go-knocked?) #t) + (let ((v1-11 (-> this neck))) + (set! (-> v1-11 up) (the-as uint 1)) + (set! (-> v1-11 nose) (the-as uint 2)) + (set! (-> v1-11 ear) (the-as uint 0)) + (set-vector! (-> v1-11 twist-max) 10922.667 12743.111 0.0 1.0) + (set! (-> v1-11 ignore-angle) 18204.445) + ) + (set! (-> this jump-start-anim) (the-as uint 10)) + (set! (-> this jump-air-anim) (the-as uint 13)) + (set! (-> this jump-land-anim) (the-as uint 14)) + (set! (-> this jump-height-min) 12288.0) + (set! (-> this jump-anim-start-frame) 8.0) + (set! (-> this land-anim-index) 26) + (set! (-> this side) (rnd-float-range this -1.5 1.5)) + (when (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (if (-> this path-intro) + (logior! (-> this path-intro flags) (path-control-flag display draw-line draw-point draw-text)) + ) + ) + (logior! (-> this nav flags) (nav-control-flag output-sphere-hash)) + (let ((v1-32 (-> this nav))) + (set! (-> v1-32 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 327680.0) + (let ((v1-37 (-> this nav))) + (set! (-> v1-37 nav-cull-radius) 61440.0) + ) + 0 + (set! (-> this fact pickup-type) (pickup-type ammo-light-random)) + (set! (-> this fact pickup-amount) 5.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/sewer/neo-grenadier_REF.gc b/test/decompiler/reference/jak3/levels/sewer/neo-grenadier_REF.gc new file mode 100644 index 0000000000..3496e9d228 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/neo-grenadier_REF.gc @@ -0,0 +1,1461 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-neo-grenadier-drip + :id 1523 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5001 :fade-after (meters 140) :falloff-to (meters 140))) + ) + +;; failed to figure out what this is: +(defpart 5002 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.6) (meters 0.2)) + (:scale-y (meters 0.4) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:scalevel-x (meters -0.0026666666) (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.73333335) + (:fade-g -3.4) + (:fade-b -0.73333335) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.25)) + (:next-launcher 882) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.35)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-neo-grenadier neo-grenadier neo-grenadier-lod0-jg -1 + ((neo-grenadier-lod0-mg (meters 20)) + (neo-grenadier-lod1-mg (meters 40)) + (neo-grenadier-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 0 0 5) + :shadow neo-grenadier-shadow-mg + :origin-joint-index 4 + ) + +;; definition of type bank-info +(deftype bank-info (structure) + ((circle sphere :inline) + (tangent-pos vector :inline) + (final-pos vector :inline) + (final-dir vector :inline) + ) + ) + +;; definition for method 3 of type bank-info +(defmethod inspect ((this bank-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bank-info) + (format #t "~1Tcircle: #~%" (-> this circle)) + (format #t "~1Ttangent-pos: #~%" (-> this tangent-pos)) + (format #t "~1Tfinal-pos: #~%" (-> this final-pos)) + (format #t "~1Tfinal-dir: #~%" (-> this final-dir)) + (label cfg-4) + this + ) + +;; definition of type neo-grenadier +(deftype neo-grenadier (nav-enemy) + ((shot-trajectory trajectory :inline) + (hostile-path path-control) + (bank bank-info :inline) + (joint joint-mod-blend-world) + (heading symbol) + (move-pos vector :inline) + (move-angle float) + (status-flags grenadier-status-flag) + (suppress-knockaside-timer time-frame) + ) + (:state-methods + attack + backup + spin-kick + ) + (:methods + (neo-grenadier-method-193 (_type_) none) + (set-bank-info! (_type_ vector) none) + (neo-grenadier-method-195 (_type_) none) + ) + ) + +;; definition for method 3 of type neo-grenadier +(defmethod inspect ((this neo-grenadier)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tshot-trajectory: #~%" (-> this shot-trajectory)) + (format #t "~2Thostile-path: ~A~%" (-> this hostile-path)) + (format #t "~2Tbank: #~%" (-> this bank)) + (format #t "~2Tjoint: #~%" (-> this joint)) + (format #t "~2Theading: ~A~%" (-> this heading)) + (format #t "~2Tmove-pos: #~%" (-> this move-pos)) + (format #t "~2Tmove-angle: ~f~%" (-> this move-angle)) + (format #t "~2Tstatus-flags: ~D~%" (-> this status-flags)) + (format #t "~2Tsuppress-knockaside-timer: ~D~%" (-> this suppress-knockaside-timer)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-neo-grenadier-defaults*, type fact-info-enemy-defaults +(define *fact-info-neo-grenadier-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +;; definition for symbol *neo-grenadier-nav-enemy-info*, type nav-enemy-info +(define *neo-grenadier-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #t + :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 'inline-array idle-control-frame 17 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 4 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 4 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x7 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 4 + :param1 8 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x8 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 39) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 11 + :hostile-anim 13 + :hit-anim 23 + :knocked-anim 31 + :knocked-land-anim 32 + :die-anim 33 + :die-falling-anim 34 + :victory-anim 22 + :jump-wind-up-anim 5 + :jump-in-air-anim 5 + :jump-land-anim 5 + :neck-joint 24 + :look-at-joint 24 + :bullseye-joint 18 + :sound-hit (static-sound-name "grenadier-hit") + :sound-die (static-sound-name "grenadier-die") + :notice-distance (meters 80) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 14.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 0.18204445 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 24 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 1802.24 :z 286.72 :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 9 + :turn-anim -1 + :run-anim 13 + :taunt-anim -1 + :run-travel-speed (meters 12) + :run-acceleration (meters 1) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 80) + :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! (-> *neo-grenadier-nav-enemy-info* fact-defaults) *fact-info-neo-grenadier-defaults*) + +;; definition for method 82 of type neo-grenadier +(defmethod event-handler ((this neo-grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit-knocked) + (when (= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (if (and (not (time-elapsed? (-> this suppress-knockaside-timer) (seconds 0.6))) + (and (-> this next-state) (= (-> this next-state name) 'attack)) + (!= (-> this hit-points) 0.0) + ) + (return #t) + ) + (logior! (-> this status-flags) (grenadier-status-flag gsf0)) + (set-time! (-> this suppress-knockaside-timer)) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('notify) + (cond + ((and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) + (let ((v1-22 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-22 from) (process->ppointer arg0)) + (set! (-> v1-22 num-params) arg1) + (set! (-> v1-22 message) 'victory) + (set! (-> v1-22 param 0) (-> arg3 param 0)) + (set! (-> v1-22 param 1) (-> arg3 param 1)) + (set! (-> v1-22 param 2) (-> arg3 param 2)) + (set! (-> v1-22 param 3) (-> arg3 param 3)) + (set! (-> v1-22 param 4) (-> arg3 param 4)) + (set! (-> v1-22 param 5) (-> arg3 param 5)) + (send-event-function this v1-22) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for function pos-rotate-y<-vector+vector +(defun pos-rotate-y<-vector+vector ((arg0 vector) (arg1 vector)) + (let ((f0-0 (rotate-y<-vector+vector arg0 arg1))) + (if (< f0-0 0.0) + (+ 65536.0 f0-0) + f0-0 + ) + ) + ) + +;; definition for method 194 of type neo-grenadier +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod set-bank-info! ((this neo-grenadier) (arg0 vector)) + (closest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) + (set! (-> this bank final-pos quad) (-> arg0 quad)) + (set! (-> this bank tangent-pos quad) (-> arg0 quad)) + (set! (-> this move-pos quad) (-> this bank tangent-pos quad)) + (none) + ) + +;; definition for method 193 of type neo-grenadier +;; WARN: Return type mismatch int vs none. +(defmethod neo-grenadier-method-193 ((this neo-grenadier)) + (let ((s5-0 (handle->process (-> this focus handle)))) + (when s5-0 + (cond + ((-> this hostile-path) + (let* ((s4-0 (-> this hostile-path)) + (f30-0 (path-control-method-23 s4-0 (get-trans (the-as process-focusable s5-0) 0))) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> this heading) (not (-> this heading))) + (let* ((f0-0 (rand-vu-float-range 0.2 0.45)) + (f0-1 (if (-> this heading) + (+ f30-0 f0-0) + (- f30-0 f0-0) + ) + ) + ) + (if (< f0-1 0.0) + (set! f0-1 (+ 1.0 f0-1)) + ) + (if (< 1.0 f0-1) + (set! f0-1 (+ -1.0 f0-1)) + ) + (get-point-at-percent-along-path! s4-0 s3-1 f0-1 'interp) + ) + (set-bank-info! this s3-1) + ) + ) + (else + (let* ((s4-1 (-> this root)) + (a0-10 (get-trans (the-as process-focusable s5-0) 0)) + (v1-27 (vector-! (new 'stack-no-clear 'vector) a0-10 (-> s4-1 trans))) + ) + (vector-length v1-27) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> this heading) (not (-> this heading))) + (if (-> this heading) + (set-vector! s3-2 (-> v1-27 z) (-> v1-27 y) (- (-> v1-27 x)) 1.0) + (set-vector! s3-2 (- (-> v1-27 z)) (-> v1-27 y) (-> v1-27 x) 1.0) + ) + (vector-normalize! s3-2 (* 4096.0 (rand-vu-float-range 14.0 18.0))) + (set-bank-info! this (vector+! s2-1 (-> s4-1 trans) s3-2)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (neo-grenadier) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let* ((f30-0 (rnd-float-range self 0.9 1.1)) + (a0-2 '((neo-grenadier-patrol-ja) (neo-grenadier-patrol1-ja))) + (gp-0 ((method-of-type (rtype-of a0-2) length) a0-2)) + (s5-0 (new 'static 'array uint64 2 #x9 #xa)) + (s4-0 (-> (the-as (pointer int32) (+ (* (rnd-int self gp-0) 8) (the-as int s5-0))))) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data s4-0) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (when (enemy-method-134 self 0.2) + (ja-no-eval :num! (loop!)) + (ja-channel-push! 1 (seconds 0.6)) + (nav-enemy-method-182 self) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (until (not (enemy-method-134 self 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (nav-enemy-method-181 self) + (ja-no-eval :num! (loop!)) + (set! s4-0 (-> (the-as (pointer int32) (+ (* (rnd-int self gp-0) 8) (the-as int s5-0))))) + (ja-channel-push! 1 (seconds 0.6)) + (ja-no-eval :group! (-> self draw art-group data s4-0) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate notice (neo-grenadier) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (vector-reset! (-> self root transv)) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (neo-grenadier) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (neo-grenadier-method-193 self) + (set-look-at-mode! self 2) + (logclear! (-> self status-flags) (grenadier-status-flag gsf0)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let* ((s5-0 (get-trans (the-as process-focusable a0-1) 0)) + (gp-0 (-> self root trans)) + (f30-0 (vector-vector-distance gp-0 s5-0)) + ) + (cond + ((and (< f30-0 12288.0) (get-focus! self)) + (go-virtual spin-kick) + ) + ((< f30-0 40960.0) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> self root trans quad)) + (new 'stack-no-clear 'vector) + (vector-normalize! s3-1 49152.0) + (closest-point-on-mesh (-> self nav) s4-0 (vector+! s4-0 s5-0 s3-1) (the-as nav-poly #f)) + (when (< 32768.0 (vector-vector-distance gp-0 s4-0)) + (set! (-> self move-pos quad) (-> s4-0 quad)) + (let ((a0-11 (-> self nav state)) + (v1-32 (-> self move-pos)) + ) + (logclear! (-> a0-11 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-11 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-11 target-pos quad) (-> v1-32 quad)) + ) + 0 + (go-virtual backup) + ) + ) + ) + ) + ) + ) + ) + (when (or (time-elapsed? (-> self state-time) (rand-vu-int-range (seconds 3) (seconds 9))) + (>= 8192.0 (vector-vector-xz-distance (-> self root trans) (-> self bank final-pos))) + ) + (if (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + (go-virtual attack) + (go-stare self) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let* ((a0-1 '((neo-grenadier-run-ja) (neo-grenadier-run1-ja))) + (a1-3 ((method-of-type (rtype-of a0-1) length) a0-1)) + (gp-0 (new 'static 'array uint64 2 #xd #xe)) + (gp-1 + (-> self draw art-group data (-> (the-as (pointer int32) (+ (* (rnd-int self a1-3) 8) (the-as int gp-0))))) + ) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (until #f + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (let ((gp-0 (-> self bank))) + (if (< (vector-vector-xz-distance (-> self root trans) (-> gp-0 tangent-pos)) 9830.4) + (set! (-> self move-pos quad) (-> gp-0 final-pos quad)) + ) + ) + (let ((a0-3 (-> self nav state)) + (v1-5 (-> self move-pos)) + ) + (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-3 target-pos quad) (-> v1-5 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate backup (neo-grenadier) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-181 self) + ) + :trans (behavior () + (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-pos)))) + (if (or (>= 12288.0 f0-0) (time-elapsed? (-> self state-time) (seconds 6))) + (go-hostile self) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! neo-grenadier-run-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-pos)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate spin-kick (neo-grenadier) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (nav-enemy-method-182 self) + (nav-enemy-method-183 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-8 *game-info*) + (a0-3 (+ (-> v1-8 attack-id) 1)) + ) + (set! (-> v1-8 attack-id) a0-3) + (set! (-> self attack-id) a0-3) + ) + (let ((v1-12 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-12 prim-core action) (collide-action deadly)) + (set! (-> v1-12 local-sphere w) 7372.8) + ) + ) + :exit (behavior () + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-3 prim-core action) (collide-action)) + (set! (-> v1-3 local-sphere w) 4096.0) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.135)) + (ja-no-eval :group! neo-grenadier-spin-kick-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-hostile self) + ) + :post (behavior () + (when (nav-enemy-method-186 self) + (let ((a0-2 (handle->process (-> self focus handle)))) + (if a0-2 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-2) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + (nav-enemy-simple-post) + ) + ) + +;; definition for method 85 of type neo-grenadier +;; INFO: Used lq/sq +(defmethod knocked-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot) (knocked-type none)) + (let ((s4-1 (-> this + draw + art-group + data + (cond + ((= (-> this hit-points) 0.0) + (-> this enemy-info knocked-anim) + ) + ((= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> this root transv quad)) + (let* ((s3-0 quaternion-rotate-y-to-vector!) + (s2-0 (new 'stack-no-clear 'quaternion)) + (s1-0 (-> this root quat)) + (a1-3 (get-knockback-dir! this (new 'stack-no-clear 'vector))) + (s3-1 (s3-0 s2-0 s1-0 (the-as quaternion (vector-negate! a1-3 a1-3)) 32768.0)) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector-inv-orient-by-quat! s4-0 s4-0 s3-1) + ) + (if (< 0.0 (-> s4-0 x)) + 24 + 25 + ) + ) + ) + (else + (-> this enemy-info knocked-anim) + ) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-12 param 1) (-> arg0 anim-speed)) + (set! (-> a0-12 frame-num) 0.0) + (joint-control-channel-group! a0-12 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + #t + ) + (((knocked-type blue-shot)) + (let* ((a0-14 '((neo-grenadier-blue-hit0-ja) (neo-grenadier-blue-hit1-ja) (neo-grenadier-blue-hit2-ja))) + (a1-11 ((method-of-type (rtype-of a0-14) length) a0-14)) + (s5-1 (new 'static 'array uint64 3 #x1b #x1c #x1d)) + (s4-2 (new 'static 'array int32 4 0 0 0 0)) + (a2-3 (ash 1 (-> s4-2 0))) + (v1-23 (enemy-method-131 this a1-11 a2-3)) + (s5-2 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-23 8) (the-as int s5-1)))))) + ) + (set! (-> s4-2 0) v1-23) + (let ((v1-26 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-26 (= v1-26 (-> this draw art-group data 30))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.067)) + ) + ) + (let ((a0-29 (-> this skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim s5-2)) + (set! (-> a0-29 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) + (set! (-> a0-29 param 1) 1.0) + (set! (-> a0-29 frame-num) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim s5-2) num-func-seek!) + ) + ) + #t + ) + (else + ((method-of-type nav-enemy knocked-anim) this arg0) + ) + ) + ) + +;; definition for method 86 of type neo-grenadier +(defmethod knocked-land-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 30))) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + ) + #t + ) + ((or (= (-> this incoming knocked-type) (knocked-type yellow-shot)) (zero? (-> this incoming knocked-type))) + #f + ) + ((< 0.0 (-> this hit-points)) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-9 (-> this skel root-channel 0)) + ) + (set! (-> a0-9 frame-group) (the-as art-joint-anim a1-4)) + (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim a1-4) frames num-frames) -1))) + (set! (-> a0-9 param 1) (-> arg0 anim-speed)) + (set! (-> a0-9 frame-num) 0.0) + (joint-control-channel-group! a0-9 (the-as art-joint-anim a1-4) num-func-seek!) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) + (set! (-> a0-11 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) + ) + (set! (-> a0-11 param 1) (-> arg0 anim-speed)) + (set! (-> a0-11 frame-num) 0.0) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) + ) + #t + ) + ) + ) + +;; failed to figure out what this is: +(defstate attack (neo-grenadier) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('event-attack) + (let ((s4-0 (handle->process (-> self focus handle)))) + (when s4-0 + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node neo-grenadier-lod0-jg bomb)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s4-0) 0) gp-0))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (let ((f0-0 (vector-length s5-1))) + 0.0 + (let ((f0-1 (fmin 245760.0 f0-0))) + (vector-normalize! s5-1 f0-1) + ) + ) + (vector+! s4-1 gp-0 s5-1) + (let ((f0-2 122880.0)) + (setup-from-to-xz-vel! (-> self shot-trajectory) gp-0 s4-1 f0-2 -102400.0) + ) + ) + (set! (-> s5-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-normalize! s5-1 1638.4) + (vector+! gp-0 gp-0 s5-1) + ) + (let ((a1-9 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-9 ent) (-> self entity)) + (set! (-> a1-9 charge) 1.0) + (set! (-> a1-9 options) (projectile-options)) + (logclear! (-> a1-9 options) (projectile-options po14 po15 po16)) + (set! (-> a1-9 pos quad) (-> gp-0 quad)) + (set! (-> a1-9 vel quad) (-> self shot-trajectory initial-velocity quad)) + (set! (-> a1-9 notify-handle) (process->handle self)) + (set! (-> a1-9 owner-handle) (the-as handle #f)) + (set! (-> a1-9 target-handle) (the-as handle #f)) + (set! (-> a1-9 target-pos quad) (the-as uint128 0)) + (set! (-> a1-9 ignore-handle) (process->handle self)) + (let* ((v1-30 *game-info*) + (a0-28 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-28) + (set! (-> a1-9 attack-id) a0-28) + ) + (set! (-> a1-9 timeout) (seconds 4)) + (let ((v1-32 (-> (spawn-projectile metalhead-grenade-shot a1-9 self *default-dead-pool*) 0)) + (v0-0 (the-as object 'neo-grenadier-shot)) + ) + (set! (-> (the-as metalhead-grenade-shot v1-32) attack-mode) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (let ((v1-1 (-> self nav state)) + (a0-1 (-> self root trans)) + ) + (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + ) + 0 + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-10 *game-info*) + (a0-6 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-6) + (set! (-> self attack-id) a0-6) + ) + (set-look-at-mode! self 1) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> 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)) + ) + (logclear! (-> self status-flags) (grenadier-status-flag gsf1)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + ) + :code (behavior () + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (let ((f28-0 (vector-length (-> self root transv)))) + (ja-channel-push! 1 (seconds 0.2)) + (when (< 4096.0 f28-0) + (let* ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> self root transv) 0.3)) + (a2-2 (vector+! (new 'stack-no-clear 'vector) (-> self root trans) v1-8)) + ) + (set! (-> self move-pos quad) (-> self root trans quad)) + (closest-point-on-mesh (-> self nav) (-> self move-pos) a2-2 (the-as nav-poly #f)) + ) + (let ((a0-10 (-> self nav state)) + (v1-13 (-> self move-pos)) + ) + (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-10 target-pos quad) (-> v1-13 quad)) + ) + 0 + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logior! (-> self status-flags) (grenadier-status-flag gsf1)) + (ja-no-eval :group! neo-grenadier-run-to-throw-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (ja-channel-push! 1 (seconds 0.067)) + (logclear! (-> self status-flags) (grenadier-status-flag gsf1)) + (if (logtest? (enemy-flag ef44) (-> 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)) + ) + ) + ) + (nav-enemy-method-182 self) + (cond + ((logtest? (-> self status-flags) (grenadier-status-flag gsf0)) + (ja-channel-push! 1 (seconds 0.135)) + (ja-no-eval :group! neo-grenadier-throw-quick-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (logclear! (-> self status-flags) (grenadier-status-flag gsf0)) + ) + (else + (when (not (enemy-method-105 self 1820.4445 #t)) + (nav-enemy-method-183 self) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! neo-grenadier-throw-turn-in-place-ja) + (ja :num-func num-func-identity :frame-num 0.0) + (until (enemy-method-105 self 910.2222 #t) + (ja-blend-eval) + (suspend) + (ja :num! (loop! 0.75)) + ) + (nav-enemy-method-184 self) + ) + (nav-enemy-method-184 self) + (ja-channel-push! 1 (seconds 0.067)) + (let ((a0-44 (handle->process (-> self focus handle)))) + (when a0-44 + (let ((f0-14 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-44) 0)))) + (cond + ((< 102400.0 f0-14) + (ja-no-eval :group! neo-grenadier-throw-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! neo-grenadier-throw1-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (go-hostile self) + ) + :post (behavior () + (when (nav-enemy-method-186 self) + (let ((a0-2 (handle->process (-> self focus handle)))) + (if a0-2 + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable a0-2) 0) + (-> self nav max-rotation-rate) + (seconds 0.02) + ) + ) + ) + ) + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate hit (neo-grenadier) + :virtual #t + :code (behavior () + (local-vars (v1-10 int) (v1-44 enemy-flag) (v1-46 enemy-flag) (v1-48 enemy-flag)) + (let ((gp-0 (get-knockback-dir! self (new 'stack-no-clear 'vector)))) + 0 + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + gp-0 + (meters 6) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + (add-debug-quaternion #t (bucket-id debug-no-zbuf1) (-> self root trans) (-> self root quat)) + (let ((f0-0 (quaternion-vector-y-angle (-> self root quat) gp-0))) + (cond + ((and (< -8192.0 f0-0) (>= 8192.0 f0-0)) + (set! v1-10 26) + ) + ((and (< 8192.0 f0-0) (>= 24576.0 f0-0)) + (set! v1-10 24) + ) + ((and (< -24576.0 f0-0) (>= -8192.0 f0-0)) + (set! v1-10 25) + ) + (else + (set! v1-10 23) + ) + ) + ) + ) + (let ((gp-1 (-> self draw art-group data v1-10))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-1 :num! (seek!) :frame-num 0.0) + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-43 (-> self enemy-flags))) + (if (logtest? v1-43 (enemy-flag vulnerable-backup)) + (set! v1-44 (logior v1-43 (enemy-flag vulnerable))) + (set! v1-44 (logclear v1-43 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-44) + (let ((v1-45 (-> self enemy-flags))) + (if (logtest? v1-45 (enemy-flag attackable-backup)) + (set! v1-46 (logior v1-45 (enemy-flag attackable))) + (set! v1-46 (logclear v1-45 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-46) + (let ((v1-47 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-47) + (set! v1-48 (logior (enemy-flag trackable) v1-47)) + (set! v1-48 (logclear v1-47 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-48) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (cond + ((= (-> self focus aware) (enemy-aware ea3)) + (if (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + (go-virtual attack) + ) + (go-hostile self) + ) + (else + (go-stare self) + ) + ) + ) + ) + +;; definition for method 78 of type neo-grenadier +(defmethod go-hostile ((this neo-grenadier)) + (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) + (and (logtest? (-> this status-flags) (grenadier-status-flag gsf0)) + (handle->process (-> this focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + (go (method-of-object this attack)) + ) + ((method-of-type nav-enemy go-hostile) this) + ) + +;; failed to figure out what this is: +(defstate victory (neo-grenadier) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (cond + ((zero? (rand-vu-int-range 0 1)) + (ja-no-eval :group! neo-grenadier-victory-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (else + (ja-no-eval :group! neo-grenadier-notice-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (go-best-state self) + ) + ) + +;; definition for method 160 of type neo-grenadier +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this neo-grenadier) (arg0 nav-control)) + (local-vars (a0-4 int) (a0-6 int)) + (when (not (logtest? (-> this status-flags) (grenadier-status-flag gsf1))) + (let ((v1-3 (new 'stack-no-clear 'vector)) + (a2-0 (new 'stack-no-clear 'vector)) + ) + (vector-reset! a2-0) + (set! (-> a2-0 y) 1.0) + (let ((t0-0 (-> arg0 state))) + (set! (-> v1-3 quad) (-> t0-0 heading quad)) + ) + (let* ((a1-3 (-> *perf-stats* data 33)) + (a3-3 (-> a1-3 ctrl)) + ) + (+! (-> a1-3 count) 1) + (b! (zero? a3-3) cfg-3 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a3-3) + ) + (.sync.l) + (.sync.p) + (label cfg-3) + 0 + (forward-up-nopitch->quaternion (-> this root quat) v1-3 a2-0) + ) + (let ((v1-5 (-> *perf-stats* data 33))) + (b! (zero? (-> v1-5 ctrl)) cfg-5 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-4 pcr0) + (+! (-> v1-5 accum0) a0-4) + (.mfpc a0-6 pcr1) + (+! (-> v1-5 accum1) a0-6) + ) + (label cfg-5) + 0 + ) + 0 + (none) + ) + +;; definition for method 59 of type neo-grenadier +;; WARN: Return type mismatch object vs none. +(defmethod enemy-common-post ((this neo-grenadier)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 34)))) + (spawn (-> this part) a1-1) + ) + (none) + ) + +;; definition for method 120 of type neo-grenadier +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this neo-grenadier)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0))) + (set! (-> s5-0 total-prims) (the-as uint 7)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 22528.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 6553.6 0.0 6553.6) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action)) + (set! (-> v1-15 transform-index) 31) + (set-vector! (-> v1-15 local-sphere) 0.0 0.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 enemy)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action deadly)) + (set! (-> v1-17 transform-index) 34) + (set-vector! (-> v1-17 local-sphere) 0.0 0.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 collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action deadly)) + (set! (-> v1-19 transform-index) 23) + (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 collide-as) (collide-spec enemy)) + (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-21 prim-core action) (collide-action deadly)) + (set! (-> v1-21 transform-index) 16) + (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 collide-with) (collide-spec backgnd obstacle hit-by-others-list)) + (set! (-> v1-23 prim-core action) (collide-action solid)) + (set-vector! (-> v1-23 local-sphere) 0.0 12288.0 0.0 12288.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 7 of type neo-grenadier +(defmethod relocate ((this neo-grenadier) (offset int)) + (when (-> this hostile-path) + (if (nonzero? (-> this hostile-path)) + (&+! (-> this hostile-path) offset) + ) + ) + (call-parent-method this offset) + ) + +;; definition for method 121 of type neo-grenadier +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this neo-grenadier)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-grenadier" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *neo-grenadier-nav-enemy-info*) + (let ((v1-5 (-> this neck))) + (when v1-5 + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-5 ignore-angle) 30947.555) + ) + ) + (let ((v1-6 (-> this nav))) + (set! (-> v1-6 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this heading) (if (rand-vu-percent? 0.5) + #t + #f + ) + ) + (set! (-> this move-angle) 5461.3335) + (set! (-> this status-flags) (grenadier-status-flag)) + (set! (-> this suppress-knockaside-timer) 0) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1523) this)) + (set! (-> this hostile-path) (new 'process 'path-control this 'hostile 0.0 (-> this entity) #t)) + (if (zero? (-> this hostile-path)) + (set! (-> this hostile-path) #f) + ) + (if (-> this hostile-path) + (logior! (-> this hostile-path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (add-connection + *part-engine* + this + 24 + this + 468 + (new 'static 'vector :x 532.48 :y -81.92 :z 1515.52 :w 163840.0) + ) + (add-connection + *part-engine* + this + 24 + this + 468 + (new 'static 'vector :x -532.48 :y -81.92 :z 1515.52 :w 163840.0) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc b/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc new file mode 100644 index 0000000000..f64e9aa327 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc @@ -0,0 +1,1869 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-neo-juicer-shot-hit + :id 1524 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5003)) + ) + +;; failed to figure out what this is: +(defpart 5003 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 64.0) + (:g 64.0 32.0) + (:b 96.0 64.0) + (:a 64.0) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-r -0.35555556) + (:fade-g -0.35555556) + (:fade-b 0.0) + (:fade-a -0.30476192) + (:accel-y (meters -0.00016666666) (meters 0.00016666666)) + (:timer (seconds 0.7)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.2)) + (:next-launcher 5004) + (:rotate-y (degrees 0) (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 5005 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 5006 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 48.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 5007 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 16)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 5008 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 196.0 128.0) + (:b 64.0 64.0) + (:a 32.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; definition of type neo-juicer-shot +(deftype neo-juicer-shot (projectile) + ((lightning lightning-control 5) + (victim handle) + ) + ) + +;; definition for method 3 of type neo-juicer-shot +(defmethod inspect ((this neo-juicer-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Tlightning[5] @ #x~X~%" (-> this lightning)) + (format #t "~2Tvictim: ~D~%" (-> this victim)) + (label cfg-4) + this + ) + +;; definition for method 35 of type neo-juicer-shot +;; INFO: Used lq/sq +(defmethod proj-event-handler ((this neo-juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('reset) + (let ((v1-1 (the-as object (-> arg3 param 0)))) + (set! (-> this root trans quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) + (set! (-> this starting-pos quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) + (set! (-> this root transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) + (set! (-> this pre-move-transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) + ) + (set! (-> this hits) 0) + (set-time! (-> this spawn-time)) + (if (made-impact? this) + (go (method-of-object this impact)) + (go (method-of-object this moving)) + ) + #t + ) + (else + ((method-of-type projectile proj-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate dissipate (neo-juicer-shot) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +;; definition for method 37 of type neo-juicer-shot +(defmethod deal-damage! ((this neo-juicer-shot) (arg0 process) (arg1 event-message-block)) + (let ((a0-2 (if (type? arg0 process-focusable) + arg0 + ) + ) + ) + (when a0-2 + (set! (-> this victim) (process->handle a0-2)) + #t + ) + ) + ) + +;; definition for method 25 of type neo-juicer-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this neo-juicer-shot)) + (let ((s5-0 (-> this starting-pos)) + (s4-0 (-> this root trans)) + ) + (when (line-in-view-frustum? s5-0 s4-0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'matrix)) + ) + (launch-particles (-> *part-id-table* 5007) s5-0) + (launch-particles (-> *part-id-table* 5008) s5-0) + (when (not (handle->process (-> this victim))) + (launch-particles (-> *part-id-table* 5007) s4-0) + (launch-particles (-> *part-id-table* 5008) s4-0) + ) + (vector-! s2-0 s4-0 s5-0) + (vector-normalize! s2-0 1.0) + (matrix-axis-angle! s1-0 s2-0 13107.2) + (vector-reset! (-> s1-0 trans)) + (set-vector! s3-0 (-> s2-0 z) 0.0 (- (-> s2-0 x)) 1.0) + (vector-normalize! s3-0 409.6) + (dotimes (s0-0 5) + (vector-matrix*! s3-0 s3-0 s1-0) + (vector+! s2-0 s3-0 s5-0) + (let ((a0-17 (-> this lightning s0-0)) + (v1-21 s2-0) + ) + (set! (-> a0-17 state meet data 0 quad) (-> v1-21 quad)) + ) + (let ((a0-20 (-> this lightning s0-0)) + (v1-25 s4-0) + ) + (set! (-> a0-20 state meet data (+ (-> a0-20 state points-to-draw) -1) quad) (-> v1-25 quad)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type neo-juicer-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this neo-juicer-shot)) + (projectile-method-25 this) + (cond + ((logtest? (-> *part-group-id-table* 1524 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1524)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1524)) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type neo-juicer-shot +(defmethod made-impact? ((this neo-juicer-shot)) + (let ((gp-0 (-> this root)) + (s5-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-0 s5-0)) + (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) + (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-0 action-mask) (collide-action solid)) + ) + (let ((a0-2 (handle->process (-> this notify-handle)))) + (when a0-2 + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) + (f0-2 (- (vector-length s4-1))) + ) + (fill-and-try-snap-to-surface gp-0 s4-1 f0-2 0.0 -3072.0 s5-0) + ) + ) + ) + ) + ) + +;; definition for function neo-juicer-proj-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun neo-juicer-proj-move ((arg0 neo-juicer-shot)) + (let ((s5-0 (handle->process (-> arg0 victim)))) + (cond + (s5-0 + (set! (-> arg0 root trans quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + ((method-of-type projectile deal-damage!) arg0 s5-0 (the-as event-message-block #f)) + ) + (else + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type neo-juicer-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this neo-juicer-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (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 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 event-self) 'touched) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; definition for method 7 of type neo-juicer-shot +;; WARN: Return type mismatch projectile vs neo-juicer-shot. +(defmethod relocate ((this neo-juicer-shot) (offset int)) + (dotimes (v1-0 5) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) offset) + ) + ) + (the-as neo-juicer-shot ((method-of-type projectile relocate) this offset)) + ) + +;; definition for method 31 of type neo-juicer-shot +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this neo-juicer-shot)) + (logior! (-> this options) (projectile-options po17)) + (set! (-> this move) neo-juicer-proj-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this attack-mode) 'neo-juicer-shot) + (dotimes (s5-0 5) + (set! (-> this lightning s5-0) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :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 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1433.6 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + (set! (-> this victim) (the-as handle #f)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-neo-juicer neo-juicer neo-juicer-lod0-jg -1 + ((neo-juicer-lod0-mg (meters 20)) (neo-juicer-lod1-mg (meters 40)) (neo-juicer-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.3) + :shadow neo-juicer-shadow-mg + :origin-joint-index 21 + ) + +;; definition of type neo-juicer-anim-info +(deftype neo-juicer-anim-info (structure) + ((anim-index int32) + ) + :pack-me + ) + +;; definition for method 3 of type neo-juicer-anim-info +(defmethod inspect ((this neo-juicer-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'neo-juicer-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (label cfg-4) + this + ) + +;; definition of type neo-juicer-global-info +(deftype neo-juicer-global-info (basic) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (idle-anim neo-juicer-anim-info 3 :inline) + (patrol-anim neo-juicer-anim-info 2 :inline) + (notice-anim neo-juicer-anim-info 2 :inline) + (charge-anim neo-juicer-anim-info 2 :inline) + (knocked-anim neo-juicer-anim-info 2 :inline) + (celebrate-anim neo-juicer-anim-info 2 :inline) + (yellow-hit-anim neo-juicer-anim-info 4 :inline) + (blue-hit-anim neo-juicer-anim-info 6 :inline) + ) + ) + +;; definition for method 3 of type neo-juicer-global-info +(defmethod inspect ((this neo-juicer-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tidle-anim[3] @ #x~X~%" (-> this idle-anim)) + (format #t "~1Tpatrol-anim[2] @ #x~X~%" (-> this patrol-anim)) + (format #t "~1Tnotice-anim[2] @ #x~X~%" (-> this notice-anim)) + (format #t "~1Tcharge-anim[2] @ #x~X~%" (-> this charge-anim)) + (format #t "~1Tknocked-anim[2] @ #x~X~%" (-> this knocked-anim)) + (format #t "~1Tcelebrate-anim[2] @ #x~X~%" (-> this celebrate-anim)) + (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> this blue-hit-anim)) + (label cfg-4) + this + ) + +;; definition of type neo-juicer +(deftype neo-juicer (nav-enemy) + ((los los-control :inline) + (intro-path path-control) + (joint joint-mod) + (joint-enable symbol) + (joint-blend float) + (last-fire-time time-frame) + (heading symbol) + (move-angle float) + (torso-track-player joint-mod) + (circle-backward? symbol :offset 832) + (using-turn-anim symbol) + (hit-focus focus) + (ambush-path-pt int8) + (charge-index int8) + (hostile-dest vector :inline) + (current-projectile handle) + ) + (:state-methods + ambush-cont + attack + ) + (:methods + (go-die-or-knocked (_type_) object) + (spawn-proj! (_type_ process-focusable uint) none) + (track-focus! (_type_) none) + (start-tracking (_type_) none) + (toggle-deadly-flag (_type_ symbol) none) + ) + ) + +;; definition for method 3 of type neo-juicer +(defmethod inspect ((this neo-juicer)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable)) + (format #t "~2Tjoint-blend: ~f~%" (-> this joint-blend)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Theading: ~A~%" (-> this heading)) + (format #t "~2Tmove-angle: ~f~%" (-> this move-angle)) + (format #t "~2Ttorso-track-player: ~A~%" (-> this torso-track-player)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) + (format #t "~2Tcircle-backward?: ~A~%" (-> this circle-backward?)) + (format #t "~2Tusing-turn-anim: ~A~%" (-> this using-turn-anim)) + (format #t "~2Thit-focus: ~A~%" (-> this hit-focus)) + (format #t "~2Tambush-path-pt: ~D~%" (-> this ambush-path-pt)) + (format #t "~2Tcharge-index: ~D~%" (-> this charge-index)) + (format #t "~2Thostile-dest: #~%" (-> this hostile-dest)) + (format #t "~2Tcurrent-projectile: ~D~%" (-> this current-projectile)) + (label cfg-4) + this + ) + +;; definition for symbol *neo-juicer-global-info*, type neo-juicer-global-info +(define *neo-juicer-global-info* (new 'static 'neo-juicer-global-info + :idle-anim (new 'static 'inline-array neo-juicer-anim-info 3 + (new 'static 'neo-juicer-anim-info :anim-index 5) + (new 'static 'neo-juicer-anim-info :anim-index 6) + (new 'static 'neo-juicer-anim-info :anim-index 7) + ) + :patrol-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 8) + (new 'static 'neo-juicer-anim-info :anim-index 23) + ) + :notice-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 21) + (new 'static 'neo-juicer-anim-info :anim-index 22) + ) + :charge-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 9) + (new 'static 'neo-juicer-anim-info :anim-index 20) + ) + :knocked-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 16) + (new 'static 'neo-juicer-anim-info :anim-index 18) + ) + :celebrate-anim (new 'static 'inline-array neo-juicer-anim-info 2 + (new 'static 'neo-juicer-anim-info :anim-index 24) + (new 'static 'neo-juicer-anim-info :anim-index 25) + ) + :yellow-hit-anim (new 'static 'inline-array neo-juicer-anim-info 4 + (new 'static 'neo-juicer-anim-info :anim-index 33) + (new 'static 'neo-juicer-anim-info :anim-index 34) + (new 'static 'neo-juicer-anim-info :anim-index 35) + (new 'static 'neo-juicer-anim-info :anim-index 36) + ) + :blue-hit-anim (new 'static 'inline-array neo-juicer-anim-info 6 + (new 'static 'neo-juicer-anim-info :anim-index 26) + (new 'static 'neo-juicer-anim-info :anim-index 27) + (new 'static 'neo-juicer-anim-info :anim-index 28) + (new 'static 'neo-juicer-anim-info :anim-index 29) + (new 'static 'neo-juicer-anim-info :anim-index 30) + (new 'static 'neo-juicer-anim-info :anim-index 31) + ) + ) + ) + +;; definition for symbol *fact-info-neo-juicer-defaults*, type fact-info-enemy-defaults +(define *fact-info-neo-juicer-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +;; definition for symbol *neo-juicer-nav-enemy-info*, type nav-enemy-info +(define *neo-juicer-nav-enemy-info* (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #t + :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 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 5 + :notice-anim 21 + :hostile-anim 9 + :hit-anim 11 + :knocked-anim 18 + :knocked-land-anim 19 + :die-anim 40 + :die-falling-anim 41 + :victory-anim 24 + :jump-wind-up-anim 37 + :jump-in-air-anim 38 + :jump-land-anim 39 + :neck-joint 34 + :look-at-joint 34 + :bullseye-joint 6 + :sound-hit (static-sound-name "juicer-hit") + :sound-die (static-sound-name "juicer-die") + :notice-distance (meters 30) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 24) + :default-hit-points 9.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.9 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'shock-red + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 65536.0 + :knocked-soft-vxz-hi 94208.0 + :knocked-soft-vy-lo 77824.0 + :knocked-soft-vy-hi 98304.0 + :knocked-medium-vxz-lo 81920.0 + :knocked-medium-vxz-hi 98304.0 + :knocked-medium-vy-lo 81920.0 + :knocked-medium-vy-hi 122880.0 + :knocked-hard-vxz-lo 65536.0 + :knocked-hard-vxz-hi 95846.4 + :knocked-hard-vy-lo 122880.0 + :knocked-hard-vy-hi 163840.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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 98304.0 + :knocked-red-vy-lo 90112.0 + :knocked-red-vy-hi 131072.0 + :knocked-blue-vxz-lo 24576.0 + :knocked-blue-vxz-hi 32768.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 73728.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 34 + :gem-seg #x2 + :gem-no-seg #x4 + :gem-offset (new 'static 'sphere :y 942.08 :z 40.96 :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #t + :use-stop-chase #f + :use-circling #t + :use-pacing #t + :walk-anim 8 + :turn-anim 10 + :run-anim 9 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 8) + :run-turning-acceleration (meters 20) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 2) + :walk-turning-acceleration (meters 3) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 7.5) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 28672.0 + :circle-dist-hi 53248.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *neo-juicer-nav-enemy-info* fact-defaults) *fact-info-neo-juicer-defaults*) + +;; definition for method 194 of type neo-juicer +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod track-focus! ((this neo-juicer)) + (let ((s3-0 (handle->process (-> this focus handle)))) + (when s3-0 + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (let ((s3-1 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform fvec) 1.0) + ) + ) + (vector-! s5-0 s5-0 s4-0) + (vector-normalize! s5-0 1.0) + (quaternion-from-two-vectors-partial! (-> this joint quat) s3-1 s5-0 (-> this joint-blend)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 195 of type neo-juicer +;; WARN: Return type mismatch int vs none. +(defmethod start-tracking ((this neo-juicer)) + (cond + ((-> this torso-track-player) + (set! (-> this joint-enable) #t) + (seek! (-> this joint-blend) 1.0 (* 2.0 (seconds-per-frame))) + (track-focus! this) + ) + ((-> this joint-enable) + (seek! (-> this joint-blend) 0.0 (* 4.0 (seconds-per-frame))) + (track-focus! this) + (if (= (-> this joint-blend) 0.0) + (set! (-> this joint-enable) #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 59 of type neo-juicer +(defmethod enemy-common-post ((this neo-juicer)) + (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) + (t9-0 this) + ) + (los-control-method-9 + (-> this los) + (the-as process-focusable (handle->process (-> this focus handle))) + (the-as vector #f) + 819.2 + 4096.0 + ) + (start-tracking this) + (none) + ) + +;; definition for method 192 of type neo-juicer +(defmethod go-die-or-knocked ((this neo-juicer)) + (if (and (= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) + ) + ) + ) + (zero? (rnd-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) + (f1-0 32768.0) + ) + (>= f0-0 (* f1-0 f1-0)) + ) + ) + (go-die this) + (go (method-of-object this knocked)) + ) + ) + +;; definition for method 82 of type neo-juicer +(defmethod event-handler ((this neo-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit-flinch) + (cond + ((= (-> this hit-points) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go-die-or-knocked this) + ) + (else + (let ((v1-29 (ja-channel-float! (the-as art-joint-anim (-> this draw art-group data 11)) 0.0 0.0 0.0))) + (when v1-29 + (set! (-> v1-29 param 0) 1.0) + (set! (-> v1-29 param 1) 0.75) + (set! (-> v1-29 param 2) 2.0) + (set! (-> v1-29 num-func) num-func-interp-play!) + ) + ) + ) + ) + #t + ) + (('hit) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (= (-> this hit-points) 0.0) + (go-die-or-knocked this) + (go (method-of-object this hit)) + ) + #t + ) + (('instant-death) + (when (< 0.0 (-> this hit-points)) + (set! (-> this hit-points) 0.0) + (set! (-> this root penetrated-by) (get-penetrated-by this)) + (let ((s4-0 (get-knockback-dir! this (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s4-0 (-> this root quat)) + (vector-float*! s4-0 s4-0 -1.0) + (vector-normalize! s4-0 1.0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go-die-or-knocked this) + ) + #t + ) + (('notify) + (if (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) (handle->process (-> this focus handle)))) + (set! (-> this hit-focus) (the-as focus #t)) + ) + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (neo-juicer) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (or (and v1-2 (or (= v1-2 neo-juicer-charge0-ja) (= v1-2 neo-juicer-charge1-ja))) + (let ((v1-8 (ja-group))) + (and v1-8 (or (= v1-8 neo-juicer-patrol0-ja) (= v1-8 neo-juicer-patrol1-ja))) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (let ((gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* patrol-anim (rnd-int self 2) anim-index))) + (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + ) + (let ((v1-34 (ja-group))) + (if (not (and v1-34 (= v1-34 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (dotimes (s4-0 s5-0) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (when (zero? (rnd-int self 2)) + (nav-enemy-method-182 self) + (ja-channel-push! 1 (seconds 0.3)) + (let ((gp-1 0)) + (until (not (enemy-method-134 self 0.4)) + (let* ((v1-61 (enemy-method-131 self 3 gp-1)) + (a1-15 (-> self draw art-group data (-> *neo-juicer-global-info* idle-anim v1-61 anim-index))) + ) + (set! gp-1 (ash 1 v1-61)) + (ja-no-eval :group! a1-15 :num! (seek! max f30-0) :frame-num 0.0) + ) + (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + (nav-enemy-method-181 self) + ) + ) + ) + #f + ) + ) + +;; definition for method 93 of type neo-juicer +(defmethod setup-jump! ((this neo-juicer) (arg0 enemy-jump-info)) + ((method-of-type nav-enemy setup-jump!) this arg0) + (none) + ) + +;; definition for method 102 of type neo-juicer +(defmethod go-directed2 ((this neo-juicer)) + (case (-> this jump-why) + ((2) + (go (method-of-object this ambush-cont)) + ) + (else + ((method-of-type nav-enemy go-directed2) this) + ) + ) + ) + +;; failed to figure out what this is: +(defstate ambush (neo-juicer) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy ambush) enter))) + (if t9-0 + (t9-0) + ) + ) + (when (zero? (-> self intro-path)) + (format 0 "ERROR: ~A has no intro path, skipping ambush~%" (-> self name)) + (go-virtual notice) + ) + (get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp) + ) + :code (behavior () + (set! (-> self ambush-path-pt) 1) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 1.0 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-5 (process->ppointer self))) + (set! (-> a1-1 from) v1-5) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate ambush-cont (neo-juicer) + :virtual #t + :event enemy-event-handler + :code (behavior () + (let ((a0-0 (-> self intro-path)) + (v1-1 (+ (-> self ambush-path-pt) 1)) + ) + (if (< v1-1 (-> a0-0 curve num-cverts)) + (set! (-> self ambush-path-pt) v1-1) + (go-best-state self) + ) + ) + (until #f + (let ((gp-0 (new 'stack-no-clear 'vector))) + (get-point-in-path! (-> self intro-path) gp-0 (the float (-> self ambush-path-pt)) 'interp) + (set! (-> self enemy-flags) + (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) + ) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (let ((v1-9 (process->ppointer self))) + (set! (-> a1-1 from) v1-9) + ) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'jump) + (set! (-> a1-1 param 0) (the-as uint 2)) + (set! (-> a1-1 param 1) (the-as uint gp-0)) + (send-event-function self a1-1) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate notice (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.075)) + (let ((s5-0 0)) + (let ((s4-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) + (gp-1 (vector-! + (new 'stack-no-clear 'vector) + (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0) + (-> self root trans) + ) + ) + ) + (vector-flatten! gp-1 gp-1 (-> s4-0 uvec)) + (vector-normalize! gp-1 1.0) + (cond + ((< (vector-dot gp-1 (-> s4-0 fvec)) (cos 8192.0)) + ) + (else + (set! s5-0 (logior s5-0 1)) + ) + ) + ) + (let ((f30-1 (rnd-float-range self 0.8 1.2)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (let* ((a0-13 (enemy-method-131 self 2 s5-0)) + (a1-8 (-> self draw art-group data (-> *neo-juicer-global-info* notice-anim a0-13 anim-index))) + ) + (ja-no-eval :group! a1-8 :num! (seek! max f30-1) :frame-num 0.0) + ) + (until (ja-done? 0) + (let ((a1-9 (-> self nav state))) + (set! (-> gp-2 quad) (-> a1-9 travel quad)) + ) + (seek-toward-heading-vec! (-> self root) gp-2 (-> self nav max-rotation-rate) (seconds 0.02)) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate victory (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.15)) + (let ((gp-1 (-> self draw art-group data (-> *neo-juicer-global-info* celebrate-anim (rnd-int self 2) anim-index))) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (neo-juicer) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 neo-juicer-charge0-ja) (= v1-2 neo-juicer-charge1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (let* ((v1-16 (rnd-int self 2)) + (gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* charge-anim v1-16 anim-index))) + ) + (set! (-> self charge-index) v1-16) + (let ((v1-19 (ja-group))) + (if (not (and v1-19 (= v1-19 gp-0))) + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) + ) + (ja :num-func num-func-identity :frame-num 0.0) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (until #f + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + #f + ) + :post (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let* ((gp-0 (get-trans (the-as process-focusable a0-1) 1)) + (f0-0 (vector-vector-xz-distance (-> self root trans) gp-0)) + ) + (let ((v1-8 (-> self nav state))) + (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + ) + 0 + (if (and (>= 53248.0 f0-0) (should-check-los? (-> self los) 0) (get-focus! self)) + (go-virtual attack) + ) + ) + ) + ) + (nav-enemy-travel-post) + ) + ) + +;; definition for method 113 of type neo-juicer +(defmethod get-focus! ((this neo-juicer)) + (let* ((t9-0 (method-of-type nav-enemy get-focus!)) + (v1-1 (t9-0 this)) + ) + (if (and v1-1 (time-elapsed? (-> this last-fire-time) (seconds 7))) + v1-1 + ) + ) + ) + +;; definition for function neo-juicer-face-player-post +;; WARN: Return type mismatch int vs none. +(defbehavior neo-juicer-face-player-post neo-juicer () + (let ((gp-0 (handle->process (-> self focus handle)))) + (when (and (nav-enemy-method-186 self) gp-0) + (let ((f0-1 + (fabs + (deg-diff + (quaternion-y-angle (-> self root quat)) + (vector-y-angle + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) + ) + ) + ) + ) + ) + (cond + ((or (< 5461.3335 f0-1) (and (-> self using-turn-anim) (< 910.2222 f0-1))) + (set! (-> self using-turn-anim) #t) + (seek-to-point-toward-point! + (-> self root) + (get-trans (the-as process-focusable gp-0) 0) + (-> self nav max-rotation-rate) + (seconds 0.2) + ) + ) + (else + (set! (-> self using-turn-anim) #f) + ) + ) + ) + ) + ) + (nav-enemy-simple-post) + 0 + (none) + ) + +;; definition for method 193 of type neo-juicer +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod spawn-proj! ((this neo-juicer) (arg0 process-focusable) (arg1 uint)) + (with-pp + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 20))) + (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (when (not (handle->process (-> this current-projectile))) + (set! (-> s5-0 ent) (-> this entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options)) + (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 notify-handle) (process->handle this)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 target-handle) (the-as handle #f)) + (set! (-> s5-0 target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 ignore-handle) (process->handle this)) + (set! (-> s5-0 attack-id) arg1) + (set! (-> s5-0 timeout) (seconds 4)) + ) + (vector-normalize! (vector-! (-> s5-0 pos) (get-trans arg0 3) s4-0) 1.0) + (vector-float*! (-> s5-0 vel) (-> s5-0 pos) (* 24576.0 (-> pp clock frames-per-second))) + (vector+float*! (-> s5-0 pos) s4-0 (-> s5-0 pos) -1024.0) + (let ((a0-21 (handle->process (-> this current-projectile)))) + (if a0-21 + (send-event a0-21 'reset s5-0) + (set! (-> this current-projectile) + (ppointer->handle (spawn-projectile neo-juicer-shot s5-0 this *default-dead-pool*)) + ) + ) + ) + ) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate attack (neo-juicer) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((v1-1 (-> self nav state)) + (a0-1 (-> self root trans)) + ) + (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + ) + 0 + (set! (-> self torso-track-player) (the-as joint-mod #t)) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (set! (-> self hit-focus) #f) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-9 *game-info*) + (v0-0 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) v0-0) + (set! (-> self attack-id) v0-0) + ) + ) + :exit (behavior () + (set! (-> self torso-track-player) #f) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (toggle-deadly-flag self #f) + (set-time! (-> self last-fire-time)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (send-event (handle->process (-> self current-projectile)) 'die) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! neo-juicer-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (if (< 11.0 (ja-aframe-num 0)) + (toggle-deadly-flag self #t) + ) + (suspend) + (ja :num! (seek!)) + ) + 0 + (let* ((gp-0 #f) + (v1-29 *game-info*) + (s5-0 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) s5-0) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 (seconds 0.25)) + (ja-no-eval :group! neo-juicer-attack0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((s3-0 (handle->process (-> self focus handle)))) + (when s3-0 + (when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0))) + (spawn-proj! self (the-as process-focusable s3-0) s5-0) + (current-time) + (if (not gp-0) + (set! gp-0 #t) + ) + ) + ) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (b! + (not (and (-> self using-turn-anim) (let ((v1-73 (ja-group))) + (not (and v1-73 (= v1-73 neo-juicer-attack-turn-ja))) + ) + ) + ) + cfg-31 + :delay (empty-form) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! neo-juicer-attack-turn-ja) + (b! #t cfg-42 :delay (nop!)) + (label cfg-31) + (when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group))) + (not (and v1-84 (= v1-84 neo-juicer-attack0-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! neo-juicer-attack0-ja) + ) + (label cfg-42) + (suspend) + (ja :num! (seek!)) + ) + (send-event (handle->process (-> self current-projectile)) 'die) + (let ((a0-37 (handle->process (-> self focus handle)))) + (when a0-37 + (if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0))) + (go-virtual circling) + ) + ) + ) + (suspend) + ) + ) + ) + (if (-> self hit-focus) + (go-virtual victory) + ) + (go-hostile self) + ) + :post neo-juicer-face-player-post + ) + +;; failed to figure out what this is: +(defstate circling (neo-juicer) + :virtual #t + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (or (= v1-2 neo-juicer-charge0-ja) (= v1-2 neo-juicer-charge1-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (until #f + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (nav-enemy-method-177 self) + (let* ((v1-22 (rnd-int self 2)) + (gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* charge-anim v1-22 anim-index))) + ) + (set! (-> self charge-index) v1-22) + (let ((v1-25 (ja-group))) + (if (not (and v1-25 (= v1-25 gp-0))) + (ja-channel-push! 1 (seconds 0.15)) + ) + ) + (let ((s5-0 (+ (rnd-int self 6) 2)) + (f30-0 (rnd-float-range self 0.9 1.1)) + ) + (while (nonzero? s5-0) + (+! s5-0 -1) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + (when (< 20480.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans))) + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (vector-reset! (-> self root transv)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-2 (-> self draw art-group data (-> *neo-juicer-global-info* celebrate-anim (rnd-int self 2) anim-index))) + (f30-2 (rnd-float-range self 0.9 1.1)) + ) + (ja-no-eval :group! gp-2 :num! (seek! max f30-2) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-2)) + ) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate hit (neo-juicer) + :virtual #t + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-39 enemy-flag) (v1-41 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (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 vulnerable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag vulnerable))) + (set! v1-37 (logclear v1-36 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? v1-38 (enemy-flag attackable-backup)) + (set! v1-39 (logior v1-38 (enemy-flag attackable))) + (set! v1-39 (logclear v1-38 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (let ((v1-40 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-40) + (set! v1-41 (logior (enemy-flag trackable) v1-40)) + (set! v1-41 (logclear v1-40 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-41) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-virtual hostile) + ) + ) + +;; failed to figure out what this is: +(defstate stare (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 1)) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate taunt (neo-juicer) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.6)) + (let ((f30-0 (rnd-float-range self 0.8 1.2))) + (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (s5-0 (current-time)) + (f28-0 f30-0) + ) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) + :num! (loop! f28-0) + :frame-num 0.0 + ) + (until (time-elapsed? s5-0 gp-0) + (suspend) + (ja :num! (loop! f28-0)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info taunt-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (go-virtual stare) + ) + ) + +;; definition for method 85 of type neo-juicer +(defmethod knocked-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + (local-vars (a2-2 int)) + (case (-> this incoming knocked-type) + (((knocked-type yellow-shot)) + (ja-channel-push! 1 0) + (let* ((a2-0 (ash 1 (-> *neo-juicer-global-info* prev-yellow-hit))) + (v1-3 (enemy-method-131 this 4 a2-0)) + (a1-6 (-> this draw art-group data (-> *neo-juicer-global-info* yellow-hit-anim v1-3 anim-index))) + ) + (set! (-> *neo-juicer-global-info* prev-yellow-hit) v1-3) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) + (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) + (set! (-> a0-13 param 1) (-> arg0 anim-speed)) + (set! (-> a0-13 frame-num) 0.0) + (joint-control-channel-group! a0-13 (the-as art-joint-anim a1-6) num-func-seek!) + ) + ) + ) + (((knocked-type blue-shot)) + (let ((v1-11 (ash 1 (-> *neo-juicer-global-info* prev-blue-hit)))) + (if (zero? (-> this charge-index)) + (set! a2-2 (logior v1-11 56)) + (set! a2-2 (logior v1-11 7)) + ) + ) + (let* ((v1-15 (enemy-method-131 this 6 a2-2)) + (s5-1 (-> this draw art-group data (-> *neo-juicer-global-info* blue-hit-anim v1-15 anim-index))) + ) + (set! (-> *neo-juicer-global-info* prev-blue-hit) v1-15) + (let ((v1-18 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-18 (= v1-18 (-> this draw art-group data 32))) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-32 (-> this skel root-channel 0))) + (set! (-> a0-32 frame-group) (the-as art-joint-anim s5-1)) + (set! (-> a0-32 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) + (set! (-> a0-32 param 1) 1.0) + (set! (-> a0-32 frame-num) 0.0) + (joint-control-channel-group! a0-32 (the-as art-joint-anim s5-1) num-func-seek!) + ) + ) + ) + (else + (let ((s4-1 (-> this draw art-group data (-> *neo-juicer-global-info* knocked-anim (rnd-int this 2) anim-index)))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-37 (-> this skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-37 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-37 param 1) (-> arg0 anim-speed)) + (set! (-> a0-37 frame-num) 0.0) + (joint-control-channel-group! a0-37 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + ) + ) + #t + ) + +;; definition for method 86 of type neo-juicer +(defmethod knocked-land-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + (cond + ((= (-> this incoming knocked-type) (knocked-type blue-shot)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 32))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!) + ) + ) + #t + ) + ) + ((!= (-> this incoming knocked-type) (knocked-type yellow-shot)) + (let* ((v1-14 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (s4-1 (if (and v1-14 (= v1-14 (-> this draw art-group data 18))) + (-> this draw art-group data 19) + (-> this draw art-group data 17) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim s4-1)) + (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) + (set! (-> a0-10 param 1) (-> arg0 anim-speed)) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! a0-10 (the-as art-joint-anim s4-1) num-func-seek!) + ) + ) + #t + ) + ) + ) + +;; definition for method 196 of type neo-juicer +;; WARN: Return type mismatch symbol vs none. +(defmethod toggle-deadly-flag ((this neo-juicer) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) + (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) + (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) + (if arg0 + (logior! (-> a2-1 prim-core action) (collide-action deadly)) + (logclear! (-> a2-1 prim-core action) (collide-action deadly)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 108 of type neo-juicer +(defmethod enemy-method-108 ((this neo-juicer) (arg0 process-focusable)) + (focus-test? arg0 invulnerable) + ) + +;; definition for method 120 of type neo-juicer +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this neo-juicer)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> s4-0 transform-index) 21) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 -4096.0 18432.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-14 local-sphere) 0.0 6144.0 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 6) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 16) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 11) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid)) + (set! (-> v1-22 transform-index) 34) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid)) + (set! (-> v1-24 transform-index) 20) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 2048.0) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-26 prim-core action) (collide-action solid)) + (set-vector! (-> v1-26 local-sphere) 0.0 8192.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-28 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-28 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-28 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 7 of type neo-juicer +(defmethod relocate ((this neo-juicer) (offset int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) offset) + ) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 121 of type neo-juicer +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this neo-juicer)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-juicer" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *neo-juicer-nav-enemy-info*) + (let ((v1-5 (-> this neck))) + (set! (-> v1-5 up) (the-as uint 1)) + (set! (-> v1-5 nose) (the-as uint 2)) + (set! (-> v1-5 ear) (the-as uint 0)) + (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-5 ignore-angle) 30947.555) + ) + (let ((v1-7 (-> this nav))) + (set! (-> v1-7 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this last-fire-time) 0) + (set! (-> this heading) (if (rand-vu-percent? 0.5) + #t + #f + ) + ) + (set! (-> this move-angle) 5461.3335) + (set! (-> this torso-track-player) #f) + (init-los! (-> this los) this (seconds 0.2) 327680.0 (collide-spec backgnd hit-by-others-list los-blocker)) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode polar-look-at) this 5)) + (set! (-> this using-turn-anim) #f) + (let ((v1-18 (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t))) + (set! (-> this intro-path) v1-18) + (if (nonzero? v1-18) + (logior! (-> v1-18 flags) (path-control-flag display draw-line draw-point draw-text)) + ) + ) + (add-connection + *part-engine* + this + 34 + this + 468 + (new 'static 'vector :x 901.12 :y -1146.88 :z 1269.76 :w 163840.0) + ) + (add-connection + *part-engine* + this + 34 + this + 468 + (new 'static 'vector :x -901.12 :y -1146.88 :z 1269.76 :w 163840.0) + ) + (add-connection *part-engine* this 20 this 5005 (new 'static 'vector :w 163840.0)) + (set! (-> this root pause-adjust-distance) 81920.0) + (set! (-> this current-projectile) (the-as handle #f)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/saberfish-spawner_REF.gc b/test/decompiler/reference/jak3/levels/sewer/saberfish-spawner_REF.gc new file mode 100644 index 0000000000..83b3a88a53 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/saberfish-spawner_REF.gc @@ -0,0 +1,1696 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type path-index-array +(deftype path-index-array (inline-array-class) + ((data int8 :dynamic) + ) + ) + +;; definition for method 3 of type path-index-array +(defmethod inspect ((this path-index-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> path-index-array heap-base) (the-as uint 1)) + +;; definition of type nav-mesh-jump +(deftype nav-mesh-jump (structure) + ((mesh nav-mesh) + (paths path-index-array) + (in-water? symbol) + ) + ) + +;; definition for method 3 of type nav-mesh-jump +(defmethod inspect ((this nav-mesh-jump)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nav-mesh-jump) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tpaths: ~A~%" (-> this paths)) + (format #t "~1Tin-water?: ~A~%" (-> this in-water?)) + (label cfg-4) + this + ) + +;; definition of type nav-mesh-jump-array +(deftype nav-mesh-jump-array (inline-array-class) + ((data nav-mesh-jump :inline :dynamic) + ) + ) + +;; definition for method 3 of type nav-mesh-jump-array +(defmethod inspect ((this nav-mesh-jump-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> nav-mesh-jump-array heap-base) (the-as uint 16)) + +;; definition of type saberfish-spawner-command +(deftype saberfish-spawner-command (structure) + ((command symbol) + (message symbol) + (initial-state symbol) + (parent handle) + ) + ) + +;; definition for method 3 of type saberfish-spawner-command +(defmethod inspect ((this saberfish-spawner-command)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'saberfish-spawner-command) + (format #t "~1Tcommand: ~A~%" (-> this command)) + (format #t "~1Tmessage: ~A~%" (-> this message)) + (format #t "~1Tinitial-state: ~A~%" (-> this initial-state)) + (format #t "~1Tparent: ~D~%" (-> this parent)) + (label cfg-4) + this + ) + +;; definition of type saberfish-spawn-query +(deftype saberfish-spawn-query (structure) + ((alive-count int16) + ) + ) + +;; definition for method 3 of type saberfish-spawn-query +(defmethod inspect ((this saberfish-spawn-query)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'saberfish-spawn-query) + (format #t "~1Talive-count: ~D~%" (-> this alive-count)) + (label cfg-4) + this + ) + +;; definition of type saberfish-spawner +(deftype saberfish-spawner (process-drawable) + ((jump-paths (array path-control)) + (nav-mesh-jumps nav-mesh-jump-array) + (live-count int8) + (last-spawned-process handle) + (mgr-parent handle) + (spawned-saberfish handle 128) + (num-spawned-saberfish int32) + ) + (:state-methods + saberfish-spawner-base-state + ) + (:methods + (saberfish-spawner-method-21 (_type_) none) + (saberfish-spawner-method-22 (_type_ vector saberfish-find-behavior) int) + (draw-paths (_type_) none) + (saberfish-spawner-method-24 (_type_ saberfish) int) + (spawn-saberfish (_type_ symbol symbol process) none) + (saberfish-spawner-method-26 (_type_ process int symbol event-message-block) object) + ) + ) + +;; definition for method 3 of type saberfish-spawner +(defmethod inspect ((this saberfish-spawner)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tjump-paths: ~A~%" (-> this jump-paths)) + (format #t "~2Tnav-mesh-jumps: ~A~%" (-> this nav-mesh-jumps)) + (format #t "~2Tlive-count: ~D~%" (-> this live-count)) + (format #t "~2Tlast-spawned-process: ~D~%" (-> this last-spawned-process)) + (format #t "~2Tmgr-parent: ~D~%" (-> this mgr-parent)) + (format #t "~2Tspawned-saberfish[128] @ #x~X~%" (-> this spawned-saberfish)) + (format #t "~2Tnum-spawned-saberfish: ~D~%" (-> this num-spawned-saberfish)) + (label cfg-4) + this + ) + +;; definition for method 11 of type saberfish-spawner +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this saberfish-spawner) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (process-entity-set! this arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this num-spawned-saberfish) 0) + (set! (-> this last-spawned-process) (the-as handle #f)) + (let ((s5-1 0)) + (let ((s4-0 (-> ((method-of-type res-lump lookup-tag-idx) (-> this entity) 'path 'base -1000000000.0) lo))) + (when (>= (the-as int s4-0) 0) + (let ((s3-0 (the-as int s4-0)) + (v1-6 (-> this entity tag s4-0)) + ) + 0 + (while (= (-> v1-6 name) (-> this entity tag s4-0 name)) + (make-property-data (-> this entity) 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f)) + (+! s5-1 1) + (+! s3-0 1) + (set! v1-6 (-> this entity tag s3-0)) + ) + ) + ) + ) + (let ((a3-2 (* (/ s5-1 2) 2))) + (set! (-> this jump-paths) (new 'process 'boxed-array path-control a3-2)) + ) + ) + 0.0 + (dotimes (s5-2 (-> this jump-paths length)) + (set! (-> this jump-paths s5-2) + (new 'process 'path-control this 'path (the float s5-2) (the-as entity #f) #f) + ) + (logior! (-> this jump-paths s5-2 flags) (path-control-flag display draw-line draw-point draw-text)) + ) + 0 + (set! sv-16 (new 'static 'res-tag)) + (res-lump-struct (-> this entity) 'nav-mesh-actor structure :tag-ptr (& sv-16)) + (let ((s5-3 (-> sv-16 elt-count))) + (set! (-> this nav-mesh-jumps) (new 'process 'nav-mesh-jump-array (the-as int s5-3))) + (dotimes (s4-1 (the-as int s5-3)) + (let ((v1-38 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor s4-1))) + (if v1-38 + (set! (-> this nav-mesh-jumps data s4-1 mesh) v1-38) + ) + ) + ) + ) + (saberfish-spawner-method-21 this) + (let ((f0-3 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-3) + ) + (let ((t9-13 (method-of-type res-lump get-property-struct)) + (a0-32 (-> this entity)) + (a1-16 'trans-offset) + (a2-9 'interp) + (a3-6 -1000000000.0) + (t0-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> t0-3 x) 0.0) + (set! (-> t0-3 y) 0.0) + (set! (-> t0-3 z) 0.0) + (set! (-> t0-3 w) 1.0) + (let ((v1-49 (the-as vector (t9-13 a0-32 a1-16 a2-9 a3-6 t0-3 (the-as (pointer res-tag) #f) *res-static-buf*)))) + (vector+! (-> this root trans) (-> this root trans) v1-49) + ) + ) + (go (method-of-object this saberfish-spawner-base-state)) + ) + +;; failed to figure out what this is: +(defstate saberfish-spawner-base-state (saberfish-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (saberfish-spawner-method-26 self proc argc message block) + ) + :enter (behavior () + '() + ) + :trans (behavior () + (draw-paths self) + ) + :code sleep-code + ) + +;; definition for symbol *temporary-closest-nav-mesh-indices*, type (pointer int8) +(define *temporary-closest-nav-mesh-indices* (new 'static 'array int8 64 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ) + ) + +;; definition for symbol *temporary-num-paths-per-nav-mesh-count*, type (pointer uint8) +(define *temporary-num-paths-per-nav-mesh-count* (the-as (pointer uint8) (new 'static 'array int8 64 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ) + ) + ) + +;; definition for method 21 of type saberfish-spawner +;; WARN: Return type mismatch symbol vs none. +(defmethod saberfish-spawner-method-21 ((this saberfish-spawner)) + (dotimes (v1-0 64) + (set! (-> *temporary-closest-nav-mesh-indices* v1-0) -1) + (set! (-> *temporary-num-paths-per-nav-mesh-count* v1-0) (the-as uint 0)) + ) + (dotimes (s5-0 (-> this jump-paths length)) + (let ((a0-5 (-> this jump-paths s5-0))) + -1 + (let ((s4-0 (new 'stack-no-clear 'vector))) + (get-point-at-percent-along-path! a0-5 s4-0 0.5 'interp) + (let ((v1-9 (saberfish-spawner-method-22 this s4-0 (saberfish-find-behavior none)))) + (set! (-> *temporary-closest-nav-mesh-indices* s5-0) v1-9) + (cond + ((>= v1-9 0) + (+! (-> *temporary-num-paths-per-nav-mesh-count* v1-9) 1) + ) + (else + ) + ) + ) + ) + ) + ) + (dotimes (s5-1 (-> this nav-mesh-jumps length)) + (let* ((s4-1 (-> this nav-mesh-jumps data s5-1)) + (s3-0 s5-1) + (a2-2 (-> *temporary-num-paths-per-nav-mesh-count* s3-0)) + (s2-0 0) + ) + (set! (-> s4-1 paths) (new 'process 'path-index-array (the-as int a2-2))) + (dotimes (v1-20 (-> this jump-paths length)) + (when (= (-> *temporary-closest-nav-mesh-indices* v1-20) s3-0) + (set! (-> s4-1 paths data s2-0) v1-20) + (set! (-> s4-1 in-water?) (= (logand v1-20 1) 1)) + (+! s2-0 1) + ) + ) + ) + ) + (none) + ) + +;; definition for method 22 of type saberfish-spawner +(defmethod saberfish-spawner-method-22 ((this saberfish-spawner) (arg0 vector) (arg1 saberfish-find-behavior)) + (local-vars (v1-16 float) (sv-64 nav-poly) (sv-72 int) (sv-80 number) (sv-84 vector) (sv-88 symbol)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-64 (new 'stack-no-clear 'nav-poly)) + (set! sv-72 -1) + (set! sv-80 24576.0) + (set! sv-84 arg0) + (set! sv-88 (in-water<-find-behavior arg1)) + (set! (-> sv-64 data 20) (the-as uint 7)) + (dotimes (s4-0 (-> this nav-mesh-jumps length)) + (let ((a0-4 (-> this nav-mesh-jumps data s4-0 mesh))) + (when a0-4 + (when (or (= arg1 (saberfish-find-behavior none)) (= (-> this nav-mesh-jumps data s4-0 in-water?) sv-88)) + (vector-! (the-as vector (-> sv-64 vertex)) sv-84 (the-as vector (-> a0-4 bounds))) + (.lvf vf1 (&-> (-> sv-64 vertex) 0 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-16 vf1) + (let ((f0-1 v1-16) + (f1-0 (-> a0-4 bounds r)) + ) + (when (< f0-1 (* f1-0 f1-0)) + (set! (-> sv-64 vertex1 x) 409600.0) + (nav-mesh-method-46 a0-4 sv-64) + (when (>= (the-as float sv-80) (-> sv-64 vertex1 w)) + (set! sv-80 (-> sv-64 vertex1 w)) + (set! sv-72 s4-0) + ) + ) + ) + ) + ) + ) + ) + sv-72 + ) + ) + +;; definition for method 7 of type saberfish-spawner +(defmethod relocate ((this saberfish-spawner) (offset int)) + (when (nonzero? (-> this jump-paths)) + (dotimes (v1-2 (-> this jump-paths length)) + (if (nonzero? (-> this jump-paths v1-2)) + (&+! (-> this jump-paths v1-2) offset) + ) + ) + ) + (when (nonzero? (-> this nav-mesh-jumps)) + (dotimes (v1-7 (-> this nav-mesh-jumps length)) + (if (nonzero? (-> this nav-mesh-jumps data v1-7 paths)) + (&+! (-> this nav-mesh-jumps data v1-7 paths) offset) + ) + ) + ) + (if (nonzero? (-> this jump-paths)) + (&+! (-> this jump-paths) offset) + ) + (if (nonzero? (-> this nav-mesh-jumps)) + (&+! (-> this nav-mesh-jumps) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 23 of type saberfish-spawner +;; WARN: Return type mismatch symbol vs none. +(defmethod draw-paths ((this saberfish-spawner)) + (dotimes (s5-0 (-> this jump-paths length)) + (debug-draw (-> this jump-paths s5-0)) + ) + (none) + ) + +;; definition for method 24 of type saberfish-spawner +;; INFO: Used lq/sq +(defmethod saberfish-spawner-method-24 ((this saberfish-spawner) (arg0 saberfish)) + (local-vars + (sv-48 float) + (sv-56 int) + (sv-64 number) + (sv-68 vector) + (sv-72 vector) + (sv-160 (function path-control vector vector symbol float)) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + ) + (set! (-> arg0 dest-nav-mesh-index) (-> arg0 desired-dest-mesh-index)) + (set! sv-48 (the-as float -1.0)) + (set! sv-56 -1) + (set! sv-64 40960000000.0) + (let ((v1-4 (new 'stack-no-clear 'vector))) + (set! (-> v1-4 quad) (-> arg0 root trans quad)) + (set! sv-68 v1-4) + ) + (set! sv-72 (new 'stack-no-clear 'vector)) + (cond + ((saberfish-method-243 arg0) + (vector-! sv-72 (-> arg0 desired-dest-nav-point) (-> arg0 root trans)) + (set! (-> sv-72 y) 0.0) + ) + (else + (vector-z-quaternion! sv-72 (-> arg0 root quat)) + (set! (-> sv-72 y) 0.0) + (vector-normalize! sv-72 61440.0) + ) + ) + (set! sv-56 -1) + (when (>= (-> arg0 current-nav-mesh-index) 0) + (let ((s4-0 (-> this nav-mesh-jumps data (-> arg0 current-nav-mesh-index)))) + (dotimes (s3-0 (-> s4-0 paths length)) + (let* ((s2-0 (-> s4-0 paths data s3-0)) + (s1-0 (-> this jump-paths s2-0)) + ) + 0.0 + 0.0 + (let* ((f0-6 (cond + (#f + (path-control-method-23 s1-0 sv-68) + ) + (else + (let ((s0-0 s1-0)) + (set! sv-160 (method-of-object s0-0 path-control-method-28)) + (set! sv-176 sv-68) + (set! sv-192 sv-72) + (let ((a3-0 (not (saberfish-method-243 arg0)))) + (sv-160 s0-0 sv-176 sv-192 a3-0) + ) + ) + ) + ) + ) + (f30-0 (fmax 0.0 (fmin 1.0 f0-6))) + (s0-1 vector-vector-xz-distance) + ) + (set! sv-208 sv-68) + (let* ((a1-8 (get-point-at-percent-along-path! s1-0 (new 'stack-no-clear 'vector) f30-0 'interp)) + (f0-8 (s0-1 sv-208 a1-8)) + ) + (when (< f0-8 (the-as float sv-64)) + (set! sv-64 f0-8) + (set! sv-56 s2-0) + (set! sv-48 f30-0) + ) + ) + ) + ) + ) + ) + ) + (cond + ((>= sv-56 0) + (let* ((v1-41 (if (saberfish-method-243 arg0) + -1 + 1 + ) + ) + (s3-1 (-> this jump-paths sv-56)) + (s4-1 (-> this jump-paths (+ sv-56 v1-41))) + ) + (if (or (< (+ sv-56 v1-41) 0) (>= (+ sv-56 v1-41) (-> this jump-paths length))) + (return 0) + ) + (let ((s2-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (let ((s0-2 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + (f30-1 0.4) + ) + (get-point-at-percent-along-path! s3-1 (-> arg0 jump-point-start) sv-48 'interp) + (if (saberfish-method-243 arg0) + (set! f30-1 0.24) + ) + (vector-! s5-1 (-> arg0 jump-point-start) (-> arg0 root trans)) + (get-point-at-percent-along-path! s3-1 s0-2 (+ -0.05 sv-48) 'interp) + (get-point-at-percent-along-path! s3-1 s1-1 (+ 0.05 sv-48) 'interp) + (vector-! s2-1 s1-1 s0-2) + (vector-normalize! s2-1 1.0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (when (< f30-1 (fabs (vector-dot s5-1 s2-1))) + (set! sv-48 (path-control-method-23 s3-1 sv-68)) + (get-point-at-percent-along-path! s3-1 (-> arg0 jump-point-start) sv-48 'interp) + ) + ) + (cond + ((saberfish-method-243 arg0) + (let ((f0-20 (path-control-method-28 s4-1 (-> arg0 jump-point-start) sv-72 #f))) + (get-point-at-percent-along-path! s4-1 (-> arg0 jump-point-end) f0-20 'interp) + ) + ) + (else + (let ((f0-21 (path-control-method-23 s4-1 (-> arg0 jump-point-start)))) + (get-point-at-percent-along-path! s4-1 (-> arg0 jump-point-end) f0-21 'interp) + ) + ) + ) + (vector-! s5-1 (-> arg0 jump-point-end) (-> arg0 jump-point-start)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + ) + ) + (let ((v1-74 (-> arg0 nav state)) + (a0-46 (-> arg0 jump-point-start)) + ) + (logclear! (-> v1-74 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-74 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-74 target-pos quad) (-> a0-46 quad)) + ) + 0 + ) + (else + ) + ) + 0 + ) + +;; definition for method 26 of type saberfish-spawner +(defmethod saberfish-spawner-method-26 ((this saberfish-spawner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('transition-terrain-begin) + (saberfish-spawner-method-24 this (the-as saberfish arg0)) + ) + (('saberfish-query) + (let ((gp-0 (the-as saberfish-spawner-query-msg (-> arg3 param 0)))) + (case (-> gp-0 query-type) + (((saberfish-query-type set-nav-idx)) + (set! v0-0 (saberfish-spawner-method-22 this (the-as vector (&-> gp-0 mesh)) (-> gp-0 behavior))) + (set! (-> gp-0 closest-nav-mesh-index) (the-as int v0-0)) + v0-0 + ) + (((saberfish-query-type set-mesh)) + (set! v0-0 (-> this nav-mesh-jumps data (-> gp-0 closest-nav-mesh-index) mesh)) + (set! (-> gp-0 mesh) (the-as nav-mesh v0-0)) + v0-0 + ) + (((saberfish-query-type set-in-water)) + (set! v0-0 (-> this nav-mesh-jumps data (-> gp-0 closest-nav-mesh-index) in-water?)) + (set! (-> gp-0 in-water?) (the-as symbol v0-0)) + v0-0 + ) + (((saberfish-query-type can-go-to-ground?)) + (send-event (handle->process (-> this mgr-parent)) 'query-can-go-to-ground? gp-0) + ) + ) + ) + ) + (('spawn-command) + (set! (-> this mgr-parent) (process->handle arg0)) + (let ((v1-17 (the-as saberfish-spawner-command (-> arg3 param 0)))) + (case (-> v1-17 command) + (('spawn-enemy) + (spawn-saberfish this (-> v1-17 message) (-> v1-17 initial-state) (handle->process (-> v1-17 parent))) + ) + ) + ) + ) + (('child-die) + (set! v0-0 (+ (-> this live-count) -1)) + (set! (-> this live-count) (the-as int v0-0)) + v0-0 + ) + (('saberfish-spawn-query) + (let ((v1-22 (the-as saberfish-spawn-query (-> arg3 param 0)))) + (set! v0-0 (-> this live-count)) + (set! (-> v1-22 alive-count) (the-as int v0-0)) + ) + v0-0 + ) + (('saberfish-ground-query) + (let ((v1-23 (the-as saberfish-spawn-query (-> arg3 param 0)))) + (set! (-> v1-23 alive-count) 0) + (dotimes (a1-21 (-> this num-spawned-saberfish)) + (let ((a2-14 (-> this spawned-saberfish a1-21))) + (when (handle->process a2-14) + (let ((a2-15 (the-as saberfish (handle->process a2-14)))) + (if (or (= (-> a2-15 ground-state) 4) + (and (-> a2-15 next-state) (let ((a2-19 (-> a2-15 next-state name))) + (or (= a2-19 'transition-terrain-move-towards-initial-jump) + (= a2-19 'jump) + (= a2-19 'transition-terrain-jump-from-water) + ) + ) + ) + ) + (+! (-> v1-23 alive-count) 1) + ) + ) + ) + ) + ) + ) + #f + ) + (('forward-event) + (send-event + (handle->process (-> this last-spawned-process)) + (the-as symbol (-> arg3 param 0)) + (-> arg3 param 1) + ) + ) + ) + ) + +;; definition for method 25 of type saberfish-spawner +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spawn-saberfish ((this saberfish-spawner) (arg0 symbol) (arg1 symbol) (arg2 process)) + (if (not arg2) + (set! arg2 this) + ) + (let ((s4-0 (new 'stack-no-clear 'saberfish-init-by-other-params))) + (if (= arg1 'saberfish-crawl-out-of-tube) + (sound-play "sf-spawner") + ) + (set! (-> s4-0 trans quad) (-> this entity extra trans quad)) + (quaternion-copy! (-> s4-0 quat) (-> this entity quat)) + (set! (-> s4-0 entity) (-> this entity)) + (set! (-> s4-0 directed?) #f) + (set! (-> s4-0 no-initial-move-to-ground?) #f) + (set! (-> s4-0 art-level) #f) + (set! (-> s4-0 spawn-parent) (process->handle this)) + (set! (-> s4-0 message) arg0) + (set! (-> s4-0 initial-state) arg1) + (set! (-> s4-0 pos quad) (-> this root trans quad)) + (quaternion-copy! (-> s4-0 orient) (-> this root quat)) + (set! (-> this last-spawned-process) + (ppointer->handle (process-spawn saberfish this s4-0 :name "saberfish" :to arg2)) + ) + ) + (+! (-> this live-count) 1) + (set! (-> this spawned-saberfish (-> this num-spawned-saberfish)) (-> this last-spawned-process)) + (+! (-> this num-spawned-saberfish) 1) + (when (>= (-> this num-spawned-saberfish) 128) + (set! (-> this num-spawned-saberfish) 0) + 0 + ) + 0 + (none) + ) + +;; definition of type saberfish-spawn-manager-base +(deftype saberfish-spawn-manager-base (process) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (total-num-spawned int32) + (total-alive int32) + (spawn-timer time-frame) + (state-time time-frame) + (allowed-on-land-count int8) + ) + (:state-methods + active + idle + ) + (:methods + (go-active (_type_) object) + (get-alive-count (_type_) int) + (get-alive-count-grounded (_type_ int) int) + ) + ) + +;; definition for method 3 of type saberfish-spawn-manager-base +(defmethod inspect ((this saberfish-spawn-manager-base)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Ttotal-num-spawned: ~D~%" (-> this total-num-spawned)) + (format #t "~2Ttotal-alive: ~D~%" (-> this total-alive)) + (format #t "~2Tspawn-timer: ~D~%" (-> this spawn-timer)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tallowed-on-land-count: ~D~%" (-> this allowed-on-land-count)) + (label cfg-7) + this + ) + +;; definition for method 11 of type saberfish-spawn-manager-base +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this saberfish-spawn-manager-base) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (set-setting! 'gem-pool-index #f 0.0 2) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-3 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this allowed-on-land-count) 2) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this total-num-spawned) 0) + (set! (-> this total-alive) 0) + (set! (-> this spawn-timer) 0) + (go-active this) + ) + +;; definition for method 18 of type saberfish-spawn-manager-base +(defmethod get-alive-count-grounded ((this saberfish-spawn-manager-base) (arg0 int)) + (with-pp + (let ((s4-0 (new 'stack-no-clear 'saberfish-spawn-query)) + (gp-0 0) + ) + (dotimes (s3-0 (-> this actor-group-count)) + (dotimes (s2-0 (-> this actor-group s3-0 length)) + (set! (-> s4-0 alive-count) 0) + (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) 'saberfish-ground-query) + (set! (-> a1-1 param 0) (the-as uint s4-0)) + (let ((t9-0 send-event-function) + (v1-7 (-> this actor-group s3-0 data s2-0 actor)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-1 + ) + ) + ) + (+! gp-0 (-> s4-0 alive-count)) + ) + ) + gp-0 + ) + ) + ) + +;; definition for method 17 of type saberfish-spawn-manager-base +(defmethod get-alive-count ((this saberfish-spawn-manager-base)) + (with-pp + (let ((s4-0 (new 'stack-no-clear 'saberfish-spawn-query)) + (gp-0 0) + ) + (dotimes (s3-0 (-> this actor-group-count)) + (dotimes (s2-0 (-> this actor-group s3-0 length)) + (set! (-> s4-0 alive-count) 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) 'saberfish-spawn-query) + (set! (-> a1-0 param 0) (the-as uint s4-0)) + (let ((t9-0 send-event-function) + (v1-7 (-> this actor-group s3-0 data s2-0 actor)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-0 + ) + ) + ) + (+! gp-0 (-> s4-0 alive-count)) + ) + ) + gp-0 + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (saberfish-spawn-manager-base) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate idle (saberfish-spawn-manager-base) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual active) + ) + ) + ) + :code sleep-code + ) + +;; definition for function saberfish-mgr-event-handler +(defbehavior saberfish-mgr-event-handler saberfish-spawn-manager-base ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (if (and (-> self next-state) (= (-> self next-state name) 'idle)) + (go-virtual active) + ) + ) + (('query-can-go-to-ground?) + (let ((gp-0 (the-as saberfish-spawner-query-msg (-> arg3 param 0))) + (v0-0 (the-as object (< (get-alive-count-grounded self arg1) (-> self allowed-on-land-count)))) + ) + (set! (-> gp-0 in-water?) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + +;; definition for method 16 of type saberfish-spawn-manager-base +(defmethod go-active ((this saberfish-spawn-manager-base)) + (go (method-of-object this active)) + ) + +;; definition of type saberfish-mgr-room1 +(deftype saberfish-mgr-room1 (saberfish-spawn-manager-base) + () + ) + +;; definition for method 3 of type saberfish-mgr-room1 +(defmethod inspect ((this saberfish-mgr-room1)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type saberfish-spawn-manager-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (saberfish-mgr-room1) + :virtual #t + :event saberfish-mgr-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-command)) + (s4-0 (-> self actor-group 0 data)) + (s5-0 (-> self actor-group 0 data 1)) + ) + (set! (-> gp-0 parent) (process->handle self)) + (set! (-> gp-0 command) 'spawn-enemy) + (set! (-> gp-0 initial-state) 'saberfish-crawl-out-of-tube) + (set! (-> self allowed-on-land-count) 2) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.1)) + (suspend) + ) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-command) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-20 (-> s4-0 0 actor)) + ) + (t9-0 + (if v1-20 + (-> v1-20 extra process) + ) + a1-0 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (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) 'spawn-command) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-1 send-event-function) + (v1-33 (-> s5-0 actor)) + ) + (t9-1 + (if v1-33 + (-> v1-33 extra process) + ) + a1-1 + ) + ) + ) + (until (>= 1 (get-alive-count self)) + (suspend) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'spawn-command) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-3 send-event-function) + (v1-43 (-> s4-0 0 actor)) + ) + (t9-3 + (if v1-43 + (-> v1-43 extra process) + ) + a1-2 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1.5)) + (suspend) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'spawn-command) + (set! (-> a1-3 param 0) (the-as uint gp-0)) + (let ((t9-4 send-event-function) + (v1-56 (-> s5-0 actor)) + ) + (t9-4 + (if v1-56 + (-> v1-56 extra process) + ) + a1-3 + ) + ) + ) + (until (>= 2 (get-alive-count self)) + (suspend) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'spawn-command) + (set! (-> a1-4 param 0) (the-as uint gp-0)) + (let ((t9-6 send-event-function) + (v1-66 (-> s4-0 0 actor)) + ) + (t9-6 + (if v1-66 + (-> v1-66 extra process) + ) + a1-4 + ) + ) + ) + (set! (-> self allowed-on-land-count) 3) + (until (>= 1 (get-alive-count self)) + (suspend) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'spawn-command) + (set! (-> a1-5 param 0) (the-as uint gp-0)) + (let ((t9-8 send-event-function) + (v1-77 (-> s5-0 actor)) + ) + (t9-8 + (if v1-77 + (-> v1-77 extra process) + ) + a1-5 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.3)) + (suspend) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'spawn-command) + (set! (-> a1-6 param 0) (the-as uint gp-0)) + (let ((t9-9 send-event-function) + (v1-90 (-> s4-0 0 actor)) + ) + (t9-9 + (if v1-90 + (-> v1-90 extra process) + ) + a1-6 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'spawn-command) + (set! (-> a1-7 param 0) (the-as uint gp-0)) + (let ((t9-10 send-event-function) + (v1-102 (-> s4-0 0 actor)) + ) + (t9-10 + (if v1-102 + (-> v1-102 extra process) + ) + a1-7 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 2.5)) + (suspend) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'spawn-command) + (set! (-> a1-8 param 0) (the-as uint gp-0)) + (let ((t9-11 send-event-function) + (v1-115 (-> s5-0 actor)) + ) + (t9-11 + (if v1-115 + (-> v1-115 extra process) + ) + a1-8 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'spawn-command) + (set! (-> a1-9 param 0) (the-as uint gp-0)) + (let ((t9-13 send-event-function) + (v1-130 (-> s5-0 actor)) + ) + (t9-13 + (if v1-130 + (-> v1-130 extra process) + ) + a1-9 + ) + ) + ) + ) + (until #f + (suspend) + ) + #f + ) + ) + +;; definition for method 16 of type saberfish-mgr-room1 +(defmethod go-active ((this saberfish-mgr-room1)) + (go (method-of-object this idle)) + ) + +;; definition of type saberfish-mgr-room2 +(deftype saberfish-mgr-room2 (saberfish-spawn-manager-base) + () + (:state-methods + stage-0 + stage-1 + stage-2 + ) + ) + +;; definition for method 3 of type saberfish-mgr-room2 +(defmethod inspect ((this saberfish-mgr-room2)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type saberfish-spawn-manager-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 16 of type saberfish-mgr-room2 +(defmethod go-active ((this saberfish-mgr-room2)) + (cond + ((task-node-closed? (game-task-node sewer-kg-met-button0-pressed)) + (process-entity-status! this (entity-perm-status dead) #t) + (go empty-state) + ) + (else + (go (method-of-object this stage-0)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate stage-0 (saberfish-mgr-room2) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger-start) + (go-virtual stage-1) + ) + (else + (saberfish-mgr-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-command))) + (set! (-> gp-0 parent) (process->handle self)) + (set! (-> gp-0 command) 'spawn-enemy) + (set! (-> gp-0 initial-state) 'saberfish-sitting-on-land) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.1)) + (suspend) + ) + (set! (-> self allowed-on-land-count) 3) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-command) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-18 (-> self actor-group 1 data 0 actor)) + ) + (t9-0 + (if v1-18 + (-> v1-18 extra process) + ) + a1-0 + ) + ) + ) + (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) 'spawn-command) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-1 send-event-function) + (v1-27 (-> self actor-group 1 data 1 actor)) + ) + (t9-1 + (if v1-27 + (-> v1-27 extra process) + ) + a1-1 + ) + ) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'spawn-command) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-2 send-event-function) + (v1-36 (-> self actor-group 1 data 2 actor)) + ) + (t9-2 + (if v1-36 + (-> v1-36 extra process) + ) + a1-2 + ) + ) + ) + ) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate stage-1 (saberfish-mgr-room2) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual stage-2) + ) + (else + (saberfish-mgr-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (let ((v1-0 (new 'stack-no-clear 'saberfish-spawner-command))) + (set! (-> v1-0 parent) (process->handle self)) + ) + (set! (-> self allowed-on-land-count) 4) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'forward-event) + (set! (-> a1-4 param 0) (the-as uint 'saberfish-command)) + (set! (-> a1-4 param 1) (the-as uint 'go-alive)) + (let ((t9-0 send-event-function) + (v1-16 (-> self actor-group 1 data 0 actor)) + ) + (t9-0 + (if v1-16 + (-> v1-16 extra process) + ) + a1-4 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 2) + (set! (-> a1-5 message) 'forward-event) + (set! (-> a1-5 param 0) (the-as uint 'saberfish-command)) + (set! (-> a1-5 param 1) (the-as uint 'go-alive)) + (let ((t9-1 send-event-function) + (v1-33 (-> self actor-group 1 data 1 actor)) + ) + (t9-1 + (if v1-33 + (-> v1-33 extra process) + ) + a1-5 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.7)) + (suspend) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'forward-event) + (set! (-> a1-6 param 0) (the-as uint 'saberfish-command)) + (set! (-> a1-6 param 1) (the-as uint 'go-alive)) + (let ((t9-2 send-event-function) + (v1-50 (-> self actor-group 1 data 2 actor)) + ) + (t9-2 + (if v1-50 + (-> v1-50 extra process) + ) + a1-6 + ) + ) + ) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate stage-2 (saberfish-mgr-room2) + :virtual #t + :event saberfish-mgr-event-handler + :enter (behavior () + '() + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-command))) + (set! (-> gp-0 parent) (process->handle self)) + (set! (-> gp-0 command) 'spawn-enemy) + (set! (-> gp-0 initial-state) 'saberfish-swimming) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'spawn-command) + (set! (-> a1-0 param 0) (the-as uint gp-0)) + (let ((t9-0 send-event-function) + (v1-11 (-> self actor-group 2 data 0 actor)) + ) + (t9-0 + (if v1-11 + (-> v1-11 extra process) + ) + a1-0 + ) + ) + ) + (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) 'spawn-command) + (set! (-> a1-1 param 0) (the-as uint gp-0)) + (let ((t9-1 send-event-function) + (v1-20 (-> self actor-group 2 data 1 actor)) + ) + (t9-1 + (if v1-20 + (-> v1-20 extra process) + ) + a1-1 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (set! (-> gp-0 initial-state) 'saberfish-crawl-out-of-tube) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'spawn-command) + (set! (-> a1-2 param 0) (the-as uint gp-0)) + (let ((t9-3 send-event-function) + (v1-39 (-> self actor-group 0 data 1 actor)) + ) + (t9-3 + (if v1-39 + (-> v1-39 extra process) + ) + a1-2 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'spawn-command) + (set! (-> a1-3 param 0) (the-as uint gp-0)) + (let ((t9-4 send-event-function) + (v1-54 (-> self actor-group 0 data 0 actor)) + ) + (t9-4 + (if v1-54 + (-> v1-54 extra process) + ) + a1-3 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) (process->ppointer self)) + (set! (-> a1-4 num-params) 1) + (set! (-> a1-4 message) 'spawn-command) + (set! (-> a1-4 param 0) (the-as uint gp-0)) + (let ((t9-6 send-event-function) + (v1-72 (-> self actor-group 0 data 0 actor)) + ) + (t9-6 + (if v1-72 + (-> v1-72 extra process) + ) + a1-4 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) (process->ppointer self)) + (set! (-> a1-5 num-params) 1) + (set! (-> a1-5 message) 'spawn-command) + (set! (-> a1-5 param 0) (the-as uint gp-0)) + (let ((t9-7 send-event-function) + (v1-87 (-> self actor-group 0 data 1 actor)) + ) + (t9-7 + (if v1-87 + (-> v1-87 extra process) + ) + a1-5 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (until (>= 4 (get-alive-count self)) + (suspend) + ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) (process->ppointer self)) + (set! (-> a1-6 num-params) 1) + (set! (-> a1-6 message) 'spawn-command) + (set! (-> a1-6 param 0) (the-as uint gp-0)) + (let ((t9-9 send-event-function) + (v1-105 (-> self actor-group 0 data 0 actor)) + ) + (t9-9 + (if v1-105 + (-> v1-105 extra process) + ) + a1-6 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (until (>= 2 (get-alive-count self)) + (suspend) + ) + (let ((a1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 1) + (set! (-> a1-7 message) 'spawn-command) + (set! (-> a1-7 param 0) (the-as uint gp-0)) + (let ((t9-11 send-event-function) + (v1-123 (-> self actor-group 0 data 0 actor)) + ) + (t9-11 + (if v1-123 + (-> v1-123 extra process) + ) + a1-7 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 0.5)) + (suspend) + ) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) (process->ppointer self)) + (set! (-> a1-8 num-params) 1) + (set! (-> a1-8 message) 'spawn-command) + (set! (-> a1-8 param 0) (the-as uint gp-0)) + (let ((t9-12 send-event-function) + (v1-138 (-> self actor-group 0 data 0 actor)) + ) + (t9-12 + (if v1-138 + (-> v1-138 extra process) + ) + a1-8 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1.5)) + (suspend) + ) + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer self)) + (set! (-> a1-9 num-params) 1) + (set! (-> a1-9 message) 'spawn-command) + (set! (-> a1-9 param 0) (the-as uint gp-0)) + (let ((t9-13 send-event-function) + (v1-153 (-> self actor-group 0 data 1 actor)) + ) + (t9-13 + (if v1-153 + (-> v1-153 extra process) + ) + a1-9 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (let ((a1-10 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-10 from) (process->ppointer self)) + (set! (-> a1-10 num-params) 1) + (set! (-> a1-10 message) 'spawn-command) + (set! (-> a1-10 param 0) (the-as uint gp-0)) + (let ((t9-14 send-event-function) + (v1-168 (-> self actor-group 0 data 0 actor)) + ) + (t9-14 + (if v1-168 + (-> v1-168 extra process) + ) + a1-10 + ) + ) + ) + (until (>= 3 (get-alive-count self)) + (suspend) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) (process->ppointer self)) + (set! (-> a1-11 num-params) 1) + (set! (-> a1-11 message) 'spawn-command) + (set! (-> a1-11 param 0) (the-as uint gp-0)) + (let ((t9-16 send-event-function) + (v1-180 (-> self actor-group 0 data 1 actor)) + ) + (t9-16 + (if v1-180 + (-> v1-180 extra process) + ) + a1-11 + ) + ) + ) + (set-time! (-> self spawn-timer)) + (until (time-elapsed? (-> self spawn-timer) (seconds 1)) + (suspend) + ) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer self)) + (set! (-> a1-12 num-params) 1) + (set! (-> a1-12 message) 'spawn-command) + (set! (-> a1-12 param 0) (the-as uint gp-0)) + (let ((t9-17 send-event-function) + (v1-195 (-> self actor-group 0 data 1 actor)) + ) + (t9-17 + (if v1-195 + (-> v1-195 extra process) + ) + a1-12 + ) + ) + ) + ) + (sleep-code) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc new file mode 100644 index 0000000000..05823a74a4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc @@ -0,0 +1,3905 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-saberfish saberfish saberfish-lod0-jg saberfish-idle-ja + ((saberfish-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + :shadow saberfish-shadow-mg + ) + +;; definition of type saberfish-jump-info +(deftype saberfish-jump-info (structure) + ((windup-anim uint32) + (air-anim uint32) + (land-anim uint32) + ) + :pack-me + ) + +;; definition for method 3 of type saberfish-jump-info +(defmethod inspect ((this saberfish-jump-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'saberfish-jump-info) + (format #t "~1Twindup-anim: ~D~%" (-> this windup-anim)) + (format #t "~1Tair-anim: ~D~%" (-> this air-anim)) + (format #t "~1Tland-anim: ~D~%" (-> this land-anim)) + (label cfg-4) + this + ) + +;; definition of type saberfish-init-by-other-params +(deftype saberfish-init-by-other-params (enemy-init-by-other-params) + ((spawn-parent handle) + (message symbol) + (pos vector :inline) + (orient quaternion :inline) + (initial-state symbol) + ) + ) + +;; definition for method 3 of type saberfish-init-by-other-params +(defmethod inspect ((this saberfish-init-by-other-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'saberfish-init-by-other-params) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tdirected?: ~A~%" (-> this directed?)) + (format #t "~1Tno-initial-move-to-ground?: ~A~%" (-> this no-initial-move-to-ground?)) + (format #t "~1Tart-level: ~A~%" (-> this art-level)) + (format #t "~1Tspawn-parent: ~D~%" (-> this spawn-parent)) + (format #t "~1Tmessage: ~A~%" (-> this message)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Torient: #~%" (-> this orient)) + (format #t "~1Tinitial-state: ~A~%" (-> this initial-state)) + (label cfg-4) + this + ) + +;; definition of type saberfish-spawner-query-msg +(deftype saberfish-spawner-query-msg (structure) + ((query-type saberfish-query-type) + (closest-nav-mesh-index int8) + (pos vector :inline) + (behavior saberfish-find-behavior) + (nav-mesh-index int8 :overlay-at closest-nav-mesh-index) + (mesh nav-mesh :overlay-at (-> pos data 0)) + (in-water? symbol :offset 40) + (can-go-to-ground? symbol :overlay-at in-water?) + ) + ) + +;; definition for method 3 of type saberfish-spawner-query-msg +(defmethod inspect ((this saberfish-spawner-query-msg)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'saberfish-spawner-query-msg) + (format #t "~1Tquery-type: ~D~%" (-> this query-type)) + (format #t "~1Tclosest-nav-mesh-index: ~D~%" (-> this closest-nav-mesh-index)) + (format #t "~1Tpos: #~%" (&-> this mesh)) + (format #t "~1Tbehavior: ~D~%" (-> this behavior)) + (format #t "~1Tnav-mesh-index: ~D~%" (-> this closest-nav-mesh-index)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tin-water?: ~A~%" (-> this in-water?)) + (format #t "~1Tcan-go-to-ground?: ~A~%" (-> this in-water?)) + (label cfg-4) + this + ) + +;; definition for function find-behavior<-in-water? +;; WARN: Return type mismatch int vs saberfish-find-behavior. +(defun find-behavior<-in-water? ((arg0 symbol)) + (the-as saberfish-find-behavior (if arg0 + (the-as saberfish-find-behavior (saberfish-find-behavior behavior1)) + (the-as saberfish-find-behavior (saberfish-find-behavior behavior2)) + ) + ) + ) + +;; definition for function in-water<-find-behavior +(defun in-water<-find-behavior ((arg0 saberfish-find-behavior)) + (case arg0 + (((saberfish-find-behavior behavior1)) + #t + ) + (((saberfish-find-behavior behavior2)) + #f + ) + (else + #f + ) + ) + ) + +;; definition of type saberfish +(deftype saberfish (nav-enemy) + ((initial-y-angle float) + (last-attack-time time-frame) + (in-pursuit? symbol) + (flee-to-readjust? symbol) + (use-stored-flee-point? symbol) + (scare-start-time time-frame) + (scare-time time-frame) + (jump-point-start vector :inline) + (jump-point-end vector :inline) + (jump saberfish-jump-info :inline :offset 708) + (flee-point-temp vector :inline) + (last-land-check-time time-frame) + (last-target-check-time time-frame) + (is-submerged? symbol) + (current-nav-mesh-index int8) + (dest-nav-mesh-index int8) + (desired-dest-nav-point vector :inline) + (desired-dest-mesh-index int8) + (flee-point vector :inline) + (spawn-parent handle) + (pos-start vector :inline) + (quat-start quaternion :inline) + (move-to-ground? symbol) + (swim-final-rotate-deg float) + (swim-travel-anim int8) + (swim-speed float) + (swim-rotate-last-dot float) + (swim-anim-last-dot float) + (last-swim-flip-time time-frame) + (saberfish-y-rotate float) + (doing-180-spin? symbol) + (adjusted-y-yet? symbol) + (attack-dir vector :inline) + (rotate-anim-quat quaternion :inline) + (post-spinflip-expected-heading vector :inline) + (nav-velocity vector :inline) + (nav-dir vector :inline) + (initial-state symbol) + (knocked-under-water? symbol) + (ground-state uint8) + (jump-start-ground-state uint8) + (ground-only? symbol) + ) + (:state-methods + attack + hostile-orient + swimming-hostile + spin-attack + stare-idle + undefined0 + transition-terrain-move-towards-initial-jump + transition-terrain-orient-towards-initial-jump + transition-terrain-jump + undefined1 + water-land + undefined2 + undefined3 + base-saberfish-state + diving-into-water + water-impact + command-mode + swim-180-spin + swimming-base + saberfish-crawl-out-of-tube + undefined4 + saberfish-sitting-on-land + knocked-recover-water + saberfish-swimming + ) + (:methods + (saberfish-method-214 (_type_ vector) float) + (saberfish-method-215 (_type_) float) + (get-cmd (_type_) saberfish-command) + (saberfish-method-217 (_type_) none) + (saberfish-method-218 (_type_) none) + (saberfish-method-219 (_type_) none) + (saberfish-method-220 (_type_) none) + (handle-cmd (_type_ saberfish-command) object) + (attack-delay-elapsed? (_type_) symbol) + (saberfish-method-223 (_type_) none) + (go-terrain-transition (_type_ symbol) object) + (get-nav-mesh-idx (_type_ vector saberfish-find-behavior) int) + (start-terrain-transition (_type_) object) + (desired-nav-idx-valid? (_type_) symbol) + (saberfish-method-228 (_type_) symbol) + (set-dest-nav! (_type_ vector saberfish-find-behavior) none) + (change-nav-mesh (_type_) none) + (saberfish-method-231 (_type_ vector float symbol vector) symbol) + (do-jump (_type_) object) + (saberfish-method-233 (_type_) nav-poly) + (saberfish-method-234 (_type_ vector) none) + (on-submerged (_type_ symbol) none) + (saberfish-method-236 (_type_ int) nav-mesh) + (saberfish-method-237 (_type_ int) symbol) + (saberfish-method-238 (_type_ symbol float float) object) + (saberfish-method-239 (_type_ vector) float) + (saberfish-method-240 (_type_ time-frame) none) + (saberfish-method-241 (_type_) symbol) + (get-ground-state (_type_) int) + (saberfish-method-243 (_type_) symbol) + (set-should-move-to-ground (_type_) none) + ) + (:states + transition-terrain-jump-from-land + transition-terrain-jump-from-water + ) + ) + +;; definition for method 3 of type saberfish +(defmethod inspect ((this saberfish)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tinitial-y-angle: ~f~%" (-> this initial-y-angle)) + (format #t "~2Tlast-attack-time: ~D~%" (-> this last-attack-time)) + (format #t "~2Tin-pursuit?: ~A~%" (-> this in-pursuit?)) + (format #t "~2Tflee-to-readjust?: ~A~%" (-> this flee-to-readjust?)) + (format #t "~2Tuse-stored-flee-point?: ~A~%" (-> this use-stored-flee-point?)) + (format #t "~2Tscare-start-time: ~D~%" (-> this scare-start-time)) + (format #t "~2Tscare-time: ~D~%" (-> this scare-time)) + (format #t "~2Tjump-point-start: #~%" (-> this jump-point-start)) + (format #t "~2Tjump-point-end: #~%" (-> this jump-point-end)) + (format #t "~2Talign: ~A~%" (-> this align)) + (format #t "~2Tjump: #~%" (-> this jump)) + (format #t "~2Tflee-point-temp: #~%" (-> this flee-point-temp)) + (format #t "~2Tlast-land-check-time: ~D~%" (-> this last-land-check-time)) + (format #t "~2Tlast-target-check-time: ~D~%" (-> this last-target-check-time)) + (format #t "~2Tis-submerged?: ~A~%" (-> this is-submerged?)) + (format #t "~2Tcurrent-nav-mesh-index: ~D~%" (-> this current-nav-mesh-index)) + (format #t "~2Tdest-nav-mesh-index: ~D~%" (-> this dest-nav-mesh-index)) + (format #t "~2Tdesired-dest-nav-point: #~%" (-> this desired-dest-nav-point)) + (format #t "~2Tdesired-dest-mesh-index: ~D~%" (-> this desired-dest-mesh-index)) + (format #t "~2Tflee-point: #~%" (-> this flee-point)) + (format #t "~2Tspawn-parent: ~D~%" (-> this spawn-parent)) + (format #t "~2Tpos-start: #~%" (-> this pos-start)) + (format #t "~2Tquat-start: #~%" (-> this quat-start)) + (format #t "~2Tmove-to-ground?: ~A~%" (-> this move-to-ground?)) + (format #t "~2Tswim-final-rotate-deg: ~f~%" (-> this swim-final-rotate-deg)) + (format #t "~2Tswim-travel-anim: ~D~%" (-> this swim-travel-anim)) + (format #t "~2Tswim-speed: ~f~%" (-> this swim-speed)) + (format #t "~2Tswim-rotate-last-dot: ~f~%" (-> this swim-rotate-last-dot)) + (format #t "~2Tswim-anim-last-dot: ~f~%" (-> this swim-anim-last-dot)) + (format #t "~2Tlast-swim-flip-time: ~D~%" (-> this last-swim-flip-time)) + (format #t "~2Tsaberfish-y-rotate: ~f~%" (-> this saberfish-y-rotate)) + (format #t "~2Tdoing-180-spin?: ~A~%" (-> this doing-180-spin?)) + (format #t "~2Tadjusted-y-yet?: ~A~%" (-> this adjusted-y-yet?)) + (format #t "~2Tattack-dir: #~%" (-> this attack-dir)) + (format #t "~2Trotate-anim-quat: #~%" (-> this rotate-anim-quat)) + (format #t "~2Tpost-spinflip-expected-heading: #~%" (-> this post-spinflip-expected-heading)) + (format #t "~2Tnav-velocity: #~%" (-> this nav-velocity)) + (format #t "~2Tnav-dir: #~%" (-> this nav-dir)) + (format #t "~2Tinitial-state: ~A~%" (-> this initial-state)) + (format #t "~2Tknocked-under-water?: ~A~%" (-> this knocked-under-water?)) + (format #t "~2Tground-state: ~D~%" (-> this ground-state)) + (format #t "~2Tjump-start-ground-state: ~D~%" (-> this jump-start-ground-state)) + (format #t "~2Tground-only?: ~A~%" (-> this ground-only?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate base-saberfish-state (saberfish) + :virtual #t + :event enemy-event-handler + :code sleep-code + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; definition for symbol *saberfish-nav-enemy-info*, type nav-enemy-info +(define *saberfish-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 4 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 5 + :hit-anim 3 + :knocked-anim 11 + :knocked-land-anim 12 + :die-anim 11 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 13 + :look-at-joint 14 + :bullseye-joint 20 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd water) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.96 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list water pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 61440.0 + :knocked-medium-vxz-hi 61440.0 + :knocked-medium-vy-lo 49152.0 + :knocked-medium-vy-hi 69632.0 + :knocked-hard-vxz-lo 61440.0 + :knocked-hard-vxz-hi 90112.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 73728.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 61440.0 + :knocked-yellow-vxz-hi 61440.0 + :knocked-yellow-vy-lo 49152.0 + :knocked-yellow-vy-hi 69632.0 + :knocked-red-vxz-lo 61440.0 + :knocked-red-vxz-hi 90112.0 + :knocked-red-vy-lo 49152.0 + :knocked-red-vy-hi 73728.0 + :knocked-blue-vxz-lo 20480.0 + :knocked-blue-vxz-hi 28672.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.9983 :y -0.0558 :z 0.0132 :w 27913.42) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9155 :y 0.3114 :z -0.2546 :w 18151.014) + :geo-tform (new 'static 'vector :x -1.0 :w 10.176285) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 27209.91) + :geo-tform (new 'static 'vector :x -0.9985 :y 0.0536 :z -0.0019 :w 20896.482) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0165 :z -0.9998 :w 19429.002) + :geo-tform (new 'static 'vector :x 0.2521 :y 0.9606 :z -0.1166 :w 20369.662) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2289 :z -0.9734 :w 4466.9336) + :geo-tform (new 'static 'vector :x 0.2309 :y 0.4174 :z 0.8788 :w 26025.31) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9134 :z 0.407 :w 21663.545) + :geo-tform (new 'static 'vector :x -0.4328 :y 0.8967 :z 0.0917 :w 27352.541) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.21 :z 0.9776 :w 14450.142) + :geo-tform (new 'static 'vector :x 0.6331 :y -0.6641 :z 0.3975 :w 19916.846) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.262 :z 0.965 :w 13256.131) + :geo-tform (new 'static 'vector :x -0.0466 :y 0.5681 :z 0.8215 :w 40370.1) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8605 :z -0.5094 :w 18296.832) + :geo-tform (new 'static 'vector :x 0.3835 :y -0.2752 :z 0.8815 :w 26565.291) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.8653 :z -0.5012 :w 1296.8118) + :geo-tform (new 'static 'vector :x -0.9994 :y 0.0297 :z 0.015 :w 17863.275) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3818 :z -0.9242 :w 259.39514) + :geo-tform (new 'static 'vector :x -0.9903 :y -0.0926 :z 0.1029 :w 15323.264) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.5325 :z 0.8464 :w 2252.818) + :geo-tform (new 'static 'vector :x -0.9999 :y 0.0039 :z 0.0062 :w 16416.531) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1966.4896 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.794 :z 0.6078 :w 42.30713) + :geo-tform (new 'static 'vector :x -0.9999 :y 0.005 :z 0.005 :w 16384.236) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1553.6128 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 862.1079) + :geo-tform (new 'static 'vector :x -0.9972 :y -0.006 :z -0.0739 :w 5204.942) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2452.6848 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9971 :z -0.0754 :w 5204.851) + :geo-tform (new 'static 'vector :x -0.4775 :y -0.1888 :z -0.858 :w 1142.2561) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7479 :z -0.6637 :w 1560.7944) + :geo-tform (new 'static 'vector :x -0.7484 :y -0.1026 :z -0.6552 :w 1775.261) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7465 :z -0.6652 :w 1765.8129) + :geo-tform (new 'static 'vector :x -0.9932 :y -0.107 :z -0.0452 :w 16973.86) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.119 :z -0.9928 :w 16093.275) + :geo-tform (new 'static 'vector :x 0.5242 :y 0.8508 :z 0.035 :w 33237.656) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.3382 :z -0.941 :w 11515.366) + :geo-tform (new 'static 'vector :x -0.2239 :y -0.4468 :z 0.8661 :w 25938.275) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9222 :z 0.3865 :w 21078.58) + :geo-tform (new 'static 'vector :x 0.4237 :y 0.5776 :z 0.6976 :w 37524.24) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5995 :z -0.8003 :w 19175.633) + :geo-tform (new 'static 'vector :x 0.0961 :y 0.9634 :z 0.2499 :w 40414.94) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2235.5967 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 20 + :pre-tform (new 'static 'vector :x -0.9723 :z 0.2333 :w 1824.8136) + :geo-tform (new 'static 'vector :x -0.9803 :y -0.1799 :z -0.0811 :w 15291.715) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8223 :z 0.5689 :w 2307.7227) + :geo-tform (new 'static 'vector :x 0.2202 :y -0.8918 :z 0.3952 :w 3410.111) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.3544 :z 0.935 :w 1537.347) + :geo-tform (new 'static 'vector :x -0.0081 :y -0.9942 :z 0.1065 :w 2835.7427) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1642.0864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.2096 :z 0.9777 :w 302.33942) + :geo-tform (new 'static 'vector :x -0.6496 :y -0.7587 :z 0.0484 :w 5384.1646) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 1437.2864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint 20 + :pre-tform (new 'static 'vector :x -0.1904 :z 0.9817 :w 17496.0) + :geo-tform (new 'static 'vector :x -0.6922 :y 0.5601 :z -0.455 :w 15608.09) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9013 :z -0.4331 :w 10963.08) + :geo-tform (new 'static 'vector :x 0.7074 :y -0.0914 :z -0.7007 :w 22558.492) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8192 :z -0.5734 :w 22395.672) + :geo-tform (new 'static 'vector :x 0.9857 :y -0.1663 :z -0.0232 :w 40309.043) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9055 :z -0.4242 :w 41043.812) + :geo-tform (new 'static 'vector :x -0.4884 :y 0.8434 :z 0.2236 :w 10095.093) + :axial-slop 1973.8533 + :max-angle 3703.2754 + :coll-rad 2348.2368 + ) + ) + ) + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint 14 + :gem-seg #x2 + :gem-offset (new 'static 'sphere :y 1511.424 :z 700.416 :r 327680.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 6 + :turn-anim -1 + :run-anim 5 + :taunt-anim -1 + :run-travel-speed (meters 6) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 60) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 1) + :maximum-rotation-rate (degrees 180) + :notice-nav-radius (meters 2) + :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! (-> *saberfish-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 120 of type saberfish +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this saberfish)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) + (set! (-> s5-0 total-prims) (the-as uint 5)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot player-list water)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 24576.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 enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd water)) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-13 transform-index) 3) + (set-vector! (-> v1-13 local-sphere) 0.0 -4096.0 0.0 6144.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 enemy)) + (set! (-> v1-15 prim-core collide-with) (collide-spec backgnd water)) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 4096.0 0.0 6144.0) + ) + (set-vector! + (-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere) + 0.0 + 4505.6 + 0.0 + 4505.6 + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-19 prim-core action) (collide-action semi-solid deadly no-standon)) + (set! (-> v1-19 transform-index) 14) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 6144.0 4505.6) + ) + (set! (-> s5-0 nav-radius) 10240.0) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + 0 + (none) + ) + +;; definition for function get-spawn-parent +(defbehavior get-spawn-parent saberfish () + (handle->process (-> self spawn-parent)) + ) + +;; definition for method 121 of type saberfish +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this saberfish)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-saberfish" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *saberfish-nav-enemy-info*) + (set! (-> this last-attack-time) 0) + (set! (-> this scare-start-time) 0) + (set! (-> this scare-time) 0) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flag part-splash part-water find-water)) + (water-control-method-10 (-> this water)) + (set! (-> this last-swim-flip-time) 0) + (set! (-> this doing-180-spin?) #f) + (set! (-> this fact pickup-type) (pickup-type eco-pill-dark)) + (if (zero? (mod (the-as int (rand-uint31-gen *random-generator*)) 11)) + (set! (-> this fact pickup-type) (pickup-type eco-pill-light)) + ) + (set! (-> this fact pickup-amount) 1.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (when (nonzero? (-> this neck)) + (let ((v1-20 (-> this neck))) + (set! (-> v1-20 ear) (the-as uint 0)) + (set! (-> v1-20 up) (the-as uint 1)) + (set! (-> v1-20 nose) (the-as uint 2)) + (set-vector! (-> v1-20 twist-max) 8192.0 11832.889 0.0 1.0) + (set! (-> v1-20 ignore-angle) 30947.555) + ) + ) + (set! (-> this current-nav-mesh-index) -1) + (cond + ((not (-> this ground-only?)) + (change-nav-mesh this) + ) + (else + (set! (-> this current-nav-mesh-index) 0) + (change-to (-> *saberfish-nav-enemy-info* nav-mesh) this) + ) + ) + (set! (-> *saberfish-nav-enemy-info* nav-mesh) #f) + (set-should-move-to-ground this) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this in-pursuit?) #t) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (set! (-> this scare-time) 0) + (set! (-> this desired-dest-mesh-index) (-> this current-nav-mesh-index)) + (set! (-> this is-submerged?) #f) + (set! (-> this root trans quad) (-> this pos-start quad)) + (quaternion-copy! (-> this root quat) (-> this quat-start)) + (set! (-> this move-to-ground?) #f) + (let ((s5-1 (-> this skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> this draw art-group data 3)) + num-func-identity + ) + (set! (-> s5-1 frame-num) 0.0) + ) + (ja-post) + (logior! (-> this fact options) (actor-option suck-in)) + 0 + (none) + ) + +;; definition for method 220 of type saberfish +;; INFO: Used lq/sq +(defmethod saberfish-method-220 ((this saberfish)) + (when (< 2 (the-as int (-> this focus aware))) + (let ((s4-0 (handle->process (-> this focus handle)))) + (when s4-0 + (let ((s5-0 (or (focus-test? (the-as process-focusable s4-0) touch-water on-water under-water) + (and (-> (the-as process-focusable s4-0) water) + (logtest? (water-flag touch-water) (-> (the-as process-focusable s4-0) water flags)) + ) + ) + ) + ) + (when (not s5-0) + (case (find-ground-for-obj (the-as process-focusable s4-0)) + ((3 1) + (set! s5-0 #t) + ) + ) + ) + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s4-0) 0) quad)) + (set-dest-nav! this (-> this focus-pos) (find-behavior<-in-water? (the-as symbol s5-0))) + ) + ) + ) + ) + (none) + ) + +;; definition for method 217 of type saberfish +;; WARN: Return type mismatch symbol vs none. +(defmethod saberfish-method-217 ((this saberfish)) + (cond + ((and (< (vector-vector-distance (-> this focus-pos) (-> this root trans)) 28672.0) + (get-focus! this) + (time-elapsed? (-> this last-attack-time) (seconds 1)) + ) + #t + ) + (else + ) + ) + (none) + ) + +;; definition for method 216 of type saberfish +;; WARN: Return type mismatch int vs saberfish-command. +(defmethod get-cmd ((this saberfish)) + (saberfish-method-220 this) + (let ((f30-0 (vector-vector-distance (-> this focus-pos) (-> this root trans))) + (f28-0 28672.0) + (gp-0 #f) + ) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (set! f28-0 (* 1.5 f28-0)) + ) + (let ((s4-1 + (cond + ((and (-> this ground-only?) (!= (find-nearest-nav-mesh (target-pos 0) 8192.0) (-> this nav state mesh))) + (the-as saberfish-command (saberfish-command stare)) + ) + ((and (not (-> this ground-only?)) (or (saberfish-method-228 this) (nav-enemy-method-174 this))) + (the-as saberfish-command (saberfish-command start-terrain-transition)) + ) + (else + (the-as + saberfish-command + (cond + ((< 61440.0 f30-0) + (saberfish-command hostile) + ) + (else + (let ((f0-2 (saberfish-method-215 this))) + 0.0 + (if (and (!= (* 20480.0 (the float (the int (* 0.000048828126 (+ 10240.0 (fabs f0-2)))))) 0.0) + (not (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere))) + ) + (set! gp-0 #t) + ) + (cond + ((and (>= 8192.0 (fabs f0-2)) (>= f28-0 f30-0) (< 16384.0 f30-0)) + (the-as saberfish-command (saberfish-command attack)) + ) + ((>= 28672.0 f30-0) + (the-as saberfish-command (saberfish-command spin-attack)) + ) + ((and (>= 10922.667 (fabs f0-2)) (< f28-0 f30-0)) + (the-as saberfish-command (saberfish-command hostile)) + ) + (else + (the-as saberfish-command (saberfish-command stare)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-43 (handle->process (-> this focus handle)))) + (when (or (not v1-43) + (or (not (and v1-43 + (not (logtest? (-> (the-as process-focusable v1-43) focus-status) (focus-status disable dead ignore grabbed))) + ) + ) + (not (attack-delay-elapsed? this)) + ) + ) + (let ((v1-51 (the-as int s4-1))) + (if (or (zero? v1-51) (= v1-51 3)) + (set! s4-1 (saberfish-command stare)) + ) + ) + ) + ) + (set! gp-0 (and (= (the-as int s4-1) 4) gp-0)) + (if gp-0 + (set! s4-1 (saberfish-command hostile-orient)) + ) + (the-as saberfish-command s4-1) + ) + ) + ) + +;; definition for function saberfish-water-post +;; WARN: Return type mismatch symbol vs none. +(defbehavior saberfish-water-post saberfish () + (none) + ) + +;; definition for function saberfish-chase-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior saberfish-chase-post saberfish () + (local-vars (v1-10 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 (handle->process (-> self focus handle)))) + (when a0-1 + (let ((gp-0 (get-trans (the-as process-focusable a0-1) 1))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> self root trans) gp-0) + (let ((f0-0 16384.0)) + (.lvf vf1 (&-> s5-0 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-10 vf1) + (if (< f0-0 v1-10) + (vector-normalize! s5-0 16384.0) + ) + ) + (vector+! gp-0 gp-0 s5-0) + ) + (let ((v1-15 (-> self nav state))) + (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-15 target-pos quad) (-> gp-0 quad)) + ) + ) + 0 + ) + ) + (nav-enemy-method-187 self) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hit (saberfish) + :virtual #t + :enter (behavior () + (sound-play "sabfish-gethit") + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (saberfish) + :virtual #t + :enter (behavior () + (if (saberfish-method-243 self) + (go-virtual swimming-hostile) + ) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + :trans (behavior () + (let ((a0-1 (handle->process (-> self focus handle)))) + (if a0-1 + (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + ) + ) + (let ((a1-2 (get-cmd self))) + (if (or (not (and (-> self next-state) (= (-> self next-state name) 'hostile))) (!= a1-2 2)) + (handle-cmd self a1-2) + ) + ) + (let ((t9-4 (-> (find-parent-state) trans))) + (if t9-4 + (t9-4) + ) + ) + ) + :post saberfish-chase-post + ) + +;; definition for method 221 of type saberfish +(defmethod handle-cmd ((this saberfish) (arg0 saberfish-command)) + (case arg0 + (((saberfish-command start-terrain-transition)) + (start-terrain-transition this) + ) + (((saberfish-command attack)) + (go (method-of-object this attack)) + ) + (((saberfish-command hostile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) + ) + ) + (((saberfish-command spin-attack)) + (go (method-of-object this spin-attack)) + ) + (((saberfish-command hostile-orient)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile-orient))) + (go (method-of-object this hostile-orient)) + ) + ) + (((saberfish-command stare)) + (if (and (not (and (-> this next-state) (= (-> this next-state name) 'stare))) + (not (and (-> this next-state) (= (-> this next-state name) 'stare-idle))) + ) + (go (method-of-object this stare)) + ) + ) + ) + ) + +;; definition for method 215 of type saberfish +(defmethod saberfish-method-215 ((this saberfish)) + (let ((a0-2 (handle->process (-> this focus handle)))) + (when a0-2 + (let ((a1-2 (get-trans (the-as process-focusable a0-2) 0))) + (saberfish-method-214 this a1-2) + ) + ) + ) + ) + +;; definition for method 214 of type saberfish +(defmethod saberfish-method-214 ((this saberfish) (arg0 vector)) + (let ((gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + 0.0 + 0.0 + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 3 prim-core) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + 0.0 + (set! (-> s4-1 y) 0.0) + (set! (-> gp-0 y) 0.0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s4-1 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s5-0 1.0) + (let ((f0-7 (acos (vector-dot s4-1 s5-0)))) + (if (< (vector-dot s4-1 gp-0) 0.0) + (set! f0-7 (* -1.0 f0-7)) + ) + f0-7 + ) + ) + ) + ) + +;; definition for function saberfish-orient-code-setup +;; WARN: Return type mismatch int vs none. +(defbehavior saberfish-orient-code-setup saberfish () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! saberfish-turn-ja :num! (loop!) :frame-num 0.0) + (none) + ) + +;; definition for function saberfish-orient-code-single-pass +;; WARN: new jak 2 until loop case, check carefully +(defbehavior saberfish-orient-code-single-pass saberfish ((arg0 float)) + (* 0.00006510417 (the float (ja-num-frames 0))) + (let ((f30-1 (if (< arg0 0.0) + -1.0 + 1.0 + ) + ) + (f24-0 (ja-frame-num 0)) + (f28-0 1.3333333) + ) + 0.0 + (let ((f26-0 (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + -1.0 + 1.0 + ) + ) + (gp-1 (* 20480.0 (the float (the int (* 0.000048828126 (+ arg0 (* 10240.0 f30-1))))))) + ) + (when (!= gp-1 0.0) + (until #f + (let ((f22-0 (ja-frame-num 0))) + 0.0 + (let ((f0-10 (* f30-1 f26-0))) + (when (or (and (< f0-10 0.0) (< f24-0 f22-0)) (and (< 0.0 f0-10) (< f22-0 f24-0))) + 0 + (goto cfg-25) + ) + ) + (let ((f0-15 (* (fmin (* 15360.0 (seconds-per-frame) f28-0) (fabs gp-1)) f30-1))) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) f0-15) + ) + (ja :num! (loop! (* f28-0 f30-1 f26-0))) + (set! f24-0 f22-0) + ) + (suspend) + 0 + ) + #f + ) + (label cfg-25) + gp-1 + ) + ) + ) + +;; definition for function saberfish-orient-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior saberfish-orient-code saberfish () + (saberfish-orient-code-setup) + (until #f + (let ((f0-0 (saberfish-method-215 self))) + (saberfish-orient-code-single-pass f0-0) + ) + (let ((a1-0 (get-cmd self))) + (handle-cmd self a1-0) + ) + ) + #f + (none) + ) + +;; failed to figure out what this is: +(defstate hostile-orient (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (stop-look-at! self) + ) + :exit (behavior () + (set-look-at-mode! self 1) + ) + :code saberfish-orient-code + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate stare-idle (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (set-look-at-mode! self 1) + ) + :trans (behavior () + (let ((a1-0 (get-cmd self))) + (if (!= a1-0 (saberfish-command stare)) + (handle-cmd self a1-0) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! saberfish-idle-ja :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate stare (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (if (saberfish-method-243 self) + (go-virtual swimming-hostile) + ) + (nav-enemy-method-182 self) + (stop-look-at! self) + ) + :exit (behavior () + (set-look-at-mode! self 1) + ) + :trans (behavior () + '() + ) + :code (behavior () + (saberfish-orient-code-setup) + (until #f + (let ((f0-0 (saberfish-method-215 self))) + (saberfish-orient-code-single-pass f0-0) + ) + (let ((a1-0 (get-cmd self))) + (case a1-0 + (((saberfish-command stare)) + (go-virtual stare-idle) + ) + (else + (handle-cmd self a1-0) + ) + ) + ) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate attack (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (stop-look-at! self) + ) + :exit (behavior () + (set-look-at-mode! self 1) + (set-time! (-> self last-attack-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! saberfish-attack-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 5)) + 0.0 + (let ((f0-5 (saberfish-method-215 self))) + 0.0 + (let ((f30-0 (* 0.06666667 (the float gp-0)))) + (let ((f1-5 (fmin (* (/ 8192.0 f30-0) (seconds-per-frame)) (fabs f0-5)))) + (if (< f0-5 0.0) + (set! f1-5 (* -1.0 f1-5)) + ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) f1-5) + ) + (when (>= 5.0 (ja-frame-num 0)) + (let ((v1-29 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (vector+float*! (-> self root trans) (-> self root trans) v1-29 (* (/ 8192.0 f30-0) (seconds-per-frame))) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (dotimes (gp-1 1) + (ja-no-eval :group! saberfish-attack-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (logclear! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! saberfish-attack-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-2 (ja-num-frames 0)) + (v1-83 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (vector+float*! + (-> self root trans) + (-> self root trans) + v1-83 + (* -8192.0 (seconds-per-frame) (/ 15.0 (the float gp-2))) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual hostile) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; definition for method 218 of type saberfish +;; WARN: Return type mismatch int vs none. +(defmethod saberfish-method-218 ((this saberfish)) + 0 + (none) + ) + +;; definition for method 234 of type saberfish +;; WARN: Return type mismatch int vs none. +(defmethod saberfish-method-234 ((this saberfish) (arg0 vector)) + (let ((s4-0 (saberfish-method-233 this)) + (a0-3 (saberfish-method-236 this (-> this current-nav-mesh-index))) + (t0-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info)) + ) + (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (-> this root trans)) + (when a0-3 + (set! (-> arg0 y) 0.0) + (clamp-vector-to-mesh-no-gaps a0-3 (-> this root trans) s4-0 arg0 t0-0) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate water-land (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (on-submerged self #f) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (vector+float*! gp-0 (-> self root trans) s5-0 81920.0) + (let ((v1-8 (-> self nav state))) + (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + ) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self nav flags) (nav-control-flag use-momentum)) + ) + :trans (behavior () + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 81920.0 (seconds-per-frame)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (dotimes (gp-0 1) + (ja-no-eval :group! saberfish-swim-burst-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (go-virtual swimming-hostile) + ) + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate swim-180-spin (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + (stop-look-at! self) + (set! (-> self swim-speed) 57344.0) + (set-time! (-> self state-time)) + (let ((a1-0 (-> self nav state)) + (v1-8 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-8 quad) (-> a1-0 target-pos quad)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + 0.0 + (vector-! gp-0 (-> self root trans) v1-8) + (set! (-> gp-0 y) 0.0) + (when (< (vector-normalize-ret-len! gp-0 1.0) 20480.0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (saberfish-method-231 self s5-0 4551.1113 #t gp-0) + (let ((v1-13 (-> self nav state))) + (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) + (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) + (set! (-> v1-13 target-pos quad) (-> s5-0 quad)) + ) + ) + 0 + ) + ) + ) + ) + :exit (behavior () + (set! (-> self root transv y) 0.0) + (set! (-> self adjusted-y-yet?) #f) + (set! (-> self saberfish-y-rotate) 0.0) + (vector-z-quaternion! (-> self nav-velocity) (-> self root quat)) + (set! (-> self nav-velocity y) 0.0) + (vector-normalize! (-> self nav-velocity) 1.0) + (set! (-> self nav-dir quad) (-> self nav-velocity quad)) + (set! (-> self doing-180-spin?) #f) + (set-time! (-> self last-swim-flip-time)) + (set! (-> self saberfish-y-rotate) 0.0) + ) + :code (behavior () + (local-vars (sv-144 vector)) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! saberfish-swim-180-turn-ja) + (set! (-> self doing-180-spin?) #t) + (quaternion-copy! (-> self rotate-anim-quat) (-> self root quat)) + (vector-z-quaternion! (-> self post-spinflip-expected-heading) (-> self root quat)) + (set! (-> self post-spinflip-expected-heading y) 0.0) + (vector-normalize! (-> self post-spinflip-expected-heading) 1.0) + (vector-float*! (-> self post-spinflip-expected-heading) (-> self post-spinflip-expected-heading) -1.0) + (let ((gp-0 #f)) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (set! (-> self root transv quad) (the-as uint128 0)) + (vector-float*! (-> self root transv) (-> self root transv) -1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (set! (-> self root transv quad) (the-as uint128 0)) + (when (not (logtest? (-> self align flags) (align-flags disabled))) + (quaternion-normalize! + (quaternion*! (-> self rotate-anim-quat) (-> self rotate-anim-quat) (-> self align delta quat)) + ) + (quaternion-copy! (-> self root quat) (-> self rotate-anim-quat)) + (when (< 3.0 (ja-frame-num 0)) + (let ((a0-16 (-> self nav state)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 quad) (-> a0-16 travel quad)) + (let ((s3-0 (new 'stack-no-clear 'quaternion)) + (s5-1 (new 'stack-no-clear 'quaternion)) + ) + (let ((s4-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) + 0.0 + (vector-normalize! s2-0 1.0) + (when (< 4.0 (ja-frame-num 0)) + (when (not gp-0) + (set! gp-0 #t) + (let ((a1-10 (new 'stack-no-clear 'vector))) + (set! (-> a1-10 quad) (-> self root trans quad)) + (splash-spawn 0.0 a1-10 1) + ) + ) + ) + (when (< 5.0 (ja-frame-num 0)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (f30-5 (/ (+ -5.0 (ja-frame-num 0)) (+ -5.0 (the float (ja-num-frames 0))))) + ) + (let ((s0-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (set! (-> s0-0 y) 0.0) + (vector-normalize! s0-0 1.0) + (vector-lerp! s1-0 s0-0 s2-0 f30-5) + ) + (let ((s1-1 (-> self root trans)) + (s0-1 (-> self root trans)) + ) + (set! sv-144 s2-0) + (let ((f0-13 (* (lerp 0.0 57344.0 f30-5) (seconds-per-frame)))) + (vector+float*! s1-1 s0-1 sv-144 f0-13) + ) + ) + ) + ) + (let ((f30-6 (vector-dot (-> self post-spinflip-expected-heading) s2-0))) + (cond + ((< 0.9999 f30-6) + (quaternion-identity! s3-0) + ) + (else + (let ((s1-4 (vector-cross! (new 'stack-no-clear 'vector) (-> self post-spinflip-expected-heading) s2-0))) + (vector-normalize! s1-4 1.0) + (quaternion-vector-angle! s3-0 s1-4 (acos f30-6)) + ) + ) + ) + ) + (let ((f0-20 (/ (+ -3.0 (ja-frame-num 0)) (+ -3.0 (the float (ja-num-frames 0)))))) + (quaternion-slerp! s5-1 s4-0 s3-0 f0-20) + ) + ) + (quaternion*! (-> self root quat) (-> self rotate-anim-quat) s5-1) + ) + ) + ) + ) + (ja :num! (seek!)) + (suspend) + ) + ) + (go-virtual swimming-hostile) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; definition for function saberfish-swim-code +;; WARN: Return type mismatch symbol vs none. +;; WARN: new jak 2 until loop case, check carefully +(defbehavior saberfish-swim-code saberfish () + (let ((v1-2 (ja-group))) + (when (not (and v1-2 (= v1-2 saberfish-swim-burst-ja))) + (ja-channel-push! 3 (seconds 0.2)) + (ja :group! saberfish-swim-burst-ja) + (ja :chan 1 :group! saberfish-swim-turn-left-ja) + (ja :chan 2 :group! saberfish-swim-turn-right-ja) + ) + ) + (until #f + (let* ((f0-1 (* 0.000061035156 (-> self swim-final-rotate-deg))) + (f0-2 (fmin 1.0 f0-1)) + ) + (let ((v1-19 (-> self skel root-channel 0)) + (f1-3 (- 1.0 f0-2)) + ) + (set! (-> v1-19 frame-interp 1) f1-3) + (set! (-> v1-19 frame-interp 0) f1-3) + ) + (ja :chan (-> self swim-travel-anim) :frame-interp0 f0-2 :frame-interp1 f0-2) + ) + (let ((v1-27 (-> self skel root-channel (- 3 (-> self swim-travel-anim)))) + (f0-3 0.0) + ) + (set! (-> v1-27 frame-interp 1) f0-3) + (set! (-> v1-27 frame-interp 0) f0-3) + ) + (ja :num! (loop!)) + (ja :chan 1 :num! (chan 0)) + (ja :chan 2 :num! (chan 0)) + (suspend) + ) + #f + (none) + ) + +;; definition for method 239 of type saberfish +;; INFO: Used lq/sq +(defmethod saberfish-method-239 ((this saberfish) (arg0 vector)) + (when (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (let ((v1-3 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((f0-0 (-> this swim-speed))) + 0.0 + 0.0 + (set! (-> v1-3 quad) (-> arg0 quad)) + (set! (-> v1-3 y) (fmin (-> v1-3 y) (+ -8192.0 (-> this water surface-height)))) + (vector-! s5-0 v1-3 (-> this root trans)) + (let ((f1-4 (-> s5-0 y)) + (v1-4 s5-0) + ) + (set! (-> this root transv y) + (/ f1-4 (/ (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) f0-0)) + ) + ) + ) + (set! (-> this root transv y) (fmin 16384.0 (-> this root transv y))) + (vector-normalize! s5-0 1.0) + (set! (-> this saberfish-y-rotate) + (deg-seek (-> this saberfish-y-rotate) (* -16384.0 (-> s5-0 y)) (* 16384.0 (seconds-per-frame))) + ) + ) + ) + ) + +;; definition for method 161 of type saberfish +(defmethod nav-enemy-method-161 ((this saberfish) (arg0 nav-control)) + (if (and (not (-> this doing-180-spin?)) + (not (and (-> this next-state) (= (-> this next-state name) 'hostile-orient))) + ) + (call-parent-method this arg0) + ) + (none) + ) + +;; definition for function saberfish-swim-travel-trans +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defbehavior saberfish-swim-travel-trans saberfish () + (local-vars (f26-0 float) (f28-0 float)) + (when (not (-> self doing-180-spin?)) + (let ((a0-0 (-> self nav state)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> a0-0 travel quad)) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (let ((f30-0 (-> self swim-speed))) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + 0.0 + 0.0 + (let ((v1-6 (-> self nav state))) + (set! (-> v1-6 speed) f30-0) + ) + 0 + (set! (-> gp-0 y) 0.0) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (vector-normalize! gp-0 1.0) + (vector-normalize! s5-0 1.0) + (cond + (#f + (set! f26-0 (-> self swim-anim-last-dot)) + (set! f28-0 (-> self swim-rotate-last-dot)) + (set! (-> s5-0 quad) (-> gp-0 quad)) + ) + (else + (let ((f0-6 (vector-dot s4-0 s5-0))) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f0-6 (* -1.0 f0-6)) + ) + (let ((f0-7 (* -1.0 f0-6))) + (set! f26-0 (seek (-> self swim-anim-last-dot) f0-7 (* 4.0 (seconds-per-frame)))) + ) + ) + (set! (-> self swim-anim-last-dot) f26-0) + (let ((f0-11 (vector-dot gp-0 s5-0))) + (set! f28-0 (seek (-> self swim-rotate-last-dot) f0-11 (* 2.0 (seconds-per-frame)))) + ) + (set! (-> self swim-rotate-last-dot) f28-0) + (set! (-> self swim-rotate-last-dot) f28-0) + ) + ) + ) + (set! (-> self swim-final-rotate-deg) (- 16384.0 (acos (fabs f26-0)))) + (if (>= f26-0 0.0) + (set! (-> self swim-travel-anim) 2) + (set! (-> self swim-travel-anim) 1) + ) + (cond + ((and (< f28-0 -0.1) + (let ((f26-1 61440.0) + (t9-8 vector-vector-xz-distance) + (a0-15 (-> self root trans)) + (a2-2 (-> self nav state)) + (a1-7 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-7 quad) (-> a2-2 target-pos quad)) + (< f26-1 (t9-8 a0-15 a1-7)) + ) + (let ((v1-37 (ja-group))) + (and (not (and v1-37 (= v1-37 saberfish-swim-180-turn-ja))) #f) + ) + ) + (set! (-> self swim-travel-anim) -1) + ) + ((< 0.99999 f28-0) + (set! (-> gp-0 quad) (-> s5-0 quad)) + ) + (else + (let ((s4-1 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f30-1 (fmin (acos f28-0) (* 0.53333336 (seconds-per-frame) f30-0)))) + (vector-cross! s4-1 gp-0 s5-0) + (vector-normalize! s4-1 1.0) + (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) f30-1 s4-1) + ) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 1.0) + ) + ) + ) + (let ((a0-27 (-> self nav state)) + (v1-48 gp-0) + ) + (set! (-> a0-27 heading quad) (-> v1-48 quad)) + ) + 0 + (set! (-> self nav-dir quad) (-> gp-0 quad)) + (vector-normalize! gp-0 (-> self swim-speed)) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> gp-0 quad)) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 24576.0) + (saberfish-method-234 self s5-1) + (when (< (vector-length s5-1) 6144.0) + (set! (-> self swim-travel-anim) -1) + (set! (-> gp-0 quad) (the-as uint128 0)) + (go-virtual swim-180-spin) + ) + ) + (let ((a0-34 (-> self nav state)) + (v1-65 gp-0) + ) + (set! (-> a0-34 velocity quad) (-> v1-65 quad)) + ) + 0 + (set! (-> self nav-velocity quad) (-> gp-0 quad)) + ) + ) + ) + (none) + ) + +;; definition for function swimming-base-exit +;; WARN: Return type mismatch symbol vs none. +(defbehavior swimming-base-exit saberfish () + (set! (-> self root transv y) 0.0) + (set! (-> self saberfish-y-rotate) 0.0) + (set! (-> self doing-180-spin?) #f) + (none) + ) + +;; failed to figure out what this is: +(defstate swimming-base (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + (stop-look-at! self) + (set! (-> self swim-speed) 57344.0) + (set-time! (-> self state-time)) + ) + :exit swimming-base-exit + :trans (behavior () + (saberfish-method-220 self) + (saberfish-swim-travel-trans) + (if (saberfish-method-228 self) + (start-terrain-transition self) + ) + ) + :code saberfish-swim-code + :post (behavior () + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate swimming-hostile (saberfish) + :virtual #t + :parent (saberfish swimming-base) + :enter (behavior () + (logior! (-> self focus-status) (focus-status dangerous)) + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 enter))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + (let ((a0-2 (handle->process (-> self focus handle)))) + (when a0-2 + (vector-! (-> self attack-dir) (get-trans (the-as process-focusable a0-2) 1) (-> self root trans)) + (set! (-> self attack-dir y) 0.0) + (vector-normalize! (-> self attack-dir) 1.0) + ) + ) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status dangerous)) + (let ((a0-1 (-> self prev-state parent))) + (when a0-1 + (let ((t9-0 (-> a0-1 exit))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (set! (-> self root transv y) 0.0) + ) + :trans (behavior () + (let ((s5-0 (handle->process (-> self focus handle))) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (when #t + (let ((s4-0 #f)) + (let ((s3-0 #f)) + (when s5-0 + (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (let ((f0-2 (- (vector-dot (-> self root trans) (-> self attack-dir)) (vector-dot gp-0 (-> self attack-dir))))) + (if (< -61440.0 f0-2) + (set! s3-0 #t) + ) + (when (< 0.0 f0-2) + #t + (vector+float*! gp-0 gp-0 (-> self attack-dir) 32768.0) + (if (< 12288.0 f0-2) + (set! s4-0 #t) + ) + ) + ) + ) + (let ((a0-7 (-> self nav state)) + (v1-27 gp-0) + ) + (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-7 target-pos quad) (-> v1-27 quad)) + ) + 0 + (when (or (not (-> self adjusted-y-yet?)) (not s3-0)) + (saberfish-method-239 self gp-0) + (set! (-> self adjusted-y-yet?) #t) + ) + ) + (when (or (not s5-0) + (or s4-0 + (not (and (handle->process (-> self focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (focus-status disable dead ignore grabbed) + ) + ) + ) + ) + ) + ) + (set! (-> self flee-to-readjust?) #f) + (set! (-> self use-stored-flee-point?) #f) + (set-time! (-> self scare-start-time)) + (let* ((f30-0 300.0) + (f28-0 2.5) + (f26-0 1.5) + (v1-50 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-51 (the-as number (logior #x3f800000 v1-50))) + ) + (set! (-> self scare-time) + (the-as time-frame (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-51))))))) + ) + ) + (saberfish-method-231 + self + (-> self flee-point-temp) + 4551.1113 + #t + (vector-! (new 'stack-no-clear 'vector) (-> self root trans) gp-0) + ) + (go-flee self) + ) + ) + ) + ) + (let ((v1-61 (-> self state parent))) + (when v1-61 + (let ((t9-5 (-> v1-61 trans))) + (if t9-5 + (t9-5) + ) + ) + ) + ) + ) + ) + +;; definition for method 219 of type saberfish +;; WARN: Return type mismatch int vs none. +(defmethod saberfish-method-219 ((this saberfish)) + (set! (-> this enemy-info idle-anim) 3) + (set! (-> this enemy-info walk-anim) 6) + (set! (-> this enemy-info run-anim) 5) + (set! (-> this enemy-info hostile-anim) 5) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (saberfish) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (if (saberfish-method-243 self) + (set! f30-0 (* 0.65 f30-0)) + ) + (until #f + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate spin-attack (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (stop-look-at! self) + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self last-attack-time)) + ) + :exit (behavior () + (set-look-at-mode! self 1) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :code (behavior () + (local-vars (f22-0 float) (f28-0 float) (f30-0 float)) + (let ((f24-0 (saberfish-method-215 self)) + (f26-0 1.0) + ) + 0.0 + 0.0 + 0.0 + 0.0 + (let ((f0-4 f24-0)) + (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) + (set! f0-4 (* -1.0 f0-4)) + ) + (cond + ((< 0.0 f0-4) + (ja-channel-push! 1 (seconds 0.2)) + (set! f30-0 3.0) + (set! f28-0 9.0) + (set! f22-0 6.0) + (ja-no-eval :group! saberfish-spin-attack-right-ja :num! (loop!) :frame-num 0.0) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (set! f30-0 3.0) + (set! f28-0 9.0) + (set! f22-0 6.0) + (ja-no-eval :group! saberfish-spin-attack-left-ja :num! (loop!) :frame-num 0.0) + ) + ) + ) + (if (< f24-0 0.0) + (set! f26-0 -1.0) + ) + (let* ((f0-10 (fabs f24-0)) + (f0-11 (+ 16384.0 f0-10)) + (f26-1 (* (fmax 16384.0 (fmin 32768.0 f0-11)) f26-0 (/ 15.0 f22-0))) + ) + (until (ja-done? 0) + (let ((f0-15 (ja-frame-num 0))) + (if (and (>= f0-15 f30-0) (>= f28-0 f0-15)) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* f26-1 (seconds-per-frame))) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (go-virtual hostile) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; definition for method 222 of type saberfish +(defmethod attack-delay-elapsed? ((this saberfish)) + (time-elapsed? (-> this last-attack-time) (seconds 1)) + ) + +;; definition for method 67 of type saberfish +(defmethod coin-flip? ((this saberfish)) + #f + ) + +;; definition for method 108 of type saberfish +(defmethod enemy-method-108 ((this saberfish) (arg0 process-focusable)) + (not (time-elapsed? (-> this scare-start-time) (-> this scare-time))) + ) + +;; definition for method 76 of type saberfish +(defmethod go-stare2 ((this saberfish)) + (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'swimming-hostile) (= v1-3 'flee)) + ) + ) + ) + (call-parent-method this) + ) + ) + +;; definition for method 92 of type saberfish +;; WARN: Return type mismatch enemy-jump-flags vs none. +(defmethod init-jump-info! ((this saberfish) (arg0 enemy-jump-info)) + (call-parent-method this arg0) + (if (saberfish-method-243 this) + (logior! (-> arg0 flags) (enemy-jump-flags ejf0)) + (logclear! (-> arg0 flags) (enemy-jump-flags ejf0)) + ) + (logclear! (-> arg0 flags) (enemy-jump-flags ejf0)) + (none) + ) + +;; definition for method 232 of type saberfish +(defmethod do-jump ((this saberfish)) + (stop-look-at! this) + (cond + ((saberfish-method-243 this) + (set! (-> this jump windup-anim) (the-as uint 18)) + (set! (-> this jump air-anim) (the-as uint 19)) + (set! (-> this jump land-anim) (the-as uint 20)) + (set! (-> this move-to-ground?) #t) + ) + (else + (set! (-> this jump air-anim) (the-as uint 21)) + (set! (-> this jump land-anim) (the-as uint 22)) + (set! (-> this move-to-ground?) #f) + ) + ) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-end) (-> this jump-point-start))) + (s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (+ (vector-length s3-1) (if (saberfish-method-243 this) + 49152.0 + 20480.0 + ) + ) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 (if (saberfish-method-243 this) + 49152.0 + 20480.0 + ) + ) + (vector+! s5-0 (-> this jump-point-start) s4-0) + (set! (-> s5-0 y) (-> this jump-point-end y)) + (set! (-> this jump-start-ground-state) (the-as uint (get-ground-state this))) + (set! (-> this enemy-flags) + (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag jump-check-blocked))) + ) + (send-event this 'jump 0 s5-0) + ) + ) + +;; failed to figure out what this is: +(defstate water-impact (saberfish) + :virtual #t + :parent (saberfish base-saberfish-state) + :enter (behavior () + (let ((v1-1 (-> self state parent))) + (when v1-1 + (let ((t9-0 (-> v1-1 enter))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + ) + :code (behavior () + (ja-no-eval :group! (-> self draw art-group data (-> self jump land-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self root transv quad) (the-as uint128 0)) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (set! (-> self root transv quad) (the-as uint128 0)) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* (lerp 40960.0 40960.0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) (seconds-per-frame)) + ) + (set! (-> self root trans y) + (- (-> self root trans y) (* (lerp 83968.0 0.0 (* 0.2 (ja-frame-num 0))) (seconds-per-frame))) + ) + (suspend) + (ja :num! (seek!)) + ) + (logior! (-> self root root-prim prim-core collide-with) (collide-spec backgnd)) + (go-virtual swimming-hostile) + ) + ) + +;; failed to figure out what this is: +(defstate diving-into-water (saberfish) + :virtual #t + :parent (saberfish base-saberfish-state) + :enter (behavior () + (set! (-> self state-time) (+ (current-time) (seconds 8))) + (logclear! (-> self root status) (collide-status touch-surface)) + (set! (-> self root transv quad) (the-as uint128 0)) + (set! (-> self root transv y) -61440.0) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (water-control-method-10 (-> self water)) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 40960.0 (seconds-per-frame)) + ) + (set! (-> self root trans y) (- (-> self root trans y) (* 81920.0 (seconds-per-frame)))) + (set! (-> self root transv quad) (the-as uint128 0)) + (if (or (< (-> self root trans y) (+ -8192.0 (-> self water surface-height))) + (logtest? (-> self root status) (collide-status touch-surface)) + (time-elapsed? (-> self state-time) (seconds 0.05)) + ) + (go-virtual water-impact) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (let ((gp-0 (-> self draw art-group data (-> self jump air-anim))) + (s5-0 #f) + ) + (ja-no-eval :group! gp-0 + :num! (identity (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1))) + ) + (until #f + (ja :group! gp-0 :num! (identity (the float (+ (-> (the-as art-joint-anim gp-0) frames num-frames) -1)))) + (suspend) + (when (and (not s5-0) (< (-> self root trans y) (-> self water surface-height))) + (set! s5-0 #t) + (set-time! (-> self state-time)) + ) + ) + ) + #f + ) + :post enemy-falling-post + ) + +;; failed to figure out what this is: +(defstate transition-terrain-jump-from-water (saberfish) + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (set! (-> self saberfish-y-rotate) 0.0) + (quaternion-look-at! + (-> self root quat) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + *up-vector* + ) + ) + :exit (behavior () + (logior! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! saberfish-jump-to-land-windup-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (f30-0 (ja-frame-num 0)) + ) + (set! (-> gp-0 y) 0.0) + (vector-normalize! gp-0 (-> self swim-speed)) + (vector-v++! (-> self root trans) gp-0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (set! (-> self root transv x) 0.0) + (set! (-> self root transv z) 0.0) + (vector-v++! (-> self root trans) (-> self root transv)) + (set! (-> self root transv quad) (the-as uint128 0)) + (if (>= f30-0 6.0) + (do-jump self) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + (do-jump self) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; definition for function jump-from-land-dive-anim +;; WARN: Return type mismatch int vs none. +(defbehavior jump-from-land-dive-anim saberfish () + (let ((f30-0 1.0)) + (compute-alignment! (-> self align)) + (cond + ((< (ja-frame-num 0) 4.5) + (align! (-> self align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> self root trans) (-> self root transv)) + ) + ((< 4.5 (ja-frame-num 0)) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* (lerp 81920.0 40960.0 (* 0.22222222 (+ -4.5 (ja-frame-num 0)))) (seconds-per-frame)) + ) + (set! (-> self root trans y) + (- (-> self root trans y) + (* (lerp 2048.0 81920.0 (* 0.22222222 (+ -4.5 (ja-frame-num 0)))) (seconds-per-frame)) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate transition-terrain-jump-from-land (saberfish) + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + ) + :exit (behavior () + '() + ) + :code (behavior () + (logclear! (-> self water flags) (water-flag swim-ground)) + (ja-channel-push! 1 (seconds 0.2)) + (stop-look-at! self) + (logclear! (-> self root root-prim prim-core collide-with) (collide-spec backgnd)) + (set! (-> self jump air-anim) (the-as uint 21)) + (set! (-> self jump land-anim) (the-as uint 22)) + (ja-no-eval :group! (-> self draw art-group data (-> self jump air-anim)) :num! (seek!) :frame-num 0.0) + (set! (-> self root transv quad) (the-as uint128 0)) + (until (ja-done? 0) + (jump-from-land-dive-anim) + ) + (set! (-> self move-to-ground?) #f) + (go-virtual diving-into-water) + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate transition-terrain-jump (saberfish) + :virtual #t + :enter (behavior () + (if (saberfish-method-243 self) + (go transition-terrain-jump-from-water) + (go transition-terrain-jump-from-land) + ) + ) + :code sleep-code + ) + +;; definition for function transition-pursue-behavior +(defbehavior transition-pursue-behavior saberfish () + (when (-> self in-pursuit?) + (saberfish-method-220 self) + (if (desired-nav-idx-valid? self) + (go-virtual hostile) + ) + ) + (nav-enemy-method-187 self) + (none) + ) + +;; failed to figure out what this is: +(defstate transition-terrain-orient-towards-initial-jump (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + ) + :trans (behavior () + (if (< (fabs (saberfish-method-214 self (-> self jump-point-end))) 2730.6667) + (go transition-terrain-jump-from-land) + ) + ) + :code (behavior () + (saberfish-orient-code-setup) + (until #f + (let ((f0-0 (saberfish-method-214 self (-> self jump-point-end)))) + (if (= (saberfish-orient-code-single-pass f0-0) 0.0) + (go transition-terrain-jump-from-land) + ) + ) + ) + #f + ) + :post (behavior () + (enemy-common-post self) + (update-transforms (-> self root)) + ) + ) + +;; definition for function turbo-swim +;; WARN: new jak 2 until loop case, check carefully +(defbehavior turbo-swim saberfish () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! saberfish-swim-burst-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate transition-terrain-move-towards-initial-jump (saberfish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (nav-enemy-method-183 self) + (set! (-> self swim-speed) 57344.0) + (when (saberfish-method-243 self) + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + 0 + ) + ) + :exit (behavior () + (if (saberfish-method-243 self) + (swimming-base-exit) + ) + ) + :trans (behavior () + (go-terrain-transition self #f) + (if (saberfish-method-243 self) + (saberfish-swim-travel-trans) + ) + ) + :code (behavior () + (cond + ((saberfish-method-243 self) + (saberfish-swim-code) + ) + (else + (let ((v1-3 (method-of-type enemy hostile))) + (when v1-3 + (let ((t9-2 (-> v1-3 code))) + (if t9-2 + ((the-as (function none) t9-2)) + ) + ) + ) + ) + ) + ) + ) + :post transition-pursue-behavior + ) + +;; definition for method 238 of type saberfish +;; INFO: Used lq/sq +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f1, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f2, f5] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f1, f3, f6] +(defmethod saberfish-method-238 ((this saberfish) (arg0 symbol) (arg1 float) (arg2 float)) + (local-vars + (f1-5 float) + (sv-192 vector) + (sv-196 float) + (sv-200 vector) + (sv-204 vector) + (sv-240 vector) + (sv-244 vector) + (sv-248 vector) + (sv-252 float) + (sv-256 float) + (sv-512 vector) + (sv-516 vector) + (sv-520 vector) + (sv-524 vector) + (sv-528 float) + (sv-532 float) + (sv-536 vector) + (sv-540 vector) + (sv-592 vector) + (sv-608 vector) + ) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (-> this swim-speed) + #t + (let ((s3-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> s3-0 query-type) (saberfish-query-type can-go-to-ground?)) + (set! (-> s3-0 in-water?) #f) + (send-event (get-spawn-parent) 'saberfish-query s3-0) + (let ((v1-6 (-> s3-0 in-water?)) + (s3-1 #f) + ) + (cond + ((and arg0 (not v1-6)) + (set! s3-1 #t) + ) + (arg0 + (set! s3-1 #t) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! sv-196 (the-as float 30720.0)) + (set! sv-200 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (set! sv-204 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (set! (-> sv-204 y) 0.0) + (vector-normalize! sv-204 1.0) + (set! sv-240 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-start) (-> this root trans))) + (set! sv-244 sv-204) + (set! sv-248 (vector-float*! (new 'stack-no-clear 'vector) sv-204 -1.0)) + (set! sv-252 (the-as float 0.0)) + (set! sv-256 (the-as float 0.0)) + (set! (-> sv-240 y) 0.0) + (vector-normalize! sv-240 1.0) + (set! sv-252 (vector-dot sv-244 sv-240)) + (set! sv-256 (vector-dot sv-248 sv-240)) + (cond + ((< sv-256 sv-252) + (vector+float*! sv-192 (-> this root trans) sv-244 sv-196) + (set! (-> sv-204 quad) (-> sv-244 quad)) + ) + (else + (vector+float*! sv-192 (-> this root trans) sv-248 sv-196) + (set! (-> sv-204 quad) (-> sv-248 quad)) + ) + ) + (when (< (* sv-196 sv-196) (vector-vector-xz-distance-squared sv-192 (-> this jump-point-start))) + (set! sv-592 (new 'stack-no-clear 'vector)) + (let ((v1-33 (-> this jump-point-start)) + (a0-22 sv-192) + ) + (.lvf vf4 (&-> v1-33 quad)) + (.lvf vf5 (&-> a0-22 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-592 quad) vf6) + (set! sv-608 (new 'stack-no-clear 'vector)) + (let ((s0-1 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + (set! (-> sv-592 y) 0.0) + (let* ((f0-19 (vector-length sv-592)) + (f30-1 (sqrtf (- (* f0-19 f0-19) (* sv-196 sv-196)))) + ) + (let ((f28-0 (atan sv-196 f30-1))) + (vector-normalize! sv-592 -1.0) + (vector-rotate-y! sv-608 sv-592 f28-0) + (let ((t9-10 vector-rotate-y!) + (a0-26 s0-1) + (a2-2 (- f28-0)) + ) + (t9-10 a0-26 sv-592 a2-2) + ) + ) + (vector-normalize! sv-608 f30-1) + (vector-normalize! s0-1 f30-1) + ) + (vector+float*! s3-2 (-> this jump-point-start) sv-608 1.0) + (vector+float*! s1-1 (-> this jump-point-start) s0-1 1.0) + (vector-! sv-608 s3-2 (-> this root trans)) + (vector-! s0-1 s1-1 (-> this root trans)) + (set! (-> sv-608 y) 0.0) + (set! (-> s0-1 y) 0.0) + (let ((f30-2 (vector-normalize-ret-len! sv-608 1.0)) + (f0-28 (vector-normalize-ret-len! s0-1 1.0)) + ) + (let* ((v1-47 sv-200) + (f1-4 (-> sv-608 x)) + (f2-1 (-> sv-608 y)) + (f3-0 (-> sv-608 z)) + (f4-0 (-> v1-47 x)) + (f5-0 (-> v1-47 y)) + (f6-0 (-> v1-47 z)) + ) + (.mula.s f1-4 f4-0) + (.madda.s f2-1 f5-0) + (.madd.s f1-5 f3-0 f6-0) + ) + (set! sv-252 f1-5) + (set! sv-256 (vector-dot s0-1 sv-200)) + (cond + ((< f30-2 40.96) + (set! (-> s2-1 quad) (-> s3-2 quad)) + ) + ((< f0-28 40.96) + (set! (-> s2-1 quad) (-> s1-1 quad)) + ) + ((< sv-256 sv-252) + (set! (-> s2-1 quad) (-> s3-2 quad)) + ) + (else + (set! (-> s2-1 quad) (-> s1-1 quad)) + ) + ) + ) + ) + (set! (-> s2-1 y) (-> this root trans y)) + (cond + ((< (vector-vector-xz-distance-squared (-> this jump-point-start) s2-1) 822083600.0) + (if (< 8192.0 arg1) + (set! s3-1 #t) + (set! s3-1 #f) + ) + ) + ((begin + (let ((s3-4 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-start) (-> this jump-point-end))) + (s0-2 (new 'stack-no-clear 'vector)) + (s1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-4 y) 0.0) + (vector-normalize! s3-4 1.0) + (vector-rotate-y! s0-2 s3-4 -8192.0) + (vector-rotate-y! s1-2 s3-4 8192.0) + (vector-normalize! s0-2 arg2) + (vector-normalize! s1-2 arg2) + (set! s3-1 #f) + (set! sv-512 (vector+! (new 'stack-no-clear 'vector) (-> this jump-point-start) s0-2)) + (set! sv-516 (vector+! (new 'stack-no-clear 'vector) (-> this jump-point-start) s1-2)) + (set! sv-520 (new 'stack-no-clear 'vector)) + (set! sv-524 (new 'stack-no-clear 'vector)) + (set! sv-528 (the-as float 0.0)) + (set! sv-532 (the-as float 0.0)) + (set! sv-536 (new 'stack-no-clear 'vector)) + (set! sv-540 (new 'stack-no-clear 'vector)) + (set! (-> sv-536 quad) (-> this root trans quad)) + (set! (-> sv-540 quad) (-> s2-1 quad)) + (set! (-> sv-536 y) (-> sv-512 y)) + (set! (-> sv-540 y) (-> sv-512 y)) + (let ((a1-37 (vector-! (new 'stack-no-clear 'vector) sv-516 sv-512)) + (a0-60 (new 'stack-no-clear 'vector)) + (v1-76 (new 'stack-no-clear 'vector)) + ) + (set-vector! a0-60 (-> s0-2 z) 0.0 (- (-> s0-2 x)) 1.0) + (set-vector! v1-76 (- (-> s0-2 z)) 0.0 (-> s0-2 x) 1.0) + (set! sv-252 (vector-dot a0-60 a1-37)) + (if (< 0.0 sv-252) + (set! (-> sv-520 quad) (-> a0-60 quad)) + (set! (-> sv-520 quad) (-> v1-76 quad)) + ) + (set-vector! a0-60 (-> s1-2 z) 0.0 (- (-> s1-2 x)) 1.0) + (set-vector! v1-76 (- (-> s1-2 z)) 0.0 (-> s1-2 x) 1.0) + (set! sv-252 (vector-dot a0-60 a1-37)) + (if (< 0.0 sv-252) + (set! (-> sv-524 quad) (-> v1-76 quad)) + (set! (-> sv-524 quad) (-> a0-60 quad)) + ) + ) + ) + (vector-normalize! sv-520 1.0) + (vector-normalize! sv-524 1.0) + (set! sv-528 (vector-dot sv-520 sv-512)) + (set! sv-252 (vector-dot sv-520 sv-536)) + (set! sv-256 (vector-dot sv-520 sv-540)) + (or (< sv-252 sv-528) (< sv-256 sv-528)) + ) + (set! s3-1 #t) + ) + (else + (set! sv-532 (vector-dot sv-524 sv-516)) + (set! sv-252 (vector-dot sv-524 sv-536)) + (set! sv-256 (vector-dot sv-524 sv-540)) + (if (or (< sv-252 sv-532) (< sv-256 sv-532)) + (set! s3-1 #t) + ) + ) + ) + ) + ) + ) + ) + (when (< 26624.0 (- (-> this water surface-height) (-> this root trans y))) + ) + (cond + (s3-1 + (set-time! (-> this scare-start-time)) + (set! (-> this scare-time) (seconds 12.5)) + (set! (-> this flee-to-readjust?) #t) + (set! (-> this use-stored-flee-point?) #t) + (saberfish-method-231 this (-> this flee-point-temp) 1820.4445 #f (the-as vector #f)) + (set-time! (-> this last-land-check-time)) + (let* ((a0-70 this) + (t9-24 (method-of-object a0-70 saberfish-method-218)) + ) + #t + (t9-24 a0-70) + ) + (if (not (and (-> this next-state) (= (-> this next-state name) 'flee))) + (go-flee this) + ) + ) + ((and (< arg2 49152.0) (< arg1 8192.0)) + (go transition-terrain-jump-from-water) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'transition-terrain-move-towards-initial-jump))) + (go (method-of-object this transition-terrain-move-towards-initial-jump)) + ) + ) + ) + ) + ) + ) + +;; definition for method 224 of type saberfish +(defmethod go-terrain-transition ((this saberfish) (arg0 symbol)) + (let ((f30-0 (vector-vector-xz-distance (-> this root trans) (-> this jump-point-start))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this jump-point-end) (-> this jump-point-start))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + ) + (set! (-> s4-1 y) 0.0) + (vector-normalize! s4-1 1.0) + (let* ((f0-2 (vector-dot s3-0 s4-1)) + (f28-0 (acos f0-2)) + ) + (cond + ((saberfish-method-243 this) + (saberfish-method-238 this arg0 f28-0 f30-0) + ) + (else + (cond + ((and (< f30-0 4096.0) (< f28-0 2730.6667)) + (go transition-terrain-jump-from-land) + ) + ((< f30-0 8192.0) + (nav-enemy-method-176 this) + (go (method-of-object this transition-terrain-orient-towards-initial-jump)) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'transition-terrain-move-towards-initial-jump))) + (nav-enemy-method-177 this) + (go (method-of-object this transition-terrain-move-towards-initial-jump)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 233 of type saberfish +(defmethod saberfish-method-233 ((this saberfish)) + (let ((gp-0 (new 'stack-no-clear 'nav-poly)) + (a0-2 (saberfish-method-236 this (-> this current-nav-mesh-index))) + ) + (if (not a0-2) + (return (the-as nav-poly #f)) + ) + (vector-! (the-as vector (-> gp-0 vertex)) (-> this root trans) (the-as vector (-> a0-2 bounds))) + (set! (-> gp-0 vertex1 x) 40960.0) + (set! (-> gp-0 data 20) (the-as uint 3)) + (nav-mesh-method-45 a0-2 gp-0) + ) + ) + +;; definition for method 231 of type saberfish +;; INFO: Used lq/sq +(defmethod saberfish-method-231 ((this saberfish) (arg0 vector) (arg1 float) (arg2 symbol) (arg3 vector)) + (local-vars (sv-64 vector) (sv-68 vector) (sv-72 float) (sv-76 float) (sv-80 vector) (sv-84 float)) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! sv-68 (new 'stack-no-clear 'vector)) + (set! sv-72 (the-as float 0.0)) + (set! sv-76 (the-as float 0.0)) + (set! sv-80 (new 'stack-no-clear 'vector)) + (set! sv-84 (the-as float -1.0)) + (if arg2 + (set! (-> sv-64 quad) (-> arg3 quad)) + (vector-! sv-64 (-> this jump-point-start) (-> this jump-point-end)) + ) + (set! (-> sv-64 y) 0.0) + (set! sv-76 arg1) + (vector-normalize-copy! sv-68 sv-64 1.0) + (let ((s3-0 (saberfish-method-236 this (-> this current-nav-mesh-index))) + (s2-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info)) + (s1-0 (saberfish-method-233 this)) + ) + 0.0 + (when s1-0 + (dotimes (s0-0 13) + (vector-rotate-y! sv-64 sv-68 sv-72) + (vector-normalize! sv-64 94208.0) + (clamp-vector-to-mesh-no-gaps s3-0 (-> this root trans) s1-0 sv-64 s2-0) + (vector+! arg0 (-> this root trans) sv-64) + (let ((f0-7 (vector-length sv-64))) + (when (< 84787.195 f0-7) + (set! (-> arg0 y) (-> this water surface-height)) + (return #t) + ) + (when (< sv-84 f0-7) + (set! sv-84 f0-7) + (set! (-> sv-80 quad) (-> arg0 quad)) + ) + ) + (if (= (logand s0-0 1) 1) + (set! sv-72 (+ sv-72 sv-76)) + (set! sv-72 (- sv-72 sv-76)) + ) + (set! sv-76 (+ sv-76 arg1)) + ) + (set! (-> arg0 quad) (-> sv-80 quad)) + (set! (-> arg0 y) (-> this water surface-height)) + (return #t) + ) + ) + #f + ) + +;; definition for method 230 of type saberfish +(defmethod change-nav-mesh ((this saberfish)) + (let* ((s5-0 (get-nav-mesh-idx this (-> this root trans) (saberfish-find-behavior none))) + (a0-3 (saberfish-method-236 this s5-0)) + ) + (when (and (>= s5-0 0) (or (!= s5-0 (-> this current-nav-mesh-index)) (!= (-> this nav state mesh) a0-3))) + (set! (-> this current-nav-mesh-index) s5-0) + (change-to a0-3 this) + ) + ) + (none) + ) + +;; definition for method 227 of type saberfish +(defmethod desired-nav-idx-valid? ((this saberfish)) + (!= (-> this desired-dest-mesh-index) (-> this dest-nav-mesh-index)) + ) + +;; definition for method 229 of type saberfish +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-dest-nav! ((this saberfish) (arg0 vector) (arg1 saberfish-find-behavior)) + (set! (-> this desired-dest-nav-point quad) (-> arg0 quad)) + (set! (-> this desired-dest-mesh-index) (get-nav-mesh-idx this arg0 arg1)) + (when (= (-> this desired-dest-mesh-index) -1) + ) + 0 + (none) + ) + +;; definition for method 228 of type saberfish +(defmethod saberfish-method-228 ((this saberfish)) + (and (not (-> this ground-only?)) + (>= (+ (current-time) (seconds -0.1)) (-> this last-swim-flip-time)) + (!= (-> this desired-dest-mesh-index) (-> this current-nav-mesh-index)) + (!= (-> this current-nav-mesh-index) -1) + ) + ) + +;; definition for method 226 of type saberfish +(defmethod start-terrain-transition ((this saberfish)) + (set-should-move-to-ground this) + (send-event (get-spawn-parent) 'transition-terrain-begin) + (go-terrain-transition this #t) + ) + +;; definition for method 160 of type saberfish +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod normalize-heading! ((this saberfish) (arg0 nav-control)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (cond + ((and (not (and (-> this next-state) (= (-> this next-state name) 'transition-terrain-orient-towards-initial-jump))) + (and (logtest? (enemy-flag ef37) (-> this enemy-flags)) + (not (logtest? (enemy-flag ef39) (-> this enemy-flags))) + ) + ) + (cond + ((or (saberfish-method-243 this) (not (logtest? (enemy-flag ef37) (-> this enemy-flags)))) + (set! (-> s5-0 quad) (-> this nav-dir quad)) + ) + (else + (let ((a1-3 (-> this nav state))) + (set! (-> s5-0 quad) (-> a1-3 heading quad)) + ) + ) + ) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (quaternion-set! s4-0 0.0 (-> s5-0 x) 0.0 (+ 1.0 (-> s5-0 z))) + (quaternion-normalize! s4-0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) s4-0) + (if (>= (+ (current-time) (seconds -0.6)) (-> this last-swim-flip-time)) + (quaternion-copy! (-> this root quat) s4-0) + (quaternion-slerp! (-> this root quat) (-> this root quat) s4-0 (* 4.0 (seconds-per-frame))) + ) + ) + ) + (else + ) + ) + ) + (if (saberfish-method-243 this) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) (-> this saberfish-y-rotate)) + ) + 0 + (none) + ) + +;; definition for method 98 of type saberfish +(defmethod jump-wind-up-anim ((this saberfish) (arg0 enemy-jump-info)) + (when (not (saberfish-method-243 this)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump windup-anim))) + (a0-5 (-> this skel root-channel 0)) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!) + ) + ) + #t + ) + +;; definition for method 96 of type saberfish +(defmethod jump-in-air-anim ((this saberfish) (arg0 enemy-jump-info)) + (ja-channel-push! 1 (seconds 0.1)) + (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + +;; definition for method 97 of type saberfish +(defmethod jump-land-anim ((this saberfish) (arg0 enemy-jump-info)) + (cond + ((zero? (-> this jump land-anim)) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.075)) + (let ((a1-2 (-> this draw art-group data (-> this jump land-anim))) + (a0-4 (-> this skel root-channel 0)) + ) + (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) + (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg0 anim-speed)) + (set! (-> a0-4 frame-num) 0.0) + (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!) + ) + #t + ) + ) + ) + +;; definition for method 93 of type saberfish +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod setup-jump! ((this saberfish) (arg0 enemy-jump-info)) + (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) + (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) + ) + (let ((f0-4 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) + (v1-3 (vector-! (new 'stack-no-clear 'vector) (-> arg0 dest-pos) (-> arg0 start-pos))) + ) + (set! (-> v1-3 y) 0.0) + (let ((f0-6 (* (/ f0-4 (vector-length v1-3)) (if (saberfish-method-243 this) + 49152.0 + 20480.0 + ) + ) + ) + ) + (+ 2048.0 f0-6) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'traj3d-params))) + (set! (-> s4-0 dest quad) (-> arg0 dest-pos quad)) + (set! (-> s4-0 src quad) (-> arg0 start-pos quad)) + (let ((f30-1 11832.889)) + (if (not (saberfish-method-243 this)) + (set! f30-1 8192.0) + ) + (set! (-> s4-0 initial-tilt) f30-1) + ) + (set! (-> s4-0 gravity) 4.551111) + (traj3d-calc-initial-velocity-using-tilt s4-0) + (set! (-> arg0 traj initial-position quad) (-> arg0 start-pos quad)) + (set! (-> arg0 traj gravity) -4.551111) + (set! (-> arg0 traj time) (-> s4-0 time)) + (set! (-> arg0 traj initial-velocity quad) (-> s4-0 initial-velocity quad)) + ) + (none) + ) + +;; definition for method 225 of type saberfish +;; INFO: Used lq/sq +(defmethod get-nav-mesh-idx ((this saberfish) (arg0 vector) (arg1 saberfish-find-behavior)) + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> gp-0 query-type) (saberfish-query-type set-nav-idx)) + (set! (-> gp-0 behavior) arg1) + (set! (-> (the-as vector (&-> gp-0 mesh)) quad) (-> arg0 quad)) + (send-event (get-spawn-parent) 'saberfish-query gp-0) + (-> gp-0 closest-nav-mesh-index) + ) + ) + +;; definition for method 164 of type saberfish +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod nav-enemy-method-164 ((this saberfish)) + (call-parent-method this) + (let* ((a0-3 this) + (t9-2 (method-of-object a0-3 set-dest-nav!)) + (a2-0 (-> this nav state)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 quad) (-> a2-0 target-pos quad)) + (t9-2 a0-3 a1-1 (saberfish-find-behavior none)) + ) + (if (saberfish-method-228 this) + (start-terrain-transition this) + ) + (none) + ) + +;; definition for method 166 of type saberfish +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs vector. +(defmethod nav-enemy-method-166 ((this saberfish) (arg0 vector) (arg1 vector)) + (cond + (#t + (set! (-> arg0 quad) (-> this flee-point-temp quad)) + #t + ) + (else + (call-parent-method this arg0 arg1) + ) + ) + (if (saberfish-method-243 this) + (set! (-> arg0 y) (-> this water surface-height)) + ) + (the-as vector #t) + ) + +;; failed to figure out what this is: +(defstate flee (saberfish) + :virtual #t + :enter (behavior () + (set! (-> self swim-speed) 57344.0) + (when (saberfish-method-243 self) + (set! (-> self saberfish-y-rotate) 0.0) + (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (set! (-> self swim-final-rotate-deg) 0.0) + (set! (-> self swim-travel-anim) 0) + 0 + ) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit (behavior () + (set! (-> self scare-time) 0) + (if (saberfish-method-243 self) + (swimming-base-exit) + ) + (let ((t9-3 (-> (find-parent-state) exit))) + (if t9-3 + (t9-3) + ) + ) + ) + :trans (behavior () + (when (-> self flee-to-readjust?) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (when (time-elapsed? (-> self last-target-check-time) (seconds 0.2)) + (set-time! (-> self last-target-check-time)) + (saberfish-method-220 self) + (when (desired-nav-idx-valid? self) + (set! (-> self scare-time) 0) + 0 + ) + ) + (saberfish-method-239 self (-> self flee-point-temp)) + ) + ) + (when (< (vector-vector-xz-distance (-> self root trans) (-> self flee-point-temp)) 16384.0) + (set! (-> self scare-time) 0) + 0 + ) + (when (time-elapsed? (-> self last-land-check-time) (seconds 2.5)) + (saberfish-method-220 self) + (set-time! (-> self last-land-check-time)) + (if (saberfish-method-228 self) + (start-terrain-transition self) + ) + ) + (saberfish-swim-travel-trans) + (when (>= (the-as int (-> self focus aware)) 2) + (let ((t9-9 (-> (find-parent-state) trans))) + (if t9-9 + (t9-9) + ) + ) + ) + ) + :code (behavior () + (saberfish-swim-code) + ) + ) + +;; definition for method 107 of type saberfish +(defmethod is-pfoc-in-mesh? ((this saberfish) (arg0 process-focusable) (arg1 vector)) + (if (and arg0 (not arg1)) + (set! arg1 (get-trans arg0 1)) + ) + (when arg1 + (let* ((f0-0 (-> arg1 y)) + (v1-4 (-> this root)) + (f1-0 (-> v1-4 trans y)) + (a0-2 (-> this fact)) + ) + (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) + (let ((f0-1 (-> this enemy-info notice-nav-radius))) + (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) + (>= (get-nav-mesh-idx this arg1 (saberfish-find-behavior none)) 0) + ) + ) + ) + ) + ) + ) + +;; definition for method 59 of type saberfish +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this saberfish)) + (if (not (handle->process (-> this spawn-parent))) + (go (method-of-object this die)) + ) + (water-control-method-10 (-> this water)) + (let ((a1-1 (-> this nav state)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-6 quad) (-> a1-1 heading quad)) + (set! (-> a0-6 y) 0.0) + (vector-normalize! a0-6 1.0) + ) + (when (= (-> this pid) 275) + ) + (set-should-move-to-ground this) + (if (and (-> this next-state) + (let ((v1-19 (-> this next-state name))) + (or (= v1-19 'diving-into-water) (= v1-19 'water-impact) (= v1-19 'jump) (= v1-19 'knocked)) + ) + ) + (change-nav-mesh this) + ) + (let ((a1-8 (-> this nav state)) + (a0-14 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-14 quad) (-> a1-8 travel quad)) + (set! (-> a0-14 y) 0.0) + (vector-normalize! a0-14 1.0) + ) + (cond + ((saberfish-method-243 this) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + (stop-look-at! this) + ) + ((= (-> this ground-state) 4) + (logior! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) + ) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 99 of type saberfish +;; INFO: Used lq/sq +(defmethod jump-anim-handler ((this saberfish) (arg0 int) (arg1 enemy-jump-info)) + (when (saberfish-method-243 this) + (case arg0 + ((5) + (compute-alignment! (-> this align)) + (align! (-> this align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) + (vector-v++! (-> this root trans) (-> this root transv)) + (when (< (ja-frame-num 0) 8.0) + (let ((f0-1 (vector-length (-> this root transv)))) + (let ((v1-17 (-> this nav state))) + (set! (-> v1-17 speed) f0-1) + ) + 0 + (let ((v1-19 (-> this nav))) + (set! (-> v1-19 target-speed) f0-1) + ) + 0 + (set! (-> this swim-speed) f0-1) + ) + ) + (set! (-> this root transv quad) (the-as uint128 0)) + ) + ) + ) + (call-parent-method this arg0 arg1) + ) + +;; definition for method 102 of type saberfish +(defmethod go-directed2 ((this saberfish)) + (if (saberfish-method-243 this) + (go (method-of-object this water-land)) + (call-parent-method this) + ) + ) + +;; definition for method 50 of type saberfish +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this saberfish) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list water pusher) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) + (set! (-> v1-8 prim-core action) (collide-action)) + (set! (-> v1-8 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate knocked (saberfish) + :virtual #t + :enter (behavior () + (set! (-> self knocked-under-water?) #f) + (set! (-> self move-to-ground?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover-water (saberfish) + :virtual #t + :parent (saberfish knocked-recover) + :enter (behavior () + '() + ) + :code (behavior () + (when (handle->process (-> self ragdoll-proc)) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (saberfish-method-240 self (seconds 1)) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! saberfish-swim-180-turn-ja :num! (seek!) :frame-num 0.0) + (let ((gp-0 (current-time))) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (go-virtual swimming-hostile) + ) + :post (behavior () + (enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (saberfish) + :virtual #t + :enter (behavior () + (set-should-move-to-ground self) + (if (saberfish-method-243 self) + (go-virtual knocked-recover-water) + ) + (let ((t9-4 (-> (find-parent-state) enter))) + (if t9-4 + (t9-4) + ) + ) + ) + :code (behavior () + (if (handle->process (-> self ragdoll-proc)) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! saberfish-flip-up-start-ja :num! (seek!) :frame-num 0.0) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.4)) + (suspend) + ) + ) + (ja-channel-push! 1 0) + (ja-no-eval :group! saberfish-flip-up-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (change-nav-mesh self) + (water-control-method-10 (-> self water)) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +;; definition for method 81 of type saberfish +(defmethod go-die ((this saberfish)) + (sound-play "sabfish-death") + (send-event (handle->process (-> this spawn-parent)) 'child-die) + (call-parent-method this) + ) + +;; definition for method 20 of type saberfish +(defmethod process-mask->search-info-flag ((this saberfish)) + (let ((v0-1 (call-parent-method this))) + (if (-> this is-submerged?) + (set! v0-1 (logior v0-1 (search-info-flag abort))) + ) + v0-1 + ) + ) + +;; definition for method 235 of type saberfish +;; WARN: Return type mismatch int vs none. +(defmethod on-submerged ((this saberfish) (arg0 symbol)) + (if arg0 + (logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + ) + (set! (-> this is-submerged?) arg0) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (saberfish) + :virtual #t + :trans (behavior () + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) + (cond + ((= (-> self focus aware) (enemy-aware ea1)) + (go-virtual active) + ) + ((< 1 (the-as int (-> self focus aware))) + (go-virtual notice) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate notice (saberfish) + :virtual #t + :enter (behavior () + (go-virtual hostile) + ) + ) + +;; definition for function saberfish-command-event-handler +(defbehavior saberfish-command-event-handler saberfish ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('saberfish-command) + (case (-> arg3 param 0) + (('go-alive) + (go-virtual idle) + ) + ) + ) + (else + (event-handler self arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate command-mode (saberfish) + :virtual #t + :event saberfish-command-event-handler + :trans (behavior () + '() + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate saberfish-swimming (saberfish) + :virtual #t + :parent (saberfish command-mode) + :enter (behavior () + (set! (-> self swim-travel-anim) 0) + (set! (-> self saberfish-y-rotate) 0.0) + (set! (-> self swim-final-rotate-deg) 0.0) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 57344.0 (seconds-per-frame)) + ) + (when (time-elapsed? (-> self state-time) (seconds 1)) + (set! (-> self current-nav-mesh-index) -1) + (change-nav-mesh self) + (go-virtual swimming-hostile) + ) + (let ((v1-15 (-> self state parent))) + (when v1-15 + (let ((t9-3 (-> v1-15 trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + ) + :code (behavior () + (saberfish-swim-code) + ) + ) + +;; failed to figure out what this is: +(defstate saberfish-crawl-out-of-tube (saberfish) + :virtual #t + :parent (saberfish command-mode) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (logclear! (-> self water flags) (water-flag swim-ground)) + (ja-channel-push! 1 0) + (stop-look-at! self) + (logclear! (-> self root root-prim prim-core collide-with) (collide-spec backgnd)) + (set! (-> self jump air-anim) (the-as uint 21)) + (set! (-> self jump land-anim) (the-as uint 22)) + (ja-no-eval :group! saberfish-crawl-out-of-tube-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (vector+float*! + (-> self root trans) + (-> self root trans) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) + (* 40960.0 (seconds-per-frame)) + ) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self root transv quad) (the-as uint128 0)) + (ja-channel-push! 1 0) + (ja :group! saberfish-jump-to-water-air-ja :num! (identity 5.0)) + (until (ja-done? 0) + (jump-from-land-dive-anim) + ) + (set! (-> self move-to-ground?) #f) + (go-virtual diving-into-water) + ) + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate saberfish-sitting-on-land (saberfish) + :virtual #t + :parent (saberfish command-mode) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('saberfish-command) + (case (-> block param 0) + (('go-alive) + (go transition-terrain-jump-from-land) + ) + ) + ) + (else + (event-handler self proc argc message block) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! saberfish-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (ja-post) + ) + ) + +;; definition for method 122 of type saberfish +(defmethod go-idle2 ((this saberfish)) + (case (-> this initial-state) + (('saberfish-crawl-out-of-tube) + (go (method-of-object this saberfish-crawl-out-of-tube)) + ) + (('saberfish-sitting-on-land) + (go (method-of-object this saberfish-sitting-on-land)) + ) + (('saberfish-swimming) + (go (method-of-object this saberfish-swimming)) + ) + (('idle) + (go (method-of-object this hostile)) + ) + ) + ) + +;; definition for method 11 of type saberfish +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this saberfish) (arg0 entity-actor)) + (set! (-> this ground-only?) #t) + (set! (-> this spawn-parent) (process->handle this)) + (set! (-> *saberfish-nav-enemy-info* nav-mesh) + (find-nearest-nav-mesh (-> arg0 extra trans) (the-as float #x7f800000)) + ) + (set! (-> this initial-state) 'idle) + (set! (-> this pos-start quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this quat-start) (-> arg0 quat)) + (call-parent-method this arg0) + ) + +;; definition for function saberfish-init-by-other +;; INFO: Used lq/sq +(defbehavior saberfish-init-by-other saberfish ((arg0 process-drawable) (arg1 saberfish-init-by-other-params)) + (set! (-> self pos-start quad) (-> arg1 pos quad)) + (quaternion-copy! (-> self quat-start) (-> arg1 orient)) + (set! (-> self spawn-parent) (-> arg1 spawn-parent)) + (set! (-> self initial-state) (-> arg1 initial-state)) + (stack-size-set! (-> self main-thread) 512) + (set! (-> self ground-only?) #f) + (enemy-init-by-other arg0 arg1) + ) + +;; definition for method 236 of type saberfish +(defmethod saberfish-method-236 ((this saberfish) (arg0 int)) + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> gp-0 query-type) (saberfish-query-type set-mesh)) + (set! (-> gp-0 closest-nav-mesh-index) arg0) + (set! (-> gp-0 mesh) #f) + (send-event (get-spawn-parent) 'saberfish-query gp-0) + (-> gp-0 mesh) + ) + ) + +;; definition for method 237 of type saberfish +(defmethod saberfish-method-237 ((this saberfish) (arg0 int)) + (let ((gp-0 (new 'stack-no-clear 'saberfish-spawner-query-msg))) + (set! (-> gp-0 query-type) (saberfish-query-type set-in-water)) + (set! (-> gp-0 closest-nav-mesh-index) arg0) + (send-event (get-spawn-parent) 'saberfish-query gp-0) + (-> gp-0 in-water?) + ) + ) + +;; definition for method 151 of type saberfish +(defmethod should-move-to-ground? ((this saberfish)) + (-> this move-to-ground?) + ) + +;; definition for method 189 of type saberfish +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod copy-nav-state-vel! ((this saberfish) (arg0 vector)) + (cond + ((saberfish-method-243 this) + (set! (-> arg0 quad) (-> this nav-velocity quad)) + ) + (else + (let ((a0-2 (-> this nav state))) + (set! (-> arg0 quad) (-> a0-2 velocity quad)) + ) + ) + ) + (none) + ) + +;; definition for method 79 of type saberfish +(defmethod go-flee ((this saberfish)) + (go (method-of-object this flee)) + ) + +;; definition for method 240 of type saberfish +;; WARN: Return type mismatch int vs none. +(defmethod saberfish-method-240 ((this saberfish) (arg0 time-frame)) + (let ((s5-0 (handle->process (-> this ragdoll-proc)))) + (when s5-0 + (disable-for-duration (the-as ragdoll-proc s5-0) arg0) + (logclear! (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-flags) (ragdoll-flag rf9)) + (enemy-method-90 this (the-as ragdoll-proc s5-0)) + ) + ) + 0 + (none) + ) + +;; definition for method 241 of type saberfish +(defmethod saberfish-method-241 ((this saberfish)) + (let ((a1-4 (-> (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))) ragdoll)) + (v1-3 0) + ) + (dotimes (a2-1 (the-as int (-> a1-4 num-joints))) + (if (logtest? (-> a1-4 ragdoll-joints a2-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2)) + (+! v1-3 1) + ) + ) + (set! (-> this knocked-under-water?) (>= v1-3 (the-as int (shr (-> a1-4 num-joints) 1)))) + (>= v1-3 (the int (* 0.6666667 (the float (-> a1-4 num-joints))))) + ) + ) + +;; definition for method 125 of type saberfish +(defmethod ragdoll-settled? ((this saberfish)) + (let* ((s5-0 (handle->process (-> this ragdoll-proc))) + (v0-0 + (or (not s5-0) + (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) + (and (not (saberfish-method-243 this)) + (time-elapsed? (-> this state-time) (seconds 0.1)) + (< (vector-length (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-joints 0 velocity)) + (* 49152.0 (seconds-per-frame)) + ) + (< (cos (* 16384.0 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) + (or (= (-> this root gspot-pos y) -40959590.0) + (< (- (-> this root trans y) (-> this root gspot-pos y)) 4096.0) + ) + ) + ) + ) + ) + ) + (if (not v0-0) + (set! v0-0 (saberfish-method-241 this)) + ) + v0-0 + ) + ) + +;; definition for method 89 of type saberfish +(defmethod within-gspot-range? ((this saberfish)) + (if (-> this knocked-under-water?) + #f + (call-parent-method this) + ) + ) + +;; definition for function find-ground-for-obj +(defun find-ground-for-obj ((arg0 process-focusable)) + (let ((gp-0 (new 'stack-no-clear 'water-info))) + (water-info-init! (-> arg0 root) gp-0 (collide-action solid semi-solid)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((v1-5 (above-ground? (-> arg0 root) s5-0 (-> arg0 root trans) (collide-spec backgnd) 8192.0 81920.0 1024.0))) + (cond + ((and (logtest? (water-flag touch-water) (-> gp-0 flags)) + v1-5 + (>= (+ 819.2 (-> s5-0 best-other-tri intersect y)) (-> arg0 root trans y)) + ) + (if (< (-> gp-0 base-height) (-> s5-0 best-other-tri intersect y)) + 4 + 3 + ) + ) + ((logtest? (water-flag touch-water) (-> gp-0 flags)) + 3 + ) + ((and v1-5 (>= (+ 819.2 (-> s5-0 best-other-tri intersect y)) (-> arg0 root trans y))) + 4 + ) + ((and v1-5 (logtest? (water-flag over-water) (-> gp-0 flags))) + (if (< (-> gp-0 base-height) (-> s5-0 best-other-tri intersect y)) + 2 + 1 + ) + ) + (v1-5 + 2 + ) + ((logtest? (water-flag over-water) (-> gp-0 flags)) + 1 + ) + (else + 0 + ) + ) + ) + ) + ) + ) + +;; definition for method 242 of type saberfish +(defmethod get-ground-state ((this saberfish)) + (if (-> this ground-only?) + (return 4) + ) + (when (and (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'knocked) (= v1-6 'knocked-recover)) + ) + ) + (handle->process (-> this ragdoll-proc)) + ) + (let ((v1-11 0) + (a1-6 0) + ) + (let ((a2-5 (-> (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))) ragdoll))) + 0 + (dotimes (a3-5 (the-as int (-> a2-5 num-joints))) + (if (logtest? (-> a2-5 ragdoll-joints a3-5 ragdoll-joint-flags) (ragdoll-joint-flag rjf2)) + (+! a1-6 1) + ) + (if (logtest? (-> a2-5 ragdoll-joints a3-5 ragdoll-joint-flags) (ragdoll-joint-flag rjf0)) + (+! v1-11 1) + ) + ) + ) + (when (or (> v1-11 0) (> a1-6 0)) + (if (< a1-6 v1-11) + (return 4) + (return 3) + ) + (the-as none 0) + ) + ) + ) + (find-ground-for-obj this) + ) + +;; definition for method 243 of type saberfish +(defmethod saberfish-method-243 ((this saberfish)) + (= (-> this ground-state) 3) + ) + +;; definition for method 244 of type saberfish +;; WARN: Return type mismatch nav-flags vs none. +(defmethod set-should-move-to-ground ((this saberfish)) + (set! (-> this ground-state) (the-as uint (get-ground-state this))) + (when #t + (case (-> this ground-state) + ((4 1 2) + (set! (-> this move-to-ground?) #t) + ) + (else + (set! (-> this move-to-ground?) #f) + ) + ) + ) + (cond + ((= (-> this ground-state) 3) + (logclear! (-> this root nav-flags) (nav-flags has-root-sphere)) + ) + (else + (set! (-> this root nav-radius) 8192.0) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + ) + ) + (none) + ) + +;; definition for method 181 of type saberfish +(defmethod nav-enemy-method-181 ((this saberfish)) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type saberfish +(defmethod relocate ((this saberfish) (offset int)) + (call-parent-method this offset) + ) + +;; definition for method 75 of type saberfish +(defmethod go-stare ((this saberfish)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (go (method-of-object this swimming-hostile)) + (call-parent-method this) + ) + ) + +;; definition for method 82 of type saberfish +(defmethod event-handler ((this saberfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('saberfish-query) + (let ((s5-1 (the-as saberfish-spawner-query-msg (-> arg3 param 0)))) + (case (-> s5-1 query-type) + (((saberfish-query-type set-nav-idx)) + (set! (-> s5-1 closest-nav-mesh-index) 0) + 0 + ) + (((saberfish-query-type set-mesh)) + (set! (-> s5-1 mesh) (find-nearest-nav-mesh (-> this entity extra trans) (the-as float #x7f800000))) + (nop!) + 0 + ) + (((saberfish-query-type set-in-water)) + (set! (-> s5-1 in-water?) #f) + #f + ) + (((saberfish-query-type can-go-to-ground?)) + (break!) + 0 + ) + ) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc new file mode 100644 index 0000000000..4c6d723674 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc @@ -0,0 +1,819 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gun-turret-params +(deftype gun-turret-params (structure) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (barrel-joint int32) + (gun-joint int32) + (hole-joints int32 8) + ) + ) + +;; definition for method 3 of type gun-turret-params +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this gun-turret-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gun-turret-params) + (format #t "~1Tnormal-sg: ~A~%" (-> this normal-sg)) + (format #t "~1Texplode-sg: ~A~%" (-> this explode-sg)) + (format #t "~1Tenemy-info: ~A~%" (-> this enemy-info)) + (format #t "~1Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~1Tshoot-anim: ~D~%" (-> this shoot-anim)) + (format #t "~1Ttrack-joint: ~D~%" (-> this track-joint)) + (format #t "~1Tbarrel-joint: ~D~%" (-> this barrel-joint)) + (format #t "~1Tgun-joint: ~D~%" (-> this gun-joint)) + (format #t "~1Thole-joints[8] @ #x~X~%" (-> this hole-joints)) + (label cfg-4) + this + ) + +;; definition of type sew-laser-guard +(deftype sew-laser-guard (enemy) + ((params gun-turret-params) + (aim-pos vector :inline) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (sync-orient sync-linear :inline) + (start-orient quaternion :inline) + (end-orient quaternion :inline) + (last-play-sweep-dir-positive? symbol) + (last-play-sweep-sync float) + (sound-hum sound-id) + (sound-scorch sound-id) + ) + (:methods + (sew-laser-guard-method-155 (_type_) none) + (sew-laser-guard-method-156 (_type_) none) + ) + ) + +;; definition for method 3 of type sew-laser-guard +(defmethod inspect ((this sew-laser-guard)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Taim-pos: #~%" (-> this aim-pos)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tcasing-part: ~A~%" (-> this casing-part)) + (format #t "~2Tsync-orient: #~%" (-> this sync-orient)) + (format #t "~2Tstart-orient: #~%" (-> this start-orient)) + (format #t "~2Tend-orient: #~%" (-> this end-orient)) + (format #t "~2Tlast-play-sweep-dir-positive?: ~A~%" (-> this last-play-sweep-dir-positive?)) + (format #t "~2Tlast-play-sweep-sync: ~f~%" (-> this last-play-sweep-sync)) + (format #t "~2Tsound-hum: ~D~%" (-> this sound-hum)) + (format #t "~2Tsound-scorch: ~D~%" (-> this sound-scorch)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defpart 4935 + :init-specs ((:texture (pal-lightning level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4936 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 64.0 64.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +;; failed to figure out what this is: +(defpart 4937 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.4) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0 30.0) + (:b 128.0) + (:a 128.0 128.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 4938 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 2.0 6.0) + (:z (meters 0.1)) + (:scale-x (meters 0.05) (meters 0.1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 1 128.0) + (:g :copy r) + (:b 255.0) + (:a 255.0) + (:omega (degrees 0.03375)) + (:vel-y (meters 0.02) (meters 0.02)) + (:fade-a -2.56 -2.56) + (:friction 0.9) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4939 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 64.0 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-laser-guard-hit + :id 1505 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4757 :period (seconds 5) :length (seconds 0.085) :offset -10) + (sp-item 4758 :fade-after (meters 60) :period (seconds 5) :length (seconds 0.1)) + (sp-item 4759 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 5) :length (seconds 0.335)) + (sp-item 4760 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 5) :length (seconds 0.167)) + (sp-item 4761 :period (seconds 5) :length (seconds 0.017) :offset -10) + (sp-item 4762 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 5) :length (seconds 0.167)) + ) + ) + +;; definition of type sew-laser-shot +(deftype sew-laser-shot (projectile) + () + ) + +;; definition for method 3 of type sew-laser-shot +(defmethod inspect ((this sew-laser-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate dissipate (sew-laser-shot) + :virtual #t + :enter (behavior () + (go-virtual impact) + ) + ) + +;; definition for method 38 of type sew-laser-shot +(defmethod made-impact? ((this sew-laser-shot)) + (let ((gp-0 (-> this root)) + (s5-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((v1-0 s5-0)) + (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) + (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-0 action-mask) (collide-action solid)) + ) + (let ((a0-2 (handle->process (-> this notify-handle)))) + (when a0-2 + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) + (f0-2 (- (vector-length s4-1))) + ) + (fill-and-try-snap-to-surface gp-0 s4-1 f0-2 0.0 -3072.0 s5-0) + ) + ) + ) + ) + ) + +;; definition for function sew-laser-shot-move +;; WARN: Return type mismatch int vs none. +(defun sew-laser-shot-move ((arg0 sew-laser-shot)) + (projectile-move-fill-line-sphere arg0) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +;; definition for method 30 of type sew-laser-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this sew-laser-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (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 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-7 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type sew-laser-shot +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this sew-laser-shot)) + (set! (-> this attack-mode) 'shock) + (set! (-> this max-speed) 131072.0) + (set! (-> this timeout) (seconds 0.125)) + (set! (-> this move) sew-laser-shot-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-laser-guard sew-laser-guard sew-laser-guard-lod0-jg sew-laser-guard-idle-ja + ((sew-laser-guard-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 30) + ) + +;; definition for symbol *sew-laser-guard-enemy-info*, type enemy-info +(define *sew-laser-guard-enemy-info* + (new 'static 'enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 3 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 150) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :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) + :knocked-off #t + ) + ) + +;; failed to figure out what this is: +(set! (-> *sew-laser-guard-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for function fire-laser! +;; INFO: Used lq/sq +(defun fire-laser! ((arg0 vector) (arg1 vector) (arg2 sew-laser-guard) (arg3 float)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-float*! (-> s5-0 move-dist) arg1 arg3) + (let ((v1-3 s5-0)) + (set! (-> v1-3 radius) 40.96) + (set! (-> v1-3 collide-with) (collide-spec backgnd jak enemy obstacle hit-by-others-list player-list)) + (set! (-> v1-3 ignore-process0) arg2) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (if (>= f0-2 0.0) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-2) + (set! (-> s5-0 best-other-tri collide-ptr) #f) + ) + ) + (cond + ((and (-> s5-0 best-other-tri collide-ptr) (let ((s3-0 (-> s5-0 best-other-tri collide-ptr))) + (if (type? s3-0 collide-shape-prim-sphere) + s3-0 + ) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s3-1 ent) (-> arg2 entity)) + (set! (-> s3-1 charge) 1.0) + (set! (-> s3-1 options) (projectile-options)) + (logclear! (-> s3-1 options) (projectile-options po14 po15 po16)) + (set! (-> s3-1 notify-handle) (the-as handle #f)) + (set! (-> s3-1 owner-handle) (the-as handle #f)) + (set! (-> s3-1 target-handle) (the-as handle #f)) + (set! (-> s3-1 target-pos quad) (the-as uint128 0)) + (set! (-> s3-1 ignore-handle) (process->handle arg2)) + (let* ((v1-19 *game-info*) + (a0-17 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-17) + (set! (-> s3-1 attack-id) a0-17) + ) + (set! (-> s3-1 timeout) (seconds 4)) + (set! (-> s3-1 pos quad) (-> s5-0 start-pos quad)) + (vector-normalize-copy! (-> s3-1 vel) (-> s5-0 move-dist) 4096000.0) + (spawn-projectile sew-laser-shot s3-1 arg2 *default-dead-pool*) + ) + (sound-play + "laser-hit-jak" + :position (vector+! (new 'stack-no-clear 'vector) (-> s5-0 start-pos) (-> s5-0 move-dist)) + ) + (vector-normalize! (-> s5-0 move-dist) (+ 2048.0 (vector-length (-> s5-0 move-dist)))) + ) + (else + (when arg2 + (let ((v1-30 arg2)) + (sound-play + "laser-sizzle" + :id (-> v1-30 sound-scorch) + :position (vector+! (new 'stack-no-clear 'vector) (-> s5-0 start-pos) (-> s5-0 move-dist)) + ) + ) + ) + ) + ) + (set! (-> *part-id-table* 4935 init-specs 4 initial-valuef) (vector-length (-> s5-0 move-dist))) + (draw-beam (-> *part-id-table* 4935) arg0 (-> s5-0 move-dist) #f) + (launch-particles (-> *part-id-table* 4936) arg0) + (launch-particles (-> *part-id-table* 4937) arg0) + (launch-particles (-> *part-id-table* 4938) (vector+! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) arg0)) + (launch-particles (-> *part-id-table* 4939) (vector+! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) arg0)) + ) + (none) + ) + +;; definition for method 155 of type sew-laser-guard +(defmethod sew-laser-guard-method-155 ((this sew-laser-guard)) + (let ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5)))) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! s4-0 (-> this root quat)) + (vector-normalize! s4-0 1.0) + (fire-laser! s5-0 s4-0 this 491520.0) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate hostile (sew-laser-guard) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (if (= proc *target*) + (send-event proc 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 3)) + (shove-up (meters 1)) + ) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (ja :group! sew-laser-guard-idle-ja) + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (until #f + (let ((f30-0 (get-norm! (-> self sync-orient) 0))) + (cond + ((-> self last-play-sweep-dir-positive?) + (when (and (< (- f30-0 (-> self last-play-sweep-sync)) 0.0) (< 0.8 f30-0)) + (sound-play "laser-sweep") + (set! (-> self last-play-sweep-dir-positive?) #f) + ) + ) + (else + (when (and (< 0.0 (- f30-0 (-> self last-play-sweep-sync))) (< f30-0 0.2)) + (sound-play "laser-sweep") + (set! (-> self last-play-sweep-dir-positive?) #t) + ) + ) + ) + (quaternion-slerp! (-> self root quat) (-> self start-orient) (-> self end-orient) f30-0) + (quaternion-normalize! (-> self root quat)) + (set! (-> self last-play-sweep-sync) f30-0) + ) + (sound-play "laser-guard" :id (-> self sound-hum)) + (let ((t9-8 (method-of-object self sew-laser-guard-method-155)) + (a0-9 self) + ) + #t + (t9-8 a0-9) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate stare (sew-laser-guard) + :virtual #t + :trans (behavior () + (go-hostile self) + ) + :code sleep-code + ) + +;; definition for method 20 of type sew-laser-guard +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this sew-laser-guard)) + (the-as search-info-flag 1) + ) + +;; definition for method 82 of type sew-laser-guard +(defmethod event-handler ((this sew-laser-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('start) + #f + ) + (('attack) + #f + ) + (('touched 'touch) + #f + ) + (('stop) + #f + ) + (('bonk) + (when (= (-> arg0 type) target) + (send-event arg0 'target-mech-get-off (seconds 0.3)) + (send-event arg0 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + ) + #f + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (sew-laser-guard) + :virtual #t + :enter (behavior () + (on-dying self) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self hit-points) 0.0) + ) + :code (behavior () + (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock)) + (sound-play "turret-explode") + (suspend) + (cleanup-for-death self) + (ja-channel-set! 0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (+! (-> gp-1 y) 10240.0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2)) + (spawn (-> self part) gp-1) + (suspend) + ) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; definition for method 120 of type sew-laser-guard +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this sew-laser-guard)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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)) + (let ((v1-6 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 3686.4 0.0 7372.8) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 10 of type sew-laser-guard +(defmethod deactivate ((this sew-laser-guard)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this casing-part)) + (kill-particles (-> this casing-part)) + ) + ((method-of-type enemy deactivate) this) + (none) + ) + +;; definition for method 67 of type sew-laser-guard +(defmethod coin-flip? ((this sew-laser-guard)) + #f + ) + +;; definition for method 7 of type sew-laser-guard +;; WARN: Return type mismatch enemy vs sew-laser-guard. +(defmethod relocate ((this sew-laser-guard) (offset int)) + (the-as sew-laser-guard ((method-of-type enemy relocate) this offset)) + ) + +;; definition for method 156 of type sew-laser-guard +;; WARN: Return type mismatch int vs none. +(defmethod sew-laser-guard-method-156 ((this sew-laser-guard)) + 0 + (none) + ) + +;; definition for method 121 of type sew-laser-guard +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this sew-laser-guard)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-guard" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *sew-laser-guard-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1505) this)) + (let ((f30-0 (res-lump-float (-> this entity) 'rotoffset)) + (f28-0 (res-lump-float (-> this entity) 'rotmax :default 8192.0)) + (f26-0 (res-lump-float (-> this entity) 'rotmin :default -8192.0)) + (s5-1 (new 'stack-no-clear 'sync-info-params)) + ) + (if (!= f30-0 0.0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f30-0) + ) + (quaternion-rotate-y! (-> this start-orient) (-> this root quat) f26-0) + (quaternion-rotate-y! (-> this end-orient) (-> this start-orient) (- f28-0 f26-0)) + (let ((v1-20 0)) + (if #t + (set! v1-20 (logior v1-20 1)) + ) + (set! (-> s5-1 sync-type) 'sync-linear) + (set! (-> s5-1 sync-flags) (the-as sync-flags v1-20)) + ) + (set! (-> s5-1 entity) (-> this entity)) + (set! (-> s5-1 period) (the-as uint 1200)) + (set! (-> s5-1 percent) 0.0) + (initialize! (-> this sync-orient) s5-1) + ) + (set! (-> this last-play-sweep-dir-positive?) #t) + (set! (-> this last-play-sweep-sync) (get-norm! (-> this sync-orient) 0)) + (set! (-> this sound-hum) (new-sound-id)) + (set! (-> this sound-scorch) (new-sound-id)) + (logclear! (-> this mask) (process-mask enemy)) + 0 + (none) + ) + +;; definition for method 122 of type sew-laser-guard +(defmethod go-idle2 ((this sew-laser-guard)) + (go (method-of-object this hostile)) + ) + +;; definition for method 52 of type sew-laser-guard +(defmethod damage-enemy! ((this sew-laser-guard) (arg0 object) (arg1 event-message-block)) + (send-event + (the-as process-tree arg0) + 'shove + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + 0.0 + ) + +;; failed to figure out what this is: +(defstate hit (sew-laser-guard) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (go-hostile self) + ) + :code sleep-code + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc new file mode 100644 index 0000000000..4f1075ba0a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc @@ -0,0 +1,1022 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sew-plat-updown +(deftype sew-plat-updown (base-plat) + ((sync sync-eased :inline) + (path-pos float) + ) + (:state-methods + idle + active + ) + (:methods + (get-skel (_type_) art-group) + ) + ) + +;; definition for method 3 of type sew-plat-updown +(defmethod inspect ((this sew-plat-updown)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type base-plat inspect))) + (t9-0 this) + ) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (sew-plat-updown) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate active (sew-plat-updown) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (plat-event proc argc message block) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post plat-post + ) + +;; definition for method 34 of type sew-plat-updown +;; WARN: Return type mismatch int vs none. +(defmethod base-plat-method-34 ((this sew-plat-updown)) + 0 + (none) + ) + +;; definition for method 11 of type sew-plat-updown +(defmethod init-from-entity! ((this sew-plat-updown) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-5 param 0) 1.0) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! + a0-5 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-24 0)) + (if (not (logtest? (-> this fact options) (actor-option loop))) + (set! v1-24 (logior v1-24 1)) + ) + (set! (-> a1-6 sync-type) 'sync-eased) + (set! (-> a1-6 sync-flags) (the-as sync-flags v1-24)) + ) + (set! (-> a1-6 period) (the-as uint 1800)) + (set! (-> a1-6 entity) arg0) + (set! (-> a1-6 percent) 0.0) + (set! (-> a1-6 ease-in) 0.15) + (set! (-> a1-6 ease-out) 0.15) + (set! (-> a1-6 pause-in) 0.2) + (set! (-> a1-6 pause-out) 0.0) + (initialize! (-> this sync) a1-6) + ) + (base-plat-method-34 this) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((> (-> this sync period) 0) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-slide-step sew-slide-step sew-slide-step-lod0-jg sew-slide-step-idle-ja + ((sew-slide-step-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) + +;; definition of type sew-slide-step +(deftype sew-slide-step (sew-plat-updown) + ((last-played-start? symbol) + ) + ) + +;; definition for method 3 of type sew-slide-step +(defmethod inspect ((this sew-slide-step)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type sew-plat-updown inspect))) + (t9-0 this) + ) + (format #t "~2Tlast-played-start?: ~A~%" (-> this last-played-start?)) + (label cfg-4) + this + ) + +;; definition for method 37 of type sew-slide-step +(defmethod get-skel ((this sew-slide-step)) + (art-group-get-by-name *level* "skel-sew-slide-step" (the-as (pointer level) #f)) + ) + +;; failed to figure out what this is: +(defstate active (sew-slide-step) + :virtual #t + :enter (behavior () + (set! (-> self last-played-start?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (cond + ((and (-> self last-played-start?) (< 0.9 (-> self path-pos))) + (sound-play "moving-step-out") + (set! (-> self last-played-start?) #f) + ) + ((and (not (-> self last-played-start?)) (< (-> self path-pos) 0.1)) + (set! (-> self last-played-start?) #t) + (sound-play "moving-step-in") + ) + ) + ) + ) + +;; definition for method 32 of type sew-slide-step +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this sew-slide-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-moving-step-a sew-moving-step-a sew-moving-step-a-lod0-jg sew-moving-step-a-idle-ja + ((sew-moving-step-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 4) + ) + +;; definition of type sew-moving-step-a +(deftype sew-moving-step-a (sew-plat-updown) + ((last-played-start? symbol) + (last-val float) + ) + ) + +;; definition for method 3 of type sew-moving-step-a +(defmethod inspect ((this sew-moving-step-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type sew-plat-updown inspect))) + (t9-0 this) + ) + (format #t "~2Tlast-played-start?: ~A~%" (-> this last-played-start?)) + (format #t "~2Tlast-val: ~f~%" (-> this last-val)) + (label cfg-4) + this + ) + +;; definition for method 34 of type sew-moving-step-a +;; WARN: Return type mismatch sparticle-launch-control vs none. +(defmethod base-plat-method-34 ((this sew-moving-step-a)) + (call-parent-method this) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1496) this)) + (none) + ) + +;; definition for method 28 of type sew-moving-step-a +;; WARN: Return type mismatch int vs none. +(defmethod update-part-and-sfx! ((this sew-moving-step-a)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (sew-moving-step-a) + :virtual #t + :enter (behavior () + (set! (-> self last-played-start?) #f) + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self last-val) -1.0) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (when (< (-> self path-pos) 0.5) + (new 'stack-no-clear 'vector) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (quaternion-copy! s5-0 (-> self entity quat)) + (quaternion->matrix gp-0 s5-0) + ) + (set! (-> gp-0 trans quad) (-> self entity extra trans quad)) + (+! (-> gp-0 trans y) 20480.0) + (spawn-from-mat (-> self part) gp-0) + ) + ) + (if (and (< 0.65 (-> self last-val)) (>= 0.65 (-> self path-pos))) + (sound-play "mv-stp-a-splash") + ) + (if (and (< (-> self last-val) 0.95) (>= (-> self path-pos) 0.95)) + (sound-play "move-step-a-hit") + ) + (set! (-> self last-val) (-> self path-pos)) + ) + ) + +;; definition for method 37 of type sew-moving-step-a +(defmethod get-skel ((this sew-moving-step-a)) + (art-group-get-by-name *level* "skel-sew-moving-step-a" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type sew-moving-step-a +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this sew-moving-step-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 16384.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition of type sew-moving-step-b +(deftype sew-moving-step-b (process-drawable) + ((sync sync-linear :inline) + (num-steps int8) + (step-delay time-frame) + (start-step-pos vector :inline) + (end-step-pos vector :inline) + (last-sync-val float) + (sound-idle sound-id) + ) + (:state-methods + idle + active + ) + (:methods + (sew-moving-step-b-method-22 (_type_ float) int) + (sew-moving-step-b-method-23 (_type_) float) + (sew-moving-step-b-method-24 (_type_) int) + (alloc-trsqv! (_type_) none) + (sew-moving-step-b-method-26 (_type_ int float) float) + ) + ) + +;; definition for method 3 of type sew-moving-step-b +(defmethod inspect ((this sew-moving-step-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tnum-steps: ~D~%" (-> this num-steps)) + (format #t "~2Tstep-delay: ~D~%" (-> this step-delay)) + (format #t "~2Tstart-step-pos: #~%" (-> this start-step-pos)) + (format #t "~2Tend-step-pos: #~%" (-> this end-step-pos)) + (format #t "~2Tlast-sync-val: ~f~%" (-> this last-sync-val)) + (format #t "~2Tsound-idle: ~D~%" (-> this sound-idle)) + (label cfg-4) + this + ) + +;; definition for method 25 of type sew-moving-step-b +;; WARN: Return type mismatch int vs none. +(defmethod alloc-trsqv! ((this sew-moving-step-b)) + (set! (-> this root) (new 'process 'trsqv)) + 0 + (none) + ) + +;; definition for method 11 of type sew-moving-step-b +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this sew-moving-step-b) (arg0 entity-actor)) + (alloc-trsqv! this) + (process-drawable-from-entity! this arg0) + (set! (-> this sound-idle) (new-sound-id)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-6 0)) + (if #f + (set! v1-6 (logior v1-6 1)) + ) + (set! (-> a1-3 sync-type) 'sync-linear) + (set! (-> a1-3 sync-flags) (the-as sync-flags v1-6)) + ) + (set! (-> a1-3 entity) arg0) + (set! (-> a1-3 period) (the-as uint 4800)) + (set! (-> a1-3 percent) 0.0) + (initialize! (-> this sync) a1-3) + ) + (set! (-> this num-steps) + (res-lump-value (-> this entity) 'sesc-num-steps int :default (the-as uint128 4) :time -1000000000.0) + ) + (set! (-> this step-delay) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'sesc-step-delay :default 4.0)))) + ) + (set! (-> this num-steps) (min (-> this num-steps) (sew-moving-step-b-method-24 this))) + (set! (-> this last-sync-val) (- 1.0 (* 0.5 (sew-moving-step-b-method-23 this)))) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) + ) + ((> (-> this sync period) 0) + (let ((s4-0 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (s5-3 (get-point-at-percent-along-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) + ) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s5-3 s4-0))) + (set! (-> s3-1 y) 0.0) + (vector-normalize! s3-1 16384.0) + (vector-! s4-0 s4-0 s3-1) + (vector-! s5-3 s5-3 s3-1) + ) + (set! (-> this start-step-pos quad) (-> s4-0 quad)) + (set! (-> this end-step-pos quad) (-> s5-3 quad)) + ) + (go (method-of-object this active)) + ) + (else + (go (method-of-object this idle)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (sew-moving-step-b) + :virtual #t + :code sleep-code + :post ja-post + ) + +;; definition for method 24 of type sew-moving-step-b +(defmethod sew-moving-step-b-method-24 ((this sew-moving-step-b)) + (the int (/ (the float (-> this sync period)) (the float (-> this step-delay)))) + ) + +;; definition for method 23 of type sew-moving-step-b +(defmethod sew-moving-step-b-method-23 ((this sew-moving-step-b)) + (/ (the float (-> this step-delay)) (the float (-> this sync period))) + ) + +;; definition for method 22 of type sew-moving-step-b +(defmethod sew-moving-step-b-method-22 ((this sew-moving-step-b) (arg0 float)) + (the int (/ arg0 (sew-moving-step-b-method-23 this))) + ) + +;; definition for method 26 of type sew-moving-step-b +(defmethod sew-moving-step-b-method-26 ((this sew-moving-step-b) (arg0 int) (arg1 float)) + (let ((f30-1 (- arg1 (* (the float arg0) (sew-moving-step-b-method-23 this))))) + (if (< f30-1 0.0) + (+! f30-1 (* (the float (-> this num-steps)) (sew-moving-step-b-method-23 this))) + ) + f30-1 + ) + ) + +;; definition of type sew-moving-step-b-step +(deftype sew-moving-step-b-step (base-plat) + ((start-pos vector :inline) + (end-pos vector :inline) + (start-path-pos vector :inline) + (end-path-pos vector :inline) + (sync sync-linear :inline) + (path-pos float) + (last-t-val float) + ) + (:state-methods + active + die + ) + ) + +;; definition for method 3 of type sew-moving-step-b-step +(defmethod inspect ((this sew-moving-step-b-step)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type base-plat inspect))) + (t9-0 this) + ) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Tend-pos: #~%" (-> this end-pos)) + (format #t "~2Tstart-path-pos: #~%" (-> this start-path-pos)) + (format #t "~2Tend-path-pos: #~%" (-> this end-path-pos)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tlast-t-val: ~f~%" (-> this last-t-val)) + (label cfg-4) + this + ) + +;; definition of type sew-moving-step-b-step-param +(deftype sew-moving-step-b-step-param (structure) + ((start-pos vector :inline) + (end-pos vector :inline) + (ent entity-actor) + (period time-frame) + (offset float) + ) + ) + +;; definition for method 3 of type sew-moving-step-b-step-param +(defmethod inspect ((this sew-moving-step-b-step-param)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sew-moving-step-b-step-param) + (format #t "~1Tstart-pos: #~%" (-> this start-pos)) + (format #t "~1Tend-pos: #~%" (-> this end-pos)) + (format #t "~1Tent: ~A~%" (-> this ent)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-moving-step-b sew-moving-step-b sew-moving-step-b-lod0-jg sew-moving-step-b-idle-ja + ((sew-moving-step-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +;; definition for function sew-moving-step-b-step-init-by-other +;; INFO: Used lq/sq +(defbehavior sew-moving-step-b-step-init-by-other sew-moving-step-b-step ((arg0 sew-moving-step-b-step-param)) + (process-entity-set! self (-> arg0 ent)) + (init-collision! self) + (set! (-> self root trans quad) (-> arg0 start-pos quad)) + (set! (-> self start-pos quad) (-> arg0 start-pos quad)) + (set! (-> self end-pos quad) (-> arg0 end-pos quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-moving-step-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) 16384.0) + (set! (-> self path) (new 'process 'path-control self 'path 0.0 (-> arg0 ent) #f)) + (get-point-at-percent-along-path! (-> self path) (-> self start-path-pos) 0.0 'interp) + (get-point-at-percent-along-path! (-> self path) (-> self end-path-pos) 1.0 'interp) + (let ((a1-7 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-16 0)) + (if #f + (set! v1-16 (logior v1-16 1)) + ) + (set! (-> a1-7 sync-type) 'sync-linear) + (set! (-> a1-7 sync-flags) (the-as sync-flags v1-16)) + ) + (set! (-> a1-7 entity) #f) + (set! (-> a1-7 period) (the-as uint (-> arg0 period))) + (set! (-> a1-7 percent) 0.0) + (initialize! (-> self sync) a1-7) + ) + (sync-now! (-> self sync) (-> arg0 offset)) + (set! (-> self last-t-val) -1.0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1497) self)) + (go-virtual active) + ) + +;; definition for function fmod +(defun fmod ((arg0 float) (arg1 float)) + (- arg0 (* (the float (the int (/ arg0 arg1))) arg1)) + ) + +;; definition for function spawn-moving-step-b-step +;; INFO: Used lq/sq +;; WARN: Return type mismatch process vs sew-moving-step-b-step. +(defun spawn-moving-step-b-step ((arg0 sew-moving-step-b) (arg1 float)) + (let ((gp-0 (new 'stack-no-clear 'sew-moving-step-b-step-param))) + (set! (-> gp-0 start-pos quad) (-> arg0 start-step-pos quad)) + (set! (-> gp-0 end-pos quad) (-> arg0 end-step-pos quad)) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 period) (the-as time-frame (-> arg0 sync period))) + (set! (-> gp-0 offset) arg1) + (let ((s5-0 (the-as process #f))) + (let ((v1-5 (process-spawn sew-moving-step-b-step gp-0 :name "sew-moving-step-b-step"))) + (if v1-5 + (set! s5-0 (-> v1-5 0)) + ) + ) + (the-as sew-moving-step-b-step s5-0) + ) + ) + ) + +;; definition for method 10 of type sew-moving-step-b +(defmethod deactivate ((this sew-moving-step-b)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-idle)) + (sound-stop (-> this sound-idle)) + ) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defstate active (sew-moving-step-b) + :virtual #t + :enter (behavior () + '() + ) + :trans (behavior () + (sound-play "move-step-b-lp" :id (-> self sound-idle)) + (let ((f30-0 (get-norm! (-> self sync) 0))) + (let* ((s5-0 (sew-moving-step-b-method-22 self (-> self last-sync-val))) + (gp-0 (- (sew-moving-step-b-method-22 self f30-0) s5-0)) + (f28-1 (fmod f30-0 (* (the float (-> self num-steps)) (sew-moving-step-b-method-23 self)))) + ) + (if (< gp-0 0) + (+! gp-0 (sew-moving-step-b-method-24 self)) + ) + (dotimes (s4-1 gp-0) + (set! s5-0 (mod (+ s5-0 1) (sew-moving-step-b-method-24 self))) + (if (< s5-0 (-> self num-steps)) + (spawn-moving-step-b-step self (sew-moving-step-b-method-26 self s5-0 f28-1)) + ) + ) + ) + (set! (-> self last-sync-val) f30-0) + ) + ) + :code sleep-code + ) + +;; definition for method 32 of type sew-moving-step-b-step +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this sew-moving-step-b-step)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 28 of type sew-moving-step-b-step +;; WARN: Return type mismatch int vs none. +(defmethod update-part-and-sfx! ((this sew-moving-step-b-step)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate die (sew-moving-step-b-step) + :virtual #t + :event (the-as (function process int symbol event-message-block object) eco-door-event-handler) + :code (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate active (sew-moving-step-b-step) + :virtual #t + :event plat-event + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (the-as time-frame (-> self sync period))) + (go-virtual die) + ) + (let ((f30-0 (get-norm! (-> self sync) 0))) + (if (< f30-0 (-> self last-t-val)) + (go-virtual die) + ) + (if (and (< (-> self last-t-val) 0.5) (>= f30-0 0.5)) + (sound-play "move-step-b-hit") + ) + (set! (-> self last-t-val) f30-0) + (cond + ((< f30-0 0.2) + (let ((f0-5 (* 5.0 f30-0))) + (vector-lerp! (-> self basetrans) (-> self start-pos) (-> self start-path-pos) f0-5) + ) + (spawn (-> self part) (-> self start-path-pos)) + ) + ((< 0.8 f30-0) + (let ((f0-8 (* 5.0 (+ -0.8 f30-0)))) + (vector-lerp! (-> self basetrans) (-> self end-path-pos) (-> self end-pos) f0-8) + ) + ) + (else + (let ((f28-0 (* 1.6666666 (+ -0.2 f30-0)))) + (set! (-> self path-pos) f28-0) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (let ((f0-12 (fmax 0.25 (fmin 1.0 (* 2.0 (- 1.0 f28-0)))))) + (set-vector! (-> self draw color-mult) f0-12 f0-12 f0-12 1.0) + ) + ) + (if (< f30-0 0.48) + (spawn (-> self part) (-> self basetrans)) + ) + ) + ) + ) + (plat-trans) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post plat-post + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-rove-plat sew-rove-plat sew-rove-plat-lod0-jg sew-rove-plat-idle-ja + ((sew-rove-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.5) + ) + +;; definition of type sew-rove-plat +(deftype sew-rove-plat (sew-plat-updown) + ((sound-id sound-id) + ) + ) + +;; definition for method 3 of type sew-rove-plat +(defmethod inspect ((this sew-rove-plat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type sew-plat-updown inspect))) + (t9-0 this) + ) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-4) + this + ) + +;; definition for method 37 of type sew-rove-plat +(defmethod get-skel ((this sew-rove-plat)) + (art-group-get-by-name *level* "skel-sew-rove-plat" (the-as (pointer level) #f)) + ) + +;; definition for method 12 of type sew-rove-plat +(defmethod run-logic? ((this sew-rove-plat)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 10 of type sew-rove-plat +(defmethod deactivate ((this sew-rove-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this sound-id)) + (call-parent-method this) + (none) + ) + +;; definition for method 32 of type sew-rove-plat +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this sew-rove-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) -15.5648 -3650.3552 0.8192 29212.262) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this sound-id) (new-sound-id)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (sew-rove-plat) + :virtual #t + :trans (behavior () + (sound-play "rove-plat-loop" :id (-> self sound-id)) + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (plat-trans) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-move-plat sew-move-plat sew-move-plat-lod0-jg sew-move-plat-idle-ja + ((sew-move-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 8) + ) + +;; definition of type sew-move-plat +(deftype sew-move-plat (base-plat) + ((sound-id sound-id) + (positions vector 2 :inline) + (current-pos-index int8) + (dest-pos-index int8) + (speed float) + ) + (:state-methods + waiting + active + ) + (:methods + (sew-move-plat-method-37 (_type_) int) + ) + ) + +;; definition for method 3 of type sew-move-plat +(defmethod inspect ((this sew-move-plat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type base-plat inspect))) + (t9-0 this) + ) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tpositions[2] @ #x~X~%" (-> this positions)) + (format #t "~2Tcurrent-pos-index: ~D~%" (-> this current-pos-index)) + (format #t "~2Tdest-pos-index: ~D~%" (-> this dest-pos-index)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate waiting (sew-move-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('bonk) + (go-virtual active) + ) + ) + (plat-event proc argc message block) + ) + :enter (behavior () + (set! (-> self basetrans quad) (-> self positions (-> self current-pos-index) quad)) + ) + :trans (behavior () + (plat-trans) + (if (> (-> self root num-riders) 0) + (go-virtual active) + ) + ) + :code sleep-code + :post (behavior () + (plat-post) + ) + ) + +;; definition for method 37 of type sew-move-plat +(defmethod sew-move-plat-method-37 ((this sew-move-plat)) + (let ((f30-0 (vector-vector-xz-distance-squared (target-pos 0) (the-as vector (-> this positions))))) + (logand (+ (-> this dest-pos-index) 1) 1) + (if (< f30-0 (vector-vector-xz-distance-squared (target-pos 0) (-> this positions 1))) + 0 + 1 + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (sew-move-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('foo) + (format 0 "FOo~%") + ) + ) + ) + :enter (behavior () + (set! (-> self dest-pos-index) (logand (+ (-> self current-pos-index) 1) 1)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (sound-play "move-plat-loop" :id (-> self sound-id)) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (if (>= (vector-vector-xz-distance (-> self basetrans) (target-pos 0)) 40960.0) + (set! (-> self dest-pos-index) (sew-move-plat-method-37 self)) + ) + (set-time! (-> self state-time)) + ) + (let ((gp-2 + (vector-! (new 'stack-no-clear 'vector) (-> self positions (-> self dest-pos-index)) (-> self basetrans)) + ) + ) + 0.0 + (let ((f0-2 (vector-normalize-ret-len! gp-2 1.0)) + (f1-2 (* 20480.0 (seconds-per-frame))) + ) + (cond + ((< f0-2 f1-2) + (set! (-> self current-pos-index) (-> self dest-pos-index)) + (sound-stop (-> self sound-id)) + (sound-play "move-plat-hit") + (go-virtual waiting) + ) + (else + (vector+float*! (-> self basetrans) (-> self basetrans) gp-2 f1-2) + (set! (-> self root trans quad) (-> self basetrans quad)) + ) + ) + ) + ) + (plat-trans) + ) + :code sleep-code + :post plat-post + ) + +;; definition for method 32 of type sew-move-plat +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this sew-move-plat)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable pull-rider-can-collide)) + (set! (-> s4-0 transform-index) 0) + (set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this sound-id) (new-sound-id)) + 0 + (none) + ) + +;; definition for method 11 of type sew-move-plat +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this sew-move-plat) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-move-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-5 param 0) 1.0) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! + a0-5 + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + num-func-loop! + ) + ) + (ja-post) + (set! (-> this current-pos-index) 0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (get-point-at-percent-along-path! (-> this path) (the-as vector (-> this positions)) 0.0 'interp) + (get-point-at-percent-along-path! (-> this path) (-> this positions 1) 1.0 'interp) + (set! (-> this basetrans quad) (-> this root trans quad)) + (set! (-> this current-pos-index) (sew-move-plat-method-37 this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this waiting)) + ) + +;; definition for method 10 of type sew-move-plat +(defmethod deactivate ((this sew-move-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 12 of type sew-move-plat +(defmethod run-logic? ((this sew-move-plat)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc new file mode 100644 index 0000000000..333ce317bd --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc @@ -0,0 +1,123 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sew-whirlpool +(deftype sew-whirlpool (process-drawable) + ((spool-sound-id sound-id) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type sew-whirlpool +(defmethod inspect ((this sew-whirlpool)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tspool-sound-id: ~D~%" (-> this spool-sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (sew-whirlpool) + :virtual #t + :trans (behavior () + (when (and *target* + (or (logtest? (water-flag touch-water) (-> *target* water flags)) + (logtest? (-> *target* control status) (collide-status on-water)) + ) + (not (logtest? (-> *target* focus-status) (focus-status grabbed))) + ) + (let* ((gp-0 (target-pos 0)) + (f30-0 (vector-vector-xz-distance (-> self root trans) gp-0)) + ) + (when (< f30-0 61440.0) + (let* ((f26-0 (* 0.000016276043 (- 61440.0 f30-0))) + (f24-0 98304.0) + (f0-6 (atan (- (-> gp-0 x) (-> self root trans x)) (- (-> gp-0 z) (-> self root trans z)))) + (f28-0 (* 0.5 f26-0 f24-0 (seconds-per-frame))) + (f22-0 (+ f0-6 f28-0)) + (f26-1 (- f30-0 (fmin f30-0 (* 0.16874999 f26-0 (fabs f24-0) (seconds-per-frame))))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! s5-0 (* (sin f22-0) f26-1) 0.0 (* (cos f22-0) f26-1) 1.0) + (vector+! s5-0 s5-0 (-> self root trans)) + (set! (-> s5-0 x) (* (- (-> s5-0 x) (-> gp-0 x)) (-> self clock frames-per-second))) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (* (- (-> s5-0 z) (-> gp-0 z)) (-> self clock frames-per-second))) + (let ((gp-1 (-> *target* control))) + (let ((s4-1 (new 'stack-no-clear 'collide-query))) + (send-event (-> gp-1 process) 'rotate-y-angle f28-0) + (set! (-> s4-1 collide-with) (-> gp-1 root-prim prim-core collide-with)) + (set! (-> s4-1 ignore-process0) self) + (set! (-> s4-1 ignore-process1) #f) + (set! (-> s4-1 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> s4-1 action-mask) (collide-action solid)) + (fill-cache-for-shape gp-1 8192.0 s4-1) + ) + (let ((s4-2 (-> gp-1 status))) + (integrate-and-collide! gp-1 s5-0) + (set! (-> gp-1 status) s4-2) + ) + ) + ) + (when (and (< f30-0 4096.0) (not (logtest? (-> *target* focus-status) (focus-status dead)))) + (set-action! + *gui-control* + (gui-action play) + (-> self spool-sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (sound-params-set! *gui-control* (-> self spool-sound-id) #f -1 -1 -1 0.5) + (send-event + *target* + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'drown-death) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 10 of type sew-whirlpool +(defmethod deactivate ((this sew-whirlpool)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 11 of type sew-whirlpool +(defmethod init-from-entity! ((this sew-whirlpool) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this spool-sound-id) + (add-process *gui-control* this (gui-channel gun) (gui-action queue) "whrlpool" -99.0 0) + ) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-frog_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-frog_REF.gc new file mode 100644 index 0000000000..7be18a6728 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-frog_REF.gc @@ -0,0 +1,1161 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-sewer-frog sewer-frog sewer-frog-lod0-jg -1 + ((sewer-frog-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow sewer-frog-shadow-mg + :origin-joint-index 19 + ) + +;; definition of type sewer-frog +(deftype sewer-frog (nav-enemy) + ((scared-timer time-frame) + ) + (:state-methods + attack + turn-to-face-focus + ) + (:methods + (sewer-frog-method-192 (_type_) none) + ) + ) + +;; definition for method 3 of type sewer-frog +(defmethod inspect ((this sewer-frog)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tscared-timer: ~D~%" (-> this scared-timer)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-sewer-frog-defaults*, type fact-info-enemy-defaults +(define *fact-info-sewer-frog-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +;; definition for symbol *sewer-frog-nav-enemy-info*, type nav-enemy-info +(define *sewer-frog-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 9 + :hostile-anim 5 + :hit-anim 17 + :knocked-anim 17 + :knocked-land-anim 3 + :die-anim 17 + :die-falling-anim 17 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 13 + :look-at-joint 14 + :bullseye-joint 4 + :sound-hit (static-sound-name "frog-hit") + :sound-die (static-sound-name "frog-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.96 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :orient-tform (new 'static 'vector :x 0.0676 :y -0.6016 :z 0.7959 :w 30666.041) + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd player-list) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.1444 :z 0.9894 :w 28642.4) + :geo-tform (new 'static 'vector :x 0.0925 :y -0.3416 :z 0.9349 :w 31829.453) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1984.512 + :hit-sound (static-sound-name "frog-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9735 :z -0.2274 :w 40103.246) + :geo-tform (new 'static 'vector :x 0.6954 :y -0.5427 :z 0.4701 :w 20942.34) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 2285.9775 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9656 :z -0.2587 :w 9536.927) + :geo-tform (new 'static 'vector :x 0.1274 :y -0.3552 :z 0.9257 :w 31935.02) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 2165.5552 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9743 :z -0.2249 :w 4085.8784) + :geo-tform (new 'static 'vector :x 0.1327 :y -0.1756 :z 0.9751 :w 32268.125) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1615.4624 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5322 :z 0.8462 :w 9507.29) + :geo-tform (new 'static 'vector :x 0.2871 :y 0.8561 :z 0.4289 :w 28150.988) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9435 :z -0.3305 :w 10984.38) + :geo-tform (new 'static 'vector :x -0.1293 :y 0.9912 :z -0.0126 :w 27502.092) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 318.6688 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint 13 + :pre-tform (new 'static 'vector :x -0.9599 :z 0.2795 :w 8485.092) + :geo-tform (new 'static 'vector :x 0.0847 :y 0.7561 :z 0.6485 :w 34826.777) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1267.3024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint 4 + :pre-tform (new 'static 'vector :x 0.2587 :z 0.9657 :w 16383.618) + :geo-tform (new 'static 'vector :x -0.0125 :y -0.0002 :z 0.9998 :w 15964.989) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9998 :z -0.0125 :w 16512.342) + :geo-tform (new 'static 'vector :x -0.4189 :y -0.8113 :z -0.4067 :w 18265.03) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.0273 :z -0.9994 :w 9645.098) + :geo-tform (new 'static 'vector :x 0.3147 :y -0.9196 :z 0.2348 :w 17491.832) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1064.96 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.0536 :z -0.9983 :w 10284.383) + :geo-tform (new 'static 'vector :y 1.0 :w 16905.375) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 363.3152 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.2587 :z -0.9657 :w 16384.346) + :geo-tform (new 'static 'vector :x -0.3909 :y 0.397 :z -0.8299 :w 18671.133) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7246 :z 0.6887 :w 16217.065) + :geo-tform (new 'static 'vector :x -0.1156 :y 0.9519 :z 0.2825 :w 24950.34) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.7086 :z 0.7052 :w 5922.1064) + :geo-tform (new 'static 'vector :x -0.3934 :y 0.2208 :z 0.8921 :w 31601.842) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1087.488 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.66 :z 0.7508 :w 11664.098) + :geo-tform (new 'static 'vector :y -1.0 :w 8004.1665) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 452.608 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.9763 :z -0.2153 :w 10854.364) + :geo-tform (new 'static 'vector :x -0.0517 :y 0.8422 :z -0.536 :w 34465.51) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1393.4592 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9814 :z -0.1916 :w 12053.145) + :geo-tform (new 'static 'vector :x 0.0117 :y 0.992 :z 0.1236 :w 34765.535) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1039.9744 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.2473 :z 0.9686 :w 14074.312) + :geo-tform (new 'static 'vector :x 0.4625 :y 0.8439 :z 0.2713 :w 24201.445) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8453 :z -0.5342 :w 10724.566) + :geo-tform (new 'static 'vector :x -0.4236 :y -0.3812 :z 0.8213 :w 36821.477) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.5795 :z 0.8146 :w 41836.6) + :geo-tform (new 'static 'vector :x -0.3352 :y 0.2062 :z 0.9189 :w 30666.19) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1061.6832 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6926 :z 0.721 :w 27957.91) + :geo-tform (new 'static 'vector :x -0.148 :y 0.9414 :z 0.302 :w 23747.88) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 562.7904 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint 19 + :pre-tform (new 'static 'vector :x -0.1352 :z -0.9905 :w 14070.961) + :geo-tform (new 'static 'vector :x 0.304 :y -0.8482 :z -0.4328 :w 20045.35) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9968 :z -0.0763 :w 9360.489) + :geo-tform (new 'static 'vector :x 0.5934 :y -0.3585 :z 0.7204 :w 26778.32) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 806.5024 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.1915 :z 0.9814 :w 23136.174) + :geo-tform (new 'static 'vector :x 0.4151 :y 0.3163 :z 0.8526 :w 36129.96) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 1043.2512 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.5995 :z 0.8 :w 40254.598) + :geo-tform (new 'static 'vector :x 0.1548 :y 0.9404 :z 0.3018 :w 42156.035) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 652.0832 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint 14 + :pre-tform (new 'static 'vector :x 0.0201 :z -0.9995 :w 9496.604) + :geo-tform (new 'static 'vector :x 0.4419 :y -0.494 :z 0.7483 :w 35945.93) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 547.6352 + :hit-sound (static-sound-name "frog-rgdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9733 :z -0.2282 :w 11187.232) + :geo-tform (new 'static 'vector :x 0.5046 :y 0.0354 :z 0.8622 :w 30183.021) + :axial-slop 1939.356 + :max-angle 4553.2773 + :coll-rad 349.3888 + :hit-sound (static-sound-name "frog-rgdoll") + ) + ) + ) + :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) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim -1 + :run-anim 5 + :taunt-anim 3 + :run-travel-speed (meters 11.6667) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 0.5) + :walk-travel-speed (meters 5) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 0.2) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :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! (-> *sewer-frog-nav-enemy-info* fact-defaults) *fact-info-sewer-frog-defaults*) + +;; definition for method 120 of type sewer-frog +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this sewer-frog)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (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 enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle 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 4915.2 0.0 10240.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 enemy)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-13 transform-index) 4) + (set-vector! (-> v1-13 local-sphere) 0.0 0.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 enemy)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd jak bot obstacle hit-by-others-list player-list pusher) + ) + (set! (-> v1-15 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-15 transform-index) 18) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 1228.8) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-17 transform-index) 14) + (set-vector! (-> v1-17 local-sphere) 0.0 409.6 1228.8 4096.0) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-19 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function sewer-frog-hop +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior sewer-frog-hop sewer-frog () + (let ((a1-0 (-> self nav state)) + (a0-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-0 quad) (-> a1-0 target-pos quad)) + (let* ((f0-0 (vector-vector-xz-distance a0-0 (-> self root trans))) + (gp-0 (-> self enemy-info)) + (f30-0 (lerp-scale 0.0 1.0 f0-0 12288.0 28672.0)) + (f28-0 1.0) + ) + (let ((s5-0 (-> self nav))) + (set! (-> s5-0 target-speed) (lerp (-> gp-0 walk-travel-speed) (-> gp-0 run-travel-speed) f30-0)) + ) + 0 + (let ((s5-1 (-> self nav))) + (set! (-> s5-1 acceleration) (lerp (-> gp-0 walk-acceleration) (-> gp-0 run-acceleration) f30-0)) + ) + 0 + (let ((v1-6 (-> self nav))) + (set! (-> v1-6 turning-acceleration) (-> gp-0 run-turning-acceleration)) + ) + 0 + (ja-channel-push! 2 (seconds 0.01)) + (ja-no-eval :group! sewer-frog-hop-small-start-ja :num! (seek! max f28-0) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! sewer-frog-hop0-start-ja + :num! (chan 0) + :frame-interp0 f30-0 + :frame-interp1 f30-0 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (let ((a0-7 (-> self skel root-channel 0))) + (let ((f0-14 (- 1.0 f30-0))) + (set! (-> a0-7 frame-interp 1) f0-14) + (set! (-> a0-7 frame-interp 0) f0-14) + ) + (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group frames num-frames) -1))) + (set! (-> a0-7 param 1) f28-0) + (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! sewer-frog-hop-small-end-ja :num! (seek! max f28-0) :frame-num 0.0) + (ja-no-eval :chan 1 + :group! sewer-frog-hop0-end-ja + :num! (chan 0) + :frame-interp0 f30-0 + :frame-interp1 f30-0 + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (let ((a0-13 (-> self skel root-channel 0))) + (let ((f0-24 (- 1.0 f30-0))) + (set! (-> a0-13 frame-interp 1) f0-24) + (set! (-> a0-13 frame-interp 0) f0-24) + ) + (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group frames num-frames) -1))) + (set! (-> a0-13 param 1) f28-0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!) + ) + (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sewer-frog-turn-to-face +;; WARN: Return type mismatch int vs none. +(defbehavior sewer-frog-turn-to-face sewer-frog ((arg0 vector)) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root trans))) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (gp-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (vector-normalize-copy! s4-0 s2-1 1.0) + (let* ((f0-1 (vector-dot s4-0 s3-0)) + (f30-0 (vector-dot s4-0 gp-0)) + (gp-1 (the int (+ 0.5 (* 0.00012207031 (acos f0-1))))) + ) + (cond + ((>= (the-as uint gp-1) (the-as uint 3)) + (ja-channel-push! 1 (seconds 0.08)) + (dotimes (s4-1 (+ (shr gp-1 2) 1)) + (cond + ((< 0.0 f30-0) + (ja-no-eval :group! sewer-frog-turn-left-180-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-to-point-toward-point! (-> self root) arg0 49152.0 (seconds 0.02)) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! sewer-frog-turn-right-180-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (seek-to-point-toward-point! (-> self root) arg0 49152.0 (seconds 0.02)) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ((> (the-as uint gp-1) 0) + (ja-channel-push! 1 (seconds 0.1)) + (dotimes (s5-1 (+ gp-1 1)) + (cond + ((< 0.0 f30-0) + (ja-no-eval :group! sewer-frog-turn-left-45-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 20480.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-no-eval :group! sewer-frog-turn-right-45-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* -20480.0 (seconds-per-frame))) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate turn-to-face-focus (sewer-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-182 self) + (nav-enemy-method-184 self) + (set-look-at-mode! self 1) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (sewer-frog-turn-to-face (-> self focus-pos)) + (go-stare self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate active (sewer-frog) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-182 self) + ) + :trans #f + :code (behavior () + (until #f + (when (or (logtest? (-> self nav state flags) (nav-state-flag at-target)) (nav-enemy-method-174 self)) + (nav-enemy-method-164 self) + (nav-enemy-method-173 self) + ) + (let ((t9-3 sewer-frog-turn-to-face) + (a1-0 (-> self nav state)) + (a0-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-3 quad) (-> a1-0 target-pos quad)) + (t9-3 a0-3) + ) + ((-> (method-of-type nav-enemy active) trans)) + (nav-enemy-method-181 self) + (sewer-frog-hop) + (nav-enemy-method-182 self) + (let ((gp-0 (the int (* 300.0 (rnd-float-range self 1.0 3.0))))) + (ja-channel-push! 1 (seconds 0.2)) + (let ((s5-0 (current-time)) + (f30-1 1.0) + ) + (ja-no-eval :group! sewer-frog-idle0-ja :num! (loop! f30-1) :frame-num 0.0) + (until (time-elapsed? s5-0 gp-0) + ((-> (method-of-type nav-enemy active) trans)) + (suspend) + (ja :num! (loop! f30-1)) + ) + ) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate stare (sewer-frog) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-184 self) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) + (not (enemy-method-104 self (-> self focus-pos) 10012.444)) + ) + (go-virtual turn-to-face-focus) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (sewer-frog) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag alert)) + (let ((t9-0 (-> (method-of-type nav-enemy hostile) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-184 self) + (nav-enemy-method-182 self) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.12)) + (let ((gp-0 (current-time)) + (s5-0 60) + (f30-0 1.0) + ) + (ja-no-eval :group! sewer-frog-idle0-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-0 s5-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + (sewer-frog-method-192 self) + (until #f + (let ((t9-4 sewer-frog-turn-to-face) + (a1-3 (-> self nav state)) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (t9-4 a0-4) + ) + (sewer-frog-method-192 self) + (nav-enemy-method-181 self) + (sewer-frog-hop) + (nav-enemy-method-182 self) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate attack (sewer-frog) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (nav-enemy-method-181 self) + (nav-enemy-method-184 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-0 (-> self enemy-info))) + (nav-enemy-method-178 self) + (ja-no-eval :group! sewer-frog-attack0-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((v1-26 (-> self nav))) + (set! (-> v1-26 target-speed) 122880.0) + ) + 0 + (let ((v1-28 (-> self nav))) + (set! (-> v1-28 acceleration) (-> gp-0 run-acceleration)) + ) + 0 + (let ((v1-30 (-> self nav))) + (set! (-> v1-30 turning-acceleration) (-> gp-0 run-turning-acceleration)) + ) + ) + 0 + (let* ((a0-6 (-> self root root-prim)) + (v1-34 (-> (the-as collide-shape-prim-group a0-6) child 2)) + ) + (+! (-> a0-6 local-sphere w) 4096.0) + (set! (-> v1-34 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-34 prim-core collide-with) (collide-spec jak bot player-list)) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (ja-no-eval :group! sewer-frog-attack0-mid-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (if (logtest? (-> self water flags) (water-flag active)) + (spawn-ripples (-> self water) 1.0 (-> self root trans) 1 *null-vector* #f) + ) + (let* ((v1-69 (-> self root root-prim)) + (a0-14 (-> (the-as collide-shape-prim-group v1-69) child 2)) + ) + (+! (-> v1-69 local-sphere w) -4096.0) + (set! (-> a0-14 prim-core collide-as) (collide-spec)) + (set! (-> a0-14 prim-core collide-with) (collide-spec)) + ) + 0 + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (nav-enemy-method-178 self) + (ja-no-eval :group! sewer-frog-attack0-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 3.8 5.6))))) + (go-best-state self) + ) + :post nav-enemy-chase-post + ) + +;; definition for function sewer-frog-check-hop +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior sewer-frog-check-hop sewer-frog () + (let ((a1-0 (new 'stack-no-clear 'vector))) + (set! (-> a1-0 quad) (-> self move-dest quad)) + (set! (-> a1-0 w) (-> self nav-radius-backup)) + (if (add-root-sphere-to-hash! (-> self nav) a1-0 #x100068) + (go-virtual stare) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate flee (sewer-frog) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (nav-enemy-method-182 self) + (ja-channel-push! 1 (seconds 0.12)) + (let ((gp-0 (current-time)) + (s5-0 60) + (f30-0 1.0) + ) + (ja-no-eval :group! sewer-frog-idle0-ja :num! (loop! f30-0) :frame-num 0.0) + (until (time-elapsed? gp-0 s5-0) + (suspend) + (ja :num! (loop! f30-0)) + ) + ) + ((-> (method-of-type nav-enemy flee) trans)) + (until #f + (let ((t9-5 sewer-frog-turn-to-face) + (a1-3 (-> self nav state)) + (a0-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (t9-5 a0-4) + ) + ((-> (method-of-type nav-enemy flee) trans)) + (sewer-frog-check-hop) + (nav-enemy-method-181 self) + (sewer-frog-hop) + (nav-enemy-method-182 self) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate knocked (sewer-frog) + :virtual #t + :post (behavior () + (let ((v1-1 (handle->process (-> self ragdoll-proc)))) + (when v1-1 + (if (< 0.0 (-> self root transv y)) + (logior! (-> (the-as ragdoll-proc v1-1) ragdoll ragdoll-flags) (ragdoll-flag rf11)) + (logtest? (-> (the-as ragdoll-proc v1-1) ragdoll ragdoll-flags) (ragdoll-flag rf11)) + ) + ) + ) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + ) + ) + +;; definition for method 167 of type sewer-frog +;; WARN: Return type mismatch symbol vs vector. +(defmethod nav-enemy-method-167 ((this sewer-frog)) + (let ((a0-2 (handle->process (-> this focus handle))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (the-as + vector + (when (and a0-2 (nav-enemy-method-166 this s5-0 (get-trans (the-as process-focusable a0-2) 0))) + (set! (-> s5-0 w) (-> this nav-radius-backup)) + (not (add-root-sphere-to-hash! (-> this nav) s5-0 #x100068)) + ) + ) + ) + ) + +;; definition for method 76 of type sewer-frog +(defmethod go-stare2 ((this sewer-frog)) + (if (not (enemy-method-104 this (-> this focus-pos) 6371.5557)) + (go (method-of-object this turn-to-face-focus)) + (go (method-of-object this stare)) + ) + ) + +;; definition for method 192 of type sewer-frog +;; WARN: Return type mismatch int vs none. +(defmethod sewer-frog-method-192 ((this sewer-frog)) + ((-> (method-of-type nav-enemy hostile) trans)) + (let* ((a0-1 (-> this focus-pos)) + (v1-3 (vector-! (new 'stack-no-clear 'vector) a0-1 (-> this root trans))) + (f0-4 (sqrtf (+ (* (-> v1-3 x) (-> v1-3 x)) (* (-> v1-3 z) (-> v1-3 z))))) + ) + (when (< f0-4 40960.0) + (if (< 12288.0 f0-4) + (go (method-of-object this attack)) + (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 1.8 3.6))))) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 125 of type sewer-frog +(defmethod ragdoll-settled? ((this sewer-frog)) + (let ((a0-2 (handle->process (-> this ragdoll-proc)))) + (or (not a0-2) + (ragdoll-proc-method-19 (the-as ragdoll-proc a0-2)) + (time-elapsed? (-> this state-time) (seconds 5)) + ) + ) + ) + +;; definition for method 108 of type sewer-frog +;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod enemy-method-108 ((this sewer-frog) (arg0 process-focusable)) + (or (< (current-time) (-> this scared-timer)) + (let ((v1-4 (handle->process (-> this focus handle)))) + (if v1-4 + (and (focus-test? (the-as process-focusable v1-4) disable dead ignore grabbed) + (< (vector-vector-xz-distance (-> this focus-pos) (-> this root trans)) 163840.0) + ) + #f + ) + ) + ) + ) + +;; definition for method 146 of type sewer-frog +(defmethod play-damage-sound ((this sewer-frog) (arg0 int)) + (case arg0 + ((2) + (if (and (-> this next-state) (= (-> this next-state name) 'knocked)) + (sound-play "frog-splash") + (sound-play "frog-waterhop") + ) + ) + (else + ((method-of-type nav-enemy play-damage-sound) this arg0) + ) + ) + ) + +;; definition for method 59 of type sewer-frog +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this sewer-frog)) + (when (< 1 (the-as int (-> this focus aware))) + (let ((a0-3 (handle->process (-> this focus handle)))) + (if a0-3 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-3) 3) quad)) + ) + ) + ) + (water-control-method-10 (-> this water)) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 82 of type sewer-frog +(defmethod event-handler ((this sewer-frog) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 121 of type sewer-frog +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this sewer-frog)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sewer-frog" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *sewer-frog-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 0 4096.0 8192.0 2048.0)) + (set! (-> this water flags) + (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) + ) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (let ((v1-10 (make-u128 (the-as uint #x706f687265) (the-as uint #x7461772d676f7266)))) + (set! (-> this water enter-water-sound) (the-as sound-name v1-10)) + ) + (let ((v1-11 (-> this neck))) + (set! (-> v1-11 up) (the-as uint 1)) + (set! (-> v1-11 nose) (the-as uint 2)) + (set! (-> v1-11 ear) (the-as uint 0)) + (set-vector! (-> v1-11 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-11 ignore-angle) 30947.555) + ) + (set! (-> this scared-timer) 0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-mood_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-mood_REF.gc new file mode 100644 index 0000000000..bf7f25f850 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-mood_REF.gc @@ -0,0 +1,487 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sewa-states +(deftype sewa-states (structure) + () + ) + +;; definition for method 3 of type sewa-states +(defmethod inspect ((this sewa-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sewa-states) + (label cfg-4) + this + ) + +;; definition for function update-sewer-lights +;; WARN: Return type mismatch vector vs none. +(defun update-sewer-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (let ((a1-0 (-> v1-0 0))) + (set! (-> a1-0 dir0 direction x) -0.372) + (set! (-> a1-0 dir0 direction y) 0.853) + (set! (-> a1-0 dir0 direction z) 0.363) + (set! (-> a1-0 dir0 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 0.65 0.855 0.82 1.0) + (let ((a1-2 (-> v1-0 0 dir1))) + (set! (-> a1-2 direction x) 0.372) + (set! (-> a1-2 direction y) 0.853) + (set! (-> a1-2 direction z) -0.363) + (set! (-> a1-2 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir1 color) 0.65 0.855 0.82 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.627 0.718 1.0 1.0) + (set! (-> v1-0 0 dir0 extra x) 0.85) + (set! (-> v1-0 0 dir1 extra x) 0.3) + (set! (-> v1-0 0 dir2 extra x) 0.0) + (set! (-> v1-0 0 ambi extra x) 0.3) + ) + (let ((v1-2 (-> arg0 current-fog))) + (set! (-> v1-2 fog-color x) 150.0) + (set! (-> v1-2 fog-color y) 165.0) + (set! (-> v1-2 fog-color z) 220.0) + (set! (-> v1-2 fog-color w) 128.0) + ) + (set-vector! (-> arg0 current-fog fog-dists) 2048000.0 12288000.0 255.0 150.0) + (none) + ) + +;; definition for function update-mood-sewa +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewa time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type sewb-states +(deftype sewb-states (structure) + ((pulse pulse-state :inline) + ) + ) + +;; definition for method 3 of type sewb-states +(defmethod inspect ((this sewb-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sewb-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (label cfg-4) + this + ) + +;; definition for function init-mood-sewb +(defun init-mood-sewb ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-2 1.0)) + (set! (-> v1-0 3) (the-as uint f0-2)) + f0-2 + ) + ) + ) + +;; definition for function update-mood-sewb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (update-mood-pulse arg0 7 0 1.0 0.25 (* 65536.0 (seconds-per-frame)) 0.0) + ) + ) + 0 + (none) + ) + +;; definition of type sewc-states +(deftype sewc-states (structure) + ((pulse pulse-state :inline) + (electricity electricity-state :inline) + (rot float) + ) + ) + +;; definition for method 3 of type sewc-states +(defmethod inspect ((this sewc-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sewc-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (format #t "~1Telectricity: #~%" (-> this electricity)) + (format #t "~1Trot: ~f~%" (-> this rot)) + (label cfg-4) + this + ) + +;; definition for function init-mood-sewc +(defun init-mood-sewc ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 5) (the-as uint 1.0)) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-3 1.0)) + (set! (-> v1-0 3) (the-as uint f0-3)) + f0-3 + ) + ) + ) + +;; definition for function update-mood-sewc +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewc-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 2 16 0.8 1.0) + (update-mood-pulse arg0 3 0 1.0 0.25 (* 87381.336 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type sewd-states +(deftype sewd-states (structure) + ((pulse pulse-state :inline) + (electricity electricity-state :inline) + (rot float) + ) + ) + +;; definition for method 3 of type sewd-states +(defmethod inspect ((this sewd-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sewd-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (format #t "~1Telectricity: #~%" (-> this electricity)) + (format #t "~1Trot: ~f~%" (-> this rot)) + (label cfg-4) + this + ) + +;; definition for function init-mood-sewd +(defun init-mood-sewd ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 5) (the-as uint 0.0)) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 2) (the-as uint 1.0)) + (let ((f0-3 1.0)) + (set! (-> v1-0 3) (the-as uint f0-3)) + f0-3 + ) + ) + ) + +;; definition for function update-mood-sewd +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewd time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewd-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 2 16 0.8 1.0) + (update-mood-pulse arg0 3 0 1.0 0.25 (* 87381.336 (seconds-per-frame)) 0.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-sewd-light! +;; WARN: Return type mismatch float vs none. +(defun set-sewd-light! ((arg0 float)) + (let ((v1-1 (level-get *level* 'sewd))) + (when (and v1-1 (= (-> v1-1 status) 'active)) + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 5) (the-as uint arg0)) + ) + ) + ) + (none) + ) + +;; definition of type sewg-states +(deftype sewg-states (structure) + ((electricity electricity-state 2 :inline) + (rot float :offset 32) + ) + ) + +;; definition for method 3 of type sewg-states +(defmethod inspect ((this sewg-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sewg-states) + (format #t "~1Telectricity[2] @ #x~X~%" (-> this electricity)) + (format #t "~1Trot: ~f~%" (-> this rot)) + (label cfg-4) + this + ) + +;; definition for function init-mood-sewg +(defun init-mood-sewg ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 1) (the-as uint 1.0)) + (let ((f0-1 1.0)) + (set! (-> v1-0 5) (the-as uint f0-1)) + f0-1 + ) + ) + ) + +;; definition for function update-mood-sewg +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewg time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewg-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-electricity arg0 2 0 1.2 1.7) + (update-mood-electricity arg0 3 16 1.2 1.7) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-sewg-electricity-scale! +;; WARN: Return type mismatch int vs none. +(defun set-sewg-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'sewg))) + (when v1-1 + (let ((v1-2 (the-as sewg-states (-> v1-1 mood-context state)))) + (set! (-> (the-as sewg-states (+ (the-as uint v1-2) (* arg1 16))) electricity 0 scale) arg0) + ) + ) + ) + 0 + (none) + ) + +;; definition of type sewh-states +(deftype sewh-states (structure) + ((electricity electricity-state 5 :inline) + (turret-value float :offset 80) + ) + ) + +;; definition for method 3 of type sewh-states +(defmethod inspect ((this sewh-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sewh-states) + (format #t "~1Telectricity[5] @ #x~X~%" (-> this electricity)) + (format #t "~1Tturret-value: ~f~%" (-> this turret-value)) + (label cfg-4) + this + ) + +;; definition for function init-mood-sewh +(defun init-mood-sewh ((arg0 mood-context)) + (let ((v1-0 (-> arg0 state))) + (set! (-> v1-0 1) (the-as uint 1.0)) + (set! (-> v1-0 5) (the-as uint 1.0)) + (set! (-> v1-0 9) (the-as uint 1.0)) + (set! (-> v1-0 13) (the-as uint 1.0)) + (let ((f0-4 1.0)) + (set! (-> v1-0 17) (the-as uint f0-4)) + f0-4 + ) + ) + ) + +;; definition for function update-mood-sewh +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewh time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewh-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 2 0 1.2 1.7) + (update-mood-electricity arg0 3 16 1.2 1.7) + (update-mood-electricity arg0 5 48 1.2 1.7) + (update-mood-electricity arg0 6 64 1.2 1.7) + (set! (-> arg0 times 7 w) (-> gp-0 turret-value)) + (if (not (paused?)) + (set! (-> gp-0 turret-value) (fmax 0.0 (+ -0.1 (-> gp-0 turret-value)))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-sewh-electricity-scale! +;; WARN: Return type mismatch int vs none. +(defun set-sewh-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'sewh))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as sewh-states (+ (the-as uint v1-2) (* arg1 16))) electricity 0 scale) arg0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-sewh-turret-flash! +;; WARN: Return type mismatch float vs none. +(defun set-sewh-turret-flash! () + (let ((v1-1 (level-get *level* 'sewh))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 20) (the-as uint 1.2)) + ) + ) + ) + (none) + ) + +;; definition of type sewj-states +(deftype sewj-states (structure) + ((rot float) + ) + ) + +;; definition for method 3 of type sewj-states +(defmethod inspect ((this sewj-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sewj-states) + (format #t "~1Trot: ~f~%" (-> this rot)) + (label cfg-4) + this + ) + +;; definition for function update-mood-sewj +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewj time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-sewer-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as sewj-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (update-mood-caustics arg0 5 (-> gp-0 rot) 0.0 0.66 0.4) + (update-mood-caustics arg0 6 (-> gp-0 rot) 21845.334 0.66 0.4) + (update-mood-caustics arg0 7 (-> gp-0 rot) 43690.668 0.66 0.4) + (if (not (paused?)) + (+! (-> gp-0 rot) (* 65536.0 (seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc new file mode 100644 index 0000000000..f0583a5b83 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc @@ -0,0 +1,596 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sew-move-turret +(deftype sew-move-turret (process-drawable) + ((sound-id sound-id) + (use-doppler? symbol) + ) + (:state-methods + idle + active + ) + (:methods + (sew-move-turret-method-22 (_type_ int) none) + ) + ) + +;; definition for method 3 of type sew-move-turret +(defmethod inspect ((this sew-move-turret)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tuse-doppler?: ~A~%" (-> this use-doppler?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-move-turret sew-move-turret sew-move-turret-lod0-jg sew-move-turret-idle-ja + ((sew-move-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +;; failed to figure out what this is: +(defstate idle (sew-move-turret) + :virtual #t + :trans (behavior () + (let ((f30-0 (vector-vector-distance (-> self root trans) (target-pos 0))) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-1 (target-pos 0) (-> self root trans)) + (let ((f0-1 (vector-dot gp-1 (-> self node-list data 5 bone transform fvec))) + (f1-2 (fabs (vector-dot gp-1 (the-as vector (-> self node-list data 5 bone transform))))) + ) + (if (and (< 4096.0 f0-1) (>= 81920.0 f1-2) (< f30-0 450560.0)) + (go-virtual active) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate active (sew-move-turret) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('use-doppler?) + (-> self use-doppler?) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self use-doppler?) #f) + ) + :trans (behavior () + (let ((f30-0 (vector-vector-distance (-> self root trans) (target-pos 0))) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-1 (target-pos 0) (-> self root trans)) + (let ((f0-1 (vector-dot gp-1 (-> self node-list data 5 bone transform fvec))) + (f1-2 (fabs (vector-dot gp-1 (the-as vector (-> self node-list data 5 bone transform))))) + ) + (when (or (>= 0.0 f0-1) (< 81920.0 f1-2) (>= f30-0 450560.0)) + (if (nonzero? (-> self sound-id)) + (sound-stop (-> self sound-id)) + ) + (go-virtual idle) + ) + ) + ) + (logior! (-> self skel status) (joint-control-status sync-math)) + ) + :code (behavior () + (until #f + (sound-play "turret-move-lp" :id (-> self sound-id)) + (let ((f30-0 -10.0)) + (until (ja-done? 0) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) + (let ((f28-0 (ja-frame-num 0))) + (let ((v1-6 #f)) + (if (or (and (< f30-0 23.0) (>= f28-0 23.0)) (and (< f30-0 67.0) (>= f28-0 67.0))) + (set! v1-6 #t) + ) + (set! (-> self use-doppler?) v1-6) + ) + (set-time! (-> self state-time)) + (sound-play "turret-gun-fire") + (sew-move-turret-method-22 self 5) + (set! f30-0 f28-0) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + (ja-no-eval :group! sew-move-turret-move-shoot-ja :num! (seek!) :frame-num 0.0) + ) + #f + ) + :post transform-post + ) + +;; definition for method 22 of type sew-move-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod sew-move-turret-method-22 ((this sew-move-turret) (arg0 int)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform fvec quad)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) + (let ((f0-0 (ja-frame-num 0))) + (cond + ((< f0-0 45.0) + (let ((f1-1 1228.8)) + (cond + ((< f0-0 5.0) + (set! f1-1 (* 0.2 f0-0 f1-1)) + ) + ((< 40.0 f0-0) + (set! f1-1 (* 0.2 (- 45.0 f0-0) f1-1)) + ) + ) + (vector+float*! s4-0 s4-0 (the-as vector (-> this node-list data arg0 bone transform)) f1-1) + ) + ) + (else + (let ((f1-2 -1228.8)) + (cond + ((< f0-0 50.0) + (set! f1-2 (* 0.2 (+ -45.0 f0-0) f1-2)) + ) + ((< 85.0 f0-0) + (set! f1-2 (* 0.2 (- 90.0 f0-0) f1-2)) + ) + ) + (vector+float*! s4-0 s4-0 (the-as vector (-> this node-list data arg0 bone transform)) f1-2) + ) + ) + ) + ) + (vector-normalize! s5-0 40960.0) + (spawn-sew-move-turret-projectile + this + s4-0 + (vector+! (new 'stack-no-clear 'vector) s4-0 s5-0) + 122880.0 + (the-as vector #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type sew-move-turret +(defmethod init-from-entity! ((this sew-move-turret) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 12288.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-9 transform-index) 4) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-11 transform-index) 3) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 12288.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> s4-0 penetrated-by) (penetrate)) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-move-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-23 (-> this skel root-channel 0))) + (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + ) + (set! (-> this sound-id) (new-sound-id)) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition for method 10 of type sew-move-turret +(defmethod deactivate ((this sew-move-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + ) + (call-parent-method this) + (none) + ) + +;; definition of type sew-move-turret-shot +(deftype sew-move-turret-shot (guard-shot) + ((doppler-sound sound-id) + (use-doppler? symbol) + ) + ) + +;; definition for method 3 of type sew-move-turret-shot +(defmethod inspect ((this sew-move-turret-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 this) + ) + (format #t "~2Tdoppler-sound: ~D~%" (-> this doppler-sound)) + (format #t "~2Tuse-doppler?: ~A~%" (-> this use-doppler?)) + (label cfg-4) + this + ) + +;; definition for function sew-turret-shot-move +;; WARN: Return type mismatch int vs none. +(defun sew-turret-shot-move ((arg0 sew-move-turret-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (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 (< 16384.0 f0-0) + (vector-normalize! s4-0 16384.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 4940 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0) + (:b 0.0) + (:a 255.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 4941 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0.3)) + (:scale-x (meters 0.9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0) + (:b 0.0) + (:a 255.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 4942 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2) (meters 1)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 64.0 128.0) + (:b 32.0) + (:a 128.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4943 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-move-turret-hit-object + :id 1506 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4944 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4945 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-move-turret-hit + :id 1507 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4944 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4945 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4946 :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4946 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.75) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 16.0 48.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:scalevel-x (meters 0.0016666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.30476192) + (:fade-g 0.15238096) + (:fade-b 0.30476192) + (:fade-a -0.15238096) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 1.4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4944 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.026666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.2) + (:fade-b -6.375) + (:fade-a -2.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; definition for method 25 of type sew-move-turret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this sew-move-turret-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((a1-0 (-> this root trans)) + (v1-1 (-> this tail-pos)) + (a0-2 (vector-! (new 'stack-no-clear 'vector) a1-0 v1-1)) + ) + (vector-length a0-2) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((a1-4 0.8)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> a0-2 quad)) + (.lvf vf4 (&-> v1-1 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) + (launch-particles (-> *part-id-table* 4940) gp-0) + (launch-particles (-> *part-id-table* 4941) gp-0) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 24 of type sew-move-turret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this sew-move-turret-shot)) + (draw-beam (-> *part-id-table* 4942) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((v1-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (gp-1 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) v1-1)) + ) + (set-sewh-turret-flash!) + (launch-particles (-> *part-id-table* 4943) gp-1) + ) + 0 + (none) + ) + +;; definition for method 26 of type sew-move-turret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this sew-move-turret-shot)) + (let* ((s4-0 (-> this root)) + (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector+! gp-0 gp-0 v1-1) + (cond + ((-> this hit-actor?) + (sound-play "bullet-hit-jak") + (cond + ((logtest? (-> *part-group-id-table* 1506 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1506)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1506)) + ) + ) + ) + ((begin (sound-play "bullet-ricco") (logtest? (-> *part-group-id-table* 1507 flags) (sp-group-flag sp13))) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1507)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1507)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function spawn-sew-move-turret-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer sew-move-turret-shot). +(defun spawn-sew-move-turret-projectile ((arg0 sew-move-turret) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 40960.0) + ) + (the-as (pointer sew-move-turret-shot) (spawn-projectile sew-move-turret-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; definition for method 31 of type sew-move-turret-shot +;; WARN: Return type mismatch (function sew-move-turret-shot none) vs none. +(defmethod init-proj-settings! ((this sew-move-turret-shot)) + (call-parent-method this) + (set! (-> this doppler-sound) (new-sound-id)) + (set! (-> this use-doppler?) (the-as symbol (send-event (ppointer->process (-> this parent)) 'use-doppler?))) + (set! (-> this max-speed) 163840.0) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 (/ 819200.0 (-> this max-speed)))))) + (set! (-> this move) sew-turret-shot-move) + (none) + ) + +;; definition for method 28 of type sew-move-turret-shot +;; WARN: Return type mismatch object vs none. +(defmethod play-impact-sound ((this sew-move-turret-shot) (arg0 projectile-options)) + (cond + ((and (= arg0 3) (-> this use-doppler?)) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (target-pos 0)))) + 0.0 + (let ((s4-1 (< 0.0 (vector-dot s5-2 (-> this root transv)))) + (f0-2 (vector-normalize-ret-len! s5-2 1.0)) + ) + (if (or (and s4-1 (< f0-2 40960.0)) (and (not s4-1) (< f0-2 102400.0))) + (sound-play-by-name + (static-sound-name "bullet-by-loop") + (-> this doppler-sound) + 1024 + (the int + (* 1524.0 (fmax -0.08 (fmin 1.0 (* 0.5 (doppler-pitch-shift (-> this root trans) (-> this root transv)))))) + ) + 0 + (sound-group) + (-> this root trans) + ) + (sound-stop (-> this doppler-sound)) + ) + ) + ) + ) + (else + (call-parent-method this arg0) + ) + ) + (none) + ) + +;; definition for method 10 of type sew-move-turret-shot +(defmethod deactivate ((this sew-move-turret-shot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this doppler-sound)) + (call-parent-method this) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc new file mode 100644 index 0000000000..c72972c192 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc @@ -0,0 +1,680 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sew-laser-beam +(deftype sew-laser-beam (process-drawable) + ((sync sync-linear :inline) + (sound-id sound-id) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type sew-laser-beam +(defmethod inspect ((this sew-laser-beam)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-laser-beam sew-laser-beam sew-laser-beam-lod0-jg sew-laser-beam-idle-ja + ((sew-laser-beam-lod0-mg (meters 20)) (sew-laser-beam-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 5.75 12) + :shadow sew-laser-beam-shadow-mg + :shadow-joint-index 4 + ) + +;; definition for function fire-sew-laser-beam! +;; INFO: Used lq/sq +(defun fire-sew-laser-beam! ((arg0 vector) (arg1 vector) (arg2 sew-laser-beam)) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (f30-0 47104.0) + ) + (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-normalize-copy! (-> s4-0 move-dist) arg1 f30-0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd jak enemy obstacle hit-by-others-list player-list)) + (set! (-> v1-2 ignore-process0) arg2) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (if (>= f0-1 0.0) + (vector-float*! (-> s4-0 move-dist) (-> s4-0 move-dist) f0-1) + (set! (-> s4-0 best-other-tri collide-ptr) #f) + ) + ) + (when (and (-> s4-0 best-other-tri collide-ptr) (let ((s2-0 (-> s4-0 best-other-tri collide-ptr))) + (if (type? s2-0 collide-shape-prim-sphere) + s2-0 + ) + ) + ) + (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s2-1 ent) (-> arg2 entity)) + (set! (-> s2-1 charge) 1.0) + (set! (-> s2-1 options) (projectile-options)) + (logclear! (-> s2-1 options) (projectile-options po14 po15 po16)) + (set! (-> s2-1 notify-handle) (the-as handle #f)) + (set! (-> s2-1 owner-handle) (the-as handle #f)) + (set! (-> s2-1 target-handle) (the-as handle #f)) + (set! (-> s2-1 target-pos quad) (the-as uint128 0)) + (set! (-> s2-1 ignore-handle) (process->handle arg2)) + (let* ((v1-19 *game-info*) + (a0-17 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-17) + (set! (-> s2-1 attack-id) a0-17) + ) + (set! (-> s2-1 timeout) (seconds 4)) + (set! (-> s2-1 pos quad) (-> s4-0 start-pos quad)) + (vector-normalize-copy! (-> s2-1 vel) (-> s4-0 move-dist) 491520.0) + (sound-play "laser-hit-jak") + (spawn-projectile sew-laser-shot s2-1 arg2 *default-dead-pool*) + ) + (vector-normalize! (-> s4-0 move-dist) (+ 2048.0 (vector-length (-> s4-0 move-dist)))) + ) + (set! (-> *part-id-table* 4935 init-specs 4 initial-valuef) f30-0) + (let ((a2-5 (new 'stack-no-clear 'vector))) + (vector-float*! a2-5 arg1 f30-0) + (draw-beam (-> *part-id-table* 4935) arg0 a2-5 #t) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (sew-laser-beam) + :virtual #t + :trans (behavior () + (sound-play "laser-beam-loop" :id (-> self sound-id)) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node sew-laser-beam-lod0-jg laser)))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-z-quaternion! s5-0 (-> self root quat)) + (vector-normalize! s5-0 1.0) + (fire-sew-laser-beam! gp-0 s5-0 self) + ) + ) + ) + :code (behavior () + (until #f + (let ((f0-2 (* (get-norm! (-> self sync) 0) (the float (ja-num-frames 0)))) + (a0-2 (-> self skel root-channel 0)) + ) + (set! (-> a0-2 param 0) f0-2) + (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop-set!) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; definition for symbol *sew-laser-beam-shadow-control*, type shadow-control +(define *sew-laser-beam-shadow-control* + (new 'static 'shadow-control :settings (new 'static 'shadow-settings + :center (new 'static 'vector :w (the-as float #x9a)) + :shadow-dir (new 'static 'vector :y -1.0 :w 614400.0) + :bot-plane (new 'static 'plane :y 1.0 :w 163840.0) + :top-plane (new 'static 'plane :y 1.0 :w -163840.0) + :shadow-type 1 + ) + ) + ) + +;; definition for method 11 of type sew-laser-beam +(defmethod init-from-entity! ((this sew-laser-beam) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-beam" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((a1-5 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-4 0)) + (if #f + (set! v1-4 (logior v1-4 1)) + ) + (set! (-> a1-5 sync-type) 'sync-linear) + (set! (-> a1-5 sync-flags) (the-as sync-flags v1-4)) + ) + (set! (-> a1-5 entity) arg0) + (set! (-> a1-5 period) (the-as uint 2700)) + (set! (-> a1-5 percent) 0.0) + (initialize! (-> this sync) a1-5) + ) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw shadow-ctrl) *sew-laser-beam-shadow-control*) + (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80ffc000)) + (go (method-of-object this idle)) + ) + +;; definition for method 10 of type sew-laser-beam +(defmethod deactivate ((this sew-laser-beam)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + ) + (call-parent-method this) + (none) + ) + +;; definition of type sew-m-gate +(deftype sew-m-gate (process-drawable) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + open + raised + ) + ) + +;; definition for method 3 of type sew-m-gate +(defmethod inspect ((this sew-m-gate)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-m-gate sew-m-gate sew-m-gate-lod0-jg sew-m-gate-idle-ja + ((sew-m-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -0.5 0 6.5) + ) + +;; failed to figure out what this is: +(defstate idle (sew-m-gate) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual open) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (v1-6 symbol)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (> (-> self actor-group-count) 0) + (dotimes (v1-5 (-> self actor-group 0 length)) + (let ((a1-1 (-> self actor-group 0 data v1-5 actor))) + (when (or (not a1-1) (not (logtest? (-> a1-1 extra perm status) (entity-perm-status subtask-complete)))) + (set! v1-6 #f) + (goto cfg-13) + ) + ) + ) + ) + (set! v1-6 #t) + (label cfg-13) + (if v1-6 + (go-virtual open) + ) + ) + ) + :code sleep-code + :post #f + ) + +;; failed to figure out what this is: +(defstate open (sew-m-gate) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'entity-name "camera-353" 0.0 0) + (process-grab? *target* #f) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) + (suspend) + ) + ) + (sound-play "gate-open") + (ja-no-eval :group! sew-m-gate-gate-open-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (transform-post) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (remove-setting! 'mode-name) + (remove-setting! 'interp-time) + (remove-setting! 'entity-name) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.5)) + (suspend) + ) + ) + (process-release? *target*) + (go-virtual raised) + ) + :post #f + ) + +;; failed to figure out what this is: +(defstate raised (sew-m-gate) + :virtual #t + :enter (behavior () + (ja :group! sew-m-gate-gate-open-ja :num! max) + (transform-post) + ) + :code sleep-code + :post #f + ) + +;; definition for method 11 of type sew-m-gate +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this sew-m-gate) (arg0 entity-actor)) + (local-vars (r0-0 uint128) (v1-15 uint128) (a0-15 object) (a1-10 uint128) (sv-16 int)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 -2048.0 0.0 26624.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-m-gate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! sv-16 0) + (let ((v1-13 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (cond + ((and v1-13 (begin + (let ((a0-16 #t)) + (let ((a1-9 (the-as uint128 sv-16))) + (.pcpyud a1-10 a1-9 r0-0) + ) + (let ((a1-12 (the-as int (shr (* (the-as int a1-10) 2) 49)))) + (cmove-#f-zero a0-15 a1-12 a0-16) + ) + ) + a0-15 + ) + ) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-13)) + (let ((v1-14 (the-as uint128 sv-16))) + (.pcpyud v1-15 v1-14 r0-0) + ) + (set! (-> this actor-group-count) (shr (* (the-as int v1-15) 2) 49)) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (let ((v1-21 (-> this skel root-channel 0))) + (set! (-> v1-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) + ) + (transform-post) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this raised)) + (go (method-of-object this idle)) + ) + ) + +;; definition of type sew-pipe +(deftype sew-pipe (process-drawable) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + lower + down + ) + ) + +;; definition for method 3 of type sew-pipe +(defmethod inspect ((this sew-pipe)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-pipe sew-pipe sew-pipe-lod0-jg sew-pipe-idle-ja + ((sew-pipe-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -7.5 0 27) + ) + +;; failed to figure out what this is: +(defstate idle (sew-pipe) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual lower) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (local-vars (v1-6 symbol)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (> (-> self actor-group-count) 0) + (dotimes (v1-5 (-> self actor-group 0 length)) + (let ((a1-1 (-> self actor-group 0 data v1-5 actor))) + (when (or (not a1-1) (not (logtest? (-> a1-1 extra perm status) (entity-perm-status subtask-complete)))) + (set! v1-6 #f) + (goto cfg-13) + ) + ) + ) + ) + (set! v1-6 #t) + (label cfg-13) + (if v1-6 + (go-virtual lower) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate lower (sew-pipe) + :virtual #t + :code (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'entity-name "camera-352" 0.0 0) + (process-grab? *target* #f) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (sound-play "pipe-lower") + (set-time! (-> self state-time)) + (ja-no-eval :group! sew-pipe-down-ja :num! (seek! max 0.1) :frame-num 0.0) + (until (ja-done? 0) + (if (time-elapsed? (-> self state-time) (seconds 1.557)) + (sound-play "pipe-lower-hit") + ) + (transform-post) + (suspend) + (ja :num! (seek! max 0.1)) + ) + (remove-setting! 'mode-name) + (remove-setting! 'interp-time) + (remove-setting! 'entity-name) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.5)) + (suspend) + ) + ) + (process-release? *target*) + (go-virtual down) + ) + :post #f + ) + +;; failed to figure out what this is: +(defstate down (sew-pipe) + :virtual #t + :enter (behavior () + (ja :group! sew-pipe-down-ja :num! max) + (transform-post) + ) + :code sleep-code + :post #f + ) + +;; definition for method 11 of type sew-pipe +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this sew-pipe) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 -30720.0 0.0 110592.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-pipe" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-13 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-13 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-13)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + ) + (else + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this down)) + (go (method-of-object this idle)) + ) + ) + +;; definition of type sew-grate-plat +(deftype sew-grate-plat (process-drawable) + ((test-pos vector :inline) + (closed-x float) + (opened-x float) + ) + (:state-methods + closed + open + opened + close + ) + ) + +;; definition for method 3 of type sew-grate-plat +(defmethod inspect ((this sew-grate-plat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Ttest-pos: #~%" (-> this test-pos)) + (format #t "~2Tclosed-x: ~f~%" (-> this closed-x)) + (format #t "~2Topened-x: ~f~%" (-> this opened-x)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-grate-plat sew-grate-plat sew-grate-plat-lod0-jg sew-grate-plat-idle-ja + ((sew-grate-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; failed to figure out what this is: +(defstate closed (sew-grate-plat) + :virtual #t + :trans (behavior () + (let ((gp-0 (-> self test-pos)) + (a0-1 (target-pos 0)) + ) + (if (and (< 0.0 (- (-> a0-1 y) (-> gp-0 y))) (< (vector-vector-xz-distance a0-1 gp-0) 61440.0)) + (go-virtual open) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate open (sew-grate-plat) + :virtual #t + :enter (behavior () + (sound-play "sew-grate-slide") + ) + :trans (behavior () + (seek! (-> self root trans x) (-> self opened-x) (* 327680.0 (seconds-per-frame))) + (if (= (-> self root trans x) (-> self opened-x)) + (go-virtual opened) + ) + ) + :code sleep-code + :post transform-post + ) + +;; failed to figure out what this is: +(defstate opened (sew-grate-plat) + :virtual #t + :trans (behavior () + (let ((gp-0 (-> self test-pos)) + (a0-1 (target-pos 0)) + ) + (if (not (and (< 0.0 (- (-> a0-1 y) (-> gp-0 y))) (< (vector-vector-xz-distance a0-1 gp-0) 61440.0))) + (go-virtual close) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate close (sew-grate-plat) + :virtual #t + :enter (behavior () + (sound-play "sew-grate-slide" :pitch -0.25) + ) + :trans (behavior () + (seek! (-> self root trans x) (-> self closed-x) (* 327680.0 (seconds-per-frame))) + (if (= (-> self root trans x) (-> self closed-x)) + (go-virtual closed) + ) + ) + :code sleep-code + :post transform-post + ) + +;; definition for method 11 of type sew-grate-plat +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this sew-grate-plat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-5 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-grate-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this test-pos quad) (-> this root trans quad)) + (+! (-> this test-pos x) -40960.0) + (set! (-> this closed-x) (-> this root trans x)) + (set! (-> this opened-x) (+ -32768.0 (-> this root trans x))) + (go (method-of-object this closed)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-part_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-part_REF.gc new file mode 100644 index 0000000000..88006ba2ee --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-part_REF.gc @@ -0,0 +1,2171 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-sewer-gas + :id 1470 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4856 :fade-after (meters 200) :falloff-to (meters 300) :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 4856 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.15) + (:x (meters 10) (meters 50)) + (:y (meters 20) (meters 40)) + (:scale-x (meters 20) (meters 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 128.0) + (:b 128.0 64.0) + (:a 0.0) + (:vel-x (meters -0.016666668) (meters 0.033333335)) + (:vel-y (meters 0) (meters 0.0033333334)) + (:scalevel-x (meters 0) (meters 0.033333335)) + (:scalevel-y (meters 0) (meters 0.033333335)) + (:fade-a 0.053333335) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 4)) + (:next-launcher 4857) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4857 + :init-specs ((:fade-a -0.053333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-steamvent + :id 1471 + :flags (sp1 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4858 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4858 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 0.15) + (:x (meters -1) (meters 2)) + (:y (meters -2) (meters 4)) + (:z (meters 2)) + (:scale-x (meters 4) (meters 8)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 255.0) + (:b 20.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0016666667)) + (:vel-z (meters 0.006666667) (meters 0.02)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0.000033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-color-sewer-gas* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 8.0 :y 8.0 :z 8.0 :w 128.0) + (new 'static 'vector :x 64.0 :y 64.0 :z 64.0 :w 128.0) + (new 'static 'vector :x 64.0 :y 64.0 :z 64.0 :w 128.0) + (new 'static 'vector :x 64.0 :y 64.0 :z 64.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-alpha-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 32.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x 32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-sewer-gas-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 4.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-sewer-gas-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 4.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *r-curve-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 0.5 :z 0.3) + :one-over-x-deltas (new 'static 'vector :x -1.0 :y -1.0 :z -1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *g-curve-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *b-curve-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.1 :y 0.1 :z 1.1 :w 2.1) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 0.9999999 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-alpha-sewer-gas* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.2 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 0.5 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 2.5 :y 1.0 :z -3.3333333 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-sewer-gas-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-sewer-gas-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-sewer-steam-puff-curve-settings*, type particle-curve-settings +(define *part-sewer-steam-puff-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 3) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0 pcf1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4858 init-specs 21 initial-valuef) + (the-as float *part-sewer-steam-puff-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* color-start) *range-color-sewer-gas*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* alpha-start) *range-alpha-sewer-gas*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* scale-x-start) *range-scale-sewer-gas-x*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* scale-y-start) *range-scale-sewer-gas-y*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* r-scalar) *r-curve-sewer-gas*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* g-scalar) *g-curve-sewer-gas*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* b-scalar) *b-curve-sewer-gas*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* a-scalar) *curve-alpha-sewer-gas*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* scale-x-scalar) *curve-sewer-gas-x*) + +;; failed to figure out what this is: +(set! (-> *part-sewer-steam-puff-curve-settings* scale-y-scalar) *curve-sewer-gas-y*) + +;; failed to figure out what this is: +(defpartgroup group-sewer-hard-blowing-steam + :id 1472 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4859 :flags (sp7))) + ) + +;; definition for symbol *steam-particle-list*, type (array int32) +(define *steam-particle-list* (new 'static 'boxed-array :type int32 #x405c00 #x400000)) + +;; definition for function birth-func-texture-group-steam +;; WARN: Return type mismatch int vs none. +(defun birth-func-texture-group-steam ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (particle-adgif-callback + (-> arg1 adgif) + (the-as + texture-id + (-> *steam-particle-list* + (mod (the-as int (rand-uint31-gen *random-generator*)) (-> *steam-particle-list* length)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 4859 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam) + (:num 2.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-z (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:friction 0.92) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335)) + (:next-launcher 4860) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4860 + :init-specs ((:fade-a -0.32)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-green-steam + :id 1473 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 4861 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4861 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group-steam) + (:num 2.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 90.0 30.0) + (:g 130.0) + (:b 32.0) + (:a 0.0) + (:omega (degrees 0.1575)) + (:vel-y (meters 0.2) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:friction 0.92 0.02) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.167)) + (:next-launcher 4862) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4862 + :init-specs ((:fade-a -0.16)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-deadly-mist + :id 1474 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4863 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4863 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 2)) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 90.0 30.0) + (:g 130.0) + (:b 32.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0.00033333333)) + (:friction 0.98) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4864) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4864 + :init-specs ((:fade-a -0.018823529)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-light-glow + :id 1475 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4865 :fade-after (meters 200) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4865 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 64.0) + (:a 12.0 4.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-panel-light-glow + :id 1476 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4866 :fade-after (meters 200) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4866 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 7) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 255.0) + (:b 255.0) + (:a 12.0 4.0) + (:omega (degrees 4515.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-little-ridge-wake + :id 1477 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4867 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4867 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.3 0.8) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.001)) + (:accel-z (meters 0.001)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-13)) + (:conerot-x (degrees -5) (degrees 10)) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-fan-lasersight + :id 1478 + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4868 :flags (sp6 sp7)) (sp-item 4869 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4868 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 64.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4869 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 64.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-fan-lasersight-hostile + :id 1479 + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4870 :flags (sp6 sp7)) (sp-item 4871 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4870 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 112.0) + (:g 16.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4871 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 1.5)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 112.0) + (:g 16.0) + (:b 10.0) + (:a 64.0 1.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 1228.8) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4872 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 30.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4873 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -1)) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 0.0) + (:a 30.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-wake-small + :id 1480 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4874 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4874 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.2) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.008333334) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:accel-z (meters 0.00033333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-grate-wake + :id 1481 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4875 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4875 + :init-specs ((:texture (water-wake sewa-sprite)) + (:num 0.5) + (:x (meters 0)) + (:z (meters -6) 6 (meters 2.1)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.016666668) (meters 0.0016666667)) + (:scalevel-y (meters 0.006666667) (meters 0.0016666667)) + (:fade-a -0.10666667 -0.10666667) + (:accel-z (meters 0.00033333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-yellow-grate-wake + :id 1482 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4876 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4876 + :init-specs ((:texture (water-wake sewa-sprite)) + (:num 1.0) + (:x (meters 0)) + (:z (meters -7.6) 4 (meters 3)) + (:scale-x (meters 0.5) (meters 0.3)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.016666668) (meters 0.0016666667)) + (:scalevel-y (meters 0.013333334) (meters 0.0016666667)) + (:fade-a -0.21333334 -0.21333334) + (:accel-x (meters 0.00033333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-falls-froth + :id 1483 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4877 :flags (is-3d sp7)) + (sp-item 4878 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4877 + :init-specs ((:texture (water-froth sewa-sprite)) + (:num 0.02 0.02) + (:x (meters -4) (meters 8)) + (:z (meters -10)) + (:scale-x (meters 5) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 110.0) + (:b 60.0 20.0) + (:a 32.0 32.0) + (:vel-z (meters 0.02) (meters 0.006666667)) + (:rotvel-y (degrees -0.010000001) (degrees 0.020000001)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:next-time (seconds 5)) + (:next-launcher 4879) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4879 + :init-specs ((:fade-a -0.042666666)) + ) + +;; failed to figure out what this is: +(defpart 4878 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -5) (meters 10)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:accel-z (meters 0.00016666666)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-whirlpool-center + :id 1484 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4880 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4881 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4881 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 1)) + (:y (meters -0.5)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-y (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335) + (:accel-y (meters -0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 2)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4880 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 2)) + (:y (meters 1)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4882) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4882 + :init-specs ((:fade-a -0.018823529)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-falls-tilt + :id 1485 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4883 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4883 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 6.0) + (:x (meters -9) (meters 18)) + (:y (meters 0.4)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters -0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-waterfall-base + :id 1486 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4884 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4885 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4884 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:z (meters 1)) + (:scale-x (meters 3) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-z (meters 0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4885 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -1.5) (meters 3)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-waterfall-base-big + :id 1487 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4886 :fade-after (meters 100) :falloff-to (meters 400) :flags (sp7)) + (sp-item 4887 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4886 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3 0.3) + (:x (meters -10) (meters 15)) + (:y (meters -0.4)) + (:z (meters 0)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4888) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4888 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +;; failed to figure out what this is: +(defpart 4889 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:z (meters 1)) + (:scale-x (meters 12) (meters 0.5)) + (:rot-y (degrees 0) 1 (degrees 180)) + (:scale-y (meters 3) (meters 0.5)) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-z (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4890 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:z (meters 1)) + (:scale-x (meters 3) (meters 0.5)) + (:rot-y (degrees 90) 1 (degrees 180)) + (:scale-y (meters 12) (meters 0.5)) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-z (meters 0.00033333333)) + (:friction 0.9) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406400 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4887 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -6) (meters 12)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-waterfall-base-tube + :id 1488 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4891 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4891 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -6) (meters 12)) + (:y (meters 0)) + (:z (meters -0.3) (meters 0.6)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 50.0 50.0) + (:b 40.0) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:vel-z (meters 0.0033333334) (meters 0.02)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-wake-medium + :id 1489 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4892 :flags (sp7)) (sp-item 4893 :flags (sp7)) (sp-item 4894 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4892 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 5.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters 0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees -10) (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4893 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 5.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters -0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 180) (degrees 100.00001)) + ) + ) + +;; failed to figure out what this is: +(defpart 4894 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.5) + (:scale-x (meters 8) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-z (meters 0.02)) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111) + (:accel-x (meters -0.00013333333)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-wake-large + :id 1490 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4895 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4895 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:scale-x (meters 3.3)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:accel-x (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:next-time (seconds 0.335)) + (:next-launcher 4896) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4896 + :init-specs ((:scalevel-x (meters -0.006666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-wake-tiny + :id 1491 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 4897 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4897 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.2) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:accel-x (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-deep-mist + :id 1492 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 200) + :parts ((sp-item 4898 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4898 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 10)) + (:scale-x (meters 10) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 20.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.008 0.008) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.99) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 6.667)) + (:next-launcher 4899) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4899 + :init-specs ((:fade-a -0.032 -0.032)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-waterfall-base-huge + :id 1493 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 4900 :fade-after (meters 50) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4901 :fade-after (meters 50) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4902 :fade-after (meters 50) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4900 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3 0.3) + (:x (meters 0)) + (:y (meters -0.4)) + (:z (meters -40) (meters 80)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4903) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4903 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +;; failed to figure out what this is: +(defpart 4901 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters 0)) + (:z (meters -40) (meters 40)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters 0.00033333333) (meters 0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4902 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters 0)) + (:z (meters 0) (meters 40)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters 0.00033333333) (meters 0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-waterfall-base-top + :id 1494 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4904 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 4905 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4904 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3 0.3) + (:x (meters 0)) + (:y (meters -0.4)) + (:z (meters -30) (meters 60)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4903) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4905 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 20.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters 0)) + (:z (meters -30) (meters 60)) + (:scale-x (meters 1) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters -0.01)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256) + (:accel-x (meters 0.00033333333) (meters 0.00066666666)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-4-waterfalls + :id 1495 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4906 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4907 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4908 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4909 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4910 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4911 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4912 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4913 :fade-after (meters 60) :falloff-to (meters 100) :flags (is-3d sp7)) + (sp-item 4914 :fade-after (meters 60) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4906 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5 0.5) + (:x (meters 0)) + (:y (meters -0.4)) + (:z (meters -20) (meters 35)) + (:scale-x (meters 1) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters 0.000033333334) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4915) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4915 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +;; failed to figure out what this is: +(defpart 4907 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters 13)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4908 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters 10) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4909 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters 4.6)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4910 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters 1.4) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4911 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters -3)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4912 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters -6.5) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4913 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters 1)) + (:z (meters -11.5)) + (:scale-x (meters 6) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-x (meters 0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4914 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 4.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0)) + (:z (meters -15) (meters 6)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters -0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:accel-x (meters 0.00033333333) (meters 0.00033333333)) + (:accel-y (meters 0.00033333333)) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-moving-step-a-wake + :id 1496 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 4916 :flags (sp7)) (sp-item 4917 :flags (sp7)) (sp-item 4918 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4916 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 2.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters 0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 80) (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4917 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 2.0) + (:x (meters -3.5)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.026666667)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.001)) + (:accel-z (meters -0.0016666667)) + (:friction 0.96) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 260) (degrees 100.00001)) + ) + ) + +;; failed to figure out what this is: +(defpart 4918 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:scale-x (meters 6.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:accel-x (meters 0.00066666666)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:next-time (seconds 0.335)) + (:next-launcher 4919) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4919 + :init-specs ((:scalevel-x (meters -0.006666667)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-moving-step-b-wake + :id 1497 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 4920 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4921 :fade-after (meters 80) :falloff-to (meters 100) :flags (is-3d sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4920 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 3.0) + (:x (meters -4.2) (meters 8.4)) + (:z (meters 1.2)) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 100.0 28.0) + (:vel-y (meters 0.0033333334) (meters 0.013333334)) + (:scalevel-x (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:accel-y (meters -0.0016666667)) + (:accel-z (meters 0.001)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-drop-group-center) + (:conerot-z (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4921 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.4) + (:y (meters 0.8)) + (:z (meters 1.5)) + (:scale-x (meters 9) (meters 1)) + (:rot-y (degrees 0)) + (:scale-y (meters 1) (meters 1)) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:scalevel-y (meters 0.013333334)) + (:fade-a -0.21333334) + (:accel-z (meters 0.001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-x (degrees 55)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-grate-bubbles + :id 1498 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4922 :fade-after (meters 80) :falloff-to (meters 100) :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4922 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.2) + (:z (meters -1)) + (:scale-x (meters 4) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0) + (:vel-z (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.017777778 -0.017777778) + (:accel-z (meters 0.00066666666)) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x408200)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-slide-froth + :id 1499 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4923 :fade-after (meters 80) :falloff-to (meters 100) :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4923 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:x (meters -2) (meters 4)) + (:z (meters -1)) + (:scale-x (meters 4) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 120.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32) + (:accel-z (meters 0.00066666666)) + (:friction 0.9 0.03) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #x406500 #x58300600)) + (:next-time (seconds 0.335)) + (:next-launcher 4924) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4924 + :init-specs ((:fade-a -0.04)) + ) + +;; failed to figure out what this is: +(defpartgroup group-flyingsaw-sparks + :id 1500 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 4925 :flags (sp7)) (sp-item 4926 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4925 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4926 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5 0.5) + (:scale-x (meters 0.05) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.64) + (:fade-b -2.56) + (:fade-a -1.28 -1.28) + (:accel-y (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-fan-gust + :id 1501 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4927 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4927 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 6.0) + (:y (meters 1) (meters 0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:vel-z (meters 0.1)) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-rising-bubbles + :id 1502 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4928 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4928 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.01 0.5) + (:x (meters 0) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:accel-y (meters 0.00083333335)) + (:timer (seconds 3.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-birth-on-bubble-pop) + (:next-time (seconds 0.017)) + (:next-launcher 4929) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4929 + :init-specs ((:scale-x (meters 0.2) (meters 0.2)) + (:scale-y :copy scale-x) + (:fade-a -0.04 0.16) + (:accel-x (meters -0.00033333333) 1 (meters 0.00066666666)) + (:accel-z (meters -0.00033333333) 1 (meters 0.00066666666)) + (:friction 0.9) + (:next-time (seconds 0.1) (seconds 0.03)) + (:next-launcher 4929) + ) + ) + +;; definition for function spt-func-birth-on-bubble-pop +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs none. +(defun spt-func-birth-on-bubble-pop ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (when (zero? (-> arg1 timer)) + (cond + ((logtest? (-> *part-group-id-table* 1503 flags) (sp-group-flag sp13)) + (let ((v1-6 (-> *launch-matrix* trans)) + (a0-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-1 x) (-> arg2 launchrot x)) + (set! (-> a0-1 y) (-> arg2 launchrot y)) + (set! (-> a0-1 z) (-> arg2 launchrot z)) + (set! (-> a0-1 w) 1.0) + (set! (-> v1-6 quad) (-> a0-1 quad)) + ) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1503)) + ) + (else + (let ((v1-19 (-> *launch-matrix* trans)) + (a0-6 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-6 x) (-> arg2 launchrot x)) + (set! (-> a0-6 y) (-> arg2 launchrot y)) + (set! (-> a0-6 z) (-> arg2 launchrot z)) + (set! (-> a0-6 w) 1.0) + (set! (-> v1-19 quad) (-> a0-6 quad)) + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1503)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-rising-bubbles-pop + :id 1503 + :duration (seconds 1.5) + :linger-duration (seconds 0) + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4930 :fade-after (meters 100) :falloff-to (meters 200) :flags (is-3d sp7) :period (seconds 20) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 4930 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sewer-abyss-waterfall-mist + :id 1504 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4931 :fade-after (meters 200) :falloff-to (meters 400) :flags (sp7)) + (sp-item 4932 :fade-after (meters 200) :falloff-to (meters 400) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4932 + :init-specs ((:texture (ceiling-dust sewa-sprite)) + (:num 0.04 0.02) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 4) (meters 2)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0.046666667)) + (:scalevel-x (meters 0.00033333333) (meters 0.0016666667)) + (:scalevel-y (meters 0.0033333334) (meters 0.0033333334)) + (:fade-a 0.021333333 0.021333333) + (:accel-y (meters -0.0005)) + (:friction 0.99) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 2.5)) + (:next-launcher 4933) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4933 + :init-specs ((:fade-a -0.042666666 -0.042666666)) + ) + +;; failed to figure out what this is: +(defpart 4931 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.2 0.2) + (:x (meters -5) (meters 10)) + (:y (meters 1)) + (:z (meters -10)) + (:scale-x (meters 6) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 180.0 70.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-z (meters 0.046666667)) + (:scalevel-x (meters 0.006666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.13333334) (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.064 0.064) + (:accel-y (meters -0.00006666667) (meters -0.00006666667)) + (:friction 0.99) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.835)) + (:next-launcher 4934) + (:conerot-y (degrees -30) (degrees 60)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4934 + :init-specs ((:fade-a -0.032 -0.032)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs-h_REF.gc new file mode 100644 index 0000000000..3d064573d4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs-h_REF.gc @@ -0,0 +1,302 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type market-object +(deftype market-object (crate) + ((sound-explode sound-spec) + (part-explode sparticle-launch-group) + (explode-matrix matrix :inline) + ) + ) + +;; definition for method 3 of type market-object +(defmethod inspect ((this market-object)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type crate inspect))) + (t9-0 this) + ) + (format #t "~2Tsound-explode: ~A~%" (-> this sound-explode)) + (format #t "~2Tpart-explode: ~A~%" (-> this part-explode)) + (format #t "~2Texplode-matrix: #~%" (-> this explode-matrix)) + (label cfg-4) + this + ) + +;; definition for method 38 of type market-object +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this market-object)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 7372.8 0.0 8192.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + knocked + ) + ) + (set! (-> this root) (the-as collide-shape-moving s5-0)) + ) + 0 + (none) + ) + +;; definition for method 37 of type market-object +;; INFO: Used lq/sq +;; WARN: Return type mismatch market-object vs none. +(defmethod init-skel! ((this market-object)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this look) (-> this type symbol)) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + 0 + ) + (set! (-> this base quad) (-> this root trans quad)) + (crate-post) + (nav-mesh-connect-from-ent this) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (market-object) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((a1-1 (the-as object (-> block param 1))) + (a0-2 proc) + ) + (-> (the-as attack-info a1-1) id) + (let ((gp-0 (-> (the-as attack-info a1-1) count))) + (cond + ((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info a1-1) mask)) + (logtest? (penetrate jak-dark-nuke) (-> (the-as attack-info a1-1) penetrate-using)) + ) + (go-virtual die #t 0) + ) + (else + (when a0-2 + (let ((v1-9 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when v1-9 + (forward-up-nopitch->inv-matrix + (-> self explode-matrix) + (vector-! (new 'stack-no-clear 'vector) (-> v1-9 root trans) (-> self root trans)) + *up-vector* + ) + (set! (-> self explode-matrix trans quad) (-> self root trans quad)) + ) + ) + ) + (send-event proc 'get-attack-count 1) + (process-contact-action proc) + (set! (-> self target) (process->handle proc)) + (go-virtual die #f (the-as int gp-0)) + ) + ) + ) + ) + ) + (else + (crate-standard-event-handler proc argc message block) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (market-object) + :virtual #t + :enter (behavior ((arg0 symbol) (arg1 int)) + (when (not arg0) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< (vector-vector-xz-distance (-> self root trans) (camera-pos)) 409600.0) + ) + (if (logtest? (-> self part-explode flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> self part-explode) + :mat-joint (-> self explode-matrix) + ) + (part-tracker-spawn part-tracker :to self :group (-> self part-explode) :mat-joint (-> self explode-matrix)) + ) + ) + (if (nonzero? (-> self sound-explode)) + (sound-play-by-spec (-> self sound-explode) (new-sound-id) (the-as vector #t)) + ) + ) + (let* ((t9-10 find-parent-method) + (a0-9 market-object) + (a1-9 30) + (t9-11 (-> (the-as (state symbol int market-object) (t9-10 a0-9 a1-9)) enter)) + ) + (if t9-11 + (t9-11 (the-as symbol a0-9) a1-9) + ) + ) + ) + ) + +;; definition of type market-basket-a +(deftype market-basket-a (market-object) + () + ) + +;; definition for method 3 of type market-basket-a +(defmethod inspect ((this market-basket-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-object inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type market-basket-b +(deftype market-basket-b (market-object) + () + ) + +;; definition for method 3 of type market-basket-b +(defmethod inspect ((this market-basket-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-object inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type market-crate +(deftype market-crate (market-object) + () + ) + +;; definition for method 3 of type market-crate +(defmethod inspect ((this market-crate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-object inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type market-sack-a +(deftype market-sack-a (market-object) + () + ) + +;; definition for method 3 of type market-sack-a +(defmethod inspect ((this market-sack-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-object inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type market-sack-b +(deftype market-sack-b (market-object) + () + ) + +;; definition for method 3 of type market-sack-b +(defmethod inspect ((this market-sack-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-object inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type fruit-stand +(deftype fruit-stand (process-focusable) + ((incoming-attack-id uint32) + (hack-counter uint32) + (count-sparts uint32) + (first-sparts uint32) + (num-sparts uint32) + (sparts-index uint32 4) + (sparts-pos vector 4 :inline) + (parts-alive? symbol) + ) + (:state-methods + idle + ) + (:methods + (fruit-stand-method-29 (_type_) none) + (fruit-stand-method-30 (_type_) none) + ) + ) + +;; definition for method 3 of type fruit-stand +(defmethod inspect ((this fruit-stand)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Thack-counter: ~D~%" (-> this hack-counter)) + (format #t "~2Tcount-sparts: ~D~%" (-> this count-sparts)) + (format #t "~2Tfirst-sparts: ~D~%" (-> this first-sparts)) + (format #t "~2Tnum-sparts: ~D~%" (-> this num-sparts)) + (format #t "~2Tsparts-index[4] @ #x~X~%" (-> this sparts-index)) + (format #t "~2Tsparts-pos[4] @ #x~X~%" (-> this sparts-pos)) + (format #t "~2Tparts-alive?: ~A~%" (-> this parts-alive?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc new file mode 100644 index 0000000000..73bb5a79ae --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc @@ -0,0 +1,1625 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-mcrate-explode + :id 248 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1117 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1118 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1119 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1120 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1121 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 1119 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 128.0) + (:g 64.0 32.0) + (:b 0.0 32.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1120 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1121 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 4)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 196.0) + (:b 128.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1118 + :init-specs ((:texture (new 'static 'texture-id :index #x15 :page #xc1)) + (:num 12.0 6.0) + (:y (meters 0) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1117 + :init-specs ((:texture (new 'static 'texture-id :index #x15 :page #xc1)) + (:num 6.0 3.0) + (:y (meters 0) (meters 2)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.3) (meters 2)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.6)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mbasket-a-explode + :id 249 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1123 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1124 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1125 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1126 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1127 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1128 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1129 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 1126 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 3)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 128.0 64.0) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1125 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 32.0) + (:y (meters 0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.083333336)) + (:accel-y (meters -0.003) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata 30720.0) + (:func 'check-water-level-drop-motion) + (:next-time (seconds 0) (seconds 0.58)) + (:next-launcher 41) + (:conerot-x (degrees 0) (degrees 85)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +;; failed to figure out what this is: +(defpart 1127 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 2.0) + (:y (meters 0) (meters 2)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 64.0 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00083333335) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1128 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 4.0 3.0) + (:y (meters 0) (meters 4)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1129 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 7)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 5)) + (:r 64.0) + (:g 196.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1124 + :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xc1)) + (:birth-func 'birth-func-texture-group) + (:num 12.0 6.0) + (:y (meters 0.5) (meters 4)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1123 + :init-specs ((:texture (new 'static 'texture-id :index #x2 :page #xc1)) + (:birth-func 'birth-func-texture-group) + (:num 6.0 3.0) + (:y (meters 0.5) (meters 4)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mbasket-b-explode + :id 250 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1130 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1131 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1132 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1133 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1134 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1135 :fade-after (meters 30) :falloff-to (meters 40) :flags (is-3d) :period (seconds 4) :length (seconds 0.335)) + (sp-item 1136 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 1134 + :init-specs ((:texture (specs level-default-sprite)) + (:num 32.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 255.0) + (:g :copy r) + (:b :copy g) + (:a 92.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1135 + :init-specs ((:texture (specs level-default-sprite)) + (:num 2.0) + (:x (meters -3) (meters 6)) + (:y (meters 0.05)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 1.5) (meters 1)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 1.5) (meters 1)) + (:r 255.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:fade-a 3.2) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.135)) + (:next-launcher 1137) + ) + ) + +;; failed to figure out what this is: +(defpart 1137 + :init-specs ((:fade-a 0.0) (:next-time (seconds 1) (seconds 0.997)) (:next-launcher 1138)) + ) + +;; failed to figure out what this is: +(defpart 1138 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 1132 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 192.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1133 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 12.0 3.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1136 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 7)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1131 + :init-specs ((:texture (new 'static 'texture-id :page #xc1)) + (:num 6.0 3.0) + (:y (meters 0.5) (meters 0.5)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1130 + :init-specs ((:texture (new 'static 'texture-id :page #xc1)) + (:num 4.0 2.0) + (:y (meters 0.5) (meters 0.5)) + (:z (meters -1.5) 1 (meters 3)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function check-market-piece-ground +;; WARN: Return type mismatch number vs none. +(defun check-market-piece-ground ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (and (>= 35225.6 (-> arg2 launchrot y)) (>= 0.0 (-> arg1 vel-sxvel y))) + (set! (-> arg2 launchrot y) 35225.6) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 1122 + :init-specs ((:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0)) + (:vel-y (meters 0)) + (:rotvel-x (degrees 0)) + (:rotvel-y (degrees 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:friction 0.8 0.1) + (:timer (seconds 4)) + (:next-time (seconds 0.5) (seconds 0.997)) + (:next-launcher 1139) + ) + ) + +;; failed to figure out what this is: +(defpart 1139 + :init-specs ((:fade-a -0.21333334 -0.21333334) (:flags (sp-cpuinfo-flag-2 left-multiply-quat))) + ) + +;; failed to figure out what this is: +(defpartgroup group-msack-a-explode + :id 251 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1140 :fade-after (meters 40) :falloff-to (meters 80) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.035)) + (sp-item 1141 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1142 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1143 :fade-after (meters 30) :falloff-to (meters 40) :flags (is-3d) :period (seconds 4) :length (seconds 0.335)) + (sp-item 1144 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1145 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1146 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 1142 + :init-specs ((:texture (new 'static 'texture-id :index #x10 :page #xc1)) + (:num 32.0) + (:y (meters 0) (meters 1)) + (:z (meters -1.5) (meters 3)) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.3) (meters 0.6)) + (:r 128.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 96.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y (meters 0.00033333333)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1143 + :init-specs ((:texture (new 'static 'texture-id :index #x11 :page #xc1)) + (:num 1.0 1.0) + (:x (meters -3) (meters 6)) + (:y (meters 0.05)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 1.5) (meters 1.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.2) (seconds 0.065)) + (:next-launcher 1137) + ) + ) + +;; failed to figure out what this is: +(defpart 1144 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 3.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 150.0 60.0) + (:g 96.0 64.0) + (:b 0.0 32.0) + (:a 16.0 8.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1145 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 3.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.05) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1146 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 5)) + (:rot-x (degrees 0.675)) + (:scale-y (meters 4.5)) + (:r 255.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1141 + :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1)) + (:num 8.0 3.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2) (meters 0.3)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1140 + :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1)) + (:num 4.0 2.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.5)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.1) (meters 0.06666667)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 0.4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 15) (degrees 150)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-msack-b-explode + :id 252 + :duration (seconds 3.335) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 12) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :parts ((sp-item 1147 :fade-after (meters 100) :falloff-to (meters 120) :flags (is-3d sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1148 :fade-after (meters 100) :falloff-to (meters 120) :flags (sp7) :period (seconds 4) :length (seconds 0.1)) + (sp-item 1149 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp7) :period (seconds 4) :length (seconds 0.135)) + (sp-item 1150 :fade-after (meters 60) :falloff-to (meters 90) :flags (sp7) :period (seconds 4) :length (seconds 0.05)) + (sp-item 1151 :fade-after (meters 50) :period (seconds 4) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 1148 + :init-specs ((:texture (new 'static 'texture-id :index #x1 :page #xc1)) + (:num 32.0) + (:y (meters 0) (meters 1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0033333334) (meters -0.00083333335)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 3.335)) + (:next-launcher 1152) + (:conerot-x (degrees 0) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1152 + :init-specs ((:vel-y (meters 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:friction 0.8 0.1) + (:timer (seconds 5.667)) + (:next-time (seconds 1.5) (seconds 0.997)) + (:next-launcher 1139) + ) + ) + +;; failed to figure out what this is: +(defpart 1149 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0 2.0) + (:y (meters 0) (meters 1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 150.0 60.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 16.0 8.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1150 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0 2.0) + (:y (meters 0) (meters 1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 1)) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 8.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters 0) (meters 0.0033333334)) + (:fade-a -0.02 -0.02) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.82 0.07) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1151 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 3)) + (:rot-x (degrees 0.675)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 64.0) + (:omega (degrees 1136.25)) + (:scalevel-x (meters 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.56) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1147 + :init-specs ((:texture (new 'static 'texture-id :index #x3 :page #xc1)) + (:num 6.0 2.0) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 0.2)) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.083333336) (meters 0.05)) + (:scalevel-x (meters -0.00022222222)) + (:rotvel-x (degrees -4.8) (degrees 9.6)) + (:rotvel-y (degrees -4.8) (degrees 9.6)) + (:rotvel-z (degrees -4.8) (degrees 9.6)) + (:scalevel-y (meters -0.00022222222)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.92 0.07) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'check-market-piece-ground) + (:next-time (seconds 4)) + (:next-launcher 1122) + (:conerot-x (degrees 0) (degrees 110)) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-market-basket-a market-basket-a market-basket-a-lod0-jg market-basket-a-idle-ja + ((market-basket-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 0 2.5) + ) + +;; definition for method 37 of type market-basket-a +;; WARN: Return type mismatch market-basket-a vs none. +(defmethod init-skel! ((this market-basket-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 249)) + (set! (-> this sound-explode) (static-sound-spec "break-vase" :group 1)) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-market-basket-b market-basket-b market-basket-b-lod0-jg market-basket-b-idle-ja + ((market-basket-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; definition for method 37 of type market-basket-b +;; WARN: Return type mismatch market-basket-b vs none. +(defmethod init-skel! ((this market-basket-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 250)) + (set! (-> this sound-explode) (static-sound-spec "break-flour" :group 1)) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-market-crate market-crate market-crate-lod0-jg market-crate-idle-ja + ((market-crate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + ) + +;; definition for method 37 of type market-crate +;; WARN: Return type mismatch market-crate vs none. +(defmethod init-skel! ((this market-crate)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-crate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 248)) + (set! (-> this sound-explode) (static-sound-spec "break-crate" :group 1)) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-market-sack-a market-sack-a market-sack-a-lod0-jg market-sack-a-idle-ja + ((market-sack-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + ) + +;; definition for method 37 of type market-sack-a +;; WARN: Return type mismatch market-sack-a vs none. +(defmethod init-skel! ((this market-sack-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 251)) + (set! (-> this sound-explode) (static-sound-spec "break-crate" :group 1)) + (call-parent-method this) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-market-sack-b market-sack-b market-sack-b-lod0-jg market-sack-b-idle-ja + ((market-sack-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + ) + +;; definition for method 37 of type market-sack-b +;; WARN: Return type mismatch market-sack-b vs none. +(defmethod init-skel! ((this market-sack-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part-explode) (-> *part-group-id-table* 252)) + (set! (-> this sound-explode) (static-sound-spec "break-veg-straw" :group 1)) + (call-parent-method this) + (none) + ) + +;; definition for function market-activate +;; WARN: Return type mismatch int vs none. +(defun market-activate ((arg0 level)) + (let* ((v1-0 (-> arg0 name)) + (gp-0 (cond + ((= v1-0 'ctymarka) + (new 'static 'boxed-array :type int32 5 0 0 #xc100200 #xc100c00) + ) + ((= v1-0 'ctymarkb) + (new 'static 'boxed-array :type int32 5 0 0 #xcd00200 #xcd00c00) + ) + ((= v1-0 'waswide) + (new 'static 'boxed-array :type int32 5 0 0 #x29a01400 #x29a01500) + ) + (else + (format 0 "ERROR: market-activate called for unknown level ~A~%" (-> arg0 name)) + ) + ) + ) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 1124) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + (set! (-> (get-field-spec-by-id (-> *part-id-table* 1123) (sp-field-id spt-userdata)) initial-valuef) + (the-as float gp-0) + ) + ) + (setup-special-textures (-> *part-id-table* 1118) "wood-plain-debris") + (setup-special-textures (-> *part-id-table* 1117) "wood-plain-debris") + (setup-special-textures (-> *part-id-table* 1124) "clay-pot-debris-01") + (setup-special-textures (-> *part-id-table* 1123) "clay-pot-debris-01") + (setup-special-textures (-> *part-id-table* 1131) "basket-debris-01") + (setup-special-textures (-> *part-id-table* 1130) "basket-debris-01") + (setup-special-textures (-> *part-id-table* 1141) "cotton-wrap-debris") + (setup-special-textures (-> *part-id-table* 1140) "cotton-wrap-debris") + (setup-special-textures (-> *part-id-table* 1147) "basket-debris-01") + (setup-special-textures (-> *part-id-table* 1142) "straw-bit") + (setup-special-textures (-> *part-id-table* 1143) "straw-ground") + (setup-special-textures (-> *part-id-table* 1148) "cherry") + 0 + (none) + ) + +;; definition for symbol *fruit-check-ground-counter*, type int +(define *fruit-check-ground-counter* 0) + +;; definition for function fruit-check-ground-bounce +(defun fruit-check-ground-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 matrix)) + (let ((v1-1 (-> arg1 key proc)) + (f0-0 (-> arg1 user-float)) + ) + (set! (-> (the-as fruit-stand (+ (* (-> (the-as fruit-stand v1-1) num-sparts) 4) (the-as uint v1-1))) + sparts-index + 0 + ) + (the-as uint arg3) + ) + (when (and (>= (-> (the-as fruit-stand v1-1) count-sparts) (-> (the-as fruit-stand v1-1) first-sparts)) + (nonzero? (-> (the-as fruit-stand v1-1) hack-counter)) + ) + (set-vector! + (-> (the-as fruit-stand v1-1) sparts-pos (-> (the-as fruit-stand v1-1) num-sparts)) + (-> arg2 launchrot x) + (-> arg2 launchrot y) + (-> arg2 launchrot z) + 1.0 + ) + (+! (-> (the-as fruit-stand v1-1) num-sparts) 1) + (+! (-> (the-as fruit-stand v1-1) hack-counter) -1) + ) + (+! (-> (the-as fruit-stand v1-1) count-sparts) 1) + (when (and (< (-> arg2 launchrot y) f0-0) (< (-> arg1 vel-sxvel y) 0.0)) + (set! (-> arg2 launchrot y) f0-0) + (if (and (< (-> arg1 vel-sxvel y) -122.88) (< (rand-vu-int-count 10) 3)) + (set-vector! + (new 'stack-no-clear 'vector) + (-> arg2 launchrot x) + (-> arg2 launchrot y) + (-> arg2 launchrot z) + 1.0 + ) + ) + (set! (-> arg1 vel-sxvel y) (* (-> arg1 vel-sxvel y) (- (rand-vu-float-range 0.6 0.8)))) + ) + ) + ) + +;; definition for function fruit-sparticle-next-on-mode-1 +(defun fruit-sparticle-next-on-mode-1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg1 key))) + (cond + ((zero? (-> s5-0 state-mode 0)) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + (else + (let ((s4-0 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + 0.0 + (let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega)))) + (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0)) + (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0)) + (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0)) + ) + (vector-float*! s4-0 (the-as vector (-> s5-0 origin)) f26-0) + (let ((a1-5 s4-0)) + (let ((v1-8 s4-0)) + (let ((a0-10 (-> s5-0 origin uvec))) + (let ((a2-1 f30-0)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-8 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-5 quad) vf6) + ) + (let ((a1-6 s4-0)) + (let ((v1-9 s4-0)) + (let ((a0-11 (-> s5-0 origin fvec))) + (let ((a2-2 f0-8)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-11 quad)) + ) + (.lvf vf4 (&-> v1-9 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! (-> arg1 vel-sxvel x) (-> s4-0 x)) + (set! (-> arg1 vel-sxvel y) (-> s4-0 y)) + (set! (-> arg1 vel-sxvel z) (-> s4-0 z)) + ) + (-> arg1 vel-sxvel) + (set! (-> arg1 user-float) (+ (-> s5-0 origin trans y) (-> arg1 omega))) + ) + ) + ) + 0.0 + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctywide-fruit + :id 253 + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 6) + :rotate ((degrees 30) (degrees 0) (degrees 0)) + :parts ((sp-item 1153 :flags (sp3 sp7)) + (sp-item 1154 :flags (sp3 sp7)) + (sp-item 1155 :flags (sp3 sp7)) + (sp-item 1156 :flags (sp3 sp7)) + (sp-item 1157 :flags (sp3 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1153 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 8.0 2.0) + (:x (meters 2.2) 2 (meters 0.75)) + (:y (meters 1.1)) + (:z (meters -1.25) 2 (meters 0.75)) + (:scale-x (meters 0.6) (meters 0.15)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 40.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 9)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1638.4) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1158) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1158 + :init-specs ((:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.96 0.02) + (:func 'fruit-check-ground-bounce) + (:next-time (seconds 2) (seconds 3.997)) + (:next-launcher 1159) + ) + ) + +;; failed to figure out what this is: +(defpart 1157 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 40.0) + (:x (meters -3.7) 7 (meters 0.25)) + (:y (meters 1.1)) + (:z (meters -1.1) 7 (meters 0.25)) + (:scale-x (meters 0.25) (meters 0.1)) + (:scale-y (meters 0.35) (meters 0.1)) + (:r 0.0 1 120.0) + (:g 90.0 20.0) + (:b 0.0 1 80.0) + (:a 128.0) + (:omega (degrees 4.5)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 819.2) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1160) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1156 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 24.0) + (:x (meters -3.6) 7 (meters 0.25)) + (:y (meters 1.25)) + (:z (meters -1.075) 6 (meters 0.25)) + (:scale-x (meters 0.25) (meters 0.1)) + (:scale-y (meters 0.35) (meters 0.1)) + (:r 0.0 1 120.0) + (:g 90.0 20.0) + (:b 0.0 1 80.0) + (:a 128.0) + (:omega (degrees 4.5)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 819.2) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1160) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1160 + :init-specs ((:rot-z (degrees 0) (degrees 360)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.97 0.02) + (:func 'fruit-check-ground-bounce) + (:next-time (seconds 1.5) (seconds 2.997)) + (:next-launcher 1161) + ) + ) + +;; failed to figure out what this is: +(defpart 1161 + :init-specs ((:rotvel-z (degrees 0)) (:fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpart 1155 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 32.0) + (:x (meters -0.8) 3 (meters 0.5)) + (:y (meters 1)) + (:z (meters -1) 3 (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.15)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 100.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 6.7500005)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1228.8) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1162) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1154 + :init-specs ((:texture (fruit1 waswide-sprite)) + (:num 32.0) + (:x (meters -0.55) 2 (meters 0.5)) + (:y (meters 1.25)) + (:z (meters -0.8) 2 (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.15)) + (:scale-y :copy scale-x) + (:r 140.0 64.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6.7500005)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 1228.8) + (:func 'fruit-sparticle-next-on-mode-1) + (:next-launcher 1162) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1162 + :init-specs ((:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.97 0.02) + (:func 'fruit-check-ground-bounce) + (:next-time (seconds 2) (seconds 3.997)) + (:next-launcher 1159) + ) + ) + +;; failed to figure out what this is: +(defpart 1159 + :init-specs ((:fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fruit-stand cty-fruit-stand cty-fruit-stand-lod0-jg cty-fruit-stand-idle-ja + ((cty-fruit-stand-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; definition for function fruit-stand-event-handler +;; WARN: Return type mismatch none vs object. +(defbehavior fruit-stand-event-handler fruit-stand ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((gp-0 (the-as attack-info (-> arg3 param 1)))) + (when (and (!= (-> gp-0 id) (-> self incoming-attack-id)) + (nonzero? (-> self part)) + (zero? (-> self part state-mode 0)) + ) + (sound-play "break-veg-wood") + (set! (-> self incoming-attack-id) (-> gp-0 id)) + (set! (-> self part state-mode 0) (the-as uint 1)) + (when (not (run-logic? self)) + (format 0 "Killing self!~%") + (when (-> self parts-alive?) + (set! (-> self parts-alive?) #f) + (kill-particles (-> self part)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 12 of type fruit-stand +(defmethod run-logic? ((this fruit-stand)) + "Should this process be run? Checked by execute-process-tree." + (if (-> this parts-alive?) + (call-parent-method this) + #t + ) + ) + +;; failed to figure out what this is: +(defstate idle (fruit-stand) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (fruit-stand-event-handler proc argc message block) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (when (-> self parts-alive?) + (dotimes (gp-0 (the-as int (-> self num-sparts))) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (s4-0 (-> *sp-particle-system-2d* cpuinfo-table (-> self sparts-index gp-0))) + ) + (when (and (nonzero? (-> s4-0 key)) (= (-> s4-0 key group) (lookup-part-group-by-name "group-ctywide-fruit"))) + (set! (-> s5-0 start-pos quad) (-> self sparts-pos gp-0 quad)) + (+! (-> s5-0 start-pos y) 4096.0) + (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) + (let ((v1-11 s5-0)) + (set! (-> v1-11 radius) (-> s4-0 omega)) + (set! (-> v1-11 collide-with) (collide-spec backgnd)) + (set! (-> v1-11 ignore-process0) #f) + (set! (-> v1-11 ignore-process1) #f) + (set! (-> v1-11 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-11 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (if (>= f0-7 0.0) + (set! (-> s4-0 user-float) (+ (-> s5-0 start-pos y) (* (-> s5-0 move-dist y) f0-7))) + ) + (when (< f0-7 0.0) + ) + ) + ) + ) + ) + (+! (-> self first-sparts) (-> self num-sparts)) + (when (>= (-> self first-sparts) (-> self count-sparts)) + (set! (-> self first-sparts) (the-as uint 0)) + 0 + ) + (set! (-> self num-sparts) (the-as uint 0)) + (set! (-> self hack-counter) (the-as uint 4)) + (set! (-> self count-sparts) (the-as uint 0)) + 0 + ) + (let ((a0-16 (new 'stack 'sphere))) + (set! (-> a0-16 quad) (-> self root trans quad)) + (set! (-> a0-16 r) (-> self root root-prim local-sphere w)) + (cond + ((or (= (-> self part state-mode 0) 1) + (and (sphere-in-view-frustum? a0-16) + (< (vector-vector-distance (-> self root trans) (math-camera-pos)) 491520.0) + ) + ) + (when (not (-> self parts-alive?)) + (initialize (-> self part) (-> *part-group-id-table* 253) self) + (set! (-> self parts-alive?) #t) + ) + (spawn-from-cspace (-> self part) (the-as cspace (-> self node-list data))) + ) + (else + (when (-> self parts-alive?) + (set! (-> self parts-alive?) #f) + (kill-particles (-> self part)) + ) + ) + ) + ) + (ja-post) + ) + ) + +;; definition for method 29 of type fruit-stand +;; WARN: Return type mismatch int vs none. +(defmethod fruit-stand-method-29 ((this fruit-stand)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 0) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 30 of type fruit-stand +;; WARN: Return type mismatch int vs none. +(defmethod fruit-stand-method-30 ((this fruit-stand)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 253) this)) + (set! (-> this parts-alive?) #t) + 0 + (none) + ) + +;; definition for method 11 of type fruit-stand +(defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor)) + (fruit-stand-method-29 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fruit-stand" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (fruit-stand-method-30 this) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/dogat_REF.gc b/test/decompiler/reference/jak3/levels/wascity/dogat_REF.gc new file mode 100644 index 0000000000..32d9af0dbc --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/dogat_REF.gc @@ -0,0 +1,560 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type dogat +(deftype dogat (nav-enemy) + ((rotation-matrix matrix :inline) + (scared-timer time-frame) + ) + (:state-methods + sit-idle + ) + (:methods + (dogat-method-191 (_type_) none) + ) + ) + +;; definition for method 3 of type dogat +(defmethod inspect ((this dogat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Trotation-matrix: #~%" (-> this rotation-matrix)) + (format #t "~2Tscared-timer: ~D~%" (-> this scared-timer)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-dogat dogat dogat-lod0-jg dogat-idle-ja + ((dogat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow dogat-shadow-mg + ) + +;; definition for symbol *dogat-nav-enemy-info*, type nav-enemy-info +(define *dogat-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 7 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 15) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 3 + :param1 6 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 15) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x5 + :param0 2 + :param1 4 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 15) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x6 + :param0 2 + :param1 4 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 3 + :hostile-anim 7 + :hit-anim -1 + :knocked-anim 8 + :knocked-land-anim 9 + :die-anim 3 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :look-at-joint 23 + :bullseye-joint 3 + :sound-hit (static-sound-name "dogat-hit") + :sound-die (static-sound-name "dogat-die") + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :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) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :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 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :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) + :knocked-off #f + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 7 + :turn-anim -1 + :run-anim 7 + :taunt-anim -1 + :run-travel-speed (meters 15) + :run-acceleration (meters 6) + :run-turning-acceleration (meters 50) + :walk-travel-speed (meters 7.5) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 25) + :maximum-rotation-rate (degrees 1440) + :notice-nav-radius (meters 2) + :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! (-> *dogat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for function dogat-travel-post +;; WARN: Return type mismatch symbol vs none. +(defbehavior dogat-travel-post dogat () + (none) + ) + +;; failed to figure out what this is: +(defstate idle (dogat) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy idle) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self scared-timer) 0) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate sit-idle (dogat) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self state-timeout) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.6 2.1))))) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-4 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + ) + :trans (behavior () + (let ((v1-0 (-> self focus aware))) + (cond + ((= v1-0 (enemy-aware ea4)) + (go-flee self) + ) + ((< (the-as int v1-0) 1) + (go-virtual idle) + ) + ) + ) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) + (go-virtual active) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let ((gp-0 (rand-vu-int-range 2 4))) + (dotimes (s5-0 gp-0) + (ja-no-eval :group! dogat-idle-sit-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (let ((gp-1 (rand-vu-int-range 2 4))) + (dotimes (s5-1 gp-1) + (ja-no-eval :group! dogat-idle-situp-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (let ((gp-2 (rand-vu-int-range 2 4))) + (dotimes (s5-2 gp-2) + (ja-no-eval :group! dogat-idle-eat-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + ) + #f + ) + :post (behavior () + (nav-enemy-simple-post) + ) + ) + +;; failed to figure out what this is: +(defstate active (dogat) + :virtual #t + :enter (behavior () + (local-vars (v1-12 symbol) (v1-15 vector) (f0-4 float)) + (let ((t9-0 (-> (method-of-type nav-enemy active) enter))) + (if t9-0 + (t9-0) + ) + ) + (let* ((a2-0 (-> self root trans)) + (gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (closest-point-on-mesh (-> self nav) gp-0 a2-0 (the-as nav-poly #f))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 0)) + (until (< f0-4 (sqrtf (+ (* (-> v1-15 x) (-> v1-15 x)) (* (-> v1-15 z) (-> v1-15 z))))) + (vector-rotate-around-y! s5-0 (-> self rotation-matrix fvec) (* 182.04445 (rand-vu-float-range -175.0 175.0))) + (vector-normalize! s5-0 (* 4096.0 (rand-vu-float-range 10.0 24.0))) + (clamp-vector-to-mesh-cross-gaps + (-> self nav) + gp-0 + s4-0 + s5-0 + 204.8 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (+! s3-0 1) + (when (< 6 s3-0) + (set! v1-12 #f) + (goto cfg-8) + ) + (set! f0-4 16384.0) + (set! v1-15 s5-0) + ) + ) + (set! v1-12 #t) + (label cfg-8) + (if v1-12 + (vector+! (-> self move-dest) gp-0 s5-0) + (set! (-> self move-dest quad) (-> gp-0 quad)) + ) + ) + ) + :trans (behavior () + '() + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (ja-no-eval :group! dogat-run0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ((-> (method-of-type nav-enemy active) trans)) + (if (< (vector-vector-xz-distance (-> self move-dest) (-> self root trans)) 8192.0) + (go-virtual sit-idle) + ) + ) + #f + ) + :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-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate notice (dogat) + :virtual #t + :enter (behavior () + (go-virtual flee) + ) + ) + +;; failed to figure out what this is: +(defstate flee (dogat) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim))) + (ja :num-func num-func-identity :frame-num 0.0) + (until #f + (suspend) + (ja :num! (loop! 2.0)) + ) + #f + ) + ) + +;; definition for method 78 of type dogat +(defmethod go-hostile ((this dogat)) + (set-time! (-> this scared-timer)) + (go (method-of-object this flee)) + ) + +;; definition for method 108 of type dogat +(defmethod enemy-method-108 ((this dogat) (arg0 process-focusable)) + (or (< (vector-vector-xz-distance (-> this root trans) (get-trans arg0 0)) 143360.0) + (not (time-elapsed? (-> this scared-timer) (seconds 4))) + ) + ) + +;; definition for method 114 of type dogat +(defmethod send-attack-to-all-tshapes ((this dogat) (arg0 process-focusable) (arg1 event-message-block)) + 0 + ) + +;; definition for method 120 of type dogat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this dogat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list projectile) + ) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 9011.2) + (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 enemy)) + (set! (-> v1-13 prim-core action) (collide-action solid no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2) + ) + (set! (-> s5-0 nav-radius) 4096.0) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 50 of type dogat +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this dogat) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 1) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0))) + (set! (-> v1-4 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + ) + ) + ((or (= v1-0 2) (zero? v1-0)) + (set! (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 prim-core collide-with) + (collide-spec) + ) + 0 + ) + ) + ) + (none) + ) + +;; definition for method 121 of type dogat +;; WARN: Return type mismatch shadow-control vs none. +(defmethod init-enemy! ((this dogat)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dogat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *dogat-nav-enemy-info*) + (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask civilian)) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + -4096.0 + 4096.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf00 shdf04) + 245760.0 + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/wasall-init_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasall-init_REF.gc new file mode 100644 index 0000000000..0e3750bdb7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/wasall-init_REF.gc @@ -0,0 +1,109 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *wasall-reserve*, type symbol +(define *wasall-reserve* #f) + +;; definition for function wasall-login +;; WARN: Return type mismatch int vs none. +(defun wasall-login ((arg0 level)) + (let ((gp-0 (the-as int (-> *game-info* current-vehicle)))) + (when (or (< (the-as uint gp-0) (the-as uint 12)) + (< (the-as uint 19) (the-as uint gp-0)) + (not (have-vehicle-v-type? gp-0)) + ) + (let ((s5-0 12)) + (countdown (s4-0 8) + (if (have-vehicle-v-type? s5-0) + (set! gp-0 s5-0) + ) + (+! s5-0 1) + ) + ) + (set! (-> *game-info* current-vehicle) (the-as game-vehicle-u8 gp-0)) + ) + ) + 0 + (none) + ) + +;; definition for function wasall-logout +;; WARN: Return type mismatch int vs none. +(defun wasall-logout ((arg0 level)) + (set! *trail-graph* #f) + 0 + (none) + ) + +;; definition for function wasall-activate +;; WARN: Return type mismatch int vs none. +(defun wasall-activate ((arg0 level)) + (let ((v1-0 *traffic-info*) + (a1-0 (-> arg0 name)) + ) + (set! (-> v1-0 vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 12) a1-0) + (set! (-> v1-0 vehicle-levels 13) a1-0) + (set! (-> v1-0 vehicle-levels 14) a1-0) + (set! (-> v1-0 vehicle-levels 15) a1-0) + (set! (-> v1-0 vehicle-levels 16) a1-0) + (set! (-> v1-0 vehicle-levels 17) a1-0) + (set! (-> v1-0 vehicle-levels 18) a1-0) + (set! (-> v1-0 vehicle-levels 19) a1-0) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +;; definition for function wasall-deactivate +;; WARN: Return type mismatch int vs none. +(defun wasall-deactivate ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 vehicle-level) (the-as basic #f)) + ) + (vehicle-manager-kill) + 0 + (none) + ) + +;; definition for function desert-game-activate +;; WARN: Return type mismatch int vs none. +(defun desert-game-activate ((arg0 level)) + (let ((v1-0 *traffic-info*) + (a0-1 (-> arg0 name)) + ) + (set! (-> v1-0 vehicle-levels 20) a0-1) + (set! (-> v1-0 vehicle-levels 22) a0-1) + (set! (-> v1-0 vehicle-levels 23) a0-1) + ) + 0 + (none) + ) + +;; definition for function desert-race-level-activate +;; WARN: Return type mismatch int vs none. +(defun desert-race-level-activate ((arg0 level)) + (let ((v1-0 *traffic-info*) + (a1-0 (-> arg0 name)) + ) + (set! (-> v1-0 race-vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 20) a1-0) + ) + 0 + (none) + ) + +;; definition for function desert-race-level-deactivate +;; WARN: Return type mismatch int vs none. +(defun desert-race-level-deactivate ((arg0 level)) + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 race-vehicle-level) (the-as basic #f)) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/wasall-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasall-obs_REF.gc new file mode 100644 index 0000000000..09de5b1e9a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/wasall-obs_REF.gc @@ -0,0 +1,1757 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-airlock wascity-airlock wascity-airlock-lod0-jg wascity-airlock-idle-ja + ((wascity-airlock-lod0-mg (meters 999999))) + :bounds (static-spherem 0 12 0 40) + ) + +;; definition of type wascity-airlock +(deftype wascity-airlock (com-airlock) + () + ) + +;; definition for method 3 of type wascity-airlock +(defmethod inspect ((this wascity-airlock)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type wascity-airlock +(defmethod init-from-entity! ((this wascity-airlock) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 49152.0 0.0 122880.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 81920.0 40960.0 0.0 81920.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -81920.0 40960.0 0.0 81920.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-airlock" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this allow-pilot?) #t) + (set! (-> this sound-gear) (static-sound-spec "w-door-steam" :group 1)) + (set! (-> this gear-stop-frame) 2.0) + (set! (-> this sound-open) (static-sound-spec "w-door-op-strt" :group 1)) + (set! (-> this sound-open-loop) (static-sound-spec "w-door-roll" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "w-door-open-hit" :group 1)) + (set! (-> this sound-close) (static-sound-spec "w-door-cls-star" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "w-door-roll" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "w-door-cls-hit" :group 1)) + (go (method-of-object this close) #t) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-airlock-small wascity-airlock-small wascity-airlock-small-lod0-jg wascity-airlock-small-idle-ja + ((wascity-airlock-small-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 20) + ) + +;; definition of type wascity-airlock-small +(deftype wascity-airlock-small (com-airlock) + () + ) + +;; definition for method 3 of type wascity-airlock-small +(defmethod inspect ((this wascity-airlock-small)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type wascity-airlock-small +(defmethod init-from-entity! ((this wascity-airlock-small) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (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 obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 40960.0 0.0 81920.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 32768.0 0.0 0.0 40960.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 7) + (set-vector! (-> v1-10 local-sphere) -32768.0 0.0 0.0 40960.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 -8192.0 0.0 40960.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-wascity-airlock-small" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-gear) (static-sound-spec "air-door-steam" :group 1)) + (set! (-> this gear-stop-frame) 2.0) + (set! (-> this sound-open) (static-sound-spec "air-ver-open" :group 1)) + (set! (-> this sound-open-loop) (static-sound-spec "air-horiz-slide" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "air-horiz-hit" :group 1)) + (set! (-> this sound-close) (static-sound-spec "air-horiz-close" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "air-hor-sld-cls" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "air-hor-cls-hit" :group 1)) + (set! (-> this sound-post-close) (static-sound-spec "air-ver-cls-hit" :group 1)) + (go (method-of-object this close) #t) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-elevator-door wascity-elevator-door wascity-elevator-door-lod0-jg wascity-elevator-door-idle-ja + ((wascity-elevator-door-lod0-mg (meters 20)) + (wascity-elevator-door-lod1-mg (meters 40)) + (wascity-elevator-door-lod2-mg (meters 999999)) + ) + :bounds (static-spherem 0 10 0 20) + ) + +;; definition of type wascity-elevator-door +(deftype wascity-elevator-door (com-airlock) + () + ) + +;; definition for method 3 of type wascity-elevator-door +(defmethod inspect ((this wascity-elevator-door)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate open (wascity-elevator-door) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (let ((v1-0 message) + (a0-1 'front) + ) + (cond + ((= v1-0 a0-1) + (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) + (f0-0 (check-crossing-distance self (camera-pos) #f)) + ) + (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< 2048.0 f30-0) + (>= (* f30-0 f0-0) 0.0) + ) + ) + ) + (else + (let ((t9-4 (-> (method-of-type com-airlock open) event))) + (if t9-4 + (t9-4 (the-as process a0-1) argc message block) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 11 of type wascity-elevator-door +(defmethod init-from-entity! ((this wascity-elevator-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 53248.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 53248.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-wascity-elevator-door" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "ver-open-hit" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "ver-open-hit" :group 1)) + (go (method-of-object this close) #t) + ) + +;; definition of type tentacle +(deftype tentacle (process-drawable) + ((init-pos vector :inline) + (focus-pos vector :inline) + (nav-mesh nav-mesh) + (active-timer time-frame) + (fade-level float) + (sound-id-loop sound-id) + (sound-id-attack sound-id) + ) + (:state-methods + dormant + un-dive-player + attacking-0 + attacking-1 + kill-player + wait + ) + ) + +;; definition for method 3 of type tentacle +(defmethod inspect ((this tentacle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tinit-pos: #~%" (-> this init-pos)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~2Tactive-timer: ~D~%" (-> this active-timer)) + (format #t "~2Tfade-level: ~f~%" (-> this fade-level)) + (format #t "~2Tsound-id-loop: ~D~%" (-> this sound-id-loop)) + (format #t "~2Tsound-id-attack: ~D~%" (-> this sound-id-attack)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-tentacle tentacle tentacle-lod0-jg tentacle-emerge-ja + ((tentacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 20 0 20) + ) + +;; definition for function tentacle-follow-post +;; INFO: Used lq/sq +(defbehavior tentacle-follow-post tentacle () + (let ((a0-0 *target*)) + (when a0-0 + (set! (-> self focus-pos quad) (-> (get-trans a0-0 0) quad)) + (set-vector! (-> self root trans) (-> self focus-pos x) (-> self root trans y) (-> self focus-pos z) 1.0) + ) + ) + (ja-post) + (none) + ) + +;; definition for function tentacle-attack-handler +(defbehavior tentacle-attack-handler tentacle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('target) + (case (-> arg3 param 0) + (('die) + (when (= (-> arg3 param 1) 'tentacle) + (go-virtual kill-player) + #t + ) + ) + ) + ) + (('joint) + 3 + ) + ) + ) + +;; failed to figure out what this is: +(defstate dormant (tentacle) + :virtual #t + :enter (behavior () + (set! (-> self active-timer) 0) + 0 + ) + :exit (behavior () + (set-setting! 'dive #f 0.0 0) + (set-setting! 'board #f 0.0 0) + (set-setting! 'gun #f 0.0 0) + (set-setting! 'jump #f 0.0 0) + (set-setting! 'double-jump #f 0.0 0) + (logior! (-> self draw status) (draw-control-status force-fade)) + (set! (-> self fade-level) 0.0) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (-> self fade-level))))) + ) + :trans (behavior () + (local-vars (v1-13 target)) + (if (not (-> self nav-mesh)) + (set! (-> self nav-mesh) (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0)) + ) + (let ((gp-0 *target*)) + (if (not (and gp-0 + (not (focus-test? *target* dead flut)) + (-> self nav-mesh) + (= (-> *game-info* mode) 'play) + (nav-mesh-method-11 (-> self nav-mesh) (get-trans gp-0 0)) + (begin (set! v1-13 gp-0) v1-13) + (or (focus-test? v1-13 on-water under-water) + (= (-> v1-13 control ground-pat material) (pat-material waterbottom)) + ) + ) + ) + (set-time! (-> self active-timer)) + ) + (when (and gp-0 (time-elapsed? (-> self active-timer) (seconds 0.1))) + (set! (-> self root trans quad) (-> (get-trans gp-0 0) quad)) + (set! (-> self root trans y) (+ -114688.0 (get-base-height *ocean-map*))) + (set! (-> self init-pos quad) (-> self root trans quad)) + (if (focus-test? gp-0 under-water) + (go-virtual un-dive-player) + (go-virtual attacking-0) + ) + ) + ) + ) + :code sleep-code + :post #f + ) + +;; failed to figure out what this is: +(defstate un-dive-player (tentacle) + :virtual #t + :trans (behavior () + (let ((v1-0 *target*)) + (cond + ((not v1-0) + (go empty-state) + ) + ((not (focus-test? v1-0 under-water)) + (go-virtual attacking-0) + ) + ) + ) + ) + :code sleep-code + :post tentacle-follow-post + ) + +;; failed to figure out what this is: +(defstate attacking-0 (tentacle) + :virtual #t + :event tentacle-attack-handler + :trans (behavior () + (set! (-> self sound-id-attack) + (add-process *gui-control* self (gui-channel background) (gui-action queue) "tentacle" -99.0 0) + ) + (sound-play "tentacle-loop" :id (-> self sound-id-loop)) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! tentacle-emerge-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual attacking-1) + ) + :post (behavior () + (set! (-> self fade-level) (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (-> self fade-level))))) + (let ((f30-2 (fmax 0.0 (fmin 1.0 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))))) + (set! (-> *part-id-table* 1644 init-specs 11 initial-valuef) (lerp 6.826667 54.613335 f30-2)) + (set! (-> *part-id-table* 1644 init-specs 11 random-rangef) + (the-as float (the int (lerp 6.826667 54.613335 f30-2))) + ) + (set! (-> *part-id-table* 1644 init-specs 10 initial-valuef) (the-as float (the int (lerp 4.0 16.0 f30-2)))) + (set! (-> *part-id-table* 1644 init-specs 10 random-rangef) (the-as float (the int (lerp 4.0 16.0 f30-2)))) + ) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self root))) + (set-vector! gp-0 (-> s4-0 trans x) (get-base-height *ocean-map*) (-> s4-0 trans z) 1.0) + ) + (spawn (-> self part) gp-0) + ) + (tentacle-follow-post) + ) + ) + +;; failed to figure out what this is: +(defstate attacking-1 (tentacle) + :virtual #t + :event tentacle-attack-handler + :exit (behavior () + (sound-stop (-> self sound-id-loop)) + ) + :trans (behavior () + (while (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'tentacle)) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self root))) + (set-vector! gp-0 (-> s4-0 trans x) (get-base-height *ocean-map*) (-> s4-0 trans z) 1.0) + ) + (cond + ((logtest? (-> *part-group-id-table* 409 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 409)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 409)) + ) + ) + ) + (tentacle-follow-post) + ) + ) + +;; failed to figure out what this is: +(defstate kill-player (tentacle) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('joint) + 3 + ) + ) + ) + :enter (behavior () + (sound-params-set! *gui-control* (-> self sound-id-attack) #f -1 -1 -1 1.0) + (set-action! + *gui-control* + (gui-action play) + (-> self sound-id-attack) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + :exit (behavior () + (if *target* + (send-event *target* 'end-mode 'bot) + ) + ) + :code (behavior () + (ja-channel-push! 1 0) + (ja-no-eval :group! tentacle-tentacle-attack-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual wait) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate wait (tentacle) + :virtual #t + :code sleep-code + ) + +;; definition for method 11 of type tentacle +(defmethod init-from-entity! ((this tentacle) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 64) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-tentacle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 408) this)) + (set! (-> this nav-mesh) #f) + (set! (-> this sound-id-loop) (new-sound-id)) + (set! (-> this sound-id-attack) (new-sound-id)) + (go (method-of-object this dormant)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-terraformer-des-fma-2 terraformer terraformer-lod0-jg terraformer-walk-ja + ((terraformer-lod0-mg (meters 20)) (terraformer-lod0-mg (meters 40)) (terraformer-lod0-mg (meters 999999))) + :bounds (static-spherem 0 175 75 25000) + :origin-joint-index 3 + :global-effects 32 + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "desert-final-boss-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-211" + :art-group "scenecamera" + :anim "desert-final-boss-intro" + :parts 24 + :command-list '((0 + (kill "terraformer-1") + (apply ,(lambda () + (set! (-> *sky-work* disable-day-star) (the-as basic #t)) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 0.0 0.0) + (set-cloud-and-fog-interp! *mood-control* 0.0 0.5 1.0 1.0) + (set-time-for-random-weather! *mood-control* 180.0 180.0) + ) + ) + (apply ,(lambda () + (set-setting! 'fog-special-interp-targ #f 0.15 0) + (set-setting! 'dust-storm-fog-scalar #f 0.5 0) + (set-setting! 'fog-special-interp-rate #f 1000.0 0) + ) + ) + ) + (1 (part-tracker + "group-cloud-spread" + entity + "particleman" + joint + "particleK" + track + #t + duration + (frame-range 1 2000) + ) + ) + (10 (part-tracker + "group-desert-final-boss-gate" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 10 20) + ) + ) + (21 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 21 22) + ) + ) + (25 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 25 26) + ) + ) + (26 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 26 27) + ) + ) + (27 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 27 28) + ) + ) + (41 (part-tracker + "group-desert-final-boss-gate" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 41 51) + ) + ) + (57 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleH" + track + #t + duration + (frame-range 57 58) + ) + ) + (59 (part-tracker + "group-desert-boss-slide-dust" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-range 59 75) + ) + ) + (125 + (part-tracker + "group-desert-fireball-shot" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 125 260) + ) + (part-tracker + "group-desert-fireball-shot-trail" + entity + "particleman" + joint + "particleJ" + track + #t + duration + (frame-range 125 260) + subsample-num + (new 'static 'bfloat :data 5.0) + ) + ) + (192 (part-tracker + "group-desert-fireball-explosion" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-range 192 193) + ) + ) + (275 (apply ,(lambda () + (set-setting! 'fog-special-interp-targ #f 0.4 0) + (set-setting! 'dust-storm-fog-scalar #f 0.4 0) + (set-setting! 'fog-special-interp-rate #f 0.03 0) + ) + ) + ) + (696 (apply ,(lambda () + (set-setting! 'fog-special-interp-targ #f 0.15 0) + (set-setting! 'dust-storm-fog-scalar #f 1.0 0) + (set-setting! 'fog-special-interp-rate #f 1000.1 0) + ) + ) + ) + (1066 (fadeout (frame-time-30 10))) + (10000 (task-close! "desert-final-boss-introduction")) + ) + :cut-list '(0 87 136 260 696 768 875 1013) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'desboss1 + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'desboss1 + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((16 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(1013) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'desboss1 + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((50 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "errol" + :level 'deserrol + :art-group "skel-errol" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "v-snake" + :level 'wasall + :art-group "skel-v-snake" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x2 + ) + (new 'static 'scene-actor + :name "snake-wheel-fma" + :level 'desboss1 + :art-group "skel-snake-wheel-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-2" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-2" + :prefix "" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x2 + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-a" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-a" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-b" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-b" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-leg-c" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-leg-c" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "lf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "lm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "lr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "rf-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "rm-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-des-fma-spike" + :level 'desboss1 + :art-group "skel-terraformer-des-fma-spike" + :prefix "rr-" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "terraformer-head" + :level 'desboss1 + :art-group "skel-terraformer-head" + :prefix "" + :draw-frames '((260 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasall-final-boss-intro-movie" + :end-point "desertb-final-boss-start" + :borrow '((desert-game alias desert copy desboss1 special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "arena-outro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-106" + :art-group "scenecamera" + :anim "arena-outro" + :parts #xb4 + :command-list '((0 (fadein (frame-time-30 10)) (send-event *time-of-day* 'change 'hour (int 14))) + (10 + (part-tracker + "group-precursor-staff-shot-glow" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 10 5300) + ) + ) + (2744 + (part-tracker + "group-precursor-staff-shot" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 2744 2750) + ) + ) + (2763 + (part-tracker + "group-precursor-staff-hit" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 2763 2764) + ) + ) + (2985 + (part-tracker + "group-precursor-staff-shot" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 2985 2996) + ) + ) + (3009 + (part-tracker + "group-precursor-staff-hit" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 3009 3010) + ) + ) + (3320 + (part-tracker + "group-ship-door-light" + entity + "precursor-ship" + joint + "door_glow" + track + #t + duration + (frame-range 3320 4385) + ) + ) + (4371 + (part-tracker + "group-mothership-thrusters" + entity + "precursor-ship" + joint + "thruster_a" + track + #t + duration + (frame-range 4371 4577) + ) + (part-tracker + "group-mothership-thrusters" + entity + "precursor-ship" + joint + "thruster_b" + track + #t + duration + (frame-range 4371 4577) + ) + (part-tracker + "group-mothership-thrusters" + entity + "precursor-ship" + joint + "thruster_c" + track + #t + duration + (frame-range 4371 4577) + ) + ) + (5380) + (5390 (fadeout (frame-time-30 10))) + (10000) + (10000 (task-close! "city-win-introduction")) + ) + :cut-list '(208 + 327 + 495 + 672 + 786 + 916 + 1061 + 1168 + 1245 + 1300 + 1387 + 1526 + 1678 + 1749 + 1803 + 1883 + 1954 + 2276 + 2385 + 2557 + 2722 + 2750 + 2918 + 2996 + 3225 + 3292 + 3380 + 3453 + 3598 + 3689 + 3827 + 3894 + 4028 + 4169 + 4318 + 4371 + 4513 + 4578 + 4629 + 4683 + 4857 + 5020 + 5300 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'outrocst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'outrocst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (1300 1678) (1803 1954) (3292 3380) (3598 3689) (4169 4399) (4683 5401)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(4371 5020) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x3a2 + ) + (new 'static 'scene-actor + :name "precursor-ship" + :level 'loutro + :art-group "skel-precursor-ship" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'loutro + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (1803 2276) (2385 2722) (2749 2764)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-leader" + :level 'loutro + :art-group "skel-ottsel-leader" + :prefix "" + :draw-frames '((0 327) + (786 1061) + (1168 1300) + (1387 1526) + (1803 1883) + (2276 2557) + (2722 2750) + (2918 2996) + (3292 3380) + (3598 3689) + (4169 4371) + ) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(2276) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-surfer" + :level 'loutro + :art-group "skel-ottsel-surfer" + :prefix "" + :draw-frames '((208 327) (786 1245) (1387 1526) (2722 2750) (2918 2996) (3292 3380) (3598 3689)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-veger" + :level 'loutro + :art-group "skel-ottsel-veger" + :prefix "" + :draw-frames '((3689 4169)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-tess" + :level 'loutro2 + :art-group "skel-ottsel-tess" + :prefix "" + :draw-frames '((3010 3380) (3453 3598) (4371 4513) (4683 5300)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sig-highres" + :level 'loutro2 + :art-group "skel-sig-highres" + :prefix "" + :draw-frames '((0 208) (327 672) (4371 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-daxpants" + :level 'loutro2 + :art-group "skel-ottsel-daxpants" + :prefix "" + :draw-frames '((2764 2918) (2996 3380) (3453 3598) (4371 4513) (4683 5401)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-dummy-outro" + :level 'loutro2 + :art-group "skel-ottsel-dummy-outro" + :prefix "" + :draw-frames '((0 327) (786 1061) (1168 1245) (1387 1526) (1803 1883) (3292 3380) (3598 3689)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ashelin-highres" + :level 'outrocst + :art-group "skel-ashelin-highres" + :prefix "" + :draw-frames '((1300 1387) (1526 1890) (3380 3453) (4371 4513) (4629 4683)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tess-highres" + :level 'outrocst + :art-group "skel-tess-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (1803 2276) (2385 2722) (2749 2918) (2996 3010)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "samos-highres" + :level 'outrocst + :art-group "skel-samos-highres" + :prefix "" + :draw-frames '((0 208) (327 672) (4371 4513) (4578 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "seem-highres" + :level 'outrocst + :art-group "skel-seem-highres" + :prefix "" + :draw-frames '((1300 1387) (1526 1890) (3380 3453) (4371 4513) (4629 4683)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kleever-highres" + :level 'outrocst + :art-group "skel-kleever-highres" + :prefix "" + :draw-frames '((0 208) (786 916) (3689 4169) (4371 4513) (4513 4578)) + :scissor-frames '((3535 4169)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'outrocst + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((327 786) (4371 4513) (4578 4629) (5020 5300)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "onin-simple" + :level 'loutro3 + :art-group "skel-onin-simple" + :prefix "" + :draw-frames '((327 495) (4371 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-ship-door" + :level 'loutro3 + :art-group "skel-precursor-ship-door" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "torn-simple" + :level 'outcast3 + :art-group "skel-torn-simple" + :prefix "" + :draw-frames '((1300 1387) (1526 1890) (3380 3453) (4371 4513) (4629 4683)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "keira-simple" + :level 'outcast3 + :art-group "skel-keira-simple" + :prefix "" + :draw-frames '((327 672) (4371 4513) (4578 4629)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "wstd-arena-plat" + :level 'wasstada + :art-group "skel-wstd-arena-plat" + :prefix "" + :draw-frames '((0 208) (786 916) (3689 4169) (4371 4513) (4513 4578)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "wasstada-outro" + :end-point "title-credits" + :borrow '((wasstada 0 loutro special) (outrocst 0 loutro2 special) (wasall 0 loutro3 special)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #x10f + :on-running #f + :on-complete #f + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/wasall-part_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasall-part_REF.gc new file mode 100644 index 0000000000..bc45c467de --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/wasall-part_REF.gc @@ -0,0 +1,1875 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-desert-buggy-dust + :id 383 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1587 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1587 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 0.2) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 30.0 10.0) + (:vel-y (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.044444446 -0.044444446) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.9) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-buggy-dust-stop + :id 384 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1588 :flags (sp7)) (sp-item 1589 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1588 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 30.0 10.0) + (:vel-z (meters 0.13333334)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.016666668 -0.016666668) + (:accel-y (meters 0) (meters 0.0001)) + (:friction 0.95) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 1590) + (:conerot-x (degrees 0) (degrees -10)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1590 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; definition for function spt-birth-func-brightness-buggy-dirt-bits +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-buggy-dirt-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 51) 200)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 1589 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-buggy-dirt-bits) + (:num 1.0 2.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.06666667) (meters 0.06666667)) + (:rotvel-z (degrees -2) (degrees 4)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees 0) (degrees -20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function spt-birth-func-part-buggy-dirt-bits +(defun spt-birth-func-part-buggy-dirt-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-buggy-dirt-bits arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-buggy-dust-skid + :id 385 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 1591 :flags (sp7)) (sp-item 1592 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1591 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0) + (:b 90.0) + (:a 30.0 10.0) + (:vel-z (meters -0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06666667 -0.06666667) + (:accel-y (meters 0) (meters 0.00016666666)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 1593) + (:conerot-x (degrees 10) (degrees 30)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1593 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpart 1592 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-buggy-skid-bits) + (:num 2.0) + (:scale-x (meters 0.1) (meters 0.05)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters -0.05) (meters -0.016666668)) + (:rotvel-z (degrees -2) (degrees 4)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-x (degrees 20)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function spt-birth-func-part-buggy-skid-bits +(defun spt-birth-func-part-buggy-skid-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-buggy-dirt-bits arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wascity-door-steam + :id 386 + :duration (seconds 1.335) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1594 :flags (sp7) :period (seconds 30) :length (seconds 1.335))) + ) + +;; failed to figure out what this is: +(defpart 1594 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-z (meters 0.01) (meters 0.013333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405c00)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wascity-door-pre-steam1 + :id 387 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1595 :period (seconds 20) :length (seconds 1) :offset 200)) + ) + +;; failed to figure out what this is: +(defpart 1595 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters -3) (meters 8)) + (:y (meters -6)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.06666667) (meters 0.13333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1596) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1596 + :init-specs ((:fade-a -0.011428571)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wascity-door-pre-steam2 + :id 388 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1597 :period (seconds 20) :length (seconds 1) :offset 200)) + ) + +;; failed to figure out what this is: +(defpart 1597 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters -3) (meters 8)) + (:y (meters -6)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.06666667) (meters 0.13333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1596) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wascity-door-big-steam1 + :id 389 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1598 :period (seconds 30) :length (seconds 2))) + ) + +;; failed to figure out what this is: +(defpart 1598 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 2.0) + (:x (meters -27)) + (:y (meters 8)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-x (meters -0.05) (meters -0.033333335)) + (:vel-y (meters -0.05) (meters -0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.93 0.03) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wascity-door-big-steam2 + :id 390 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1599 :period (seconds 30) :length (seconds 2))) + ) + +;; failed to figure out what this is: +(defpart 1599 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 2.0) + (:x (meters 27)) + (:y (meters 8)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 16.0) + (:vel-x (meters 0.05) (meters 0.033333335)) + (:vel-y (meters -0.05) (meters -0.033333335)) + (:scalevel-x (meters 0.01) (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.93 0.03) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wascity-door-big-pre-steam1 + :id 391 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1600 :period (seconds 20) :length (seconds 1))) + ) + +;; failed to figure out what this is: +(defpart 1600 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters -10) (meters -20)) + (:y (meters 0)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.13333334) (meters 0.26666668)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1601) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1601 + :init-specs ((:fade-a -0.011428571)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-wascity-door-big-pre-steam2 + :id 392 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1602 :period (seconds 20) :length (seconds 1))) + ) + +;; failed to figure out what this is: +(defpart 1602 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0) + (:x (meters 10) (meters 20)) + (:y (meters 0)) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 150.0) + (:g 120.0 10.0) + (:b 80.0 20.0) + (:a 0.0) + (:vel-z (meters -0.13333334) (meters 0.26666668)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.10666667) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.5)) + (:next-launcher 1601) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-wasdoors-gaslamp + :id 393 + :flags (sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1603 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1604 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1605 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1606 :fade-after (meters 200) :falloff-to (meters 300) :flags (sp7)) + (sp-item 1607 :fade-after (meters 20) :falloff-to (meters 30) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1603 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0 1.0) + (:z (meters 0.4)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 200.0) + (:a 0.0) + (:vel-z (meters -0.0016666667) (meters 0.0016666667)) + (:scalevel-x (meters -0.016666668)) + (:accel-x (meters -0.001)) + (:accel-z (meters 0.0013333333) (meters 0.0013333333)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0)) + (:conerot-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *wasdoors-range-color-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *wasdoors-range-alpha-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 96.0 :y 255.0 :z 256.0 :w 257.0) + :one-over-x-deltas (new 'static 'vector :x 159.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *wasdoors-range-scale-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *wasdoors-range-scale-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 4.0 :y 8.0 :z 9.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *r-wasdoors-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *g-wasdoors-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -1.0 :z -2.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *b-wasdoors-curve-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0) + :one-over-x-deltas (new 'static 'vector :y -5.0000005 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *wasdoors-curve-alpha-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.01 :y 0.01 :z 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :y 3.3000002 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *wasdoors-curve-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 0.3 :y 0.6 :z 0.5 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y -1.0 :z -0.75000006 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *wasdoors-curve-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 0.5 :w 0.6) + :one-over-x-deltas (new 'static 'vector :x 0.4 :y 0.5 :z 0.3333334 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-wasdoors-gas-lamp-flame-curve-settings*, type particle-curve-settings +(define *part-wasdoors-gas-lamp-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.3) + :lifetime-offset (seconds 0.2) + :flags (particle-curve-flags pcf1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 1603 init-specs 17 initial-valuef) + (the-as float *part-wasdoors-gas-lamp-flame-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* color-start) *wasdoors-range-color-flame*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* alpha-start) *wasdoors-range-alpha-flame*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-x-start) *wasdoors-range-scale-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-y-start) *wasdoors-range-scale-flame-y*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* r-scalar) *r-wasdoors-curve-flame*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* g-scalar) *g-wasdoors-curve-flame*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* b-scalar) *b-wasdoors-curve-flame*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* a-scalar) *wasdoors-curve-alpha-flame*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-x-scalar) *wasdoors-curve-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-wasdoors-gas-lamp-flame-curve-settings* scale-y-scalar) *wasdoors-curve-flame-y*) + +;; failed to figure out what this is: +(defpart 1604 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.3) (meters 0.6)) + (:y (meters -0.3) (meters 0.6)) + (:z (meters 0.3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 10.0 20.0) + (:g 10.0 20.0) + (:b 200.0) + (:a 64.0) + (:scalevel-x (meters -0.00033333333)) + (:fade-a -0.64) + (:accel-x (meters -0.001)) + (:accel-z (meters 0.0013333333) (meters 0.0013333333)) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1605 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.4) + (:x (meters -1)) + (:z (meters 2.5)) + (:scale-x (meters 12) (meters 6)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 32.0) + (:a 8.0 4.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1606 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 0.01 0.05) + (:scale-x (meters 0.3) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 8.0) + (:a 255.0) + (:vel-z (meters 0.06666667) (meters 0.016666668)) + (:fade-g -0.16666667) + (:fade-b -5.0) + (:fade-a -1.7) + (:accel-x (meters 0.0016666667)) + (:friction 0.95) + (:timer (seconds 2) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-y (degrees -20) (degrees 40)) + (:rotate-y (degrees -40)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1607 + :init-specs ((:num 0.2) + (:x (meters 0) (meters 2)) + (:y (meters -0.5) (meters 1)) + (:z (meters 6)) + (:rot-x 8) + (:r 8192.0) + (:g 1228.8) + (:b 1024.0) + (:accel-x (meters 0.001)) + (:accel-z (meters 0.0016666667)) + (:timer (seconds 0.335)) + (:flags (distort)) + (:rotate-y (degrees -30)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-wasdoors-red-lights + :id 394 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 1608 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 1608 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-elevator-palace-door + :id 395 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1609 :flags (sp7) :period (seconds 20) :length (seconds 2))) + ) + +;; failed to figure out what this is: +(defpart 1609 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -5) (meters 10)) + (:y (meters -7)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 90.0) + (:g 70.0) + (:b 50.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.93) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees -60) (degrees 120)) + (:conerot-z (degrees -30) (degrees 60)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-elevator-palace-door-close + :id 396 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1610 :flags (sp7) :period (seconds 20) :length (seconds 0.035))) + ) + +;; failed to figure out what this is: +(defpart 1610 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 30.0 10.0) + (:x (meters -5) (meters 10)) + (:y (meters -20)) + (:z (meters -5) (meters 10)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 90.0) + (:g 70.0) + (:b 50.0) + (:a 32.0 32.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.053333335 -0.053333335) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.93) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees -60) (degrees 120)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-fireball-shot + :id 397 + :flags (sp0) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1611 :flags (sp6)) (sp-item 1612)) + ) + +;; failed to figure out what this is: +(defpart 1611 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100) (meters 20)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 180.0) + (:b 0.0) + (:a 20.0 40.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 1612 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters -1)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-fireball-shot-trail + :id 398 + :flags (sp0 sp13) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 1613)) + ) + +;; failed to figure out what this is: +(defpart 1613 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 10)) + (:scale-x (meters 30) (meters 10)) + (:scale-y (meters 20) (meters 5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:scalevel-x (meters -0.06666667) (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.6666667) + (:fade-b -3.4) + (:accel-y (meters -0.0033333334) (meters -0.016666668)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:next-time (seconds 0.25)) + (:next-launcher 1614) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1614 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.48 -0.48)) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-fireball-explosion + :id 399 + :flags (sp0) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1615 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 1615 + :init-specs ((:texture (middot level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2500)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -6.6666665)) + (:scalevel-y :copy scalevel-x) + (:fade-b -0.10666667) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 1616) + ) + ) + +;; failed to figure out what this is: +(defpart 1616 + :init-specs ((:scalevel-x (meters -3.3333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:next-time (seconds 0.335)) + (:next-launcher 1617) + ) + ) + +;; failed to figure out what this is: +(defpart 1617 + :init-specs ((:scalevel-x (meters -2.6666667)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.5)) + (:next-launcher 1618) + ) + ) + +;; failed to figure out what this is: +(defpart 1618 + :init-specs ((:scalevel-x (meters -2.3333333)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.667)) + (:next-launcher 1619) + ) + ) + +;; failed to figure out what this is: +(defpart 1619 + :init-specs ((:scalevel-x (meters -2)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-cloud-spread + :id 400 + :duration (seconds 200) + :linger-duration (seconds 20) + :flags (sp0 sp1 sp4) + :bounds (static-bspherem 0 0 0 1000) + :parts ((sp-item 1620 :flags (is-3d sp7) :period (seconds 200) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 1620 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 100.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 2000)) + (:scale-x (meters 100) (meters 300)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:accel-z (meters 0.033333335)) + (:friction 0.3) + (:timer (seconds 20)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 6.4)) + (:next-launcher 1621) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1621 + :init-specs ((:fade-a 0.21333334) (:friction 0.0)) + ) + +;; definition for function spt-birth-func-brightness-part-desert-boss-slide-dust +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-part-desert-boss-slide-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 140)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (logand 0 (rand-uint31-gen *random-generator*)) 20)) + (v1-3 (+ (logand 0 (rand-uint31-gen *random-generator*)) 40)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-3))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-boss-slide-dust + :id 401 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1622)) + ) + +;; failed to figure out what this is: +(defpart 1622 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-part-desert-boss-slide-dust) + (:num 0.5) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 32.0 32.0) + (:vel-z (meters 0) (meters -0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-y (degrees -20) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-final-boss-gate + :id 402 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 1623 :flags (sp6 sp7)) + (sp-item 1624 :flags (sp6 sp7)) + (sp-item 1625 :flags (sp7)) + (sp-item 1626 :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1623 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 60.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 1624 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 0.0) + (:b 255.0) + (:a 60.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 1625 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 20.0) + (:scale-x (meters 0.5)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g 32.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 0.5) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1626 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters -0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.53333336) (degrees 1.0666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.13)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-precursor-staff-shot-glow + :id 403 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1627)) + ) + +;; failed to figure out what this is: +(defpart 1627 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0.6) (meters 0.3)) + (:rot-x (degrees 45)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:fade-a 0.6) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.167)) + (:next-launcher 1628) + ) + ) + +;; failed to figure out what this is: +(defpart 1628 + :init-specs ((:fade-a -0.6)) + ) + +;; failed to figure out what this is: +(defpartgroup group-precursor-staff-shot + :id 404 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1629 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1629 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 20.0) + (:y (meters 0) (meters 0.03)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 64.0) + (:a 32.0 32.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.03) (meters 0.0033333334)) + (:timer (seconds 0.835) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.635)) + (:next-launcher 1630) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1630 + :init-specs ((:scalevel-x (meters -0.00066666666) (meters 0.0013333333)) + (:scalevel-y :copy scalevel-x) + (:accel-x (meters -0.013333334) (meters 0.026666667)) + (:accel-y (meters -0.013333334) (meters 0.026666667)) + (:friction 0.5 0.1) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-precursor-staff-hit + :id 405 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1631 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 1631 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y (meters -0.06666667)) + (:fade-a -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ship-door-light + :id 406 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 1632 :flags (sp6)) + (sp-item 1633 :flags (is-3d)) + (sp-item 1634 :flags (is-3d)) + (sp-item 1635 :flags (is-3d)) + ) + ) + +;; failed to figure out what this is: +(defpart 1632 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 6.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1636 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1637) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 1637 + :init-specs ((:fade-a -2.56)) + ) + +;; failed to figure out what this is: +(defpart 1633 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1637) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 1634 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1637) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 1635 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 6) (meters 1)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 20)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 1638) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 20)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 1638 + :init-specs ((:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpartgroup group-mothership-thrusters + :id 407 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 1639 :flags (sp6)) (sp-item 1640 :flags (sp6)) (sp-item 1641 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 1640 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1639 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0) + (:b 255.0) + (:a 50.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 81920.0) + ) + ) + +;; failed to figure out what this is: +(defpart 1641 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:x (meters 0) (meters 4)) + (:scale-x (meters 6) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters -0.0033333334) (meters 0.006666667)) + (:vel-y (meters -0.033333335) (meters -0.016666668)) + (:vel-z (meters -0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.02) (meters 0.04)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 2.56) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40a000 #x409b00 #x409b00)) + (:next-time (seconds 0.085)) + (:next-launcher 1642) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1642 + :init-specs ((:fade-a -0.07314286 -0.14628571)) + ) + +;; failed to figure out what this is: +(defpartgroup group-tentacle-warn + :id 408 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 1643 :flags (sp7)) (sp-item 1644 :flags (sp7)) (sp-item 1645 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 1643 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 3.0) + (:x (meters 0) (meters 6)) + (:y (meters -3) (meters -5)) + (:scale-x (meters 0.1) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.006666667)) + (:fade-a 0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'check-bubble-height) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1644 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 3.0) + (:x (meters 0) (meters 3)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 32.0) + (:vel-y (meters 0.013333334) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1645 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.3) + (:x (meters 0)) + (:y (meters 0)) + (:scale-x (meters 3)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 40.0 40.0) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-tentacle-attack + :id 409 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 1646 :flags (sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 1647 :flags (sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 1648 :flags (sp7) :period (seconds 10) :length (seconds 0.067) :offset 325) + ) + ) + +;; failed to figure out what this is: +(defpart 1646 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters 0) (meters 1)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:scalevel-x (meters 0.001) (meters 0.001)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:func 'check-drop-group-center) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1647 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 100.0) + (:x (meters 0) (meters 1)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334)) + (:scalevel-x (meters -0.0033333334) (meters -0.0033333334)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.000033333334)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 78) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 1648 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters 0) (meters 2)) + (:y (meters 0)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 130.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.026666667)) + (:scalevel-x (meters 0.001) (meters 0.001)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 13.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 0) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-wascity-burning-bush-holo-on + :id 381 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1649 :flags (is-3d sp6 sp7)) + (sp-item 1650 :flags (is-3d sp6 sp7)) + (sp-item 1651 :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1652 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 2.0 4.0) + (:x (meters -2.25) (meters 4.5)) + (:y (meters 6.1)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 6)) + (:r 128.0 1 128.0) + (:g 255.0) + (:b 32.0) + (:a 0.0) + (:fade-a 1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.067)) + (:next-launcher 1653) + (:rotate-y (degrees 0) 1 (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 1653 + :init-specs ((:fade-a -1.6)) + ) + +;; failed to figure out what this is: +(defpart 1649 + :init-specs ((:texture (kleever-fist-logo desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 55.0) + (:g 55.0) + (:b 55.0) + (:a 160.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1651 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 8)) + (:r 255.0) + (:g 60.0) + (:b 10.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1650 + :init-specs ((:texture (kleever-fist-logo desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 4.8) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-wascity-burning-bush-holo-off + :id 382 + :flags (sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 1654 :flags (is-3d sp6 sp7)) + (sp-item 1655 :flags (is-3d sp6 sp7)) + (sp-item 1656 :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 1654 + :init-specs ((:texture (burning-bush-off desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.02)) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1656 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.05)) + (:scale-x (meters 7)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 8)) + (:r 64.0 64.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 32.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1657 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:y (meters 6)) + (:z (meters -0.05)) + (:scale-x (meters 5)) + (:rot-x (degrees -90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 0.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1655 + :init-specs ((:texture (burning-bush-off desert-sprite)) + (:num 1.0) + (:y (meters 6)) + (:z (meters 0.02)) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/wascitya-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wascitya-obs_REF.gc new file mode 100644 index 0000000000..d63a5b18a3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/wascitya-obs_REF.gc @@ -0,0 +1,154 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-stad-door wascity-stad-door wascity-stad-door-lod0-jg wascity-stad-door-idle-ja + ((wascity-stad-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 20) + ) + +;; definition of type wascity-stad-door +(deftype wascity-stad-door (com-airlock) + () + ) + +;; definition for method 3 of type wascity-stad-door +(defmethod inspect ((this wascity-stad-door)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type wascity-stad-door +(defmethod init-from-entity! ((this wascity-stad-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 61440.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-11 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-stad-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-open-stop) (static-sound-spec "ver-open-hit" :group 1)) + (set! (-> this sound-close-loop) (static-sound-spec "ver-open" :group 1)) + (set! (-> this sound-close-stop) (static-sound-spec "air-ver-cls-hit" :group 1)) + (set! (-> this sound-behind?) #t) + (set! (-> this allow-pilot?) #t) + (go (method-of-object this close) #t) + ) + +;; definition of type waspala-elevator +(deftype waspala-elevator (elevator) + () + ) + +;; definition for method 3 of type waspala-elevator +(defmethod inspect ((this waspala-elevator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-waspala-elevator waspala-elevator waspala-elevator-lod0-jg waspala-elevator-idle-ja + ((waspala-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 20 0 30) + ) + +;; definition for method 47 of type waspala-elevator +(defmethod elevator-method-47 ((this waspala-elevator)) + (if *target* + (< (vector-vector-xz-distance (target-pos 0) (-> this root trans)) + (* 0.4 (-> this root root-prim prim-core world-sphere w)) + ) + #f + ) + ) + +;; definition for method 31 of type waspala-elevator +(defmethod get-art-group ((this waspala-elevator)) + (art-group-get-by-name *level* "skel-waspala-elevator" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type waspala-elevator +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this waspala-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec camera-blocker pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 8192.0 0.0 40960.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! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 34 of type waspala-elevator +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this waspala-elevator)) + (set! (-> this sound-running-loop) (static-sound-spec "palacelev-loop" :group 1)) + (set! (-> this sound-arrived) (static-sound-spec "palacelev-stop" :group 1)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc new file mode 100644 index 0000000000..a3105055b7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc @@ -0,0 +1,1167 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type wascity-windmill +(deftype wascity-windmill (process-drawable) + ((quat quaternion :inline) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type wascity-windmill +(defmethod inspect ((this wascity-windmill)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tquat: #~%" (-> this quat)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-windmill wascity-windmill wascity-windmill-lod0-jg wascity-windmill-idle-ja + ((wascity-windmill-lod0-mg (meters 20)) (wascity-windmill-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 20) + ) + +;; failed to figure out what this is: +(defstate idle (wascity-windmill) + :virtual #t + :trans (behavior () + (quaternion-rotate-local-y! + (-> self root quat) + (-> self quat) + (lerp-scale -16384.0 16384.0 (sin (* 5.0 (the float (current-time)))) -1.0 1.0) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for function wascity-windmill-callback +;; WARN: Return type mismatch int vs none. +(defun wascity-windmill-callback ((arg0 cspace) (arg1 transformq)) + (quaternion-rotate-local-z! (-> arg1 quat) (-> arg1 quat) (* 109.22667 (the float (current-time)))) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +;; definition for method 11 of type wascity-windmill +(defmethod init-from-entity! ((this wascity-windmill) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-windmill" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (quaternion-copy! (-> this quat) (-> this root quat)) + (let ((a0-7 (-> this node-list data 4))) + (set! (-> a0-7 param0) wascity-windmill-callback) + (set! (-> a0-7 param1) this) + (set! (-> a0-7 param2) (the-as basic 0)) + ) + (go (method-of-object this idle)) + ) + +;; definition of type wascity-flag-base +(deftype wascity-flag-base (process-drawable) + () + (:state-methods + idle + ) + (:methods + (wascity-flag-base-method-21 (_type_) none) + (wascity-flag-base-method-22 (_type_) none) + ) + ) + +;; definition for method 3 of type wascity-flag-base +(defmethod inspect ((this wascity-flag-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (wascity-flag-base) + :virtual #t + :enter (behavior () + (ja :num-func num-func-identity :frame-num (the float (rand-vu-int-count (ja-num-frames 0)))) + ) + :trans (behavior () + (ja :num! (loop!)) + (if (ja-done? 0) + (wascity-flag-base-method-22 self) + ) + ) + :code sleep-code + :post ja-post + ) + +;; definition for method 22 of type wascity-flag-base +;; WARN: Return type mismatch int vs none. +(defmethod wascity-flag-base-method-22 ((this wascity-flag-base)) + 0 + (none) + ) + +;; definition for method 11 of type wascity-flag-base +(defmethod init-from-entity! ((this wascity-flag-base) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (wascity-flag-base-method-21 this)) (the-as pair 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) + ) + +;; definition of type wascity-flag-a +(deftype wascity-flag-a (wascity-flag-base) + () + ) + +;; definition for method 3 of type wascity-flag-a +(defmethod inspect ((this wascity-flag-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wascity-flag-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-flag-a wascity-flag-a wascity-flag-a-lod0-jg wascity-flag-a-flap-ja + ((wascity-flag-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 12) + ) + +;; definition for method 21 of type wascity-flag-a +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-a)) + (art-group-get-by-name *level* "skel-wascity-flag-a" (the-as (pointer level) #f)) + (none) + ) + +;; definition of type wascity-flag-b +(deftype wascity-flag-b (wascity-flag-base) + () + ) + +;; definition for method 3 of type wascity-flag-b +(defmethod inspect ((this wascity-flag-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wascity-flag-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-flag-b wascity-flag-b wascity-flag-b-lod0-jg wascity-flag-b-flap-ja + ((wascity-flag-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6 0 12) + ) + +;; definition for method 21 of type wascity-flag-b +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-b)) + (art-group-get-by-name *level* "skel-wascity-flag-b" (the-as (pointer level) #f)) + (none) + ) + +;; definition of type wascity-flag-c +(deftype wascity-flag-c (wascity-flag-base) + () + ) + +;; definition for method 3 of type wascity-flag-c +(defmethod inspect ((this wascity-flag-c)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wascity-flag-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-flag-c wascity-flag-c wascity-flag-c-lod0-jg wascity-flag-c-flap-ja + ((wascity-flag-c-lod0-mg (meters 999999))) + :bounds (static-spherem 0 7 0 10) + ) + +;; definition for method 21 of type wascity-flag-c +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-c)) + (art-group-get-by-name *level* "skel-wascity-flag-c" (the-as (pointer level) #f)) + (none) + ) + +;; definition of type wascity-flag-d +(deftype wascity-flag-d (wascity-flag-base) + () + ) + +;; definition for method 3 of type wascity-flag-d +(defmethod inspect ((this wascity-flag-d)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type wascity-flag-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-flag-d wascity-flag-d wascity-flag-d-lod0-jg wascity-flag-d-flap-ja + ((wascity-flag-d-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; definition for method 21 of type wascity-flag-d +;; WARN: Return type mismatch art-group vs none. +(defmethod wascity-flag-base-method-21 ((this wascity-flag-d)) + (art-group-get-by-name *level* "skel-wascity-flag-d" (the-as (pointer level) #f)) + (none) + ) + +;; definition of type wascity-wind-fan +(deftype wascity-wind-fan (process-drawable) + ((quat quaternion :inline) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type wascity-wind-fan +(defmethod inspect ((this wascity-wind-fan)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tquat: #~%" (-> this quat)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-wind-fan wascity-wind-fan wascity-wind-fan-lod0-jg wascity-wind-fan-idle-ja + ((wascity-wind-fan-lod0-mg (meters 20)) (wascity-wind-fan-lod1-mg (meters 999999))) + :bounds (static-spherem 0 5 0 15) + ) + +;; failed to figure out what this is: +(defstate idle (wascity-wind-fan) + :virtual #t + :trans (behavior () + (quaternion-rotate-local-y! (-> self root quat) (-> self quat) (* 18.204445 (the float (current-time)))) + ) + :code (behavior () + (ja :group! wascity-wind-fan-idle-ja :num! none :frame-num 0.0) + (sleep-code) + ) + :post ja-post + ) + +;; definition for method 11 of type wascity-wind-fan +(defmethod init-from-entity! ((this wascity-wind-fan) (arg0 entity-actor)) + (ctywide-entity-hack) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-wind-fan" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (quaternion-copy! (-> this quat) (-> this root quat)) + (go (method-of-object this idle)) + ) + +;; definition of type shaker +(deftype shaker (structure) + ((axis vector :inline) + (start-time time-frame) + (decay-time float) + (amplitude float) + (freq float) + (y-decay-time float) + (y-amplitude float) + (y-freq float) + (shake float) + (y-shake float) + ) + (:methods + (shaker-method-9 (_type_) none) + ) + ) + +;; definition for method 3 of type shaker +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this shaker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'shaker) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tdecay-time: ~f~%" (-> this decay-time)) + (format #t "~1Tamplitude: ~f~%" (-> this amplitude)) + (format #t "~1Tfreq: ~f~%" (-> this freq)) + (format #t "~1Ty-decay-time: ~f~%" (-> this y-decay-time)) + (format #t "~1Ty-amplitude: ~f~%" (-> this y-amplitude)) + (format #t "~1Ty-freq: ~f~%" (-> this y-freq)) + (format #t "~1Tshake: ~f~%" (-> this shake)) + (format #t "~1Ty-shake: ~f~%" (-> this y-shake)) + (label cfg-4) + this + ) + +;; definition for method 9 of type shaker +;; INFO: this function exists in multiple non-identical object files +;; WARN: Return type mismatch float vs none. +(defmethod shaker-method-9 ((this shaker)) + (let ((s5-0 (- (current-time) (-> this start-time)))) + (set! (-> this shake) (* (-> this amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this freq)))) + ) + ) + (set! (-> this y-shake) (* (-> this y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this y-freq)))) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-cactus wascity-cactus wascity-cactus-lod0-jg wascity-cactus-idle-ja + ((wascity-cactus-lod0-mg (meters 999999))) + :bounds (static-spherem 0 4 0 7) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-cactus-explode wascity-cactus wascity-cactus-explode-lod0-jg wascity-cactus-explode-idle-ja + ((wascity-cactus-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 80) + ) + +;; definition for symbol *wascity-cactus-exploder-params*, type joint-exploder-static-params +(define *wascity-cactus-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition of type wascity-cactus +(deftype wascity-cactus (process-focusable) + ((shakers shaker 6 :inline) + (incoming-attack-id uint32) + (incoming-attack-time time-frame) + (hit-points float) + ) + (:state-methods + idle + die + ) + (:methods + (wascity-cactus-method-30 (_type_) none) + (wascity-cactus-method-31 (_type_) none) + ) + ) + +;; definition for method 3 of type wascity-cactus +(defmethod inspect ((this wascity-cactus)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tshakers[6] @ #x~X~%" (-> this shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tincoming-attack-time: ~D~%" (-> this incoming-attack-time)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (label cfg-4) + this + ) + +;; definition for function wascity-cactus-callback +;; WARN: Return type mismatch int vs none. +(defun wascity-cactus-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (-> arg0 param1)) + (s3-0 (the-as object (-> arg0 param2))) + ) + (quaternion*! + (-> arg1 quat) + (-> arg1 quat) + (quaternion-vector-angle! + (the-as quaternion (new 'stack-no-clear 'vector)) + (the-as vector (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0))) + (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) shake) + ) + ) + (quaternion-rotate-local-y! + (-> arg1 quat) + (-> arg1 quat) + (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) y-shake) + ) + (if (< (the int (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) decay-time)) + (- (current-time) (-> (the-as wascity-cactus s4-0) shakers (the-as int s3-0) start-time)) + ) + (set! (-> arg0 param0) #f) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate die (wascity-cactus) + :virtual #t + :enter #f + :exit #f + :trans #f + :code (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) 0 #t) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post #f + ) + +;; failed to figure out what this is: +(defstate idle (wascity-cactus) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((a1-1 (the-as object (-> block param 1))) + (a0-2 proc) + ) + (when (and (!= (-> (the-as attack-info a1-1) id) (-> self incoming-attack-id)) + (!= (-> (the-as attack-info a1-1) mode) 'flut) + ) + (set! (-> self incoming-attack-id) (-> (the-as attack-info a1-1) id)) + (when a0-2 + (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info a1-1)))) + (when s5-0 + (let ((a0-4 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block))) + (cond + ((and (not (logtest? (penetrate dark-skin) a0-4)) + (= (pu->knocked-type a0-4) (knocked-type none)) + (< 0.0 (-> self hit-points)) + ) + (if (not (time-elapsed? (-> self incoming-attack-time) (seconds 0.6))) + (return #f) + ) + (sound-play "cactus-hit") + (seek! (-> self hit-points) 0.0 0.1) + (set-time! (-> self incoming-attack-time)) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (vector-inv-orient-by-quat! + gp-2 + (vector-cross! + (new 'stack-no-clear 'vector) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root trans) (-> self root trans)) 1.0) + *up-vector* + ) + (-> self root quat) + ) + (let ((v1-20 (-> self shakers))) + (set! (-> v1-20 0 axis quad) (-> gp-2 quad)) + (set-time! (-> v1-20 0 start-time)) + (set! (-> v1-20 0 decay-time) 300.0) + (set! (-> v1-20 0 freq) 150.0) + (set! (-> v1-20 0 amplitude) 1820.4445) + (set! (-> v1-20 0 y-amplitude) 0.0) + ) + (let ((a0-19 (joint-node wascity-cactus-lod0-jg main))) + (set! (-> a0-19 param0) wascity-cactus-callback) + (set! (-> a0-19 param1) self) + (set! (-> a0-19 param2) (the-as basic 0)) + ) + (let ((v1-23 (-> self shakers 1))) + (set! (-> v1-23 axis quad) (-> gp-2 quad)) + (set! (-> v1-23 start-time) (+ (current-time) (seconds -0.06))) + (set! (-> v1-23 decay-time) 600.0) + (set! (-> v1-23 freq) 150.0) + (set! (-> v1-23 amplitude) 364.0889) + (set! (-> v1-23 y-amplitude) 0.0) + (set! (-> v1-23 y-decay-time) 450.0) + (set! (-> v1-23 y-freq) 150.0) + (set! (-> v1-23 y-amplitude) 3640.889) + ) + (let ((v1-25 (joint-node wascity-cactus-lod0-jg a))) + (set! (-> v1-25 param0) wascity-cactus-callback) + (set! (-> v1-25 param1) self) + (set! (-> v1-25 param2) (the-as basic 1)) + ) + (let ((v1-26 (-> self shakers 2))) + (set! (-> v1-26 axis quad) (-> gp-2 quad)) + (set! (-> v1-26 start-time) (+ (current-time) (seconds -0.2))) + (set! (-> v1-26 decay-time) 600.0) + (set! (-> v1-26 freq) 150.0) + (set! (-> v1-26 amplitude) 364.0889) + (set! (-> v1-26 y-decay-time) 450.0) + (set! (-> v1-26 y-freq) 150.0) + (set! (-> v1-26 y-amplitude) 3640.889) + ) + (let ((v1-28 (joint-node wascity-cactus-lod0-jg b))) + (set! (-> v1-28 param0) wascity-cactus-callback) + (set! (-> v1-28 param1) self) + (set! (-> v1-28 param2) (the-as basic 2)) + ) + (let ((v1-29 (-> self shakers 3))) + (set! (-> v1-29 axis quad) (-> gp-2 quad)) + (set! (-> v1-29 start-time) (+ (current-time) (seconds -0.2))) + (set! (-> v1-29 decay-time) 600.0) + (set! (-> v1-29 freq) 150.0) + (set! (-> v1-29 amplitude) 364.0889) + (set! (-> v1-29 y-decay-time) 450.0) + (set! (-> v1-29 y-freq) 150.0) + (set! (-> v1-29 y-amplitude) 3640.889) + ) + (let ((v1-31 (joint-node wascity-cactus-lod0-jg c))) + (set! (-> v1-31 param0) wascity-cactus-callback) + (set! (-> v1-31 param1) self) + (set! (-> v1-31 param2) (the-as basic 2)) + ) + (let ((v1-32 (-> self shakers 4))) + (set! (-> v1-32 axis quad) (-> gp-2 quad)) + (set! (-> v1-32 start-time) (+ (current-time) (seconds -0.2))) + (set! (-> v1-32 decay-time) 600.0) + (set! (-> v1-32 freq) 150.0) + (set! (-> v1-32 amplitude) 364.0889) + (set! (-> v1-32 y-decay-time) 450.0) + (set! (-> v1-32 y-freq) 150.0) + (set! (-> v1-32 y-amplitude) 3640.889) + ) + (let ((v1-34 (joint-node wascity-cactus-lod0-jg d))) + (set! (-> v1-34 param0) wascity-cactus-callback) + (set! (-> v1-34 param1) self) + (set! (-> v1-34 param2) (the-as basic 2)) + ) + (let ((v1-35 (-> self shakers 5))) + (set! (-> v1-35 axis quad) (-> gp-2 quad)) + (set! (-> v1-35 start-time) (+ (current-time) (seconds -0.4))) + (set! (-> v1-35 decay-time) 600.0) + (set! (-> v1-35 freq) 150.0) + (set! (-> v1-35 amplitude) 364.0889) + (set! (-> v1-35 y-decay-time) 450.0) + (set! (-> v1-35 y-freq) 150.0) + (set! (-> v1-35 y-amplitude) 3640.889) + ) + ) + (let ((v0-0 (the-as object (joint-node wascity-cactus-lod0-jg e)))) + (set! (-> (the-as cspace v0-0) param0) wascity-cactus-callback) + (set! (-> (the-as cspace v0-0) param1) self) + (set! (-> (the-as cspace v0-0) param2) (the-as basic 2)) + v0-0 + ) + ) + (else + (sound-play "cactus-burst") + (let ((gp-4 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (set! (-> gp-4 fountain-rand-transv-lo quad) (-> s5-0 root trans quad)) + (set! (-> gp-4 fountain-rand-transv-hi x) 4096.0) + (set! (-> gp-4 fountain-rand-transv-hi y) 122880.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-wascity-cactus-explode" (the-as (pointer level) #f)) + 7 + gp-4 + *wascity-cactus-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :exit #f + :code sleep-code + :post (behavior () + (dotimes (gp-0 6) + (shaker-method-9 (-> self shakers gp-0)) + ) + (transform-post) + ) + ) + +;; definition for method 30 of type wascity-cactus +;; WARN: Return type mismatch int vs none. +(defmethod wascity-cactus-method-30 ((this wascity-cactus)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (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 ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 16384.0 0.0 28672.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 31 of type wascity-cactus +;; WARN: Return type mismatch int vs none. +(defmethod wascity-cactus-method-31 ((this wascity-cactus)) + (logior! (-> this mask) (process-mask crate)) + 0 + (none) + ) + +;; definition for method 11 of type wascity-cactus +(defmethod init-from-entity! ((this wascity-cactus) (arg0 entity-actor)) + (ctywide-entity-hack) + (wascity-cactus-method-30 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-cactus" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (wascity-cactus-method-31 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type none) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> this hit-points) 1.0) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (let ((f0-4 (rand-vu-float-range 0.9 1.1))) + (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) + ) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition of type wascity-market-crate +(deftype wascity-market-crate (market-crate) + () + ) + +;; definition for method 3 of type wascity-market-crate +(defmethod inspect ((this wascity-market-crate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-crate inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type wascity-market-basket-a +(deftype wascity-market-basket-a (market-basket-a) + () + ) + +;; definition for method 3 of type wascity-market-basket-a +(defmethod inspect ((this wascity-market-basket-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-basket-a inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type wascity-market-basket-b +(deftype wascity-market-basket-b (market-basket-b) + () + ) + +;; definition for method 3 of type wascity-market-basket-b +(defmethod inspect ((this wascity-market-basket-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-basket-b inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type wascity-market-sack-a +(deftype wascity-market-sack-a (market-sack-a) + () + ) + +;; definition for method 3 of type wascity-market-sack-a +(defmethod inspect ((this wascity-market-sack-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-sack-a inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type wascity-market-sack-b +(deftype wascity-market-sack-b (market-sack-b) + () + ) + +;; definition for method 3 of type wascity-market-sack-b +(defmethod inspect ((this wascity-market-sack-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type market-sack-b inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type wascity-fruit-stand +(deftype wascity-fruit-stand (fruit-stand) + () + ) + +;; definition for method 3 of type wascity-fruit-stand +(defmethod inspect ((this wascity-fruit-stand)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type fruit-stand inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type wascity-water-pump +(deftype wascity-water-pump (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type wascity-water-pump +(defmethod inspect ((this wascity-water-pump)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-water-pump wascity-water-pump wascity-water-pump-lod0-jg wascity-water-pump-idle-ja + ((wascity-water-pump-lod0-mg (meters 20)) (wascity-water-pump-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; failed to figure out what this is: +(defstate idle (wascity-water-pump) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type wascity-water-pump +(defmethod init-from-entity! ((this wascity-water-pump) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid rideable no-standon)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 49152.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-8 transform-index) 6) + (set-vector! (-> v1-8 local-sphere) 10240.0 0.0 8192.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 1)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-10 transform-index) 8) + (set-vector! (-> v1-10 local-sphere) -8192.0 0.0 0.0 12288.0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 1)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-12 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-12 prim-core action) (collide-action solid rideable)) + (set! (-> v1-12 transform-index) 3) + (set-vector! (-> v1-12 local-sphere) 0.0 0.0 0.0 49152.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-15 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-water-pump" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-awning-a wascity-awning-a wascity-awning-a-lod0-jg wascity-awning-a-idle-ja + ((wascity-awning-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 -2.5 5 10) + ) + +;; definition of type wascity-awning-a +(deftype wascity-awning-a (bouncer) + () + ) + +;; definition for method 3 of type wascity-awning-a +(defmethod inspect ((this wascity-awning-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bouncer inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 25 of type wascity-awning-a +;; WARN: Return type mismatch int vs none. +(defmethod play-sound ((this wascity-awning-a)) + (sound-play "tarp-bounce") + 0 + (none) + ) + +;; definition for method 26 of type wascity-awning-a +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-26 ((this wascity-awning-a)) + (sound-play "bounce-whoosh") + 0 + (none) + ) + +;; definition for method 23 of type wascity-awning-a +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-23 ((this wascity-awning-a)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +;; definition for method 24 of type wascity-awning-a +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-24 ((this wascity-awning-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 -16384.0 16384.0 32768.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-awning-b wascity-awning-b wascity-awning-b-lod0-jg wascity-awning-b-idle-ja + ((wascity-awning-b-lod0-mg (meters 20)) (wascity-awning-b-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; definition of type wascity-awning-b +(deftype wascity-awning-b (bouncer) + () + ) + +;; definition for method 3 of type wascity-awning-b +(defmethod inspect ((this wascity-awning-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bouncer inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 25 of type wascity-awning-b +;; WARN: Return type mismatch int vs none. +(defmethod play-sound ((this wascity-awning-b)) + (sound-play "tarp-bounce") + 0 + (none) + ) + +;; definition for method 26 of type wascity-awning-b +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-26 ((this wascity-awning-b)) + (sound-play "bounce-whoosh") + 0 + (none) + ) + +;; definition for method 23 of type wascity-awning-b +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-23 ((this wascity-awning-b)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-wascity-awning-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +;; definition for method 24 of type wascity-awning-b +;; WARN: Return type mismatch int vs none. +(defmethod bouncer-method-24 ((this wascity-awning-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-monk-npc monk monk-lod0-jg monk-standing-idle-1-ja + ((monk-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0.2 0 1.6) + :shadow monk-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +;; definition of type monk-npc +(deftype monk-npc (process-taskable) + () + ) + +;; definition for method 3 of type monk-npc +(defmethod inspect ((this monk-npc)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 35 of type monk-npc +;; WARN: Return type mismatch int vs none. +(defmethod init-skeleton! ((this monk-npc)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-monk-npc" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (let* ((v1-8 (mod + (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + 6 + ) + ) + (s5-1 (cond + ((zero? v1-8) + 4171 + ) + ((= v1-8 1) + 8357 + ) + ((= v1-8 2) + #x4113 + ) + ((= v1-8 3) + #x8225 + ) + ((= v1-8 4) + #x10407 + ) + ((= v1-8 5) + #x20825 + ) + ) + ) + ) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) s5-1 0) + ) + 0 + (none) + ) + +;; definition for method 37 of type monk-npc +(defmethod get-art-element ((this monk-npc)) + (if (not (logtest? (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + 1 + ) + ) + (-> this draw art-group data 9) + (-> this draw art-group data 10) + ) + ) + + + + diff --git a/test/offline/config/jak3/config.jsonc b/test/offline/config/jak3/config.jsonc index a40f544241..cbe90aeb7d 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -5,7 +5,16 @@ "DGO/HALFPIPE.DGO", "DGO/PRECC.DGO", "DGO/LMECH.DGO", - "DGO/WWD.DGO" + "DGO/WWD.DGO", + "DGO/MIA.DGO", + "DGO/MIC.DGO", + "DGO/WCA.DGO", + "DGO/FRSTA.DGO", + "DGO/TEMA.DGO", + "DGO/MINED.DGO", + "DGO/SEA.DGO", + "DGO/WASALL.DGO", + "DGO/DESRALLY.DGO" ], "skip_compile_files": [ @@ -179,11 +188,34 @@ // mood "update-mood-direction", // eyes - "debug-eyes" + "debug-eyes", + // nav-mesh + "(method 36 nav-mesh)", + "(method 45 nav-mesh)", + "(method 46 nav-mesh)", + // minimap + "(method 20 minimap)", + "(method 18 minimap)", + "(method 16 minimap)", + // merc-blend-shape + "setup-blerc-chains", + // prebot + "prebot-spawn-shockwave", + // saberfish + "(method 238 saberfish)", + // sew-laser-turret + "(method 161 sew-laser-turret)", + // path + "(method 28 path-control)", + // squad-control + "(method 17 squad-control)", + // pilot-states + "target-pilot-trans" ], "skip_compile_states": { "(target-flut-kanga-catch target)": ["post", "code"], // setting pp - "(target-flut-death target)": ["code"] + "(target-flut-death target)": ["code"], // temporary until (anon-function 20 target-flut) is fixed + "(hostile kg-hopper)": ["trans"] // adds b! but the corresponding label is missing } }